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

Unified Diff: content/public/browser/push_messaging_service.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
« no previous file with comments | « content/browser/service_worker/service_worker_storage_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/push_messaging_service.cc
diff --git a/content/public/browser/push_messaging_service.cc b/content/public/browser/push_messaging_service.cc
index ea5058cf66adfccd717478c2c56ce1294cc075b9..e43e9f94414408f0d775b9c01c0811f0db25be27 100644
--- a/content/public/browser/push_messaging_service.cc
+++ b/content/public/browser/push_messaging_service.cc
@@ -17,13 +17,18 @@ namespace {
void CallStringCallbackFromIO(
const PushMessagingService::StringCallback& callback,
- const std::string& data,
+ const std::vector<std::string>& data,
ServiceWorkerStatusCode service_worker_status) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
bool success = service_worker_status == SERVICE_WORKER_OK;
bool not_found = service_worker_status == SERVICE_WORKER_ERROR_NOT_FOUND;
+ std::string result;
+ if (success) {
+ DCHECK_EQ(1u, data.size());
+ result = data[0];
+ }
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(callback, data, success, not_found));
+ base::Bind(callback, result, success, not_found));
}
void CallClosureFromIO(const base::Closure& callback,
@@ -39,7 +44,7 @@ void GetUserDataOnIO(
const PushMessagingService::StringCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
service_worker_context_wrapper->GetRegistrationUserData(
- service_worker_registration_id, key,
+ service_worker_registration_id, {key},
base::Bind(&CallStringCallbackFromIO, callback));
}
@@ -50,8 +55,7 @@ void ClearPushSubscriptionIDOnIO(
DCHECK_CURRENTLY_ON(BrowserThread::IO);
service_worker_context->ClearRegistrationUserData(
- service_worker_registration_id,
- kPushRegistrationIdServiceWorkerKey,
+ service_worker_registration_id, {kPushRegistrationIdServiceWorkerKey},
base::Bind(&CallClosureFromIO, callback));
}
« no previous file with comments | « content/browser/service_worker/service_worker_storage_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698