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 <intrin.h> | 8 #include <intrin.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // the "Do you want to restart" message and then we call the previous filter. | 283 // the "Do you want to restart" message and then we call the previous filter. |
284 long WINAPI ChromeExceptionFilter(EXCEPTION_POINTERS* info) { | 284 long WINAPI ChromeExceptionFilter(EXCEPTION_POINTERS* info) { |
285 DumpDoneCallback(NULL, NULL, NULL, info, NULL, false); | 285 DumpDoneCallback(NULL, NULL, NULL, info, NULL, false); |
286 | 286 |
287 if (previous_filter) | 287 if (previous_filter) |
288 return previous_filter(info); | 288 return previous_filter(info); |
289 | 289 |
290 return EXCEPTION_EXECUTE_HANDLER; | 290 return EXCEPTION_EXECUTE_HANDLER; |
291 } | 291 } |
292 | 292 |
293 // Exception filter for the service process used when breakpad is not enabled. | 293 // Exception filter for the Cloud Print service process used when breakpad is |
294 // We just display the "Do you want to restart" message and then die | 294 // not enabled. We just display the "Do you want to restart" message and then |
295 // (without calling the previous filter). | 295 // die (without calling the previous filter). |
296 long WINAPI ServiceExceptionFilter(EXCEPTION_POINTERS* info) { | 296 long WINAPI CloudPrintServiceExceptionFilter(EXCEPTION_POINTERS* info) { |
297 DumpDoneCallback(NULL, NULL, NULL, info, NULL, false); | 297 DumpDoneCallback(NULL, NULL, NULL, info, NULL, false); |
298 return EXCEPTION_EXECUTE_HANDLER; | 298 return EXCEPTION_EXECUTE_HANDLER; |
299 } | 299 } |
300 | 300 |
301 #if !defined(COMPONENT_BUILD) | 301 #if !defined(COMPONENT_BUILD) |
302 // Installed via base::debug::SetCrashKeyReportingFunctions. | 302 // Installed via base::debug::SetCrashKeyReportingFunctions. |
303 void SetCrashKeyValueForBaseDebug(const base::StringPiece& key, | 303 void SetCrashKeyValueForBaseDebug(const base::StringPiece& key, |
304 const base::StringPiece& value) { | 304 const base::StringPiece& value) { |
305 DCHECK(CrashKeysWin::keeper()); | 305 DCHECK(CrashKeysWin::keeper()); |
306 CrashKeysWin::keeper()->SetCrashKeyValue(base::UTF8ToUTF16(key), | 306 CrashKeysWin::keeper()->SetCrashKeyValue(base::UTF8ToUTF16(key), |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 GetCrashReporterClient()->RegisterCrashKeys(); | 574 GetCrashReporterClient()->RegisterCrashKeys(); |
575 #endif | 575 #endif |
576 | 576 |
577 google_breakpad::ExceptionHandler::MinidumpCallback callback = NULL; | 577 google_breakpad::ExceptionHandler::MinidumpCallback callback = NULL; |
578 LPTOP_LEVEL_EXCEPTION_FILTER default_filter = NULL; | 578 LPTOP_LEVEL_EXCEPTION_FILTER default_filter = NULL; |
579 // We install the post-dump callback only for the browser and service | 579 // We install the post-dump callback only for the browser and service |
580 // processes. It spawns a new browser/service process. | 580 // processes. It spawns a new browser/service process. |
581 if (process_type == L"browser") { | 581 if (process_type == L"browser") { |
582 callback = &DumpDoneCallback; | 582 callback = &DumpDoneCallback; |
583 default_filter = &ChromeExceptionFilter; | 583 default_filter = &ChromeExceptionFilter; |
584 } else if (process_type == L"service") { | 584 } else if (process_type == L"cloud-print-service") { |
585 callback = &DumpDoneCallback; | 585 callback = &DumpDoneCallback; |
586 default_filter = &ServiceExceptionFilter; | 586 default_filter = &CloudPrintServiceExceptionFilter; |
587 } | 587 } |
588 | 588 |
589 if (GetCrashReporterClient()->ShouldCreatePipeName(process_type)) | 589 if (GetCrashReporterClient()->ShouldCreatePipeName(process_type)) |
590 InitPipeNameEnvVar(GetCrashReporterClient()->GetIsPerUserInstall()); | 590 InitPipeNameEnvVar(GetCrashReporterClient()->GetIsPerUserInstall()); |
591 | 591 |
592 std::unique_ptr<base::Environment> env(base::Environment::Create()); | 592 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
593 std::string pipe_name_ascii; | 593 std::string pipe_name_ascii; |
594 if (!env->GetVar(kPipeNameVar, &pipe_name_ascii)) { | 594 if (!env->GetVar(kPipeNameVar, &pipe_name_ascii)) { |
595 // Breakpad is not enabled. Configuration is managed or the user | 595 // Breakpad is not enabled. Configuration is managed or the user |
596 // did not allow Google Update to send crashes. We need to use | 596 // did not allow Google Update to send crashes. We need to use |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 extern "C" void __declspec(dllexport) __cdecl | 743 extern "C" void __declspec(dllexport) __cdecl |
744 UnregisterNonABICompliantCodeRange(void* start) { | 744 UnregisterNonABICompliantCodeRange(void* start) { |
745 ExceptionHandlerRecord* record = | 745 ExceptionHandlerRecord* record = |
746 reinterpret_cast<ExceptionHandlerRecord*>(start); | 746 reinterpret_cast<ExceptionHandlerRecord*>(start); |
747 | 747 |
748 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 748 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
749 } | 749 } |
750 #endif | 750 #endif |
751 | 751 |
752 } // namespace breakpad | 752 } // namespace breakpad |
OLD | NEW |