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

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2579623002: [DXVAVDA] Dump without crashing on EXCEPTION_DEBUG_EVENT (Closed)
Patch Set: change to EXCEPTION_DEBUG_EVENT Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/dxva_video_decode_accelerator_win.cc
diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc
index 1bb4dc8b819c22de4b73f272ae2da20a3d35ce1b..12729f807f3741a4cf8d83740fe8dc0adc0c6e29 100644
--- a/media/gpu/dxva_video_decode_accelerator_win.cc
+++ b/media/gpu/dxva_video_decode_accelerator_win.cc
@@ -25,6 +25,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/debug/alias.h"
+#include "base/debug/dump_without_crashing.h"
#include "base/file_version_info.h"
#include "base/files/file_path.h"
#include "base/location.h"
@@ -188,6 +189,8 @@ constexpr const wchar_t* const kMediaFoundationVideoDecoderDLLs[] = {
// ensure only the thread with the ScopedExceptionCatcher dumps anything.
base::ThreadLocalStorage::StaticSlot g_catcher_tls_slot = TLS_INITIALIZER;
+base::subtle::Atomic32 g_dump_count;
+
uint64_t GetCurrentQPC() {
LARGE_INTEGER perf_counter_now = {};
// Use raw QueryPerformanceCounter to avoid grabbing locks or allocating
@@ -207,6 +210,14 @@ LONG CALLBACK VectoredCrashHandler(EXCEPTION_POINTERS* exception_pointers) {
if (g_catcher_tls_slot.Get()) {
g_last_exception_code = exception_pointers->ExceptionRecord->ExceptionCode;
g_last_exception_time = GetCurrentQPC();
+ if (exception_pointers->ExceptionRecord->ExceptionCode ==
+ EXCEPTION_DEBUG_EVENT) {
+ base::debug::Alias(&exception_pointers);
+ // Only dump first time to ensure we don't spend a lot of time doing this
+ // if the driver continually causes exceptions.
+ if (base::subtle::Barrier_AtomicIncrement(&g_dump_count, 1) == 1)
+ base::debug::DumpWithoutCrashing();
+ }
}
return EXCEPTION_CONTINUE_SEARCH;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698