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
diff --git a/chrome/common/child_process_logging_win.cc b/chrome/common/child_process_logging_win.cc
index 046244f..d587f2e 100644
--- a/chrome/common/child_process_logging_win.cc
+++ b/chrome/common/child_process_logging_win.cc
@@ -73,6 +73,14 @@
   (set_client_id)(wstr.c_str());
 }
 
+std::string GetClientId() {
+  std::wstring wstr_client_id;
+  if (GoogleUpdateSettings::GetMetricsId(&wstr_client_id))
+    return WideToASCII(wstr_client_id);
+  else
+    return std::string();
+}
+
 void SetActiveExtensions(const std::set<std::string>& extension_ids) {
   static MainSetExtensionID set_extension_id = NULL;
   if (!set_extension_id) {