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 "content/browser/service_worker/embedded_worker_status.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 class ServiceWorkerMetrics { | 20 class ServiceWorkerMetrics { |
20 public: | 21 public: |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 EventType purpose, | 155 EventType purpose, |
155 bool is_installed); | 156 bool is_installed); |
156 | 157 |
157 // Records the time taken to successfully start a worker. |is_installed| | 158 // Records the time taken to successfully start a worker. |is_installed| |
158 // indicates whether the version has been installed. | 159 // indicates whether the version has been installed. |
159 static void RecordStartWorkerTime(base::TimeDelta time, | 160 static void RecordStartWorkerTime(base::TimeDelta time, |
160 bool is_installed, | 161 bool is_installed, |
161 StartSituation start_situation, | 162 StartSituation start_situation, |
162 EventType purpose); | 163 EventType purpose); |
163 | 164 |
| 165 // Records the time taken to prepare an activated Service Worker for a main |
| 166 // frame fetch. |
| 167 static void RecordActivatedWorkerPreparationTimeForMainFrame( |
| 168 base::TimeDelta time, |
| 169 EmbeddedWorkerStatus initial_worker_status, |
| 170 StartSituation start_situation); |
| 171 |
164 // Records the result of trying to stop a worker. | 172 // Records the result of trying to stop a worker. |
165 static void RecordWorkerStopped(StopStatus status); | 173 static void RecordWorkerStopped(StopStatus status); |
166 | 174 |
167 // Records the time taken to successfully stop a worker. | 175 // Records the time taken to successfully stop a worker. |
168 static void RecordStopWorkerTime(base::TimeDelta time); | 176 static void RecordStopWorkerTime(base::TimeDelta time); |
169 | 177 |
170 static void RecordActivateEventStatus(ServiceWorkerStatusCode status, | 178 static void RecordActivateEventStatus(ServiceWorkerStatusCode status, |
171 bool is_shutdown); | 179 bool is_shutdown); |
172 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); | 180 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); |
173 | 181 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 static void RecordStartStatusAfterFailure(int failure_count, | 239 static void RecordStartStatusAfterFailure(int failure_count, |
232 ServiceWorkerStatusCode status); | 240 ServiceWorkerStatusCode status); |
233 | 241 |
234 private: | 242 private: |
235 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 243 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
236 }; | 244 }; |
237 | 245 |
238 } // namespace content | 246 } // namespace content |
239 | 247 |
240 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 248 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
OLD | NEW |