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/setup_constants.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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 const base::debug::CrashKey kKeys[] = { |
128 { crash_keys::kClientId, crash_keys::kSmallSize }, | 129 { crash_keys::kClientId, crash_keys::kSmallSize }, |
| 130 { installer::crash_keys::kCurrentVersion, crash_keys::kSmallSize }, |
| 131 { installer::crash_keys::kDistributionType, crash_keys::kSmallSize }, |
| 132 { installer::crash_keys::kOperation, crash_keys::kSmallSize }, |
| 133 { installer::crash_keys::kPackageType, crash_keys::kSmallSize }, |
| 134 { installer::crash_keys::kPrivilegeLevel, crash_keys::kSmallSize }, |
| 135 |
| 136 // This is a Windows registry key, which maxes out at 255 chars. |
| 137 // (kMediumSize actually maxes out at 252 chars on Windows, but potentially |
| 138 // truncating such a small amount is a fair tradeoff compared to using |
| 139 // kLargeSize, which is wasteful.) |
| 140 { installer::crash_keys::kStateKey, crash_keys::kMediumSize }, |
129 }; | 141 }; |
130 | 142 |
131 return base::debug::InitCrashKeys(&kKeys[0], arraysize(kKeys), | 143 return base::debug::InitCrashKeys(&kKeys[0], arraysize(kKeys), |
132 crash_keys::kChunkMaxLength); | 144 crash_keys::kChunkMaxLength); |
133 } | 145 } |
134 | 146 |
135 bool InstallerCrashReporterClient::IsRunningUnattended() { | 147 bool InstallerCrashReporterClient::IsRunningUnattended() { |
136 scoped_ptr<base::Environment> env(base::Environment::Create()); | 148 scoped_ptr<base::Environment> env(base::Environment::Create()); |
137 return env->HasVar(env_vars::kHeadless); | 149 return env->HasVar(env_vars::kHeadless); |
138 } | 150 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 } | 188 } |
177 } | 189 } |
178 | 190 |
179 return false; | 191 return false; |
180 } | 192 } |
181 | 193 |
182 bool InstallerCrashReporterClient::EnableBreakpadForProcess( | 194 bool InstallerCrashReporterClient::EnableBreakpadForProcess( |
183 const std::string& process_type) { | 195 const std::string& process_type) { |
184 return true; | 196 return true; |
185 } | 197 } |
OLD | NEW |