Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1649)

Side by Side Diff: ppapi/proxy/host_dispatcher.cc

Issue 704913002: PPAPI: Make GetProxiedInterface not re-enter the plugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oops, make SimulateInputEvent async again Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/pepper/ppb_video_decoder_impl.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/host_dispatcher.h" 5 #include "ppapi/proxy/host_dispatcher.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ppapi/c/private/ppb_proxy_private.h" 9 #include "ppapi/c/private/ppb_proxy_private.h"
10 #include "ppapi/c/ppb_var.h" 10 #include "ppapi/c/ppb_var.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 const void* proxied_interface = 217 const void* proxied_interface =
218 InterfaceList::GetInstance()->GetInterfaceForPPP(iface_name); 218 InterfaceList::GetInstance()->GetInterfaceForPPP(iface_name);
219 if (!proxied_interface) 219 if (!proxied_interface)
220 return NULL; // Don't have a proxy for this interface, don't query further. 220 return NULL; // Don't have a proxy for this interface, don't query further.
221 221
222 PluginSupportedMap::iterator iter(plugin_supported_.find(iface_name)); 222 PluginSupportedMap::iterator iter(plugin_supported_.find(iface_name));
223 if (iter == plugin_supported_.end()) { 223 if (iter == plugin_supported_.end()) {
224 // Need to query. Cache the result so we only do this once. 224 // Need to query. Cache the result so we only do this once.
225 bool supported = false; 225 bool supported = false;
226 226
227 bool previous_reentrancy_value = allow_plugin_reentrancy_;
228 allow_plugin_reentrancy_ = true;
229 Send(new PpapiMsg_SupportsInterface(iface_name, &supported)); 227 Send(new PpapiMsg_SupportsInterface(iface_name, &supported));
230 allow_plugin_reentrancy_ = previous_reentrancy_value;
231 228
232 std::pair<PluginSupportedMap::iterator, bool> iter_success_pair; 229 std::pair<PluginSupportedMap::iterator, bool> iter_success_pair;
233 iter_success_pair = plugin_supported_.insert( 230 iter_success_pair = plugin_supported_.insert(
234 PluginSupportedMap::value_type(iface_name, supported)); 231 PluginSupportedMap::value_type(iface_name, supported));
235 iter = iter_success_pair.first; 232 iter = iter_success_pair.first;
236 } 233 }
237 if (iter->second) 234 if (iter->second)
238 return proxied_interface; 235 return proxied_interface;
239 return NULL; 236 return NULL;
240 } 237 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 281 }
285 } 282 }
286 283
287 ScopedModuleReference::~ScopedModuleReference() { 284 ScopedModuleReference::~ScopedModuleReference() {
288 if (dispatcher_) 285 if (dispatcher_)
289 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); 286 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module());
290 } 287 }
291 288
292 } // namespace proxy 289 } // namespace proxy
293 } // namespace ppapi 290 } // namespace ppapi
OLDNEW
« no previous file with comments | « content/renderer/pepper/ppb_video_decoder_impl.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698