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

Side by Side Diff: content/browser/service_worker/service_worker_metrics.h

Issue 2034663002: ServiceWorker: Keep the worker alive until FetchEvent.waitUntil settles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the comment and remove extra decrementPendingActivity Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // Used for UMA. Append-only. 73 // Used for UMA. Append-only.
74 enum class StopStatus { 74 enum class StopStatus {
75 NORMAL, 75 NORMAL,
76 DETACH_BY_REGISTRY, 76 DETACH_BY_REGISTRY,
77 TIMEOUT, 77 TIMEOUT,
78 // Add new types here. 78 // Add new types here.
79 NUM_TYPES 79 NUM_TYPES
80 }; 80 };
81 81
82 // Used for UMA. Append-only. 82 // Used for UMA. Append-only.
83 // This class is used to indicate which event is fired/finished. Most events
84 // have only one request that starts event and one response that finishes
falken 2016/06/22 05:53:33 nit: s/starts event/starts the event and s/finishe
shimazu 2016/06/22 07:13:39 Done.
85 // event, but the fetch and the foreign fetch event have two responses, so
86 // there are two types of EventType to break down the measurement into two:
87 // FETCH/FOREIGN_FETCH and FETCH_WAITUNTIL/FOREIGN_FETCH_WAITUNTIL.
88 // Moreover, FETCH is separated into the four: MAIN_FRAME, SUB_FRAME,
89 // SHARED_WORKER and SUB_RESOURCE for more detailed UMA.
83 enum class EventType { 90 enum class EventType {
84 ACTIVATE = 0, 91 ACTIVATE = 0,
85 INSTALL = 1, 92 INSTALL = 1,
86 // FETCH = 2, // Obsolete 93 // FETCH = 2, // Obsolete
87 SYNC = 3, 94 SYNC = 3,
88 NOTIFICATION_CLICK = 4, 95 NOTIFICATION_CLICK = 4,
89 PUSH = 5, 96 PUSH = 5,
90 // GEOFENCING = 6, // Obsolete 97 // GEOFENCING = 6, // Obsolete
91 // SERVICE_PORT_CONNECT = 7, // Obsolete 98 // SERVICE_PORT_CONNECT = 7, // Obsolete
92 MESSAGE = 8, 99 MESSAGE = 8,
93 NOTIFICATION_CLOSE = 9, 100 NOTIFICATION_CLOSE = 9,
94 FETCH_MAIN_FRAME = 10, 101 FETCH_MAIN_FRAME = 10,
95 FETCH_SUB_FRAME = 11, 102 FETCH_SUB_FRAME = 11,
96 FETCH_SHARED_WORKER = 12, 103 FETCH_SHARED_WORKER = 12,
97 FETCH_SUB_RESOURCE = 13, 104 FETCH_SUB_RESOURCE = 13,
98 UNKNOWN = 14, // Used when event type is not known. 105 UNKNOWN = 14, // Used when event type is not known.
99 FOREIGN_FETCH = 15, 106 FOREIGN_FETCH = 15,
107 FETCH_WAITUNTIL = 16,
108 FOREIGN_FETCH_WAITUNTIL = 17,
100 // Add new events to record here. 109 // Add new events to record here.
101 NUM_TYPES 110 NUM_TYPES
102 }; 111 };
103 112
104 // Used for UMA. Append only. 113 // Used for UMA. Append only.
105 enum class Site { 114 enum class Site {
106 OTHER, // Obsolete 115 OTHER, // Obsolete
107 NEW_TAB_PAGE, 116 NEW_TAB_PAGE,
108 WITH_FETCH_HANDLER, 117 WITH_FETCH_HANDLER,
109 WITHOUT_FETCH_HANDLER, 118 WITHOUT_FETCH_HANDLER,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 static void RecordStartStatusAfterFailure(int failure_count, 249 static void RecordStartStatusAfterFailure(int failure_count,
241 ServiceWorkerStatusCode status); 250 ServiceWorkerStatusCode status);
242 251
243 private: 252 private:
244 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); 253 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics);
245 }; 254 };
246 255
247 } // namespace content 256 } // namespace content
248 257
249 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ 258 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698