summaryrefslogtreecommitdiffstats
path: root/content
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 /content
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 'content')
-rw-r--r--content/browser/ppapi_plugin_process_host.cc6
-rw-r--r--content/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--content/common/content_switches.cc3
-rw-r--r--content/common/content_switches.h1
-rw-r--r--content/ppapi_plugin/ppapi_plugin_main.cc5
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.cc7
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.h1
7 files changed, 24 insertions, 0 deletions
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 482ee98..e3d89b3 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -45,6 +45,12 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
switches::kPpapiPluginProcess);
cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
+ static const char* kForwardSwitches[] = {
+ switches::kPpapiFlashArgs,
+ };
+ cmd_line->CopySwitchesFrom(browser_command_line, kForwardSwitches,
+ arraysize(kForwardSwitches));
+
if (!plugin_launcher.empty())
cmd_line->PrependWrapper(plugin_launcher);
diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc
index 93d1817..2c69680 100644
--- a/content/browser/renderer_host/browser_render_process_host.cc
+++ b/content/browser/renderer_host/browser_render_process_host.cc
@@ -591,6 +591,7 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(
switches::kNoReferrers,
switches::kNoSandbox,
switches::kPlaybackMode,
+ switches::kPpapiFlashArgs,
switches::kPpapiFlashInProcess,
switches::kPpapiFlashPath,
switches::kPpapiFlashVersion,
diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc
index e4056c8..c8b2ec5 100644
--- a/content/common/content_switches.cc
+++ b/content/common/content_switches.cc
@@ -266,6 +266,9 @@ const char kPluginStartupDialog[] = "plugin-startup-dialog";
// Argument to the process type that indicates a PPAPI broker process type.
const char kPpapiBrokerProcess[] = "ppapi-broker";
+// "Command-line" arguments for the PPAPI Flash; used for debugging options.
+const char kPpapiFlashArgs[] = "ppapi-flash-args";
+
// Use the PPAPI (Pepper) Flash found at the given path.
const char kPpapiFlashPath[] = "ppapi-flash-path";
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index e332a1f..e1405ab 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -85,6 +85,7 @@ extern const char kPluginPath[];
extern const char kPluginProcess[];
extern const char kPluginStartupDialog[];
extern const char kPpapiBrokerProcess[];
+extern const char kPpapiFlashArgs[];
extern const char kPpapiFlashPath[];
extern const char kPpapiFlashVersion[];
extern const char kPpapiOutOfProcess[];
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc
index bca4073..92cb004 100644
--- a/content/ppapi_plugin/ppapi_plugin_main.cc
+++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
@@ -9,6 +10,7 @@
#include "content/common/content_switches.h"
#include "content/common/main_function_params.h"
#include "content/ppapi_plugin/ppapi_thread.h"
+#include "ppapi/proxy/proxy_module.h"
// Main function for starting the PPAPI plugin process.
int PpapiPluginMain(const MainFunctionParams& parameters) {
@@ -23,6 +25,9 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
ChildProcess ppapi_process;
ppapi_process.set_main_thread(new PpapiThread(false)); // Not a broker.
+ pp::proxy::ProxyModule::GetInstance()->SetFlashCommandLineArgs(
+ command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs));
+
main_message_loop.Run();
return 0;
}
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index ce5b17c..34256cc 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -8,6 +8,7 @@
#include <queue>
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -18,6 +19,7 @@
#include "content/common/audio_messages.h"
#include "content/common/child_process_messages.h"
#include "content/common/child_thread.h"
+#include "content/common/content_switches.h"
#include "content/common/file_system/file_system_dispatcher.h"
#include "content/common/pepper_file_messages.h"
#include "content/common/pepper_plugin_registry.h"
@@ -1290,3 +1292,8 @@ double PepperPluginDelegateImpl::GetLocalTimeZoneOffset(base::Time t) {
t, &result));
return result;
}
+
+std::string PepperPluginDelegateImpl::GetFlashCommandLineArgs() {
+ return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kPpapiFlashArgs);
+}
diff --git a/content/renderer/pepper_plugin_delegate_impl.h b/content/renderer/pepper_plugin_delegate_impl.h
index 108c51d..0a5a3a3 100644
--- a/content/renderer/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper_plugin_delegate_impl.h
@@ -271,6 +271,7 @@ class PepperPluginDelegateImpl
virtual P2PSocketDispatcher* GetP2PSocketDispatcher();
virtual webkit_glue::P2PTransport* CreateP2PTransport();
virtual double GetLocalTimeZoneOffset(base::Time t);
+ virtual std::string GetFlashCommandLineArgs();
private:
// Asynchronously attempts to create a PPAPI broker for the given plugin.