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

Unified Diff: ppapi/proxy/ppb_var_deprecated_proxy.cc

Issue 10542150: Actually free plugin implement vars when running out of process when the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | « ppapi/proxy/plugin_var_tracker_unittest.cc ('k') | ppapi/proxy/ppp_class_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_var_deprecated_proxy.cc
===================================================================
--- ppapi/proxy/ppb_var_deprecated_proxy.cc (revision 141525)
+++ ppapi/proxy/ppb_var_deprecated_proxy.cc (working copy)
@@ -18,6 +18,7 @@
#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/plugin_var_tracker.h"
+#include "ppapi/proxy/proxy_object_var.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppp_class_proxy.h"
#include "ppapi/proxy/serialized_var.h"
@@ -254,6 +255,10 @@
if (!dispatcher)
return PP_MakeUndefined();
+ PluginVarTracker* tracker = PluginGlobals::Get()->plugin_var_tracker();
+ if (tracker->IsPluginImplementedObjectAlive(ppp_class_data))
+ return PP_MakeUndefined(); // Object already exists with this user data.
+
ReceiveSerializedVarReturnValue result;
int64 class_int = static_cast<int64>(reinterpret_cast<intptr_t>(ppp_class));
int64 data_int =
@@ -261,7 +266,12 @@
dispatcher->Send(new PpapiHostMsg_PPBVar_CreateObjectDeprecated(
API_ID_PPB_VAR_DEPRECATED, instance, class_int, data_int,
&result));
- return result.Return(dispatcher);
+ PP_Var ret_var = result.Return(dispatcher);
+
+ // Register this object as being implemented by the plugin.
+ tracker->PluginImplementedObjectCreated(instance, ret_var,
+ ppp_class, ppp_class_data);
+ return ret_var;
}
InterfaceProxy* CreateVarDeprecatedProxy(Dispatcher* dispatcher) {
« no previous file with comments | « ppapi/proxy/plugin_var_tracker_unittest.cc ('k') | ppapi/proxy/ppp_class_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698