Chromium Code Reviews| Index: content/browser/service_worker/service_worker_storage.cc |
| diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc |
| index 69e48f37ab2b678e670eebb4bdb9bf23615cc519..c950c87d1725d6704f2e049ae3abdf4478c77db6 100644 |
| --- a/content/browser/service_worker/service_worker_storage.cc |
| +++ b/content/browser/service_worker/service_worker_storage.cc |
| @@ -9,7 +9,6 @@ |
| #include "base/bind_helpers.h" |
| #include "base/debug/trace_event.h" |
| #include "base/files/file_util.h" |
| -#include "base/hash.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/sequenced_task_runner.h" |
| #include "base/single_thread_task_runner.h" |
| @@ -770,9 +769,8 @@ void ServiceWorkerStorage::DidReadInitialData( |
| registered_origins_.swap(data->origins); |
| state_ = INITIALIZED; |
| } else { |
| - // TODO(nhiroki): Stringify |status| using StatusToString() defined in |
| - // service_worker_database.cc. |
| - DVLOG(2) << "Failed to initialize: " << status; |
| + DVLOG(2) << "Failed to initialize: " |
| + << ServiceWorkerDatabase::StatusToString(status); |
| ScheduleDeleteAndStartOver(); |
| } |
| @@ -796,7 +794,7 @@ void ServiceWorkerStorage::DidFindRegistrationForDocument( |
| "ServiceWorker", |
| "ServiceWorkerStorage::FindRegistrationForDocument", |
| callback_id, |
| - "Status", "OK"); |
| + "Status", ServiceWorkerDatabase::StatusToString(status)); |
| return; |
| } |
| @@ -804,14 +802,17 @@ void ServiceWorkerStorage::DidFindRegistrationForDocument( |
| // Look for something currently being installed. |
| scoped_refptr<ServiceWorkerRegistration> installing_registration = |
| FindInstallingRegistrationForDocument(document_url); |
| - callback.Run(installing_registration.get() ? SERVICE_WORKER_OK |
| - : SERVICE_WORKER_ERROR_NOT_FOUND, |
| - installing_registration); |
| - TRACE_EVENT_ASYNC_END1( |
| + ServiceWorkerStatusCode installing_status = installing_registration.get() ? |
| + SERVICE_WORKER_OK : SERVICE_WORKER_ERROR_NOT_FOUND; |
| + callback.Run(installing_status, installing_registration); |
| + TRACE_EVENT_ASYNC_END2( |
| "ServiceWorker", |
| "ServiceWorkerStorage::FindRegistrationForDocument", |
| callback_id, |
| - "Status", status); |
| + "Status", ServiceWorkerDatabase::StatusToString(status), |
| + "Info", |
| + (installing_status == SERVICE_WORKER_OK) ? |
| + "Found installing registration" : "Not found any registrations"); |
|
nhiroki
2014/10/16 09:20:51
nit: found -> find
shimazu
2014/10/17 01:54:46
Done.
|
| return; |
| } |
| @@ -822,7 +823,7 @@ void ServiceWorkerStorage::DidFindRegistrationForDocument( |
| "ServiceWorker", |
| "ServiceWorkerStorage::FindRegistrationForDocument", |
| callback_id, |
| - "Status", status); |
| + "Status", ServiceWorkerDatabase::StatusToString(status)); |
| } |
| void ServiceWorkerStorage::DidFindRegistrationForPattern( |
| @@ -1412,7 +1413,8 @@ void ServiceWorkerStorage::DidDeleteDatabase( |
| DCHECK_EQ(DISABLED, state_); |
| if (status != ServiceWorkerDatabase::STATUS_OK) { |
| // Give up the corruption recovery until the browser restarts. |
| - LOG(ERROR) << "Failed to delete the database: " << status; |
| + LOG(ERROR) << "Failed to delete the database: " |
| + << ServiceWorkerDatabase::StatusToString(status); |
| callback.Run(DatabaseStatusToStatusCode(status)); |
| return; |
| } |