diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 08:55:22 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 08:55:22 +0000 |
commit | 6dde9d7f2a99851b0f84671832f072799dd3f8d5 (patch) | |
tree | 133dc5f7a37c0c1bf0e65f3ab32ef081a3c3f293 /chrome/browser/browser_child_process_host.cc | |
parent | 31de519d7a62e532c2bdded403a451c9f3f972da (diff) | |
download | chromium_src-6dde9d7f2a99851b0f84671832f072799dd3f8d5.zip chromium_src-6dde9d7f2a99851b0f84671832f072799dd3f8d5.tar.gz chromium_src-6dde9d7f2a99851b0f84671832f072799dd3f8d5.tar.bz2 |
Make crash reporting client_id accessible through child_process_logging.
On Mac and Linux, keep the client id in a global variable kept by the
child_process_logging implementations. This allows to read it in a
thread safe fashion when starting a child process.
Also replace std::string with statically allocated buffers for the
various items we add to the crash reports. This allows to properly
handle crashes upon shutdown (std::string would run its destructor,
invalidating the memory).
BUG=53231
TEST=Crash reporting should still work
Review URL: http://codereview.chromium.org/3186028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_child_process_host.cc')
-rw-r--r-- | chrome/browser/browser_child_process_host.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/chrome/browser/browser_child_process_host.cc b/chrome/browser/browser_child_process_host.cc index cf2dc15..36f8411 100644 --- a/chrome/browser/browser_child_process_host.cc +++ b/chrome/browser/browser_child_process_host.cc @@ -14,9 +14,9 @@ #include "base/stl_util-inl.h" #include "base/string_util.h" #include "chrome/app/breakpad_mac.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths_internal.h" #include "chrome/common/chrome_switches.h" @@ -79,16 +79,13 @@ void BrowserChildProcessHost::SetCrashReporterCommandLine( CommandLine* command_line) { #if defined(USE_LINUX_BREAKPAD) if (IsCrashReporterEnabled()) { - std::string client_id = - g_browser_process->local_state()->GetString(prefs::kMetricsClientID); command_line->AppendSwitchASCII(switches::kEnableCrashReporter, - client_id + "," + base::GetLinuxDistro()); + child_process_logging::GetClientId() + "," + base::GetLinuxDistro()); } #elif defined(OS_MACOSX) if (IsCrashReporterEnabled()) { - std::string client_id = - g_browser_process->local_state()->GetString(prefs::kMetricsClientID); - command_line->AppendSwitchASCII(switches::kEnableCrashReporter, client_id); + command_line->AppendSwitchASCII(switches::kEnableCrashReporter, + child_process_logging::GetClientId()); } #endif // OS_MACOSX } |