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

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

Issue 780713002: Fix remaining WeakPtrFactory ordering problems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 6 years 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/plugin_object.h ('k') | device/hid/hid_service_linux.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) 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 instance_ = NULL; 162 instance_ = NULL;
163 } 163 }
164 164
165 PluginObject::PluginObject(PepperPluginInstanceImpl* instance, 165 PluginObject::PluginObject(PepperPluginInstanceImpl* instance,
166 const PPP_Class_Deprecated* ppp_class, 166 const PPP_Class_Deprecated* ppp_class,
167 void* ppp_class_data) 167 void* ppp_class_data)
168 : gin::NamedPropertyInterceptor(instance->GetIsolate(), this), 168 : gin::NamedPropertyInterceptor(instance->GetIsolate(), this),
169 instance_(instance), 169 instance_(instance),
170 ppp_class_(ppp_class), 170 ppp_class_(ppp_class),
171 ppp_class_data_(ppp_class_data), 171 ppp_class_data_(ppp_class_data),
172 weak_factory_(this), 172 template_cache_(instance->GetIsolate()),
173 template_cache_(instance->GetIsolate()) { 173 weak_factory_(this) {
174 instance_->AddPluginObject(this); 174 instance_->AddPluginObject(this);
175 } 175 }
176 176
177 gin::ObjectTemplateBuilder PluginObject::GetObjectTemplateBuilder( 177 gin::ObjectTemplateBuilder PluginObject::GetObjectTemplateBuilder(
178 v8::Isolate* isolate) { 178 v8::Isolate* isolate) {
179 return Wrappable<PluginObject>::GetObjectTemplateBuilder(isolate) 179 return Wrappable<PluginObject>::GetObjectTemplateBuilder(isolate)
180 .AddNamedPropertyInterceptor(); 180 .AddNamedPropertyInterceptor();
181 } 181 }
182 182
183 v8::Local<v8::Value> PluginObject::GetPropertyOrMethod(v8::Isolate* isolate, 183 v8::Local<v8::Value> PluginObject::GetPropertyOrMethod(v8::Isolate* isolate,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 return function_template; 274 return function_template;
275 function_template = 275 function_template =
276 gin::CreateFunctionTemplate( 276 gin::CreateFunctionTemplate(
277 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(), 277 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(),
278 name)); 278 name));
279 template_cache_.Set(name, function_template); 279 template_cache_.Set(name, function_template);
280 return function_template; 280 return function_template;
281 } 281 }
282 282
283 } // namespace content 283 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/plugin_object.h ('k') | device/hid/hid_service_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698