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/common/child_process_logging.h | |
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/common/child_process_logging.h')
-rw-r--r-- | chrome/common/child_process_logging.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/common/child_process_logging.h b/chrome/common/child_process_logging.h index 6de7bfe..bdc5a44 100644 --- a/chrome/common/child_process_logging.h +++ b/chrome/common/child_process_logging.h @@ -23,6 +23,13 @@ static const int kMaxReportedActiveExtensions = 10; namespace child_process_logging { +#if defined(OS_LINUX) +// These are declared here so the crash reporter can access them directly in +// compromised context without going through the standard library. +extern char g_active_url[]; +extern char g_client_id[]; +#endif + // Sets the URL that is logged if the child process crashes. Use GURL() to clear // the URL. void SetActiveURL(const GURL& url); @@ -30,6 +37,10 @@ void SetActiveURL(const GURL& url); // Sets the Client ID that is used as GUID if a Chrome process crashes. void SetClientId(const std::string& client_id); +// Gets the Client ID to be used as GUID for crash reporting. Returns the client +// id in |client_id| if it's known, an empty string otherwise. +std::string GetClientId(); + // Sets the list of "active" extensions in this process. We overload "active" to // mean different things depending on the process type: // - browser: all enabled extensions |