Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/app/chrome_crash_reporter_client.cc

Issue 1546673002: Add the crash client ID to the uninstall URL params. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/chrome_installer_util.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app/chrome_crash_reporter_client.h" 5 #include "chrome/app/chrome_crash_reporter_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/common/chrome_constants.h" 14 #include "chrome/common/chrome_constants.h"
15 #include "chrome/common/chrome_paths.h" 15 #include "chrome/common/chrome_paths.h"
16 #include "chrome/common/chrome_paths_internal.h"
16 #include "chrome/common/chrome_result_codes.h" 17 #include "chrome/common/chrome_result_codes.h"
17 #include "chrome/common/crash_keys.h" 18 #include "chrome/common/crash_keys.h"
18 #include "chrome/common/env_vars.h" 19 #include "chrome/common/env_vars.h"
19 #include "chrome/installer/util/browser_distribution.h"
20 #include "chrome/installer/util/google_update_settings.h" 20 #include "chrome/installer/util/google_update_settings.h"
21 #include "content/public/common/content_switches.h" 21 #include "content/public/common/content_switches.h"
22 22
23 #if defined(OS_WIN) 23 #if defined(OS_WIN)
24 #include <windows.h> 24 #include <windows.h>
25 25
26 #include "base/file_version_info.h" 26 #include "base/file_version_info.h"
27 #include "base/win/registry.h" 27 #include "base/win/registry.h"
28 #include "chrome/installer/util/google_chrome_sxs_distribution.h" 28 #include "chrome/installer/util/google_chrome_sxs_distribution.h"
29 #include "chrome/installer/util/install_util.h" 29 #include "chrome/installer/util/install_util.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 273 }
274 274
275 base::FilePath ChromeCrashReporterClient::GetReporterLogFilename() { 275 base::FilePath ChromeCrashReporterClient::GetReporterLogFilename() {
276 return base::FilePath(CrashUploadList::kReporterLogFilename); 276 return base::FilePath(CrashUploadList::kReporterLogFilename);
277 } 277 }
278 #endif 278 #endif
279 279
280 bool ChromeCrashReporterClient::GetCrashDumpLocation( 280 bool ChromeCrashReporterClient::GetCrashDumpLocation(
281 base::FilePath* crash_dir) { 281 base::FilePath* crash_dir) {
282 #if defined(OS_WIN) 282 #if defined(OS_WIN)
283 // In order to be able to start crash handling very early, we do not rely on 283 // In order to be able to start crash handling very early, we do not rely on
scottmg 2016/01/08 20:16:09 This should probably be moved/duplicated to GetDef
grt (UTC plus 2) 2016/01/13 19:03:56 Done.
284 // chrome's PathService entries (for DIR_CRASH_DUMPS) being available on 284 // chrome's PathService entries (for DIR_CRASH_DUMPS) being available on
285 // Windows. See https://crbug.com/564398. 285 // Windows. See https://crbug.com/564398.
286 base::FilePath result;
287 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, &result))
288 return false;
289 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
290 result = result.Append(dist->GetInstallSubDir());
291 // TODO(scottmg): Consider supporting --user-data-dir. See 286 // TODO(scottmg): Consider supporting --user-data-dir. See
292 // https://crbug.com/565446. 287 // https://crbug.com/565446.
293 result = result.Append(chrome::kUserDataDirname); 288 return chrome::GetDefaultCrashDumpLocation(crash_dir);
294 result = result.Append(FILE_PATH_LITERAL("Crashpad"));
295 *crash_dir = result;
296 return true;
297 #else 289 #else
298 // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate 290 // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate
299 // location to write breakpad crash dumps can be set. 291 // location to write breakpad crash dumps can be set.
300 scoped_ptr<base::Environment> env(base::Environment::Create()); 292 scoped_ptr<base::Environment> env(base::Environment::Create());
301 std::string alternate_crash_dump_location; 293 std::string alternate_crash_dump_location;
302 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) { 294 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_crash_dump_location)) {
303 base::FilePath crash_dumps_dir_path = 295 base::FilePath crash_dumps_dir_path =
304 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location); 296 base::FilePath::FromUTF8Unsafe(alternate_crash_dump_location);
305 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path); 297 PathService::Override(chrome::DIR_CRASH_DUMPS, crash_dumps_dir_path);
306 } 298 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 #endif 345 #endif
354 346
355 bool ChromeCrashReporterClient::EnableBreakpadForProcess( 347 bool ChromeCrashReporterClient::EnableBreakpadForProcess(
356 const std::string& process_type) { 348 const std::string& process_type) {
357 return process_type == switches::kRendererProcess || 349 return process_type == switches::kRendererProcess ||
358 process_type == switches::kPluginProcess || 350 process_type == switches::kPluginProcess ||
359 process_type == switches::kPpapiPluginProcess || 351 process_type == switches::kPpapiPluginProcess ||
360 process_type == switches::kZygoteProcess || 352 process_type == switches::kZygoteProcess ||
361 process_type == switches::kGpuProcess; 353 process_type == switches::kGpuProcess;
362 } 354 }
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_installer_util.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698