OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/plugin_dispatcher.h" | 5 #include "ppapi/proxy/plugin_dispatcher.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return found->second; | 101 return found->second; |
102 } | 102 } |
103 | 103 |
104 // static | 104 // static |
105 PluginDispatcher* PluginDispatcher::GetForResource(const Resource* resource) { | 105 PluginDispatcher* PluginDispatcher::GetForResource(const Resource* resource) { |
106 return GetForInstance(resource->pp_instance()); | 106 return GetForInstance(resource->pp_instance()); |
107 } | 107 } |
108 | 108 |
109 // static | 109 // static |
110 const void* PluginDispatcher::GetBrowserInterface(const char* interface_name) { | 110 const void* PluginDispatcher::GetBrowserInterface(const char* interface_name) { |
111 if (!interface_name) { | 111 // CAUTION: This function is called directly from the plugin, but we *don't* |
112 DLOG(WARNING) << "|interface_name| is null. Did you forget to add " | 112 // lock the ProxyLock to avoid excessive locking from C++ wrappers. |
113 "the |interface_name()| template function to the interface's C++ " | |
114 "wrapper?"; | |
115 return NULL; | |
116 } | |
117 | |
118 return InterfaceList::GetInstance()->GetInterfaceForPPB(interface_name); | 113 return InterfaceList::GetInstance()->GetInterfaceForPPB(interface_name); |
119 } | 114 } |
120 | 115 |
121 // static | 116 // static |
122 void PluginDispatcher::LogWithSource(PP_Instance instance, | 117 void PluginDispatcher::LogWithSource(PP_Instance instance, |
123 PP_LogLevel level, | 118 PP_LogLevel level, |
124 const std::string& source, | 119 const std::string& source, |
125 const std::string& value) { | 120 const std::string& value) { |
126 if (!g_live_dispatchers || !g_instance_to_dispatcher) | 121 if (!g_live_dispatchers || !g_instance_to_dispatcher) |
127 return; | 122 return; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // once they're set. The user will have to restart to get new font prefs | 320 // once they're set. The user will have to restart to get new font prefs |
326 // propogated to plugins. | 321 // propogated to plugins. |
327 if (!received_preferences_) { | 322 if (!received_preferences_) { |
328 received_preferences_ = true; | 323 received_preferences_ = true; |
329 preferences_ = prefs; | 324 preferences_ = prefs; |
330 } | 325 } |
331 } | 326 } |
332 | 327 |
333 } // namespace proxy | 328 } // namespace proxy |
334 } // namespace ppapi | 329 } // namespace ppapi |
OLD | NEW |