| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This module contains the necessary code to register the Breakpad exception | 5 // This module contains the necessary code to register the Breakpad exception |
| 6 // handler. This implementation is based on Chrome's crash reporting code. | 6 // handler. This implementation is based on Chrome's crash reporting code. |
| 7 | 7 |
| 8 #include "chrome_elf/breakpad.h" | 8 #include "chrome_elf/breakpad.h" |
| 9 | 9 |
| 10 #include <sddl.h> | 10 #include <sddl.h> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // The protocol for connecting to the out-of-process Breakpad crash | 29 // The protocol for connecting to the out-of-process Breakpad crash |
| 30 // reporter is different for x86-32 and x86-64: the message sizes | 30 // reporter is different for x86-32 and x86-64: the message sizes |
| 31 // are different because the message struct contains a pointer. As | 31 // are different because the message struct contains a pointer. As |
| 32 // a result, there are two different named pipes to connect to. The | 32 // a result, there are two different named pipes to connect to. The |
| 33 // 64-bit one is distinguished with an "-x64" suffix. | 33 // 64-bit one is distinguished with an "-x64" suffix. |
| 34 const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices\\"; | 34 const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices\\"; |
| 35 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; | 35 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; |
| 36 const wchar_t kSystemPrincipalSid[] = L"S-1-5-18"; | 36 const wchar_t kSystemPrincipalSid[] = L"S-1-5-18"; |
| 37 | 37 |
| 38 const wchar_t kNoErrorDialogs[] = L"noerrdialogs"; | 38 const wchar_t kNoErrorDialogs[] = L"noerrdialogs"; |
| 39 const wchar_t kChromeHeadless[] = L"CHROME_HEADLESS"; | |
| 40 | 39 |
| 41 google_breakpad::CustomClientInfo* GetCustomInfo() { | 40 google_breakpad::CustomClientInfo* GetCustomInfo() { |
| 42 base::string16 process = IsNonBrowserProcess() ? L"renderer" : L"browser"; | 41 base::string16 process = IsNonBrowserProcess() ? L"renderer" : L"browser"; |
| 43 | 42 |
| 44 wchar_t exe_path[MAX_PATH] = {}; | 43 wchar_t exe_path[MAX_PATH] = {}; |
| 45 base::string16 channel; | 44 base::string16 channel; |
| 46 if (GetModuleFileName(NULL, exe_path, arraysize(exe_path)) && | 45 if (GetModuleFileName(NULL, exe_path, arraysize(exe_path)) && |
| 47 IsCanary(exe_path)) { | 46 IsCanary(exe_path)) { |
| 48 channel = L"canary"; | 47 channel = L"canary"; |
| 49 } | 48 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 google_breakpad::ExceptionHandler::HANDLER_ALL, | 183 google_breakpad::ExceptionHandler::HANDLER_ALL, |
| 185 dump_type, | 184 dump_type, |
| 186 pipe_name.c_str(), | 185 pipe_name.c_str(), |
| 187 GetCustomInfo()); | 186 GetCustomInfo()); |
| 188 | 187 |
| 189 if (g_elf_breakpad->IsOutOfProcess()) { | 188 if (g_elf_breakpad->IsOutOfProcess()) { |
| 190 // Tells breakpad to handle breakpoint and single step exceptions. | 189 // Tells breakpad to handle breakpoint and single step exceptions. |
| 191 g_elf_breakpad->set_handle_debug_exceptions(true); | 190 g_elf_breakpad->set_handle_debug_exceptions(true); |
| 192 } | 191 } |
| 193 } | 192 } |
| OLD | NEW |