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

Side by Side Diff: base/command_line.cc

Issue 21190: POSIX: add command line option to launch renderers in a wrapper (Closed)
Patch Set: ... Created 11 years, 10 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 | « base/command_line.h ('k') | chrome/browser/renderer_host/browser_render_process_host.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/command_line.h" 5 #include "base/command_line.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif 10 #endif
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // Logic could be shorter but this is clearer. 327 // Logic could be shorter but this is clearer.
328 DCHECK(include_program ? !other.program().empty() : other.program().empty()); 328 DCHECK(include_program ? !other.program().empty() : other.program().empty());
329 329
330 size_t first_arg = include_program ? 0 : 1; 330 size_t first_arg = include_program ? 0 : 1;
331 for (size_t i = first_arg; i < other.argv_.size(); ++i) 331 for (size_t i = first_arg; i < other.argv_.size(); ++i)
332 argv_.push_back(other.argv_[i]); 332 argv_.push_back(other.argv_[i]);
333 std::map<std::string, StringType>::const_iterator i; 333 std::map<std::string, StringType>::const_iterator i;
334 for (i = other.switches_.begin(); i != other.switches_.end(); ++i) 334 for (i = other.switches_.begin(); i != other.switches_.end(); ++i)
335 switches_[i->first] = i->second; 335 switches_[i->first] = i->second;
336 } 336 }
337
338 void CommandLine::PrependWrapper(const std::wstring& wrapper_wide) {
339 // The wrapper may have embedded arguments (like "gdb --args"). In this case,
340 // we don't pretend to do anything fancy, we just split on spaces.
341 const std::string wrapper = WideToASCII(wrapper_wide);
342 std::vector<std::string> wrapper_and_args;
343 SplitString(wrapper, ' ', &wrapper_and_args);
344 argv_.insert(argv_.begin(), wrapper_and_args.begin(), wrapper_and_args.end());
345 }
346
337 #endif 347 #endif
338 348
OLDNEW
« no previous file with comments | « base/command_line.h ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698