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 "base/time/time.h" |
12 #include "content/browser/service_worker/service_worker_database.h" | 12 #include "content/browser/service_worker/service_worker_database.h" |
13 #include "content/common/service_worker/service_worker_types.h" | 13 #include "content/common/service_worker/service_worker_types.h" |
14 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseError.h" | 14 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseError.h" |
| 15 #include "ui/base/page_transition_types.h" |
15 | 16 |
16 class GURL; | 17 class GURL; |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 | 20 |
20 enum class EmbeddedWorkerStatus; | 21 enum class EmbeddedWorkerStatus; |
21 | 22 |
22 class ServiceWorkerMetrics { | 23 class ServiceWorkerMetrics { |
23 public: | 24 public: |
24 // Used for UMA. Append-only. | 25 // Used for UMA. Append-only. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); | 167 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); |
167 static void RecordDestroyDatabaseResult(ServiceWorkerDatabase::Status status); | 168 static void RecordDestroyDatabaseResult(ServiceWorkerDatabase::Status status); |
168 | 169 |
169 // Used for ServiceWorkerStorage. | 170 // Used for ServiceWorkerStorage. |
170 static void RecordPurgeResourceResult(int net_error); | 171 static void RecordPurgeResourceResult(int net_error); |
171 static void RecordDeleteAndStartOverResult(DeleteAndStartOverResult result); | 172 static void RecordDeleteAndStartOverResult(DeleteAndStartOverResult result); |
172 | 173 |
173 // Counts the number of page loads controlled by a Service Worker. | 174 // Counts the number of page loads controlled by a Service Worker. |
174 static void CountControlledPageLoad(Site site, | 175 static void CountControlledPageLoad(Site site, |
175 const GURL& url, | 176 const GURL& url, |
176 bool is_main_frame_load); | 177 bool is_main_frame_load, |
| 178 ui::PageTransition page_transition, |
| 179 size_t redirect_chain_length); |
177 | 180 |
178 // Records the result of trying to start a worker. |is_installed| indicates | 181 // Records the result of trying to start a worker. |is_installed| indicates |
179 // whether the version has been installed. | 182 // whether the version has been installed. |
180 static void RecordStartWorkerStatus(ServiceWorkerStatusCode status, | 183 static void RecordStartWorkerStatus(ServiceWorkerStatusCode status, |
181 EventType purpose, | 184 EventType purpose, |
182 bool is_installed); | 185 bool is_installed); |
183 | 186 |
184 // Records the time taken to successfully start a worker. |is_installed| | 187 // Records the time taken to successfully start a worker. |is_installed| |
185 // indicates whether the version has been installed. | 188 // indicates whether the version has been installed. |
186 static void RecordStartWorkerTime(base::TimeDelta time, | 189 static void RecordStartWorkerTime(base::TimeDelta time, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 static void RecordStartStatusAfterFailure(int failure_count, | 285 static void RecordStartStatusAfterFailure(int failure_count, |
283 ServiceWorkerStatusCode status); | 286 ServiceWorkerStatusCode status); |
284 | 287 |
285 private: | 288 private: |
286 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 289 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
287 }; | 290 }; |
288 | 291 |
289 } // namespace content | 292 } // namespace content |
290 | 293 |
291 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 294 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
OLD | NEW |