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

Side by Side Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2016123002: Remove ScriptCallStack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2006893004
Patch Set: full stack trace Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 14 matching lines...) Expand all
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * 29 *
30 */ 30 */
31 31
32 #include "core/events/EventTarget.h" 32 #include "core/events/EventTarget.h"
33 33
34 #include "bindings/core/v8/ExceptionState.h" 34 #include "bindings/core/v8/ExceptionState.h"
35 #include "bindings/core/v8/ScriptCallStack.h"
36 #include "bindings/core/v8/ScriptEventListener.h" 35 #include "bindings/core/v8/ScriptEventListener.h"
36 #include "bindings/core/v8/SourceLocation.h"
37 #include "bindings/core/v8/V8DOMActivityLogger.h" 37 #include "bindings/core/v8/V8DOMActivityLogger.h"
38 #include "core/dom/ExceptionCode.h" 38 #include "core/dom/ExceptionCode.h"
39 #include "core/editing/Editor.h" 39 #include "core/editing/Editor.h"
40 #include "core/events/Event.h" 40 #include "core/events/Event.h"
41 #include "core/events/EventUtil.h" 41 #include "core/events/EventUtil.h"
42 #include "core/frame/FrameHost.h" 42 #include "core/frame/FrameHost.h"
43 #include "core/frame/LocalDOMWindow.h" 43 #include "core/frame/LocalDOMWindow.h"
44 #include "core/frame/Settings.h" 44 #include "core/frame/Settings.h"
45 #include "core/frame/UseCounter.h" 45 #include "core/frame/UseCounter.h"
46 #include "core/inspector/ConsoleMessage.h" 46 #include "core/inspector/ConsoleMessage.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return; 92 return;
93 93
94 V8AbstractEventListener* v8Listener = V8AbstractEventListener::cast(register edListener->listener()); 94 V8AbstractEventListener* v8Listener = V8AbstractEventListener::cast(register edListener->listener());
95 v8::HandleScope handles(v8Listener->isolate()); 95 v8::HandleScope handles(v8Listener->isolate());
96 v8::Local<v8::Object> handler = v8Listener->getListenerObject(context); 96 v8::Local<v8::Object> handler = v8Listener->getListenerObject(context);
97 97
98 String messageText = String::format( 98 String messageText = String::format(
99 "Handling of '%s' input event was delayed for %ld ms due to main thread being busy. " 99 "Handling of '%s' input event was delayed for %ld ms due to main thread being busy. "
100 "Consider marking event handler as 'passive' to make the page more respo nive.", 100 "Consider marking event handler as 'passive' to make the page more respo nive.",
101 event->type().getString().utf8().data(), lround(delayedSeconds * 1000)); 101 event->type().getString().utf8().data(), lround(delayedSeconds * 1000));
102 ConsoleMessage* message = nullptr;
103 102
104 v8::Local<v8::Function> function = eventListenerEffectiveFunction(v8Listener ->isolate(), handler); 103 v8::Local<v8::Function> function = eventListenerEffectiveFunction(v8Listener ->isolate(), handler);
105 if (!function.IsEmpty()) 104 OwnPtr<SourceLocation> location = SourceLocation::fromFunction(function);
106 message = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, m essageText, String(), function->GetScriptLineNumber() + 1, function->GetScriptCo lumnNumber() + 1, nullptr, function->ScriptId()); 105 ConsoleMessage* message = ConsoleMessage::create(JSMessageSource, WarningMes sageLevel, messageText, std::move(location));
107 else
108 message = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, m essageText, String(), 0, 0);
109 context->addConsoleMessage(message); 106 context->addConsoleMessage(message);
110 registeredListener->setBlockedEventWarningEmitted(); 107 registeredListener->setBlockedEventWarningEmitted();
111 } 108 }
112 109
113 110
114 } // namespace 111 } // namespace
115 112
116 EventTargetData::EventTargetData() 113 EventTargetData::EventTargetData()
117 { 114 {
118 } 115 }
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 // they have one less listener to invoke. 630 // they have one less listener to invoke.
634 if (d->firingEventIterators) { 631 if (d->firingEventIterators) {
635 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 632 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
636 d->firingEventIterators->at(i).iterator = 0; 633 d->firingEventIterators->at(i).iterator = 0;
637 d->firingEventIterators->at(i).end = 0; 634 d->firingEventIterators->at(i).end = 0;
638 } 635 }
639 } 636 }
640 } 637 }
641 638
642 } // namespace blink 639 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698