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

Side by Side Diff: webkit/plugins/ppapi/message_channel.cc

Issue 9564024: Re-land http://codereview.chromium.org/9403039/, r124106 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary change to ppapi_uitest.cc timer_ 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 | « webkit/plugins/ppapi/host_var_tracker.cc ('k') | webkit/plugins/ppapi/npobject_var.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 "webkit/plugins/ppapi/message_channel.h" 5 #include "webkit/plugins/ppapi/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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 MessageChannel::~MessageChannel() { 414 MessageChannel::~MessageChannel() {
415 WebBindings::releaseObject(np_object_); 415 WebBindings::releaseObject(np_object_);
416 if (passthrough_object_) 416 if (passthrough_object_)
417 WebBindings::releaseObject(passthrough_object_); 417 WebBindings::releaseObject(passthrough_object_);
418 } 418 }
419 419
420 void MessageChannel::SetPassthroughObject(NPObject* passthrough) { 420 void MessageChannel::SetPassthroughObject(NPObject* passthrough) {
421 // Retain the passthrough object; We need to ensure it lives as long as this 421 // Retain the passthrough object; We need to ensure it lives as long as this
422 // MessageChannel. 422 // MessageChannel.
423 WebBindings::retainObject(passthrough); 423 if (passthrough)
424 WebBindings::retainObject(passthrough);
424 425
425 // If we had a passthrough set already, release it. Note that we retain the 426 // If we had a passthrough set already, release it. Note that we retain the
426 // incoming passthrough object first, so that we behave correctly if anyone 427 // incoming passthrough object first, so that we behave correctly if anyone
427 // invokes: 428 // invokes:
428 // SetPassthroughObject(passthrough_object()); 429 // SetPassthroughObject(passthrough_object());
429 if (passthrough_object_) 430 if (passthrough_object_)
430 WebBindings::releaseObject(passthrough_object_); 431 WebBindings::releaseObject(passthrough_object_);
431 432
432 passthrough_object_ = passthrough; 433 passthrough_object_ = passthrough;
433 } 434 }
434 435
435 } // namespace ppapi 436 } // namespace ppapi
436 } // namespace webkit 437 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/host_var_tracker.cc ('k') | webkit/plugins/ppapi/npobject_var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698