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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 void Init() { | 60 void Init() { |
61 // Note: on other platforms, this is set up during Breakpad initialization, | 61 // Note: on other platforms, this is set up during Breakpad initialization, |
62 // in ChromeBreakpadClient. But on Windows, that is before the DLL module is | 62 // in ChromeBreakpadClient. But on Windows, that is before the DLL module is |
63 // loaded, which is a prerequisite of the crash key system. | 63 // loaded, which is a prerequisite of the crash key system. |
64 crash_keys::RegisterChromeCrashKeys(); | 64 crash_keys::RegisterChromeCrashKeys(); |
65 base::debug::SetCrashKeyReportingFunctions( | 65 base::debug::SetCrashKeyReportingFunctions( |
66 &SetCrashKeyValueTrampoline, &ClearCrashKeyValueTrampoline); | 66 &SetCrashKeyValueTrampoline, &ClearCrashKeyValueTrampoline); |
67 | 67 |
68 // This would be handled by BreakpadClient::SetClientID(), but because of the | 68 // This would be handled by BreakpadClient::SetCrashClientIdFromGUID(), but |
69 // aforementioned issue, crash keys aren't ready yet at the time of Breakpad | 69 // because of the aforementioned issue, crash keys aren't ready yet at the |
70 // initialization. | 70 // time of Breakpad initialization, load the client id backed up in Google |
71 std::string client_id; | 71 // Update settings instead. |
72 if (GoogleUpdateSettings::GetMetricsId(&client_id)) | 72 std::string client_guid; |
73 base::debug::SetCrashKeyValue(crash_keys::kClientID, client_id); | 73 if (GoogleUpdateSettings::LoadMetricsClientId(&client_guid)) |
| 74 crash_keys::SetCrashClientIdFromGUID(client_guid); |
74 } | 75 } |
75 | 76 |
76 } // namespace child_process_logging | 77 } // namespace child_process_logging |
OLD | NEW |