| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/child_process_logging.h" | 5 #include "chrome/common/child_process_logging.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/common/chrome_constants.h" | 12 #include "chrome/common/chrome_constants.h" |
| 12 #include "chrome/common/crash_keys.h" | 13 #include "chrome/common/crash_keys.h" |
| 13 #include "chrome/installer/util/google_update_settings.h" | 14 #include "chrome/installer/util/google_update_settings.h" |
| 15 #include "components/metrics/client_info.h" |
| 14 | 16 |
| 15 namespace child_process_logging { | 17 namespace child_process_logging { |
| 16 | 18 |
| 17 namespace { | 19 namespace { |
| 18 | 20 |
| 19 // exported in breakpad_win.cc: | 21 // exported in breakpad_win.cc: |
| 20 // void __declspec(dllexport) __cdecl SetCrashKeyValueImpl. | 22 // void __declspec(dllexport) __cdecl SetCrashKeyValueImpl. |
| 21 typedef void (__cdecl *SetCrashKeyValue)(const wchar_t*, const wchar_t*); | 23 typedef void (__cdecl *SetCrashKeyValue)(const wchar_t*, const wchar_t*); |
| 22 | 24 |
| 23 // exported in breakpad_win.cc: | 25 // exported in breakpad_win.cc: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // in ChromeBreakpadClient. But on Windows, that is before the DLL module is | 64 // in ChromeBreakpadClient. But on Windows, that is before the DLL module is |
| 63 // loaded, which is a prerequisite of the crash key system. | 65 // loaded, which is a prerequisite of the crash key system. |
| 64 crash_keys::RegisterChromeCrashKeys(); | 66 crash_keys::RegisterChromeCrashKeys(); |
| 65 base::debug::SetCrashKeyReportingFunctions( | 67 base::debug::SetCrashKeyReportingFunctions( |
| 66 &SetCrashKeyValueTrampoline, &ClearCrashKeyValueTrampoline); | 68 &SetCrashKeyValueTrampoline, &ClearCrashKeyValueTrampoline); |
| 67 | 69 |
| 68 // This would be handled by BreakpadClient::SetCrashClientIdFromGUID(), but | 70 // This would be handled by BreakpadClient::SetCrashClientIdFromGUID(), but |
| 69 // because of the aforementioned issue, crash keys aren't ready yet at the | 71 // because of the aforementioned issue, crash keys aren't ready yet at the |
| 70 // time of Breakpad initialization, load the client id backed up in Google | 72 // time of Breakpad initialization, load the client id backed up in Google |
| 71 // Update settings instead. | 73 // Update settings instead. |
| 72 std::string client_guid; | 74 scoped_ptr<metrics::ClientInfo> client_info = |
| 73 if (GoogleUpdateSettings::LoadMetricsClientId(&client_guid)) | 75 GoogleUpdateSettings::LoadMetricsClientInfo(); |
| 74 crash_keys::SetCrashClientIdFromGUID(client_guid); | 76 if (client_info) |
| 77 crash_keys::SetCrashClientIdFromGUID(client_info->client_id); |
| 75 } | 78 } |
| 76 | 79 |
| 77 } // namespace child_process_logging | 80 } // namespace child_process_logging |
| OLD | NEW |