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