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

Unified Diff: webkit/glue/plugins/pepper_plugin_module.cc

Issue 2716002: Add a command line switch to enable the pepper testing interface. This moves ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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
Index: webkit/glue/plugins/pepper_plugin_module.cc
===================================================================
--- webkit/glue/plugins/pepper_plugin_module.cc (revision 49168)
+++ webkit/glue/plugins/pepper_plugin_module.cc (working copy)
@@ -6,6 +6,7 @@
#include <set>
+#include "base/command_line.h"
#include "base/message_loop_proxy.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
@@ -126,8 +127,14 @@
return ImageData::GetInterface();
if (strcmp(name, PPB_DEVICECONTEXT2D_INTERFACE) == 0)
return DeviceContext2D::GetInterface();
- if (strcmp(name, PPB_TESTING_INTERFACE) == 0)
- return &testing_interface;
+
+ // Only support the testing interface when the command line switch is
+ // specified. This allows us to prevent people from (ab)using this interface
+ // in production code.
+ if (strcmp(name, PPB_TESTING_INTERFACE) == 0) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing"))
Nico 2011/08/30 20:22:23 Why not kEnablePepperTesting? (Asking because I w
brettw 2011/08/30 23:10:41 I think at the time of this patch there was no sha
+ return &testing_interface;
+ }
return NULL;
}
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | webkit/glue/plugins/plugin_list_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698