summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 19:04:23 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 19:04:23 +0000
commit9ad436ba75c4b94ad2eb489a43fdab1711eef051 (patch)
tree8984cc140c1f10b6bf4b88c6b32801c3789ba62e /chrome
parent382b497b6756b4a3ba5fd6e054c06f2e6b48d624 (diff)
downloadchromium_src-9ad436ba75c4b94ad2eb489a43fdab1711eef051.zip
chromium_src-9ad436ba75c4b94ad2eb489a43fdab1711eef051.tar.gz
chromium_src-9ad436ba75c4b94ad2eb489a43fdab1711eef051.tar.bz2
Use new CopySwitchesFrom CommandLine API to simplify some code.
Review URL: http://codereview.chromium.org/3010046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc53
1 files changed, 12 insertions, 41 deletions
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index 51e0fd9..8b3ac2d 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -110,49 +110,20 @@ bool WorkerProcessHost::Init() {
cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
SetCrashReporterCommandLine(cmd_line);
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableNativeWebWorkers)) {
- cmd_line->AppendSwitch(switches::kEnableNativeWebWorkers);
- }
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kWebWorkerShareProcesses)) {
- cmd_line->AppendSwitch(switches::kWebWorkerShareProcesses);
- }
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableApplicationCache)) {
- cmd_line->AppendSwitch(switches::kDisableApplicationCache);
- }
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableDatabases)) {
- cmd_line->AppendSwitch(switches::kDisableDatabases);
- }
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableLogging)) {
- cmd_line->AppendSwitch(switches::kEnableLogging);
- }
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kLoggingLevel)) {
- const std::string level =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kLoggingLevel);
- cmd_line->AppendSwitchASCII(switches::kLoggingLevel, level);
- }
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableWebSockets)) {
- cmd_line->AppendSwitch(switches::kDisableWebSockets);
- }
-
+ static const char* const kSwitchNames[] = {
+ switches::kEnableNativeWebWorkers,
+ switches::kWebWorkerShareProcesses,
+ switches::kDisableApplicationCache,
+ switches::kDisableDatabases,
+ switches::kEnableLogging,
+ switches::kLoggingLevel,
+ switches::kDisableWebSockets,
#if defined(OS_WIN)
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableDesktopNotifications)) {
- cmd_line->AppendSwitch(switches::kDisableDesktopNotifications);
- }
+ switches::kDisableDesktopNotifications,
#endif
+ };
+ cmd_line->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), kSwitchNames,
+ arraysize(kSwitchNames));
#if defined(OS_POSIX)
if (CommandLine::ForCurrentProcess()->HasSwitch(