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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.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: merge 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc
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 08b525b6e31ee0ad60aba4c7ba0c8f1fb172eb99..d2d35e599fa76632bbbd5f05f65e7c100aff8a3e 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);

Powered by Google App Engine
This is Rietveld 408576698