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

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

Issue 26308002: Fix some WeakPtrFactory members that aren't last (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix weak ptr initialization Created 7 years, 2 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 | « content/renderer/pepper/message_channel.h ('k') | net/http/http_server_properties_impl.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 "content/renderer/pepper/message_channel.h" 5 #include "content/renderer/pepper/message_channel.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 MessageChannel::MessageChannelNPObject::MessageChannelNPObject() { 295 MessageChannel::MessageChannelNPObject::MessageChannelNPObject() {
296 } 296 }
297 297
298 MessageChannel::MessageChannelNPObject::~MessageChannelNPObject() {} 298 MessageChannel::MessageChannelNPObject::~MessageChannelNPObject() {}
299 299
300 MessageChannel::MessageChannel(PepperPluginInstanceImpl* instance) 300 MessageChannel::MessageChannel(PepperPluginInstanceImpl* instance)
301 : instance_(instance), 301 : instance_(instance),
302 passthrough_object_(NULL), 302 passthrough_object_(NULL),
303 np_object_(NULL), 303 np_object_(NULL),
304 weak_ptr_factory_(this), 304 early_message_queue_state_(QUEUE_MESSAGES),
305 early_message_queue_state_(QUEUE_MESSAGES) { 305 weak_ptr_factory_(this) {
306 // Now create an NPObject for receiving calls to postMessage. This sets the 306 // Now create an NPObject for receiving calls to postMessage. This sets the
307 // reference count to 1. We release it in the destructor. 307 // reference count to 1. We release it in the destructor.
308 NPObject* obj = WebBindings::createObject(instance_->instanceNPP(), 308 NPObject* obj = WebBindings::createObject(instance_->instanceNPP(),
309 &message_channel_class); 309 &message_channel_class);
310 DCHECK(obj); 310 DCHECK(obj);
311 np_object_ = static_cast<MessageChannel::MessageChannelNPObject*>(obj); 311 np_object_ = static_cast<MessageChannel::MessageChannelNPObject*>(obj);
312 np_object_->message_channel = weak_ptr_factory_.GetWeakPtr(); 312 np_object_->message_channel = weak_ptr_factory_.GetWeakPtr();
313 } 313 }
314 314
315 void MessageChannel::NPVariantToPPVar(const NPVariant* variant) { 315 void MessageChannel::NPVariantToPPVar(const NPVariant* variant) {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 // incoming passthrough object first, so that we behave correctly if anyone 552 // incoming passthrough object first, so that we behave correctly if anyone
553 // invokes: 553 // invokes:
554 // SetPassthroughObject(passthrough_object()); 554 // SetPassthroughObject(passthrough_object());
555 if (passthrough_object_) 555 if (passthrough_object_)
556 WebBindings::releaseObject(passthrough_object_); 556 WebBindings::releaseObject(passthrough_object_);
557 557
558 passthrough_object_ = passthrough; 558 passthrough_object_ = passthrough;
559 } 559 }
560 560
561 } // namespace content 561 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/message_channel.h ('k') | net/http/http_server_properties_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698