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

Unified Diff: webkit/plugins/ppapi/ppapi_webplugin_impl.cc

Issue 6731051: Fix up some reference counting when WebPluginImpl::scriptableObject is called. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/plugin_object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_webplugin_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_webplugin_impl.cc (revision 79559)
+++ webkit/plugins/ppapi/ppapi_webplugin_impl.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include "base/message_loop.h"
#include "ppapi/c/pp_var.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
@@ -94,11 +95,12 @@
// If there's an InstanceObject, tell the Instance's MessageChannel to pass
// any non-postMessage calls to it.
if (object) {
- instance_->message_channel().set_passthrough_object(
- object->np_object());
+ instance_->message_channel().SetPassthroughObject(object->np_object());
}
- // And return the instance's MessageChannel.
- return instance_->message_channel().np_object();
+ NPObject* message_channel_np_object(instance_->message_channel().np_object());
+ // The object is expected to be retained before it is returned.
+ WebKit::WebBindings::retainObject(message_channel_np_object);
+ return message_channel_np_object;
}
void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) {
« no previous file with comments | « webkit/plugins/ppapi/plugin_object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698