| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/common/v8_breakpad_support_win.h" | 5 #include "chrome/common/v8_breakpad_support_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
| 11 #include "gin/public/debug.h" | 11 #include "gin/public/debug.h" |
| 12 | 12 |
| 13 namespace v8_breakpad_support { | 13 namespace v8_breakpad_support { |
| 14 | 14 |
| 15 void SetUp() { | 15 void SetUp() { |
| 16 #ifdef _WIN64 | 16 #ifdef _WIN64 |
| 17 // Get the breakpad pointer from chrome.exe | 17 // Get the breakpad pointer from chrome.exe |
| 18 gin::Debug::CodeRangeCreatedCallback create_callback = | 18 gin::Debug::CodeRangeCreatedCallback create_callback = |
| 19 reinterpret_cast<gin::Debug::CodeRangeCreatedCallback>( | 19 reinterpret_cast<gin::Debug::CodeRangeCreatedCallback>( |
| 20 ::GetProcAddress(::GetModuleHandle( | 20 ::GetProcAddress(::GetModuleHandle(chrome::kChromeElfDllName), |
| 21 chrome::kBrowserProcessExecutableName), | |
| 22 "RegisterNonABICompliantCodeRange")); | 21 "RegisterNonABICompliantCodeRange")); |
| 23 gin::Debug::CodeRangeDeletedCallback delete_callback = | 22 gin::Debug::CodeRangeDeletedCallback delete_callback = |
| 24 reinterpret_cast<gin::Debug::CodeRangeDeletedCallback>( | 23 reinterpret_cast<gin::Debug::CodeRangeDeletedCallback>( |
| 25 ::GetProcAddress(::GetModuleHandle( | 24 ::GetProcAddress(::GetModuleHandle(chrome::kChromeElfDllName), |
| 26 chrome::kBrowserProcessExecutableName), | |
| 27 "UnregisterNonABICompliantCodeRange")); | 25 "UnregisterNonABICompliantCodeRange")); |
| 28 // When running e.g. browser_tests.exe, these might be NULL. | 26 // When running e.g. browser_tests.exe, these might be NULL. |
| 29 if (create_callback && delete_callback) { | 27 if (create_callback && delete_callback) { |
| 30 gin::Debug::SetCodeRangeCreatedCallback(create_callback); | 28 gin::Debug::SetCodeRangeCreatedCallback(create_callback); |
| 31 gin::Debug::SetCodeRangeDeletedCallback(delete_callback); | 29 gin::Debug::SetCodeRangeDeletedCallback(delete_callback); |
| 32 } | 30 } |
| 33 #endif | 31 #endif |
| 34 } | 32 } |
| 35 | 33 |
| 36 } // namespace v8_breakpad_support | 34 } // namespace v8_breakpad_support |
| OLD | NEW |