| 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 "content/common/set_process_title.h" | 5 #include "content/common/set_process_title.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #if defined(OS_POSIX) | 13 #if defined(OS_POSIX) |
| 14 #include <limits.h> | 14 #include <limits.h> |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 #include <unistd.h> | 16 #include <unistd.h> |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 #if defined(OS_LINUX) | 19 #if defined(OS_LINUX) |
| 20 #include <sys/prctl.h> | 20 #include <sys/prctl.h> |
| 21 | 21 |
| 22 // Linux/glibc doesn't natively have setproctitle(). | 22 // Linux/glibc doesn't natively have setproctitle(). |
| 23 #include "content/common/set_process_title_linux.h" | 23 #include "content/common/set_process_title_linux.h" |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 26 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS) |
| 27 | 27 |
| 28 void SetProcessTitleFromCommandLine(char** main_argv) { | 28 void SetProcessTitleFromCommandLine(char** main_argv) { |
| 29 // Build a single string which consists of all the arguments separated | 29 // Build a single string which consists of all the arguments separated |
| 30 // by spaces. We can't actually keep them separate due to the way the | 30 // by spaces. We can't actually keep them separate due to the way the |
| 31 // setproctitle() function works. | 31 // setproctitle() function works. |
| 32 std::string title; | 32 std::string title; |
| 33 bool have_argv0 = false; | 33 bool have_argv0 = false; |
| 34 | 34 |
| 35 #if defined(OS_LINUX) | 35 #if defined(OS_LINUX) |
| 36 if (main_argv) | 36 if (main_argv) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 #else | 73 #else |
| 74 | 74 |
| 75 // All other systems (basically Windows & Mac) have no need or way to implement | 75 // All other systems (basically Windows & Mac) have no need or way to implement |
| 76 // this function. | 76 // this function. |
| 77 void SetProcessTitleFromCommandLine(char** /* main_argv */) { | 77 void SetProcessTitleFromCommandLine(char** /* main_argv */) { |
| 78 } | 78 } |
| 79 | 79 |
| 80 #endif | 80 #endif |
| 81 | 81 |
| OLD | NEW |