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/logging.h" | 10 #include "base/logging.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 NOTREACHED(); | 239 NOTREACHED(); |
240 } | 240 } |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
244 InstanceData* PluginDispatcher::GetInstanceData(PP_Instance instance) { | 244 InstanceData* PluginDispatcher::GetInstanceData(PP_Instance instance) { |
245 InstanceDataMap::iterator it = instance_map_.find(instance); | 245 InstanceDataMap::iterator it = instance_map_.find(instance); |
246 return (it == instance_map_.end()) ? NULL : &it->second; | 246 return (it == instance_map_.end()) ? NULL : &it->second; |
247 } | 247 } |
248 | 248 |
249 FunctionGroupBase* PluginDispatcher::GetFunctionAPI(ApiID id) { | 249 thunk::PPB_Instance_API* PluginDispatcher::GetInstanceAPI() { |
250 return GetInterfaceProxy(id); | 250 return static_cast<PPB_Instance_Proxy*>( |
| 251 GetInterfaceProxy(API_ID_PPB_INSTANCE)); |
| 252 } |
| 253 |
| 254 thunk::ResourceCreationAPI* PluginDispatcher::GetResourceCreationAPI() { |
| 255 return static_cast<ResourceCreationProxy*>( |
| 256 GetInterfaceProxy(API_ID_RESOURCE_CREATION)); |
251 } | 257 } |
252 | 258 |
253 void PluginDispatcher::ForceFreeAllInstances() { | 259 void PluginDispatcher::ForceFreeAllInstances() { |
254 if (!g_instance_to_dispatcher) | 260 if (!g_instance_to_dispatcher) |
255 return; | 261 return; |
256 | 262 |
257 // Iterating will remove each item from the map, so we need to make a copy | 263 // Iterating will remove each item from the map, so we need to make a copy |
258 // to avoid things changing out from under is. | 264 // to avoid things changing out from under is. |
259 InstanceToDispatcherMap temp_map = *g_instance_to_dispatcher; | 265 InstanceToDispatcherMap temp_map = *g_instance_to_dispatcher; |
260 for (InstanceToDispatcherMap::iterator i = temp_map.begin(); | 266 for (InstanceToDispatcherMap::iterator i = temp_map.begin(); |
(...skipping 30 matching lines...) Expand all Loading... |
291 // once they're set. The user will have to restart to get new font prefs | 297 // once they're set. The user will have to restart to get new font prefs |
292 // propogated to plugins. | 298 // propogated to plugins. |
293 if (!received_preferences_) { | 299 if (!received_preferences_) { |
294 received_preferences_ = true; | 300 received_preferences_ = true; |
295 preferences_ = prefs; | 301 preferences_ = prefs; |
296 } | 302 } |
297 } | 303 } |
298 | 304 |
299 } // namespace proxy | 305 } // namespace proxy |
300 } // namespace ppapi | 306 } // namespace ppapi |
OLD | NEW |