#include "content/public/browser/push_messaging_service.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "content/browser/push_messaging/push_messaging_manager.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
namespace content {
namespace {
void CallStringCallback(
PushMessagingService::RegistrationUserDataCallback callback,
const std::vector<std::string>& data,
blink::ServiceWorkerStatusCode service_worker_status) { … }
void CallClosure(base::OnceClosure callback,
blink::ServiceWorkerStatusCode status) { … }
scoped_refptr<ServiceWorkerContextWrapper> GetServiceWorkerContext(
BrowserContext* browser_context, const GURL& origin) { … }
void GetSWDataCallback(PushMessagingService::SWDataCallback callback,
const std::vector<std::string>& result) { … }
void GetSenderIdCallback(PushMessagingService::SenderIdCallback callback,
const std::vector<std::string>& result) { … }
}
void PushMessagingService::GetSenderId(BrowserContext* browser_context,
const GURL& origin,
int64_t service_worker_registration_id,
SenderIdCallback callback) { … }
void PushMessagingService::GetSWData(BrowserContext* browser_context,
const GURL& origin,
int64_t service_worker_registration_id,
SWDataCallback callback) { … }
void PushMessagingService::ClearPushSubscriptionId(
BrowserContext* browser_context,
const GURL& origin,
int64_t service_worker_registration_id,
base::OnceClosure callback) { … }
void PushMessagingService::UpdatePushSubscriptionId(
BrowserContext* browser_context,
const GURL& origin,
int64_t service_worker_registration_id,
const std::string& subscription_id,
base::OnceClosure callback) { … }
void PushMessagingService::StorePushSubscriptionForTesting(
BrowserContext* browser_context,
const GURL& origin,
int64_t service_worker_registration_id,
const std::string& subscription_id,
const std::string& sender_id,
base::OnceClosure callback) { … }
}