| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 310 |
| 311 // Records the result of a start attempt that occurred after the worker had | 311 // Records the result of a start attempt that occurred after the worker had |
| 312 // failed |failure_count| consecutive times. | 312 // failed |failure_count| consecutive times. |
| 313 static void RecordStartStatusAfterFailure(int failure_count, | 313 static void RecordStartStatusAfterFailure(int failure_count, |
| 314 ServiceWorkerStatusCode status); | 314 ServiceWorkerStatusCode status); |
| 315 | 315 |
| 316 // Records the size of Service-Worker-Navigation-Preload header when the | 316 // Records the size of Service-Worker-Navigation-Preload header when the |
| 317 // navigation preload request is to be sent. | 317 // navigation preload request is to be sent. |
| 318 static void RecordNavigationPreloadRequestHeaderSize(size_t size); | 318 static void RecordNavigationPreloadRequestHeaderSize(size_t size); |
| 319 | 319 |
| 320 // Records timings for the navigation preload response and how |
| 321 // it compares to starting the worker. |
| 322 // |worker_start| is the time it took to prepare an activated and running |
| 323 // worker to receive the fetch event. |initial_worker_status| and |
| 324 // |start_situation| describe the preparation needed. |
| 325 // |response_start| is the time it took until the navigation preload response |
| 326 // started. |
| 327 CONTENT_EXPORT static void RecordNavigationPreloadResponse( |
| 328 base::TimeDelta worker_start, |
| 329 base::TimeDelta response_start, |
| 330 EmbeddedWorkerStatus initial_worker_status, |
| 331 StartSituation start_situation); |
| 332 |
| 320 // Records the result of trying to handle a request for a service worker | 333 // Records the result of trying to handle a request for a service worker |
| 321 // script. | 334 // script. |
| 322 static void RecordContextRequestHandlerStatus( | 335 static void RecordContextRequestHandlerStatus( |
| 323 ServiceWorkerContextRequestHandler::CreateJobStatus status, | 336 ServiceWorkerContextRequestHandler::CreateJobStatus status, |
| 324 bool is_installed, | 337 bool is_installed, |
| 325 bool is_main_script); | 338 bool is_main_script); |
| 326 | 339 |
| 327 private: | 340 private: |
| 328 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 341 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
| 329 }; | 342 }; |
| 330 | 343 |
| 331 } // namespace content | 344 } // namespace content |
| 332 | 345 |
| 333 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 346 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
| OLD | NEW |