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

Side by Side Diff: content/renderer/pepper/plugin_object.cc

Issue 1839933002: Ensure we don't leak ObjectProxy objects Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | ppapi/proxy/ppp_class_proxy.cc » ('j') | ppapi/proxy/ppp_class_proxy.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/pepper/plugin_object.h" 5 #include "content/renderer/pepper/plugin_object.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace { 43 namespace {
44 44
45 const char kInvalidValueException[] = "Error: Invalid value"; 45 const char kInvalidValueException[] = "Error: Invalid value";
46 46
47 } // namespace 47 } // namespace
48 48
49 // PluginObject ---------------------------------------------------------------- 49 // PluginObject ----------------------------------------------------------------
50 50
51 PluginObject::~PluginObject() { 51 PluginObject::~PluginObject() {
52 if (instance_) { 52 ppp_class_->Deallocate(ppp_class_data_);
piman 2016/03/29 18:28:51 So, in theory, we are not supposed to call back in
53 ppp_class_->Deallocate(ppp_class_data_); 53 if (instance_)
54 instance_->RemovePluginObject(this); 54 instance_->RemovePluginObject(this);
55 }
56 } 55 }
57 56
58 // static 57 // static
59 gin::WrapperInfo PluginObject::kWrapperInfo = {gin::kEmbedderNativeGin}; 58 gin::WrapperInfo PluginObject::kWrapperInfo = {gin::kEmbedderNativeGin};
60 59
61 // static 60 // static
62 PluginObject* PluginObject::FromV8Object(v8::Isolate* isolate, 61 PluginObject* PluginObject::FromV8Object(v8::Isolate* isolate,
63 v8::Local<v8::Object> v8_object) { 62 v8::Local<v8::Object> v8_object) {
64 PluginObject* plugin_object; 63 PluginObject* plugin_object;
65 if (!v8_object.IsEmpty() && 64 if (!v8_object.IsEmpty() &&
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 return function_template; 296 return function_template;
298 function_template = 297 function_template =
299 gin::CreateFunctionTemplate( 298 gin::CreateFunctionTemplate(
300 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(), 299 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(),
301 name)); 300 name));
302 template_cache_.Set(name, function_template); 301 template_cache_.Set(name, function_template);
303 return function_template; 302 return function_template;
304 } 303 }
305 304
306 } // namespace content 305 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ppapi/proxy/ppp_class_proxy.cc » ('j') | ppapi/proxy/ppp_class_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698