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

Unified Diff: ppapi/proxy/ppb_testing_proxy.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/plugin_var_serialization_rules.cc ('k') | ppapi/proxy/serialized_var.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_testing_proxy.cc
diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc
index 77d1af08a4241a9fc7221783fbd66bea78588519..32d521543a15db0573592ff8998dbd91e7f4a519 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -95,6 +95,19 @@ PP_Var GetDocumentURL(PP_Instance instance, PP_URLComponents_Dev* components) {
return enter.functions()->GetDocumentURL(instance, components);
}
+// TODO(dmichael): Ideally we could get a way to check the number of vars in the
+// host-side tracker when running out-of-process, to make sure the proxy does
+// not leak host-side vars.
+uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) {
+ std::vector<PP_Var> vars =
+ PpapiGlobals::Get()->GetVarTracker()->GetLiveVars();
+ for (size_t i = 0u;
+ i < std::min(static_cast<size_t>(array_size), vars.size());
+ ++i)
+ live_vars[i] = vars[i];
+ return vars.size();
+}
+
const PPB_Testing_Dev testing_interface = {
&ReadImageData,
&RunMessageLoop,
@@ -102,7 +115,8 @@ const PPB_Testing_Dev testing_interface = {
&GetLiveObjectsForInstance,
&IsOutOfProcess,
&SimulateInputEvent,
- &GetDocumentURL
+ &GetDocumentURL,
+ &GetLiveVars
};
InterfaceProxy* CreateTestingProxy(Dispatcher* dispatcher) {
« no previous file with comments | « ppapi/proxy/plugin_var_serialization_rules.cc ('k') | ppapi/proxy/serialized_var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698