| 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 <memory> |
| 10 |
| 9 #include "base/debug/crash_logging.h" | 11 #include "base/debug/crash_logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
| 13 #include "chrome/common/crash_keys.h" | 14 #include "chrome/common/crash_keys.h" |
| 14 #include "chrome/installer/util/google_update_settings.h" | 15 #include "chrome/installer/util/google_update_settings.h" |
| 15 #include "components/metrics/client_info.h" | 16 #include "components/metrics/client_info.h" |
| 16 | 17 |
| 17 namespace child_process_logging { | 18 namespace child_process_logging { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 56 |
| 56 void Init() { | 57 void Init() { |
| 57 crash_keys::RegisterChromeCrashKeys(); | 58 crash_keys::RegisterChromeCrashKeys(); |
| 58 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueTrampoline, | 59 base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueTrampoline, |
| 59 &ClearCrashKeyValueTrampoline); | 60 &ClearCrashKeyValueTrampoline); |
| 60 | 61 |
| 61 // This would be handled by BreakpadClient::SetCrashClientIdFromGUID(), but | 62 // This would be handled by BreakpadClient::SetCrashClientIdFromGUID(), but |
| 62 // because of the aforementioned issue, crash keys aren't ready yet at the | 63 // because of the aforementioned issue, crash keys aren't ready yet at the |
| 63 // time of Breakpad initialization, load the client id backed up in Google | 64 // time of Breakpad initialization, load the client id backed up in Google |
| 64 // Update settings instead. | 65 // Update settings instead. |
| 65 scoped_ptr<metrics::ClientInfo> client_info = | 66 std::unique_ptr<metrics::ClientInfo> client_info = |
| 66 GoogleUpdateSettings::LoadMetricsClientInfo(); | 67 GoogleUpdateSettings::LoadMetricsClientInfo(); |
| 67 if (client_info) | 68 if (client_info) |
| 68 crash_keys::SetMetricsClientIdFromGUID(client_info->client_id); | 69 crash_keys::SetMetricsClientIdFromGUID(client_info->client_id); |
| 69 } | 70 } |
| 70 | 71 |
| 71 } // namespace child_process_logging | 72 } // namespace child_process_logging |
| OLD | NEW |