OLD | NEW |
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 "components/crash/content/app/breakpad_win.h" | 5 #include "components/crash/content/app/breakpad_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <tchar.h> | 10 #include <tchar.h> |
11 #include <userenv.h> | 11 #include <userenv.h> |
12 #include <winnt.h> | 12 #include <winnt.h> |
13 | 13 |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <map> | 15 #include <map> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/base_switches.h" | 18 #include "base/base_switches.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/debug/crash_logging.h" | 20 #include "base/debug/crash_logging.h" |
21 #include "base/debug/dump_without_crashing.h" | 21 #include "base/debug/dump_without_crashing.h" |
22 #include "base/environment.h" | 22 #include "base/environment.h" |
| 23 #include "base/files/file_path.h" |
23 #include "base/macros.h" | 24 #include "base/macros.h" |
24 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
25 #include "base/numerics/safe_conversions.h" | 26 #include "base/numerics/safe_conversions.h" |
26 #include "base/strings/string16.h" | 27 #include "base/strings/string16.h" |
27 #include "base/strings/string_split.h" | 28 #include "base/strings/string_split.h" |
28 #include "base/strings/string_util.h" | 29 #include "base/strings/string_util.h" |
29 #include "base/strings/stringprintf.h" | 30 #include "base/strings/stringprintf.h" |
30 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
31 #include "base/synchronization/lock.h" | 32 #include "base/synchronization/lock.h" |
32 #include "base/win/metro.h" | |
33 #include "base/win/pe_image.h" | 33 #include "base/win/pe_image.h" |
34 #include "base/win/registry.h" | 34 #include "base/win/registry.h" |
35 #include "base/win/win_util.h" | 35 #include "base/win/win_util.h" |
36 #include "breakpad/src/client/windows/common/ipc_protocol.h" | 36 #include "breakpad/src/client/windows/common/ipc_protocol.h" |
37 #include "breakpad/src/client/windows/handler/exception_handler.h" | 37 #include "breakpad/src/client/windows/handler/exception_handler.h" |
38 #include "components/crash/content/app/crash_keys_win.h" | 38 #include "components/crash/content/app/crash_keys_win.h" |
39 #include "components/crash/content/app/crash_reporter_client.h" | 39 #include "components/crash/content/app/crash_reporter_client.h" |
40 #include "components/crash/content/app/hard_error_handler_win.h" | 40 #include "components/crash/content/app/hard_error_handler_win.h" |
41 #include "components/crash/core/common/crash_keys.h" | 41 #include "components/crash/core/common/crash_keys.h" |
42 #include "content/public/common/result_codes.h" | 42 #include "content/public/common/result_codes.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 GetCrashReporterClient()->GetResultCodeRespawnFailed()); | 347 GetCrashReporterClient()->GetResultCodeRespawnFailed()); |
348 } | 348 } |
349 | 349 |
350 return true; | 350 return true; |
351 } | 351 } |
352 | 352 |
353 // This function is executed by the child process that DumpDoneCallback() | 353 // This function is executed by the child process that DumpDoneCallback() |
354 // spawned and basically just shows the 'chrome has crashed' dialog if | 354 // spawned and basically just shows the 'chrome has crashed' dialog if |
355 // the CHROME_CRASHED environment variable is present. | 355 // the CHROME_CRASHED environment variable is present. |
356 bool ShowRestartDialogIfCrashed(bool* exit_now) { | 356 bool ShowRestartDialogIfCrashed(bool* exit_now) { |
357 // If we are being launched in metro mode don't try to show the dialog. | |
358 if (base::win::IsMetroProcess()) | |
359 return false; | |
360 | |
361 base::string16 message; | 357 base::string16 message; |
362 base::string16 title; | 358 base::string16 title; |
363 bool is_rtl_locale; | 359 bool is_rtl_locale; |
364 if (!GetCrashReporterClient()->ShouldShowRestartDialog( | 360 if (!GetCrashReporterClient()->ShouldShowRestartDialog( |
365 &title, &message, &is_rtl_locale)) { | 361 &title, &message, &is_rtl_locale)) { |
366 return false; | 362 return false; |
367 } | 363 } |
368 | 364 |
369 // If the UI layout is right-to-left, we need to pass the appropriate MB_XXX | 365 // If the UI layout is right-to-left, we need to pass the appropriate MB_XXX |
370 // flags so that an RTL message box is displayed. | 366 // flags so that an RTL message box is displayed. |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 extern "C" void __declspec(dllexport) __cdecl | 742 extern "C" void __declspec(dllexport) __cdecl |
747 UnregisterNonABICompliantCodeRange(void* start) { | 743 UnregisterNonABICompliantCodeRange(void* start) { |
748 ExceptionHandlerRecord* record = | 744 ExceptionHandlerRecord* record = |
749 reinterpret_cast<ExceptionHandlerRecord*>(start); | 745 reinterpret_cast<ExceptionHandlerRecord*>(start); |
750 | 746 |
751 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 747 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
752 } | 748 } |
753 #endif | 749 #endif |
754 | 750 |
755 } // namespace breakpad | 751 } // namespace breakpad |
OLD | NEW |