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

Unified Diff: content/renderer/service_worker/service_worker_context_client.h

Issue 1220943003: [Background Sync] Use Mojo IPC to fire background sync events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mek
Patch Set: Addressing post-lgtm review comments Created 5 years, 5 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/renderer/service_worker/service_worker_context_client.h
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h
index f78758b87ff2d1334c445a39f0a9c2599f7ebb52..5711090004775b7ac00ad155805625bba48aa522 100644
--- a/content/renderer/service_worker/service_worker_context_client.h
+++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/service_worker/service_worker_types.h"
+#include "content/public/common/service_worker_event_status.mojom.h"
#include "ipc/ipc_listener.h"
#include "mojo/application/public/interfaces/service_provider.mojom.h"
#include "third_party/WebKit/public/platform/WebGeofencingEventType.h"
@@ -56,6 +57,8 @@ class WebServiceWorkerRegistrationImpl;
class ServiceWorkerContextClient
: public blink::WebServiceWorkerContextClient {
public:
+ using SyncCallback = mojo::Callback<void(ServiceWorkerEventStatus)>;
+
// Returns a thread-specific client instance. This does NOT create a
// new instance.
static ServiceWorkerContextClient* ThreadSpecificInstance();
@@ -147,6 +150,8 @@ class ServiceWorkerContextClient
virtual void stashMessagePort(blink::WebMessagePortChannel* channel,
const blink::WebString& name);
+ virtual void DispatchSyncEvent(const SyncCallback& callback);
+
private:
struct WorkerContextData;
@@ -161,7 +166,6 @@ class ServiceWorkerContextClient
void OnActivateEvent(int request_id);
void OnInstallEvent(int request_id);
void OnFetchEvent(int request_id, const ServiceWorkerFetchRequest& request);
- void OnSyncEvent(int request_id);
void OnNotificationClickEvent(
int request_id,
int64_t persistent_notification_id,

Powered by Google App Engine
This is Rietveld 408576698