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

Unified Diff: webkit/plugins/ppapi/plugin_module.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 | « webkit/plugins/ppapi/message_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/plugin_module.cc
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 3cb4c482284c1f3c516d06ec1d3f010d7e047257..9934666c2a9a190ea0d3610ac4318421c60ef6de 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -247,6 +247,16 @@ PP_Var GetDocumentURL(PP_Instance instance, PP_URLComponents_Dev* components) {
return plugin_instance->GetDocumentURL(instance, components);
}
+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,
@@ -254,7 +264,8 @@ const PPB_Testing_Dev testing_interface = {
&GetLiveObjectsForInstance,
&IsOutOfProcess,
&SimulateInputEvent,
- &GetDocumentURL
+ &GetDocumentURL,
+ &GetLiveVars
};
// GetInterface ----------------------------------------------------------------
@@ -351,8 +362,7 @@ const void* GetInterface(const char* name) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePepperTesting)) {
if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0 ||
- strcmp(name, PPB_TESTING_DEV_INTERFACE_0_7) == 0 ||
- strcmp(name, PPB_TESTING_DEV_INTERFACE_0_8) == 0) {
+ strcmp(name, PPB_TESTING_DEV_INTERFACE_0_9) == 0) {
return &testing_interface;
}
}
« no previous file with comments | « webkit/plugins/ppapi/message_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698