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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2010 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 "webkit/plugins/ppapi/ppapi_webplugin_impl.h" 5 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "ppapi/c/pp_var.h" 10 #include "ppapi/c/pp_var.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 88 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
89 } 89 }
90 90
91 NPObject* WebPluginImpl::scriptableObject() { 91 NPObject* WebPluginImpl::scriptableObject() {
92 scoped_refptr<ObjectVar> object( 92 scoped_refptr<ObjectVar> object(
93 ObjectVar::FromPPVar(instance_->GetInstanceObject())); 93 ObjectVar::FromPPVar(instance_->GetInstanceObject()));
94 // If there's an InstanceObject, tell the Instance's MessageChannel to pass 94 // If there's an InstanceObject, tell the Instance's MessageChannel to pass
95 // any non-postMessage calls to it. 95 // any non-postMessage calls to it.
96 if (object) { 96 if (object) {
97 instance_->message_channel().set_passthrough_object( 97 instance_->message_channel().set_passthrough_object(object->np_object());
piman 2011/03/29 16:19:47 The message channel should also retain the passthr
dmichael(do not use this one) 2011/03/29 16:56:10 That's what I thought... I was trying to slap tog
98 object->np_object());
99 } 98 }
100 // And return the instance's MessageChannel. 99 NPObject* message_channel_np_object;
piman 2011/03/29 16:19:47 = instance_->message_channel().np_object() ?
dmichael(do not use this one) 2011/03/29 16:56:10 Yeah, I hit send too hastily. Sorry.
101 return instance_->message_channel().np_object(); 100 // The object is expected to be retained before it is returned.
101 WebBindings::retainObject(message_channel_np_object);
102 return message_channel_np_object;
102 } 103 }
103 104
104 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { 105 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) {
105 if (!instance_->IsFullscreenOrPending()) 106 if (!instance_->IsFullscreenOrPending())
106 instance_->Paint(canvas, plugin_rect_, rect); 107 instance_->Paint(canvas, plugin_rect_, rect);
107 } 108 }
108 109
109 void WebPluginImpl::updateGeometry( 110 void WebPluginImpl::updateGeometry(
110 const WebRect& window_rect, 111 const WebRect& window_rect,
111 const WebRect& clip_rect, 112 const WebRect& clip_rect,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return instance_->PrintPage(page_number, canvas); 223 return instance_->PrintPage(page_number, canvas);
223 } 224 }
224 225
225 void WebPluginImpl::printEnd() { 226 void WebPluginImpl::printEnd() {
226 return instance_->PrintEnd(); 227 return instance_->PrintEnd();
227 } 228 }
228 229
229 } // namespace ppapi 230 } // namespace ppapi
230 } // namespace webkit 231 } // namespace webkit
231 232
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698