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 |
| 11 class GURL; |
| 12 |
11 namespace content { | 13 namespace content { |
12 | 14 |
13 class ServiceWorkerMetrics { | 15 class ServiceWorkerMetrics { |
14 public: | 16 public: |
15 enum ReadResponseResult { | 17 enum ReadResponseResult { |
16 READ_OK, | 18 READ_OK, |
17 READ_HEADERS_ERROR, | 19 READ_HEADERS_ERROR, |
18 READ_DATA_ERROR, | 20 READ_DATA_ERROR, |
19 NUM_READ_RESPONSE_RESULT_TYPES, | 21 NUM_READ_RESPONSE_RESULT_TYPES, |
20 }; | 22 }; |
21 | 23 |
22 enum WriteResponseResult { | 24 enum WriteResponseResult { |
23 WRITE_OK, | 25 WRITE_OK, |
24 WRITE_HEADERS_ERROR, | 26 WRITE_HEADERS_ERROR, |
25 WRITE_DATA_ERROR, | 27 WRITE_DATA_ERROR, |
26 NUM_WRITE_RESPONSE_RESULT_TYPES, | 28 NUM_WRITE_RESPONSE_RESULT_TYPES, |
27 }; | 29 }; |
28 | 30 |
29 // Used for ServiceWorkerDiskCache. | 31 // Used for ServiceWorkerDiskCache. |
30 static void CountInitDiskCacheResult(bool result); | 32 static void CountInitDiskCacheResult(bool result); |
31 static void CountReadResponseResult(ReadResponseResult result); | 33 static void CountReadResponseResult(ReadResponseResult result); |
32 static void CountWriteResponseResult(WriteResponseResult result); | 34 static void CountWriteResponseResult(WriteResponseResult result); |
33 | 35 |
34 // Used for ServiceWorkerDatabase. | 36 // Used for ServiceWorkerDatabase. |
35 static void CountOpenDatabaseResult(ServiceWorkerDatabase::Status status); | 37 static void CountOpenDatabaseResult(ServiceWorkerDatabase::Status status); |
36 static void CountReadDatabaseResult(ServiceWorkerDatabase::Status status); | 38 static void CountReadDatabaseResult(ServiceWorkerDatabase::Status status); |
37 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); | 39 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); |
38 | 40 |
39 // Counts the number of page loads controlled by a Service Worker. | 41 // Counts the number of page loads controlled by a Service Worker. |
40 static void CountControlledPageLoad(); | 42 static void CountControlledPageLoad(const GURL& url); |
41 | 43 |
42 private: | 44 private: |
43 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 45 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
44 }; | 46 }; |
45 | 47 |
46 } // namespace content | 48 } // namespace content |
47 | 49 |
48 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 50 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
OLD | NEW |