OLD | NEW |
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // Records the result of trying to stop a worker. | 188 // Records the result of trying to stop a worker. |
189 static void RecordWorkerStopped(StopStatus status); | 189 static void RecordWorkerStopped(StopStatus status); |
190 | 190 |
191 // Records the time taken to successfully stop a worker. | 191 // Records the time taken to successfully stop a worker. |
192 static void RecordStopWorkerTime(base::TimeDelta time); | 192 static void RecordStopWorkerTime(base::TimeDelta time); |
193 | 193 |
194 static void RecordActivateEventStatus(ServiceWorkerStatusCode status, | 194 static void RecordActivateEventStatus(ServiceWorkerStatusCode status, |
195 bool is_shutdown); | 195 bool is_shutdown); |
196 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); | 196 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); |
197 | 197 |
| 198 static void RecordForeignFetchRegistrationCount(size_t scope_count, |
| 199 size_t origin_count); |
| 200 |
198 // Records how much of dispatched events are handled while a Service | 201 // Records how much of dispatched events are handled while a Service |
199 // Worker is awake (i.e. after it is woken up until it gets stopped). | 202 // Worker is awake (i.e. after it is woken up until it gets stopped). |
200 static void RecordEventHandledRatio(EventType event, | 203 static void RecordEventHandledRatio(EventType event, |
201 size_t handled_events, | 204 size_t handled_events, |
202 size_t fired_events); | 205 size_t fired_events); |
203 | 206 |
204 // Records the precision of the speculative launch of Service Workers for | 207 // Records the precision of the speculative launch of Service Workers for |
205 // each navigation hint type when the worker is stopped. If there was no | 208 // each navigation hint type when the worker is stopped. If there was no |
206 // main/sub frame fetch event fired on the worker, |frame_fetch_event_fired| | 209 // main/sub frame fetch event fired on the worker, |frame_fetch_event_fired| |
207 // is false. This means that the speculative launch wasn't helpful. | 210 // is false. This means that the speculative launch wasn't helpful. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 static void RecordStartStatusAfterFailure(int failure_count, | 265 static void RecordStartStatusAfterFailure(int failure_count, |
263 ServiceWorkerStatusCode status); | 266 ServiceWorkerStatusCode status); |
264 | 267 |
265 private: | 268 private: |
266 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 269 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
267 }; | 270 }; |
268 | 271 |
269 } // namespace content | 272 } // namespace content |
270 | 273 |
271 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 274 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
OLD | NEW |