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

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

Issue 1945753002: Make Service Worker DB UserData methods accept multiple keys at once (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid6encrypt
Patch Set: Rebase Created 4 years, 7 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
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 c326aa5d89586e431b918e4e394c031b4297a53f..9541834503f8a12f75e7fe4ccc63327106dcbc5b 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -597,21 +597,21 @@ void ServiceWorkerContextWrapper::GetAllRegistrations(
void ServiceWorkerContextWrapper::GetRegistrationUserData(
int64_t registration_id,
- const std::string& key,
+ const std::vector<std::string>& keys,
const GetUserDataCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!context_core_) {
- RunSoon(base::Bind(callback, std::string(), SERVICE_WORKER_ERROR_ABORT));
+ RunSoon(base::Bind(callback, std::vector<std::string>(),
+ SERVICE_WORKER_ERROR_ABORT));
return;
}
- context_core_->storage()->GetUserData(registration_id, key, callback);
+ context_core_->storage()->GetUserData(registration_id, keys, callback);
}
void ServiceWorkerContextWrapper::StoreRegistrationUserData(
int64_t registration_id,
const GURL& origin,
- const std::string& key,
- const std::string& data,
+ const std::vector<std::pair<std::string, std::string>>& key_value_pairs,
const StatusCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!context_core_) {
@@ -619,19 +619,19 @@ void ServiceWorkerContextWrapper::StoreRegistrationUserData(
return;
}
context_core_->storage()->StoreUserData(registration_id, origin.GetOrigin(),
- key, data, callback);
+ key_value_pairs, callback);
}
void ServiceWorkerContextWrapper::ClearRegistrationUserData(
int64_t registration_id,
- const std::string& key,
+ const std::vector<std::string>& keys,
const StatusCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!context_core_) {
RunSoon(base::Bind(callback, SERVICE_WORKER_ERROR_ABORT));
return;
}
- context_core_->storage()->ClearUserData(registration_id, key, callback);
+ context_core_->storage()->ClearUserData(registration_id, keys, callback);
}
void ServiceWorkerContextWrapper::GetUserDataForAllRegistrations(

Powered by Google App Engine
This is Rietveld 408576698