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

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

Issue 6881012: Keep the module in scope when executing scripts. This prevents a crash when the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
OLDNEW
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/logging.h" 9 #include "base/logging.h"
10 #include "ppapi/c/private/ppb_proxy_private.h" 10 #include "ppapi/c/private/ppb_proxy_private.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // the proxy does. If this happens, something is out of sync. 226 // the proxy does. If this happens, something is out of sync.
227 NOTREACHED(); 227 NOTREACHED();
228 return NULL; 228 return NULL;
229 } 229 }
230 230
231 InterfaceProxy* proxy = info->create_proxy(this, local_interface); 231 InterfaceProxy* proxy = info->create_proxy(this, local_interface);
232 target_proxies_[info->id].reset(proxy); 232 target_proxies_[info->id].reset(proxy);
233 return proxy; 233 return proxy;
234 } 234 }
235 235
236
viettrungluu 2011/04/18 19:53:41 Nit: Is the extra blank line really necessary?
237 // ScopedModuleReference -------------------------------------------------------
238
239 ScopedModuleReference::ScopedModuleReference(Dispatcher* dispatcher) {
240 DCHECK(!dispatcher->IsPlugin());
241 dispatcher_ = static_cast<HostDispatcher*>(dispatcher);
242 dispatcher_->ppb_proxy()->AddRefModule(dispatcher_->pp_module());
243 }
244
245 ScopedModuleReference::~ScopedModuleReference() {
246 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module());
247 }
248
236 } // namespace proxy 249 } // namespace proxy
237 } // namespace pp 250 } // namespace pp
238 251
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698