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

Side by Side Diff: chrome/plugin/plugin_main.cc

Issue 490028: Linux: use readlink() and prctl() in SetProcTitle() to fix "exe" showing in process listings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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
« base/command_line.cc ('K') | « base/setproctitle_linux.h ('k') | no next file » | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "app/hi_res_timer_manager.h" 7 #include "app/hi_res_timer_manager.h"
8 #include "app/system_monitor.h" 8 #include "app/system_monitor.h"
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include "app/win_util.h" 10 #include "app/win_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #endif 55 #endif
56 MessageLoop main_message_loop(MessageLoop::TYPE_UI); 56 MessageLoop main_message_loop(MessageLoop::TYPE_UI);
57 std::wstring app_name = chrome::kBrowserAppName; 57 std::wstring app_name = chrome::kBrowserAppName;
58 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str()); 58 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str());
59 59
60 SystemMonitor system_monitor; 60 SystemMonitor system_monitor;
61 HighResolutionTimerManager high_resolution_timer_manager; 61 HighResolutionTimerManager high_resolution_timer_manager;
62 62
63 const CommandLine& parsed_command_line = parameters.command_line_; 63 const CommandLine& parsed_command_line = parameters.command_line_;
64 64
65 #if defined(OS_WIN) 65 #if defined(OS_LINUX)
66 // On Linux we exec ourselves from /proc/self/exe, but that makes the
67 // process name that shows up in "ps" etc. for plugins show as "exe"
68 // instead of "chrome" or something reasonable. Try to fix it.
69 CommandLine::SetProcTitle();
70 #elif defined(OS_WIN)
66 sandbox::TargetServices* target_services = 71 sandbox::TargetServices* target_services =
67 parameters.sandbox_info_.TargetServices(); 72 parameters.sandbox_info_.TargetServices();
68 73
69 CoInitialize(NULL); 74 CoInitialize(NULL);
70 DLOG(INFO) << "Started plugin with " << 75 DLOG(INFO) << "Started plugin with " <<
71 parsed_command_line.command_line_string(); 76 parsed_command_line.command_line_string();
72 77
73 HMODULE sandbox_test_module = NULL; 78 HMODULE sandbox_test_module = NULL;
74 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox) || 79 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox) ||
75 !parsed_command_line.HasSwitch(switches::kSafePlugins); 80 !parsed_command_line.HasSwitch(switches::kSafePlugins);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 122
118 MessageLoop::current()->Run(); 123 MessageLoop::current()->Run();
119 } 124 }
120 125
121 #if defined(OS_WIN) 126 #if defined(OS_WIN)
122 CoUninitialize(); 127 CoUninitialize();
123 #endif 128 #endif
124 129
125 return 0; 130 return 0;
126 } 131 }
OLDNEW
« base/command_line.cc ('K') | « base/setproctitle_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698