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

Unified Diff: Source/bindings/core/v8/V8AbstractEventListener.cpp

Issue 585873002: Show a warning when using sync xhr. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated patch with reset -expected.txt files. Created 6 years, 3 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
Index: Source/bindings/core/v8/V8AbstractEventListener.cpp
diff --git a/Source/bindings/core/v8/V8AbstractEventListener.cpp b/Source/bindings/core/v8/V8AbstractEventListener.cpp
index 21be4e1c79935cc44ad2dfae3978b61b6b15a619..b4c9d2a3fedc98e12cec72b154e48641da930032 100644
--- a/Source/bindings/core/v8/V8AbstractEventListener.cpp
+++ b/Source/bindings/core/v8/V8AbstractEventListener.cpp
@@ -124,8 +124,11 @@ void V8AbstractEventListener::invokeEventHandler(Event* event, v8::Local<v8::Val
// Make the event available in the global object, so LocalDOMWindow can expose it.
V8HiddenValue::setHiddenValue(isolate(), scriptState()->context()->Global(), V8HiddenValue::event(isolate()), jsEvent);
tryCatch.Reset();
-
+ if (event->isBeforeUnloadEvent())
+ scriptState()->executionContext()->setIsBeforeUnloadEvent(true);
returnValue = callListenerFunction(jsEvent, event);
+ if (event->isBeforeUnloadEvent())
+ scriptState()->executionContext()->setIsBeforeUnloadEvent(false);
if (tryCatch.HasCaught())
event->target()->uncaughtExceptionInEventHandler();

Powered by Google App Engine
This is Rietveld 408576698