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

Side by Side Diff: base/command_line.cc

Issue 4928002: Changing the installer switches from wchar_t[] to char[].... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/command_line_unittest.cc » ('j') | base/command_line_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #elif defined(OS_POSIX) 10 #elif defined(OS_POSIX)
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 command_line_string_.append(L" "); 424 command_line_string_.append(L" ");
425 command_line_string_.append(WindowsStyleQuote(value)); 425 command_line_string_.append(WindowsStyleQuote(value));
426 args_.push_back(value); 426 args_.push_back(value);
427 } 427 }
428 428
429 void CommandLine::AppendArguments(const CommandLine& other, 429 void CommandLine::AppendArguments(const CommandLine& other,
430 bool include_program) { 430 bool include_program) {
431 // Verify include_program is used correctly. 431 // Verify include_program is used correctly.
432 // Logic could be shorter but this is clearer. 432 // Logic could be shorter but this is clearer.
433 DCHECK_EQ(include_program, !other.GetProgram().empty()); 433 DCHECK_EQ(include_program, !other.GetProgram().empty());
434 command_line_string_ += L" " + other.command_line_string_; 434 if (include_program) {
435 DCHECK(program_.empty());
436 program_ = other.program_;
437 }
438
439 if (!command_line_string_.empty())
440 command_line_string_ += L' ';
441
442 command_line_string_ += other.command_line_string_;
443
435 std::map<std::string, StringType>::const_iterator i; 444 std::map<std::string, StringType>::const_iterator i;
436 for (i = other.switches_.begin(); i != other.switches_.end(); ++i) 445 for (i = other.switches_.begin(); i != other.switches_.end(); ++i)
437 switches_[i->first] = i->second; 446 switches_[i->first] = i->second;
438 } 447 }
439 448
440 void CommandLine::PrependWrapper(const std::wstring& wrapper) { 449 void CommandLine::PrependWrapper(const std::wstring& wrapper) {
441 if (wrapper.empty()) 450 if (wrapper.empty())
442 return; 451 return;
443 // The wrapper may have embedded arguments (like "gdb --args"). In this case, 452 // The wrapper may have embedded arguments (like "gdb --args"). In this case,
444 // we don't pretend to do anything fancy, we just split on spaces. 453 // we don't pretend to do anything fancy, we just split on spaces.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 531
523 // private 532 // private
524 CommandLine::CommandLine() { 533 CommandLine::CommandLine() {
525 } 534 }
526 535
527 // static 536 // static
528 CommandLine* CommandLine::ForCurrentProcessMutable() { 537 CommandLine* CommandLine::ForCurrentProcessMutable() {
529 DCHECK(current_process_commandline_); 538 DCHECK(current_process_commandline_);
530 return current_process_commandline_; 539 return current_process_commandline_;
531 } 540 }
OLDNEW
« no previous file with comments | « no previous file | base/command_line_unittest.cc » ('j') | base/command_line_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698