| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/service_worker/service_worker_storage.h" | 5 #include "content/browser/service_worker/service_worker_storage.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 void EmptyCompletionCallback(int) {} | 58 void EmptyCompletionCallback(int) {} |
| 59 | 59 |
| 60 ServiceWorkerStatusCode DatabaseStatusToStatusCode( | 60 ServiceWorkerStatusCode DatabaseStatusToStatusCode( |
| 61 ServiceWorkerDatabase::Status status) { | 61 ServiceWorkerDatabase::Status status) { |
| 62 switch (status) { | 62 switch (status) { |
| 63 case ServiceWorkerDatabase::STATUS_OK: | 63 case ServiceWorkerDatabase::STATUS_OK: |
| 64 return SERVICE_WORKER_OK; | 64 return SERVICE_WORKER_OK; |
| 65 case ServiceWorkerDatabase::STATUS_ERROR_NOT_FOUND: | 65 case ServiceWorkerDatabase::STATUS_ERROR_NOT_FOUND: |
| 66 return SERVICE_WORKER_ERROR_NOT_FOUND; | 66 return SERVICE_WORKER_ERROR_NOT_FOUND; |
| 67 case ServiceWorkerDatabase::STATUS_ERROR_MAX: |
| 68 NOTREACHED(); |
| 67 default: | 69 default: |
| 68 return SERVICE_WORKER_ERROR_FAILED; | 70 return SERVICE_WORKER_ERROR_FAILED; |
| 69 } | 71 } |
| 70 } | 72 } |
| 71 | 73 |
| 72 } // namespace | 74 } // namespace |
| 73 | 75 |
| 74 ServiceWorkerStorage::InitialData::InitialData() | 76 ServiceWorkerStorage::InitialData::InitialData() |
| 75 : next_registration_id(kInvalidServiceWorkerRegistrationId), | 77 : next_registration_id(kInvalidServiceWorkerRegistrationId), |
| 76 next_version_id(kInvalidServiceWorkerVersionId), | 78 next_version_id(kInvalidServiceWorkerVersionId), |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 const FindInDBCallback& callback) { | 963 const FindInDBCallback& callback) { |
| 962 ServiceWorkerDatabase::RegistrationData data; | 964 ServiceWorkerDatabase::RegistrationData data; |
| 963 ResourceList resources; | 965 ResourceList resources; |
| 964 ServiceWorkerDatabase::Status status = | 966 ServiceWorkerDatabase::Status status = |
| 965 database->ReadRegistration(registration_id, origin, &data, &resources); | 967 database->ReadRegistration(registration_id, origin, &data, &resources); |
| 966 original_task_runner->PostTask( | 968 original_task_runner->PostTask( |
| 967 FROM_HERE, base::Bind(callback, data, resources, status)); | 969 FROM_HERE, base::Bind(callback, data, resources, status)); |
| 968 } | 970 } |
| 969 | 971 |
| 970 } // namespace content | 972 } // namespace content |
| OLD | NEW |