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

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

Issue 8982006: Add GetLiveVars to PPB_Testing_Dev. Fix leaks it uncovered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_websocket.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('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 "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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 const NPVariant* args, uint32 arg_count, 177 const NPVariant* args, uint32 arg_count,
178 NPVariant* result) { 178 NPVariant* result) {
179 if (!np_obj) 179 if (!np_obj)
180 return false; 180 return false;
181 181
182 // We only handle a function called postMessage. 182 // We only handle a function called postMessage.
183 if (IdentifierIsPostMessage(name) && (arg_count == 1)) { 183 if (IdentifierIsPostMessage(name) && (arg_count == 1)) {
184 MessageChannel& message_channel(ToMessageChannel(np_obj)); 184 MessageChannel& message_channel(ToMessageChannel(np_obj));
185 PP_Var argument(NPVariantToPPVar(message_channel.instance(), &args[0])); 185 PP_Var argument(NPVariantToPPVar(message_channel.instance(), &args[0]));
186 message_channel.PostMessageToNative(argument); 186 message_channel.PostMessageToNative(argument);
187 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(argument);
187 return true; 188 return true;
188 } 189 }
189 // Other method calls we will pass to the passthrough object, if we have one. 190 // Other method calls we will pass to the passthrough object, if we have one.
190 NPObject* passthrough = ToMessageChannel(np_obj).passthrough_object(); 191 NPObject* passthrough = ToMessageChannel(np_obj).passthrough_object();
191 if (passthrough) { 192 if (passthrough) {
192 return WebBindings::invoke(NULL, passthrough, name, args, arg_count, 193 return WebBindings::invoke(NULL, passthrough, name, args, arg_count,
193 result); 194 result);
194 } 195 }
195 return false; 196 return false;
196 } 197 }
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // SetPassthroughObject(passthrough_object()); 414 // SetPassthroughObject(passthrough_object());
414 if (passthrough_object_) 415 if (passthrough_object_)
415 WebBindings::releaseObject(passthrough_object_); 416 WebBindings::releaseObject(passthrough_object_);
416 417
417 passthrough_object_ = passthrough; 418 passthrough_object_ = passthrough;
418 } 419 }
419 420
420 } // namespace ppapi 421 } // namespace ppapi
421 } // namespace webkit 422 } // namespace webkit
422 423
OLDNEW
« no previous file with comments | « ppapi/tests/test_websocket.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698