summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 18:18:51 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 18:18:51 +0000
commit7e11bf57a0d649706afe8d3f00e708095dc1305c (patch)
tree895727756c11bf24e94cc80a7949d192fd91a498
parent8da664fa0ddc9e9f224ad094492066972058408d (diff)
downloadchromium_src-7e11bf57a0d649706afe8d3f00e708095dc1305c.zip
chromium_src-7e11bf57a0d649706afe8d3f00e708095dc1305c.tar.gz
chromium_src-7e11bf57a0d649706afe8d3f00e708095dc1305c.tar.bz2
Merge 115503 - Add GetLiveVars to PPB_Testing_Dev. Fix leaks it uncovered.
BUG=108308 TEST= Review URL: http://codereview.chromium.org/8982006 TBR=dmichael@chromium.org Review URL: http://codereview.chromium.org/9027008 git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@115558 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc6
-rw-r--r--webkit/plugins/ppapi/message_channel.cc1
2 files changed, 7 insertions, 0 deletions
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc
index 062bb5b..0676b16 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc
@@ -13,6 +13,7 @@
#endif
using ppapi_proxy::PPBMessagingInterface;
+using ppapi_proxy::PPBVarInterface;
using ppapi_proxy::DebugPrintf;
using ppapi_proxy::DeserializeTo;
@@ -30,6 +31,11 @@ void PpbMessagingRpcServer::PPB_Messaging_PostMessage(
return;
PPBMessagingInterface()->PostMessage(instance, message);
+
+ // In the case of a string, DeserializeTo creates a PP_Var with a reference-
+ // count of 1. We must release the var, or it will stay in the browser's map.
+ PPBVarInterface()->Release(message);
+
DebugPrintf("PPB_Messaging::PostMessage: instance=%"NACL_PRIu32"\n",
instance);
diff --git a/webkit/plugins/ppapi/message_channel.cc b/webkit/plugins/ppapi/message_channel.cc
index 4e9e82883..cc0026e 100644
--- a/webkit/plugins/ppapi/message_channel.cc
+++ b/webkit/plugins/ppapi/message_channel.cc
@@ -159,6 +159,7 @@ bool MessageChannelInvoke(NPObject* np_obj, NPIdentifier name,
MessageChannel& message_channel(ToMessageChannel(np_obj));
PP_Var argument(NPVariantToPPVar(message_channel.instance(), &args[0]));
message_channel.PostMessageToNative(argument);
+ PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(argument);
return true;
}
// Other method calls we will pass to the passthrough object, if we have one.