[jumbo] Give two GetDelegate/GetDelegateWrapper methods unique names

In jumbo builds whole chunks of the code is compiled in the same
translation unit, using the same anonymous namespace. If two
files use the same symbol names they will then clash and that
happened in chrome/browser/extensions between
active_tab_permission_granter.cc and extension_tab_util.cc.

This patch renames GetDelegate() and GetDelegateWrapper to include
the more exact names of the Delegate type, making them unique.

Bug: 865947
Change-Id: I46426e8dee715d57acaa3d2385e6dd5b6ac38cf1
Reviewed-on: https://chromium-review.googlesource.com/1219246
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590327}
diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc
index 92e4877c..a636017 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -73,23 +73,25 @@
     tab_process->Send(create_message.Run(false));
 }
 
-std::unique_ptr<ActiveTabPermissionGranter::Delegate>& GetDelegateWrapper() {
+std::unique_ptr<ActiveTabPermissionGranter::Delegate>&
+GetActiveTabPermissionGranterDelegateWrapper() {
   static base::NoDestructor<
       std::unique_ptr<ActiveTabPermissionGranter::Delegate>>
       delegate_wrapper;
   return *delegate_wrapper;
 }
 
-ActiveTabPermissionGranter::Delegate* GetDelegate() {
-  return GetDelegateWrapper().get();
+ActiveTabPermissionGranter::Delegate* GetActiveTabPermissionGranterDelegate() {
+  return GetActiveTabPermissionGranterDelegateWrapper().get();
 }
 
 // Returns true if activeTab is allowed to be granted to the extension. This can
 // return false for platform-specific implementations.
 bool ShouldGrantActiveTabOrPrompt(const Extension* extension,
                                   content::WebContents* web_contents) {
-  return !GetDelegate() ||
-         GetDelegate()->ShouldGrantActiveTabOrPrompt(extension, web_contents);
+  return !GetActiveTabPermissionGranterDelegate() ||
+         GetActiveTabPermissionGranterDelegate()->ShouldGrantActiveTabOrPrompt(
+             extension, web_contents);
 }
 
 }  // namespace
@@ -109,7 +111,7 @@
 // static
 void ActiveTabPermissionGranter::SetPlatformDelegate(
     std::unique_ptr<Delegate> delegate) {
-  GetDelegateWrapper() = std::move(delegate);
+  GetActiveTabPermissionGranterDelegateWrapper() = std::move(delegate);
 }
 
 void ActiveTabPermissionGranter::GrantIfRequested(const Extension* extension) {
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index 476c39c..887f2cad 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -106,14 +106,15 @@
   return SessionTabHelper::IdForTab(web_contents).id();
 }
 
-std::unique_ptr<ExtensionTabUtil::Delegate>& GetDelegateWrapper() {
+std::unique_ptr<ExtensionTabUtil::Delegate>&
+GetExtensionTabUtilDelegateWrapper() {
   static base::NoDestructor<std::unique_ptr<ExtensionTabUtil::Delegate>>
       delegate_wrapper;
   return *delegate_wrapper;
 }
 
-ExtensionTabUtil::Delegate* GetDelegate() {
-  return GetDelegateWrapper().get();
+ExtensionTabUtil::Delegate* GetExtensionTabUtilDelegate() {
+  return GetExtensionTabUtilDelegateWrapper().get();
 }
 
 }  // namespace
@@ -500,7 +501,7 @@
 
 // static
 void ExtensionTabUtil::SetPlatformDelegate(std::unique_ptr<Delegate> delegate) {
-  GetDelegateWrapper() = std::move(delegate);
+  GetExtensionTabUtilDelegateWrapper() = std::move(delegate);
 }
 
 // static
@@ -530,8 +531,10 @@
     tab->title.reset();
     tab->fav_icon_url.reset();
   }
-  if (GetDelegate())
-    GetDelegate()->ScrubTabForExtension(extension, contents, tab);
+  if (GetExtensionTabUtilDelegate()) {
+    GetExtensionTabUtilDelegate()->ScrubTabForExtension(extension, contents,
+                                                        tab);
+  }
 }
 
 bool ExtensionTabUtil::GetTabStripModel(const WebContents* web_contents,