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

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

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: upload for real this time, address comments from falken@ and michaeln@ Created 4 years, 2 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 73
74 // Used for UMA. Append-only. 74 // Used for UMA. Append-only.
75 enum class StopStatus { 75 enum class StopStatus {
76 NORMAL, 76 NORMAL,
77 DETACH_BY_REGISTRY, 77 DETACH_BY_REGISTRY,
78 TIMEOUT, 78 TIMEOUT,
79 // Add new types here. 79 // Add new types here.
80 NUM_TYPES 80 NUM_TYPES
81 }; 81 };
82 82
83 // Used for UMA. Append-only. 83 // Used for UMA. Append-only.
falken 2016/09/29 14:52:25 Even though you dont add the UMA here, I think it'
lazyboy 2016/09/29 18:07:19 Done.
84 // This class is used to indicate which event is fired/finished. Most events 84 // This class is used to indicate which event is fired/finished. Most events
85 // have only one request that starts the event and one response that finishes 85 // have only one request that starts the event and one response that finishes
86 // the event, but the fetch and the foreign fetch event have two responses, so 86 // the event, but the fetch and the foreign fetch event have two responses, so
87 // there are two types of EventType to break down the measurement into two: 87 // there are two types of EventType to break down the measurement into two:
88 // FETCH/FOREIGN_FETCH and FETCH_WAITUNTIL/FOREIGN_FETCH_WAITUNTIL. 88 // FETCH/FOREIGN_FETCH and FETCH_WAITUNTIL/FOREIGN_FETCH_WAITUNTIL.
89 // Moreover, FETCH is separated into the four: MAIN_FRAME, SUB_FRAME, 89 // Moreover, FETCH is separated into the four: MAIN_FRAME, SUB_FRAME,
90 // SHARED_WORKER and SUB_RESOURCE for more detailed UMA. 90 // SHARED_WORKER and SUB_RESOURCE for more detailed UMA.
91 enum class EventType { 91 enum class EventType {
92 ACTIVATE = 0, 92 ACTIVATE = 0,
93 INSTALL = 1, 93 INSTALL = 1,
94 // FETCH = 2, // Obsolete 94 // FETCH = 2, // Obsolete
95 SYNC = 3, 95 SYNC = 3,
96 NOTIFICATION_CLICK = 4, 96 NOTIFICATION_CLICK = 4,
97 PUSH = 5, 97 PUSH = 5,
98 // GEOFENCING = 6, // Obsolete 98 // GEOFENCING = 6, // Obsolete
99 // SERVICE_PORT_CONNECT = 7, // Obsolete 99 // SERVICE_PORT_CONNECT = 7, // Obsolete
100 MESSAGE = 8, 100 MESSAGE = 8,
101 NOTIFICATION_CLOSE = 9, 101 NOTIFICATION_CLOSE = 9,
102 FETCH_MAIN_FRAME = 10, 102 FETCH_MAIN_FRAME = 10,
103 FETCH_SUB_FRAME = 11, 103 FETCH_SUB_FRAME = 11,
104 FETCH_SHARED_WORKER = 12, 104 FETCH_SHARED_WORKER = 12,
105 FETCH_SUB_RESOURCE = 13, 105 FETCH_SUB_RESOURCE = 13,
106 UNKNOWN = 14, // Used when event type is not known. 106 UNKNOWN = 14, // Used when event type is not known.
107 FOREIGN_FETCH = 15, 107 FOREIGN_FETCH = 15,
108 FETCH_WAITUNTIL = 16, 108 FETCH_WAITUNTIL = 16,
109 FOREIGN_FETCH_WAITUNTIL = 17, 109 FOREIGN_FETCH_WAITUNTIL = 17,
110 NAVIGATION_HINT_LINK_MOUSE_DOWN = 18, 110 NAVIGATION_HINT_LINK_MOUSE_DOWN = 18,
111 NAVIGATION_HINT_LINK_TAP_UNCONFIRMED = 19, 111 NAVIGATION_HINT_LINK_TAP_UNCONFIRMED = 19,
112 NAVIGATION_HINT_LINK_TAP_DOWN = 20, 112 NAVIGATION_HINT_LINK_TAP_DOWN = 20,
113 // Used when external consumers want to add a request to
114 // ServiceWorkerVersion to keep it alive.
115 EXTERNAL_REQUEST = 21,
113 // Add new events to record here. 116 // Add new events to record here.
114 NUM_TYPES 117 NUM_TYPES
115 }; 118 };
116 119
117 // Used for UMA. Append only. 120 // Used for UMA. Append only.
118 enum class Site { 121 enum class Site {
119 OTHER, // Obsolete for UMA. Use WITH_FETCH_HANDLER or 122 OTHER, // Obsolete for UMA. Use WITH_FETCH_HANDLER or
120 // WITHOUT_FETCH_HANDLER. 123 // WITHOUT_FETCH_HANDLER.
121 NEW_TAB_PAGE, 124 NEW_TAB_PAGE,
122 WITH_FETCH_HANDLER, 125 WITH_FETCH_HANDLER,
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 static void RecordStartStatusAfterFailure(int failure_count, 282 static void RecordStartStatusAfterFailure(int failure_count,
280 ServiceWorkerStatusCode status); 283 ServiceWorkerStatusCode status);
281 284
282 private: 285 private:
283 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); 286 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics);
284 }; 287 };
285 288
286 } // namespace content 289 } // namespace content
287 290
288 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ 291 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698