OLD | NEW |
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 #elif defined(OS_POSIX) | 217 #elif defined(OS_POSIX) |
218 current_process_commandline_->InitFromArgv(argc, argv); | 218 current_process_commandline_->InitFromArgv(argc, argv); |
219 #endif | 219 #endif |
220 | 220 |
221 #if defined(OS_LINUX) | 221 #if defined(OS_LINUX) |
222 if (argv) | 222 if (argv) |
223 setproctitle_init(const_cast<char**>(argv)); | 223 setproctitle_init(const_cast<char**>(argv)); |
224 #endif | 224 #endif |
225 } | 225 } |
226 | 226 |
227 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 227 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_NACL) |
228 // static | 228 // static |
229 void CommandLine::SetProcTitle() { | 229 void CommandLine::SetProcTitle() { |
230 // Build a single string which consists of all the arguments separated | 230 // Build a single string which consists of all the arguments separated |
231 // by spaces. We can't actually keep them separate due to the way the | 231 // by spaces. We can't actually keep them separate due to the way the |
232 // setproctitle() function works. | 232 // setproctitle() function works. |
233 std::string title; | 233 std::string title; |
234 bool have_argv0 = false; | 234 bool have_argv0 = false; |
235 #if defined(OS_LINUX) | 235 #if defined(OS_LINUX) |
236 // In Linux we sometimes exec ourselves from /proc/self/exe, but this makes us | 236 // In Linux we sometimes exec ourselves from /proc/self/exe, but this makes us |
237 // show up as "exe" in process listings. Read the symlink /proc/self/exe and | 237 // show up as "exe" in process listings. Read the symlink /proc/self/exe and |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 | 522 |
523 // private | 523 // private |
524 CommandLine::CommandLine() { | 524 CommandLine::CommandLine() { |
525 } | 525 } |
526 | 526 |
527 // static | 527 // static |
528 CommandLine* CommandLine::ForCurrentProcessMutable() { | 528 CommandLine* CommandLine::ForCurrentProcessMutable() { |
529 DCHECK(current_process_commandline_); | 529 DCHECK(current_process_commandline_); |
530 return current_process_commandline_; | 530 return current_process_commandline_; |
531 } | 531 } |
OLD | NEW |