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

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: Rebase after cr/1221503003 landed 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 970480d2705f089a28cf29737b84dd9f0dde3d1a..1ca7deacbf0eabf8758568cfb5da48647edc0794 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();
@@ -149,6 +152,8 @@ class ServiceWorkerContextClient
virtual void stashMessagePort(blink::WebMessagePortChannel* channel,
const blink::WebString& name);
+ virtual void DispatchSyncEvent(const SyncCallback& callback);
+
private:
struct WorkerContextData;
@@ -163,7 +168,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