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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2490563002: Revert of DevTools: add the logging aspect into the PerformanceMonitor (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698