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

Side by Side Diff: content/common/set_process_title.cc

Issue 7857019: Basic scaffolding for a "content shell", i.e. test browser over the content module. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | « content/common/set_process_title.h ('k') | content/common/set_process_title_linux.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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) && !defined(OS_SOLARIS) 26 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_SOLARIS)
27 27
28 void SetProcessTitleFromCommandLine(char** main_argv) { 28 void SetProcessTitleFromCommandLine(const 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)
37 setproctitle_init(main_argv); 37 setproctitle_init(main_argv);
38 38
(...skipping 28 matching lines...) Expand all
67 title += command_line->argv()[i]; 67 title += command_line->argv()[i];
68 } 68 }
69 // Disable prepending argv[0] with '-' if we prepended it ourselves above. 69 // Disable prepending argv[0] with '-' if we prepended it ourselves above.
70 setproctitle(have_argv0 ? "-%s" : "%s", title.c_str()); 70 setproctitle(have_argv0 ? "-%s" : "%s", title.c_str());
71 } 71 }
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(const char** /* main_argv */) {
78 } 78 }
79 79
80 #endif 80 #endif
81 81
OLDNEW
« no previous file with comments | « content/common/set_process_title.h ('k') | content/common/set_process_title_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698