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" |
| 11 #include "base/time/time.h" |
11 #include "content/browser/service_worker/service_worker_database.h" | 12 #include "content/browser/service_worker/service_worker_database.h" |
12 #include "content/common/service_worker/service_worker_types.h" | 13 #include "content/common/service_worker/service_worker_types.h" |
13 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseError.h" | 14 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseError.h" |
14 | 15 |
15 class GURL; | 16 class GURL; |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 enum class EmbeddedWorkerStatus; | 20 enum class EmbeddedWorkerStatus; |
20 | 21 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 bool frame_fetch_event_fired); | 219 bool frame_fetch_event_fired); |
219 | 220 |
220 // Records how often a dispatched event times out. | 221 // Records how often a dispatched event times out. |
221 static void RecordEventTimeout(EventType event); | 222 static void RecordEventTimeout(EventType event); |
222 | 223 |
223 // Records the amount of time spent handling an event. | 224 // Records the amount of time spent handling an event. |
224 static void RecordEventDuration(EventType event, | 225 static void RecordEventDuration(EventType event, |
225 base::TimeDelta time, | 226 base::TimeDelta time, |
226 bool was_handled); | 227 bool was_handled); |
227 | 228 |
| 229 // Records the time taken between sending an event IPC from the browser |
| 230 // process to a Service Worker and executing the event handler in the Service |
| 231 // Worker. |
| 232 static void RecordEventDispatchingDelay(EventType event, |
| 233 base::TimeDelta time, |
| 234 Site site_for_metrics); |
| 235 |
228 // Records the result of dispatching a fetch event to a service worker. | 236 // Records the result of dispatching a fetch event to a service worker. |
229 static void RecordFetchEventStatus(bool is_main_resource, | 237 static void RecordFetchEventStatus(bool is_main_resource, |
230 ServiceWorkerStatusCode status); | 238 ServiceWorkerStatusCode status); |
231 | 239 |
232 // Records result of a ServiceWorkerURLRequestJob that was forwarded to | 240 // Records result of a ServiceWorkerURLRequestJob that was forwarded to |
233 // the service worker. | 241 // the service worker. |
234 static void RecordURLRequestJobResult(bool is_main_resource, | 242 static void RecordURLRequestJobResult(bool is_main_resource, |
235 URLRequestJobResult result); | 243 URLRequestJobResult result); |
236 | 244 |
237 // Records the error code provided when the renderer returns a response with | 245 // Records the error code provided when the renderer returns a response with |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 static void RecordStartStatusAfterFailure(int failure_count, | 279 static void RecordStartStatusAfterFailure(int failure_count, |
272 ServiceWorkerStatusCode status); | 280 ServiceWorkerStatusCode status); |
273 | 281 |
274 private: | 282 private: |
275 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 283 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
276 }; | 284 }; |
277 | 285 |
278 } // namespace content | 286 } // namespace content |
279 | 287 |
280 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 288 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
OLD | NEW |