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

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

Issue 1327763002: Cleanup: Remove some LOG(ERROR) in ServiceWorkerContextWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and rm more .get() Created 5 years, 3 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 | « no previous file | 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_context_wrapper.cc
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index f83be8cf29a02cd028fced8b1975af5c1af7b9c0..4c80be97e106c01abeeb1cf1efee7ebfc120d757 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -150,7 +150,6 @@ void ServiceWorkerContextWrapper::DeleteAndStartOver() {
// The context could be null due to system shutdown or restart failure. In
// either case, we should not have to recover the system, so just return
// here.
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
return;
}
context_core_->DeleteAndStartOver(
@@ -195,8 +194,7 @@ void ServiceWorkerContextWrapper::RegisterServiceWorker(
continuation));
return;
}
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_) {
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
@@ -232,8 +230,7 @@ void ServiceWorkerContextWrapper::UnregisterServiceWorker(
continuation));
return;
}
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_) {
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
@@ -254,10 +251,8 @@ void ServiceWorkerContextWrapper::UpdateRegistration(const GURL& pattern) {
pattern));
return;
}
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_)
return;
- }
context_core_->storage()->FindRegistrationForPattern(
net::SimplifyUrlForRequest(pattern),
base::Bind(&ServiceWorkerContextWrapper::DidFindRegistrationForUpdate,
@@ -274,8 +269,7 @@ void ServiceWorkerContextWrapper::StartServiceWorker(
pattern, callback));
return;
}
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, SERVICE_WORKER_ERROR_ABORT));
return;
@@ -293,10 +287,8 @@ void ServiceWorkerContextWrapper::SimulateSkipWaiting(int64_t version_id) {
version_id));
return;
}
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_)
return;
- }
ServiceWorkerVersion* version = GetLiveVersion(version_id);
if (!version || version->skip_waiting())
return;
@@ -331,8 +323,7 @@ void ServiceWorkerContextWrapper::CanHandleMainResourceOffline(
void ServiceWorkerContextWrapper::GetAllOriginsInfo(
const GetUsageInfoCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_) {
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
@@ -395,10 +386,8 @@ void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate(
if (status != SERVICE_WORKER_OK)
return;
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_)
return;
- }
DCHECK(registration);
context_core_->UpdateServiceWorker(registration.get(),
true /* force_bypass_cache */);
@@ -419,8 +408,7 @@ void ServiceWorkerContextWrapper::DeleteForOrigin(
const GURL& origin,
const ResultCallback& result) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_) {
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
@@ -446,8 +434,7 @@ void ServiceWorkerContextWrapper::CheckHasServiceWorker(
url, other_url, callback));
return;
}
- if (!context_core_.get()) {
- LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
+ if (!context_core_) {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(callback, false));
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698