[ppapi] Renamed two global variables and types in ppapi/proxy

In jumbo build experiments, the different
InstanceToDispatcherMap types and g_instance_to_dispatcher
globals ended up in the same translation unit and thus the same
anonymous namespace where the symbols clashed. This just renames
them as Dispatcher -> PluginDispatcher/HostDispatcher.

Bug: 898475
Change-Id: Ieae4310fdbe7ea27954011964d2bb6fa4d83e338
Reviewed-on: https://chromium-review.googlesource.com/c/1297145
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602647}
diff --git a/ppapi/proxy/host_dispatcher.cc b/ppapi/proxy/host_dispatcher.cc
index a5fdfca..3eb4b87 100644
--- a/ppapi/proxy/host_dispatcher.cc
+++ b/ppapi/proxy/host_dispatcher.cc
@@ -21,8 +21,8 @@
 
 namespace {
 
-typedef std::map<PP_Instance, HostDispatcher*> InstanceToDispatcherMap;
-InstanceToDispatcherMap* g_instance_to_dispatcher = NULL;
+typedef std::map<PP_Instance, HostDispatcher*> InstanceToHostDispatcherMap;
+InstanceToHostDispatcherMap* g_instance_to_host_dispatcher = NULL;
 
 typedef std::map<PP_Module, HostDispatcher*> ModuleToDispatcherMap;
 ModuleToDispatcherMap* g_module_to_dispatcher = NULL;
@@ -101,11 +101,11 @@
 
 // static
 HostDispatcher* HostDispatcher::GetForInstance(PP_Instance instance) {
-  if (!g_instance_to_dispatcher)
+  if (!g_instance_to_host_dispatcher)
     return NULL;
-  InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find(
-      instance);
-  if (found == g_instance_to_dispatcher->end())
+  InstanceToHostDispatcherMap::iterator found =
+      g_instance_to_host_dispatcher->find(instance);
+  if (found == g_instance_to_host_dispatcher->end())
     return NULL;
   return found->second;
 }
@@ -113,19 +113,19 @@
 // static
 void HostDispatcher::SetForInstance(PP_Instance instance,
                                     HostDispatcher* dispatcher) {
-  if (!g_instance_to_dispatcher)
-    g_instance_to_dispatcher = new InstanceToDispatcherMap;
-  (*g_instance_to_dispatcher)[instance] = dispatcher;
+  if (!g_instance_to_host_dispatcher)
+    g_instance_to_host_dispatcher = new InstanceToHostDispatcherMap;
+  (*g_instance_to_host_dispatcher)[instance] = dispatcher;
 }
 
 // static
 void HostDispatcher::RemoveForInstance(PP_Instance instance) {
-  if (!g_instance_to_dispatcher)
+  if (!g_instance_to_host_dispatcher)
     return;
-  InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find(
-      instance);
-  if (found != g_instance_to_dispatcher->end())
-    g_instance_to_dispatcher->erase(found);
+  InstanceToHostDispatcherMap::iterator found =
+      g_instance_to_host_dispatcher->find(instance);
+  if (found != g_instance_to_host_dispatcher->end())
+    g_instance_to_host_dispatcher->erase(found);
 }
 
 bool HostDispatcher::IsPlugin() const {
diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc
index 6bc240d..67c9c3b 100644
--- a/ppapi/proxy/plugin_dispatcher.cc
+++ b/ppapi/proxy/plugin_dispatcher.cc
@@ -41,8 +41,8 @@
 
 namespace {
 
-typedef std::map<PP_Instance, PluginDispatcher*> InstanceToDispatcherMap;
-InstanceToDispatcherMap* g_instance_to_dispatcher = NULL;
+typedef std::map<PP_Instance, PluginDispatcher*> InstanceToPluginDispatcherMap;
+InstanceToPluginDispatcherMap* g_instance_to_plugin_dispatcher = NULL;
 
 typedef std::set<PluginDispatcher*> DispatcherSet;
 DispatcherSet* g_live_dispatchers = NULL;
@@ -152,11 +152,11 @@
 
 // static
 PluginDispatcher* PluginDispatcher::GetForInstance(PP_Instance instance) {
-  if (!g_instance_to_dispatcher)
+  if (!g_instance_to_plugin_dispatcher)
     return NULL;
-  InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find(
-      instance);
-  if (found == g_instance_to_dispatcher->end())
+  InstanceToPluginDispatcherMap::iterator found =
+      g_instance_to_plugin_dispatcher->find(instance);
+  if (found == g_instance_to_plugin_dispatcher->end())
     return NULL;
   return found->second;
 }
@@ -178,13 +178,13 @@
                                      PP_LogLevel level,
                                      const std::string& source,
                                      const std::string& value) {
-  if (!g_live_dispatchers || !g_instance_to_dispatcher)
+  if (!g_live_dispatchers || !g_instance_to_plugin_dispatcher)
     return;
 
   if (instance) {
-    InstanceToDispatcherMap::iterator found =
-        g_instance_to_dispatcher->find(instance);
-    if (found != g_instance_to_dispatcher->end()) {
+    InstanceToPluginDispatcherMap::iterator found =
+        g_instance_to_plugin_dispatcher->find(instance);
+    if (found != g_instance_to_plugin_dispatcher->end()) {
       // Send just to this specific dispatcher.
       found->second->Send(new PpapiHostMsg_LogWithSource(
           instance, static_cast<int>(level), source, value));
@@ -283,21 +283,21 @@
 }
 
 void PluginDispatcher::DidCreateInstance(PP_Instance instance) {
-  if (!g_instance_to_dispatcher)
-    g_instance_to_dispatcher = new InstanceToDispatcherMap;
-  (*g_instance_to_dispatcher)[instance] = this;
+  if (!g_instance_to_plugin_dispatcher)
+    g_instance_to_plugin_dispatcher = new InstanceToPluginDispatcherMap;
+  (*g_instance_to_plugin_dispatcher)[instance] = this;
   instance_map_[instance] = std::make_unique<InstanceData>();
 }
 
 void PluginDispatcher::DidDestroyInstance(PP_Instance instance) {
   instance_map_.erase(instance);
 
-  if (g_instance_to_dispatcher) {
-    InstanceToDispatcherMap::iterator found = g_instance_to_dispatcher->find(
-        instance);
-    if (found != g_instance_to_dispatcher->end()) {
+  if (g_instance_to_plugin_dispatcher) {
+    InstanceToPluginDispatcherMap::iterator found =
+        g_instance_to_plugin_dispatcher->find(instance);
+    if (found != g_instance_to_plugin_dispatcher->end()) {
       DCHECK(found->second == this);
-      g_instance_to_dispatcher->erase(found);
+      g_instance_to_plugin_dispatcher->erase(found);
     } else {
       NOTREACHED();
     }
@@ -322,13 +322,13 @@
 }
 
 void PluginDispatcher::ForceFreeAllInstances() {
-  if (!g_instance_to_dispatcher)
+  if (!g_instance_to_plugin_dispatcher)
     return;
 
   // Iterating will remove each item from the map, so we need to make a copy
   // to avoid things changing out from under is.
-  InstanceToDispatcherMap temp_map = *g_instance_to_dispatcher;
-  for (InstanceToDispatcherMap::iterator i = temp_map.begin();
+  InstanceToPluginDispatcherMap temp_map = *g_instance_to_plugin_dispatcher;
+  for (InstanceToPluginDispatcherMap::iterator i = temp_map.begin();
        i != temp_map.end(); ++i) {
     if (i->second == this) {
       // Synthesize an "instance destroyed" message, this will notify the