| 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 DeleteAndStartOverResult { |
| 32 DELETE_OK, |
| 33 DELETE_DATABASE_ERROR, |
| 34 DELETE_DISK_CACHE_ERROR, |
| 35 NUM_DELETE_AND_START_OVER_RESULT_TYPES, |
| 36 }; |
| 37 |
| 31 // Used for ServiceWorkerDiskCache. | 38 // Used for ServiceWorkerDiskCache. |
| 32 static void CountInitDiskCacheResult(bool result); | 39 static void CountInitDiskCacheResult(bool result); |
| 33 static void CountReadResponseResult(ReadResponseResult result); | 40 static void CountReadResponseResult(ReadResponseResult result); |
| 34 static void CountWriteResponseResult(WriteResponseResult result); | 41 static void CountWriteResponseResult(WriteResponseResult result); |
| 35 | 42 |
| 36 // Used for ServiceWorkerDatabase. | 43 // Used for ServiceWorkerDatabase. |
| 37 static void CountOpenDatabaseResult(ServiceWorkerDatabase::Status status); | 44 static void CountOpenDatabaseResult(ServiceWorkerDatabase::Status status); |
| 38 static void CountReadDatabaseResult(ServiceWorkerDatabase::Status status); | 45 static void CountReadDatabaseResult(ServiceWorkerDatabase::Status status); |
| 39 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); | 46 static void CountWriteDatabaseResult(ServiceWorkerDatabase::Status status); |
| 47 static void RecordDestroyDatabaseResult(ServiceWorkerDatabase::Status status); |
| 48 |
| 49 // Used for ServiceWorkerStorage. |
| 50 static void RecordDeleteAndStartOverResult(DeleteAndStartOverResult result); |
| 40 | 51 |
| 41 // Counts the number of page loads controlled by a Service Worker. | 52 // Counts the number of page loads controlled by a Service Worker. |
| 42 static void CountControlledPageLoad(const GURL& url); | 53 static void CountControlledPageLoad(const GURL& url); |
| 43 | 54 |
| 44 private: | 55 private: |
| 45 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 56 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
| 46 }; | 57 }; |
| 47 | 58 |
| 48 } // namespace content | 59 } // namespace content |
| 49 | 60 |
| 50 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 61 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
| OLD | NEW |