| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/win_util.h" | 10 #include "base/win_util.h" |
| 11 #include "chrome/installer/util/google_update_settings.h" | 11 #include "chrome/installer/util/google_update_settings.h" |
| 12 #include "chrome/installer/util/install_util.h" | 12 #include "chrome/installer/util/install_util.h" |
| 13 #include "chrome_frame/chrome_frame_reporting.h" | 13 #include "chrome_frame/chrome_frame_reporting.h" |
| 14 #include "chrome_frame/exception_barrier.h" | 14 #include "chrome_frame/exception_barrier.h" |
| 15 #include "chrome_frame/utils.h" | 15 #include "chrome_frame/utils.h" |
| 16 | 16 |
| 17 // Well known SID for the system principal. | 17 // Well known SID for the system principal. |
| 18 const wchar_t kSystemPrincipalSid[] = L"S-1-5-18"; | 18 const wchar_t kSystemPrincipalSid[] = L"S-1-5-18"; |
| 19 const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices"; | 19 const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices"; |
| 20 | 20 |
| 21 // Returns the custom info structure based on the dll in parameter | 21 // Returns the custom info structure based on the dll in parameter |
| 22 google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* dll_path) { | 22 google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* dll_path) { |
| 23 std::wstring product; | 23 std::wstring product; |
| 24 std::wstring version; | 24 std::wstring version; |
| 25 scoped_ptr<FileVersionInfo> | 25 scoped_ptr<FileVersionInfo> |
| 26 version_info(FileVersionInfo::CreateFileVersionInfo(dll_path)); | 26 version_info(FileVersionInfo::CreateFileVersionInfo(FilePath(dll_path))); |
| 27 if (version_info.get()) { | 27 if (version_info.get()) { |
| 28 version = version_info->product_version(); | 28 version = version_info->product_version(); |
| 29 product = version_info->product_short_name(); | 29 product = version_info->product_short_name(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 if (version.empty()) | 32 if (version.empty()) |
| 33 version = L"0.1.0.0"; | 33 version = L"0.1.0.0"; |
| 34 | 34 |
| 35 if (product.empty()) | 35 if (product.empty()) |
| 36 product = L"ChromeFrame"; | 36 product = L"ChromeFrame"; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 return InitializeVectoredCrashReporting(false, user_sid.c_str(), | 90 return InitializeVectoredCrashReporting(false, user_sid.c_str(), |
| 91 temp_directory.value(), GetCustomInfo(dll_path)); | 91 temp_directory.value(), GetCustomInfo(dll_path)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool ShutdownCrashReporting() { | 94 bool ShutdownCrashReporting() { |
| 95 ExceptionBarrierConfig::set_enabled(false); | 95 ExceptionBarrierConfig::set_enabled(false); |
| 96 return ShutdownVectoredCrashReporting(); | 96 return ShutdownVectoredCrashReporting(); |
| 97 } | 97 } |
| OLD | NEW |