OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/installer/setup/installer_crash_reporter_client.h" | 5 #include "chrome/installer/setup/installer_crash_reporter_client.h" |
6 | 6 |
7 #include "base/debug/crash_logging.h" | 7 #include "base/debug/crash_logging.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/win/registry.h" | 12 #include "base/win/registry.h" |
13 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
14 #include "chrome/common/chrome_version.h" | 14 #include "chrome/common/chrome_version.h" |
15 #include "chrome/common/env_vars.h" | 15 #include "chrome/common/env_vars.h" |
16 #include "chrome/installer/setup/installer_crash_keys.h" | |
16 #include "chrome/installer/util/google_update_settings.h" | 17 #include "chrome/installer/util/google_update_settings.h" |
17 #include "components/crash/core/common/crash_keys.h" | 18 #include "components/crash/core/common/crash_keys.h" |
18 | 19 |
19 InstallerCrashReporterClient::InstallerCrashReporterClient( | 20 InstallerCrashReporterClient::InstallerCrashReporterClient( |
20 bool is_per_user_install) | 21 bool is_per_user_install) |
21 : is_per_user_install_(is_per_user_install) { | 22 : is_per_user_install_(is_per_user_install) { |
22 } | 23 } |
23 | 24 |
24 InstallerCrashReporterClient::~InstallerCrashReporterClient() = default; | 25 InstallerCrashReporterClient::~InstallerCrashReporterClient() = default; |
25 | 26 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 } | 118 } |
118 | 119 |
119 bool InstallerCrashReporterClient::GetCrashDumpLocation( | 120 bool InstallerCrashReporterClient::GetCrashDumpLocation( |
120 base::FilePath* crash_dir) { | 121 base::FilePath* crash_dir) { |
121 // TODO(grt): Is there a reason to support the BREAKPAD_DUMP_LOCATION | 122 // TODO(grt): Is there a reason to support the BREAKPAD_DUMP_LOCATION |
122 // environment variable? | 123 // environment variable? |
123 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); | 124 return PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); |
124 } | 125 } |
125 | 126 |
126 size_t InstallerCrashReporterClient::RegisterCrashKeys() { | 127 size_t InstallerCrashReporterClient::RegisterCrashKeys() { |
127 const base::debug::CrashKey kKeys[] = { | 128 std::vector<base::debug::CrashKey> keys; |
128 { crash_keys::kClientId, crash_keys::kSmallSize }, | 129 installer::RegisterCrashKeys(keys); |
129 }; | 130 return base::debug::InitCrashKeys(&keys.at(0), keys.size(), |
grt (UTC plus 2)
2015/11/26 19:24:45
&keys.at(0) -> keys.data()
Joe Mason
2015/11/26 20:49:06
Done.
| |
130 | |
131 return base::debug::InitCrashKeys(&kKeys[0], arraysize(kKeys), | |
132 crash_keys::kChunkMaxLength); | 131 crash_keys::kChunkMaxLength); |
133 } | 132 } |
134 | 133 |
135 bool InstallerCrashReporterClient::IsRunningUnattended() { | 134 bool InstallerCrashReporterClient::IsRunningUnattended() { |
136 scoped_ptr<base::Environment> env(base::Environment::Create()); | 135 scoped_ptr<base::Environment> env(base::Environment::Create()); |
137 return env->HasVar(env_vars::kHeadless); | 136 return env->HasVar(env_vars::kHeadless); |
138 } | 137 } |
139 | 138 |
140 bool InstallerCrashReporterClient::GetCollectStatsConsent() { | 139 bool InstallerCrashReporterClient::GetCollectStatsConsent() { |
141 #if defined(GOOGLE_CHROME_BUILD) | 140 #if defined(GOOGLE_CHROME_BUILD) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 } | 175 } |
177 } | 176 } |
178 | 177 |
179 return false; | 178 return false; |
180 } | 179 } |
181 | 180 |
182 bool InstallerCrashReporterClient::EnableBreakpadForProcess( | 181 bool InstallerCrashReporterClient::EnableBreakpadForProcess( |
183 const std::string& process_type) { | 182 const std::string& process_type) { |
184 return true; | 183 return true; |
185 } | 184 } |
OLD | NEW |