OLD | NEW |
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 Loading... |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 return; | 94 return; |
95 | 95 |
96 V8AbstractEventListener* v8Listener = V8AbstractEventListener::cast(register
edListener->listener()); | 96 V8AbstractEventListener* v8Listener = V8AbstractEventListener::cast(register
edListener->listener()); |
97 v8::HandleScope handles(v8Listener->isolate()); | 97 v8::HandleScope handles(v8Listener->isolate()); |
98 v8::Local<v8::Object> handler = v8Listener->getListenerObject(context); | 98 v8::Local<v8::Object> handler = v8Listener->getListenerObject(context); |
99 | 99 |
100 String messageText = String::format( | 100 String messageText = String::format( |
101 "Handling of '%s' input event was delayed for %ld ms due to main thread
being busy. " | 101 "Handling of '%s' input event was delayed for %ld ms due to main thread
being busy. " |
102 "Consider marking event handler as 'passive' to make the page more respo
nive.", | 102 "Consider marking event handler as 'passive' to make the page more respo
nive.", |
103 event->type().getString().utf8().data(), lround(delayedSeconds * 1000)); | 103 event->type().getString().utf8().data(), lround(delayedSeconds * 1000)); |
104 ConsoleMessage* message = nullptr; | |
105 | 104 |
106 v8::Local<v8::Function> function = eventListenerEffectiveFunction(v8Listener
->isolate(), handler); | 105 v8::Local<v8::Function> function = eventListenerEffectiveFunction(v8Listener
->isolate(), handler); |
107 if (!function.IsEmpty()) | 106 OwnPtr<SourceLocation> location = SourceLocation::fromFunction(function); |
108 message = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, m
essageText, String(), function->GetScriptLineNumber() + 1, function->GetScriptCo
lumnNumber() + 1, nullptr, function->ScriptId()); | 107 ConsoleMessage* message = ConsoleMessage::create(JSMessageSource, WarningMes
sageLevel, messageText, std::move(location)); |
109 else | |
110 message = ConsoleMessage::create(JSMessageSource, WarningMessageLevel, m
essageText, String(), 0, 0); | |
111 context->addConsoleMessage(message); | 108 context->addConsoleMessage(message); |
112 registeredListener->setBlockedEventWarningEmitted(); | 109 registeredListener->setBlockedEventWarningEmitted(); |
113 } | 110 } |
114 | 111 |
115 | 112 |
116 } // namespace | 113 } // namespace |
117 | 114 |
118 EventTargetData::EventTargetData() | 115 EventTargetData::EventTargetData() |
119 { | 116 { |
120 } | 117 } |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 // they have one less listener to invoke. | 638 // they have one less listener to invoke. |
642 if (d->firingEventIterators) { | 639 if (d->firingEventIterators) { |
643 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { | 640 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { |
644 d->firingEventIterators->at(i).iterator = 0; | 641 d->firingEventIterators->at(i).iterator = 0; |
645 d->firingEventIterators->at(i).end = 0; | 642 d->firingEventIterators->at(i).end = 0; |
646 } | 643 } |
647 } | 644 } |
648 } | 645 } |
649 | 646 |
650 } // namespace blink | 647 } // namespace blink |
OLD | NEW |