summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 19:13:43 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 19:13:43 +0000
commit747ab0d4b60d997bc6036c4ec7d70dae6bef6c85 (patch)
tree7d6de1a2eb3900444fda347a60bbb7b63da5a9e7 /webkit
parenta041229a7dfe1dc778a2c414b8d75351e517e172 (diff)
downloadchromium_src-747ab0d4b60d997bc6036c4ec7d70dae6bef6c85.zip
chromium_src-747ab0d4b60d997bc6036c4ec7d70dae6bef6c85.tar.gz
chromium_src-747ab0d4b60d997bc6036c4ec7d70dae6bef6c85.tar.bz2
Add a way to pass information to Pepper Flash from the command-line (e.g., for debugging).
This also adds a |ProxyModule| singleton object to the Pepper proxy, which we may eventually use for communicating directly with the browser. BUG=none TEST=none Review URL: http://codereview.chromium.org/6910007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83932 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.cc4
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.h1
-rw-r--r--webkit/plugins/ppapi/plugin_delegate.h4
-rw-r--r--webkit/plugins/ppapi/ppb_flash_impl.cc17
4 files changed, 25 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc
index 133226b..f6d5adb 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.cc
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc
@@ -239,5 +239,9 @@ double MockPluginDelegate::GetLocalTimeZoneOffset(base::Time t) {
return 0.0;
}
+std::string MockPluginDelegate::GetFlashCommandLineArgs() {
+ return std::string();
+}
+
} // namespace ppapi
} // namespace webkit
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h
index 4c3d740..a5b8376 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.h
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.h
@@ -103,6 +103,7 @@ class MockPluginDelegate : public PluginDelegate {
virtual P2PSocketDispatcher* GetP2PSocketDispatcher();
virtual webkit_glue::P2PTransport* CreateP2PTransport();
virtual double GetLocalTimeZoneOffset(base::Time t);
+ virtual std::string GetFlashCommandLineArgs();
};
} // namespace ppapi
diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h
index 3cb1fea..671196a 100644
--- a/webkit/plugins/ppapi/plugin_delegate.h
+++ b/webkit/plugins/ppapi/plugin_delegate.h
@@ -390,6 +390,10 @@ class PluginDelegate {
virtual webkit_glue::P2PTransport* CreateP2PTransport() = 0;
virtual double GetLocalTimeZoneOffset(base::Time t) = 0;
+
+ // TODO(viettrungluu): Generalize this for use with other plugins if it proves
+ // necessary.
+ virtual std::string GetFlashCommandLineArgs() = 0;
};
} // namespace ppapi
diff --git a/webkit/plugins/ppapi/ppb_flash_impl.cc b/webkit/plugins/ppapi/ppb_flash_impl.cc
index d54a46c..0898da8 100644
--- a/webkit/plugins/ppapi/ppb_flash_impl.cc
+++ b/webkit/plugins/ppapi/ppb_flash_impl.cc
@@ -12,6 +12,7 @@
#include "ppapi/c/private/ppb_flash.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
+#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/ppb_url_request_info_impl.h"
#include "webkit/plugins/ppapi/resource_tracker.h"
@@ -92,6 +93,19 @@ double GetLocalTimeZoneOffset(PP_Instance pp_instance, PP_Time t) {
base::Time::FromDoubleT(t));
}
+PP_Var GetCommandLineArgs(PP_Module pp_module) {
+ PluginModule* module = ResourceTracker::Get()->GetModule(pp_module);
+ if (!module)
+ return PP_MakeUndefined();
+
+ PluginInstance* instance = module->GetSomeInstance();
+ if (!instance)
+ return PP_MakeUndefined();
+
+ std::string args = instance->delegate()->GetFlashCommandLineArgs();
+ return StringVar::StringToPPVar(module, args);
+}
+
const PPB_Flash ppb_flash = {
&SetInstanceAlwaysOnTop,
&PPB_Flash_Impl::DrawGlyphs,
@@ -99,7 +113,8 @@ const PPB_Flash ppb_flash = {
&Navigate,
&RunMessageLoop,
&QuitMessageLoop,
- &GetLocalTimeZoneOffset
+ &GetLocalTimeZoneOffset,
+ &GetCommandLineArgs
};
} // namespace