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

Side by Side Diff: chrome/browser/utility_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
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/utility_process_host.h" 5 #include "chrome/browser/utility_process_host.h"
6 6
7 #include "app/app_switches.h" 7 #include "app/app_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 FilePath exe_path = GetUtilityProcessCmd(); 74 FilePath exe_path = GetUtilityProcessCmd();
75 if (exe_path.empty()) { 75 if (exe_path.empty()) {
76 NOTREACHED() << "Unable to get utility process binary name."; 76 NOTREACHED() << "Unable to get utility process binary name.";
77 return false; 77 return false;
78 } 78 }
79 79
80 CommandLine* cmd_line = new CommandLine(exe_path); 80 CommandLine* cmd_line = new CommandLine(exe_path);
81 cmd_line->AppendSwitchWithValue(switches::kProcessType, 81 cmd_line->AppendSwitchWithValue(switches::kProcessType,
82 switches::kUtilityProcess); 82 switches::kUtilityProcess);
83 cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, 83 cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, channel_id());
84 ASCIIToWide(channel_id()));
85 std::string locale = g_browser_process->GetApplicationLocale(); 84 std::string locale = g_browser_process->GetApplicationLocale();
86 cmd_line->AppendSwitchWithValue(switches::kLang, locale); 85 cmd_line->AppendSwitchWithValue(switches::kLang, locale);
87 86
88 SetCrashReporterCommandLine(cmd_line); 87 SetCrashReporterCommandLine(cmd_line);
89 88
90 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); 89 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
91 if (browser_command_line.HasSwitch(switches::kChromeFrame)) 90 if (browser_command_line.HasSwitch(switches::kChromeFrame))
92 cmd_line->AppendSwitch(switches::kChromeFrame); 91 cmd_line->AppendSwitch(switches::kChromeFrame);
93 92
94 if (browser_command_line.HasSwitch(switches::kEnableApps)) 93 if (browser_command_line.HasSwitch(switches::kEnableApps))
(...skipping 12 matching lines...) Expand all
107 // Linux updating. 106 // Linux updating.
108 bool has_cmd_prefix = browser_command_line.HasSwitch( 107 bool has_cmd_prefix = browser_command_line.HasSwitch(
109 switches::kUtilityCmdPrefix); 108 switches::kUtilityCmdPrefix);
110 if (has_cmd_prefix) { 109 if (has_cmd_prefix) {
111 // launch the utility child process with some prefix (usually "xterm -e gdb 110 // launch the utility child process with some prefix (usually "xterm -e gdb
112 // --args"). 111 // --args").
113 cmd_line->PrependWrapper(browser_command_line.GetSwitchValue( 112 cmd_line->PrependWrapper(browser_command_line.GetSwitchValue(
114 switches::kUtilityCmdPrefix)); 113 switches::kUtilityCmdPrefix));
115 } 114 }
116 115
117 cmd_line->AppendSwitchWithValue(switches::kUtilityProcessAllowedDir, 116 cmd_line->AppendSwitchPath(switches::kUtilityProcessAllowedDir, exposed_dir);
118 exposed_dir.value().c_str());
119 #endif 117 #endif
120 118
121 Launch( 119 Launch(
122 #if defined(OS_WIN) 120 #if defined(OS_WIN)
123 exposed_dir, 121 exposed_dir,
124 #elif defined(OS_POSIX) 122 #elif defined(OS_POSIX)
125 false, 123 false,
126 base::environment_vector(), 124 base::environment_vector(),
127 #endif 125 #endif
128 cmd_line); 126 cmd_line);
(...skipping 27 matching lines...) Expand all
156 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseUpdateManifest_Succeeded, 154 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseUpdateManifest_Succeeded,
157 Client::OnParseUpdateManifestSucceeded) 155 Client::OnParseUpdateManifestSucceeded)
158 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseUpdateManifest_Failed, 156 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseUpdateManifest_Failed,
159 Client::OnParseUpdateManifestFailed) 157 Client::OnParseUpdateManifestFailed)
160 IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Succeeded, 158 IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Succeeded,
161 Client::OnDecodeImageSucceeded) 159 Client::OnDecodeImageSucceeded)
162 IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Failed, 160 IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Failed,
163 Client::OnDecodeImageFailed) 161 Client::OnDecodeImageFailed)
164 IPC_END_MESSAGE_MAP_EX() 162 IPC_END_MESSAGE_MAP_EX()
165 } 163 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/browser/worker_host/worker_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698