You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chromium/chromium-83-WebUI-fix-templ...

68 lines
1.8 KiB

4 years ago
From aa4ba19043db1f41bb0982d4b50f4f00151930f4 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Tue, 26 May 2020 15:29:49 +0000
Subject: [PATCH] GCC: fix template specialization in content::WebUI
GCC complains that explicit specialization in non-namespace scope
is happening for GetValue. Move the methods outside
the class definition.
Bug: 819294
Change-Id: I109472a0b6fa7ddab3529bc92bba680252b40f67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128307
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771818}
---
5 years ago
diff --git a/content/public/browser/web_ui.h b/content/public/browser/web_ui.h
index 4e6aa0e..fa6f10c 100644
--- a/content/public/browser/web_ui.h
+++ b/content/public/browser/web_ui.h
4 years ago
@@ -138,22 +138,6 @@
5 years ago
template <typename T>
static T GetValue(const base::Value& value);
- template <>
- inline bool GetValue<bool>(const base::Value& value) {
- return value.GetBool();
- }
-
- template <>
- inline int GetValue<int>(const base::Value& value) {
- return value.GetInt();
- }
-
- template <>
- inline const std::string& GetValue<const std::string&>(
- const base::Value& value) {
- return value.GetString();
- }
-
template <typename Is, typename... Args>
struct Call;
4 years ago
@@ -169,6 +153,22 @@
5 years ago
};
};
+template <>
+inline bool WebUI::GetValue<bool>(const base::Value& value) {
+ return value.GetBool();
+}
+
+template <>
+inline int WebUI::GetValue<int>(const base::Value& value) {
+ return value.GetInt();
+}
+
+template <>
+inline const std::string& WebUI::GetValue<const std::string&>(
+ const base::Value& value) {
+ return value.GetString();
+}
+
} // namespace content
#endif // CONTENT_PUBLIC_BROWSER_WEB_UI_H_