| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/host_dispatcher.h" | 5 #include "ppapi/proxy/host_dispatcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 const void* HostDispatcher::GetProxiedInterface(const std::string& interface) { | 204 const void* HostDispatcher::GetProxiedInterface(const std::string& interface) { |
| 205 // First see if we even have a proxy for this interface. | 205 // First see if we even have a proxy for this interface. |
| 206 const InterfaceProxy::Info* info = GetPPPInterfaceInfo(interface); | 206 const InterfaceProxy::Info* info = GetPPPInterfaceInfo(interface); |
| 207 if (!info) | 207 if (!info) |
| 208 return NULL; | 208 return NULL; |
| 209 | 209 |
| 210 PluginIFSupportedMap::iterator iter(plugin_if_supported_.find(interface)); | 210 PluginIFSupportedMap::iterator iter(plugin_if_supported_.find(interface)); |
| 211 if (iter == plugin_if_supported_.end()) { | 211 if (iter == plugin_if_supported_.end()) { |
| 212 // Need to query. Cache the result so we only do this once. | 212 // Need to query. Cache the result so we only do this once. |
| 213 bool supported = false; | 213 bool supported = false; |
| 214 |
| 215 bool previous_reentrancy_value = allow_plugin_reentrancy_; |
| 216 allow_plugin_reentrancy_ = true; |
| 214 Send(new PpapiMsg_SupportsInterface(interface, &supported)); | 217 Send(new PpapiMsg_SupportsInterface(interface, &supported)); |
| 218 allow_plugin_reentrancy_ = previous_reentrancy_value; |
| 219 |
| 215 std::pair<PluginIFSupportedMap::iterator, bool> iter_success_pair; | 220 std::pair<PluginIFSupportedMap::iterator, bool> iter_success_pair; |
| 216 iter_success_pair = plugin_if_supported_.insert( | 221 iter_success_pair = plugin_if_supported_.insert( |
| 217 PluginIFSupportedMap::value_type(interface, supported)); | 222 PluginIFSupportedMap::value_type(interface, supported)); |
| 218 iter = iter_success_pair.first; | 223 iter = iter_success_pair.first; |
| 219 } | 224 } |
| 220 if (iter->second) | 225 if (iter->second) |
| 221 return info->interface_ptr; | 226 return info->interface_ptr; |
| 222 return NULL; | 227 return NULL; |
| 223 } | 228 } |
| 224 | 229 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 dispatcher_ = static_cast<HostDispatcher*>(dispatcher); | 269 dispatcher_ = static_cast<HostDispatcher*>(dispatcher); |
| 265 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module()); | 270 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module()); |
| 266 } | 271 } |
| 267 | 272 |
| 268 ScopedModuleReference::~ScopedModuleReference() { | 273 ScopedModuleReference::~ScopedModuleReference() { |
| 269 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); | 274 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); |
| 270 } | 275 } |
| 271 | 276 |
| 272 } // namespace proxy | 277 } // namespace proxy |
| 273 } // namespace pp | 278 } // namespace pp |
| 274 | |
| OLD | NEW |