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

Side by Side Diff: base/command_line.cc

Issue 2104012: Fixed a TODO in data export of net-internals, added Chrome version and comman... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « base/command_line.h ('k') | chrome/browser/dom_ui/net_internals_ui.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) 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 for (size_t i = 0; i < loose_values_.size(); ++i) 296 for (size_t i = 0; i < loose_values_.size(); ++i)
297 values.push_back(base::SysNativeMBToWide(loose_values_[i])); 297 values.push_back(base::SysNativeMBToWide(loose_values_[i]));
298 return values; 298 return values;
299 } 299 }
300 std::wstring CommandLine::program() const { 300 std::wstring CommandLine::program() const {
301 DCHECK_GT(argv_.size(), 0U); 301 DCHECK_GT(argv_.size(), 0U);
302 return base::SysNativeMBToWide(argv_[0]); 302 return base::SysNativeMBToWide(argv_[0]);
303 } 303 }
304 #endif 304 #endif
305 305
306 #if defined(OS_POSIX)
307 std::string CommandLine::command_line_string() const {
308 return JoinString(argv_, ' ');
309 }
310 #endif
306 311
307 // static 312 // static
308 std::wstring CommandLine::PrefixedSwitchString( 313 std::wstring CommandLine::PrefixedSwitchString(
309 const std::string& switch_string) { 314 const std::string& switch_string) {
310 #if defined(OS_WIN) 315 #if defined(OS_WIN)
311 return kSwitchPrefixes[0] + ASCIIToWide(switch_string); 316 return kSwitchPrefixes[0] + ASCIIToWide(switch_string);
312 #else 317 #else
313 return ASCIIToWide(kSwitchPrefixes[0] + switch_string); 318 return ASCIIToWide(kSwitchPrefixes[0] + switch_string);
314 #endif 319 #endif
315 } 320 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 void CommandLine::PrependWrapper(const std::wstring& wrapper_wide) { 430 void CommandLine::PrependWrapper(const std::wstring& wrapper_wide) {
426 // The wrapper may have embedded arguments (like "gdb --args"). In this case, 431 // The wrapper may have embedded arguments (like "gdb --args"). In this case,
427 // we don't pretend to do anything fancy, we just split on spaces. 432 // we don't pretend to do anything fancy, we just split on spaces.
428 const std::string wrapper = base::SysWideToNativeMB(wrapper_wide); 433 const std::string wrapper = base::SysWideToNativeMB(wrapper_wide);
429 std::vector<std::string> wrapper_and_args; 434 std::vector<std::string> wrapper_and_args;
430 SplitString(wrapper, ' ', &wrapper_and_args); 435 SplitString(wrapper, ' ', &wrapper_and_args);
431 argv_.insert(argv_.begin(), wrapper_and_args.begin(), wrapper_and_args.end()); 436 argv_.insert(argv_.begin(), wrapper_and_args.begin(), wrapper_and_args.end());
432 } 437 }
433 438
434 #endif 439 #endif
OLDNEW
« no previous file with comments | « base/command_line.h ('k') | chrome/browser/dom_ui/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698