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; |
} |