Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: content/browser/service_worker/service_worker_storage.cc

Issue 654823002: ServiceWorker: Convert ServiceWorkerDatabase::Status to string for logging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add 'not' Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/service_worker/service_worker_database.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3a2695efc7202d427efd1d71ffe9e08c7a696f3f 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"
@@ -280,7 +279,7 @@ void ServiceWorkerStorage::FindRegistrationForDocument(
"ServiceWorkerStorage::FindRegistrationForDocument:CheckInstalling",
TRACE_EVENT_SCOPE_THREAD,
"URL", document_url.spec(),
- "Status", (status == SERVICE_WORKER_OK) ? "Found" : "Not Found");
+ "Status", ServiceWorkerStatusToString(status));
CompleteFindNow(installing_registration,
status,
callback);
@@ -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,18 @@ 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) ?
+ "Installing registration is found" :
+ "Any registrations are not found");
return;
}
@@ -822,7 +824,7 @@ void ServiceWorkerStorage::DidFindRegistrationForDocument(
"ServiceWorker",
"ServiceWorkerStorage::FindRegistrationForDocument",
callback_id,
- "Status", status);
+ "Status", ServiceWorkerDatabase::StatusToString(status));
}
void ServiceWorkerStorage::DidFindRegistrationForPattern(
@@ -1412,7 +1414,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;
}
« no previous file with comments | « content/browser/service_worker/service_worker_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698