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

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

Issue 938553003: [DO NOT COMMIT] [DO NOT REVIEW] XHR timeout layout test (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 9712acca97fc301f330063bee4a19dfdde23ce4d..ede386d45e6b01a567d3bacca3782d4ce7869df8 100644
--- a/Source/bindings/core/v8/V8AbstractEventListener.cpp
+++ b/Source/bindings/core/v8/V8AbstractEventListener.cpp
@@ -40,6 +40,7 @@
#include "core/events/Event.h"
#include "core/inspector/InspectorCounters.h"
#include "core/workers/WorkerGlobalScope.h"
+#include <base/debug/stack_trace.h>
namespace blink {
@@ -75,13 +76,20 @@ V8AbstractEventListener::~V8AbstractEventListener()
void V8AbstractEventListener::handleEvent(ExecutionContext*, Event* event)
{
- if (!scriptState()->contextIsValid())
+ fprintf(stderr, "%s event->type = %s\n", __PRETTY_FUNCTION__, event ? event->type().utf8().data() : "(null)");
+ if (!scriptState()->contextIsValid()) {
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
return;
- if (!scriptState()->executionContext())
+ }
+ if (!scriptState()->executionContext()) {
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
return;
+ }
// Don't reenter V8 if execution was terminated in this instance of V8.
- if (scriptState()->executionContext()->isJSExecutionForbidden())
+ if (scriptState()->executionContext()->isJSExecutionForbidden()) {
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
return;
+ }
ASSERT(event);
@@ -91,11 +99,17 @@ void V8AbstractEventListener::handleEvent(ExecutionContext*, Event* event)
ScriptState::Scope scope(scriptState());
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
// Get the V8 wrapper for the event object.
v8::Handle<v8::Value> jsEvent = toV8(event, scriptState()->context()->Global(), isolate());
- if (jsEvent.IsEmpty())
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
+ if (jsEvent.IsEmpty()) {
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
return;
+ }
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
invokeEventHandler(event, v8::Local<v8::Value>::New(isolate(), jsEvent));
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
}
void V8AbstractEventListener::setListenerObject(v8::Handle<v8::Object> listener)
@@ -106,6 +120,7 @@ void V8AbstractEventListener::setListenerObject(v8::Handle<v8::Object> listener)
void V8AbstractEventListener::invokeEventHandler(Event* event, v8::Local<v8::Value> jsEvent)
{
+ fprintf(stderr, "%s event->type = %s, this = %p\n", __PRETTY_FUNCTION__, event ? event->type().utf8().data() : "(null)", this);
// If jsEvent is empty, attempt to set it as a hidden value would crash v8.
if (jsEvent.IsEmpty())
return;
@@ -125,13 +140,16 @@ void V8AbstractEventListener::invokeEventHandler(Event* event, v8::Local<v8::Val
V8HiddenValue::setHiddenValue(isolate(), scriptState()->context()->Global(), V8HiddenValue::event(isolate()), jsEvent);
tryCatch.Reset();
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
returnValue = callListenerFunction(jsEvent, event);
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
if (tryCatch.HasCaught())
event->target()->uncaughtExceptionInEventHandler();
if (!tryCatch.CanContinue()) { // Result of TerminateExecution().
if (scriptState()->executionContext()->isWorkerGlobalScope())
toWorkerGlobalScope(scriptState()->executionContext())->script()->forbidExecution();
+ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
return;
}
tryCatch.Reset();
@@ -183,6 +201,7 @@ bool V8AbstractEventListener::belongsToTheCurrentWorld() const
void V8AbstractEventListener::setWeakCallback(const v8::WeakCallbackData<v8::Object, V8AbstractEventListener> &data)
{
+ fprintf(stderr, ">>>\n%s this = %p\n", __PRETTY_FUNCTION__, data.GetParameter());
data.GetParameter()->m_listener.clear();
}
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xhr-onload-expected.txt ('k') | Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698