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

Side by Side Diff: base/command_line.cc

Issue 1278973003: Revert of Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « ash/test/display_manager_test_api.cc ('k') | base/debug/proc_maps_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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 if (include_program) 387 if (include_program)
388 SetProgram(other.GetProgram()); 388 SetProgram(other.GetProgram());
389 AppendSwitchesAndArguments(this, other.argv()); 389 AppendSwitchesAndArguments(this, other.argv());
390 } 390 }
391 391
392 void CommandLine::PrependWrapper(const CommandLine::StringType& wrapper) { 392 void CommandLine::PrependWrapper(const CommandLine::StringType& wrapper) {
393 if (wrapper.empty()) 393 if (wrapper.empty())
394 return; 394 return;
395 // The wrapper may have embedded arguments (like "gdb --args"). In this case, 395 // The wrapper may have embedded arguments (like "gdb --args"). In this case,
396 // we don't pretend to do anything fancy, we just split on spaces. 396 // we don't pretend to do anything fancy, we just split on spaces.
397 StringVector wrapper_argv = SplitString( 397 StringVector wrapper_argv;
398 wrapper, FilePath::StringType(1, ' '), base::TRIM_WHITESPACE, 398 SplitString(wrapper, FILE_PATH_LITERAL(' '), &wrapper_argv);
399 base::SPLIT_WANT_ALL);
400 // Prepend the wrapper and update the switches/arguments |begin_args_|. 399 // Prepend the wrapper and update the switches/arguments |begin_args_|.
401 argv_.insert(argv_.begin(), wrapper_argv.begin(), wrapper_argv.end()); 400 argv_.insert(argv_.begin(), wrapper_argv.begin(), wrapper_argv.end());
402 begin_args_ += wrapper_argv.size(); 401 begin_args_ += wrapper_argv.size();
403 } 402 }
404 403
405 #if defined(OS_WIN) 404 #if defined(OS_WIN)
406 void CommandLine::ParseFromString(const string16& command_line) { 405 void CommandLine::ParseFromString(const string16& command_line) {
407 string16 command_line_string; 406 string16 command_line_string;
408 TrimWhitespace(command_line, TRIM_ALL, &command_line_string); 407 TrimWhitespace(command_line, TRIM_ALL, &command_line_string);
409 if (command_line_string.empty()) 408 if (command_line_string.empty())
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 return params; 464 return params;
466 } 465 }
467 466
468 void CommandLine::ResetStringPieces() { 467 void CommandLine::ResetStringPieces() {
469 switches_by_stringpiece_.clear(); 468 switches_by_stringpiece_.clear();
470 for (const auto& entry : switches_) 469 for (const auto& entry : switches_)
471 switches_by_stringpiece_[entry.first] = &(entry.second); 470 switches_by_stringpiece_[entry.first] = &(entry.second);
472 } 471 }
473 472
474 } // namespace base 473 } // namespace base
OLDNEW
« no previous file with comments | « ash/test/display_manager_test_api.cc ('k') | base/debug/proc_maps_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698