diff options
author | nileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-09 01:53:38 +0000 |
---|---|---|
committer | nileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-09 01:53:38 +0000 |
commit | ae038209c9dcc4f18c3a93e060f3b8889dd97f34 (patch) | |
tree | 4d6118b5459e686d55caa177c024b9ac271f9baa | |
parent | 0ffd0087ef9804a33c87d956f41618040a423184 (diff) | |
download | chromium_src-ae038209c9dcc4f18c3a93e060f3b8889dd97f34.zip chromium_src-ae038209c9dcc4f18c3a93e060f3b8889dd97f34.tar.gz chromium_src-ae038209c9dcc4f18c3a93e060f3b8889dd97f34.tar.bz2 |
Android: Set client id for renderer crash dumps.
BUG=178750
Review URL: https://chromiumcodereview.appspot.com/12463029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187107 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/breakpad_linux.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index d507095..c540046 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -212,6 +212,19 @@ void PopulateGUIDAndURLAndDistro(char* guid, size_t* guid_len_param, *distro_len_param = distro_len; } +void SetClientIdFromCommandLine(const CommandLine& command_line) { + // Get the guid and linux distro from the command line switch. + std::string switch_value = + command_line.GetSwitchValueASCII(switches::kEnableCrashReporter); + size_t separator = switch_value.find(","); + if (separator != std::string::npos) { + child_process_logging::SetClientId(switch_value.substr(0, separator)); + base::SetLinuxDistro(switch_value.substr(separator + 1)); + } else { + child_process_logging::SetClientId(switch_value); + } +} + // MIME substrings. const char g_rn[] = "\r\n"; const char g_form_data_msg[] = "Content-Disposition: form-data; name=\""; @@ -596,7 +609,7 @@ void EnableNonBrowserCrashDumping(int minidump_fd) { // This will guarantee that the BuildInfo has been initialized and subsequent // calls will not require memory allocation. base::android::BuildInfo::GetInstance(); - child_process_logging::SetClientId("Android"); + SetClientIdFromCommandLine(*CommandLine::ForCurrentProcess()); // On Android, the current sandboxing uses process isolation, in which the // child process runs with a different UID. That breaks the normal crash @@ -1439,16 +1452,7 @@ void InitCrashReporter() { // simplicity. if (!parsed_command_line.HasSwitch(switches::kEnableCrashReporter)) return; - // Get the guid and linux distro from the command line switch. - std::string switch_value = - parsed_command_line.GetSwitchValueASCII(switches::kEnableCrashReporter); - size_t separator = switch_value.find(","); - if (separator != std::string::npos) { - child_process_logging::SetClientId(switch_value.substr(0, separator)); - base::SetLinuxDistro(switch_value.substr(separator + 1)); - } else { - child_process_logging::SetClientId(switch_value); - } + SetClientIdFromCommandLine(parsed_command_line); EnableNonBrowserCrashDumping(); VLOG(1) << "Non Browser crash dumping enabled for: " << process_type; #endif // #if defined(OS_ANDROID) |