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 "components/crash/content/app/crashpad.h" | 5 #include "components/crash/content/app/crashpad.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "base/environment.h" | 9 #include "base/environment.h" |
8 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/numerics/safe_conversions.h" | 11 #include "base/numerics/safe_conversions.h" |
11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
16 #include "components/crash/content/app/crash_reporter_client.h" | 17 #include "components/crash/content/app/crash_reporter_client.h" |
17 #include "components/crash/content/app/crash_switches.h" | 18 #include "components/crash/content/app/crash_switches.h" |
18 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" | 19 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" |
19 #include "third_party/crashpad/crashpad/client/crashpad_client.h" | 20 #include "third_party/crashpad/crashpad/client/crashpad_client.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 52 } |
52 | 53 |
53 base::FilePath PlatformCrashpadInitialization(bool initial_client, | 54 base::FilePath PlatformCrashpadInitialization(bool initial_client, |
54 bool browser_process, | 55 bool browser_process, |
55 bool embedded_handler) { | 56 bool embedded_handler) { |
56 base::FilePath database_path; // Only valid in the browser process. | 57 base::FilePath database_path; // Only valid in the browser process. |
57 bool result; | 58 bool result; |
58 | 59 |
59 const char kPipeNameVar[] = "CHROME_CRASHPAD_PIPE_NAME"; | 60 const char kPipeNameVar[] = "CHROME_CRASHPAD_PIPE_NAME"; |
60 const char kServerUrlVar[] = "CHROME_CRASHPAD_SERVER_URL"; | 61 const char kServerUrlVar[] = "CHROME_CRASHPAD_SERVER_URL"; |
61 scoped_ptr<base::Environment> env(base::Environment::Create()); | 62 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
62 | 63 |
63 if (initial_client) { | 64 if (initial_client) { |
64 CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); | 65 CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); |
65 crash_reporter_client->GetCrashDumpLocation(&database_path); | 66 crash_reporter_client->GetCrashDumpLocation(&database_path); |
66 | 67 |
67 std::map<std::string, std::string> process_annotations; | 68 std::map<std::string, std::string> process_annotations; |
68 GetPlatformCrashpadAnnotations(&process_annotations); | 69 GetPlatformCrashpadAnnotations(&process_annotations); |
69 | 70 |
70 #if defined(GOOGLE_CHROME_BUILD) | 71 #if defined(GOOGLE_CHROME_BUILD) |
71 std::string url = "https://clients2.google.com/cr/report"; | 72 std::string url = "https://clients2.google.com/cr/report"; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( | 286 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( |
286 void* start) { | 287 void* start) { |
287 ExceptionHandlerRecord* record = | 288 ExceptionHandlerRecord* record = |
288 reinterpret_cast<ExceptionHandlerRecord*>(start); | 289 reinterpret_cast<ExceptionHandlerRecord*>(start); |
289 | 290 |
290 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 291 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
291 } | 292 } |
292 #endif // ARCH_CPU_X86_64 | 293 #endif // ARCH_CPU_X86_64 |
293 | 294 |
294 } // extern "C" | 295 } // extern "C" |
OLD | NEW |