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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/browser/service_worker/service_worker_database.h" | 9 #include "content/browser/service_worker/service_worker_database.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 NUM_READ_RESPONSE_RESULT_TYPES, | 21 NUM_READ_RESPONSE_RESULT_TYPES, |
22 }; | 22 }; |
23 | 23 |
24 enum WriteResponseResult { | 24 enum WriteResponseResult { |
25 WRITE_OK, | 25 WRITE_OK, |
26 WRITE_HEADERS_ERROR, | 26 WRITE_HEADERS_ERROR, |
27 WRITE_DATA_ERROR, | 27 WRITE_DATA_ERROR, |
28 NUM_WRITE_RESPONSE_RESULT_TYPES, | 28 NUM_WRITE_RESPONSE_RESULT_TYPES, |
29 }; | 29 }; |
30 | 30 |
| 31 enum DiskCacheMigrationResult { |
| 32 MIGRATION_OK, |
| 33 MIGRATION_NOT_NECESSARY, |
| 34 MIGRATION_ERROR_FAILED, |
| 35 NUM_MIGRATION_RESULT_TYPES, |
| 36 }; |
| 37 |
31 enum DeleteAndStartOverResult { | 38 enum DeleteAndStartOverResult { |
32 DELETE_OK, | 39 DELETE_OK, |
33 DELETE_DATABASE_ERROR, | 40 DELETE_DATABASE_ERROR, |
34 DELETE_DISK_CACHE_ERROR, | 41 DELETE_DISK_CACHE_ERROR, |
35 NUM_DELETE_AND_START_OVER_RESULT_TYPES, | 42 NUM_DELETE_AND_START_OVER_RESULT_TYPES, |
36 }; | 43 }; |
37 | 44 |
38 enum URLRequestJobResult { | 45 enum URLRequestJobResult { |
39 REQUEST_JOB_FALLBACK_RESPONSE, | 46 REQUEST_JOB_FALLBACK_RESPONSE, |
40 REQUEST_JOB_FALLBACK_FOR_CORS, | 47 REQUEST_JOB_FALLBACK_FOR_CORS, |
(...skipping 23 matching lines...) Expand all Loading... |
64 static void CountWriteResponseResult(WriteResponseResult result); | 71 static void CountWriteResponseResult(WriteResponseResult result); |
65 | 72 |
66 // Used for ServiceWorkerDatabase. | 73 // Used for ServiceWorkerDatabase. |
67 static void CountOpenDatabaseResult(ServiceWorkerDatabase::Status status); | 74 static void CountOpenDatabaseResult(ServiceWorkerDatabase::Status status); |
68 static void CountReadDatabaseResult(ServiceWorkerDatabase::Status status); | 75 static void CountReadDatabaseResult(ServiceWorkerDatabase::Status status); |
69 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); | 76 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); |
70 static void RecordDestroyDatabaseResult(ServiceWorkerDatabase::Status status); | 77 static void RecordDestroyDatabaseResult(ServiceWorkerDatabase::Status status); |
71 | 78 |
72 // Used for ServiceWorkerStorage. | 79 // Used for ServiceWorkerStorage. |
73 static void RecordDeleteAndStartOverResult(DeleteAndStartOverResult result); | 80 static void RecordDeleteAndStartOverResult(DeleteAndStartOverResult result); |
| 81 static void RecordDiskCacheMigrationResult(DiskCacheMigrationResult result); |
74 | 82 |
75 // Counts the number of page loads controlled by a Service Worker. | 83 // Counts the number of page loads controlled by a Service Worker. |
76 static void CountControlledPageLoad(const GURL& url); | 84 static void CountControlledPageLoad(const GURL& url); |
77 | 85 |
78 // Records the result of trying to start a worker. |is_installed| indicates | 86 // Records the result of trying to start a worker. |is_installed| indicates |
79 // whether the version has been installed. | 87 // whether the version has been installed. |
80 static void RecordStartWorkerStatus(ServiceWorkerStatusCode status, | 88 static void RecordStartWorkerStatus(ServiceWorkerStatusCode status, |
81 bool is_installed); | 89 bool is_installed); |
82 | 90 |
83 // Records the time taken to successfully start a worker. |is_installed| | 91 // Records the time taken to successfully start a worker. |is_installed| |
(...skipping 17 matching lines...) Expand all Loading... |
101 static void RecordFetchEventStatus(bool is_main_resource, | 109 static void RecordFetchEventStatus(bool is_main_resource, |
102 ServiceWorkerStatusCode status); | 110 ServiceWorkerStatusCode status); |
103 | 111 |
104 private: | 112 private: |
105 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 113 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
106 }; | 114 }; |
107 | 115 |
108 } // namespace content | 116 } // namespace content |
109 | 117 |
110 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 118 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
OLD | NEW |