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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp

Issue 2218943002: Introduce ServiceWorker.EventDispatchingDelay UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated mpearson@'s comment Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
index 843f76852a7879099f7d5e007798fae34699d495..ef65b6b1660fc1fb925d099d0864ad53b244ffb2 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
@@ -84,6 +84,7 @@ WaitUntilObserver* WaitUntilObserver::create(ExecutionContext* context, EventTyp
void WaitUntilObserver::willDispatchEvent()
{
+ m_eventDispatchTime = WTF::currentTime();
// When handling a notificationclick event, we want to allow one window to
// be focused or opened. These calls are allowed between the call to
// willDispatchEvent() and the last call to decrementPendingActivity(). If
@@ -131,9 +132,6 @@ WaitUntilObserver::WaitUntilObserver(ExecutionContext* context, EventType type,
: ContextLifecycleObserver(context)
, m_type(type)
, m_eventID(eventID)
- , m_pendingActivity(0)
- , m_hasError(false)
- , m_eventDispatched(false)
, m_consumeWindowInteractionTimer(this, &WaitUntilObserver::consumeWindowInteraction)
{
}
@@ -161,30 +159,30 @@ void WaitUntilObserver::decrementPendingActivity()
WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResultRejected : WebServiceWorkerEventResultCompleted;
switch (m_type) {
case Activate:
- client->didHandleActivateEvent(m_eventID, result);
+ client->didHandleActivateEvent(m_eventID, result, m_eventDispatchTime);
break;
case Fetch:
- client->didHandleFetchEvent(m_eventID, result);
+ client->didHandleFetchEvent(m_eventID, result, m_eventDispatchTime);
break;
case Install:
- client->didHandleInstallEvent(m_eventID, result);
+ client->didHandleInstallEvent(m_eventID, result, m_eventDispatchTime);
break;
case Message:
- client->didHandleExtendableMessageEvent(m_eventID, result);
+ client->didHandleExtendableMessageEvent(m_eventID, result, m_eventDispatchTime);
break;
case NotificationClick:
- client->didHandleNotificationClickEvent(m_eventID, result);
+ client->didHandleNotificationClickEvent(m_eventID, result, m_eventDispatchTime);
m_consumeWindowInteractionTimer.stop();
consumeWindowInteraction(nullptr);
break;
case NotificationClose:
- client->didHandleNotificationCloseEvent(m_eventID, result);
+ client->didHandleNotificationCloseEvent(m_eventID, result, m_eventDispatchTime);
break;
case Push:
- client->didHandlePushEvent(m_eventID, result);
+ client->didHandlePushEvent(m_eventID, result, m_eventDispatchTime);
break;
case Sync:
- client->didHandleSyncEvent(m_eventID, result);
+ client->didHandleSyncEvent(m_eventID, result, m_eventDispatchTime);
break;
}
setContext(nullptr);

Powered by Google App Engine
This is Rietveld 408576698