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

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

Issue 2484213003: Convert performance monitor to the subscription model. (Closed)
Patch Set: core export 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
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 13346d6f9206d42f0419aea37bf81d968c63e899..dc84b28122107b6c925182a3e8f6b5ff1ced7ac1 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -59,8 +59,6 @@ using namespace WTF;
namespace blink {
namespace {
-static const double kBlockedWarningThresholdMillis = 100.0;
-
enum PassiveForcedListenerResultType {
PreventDefaultNotCalled,
DocumentLevelTouchPreventDefaultCalled,
@@ -101,15 +99,14 @@ bool isScrollBlockingEvent(const AtomicString& eventType) {
eventType == EventTypeNames::wheel;
}
-double blockedEventsWarningThreshold(ExecutionContext* context, Event* event) {
+double blockedEventsWarningThreshold(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;
+ return PerformanceMonitor::threshold(context,
+ PerformanceMonitor::kBlockedEvent);
}
void reportBlockedEvent(ExecutionContext* context,
@@ -140,8 +137,10 @@ void reportBlockedEvent(ExecutionContext* context,
eventListenerEffectiveFunction(v8Listener->isolate(), handler);
std::unique_ptr<SourceLocation> location =
SourceLocation::fromFunction(function);
- PerformanceMonitor::logViolation(WarningMessageLevel, context, messageText,
- std::move(location));
+
+ PerformanceMonitor::reportGenericViolation(
+ context, PerformanceMonitor::kBlockedEvent, messageText, delayedSeconds,
+ location.get());
registeredListener->setBlockedEventWarningEmitted();
}

Powered by Google App Engine
This is Rietveld 408576698