summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 01:00:22 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 01:00:22 +0000
commitbb97536b768ac68fcbc4605c35461a798ef6e5ff (patch)
tree479bde96cd05a9e1f9d2746dd82313e2eb715e8e /chrome/renderer
parent8731a63268015f4e5d684833c11a1b44bd9ae468 (diff)
downloadchromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.zip
chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.tar.gz
chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.tar.bz2
Make CommandLine into a normal object, with some statics for getting at the current process's command line.
One explicit goal of this change is to *not* deal with the string/wstring issues at the API on POSIX; the functions are the same as before, which means they remain as broken as before. (I did try to fix the internals, though, so migrating the callers is now possible by adding platform-appropriate hooks.) Review URL: http://codereview.chromium.org/18248 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8347 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_process.cc2
-rw-r--r--chrome/renderer/render_view.cc6
-rw-r--r--chrome/renderer/renderer_glue.cc2
-rw-r--r--chrome/renderer/renderer_main.cc2
4 files changed, 6 insertions, 6 deletions
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc
index b2b4606..2fe1af7 100644
--- a/chrome/renderer/render_process.cc
+++ b/chrome/renderer/render_process.cc
@@ -63,7 +63,7 @@ bool RenderProcess::GlobalInit(const std::wstring &channel_name) {
}
}
- CommandLine command_line;
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
webkit_glue::SetJavaScriptFlags(
command_line.GetSwitchValue(switches::kJavaScriptFlags));
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 9927171..8f08add 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -289,7 +289,7 @@ void RenderView::Init(HWND parent_hwnd,
host_window_ = parent_hwnd;
modal_dialog_event_.reset(modal_dialog_event);
- CommandLine command_line;
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
enable_dom_automation_ =
command_line.HasSwitch(switches::kDomAutomationController);
disable_popup_blocking_ =
@@ -1834,8 +1834,8 @@ static bool ShouldLoadPluginInProcess(const std::string& mime_type,
if (mime_type == "application/x-googlegears") {
*is_gears = true;
- CommandLine cmd;
- return cmd.HasSwitch(switches::kGearsInRenderer);
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kGearsInRenderer);
}
return false;
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index 7516ace..3bc7c63 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -136,7 +136,7 @@ ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
namespace webkit_glue {
bool IsMediaPlayerAvailable() {
- return CommandLine().HasSwitch(switches::kEnableVideo);
+ return CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableVideo);
}
void PrefetchDns(const std::string& hostname) {
diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc
index 476e4f7..b3d9fec 100644
--- a/chrome/renderer/renderer_main.cc
+++ b/chrome/renderer/renderer_main.cc
@@ -46,7 +46,7 @@ static void HandleRendererErrorTestParameters(const CommandLine& command_line) {
// mainline routine for running as the Rendererer process
int RendererMain(const MainFunctionParams& parameters) {
- CommandLine& parsed_command_line = parameters.command_line_;
+ const CommandLine& parsed_command_line = parameters.command_line_;
sandbox::TargetServices* target_services =
parameters.sandbox_info_.TargetServices();