Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1227)

Unified Diff: client/crashpad_client_win.cc

Issue 1405243002: Fix CRITICAL_SECTION test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | handler/handler.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/crashpad_client_win.cc
diff --git a/client/crashpad_client_win.cc b/client/crashpad_client_win.cc
index 7a1e547a4c8bfdbda64af09d36aee477e0b777ac..3b3eaa6a6051329fe1f428ab135464492569d827 100644
--- a/client/crashpad_client_win.cc
+++ b/client/crashpad_client_win.cc
@@ -23,6 +23,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "util/file/file_io.h"
+#include "util/win/critical_section_with_debug_info.h"
#include "util/win/registration_protocol_win.h"
#include "util/win/scoped_handle.h"
@@ -101,18 +102,6 @@ LONG WINAPI UnhandledExceptionHandler(EXCEPTION_POINTERS* exception_pointers) {
return EXCEPTION_CONTINUE_SEARCH;
}
-BOOL CrashpadInitializeCriticalSectionEx(
- CRITICAL_SECTION* critical_section,
- DWORD spin_count,
- DWORD flags) {
- static decltype(InitializeCriticalSectionEx)* initialize_critical_section_ex =
- reinterpret_cast<decltype(InitializeCriticalSectionEx)*>(GetProcAddress(
- LoadLibrary(L"kernel32.dll"), "InitializeCriticalSectionEx"));
- if (!initialize_critical_section_ex)
- return false;
- return initialize_critical_section_ex(critical_section, spin_count, flags);
-}
-
} // namespace
namespace crashpad {
@@ -156,14 +145,10 @@ bool CrashpadClient::SetHandler(const std::string& ipc_port) {
// debugger would instead inspect ntdll!RtlCriticalSectionList to get the head
// of the list. But that is not an exported symbol, so on an arbitrary client
// machine, we don't have a way of getting that pointer.
- if (CrashpadInitializeCriticalSectionEx(
- &g_critical_section_with_debug_info,
- 0,
- RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO)) {
+ if (InitializeCriticalSectionWithDebugInfoIfPossible(
+ &g_critical_section_with_debug_info)) {
message.registration.critical_section_address =
reinterpret_cast<WinVMAddress>(&g_critical_section_with_debug_info);
- } else {
- PLOG(ERROR) << "InitializeCriticalSectionEx";
}
ServerToClientMessage response = {0};
« no previous file with comments | « no previous file | handler/handler.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698