Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/worker_host/worker_process_host.cc

Issue 3012021: CommandLine: add a CopySwitchesFrom() for copying from another CommandLine (Closed)
Patch Set: minor cleanups Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/utility_process_host.cc ('k') | chrome/browser/zygote_host_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/worker_host/worker_process_host.h" 5 #include "chrome/browser/worker_host/worker_process_host.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (!CreateChannel()) 100 if (!CreateChannel())
101 return false; 101 return false;
102 102
103 FilePath exe_path = GetChildPath(true); 103 FilePath exe_path = GetChildPath(true);
104 if (exe_path.empty()) 104 if (exe_path.empty())
105 return false; 105 return false;
106 106
107 CommandLine* cmd_line = new CommandLine(exe_path); 107 CommandLine* cmd_line = new CommandLine(exe_path);
108 cmd_line->AppendSwitchWithValue(switches::kProcessType, 108 cmd_line->AppendSwitchWithValue(switches::kProcessType,
109 switches::kWorkerProcess); 109 switches::kWorkerProcess);
110 cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, 110 cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, channel_id());
111 ASCIIToWide(channel_id()));
112 SetCrashReporterCommandLine(cmd_line); 111 SetCrashReporterCommandLine(cmd_line);
113 112
114 if (CommandLine::ForCurrentProcess()->HasSwitch( 113 if (CommandLine::ForCurrentProcess()->HasSwitch(
115 switches::kEnableNativeWebWorkers)) { 114 switches::kEnableNativeWebWorkers)) {
116 cmd_line->AppendSwitch(switches::kEnableNativeWebWorkers); 115 cmd_line->AppendSwitch(switches::kEnableNativeWebWorkers);
117 } 116 }
118 117
119 if (CommandLine::ForCurrentProcess()->HasSwitch( 118 if (CommandLine::ForCurrentProcess()->HasSwitch(
120 switches::kWebWorkerShareProcesses)) { 119 switches::kWebWorkerShareProcesses)) {
121 cmd_line->AppendSwitch(switches::kWebWorkerShareProcesses); 120 cmd_line->AppendSwitch(switches::kWebWorkerShareProcesses);
(...skipping 11 matching lines...) Expand all
133 132
134 if (CommandLine::ForCurrentProcess()->HasSwitch( 133 if (CommandLine::ForCurrentProcess()->HasSwitch(
135 switches::kEnableLogging)) { 134 switches::kEnableLogging)) {
136 cmd_line->AppendSwitch(switches::kEnableLogging); 135 cmd_line->AppendSwitch(switches::kEnableLogging);
137 } 136 }
138 if (CommandLine::ForCurrentProcess()->HasSwitch( 137 if (CommandLine::ForCurrentProcess()->HasSwitch(
139 switches::kLoggingLevel)) { 138 switches::kLoggingLevel)) {
140 const std::wstring level = 139 const std::wstring level =
141 CommandLine::ForCurrentProcess()->GetSwitchValue( 140 CommandLine::ForCurrentProcess()->GetSwitchValue(
142 switches::kLoggingLevel); 141 switches::kLoggingLevel);
143 cmd_line->AppendSwitchWithValue( 142 cmd_line->AppendSwitchWithValue(switches::kLoggingLevel, level);
144 switches::kLoggingLevel, level);
145 } 143 }
146 144
147 if (CommandLine::ForCurrentProcess()->HasSwitch( 145 if (CommandLine::ForCurrentProcess()->HasSwitch(
148 switches::kDisableWebSockets)) { 146 switches::kDisableWebSockets)) {
149 cmd_line->AppendSwitch(switches::kDisableWebSockets); 147 cmd_line->AppendSwitch(switches::kDisableWebSockets);
150 } 148 }
151 149
152 #if defined(OS_WIN) 150 #if defined(OS_WIN)
153 if (CommandLine::ForCurrentProcess()->HasSwitch( 151 if (CommandLine::ForCurrentProcess()->HasSwitch(
154 switches::kDisableDesktopNotifications)) { 152 switches::kDisableDesktopNotifications)) {
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 627 }
630 } 628 }
631 return false; 629 return false;
632 } 630 }
633 631
634 WorkerProcessHost::WorkerInstance::SenderInfo 632 WorkerProcessHost::WorkerInstance::SenderInfo
635 WorkerProcessHost::WorkerInstance::GetSender() const { 633 WorkerProcessHost::WorkerInstance::GetSender() const {
636 DCHECK(NumSenders() == 1); 634 DCHECK(NumSenders() == 1);
637 return *senders_.begin(); 635 return *senders_.begin();
638 } 636 }
OLDNEW
« no previous file with comments | « chrome/browser/utility_process_host.cc ('k') | chrome/browser/zygote_host_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698