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 // CAUTION: This function is called directly from the plugin, but we *don't* | 111 if (!interface_name) { |
112 // lock the ProxyLock to avoid excessive locking from C++ wrappers. | 112 DLOG(WARNING) << "|interface_name| is null. Did you forget to add " |
| 113 "the |interface_name()| template function to the interface's C++ " |
| 114 "wrapper?"; |
| 115 return NULL; |
| 116 } |
| 117 |
113 return InterfaceList::GetInstance()->GetInterfaceForPPB(interface_name); | 118 return InterfaceList::GetInstance()->GetInterfaceForPPB(interface_name); |
114 } | 119 } |
115 | 120 |
116 // static | 121 // static |
117 void PluginDispatcher::LogWithSource(PP_Instance instance, | 122 void PluginDispatcher::LogWithSource(PP_Instance instance, |
118 PP_LogLevel level, | 123 PP_LogLevel level, |
119 const std::string& source, | 124 const std::string& source, |
120 const std::string& value) { | 125 const std::string& value) { |
121 if (!g_live_dispatchers || !g_instance_to_dispatcher) | 126 if (!g_live_dispatchers || !g_instance_to_dispatcher) |
122 return; | 127 return; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // once they're set. The user will have to restart to get new font prefs | 325 // once they're set. The user will have to restart to get new font prefs |
321 // propogated to plugins. | 326 // propogated to plugins. |
322 if (!received_preferences_) { | 327 if (!received_preferences_) { |
323 received_preferences_ = true; | 328 received_preferences_ = true; |
324 preferences_ = prefs; | 329 preferences_ = prefs; |
325 } | 330 } |
326 } | 331 } |
327 | 332 |
328 } // namespace proxy | 333 } // namespace proxy |
329 } // namespace ppapi | 334 } // namespace ppapi |
OLD | NEW |