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

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

Issue 9655019: Fix a crash related to PPAPI scripting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/dispatcher.cc ('k') | ppapi/proxy/host_var_serialization_rules.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 <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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 PP_Module module, 65 PP_Module module,
66 GetInterfaceFunc local_get_interface) 66 GetInterfaceFunc local_get_interface)
67 : Dispatcher(remote_process_handle, local_get_interface), 67 : Dispatcher(remote_process_handle, local_get_interface),
68 pp_module_(module), 68 pp_module_(module),
69 ppb_proxy_(NULL), 69 ppb_proxy_(NULL),
70 allow_plugin_reentrancy_(false) { 70 allow_plugin_reentrancy_(false) {
71 if (!g_module_to_dispatcher) 71 if (!g_module_to_dispatcher)
72 g_module_to_dispatcher = new ModuleToDispatcherMap; 72 g_module_to_dispatcher = new ModuleToDispatcherMap;
73 (*g_module_to_dispatcher)[pp_module_] = this; 73 (*g_module_to_dispatcher)[pp_module_] = this;
74 74
75 SetSerializationRules(new HostVarSerializationRules(module)); 75 SetSerializationRules(new HostVarSerializationRules);
76 76
77 ppb_proxy_ = reinterpret_cast<const PPB_Proxy_Private*>( 77 ppb_proxy_ = reinterpret_cast<const PPB_Proxy_Private*>(
78 local_get_interface(PPB_PROXY_PRIVATE_INTERFACE)); 78 local_get_interface(PPB_PROXY_PRIVATE_INTERFACE));
79 DCHECK(ppb_proxy_) << "The proxy interface should always be supported."; 79 DCHECK(ppb_proxy_) << "The proxy interface should always be supported.";
80 80
81 ppb_proxy_->SetReserveInstanceIDCallback(pp_module_, &ReserveInstanceID); 81 ppb_proxy_->SetReserveInstanceIDCallback(pp_module_, &ReserveInstanceID);
82 } 82 }
83 83
84 HostDispatcher::~HostDispatcher() { 84 HostDispatcher::~HostDispatcher() {
85 g_module_to_dispatcher->erase(pp_module_); 85 g_module_to_dispatcher->erase(pp_module_);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 dispatcher_ = static_cast<HostDispatcher*>(dispatcher); 244 dispatcher_ = static_cast<HostDispatcher*>(dispatcher);
245 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module()); 245 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module());
246 } 246 }
247 247
248 ScopedModuleReference::~ScopedModuleReference() { 248 ScopedModuleReference::~ScopedModuleReference() {
249 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); 249 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module());
250 } 250 }
251 251
252 } // namespace proxy 252 } // namespace proxy
253 } // namespace ppapi 253 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/dispatcher.cc ('k') | ppapi/proxy/host_var_serialization_rules.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698