| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Implementation of wrapper around common crash reporting. | 5 // Implementation of wrapper around common crash reporting. |
| 6 | 6 |
| 7 #include "chrome_frame/chrome_frame_reporting.h" | 7 #include "chrome_frame/chrome_frame_reporting.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // user allows it first. | 59 // user allows it first. |
| 60 if (!always_take_dump && !GoogleUpdateSettings::GetCollectStatsConsent()) | 60 if (!always_take_dump && !GoogleUpdateSettings::GetCollectStatsConsent()) |
| 61 return true; | 61 return true; |
| 62 | 62 |
| 63 // If we got here, we want to report crashes, so make sure all | 63 // If we got here, we want to report crashes, so make sure all |
| 64 // ExceptionBarrierBase instances do so. | 64 // ExceptionBarrierBase instances do so. |
| 65 ExceptionBarrierConfig::set_enabled(true); | 65 ExceptionBarrierConfig::set_enabled(true); |
| 66 | 66 |
| 67 // Get the alternate dump directory. We use the temp path. | 67 // Get the alternate dump directory. We use the temp path. |
| 68 base::FilePath temp_directory; | 68 base::FilePath temp_directory; |
| 69 if (!file_util::GetTempDir(&temp_directory) || temp_directory.empty()) | 69 if (!base::GetTempDir(&temp_directory) || temp_directory.empty()) |
| 70 return false; | 70 return false; |
| 71 | 71 |
| 72 wchar_t dll_path[MAX_PATH * 2] = {0}; | 72 wchar_t dll_path[MAX_PATH * 2] = {0}; |
| 73 GetModuleFileName(reinterpret_cast<HMODULE>(&__ImageBase), dll_path, | 73 GetModuleFileName(reinterpret_cast<HMODULE>(&__ImageBase), dll_path, |
| 74 arraysize(dll_path)); | 74 arraysize(dll_path)); |
| 75 | 75 |
| 76 if (always_take_dump) { | 76 if (always_take_dump) { |
| 77 return InitializeVectoredCrashReportingWithPipeName( | 77 return InitializeVectoredCrashReportingWithPipeName( |
| 78 true, kChromePipeName, temp_directory.value(), GetCustomInfo(dll_path)); | 78 true, kChromePipeName, temp_directory.value(), GetCustomInfo(dll_path)); |
| 79 } | 79 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 104 | 104 |
| 105 void CrashReportingTraits::Initialize() { | 105 void CrashReportingTraits::Initialize() { |
| 106 InitializeCrashReporting(); | 106 InitializeCrashReporting(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void CrashReportingTraits::Shutdown() { | 109 void CrashReportingTraits::Shutdown() { |
| 110 ShutdownCrashReporting(); | 110 ShutdownCrashReporting(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace chrome_frame | 113 } // namespace chrome_frame |
| OLD | NEW |