diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:00:22 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:00:22 +0000 |
commit | bb97536b768ac68fcbc4605c35461a798ef6e5ff (patch) | |
tree | 479bde96cd05a9e1f9d2746dd82313e2eb715e8e /chrome/renderer | |
parent | 8731a63268015f4e5d684833c11a1b44bd9ae468 (diff) | |
download | chromium_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.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/renderer_main.cc | 2 |
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(); |