| Index: third_party/WebKit/Source/core/events/EventTarget.cpp
|
| diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
|
| index 99562b50dbc1064632c9c4b1335e3a1f0570fef2..afeac1d4727d710b5c7a65c86f050c9cc57a3d59 100644
|
| --- a/third_party/WebKit/Source/core/events/EventTarget.cpp
|
| +++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
|
| @@ -42,9 +42,9 @@
|
| #include "core/events/PointerEvent.h"
|
| #include "core/frame/FrameHost.h"
|
| #include "core/frame/LocalDOMWindow.h"
|
| -#include "core/frame/PerformanceMonitor.h"
|
| #include "core/frame/Settings.h"
|
| #include "core/frame/UseCounter.h"
|
| +#include "core/inspector/ConsoleMessage.h"
|
| #include "core/inspector/InspectorInstrumentation.h"
|
| #include "platform/EventDispatchForbiddenScope.h"
|
| #include "platform/Histogram.h"
|
| @@ -59,8 +59,6 @@
|
| namespace blink {
|
| namespace {
|
|
|
| -static const double kBlockedWarningThresholdMillis = 100.0;
|
| -
|
| enum PassiveForcedListenerResultType {
|
| PreventDefaultNotCalled,
|
| DocumentLevelTouchPreventDefaultCalled,
|
| @@ -96,15 +94,19 @@
|
| eventType == EventTypeNames::wheel;
|
| }
|
|
|
| -double blockedEventsWarningThreshold(ExecutionContext* context, Event* event) {
|
| +double blockedEventsWarningThreshold(const ExecutionContext* context,
|
| + const Event* event) {
|
| if (!event->cancelable())
|
| return 0.0;
|
| if (!isScrollBlockingEvent(event->type()))
|
| return 0.0;
|
|
|
| - return PerformanceMonitor::enabled(context)
|
| - ? kBlockedWarningThresholdMillis / 1000
|
| - : 0;
|
| + if (!context->isDocument())
|
| + return 0.0;
|
| + FrameHost* frameHost = toDocument(context)->frameHost();
|
| + if (!frameHost)
|
| + return 0.0;
|
| + return frameHost->settings().blockedMainThreadEventsWarningThreshold();
|
| }
|
|
|
| void reportBlockedEvent(ExecutionContext* context,
|
| @@ -135,8 +137,9 @@
|
| eventListenerEffectiveFunction(v8Listener->isolate(), handler);
|
| std::unique_ptr<SourceLocation> location =
|
| SourceLocation::fromFunction(function);
|
| - PerformanceMonitor::logViolation(WarningMessageLevel, context, messageText,
|
| - std::move(location));
|
| + ConsoleMessage* message = ConsoleMessage::create(
|
| + JSMessageSource, WarningMessageLevel, messageText, std::move(location));
|
| + context->addConsoleMessage(message);
|
| registeredListener->setBlockedEventWarningEmitted();
|
| }
|
|
|
|
|