summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser_main.cc6
-rw-r--r--chrome/renderer/renderer_main.cc9
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index ee398bf..94d898a 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -65,6 +65,7 @@
#if defined(OS_LINUX)
#include "chrome/app/breakpad_linux.h"
+#include <sys/prctl.h>
#endif
// TODO(port): several win-only methods have been pulled out of this, but
@@ -268,6 +269,11 @@ int BrowserMain(const MainFunctionParams& parameters) {
std::wstring app_name = chrome::kBrowserAppName;
std::string thread_name_string = WideToASCII(app_name + L"_BrowserMain");
+#if defined(OS_LINUX)
+ // Set the process name so it is easier to distinguish this process from
+ // others. The process name will be trimmed to 15 characters.
+ prctl(PR_SET_NAME, WideToASCII(app_name + L"_Browser").c_str(), 0, 0, 0);
+#endif
const char* thread_name = thread_name_string.c_str();
PlatformThread::SetName(thread_name);
main_message_loop.set_thread_name(thread_name);
diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc
index fc4d291..7c40767 100644
--- a/chrome/renderer/renderer_main.cc
+++ b/chrome/renderer/renderer_main.cc
@@ -25,6 +25,10 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#if defined(OS_LINUX)
+#include <sys/prctl.h>
+#endif
+
// This function provides some ways to test crash and assertion handling
// behavior of the renderer.
static void HandleRendererErrorTestParameters(const CommandLine& command_line) {
@@ -79,6 +83,11 @@ int RendererMain(const MainFunctionParams& parameters) {
MessageLoopForIO main_message_loop;
std::wstring app_name = chrome::kBrowserAppName;
PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str());
+#if defined(OS_LINUX)
+ // Set the process name so it is easier to distinguish this process from
+ // others. The process name will be trimmed to 15 characters.
+ prctl(PR_SET_NAME, WideToASCII(app_name + L"_Renderer").c_str(), 0, 0, 0);
+#endif
// Initialize the SystemMonitor
base::SystemMonitor::Start();