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

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

Issue 950343006: [BackgroundSync] Initial land of the BackgroundSyncManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CONTENT_EXPORT for nested classes Created 5 years, 9 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_storage.h ('k') | content/content_browser.gypi » ('j') | 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 3b37e233a328c915e346967c1536959cde501754..59ac4f2e2414589ba4166d5c748a28210e05bed5 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -773,13 +773,17 @@ void ServiceWorkerStorage::GetUserDataForAllRegistrations(
const std::string& key,
const ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback&
callback) {
- DCHECK(state_ == INITIALIZED || state_ == DISABLED) << state_;
- if (IsDisabled() || !context_) {
- RunSoon(FROM_HERE,
- base::Bind(callback, std::vector<std::pair<int64, std::string>>(),
- SERVICE_WORKER_ERROR_FAILED));
+ if (!LazyInitialize(
+ base::Bind(&ServiceWorkerStorage::GetUserDataForAllRegistrations,
+ weak_factory_.GetWeakPtr(), key, callback))) {
+ if (state_ != INITIALIZING || !context_) {
+ RunSoon(FROM_HERE,
+ base::Bind(callback, std::vector<std::pair<int64, std::string>>(),
+ SERVICE_WORKER_ERROR_FAILED));
+ }
return;
}
+ DCHECK_EQ(INITIALIZED, state_);
if (key.empty()) {
RunSoon(FROM_HERE,
« no previous file with comments | « content/browser/service_worker/service_worker_storage.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698