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

Unified Diff: content/public/browser/push_messaging_service.cc

Issue 1861683002: Background service worker push message processing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck ordering Created 4 years, 8 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/public/browser/push_messaging_service.h ('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 b345f9d2cdad29532af62cb22f6450b2a39e569f..ea5058cf66adfccd717478c2c56ce1294cc075b9 100644
--- a/content/public/browser/push_messaging_service.cc
+++ b/content/public/browser/push_messaging_service.cc
@@ -15,9 +15,6 @@ namespace content {
namespace {
-const char kNotificationsShownServiceWorkerKey[] =
- "notifications_shown_by_last_few_pushes";
-
void CallStringCallbackFromIO(
const PushMessagingService::StringCallback& callback,
const std::string& data,
@@ -29,15 +26,6 @@ void CallStringCallbackFromIO(
base::Bind(callback, data, success, not_found));
}
-void CallResultCallbackFromIO(
- const ServiceWorkerContext::ResultCallback& callback,
- ServiceWorkerStatusCode service_worker_status) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- bool success = service_worker_status == SERVICE_WORKER_OK;
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(callback, success));
-}
-
void CallClosureFromIO(const base::Closure& callback,
ServiceWorkerStatusCode status) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -55,19 +43,6 @@ void GetUserDataOnIO(
base::Bind(&CallStringCallbackFromIO, callback));
}
-void SetNotificationsShownOnIO(
- scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_wrapper,
- int64_t service_worker_registration_id,
- const GURL& origin,
- const std::string& data,
- const PushMessagingService::ResultCallback& callback) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- service_worker_context_wrapper->StoreRegistrationUserData(
- service_worker_registration_id, origin,
- kNotificationsShownServiceWorkerKey, data,
- base::Bind(&CallResultCallbackFromIO, callback));
-}
-
void ClearPushSubscriptionIDOnIO(
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
int64_t service_worker_registration_id,
@@ -92,41 +67,6 @@ scoped_refptr<ServiceWorkerContextWrapper> GetServiceWorkerContext(
} // anonymous namespace
// static
-void PushMessagingService::GetNotificationsShownByLastFewPushes(
- ServiceWorkerContext* service_worker_context,
- int64_t service_worker_registration_id,
- const StringCallback& callback) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- scoped_refptr<ServiceWorkerContextWrapper> wrapper =
- static_cast<ServiceWorkerContextWrapper*>(service_worker_context);
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(&GetUserDataOnIO,
- wrapper,
- service_worker_registration_id,
- kNotificationsShownServiceWorkerKey,
- callback));
-}
-
-// static
-void PushMessagingService::SetNotificationsShownByLastFewPushes(
- ServiceWorkerContext* service_worker_context,
- int64_t service_worker_registration_id,
- const GURL& origin,
- const std::string& notifications_shown,
- const ResultCallback& callback) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- scoped_refptr<ServiceWorkerContextWrapper> wrapper =
- static_cast<ServiceWorkerContextWrapper*>(service_worker_context);
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(&SetNotificationsShownOnIO,
- wrapper,
- service_worker_registration_id,
- origin,
- notifications_shown,
- callback));
-}
-
-// static
void PushMessagingService::GetSenderId(BrowserContext* browser_context,
const GURL& origin,
int64_t service_worker_registration_id,
« no previous file with comments | « content/public/browser/push_messaging_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698