Chromium Code Reviews| Index: content/browser/service_worker/service_worker_version.h |
| diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h |
| index d77ed99202c02013e012641c7be48c86996778c0..1778f875a47c42f6ab4c52fff67fc13461df5952 100644 |
| --- a/content/browser/service_worker/service_worker_version.h |
| +++ b/content/browser/service_worker/service_worker_version.h |
| @@ -21,6 +21,7 @@ |
| #include "base/timer/timer.h" |
| #include "content/browser/service_worker/embedded_worker_instance.h" |
| #include "content/browser/service_worker/service_worker_script_cache_map.h" |
| +#include "content/common/background_sync_service.mojom.h" |
| #include "content/common/content_export.h" |
| #include "content/common/service_worker/service_worker_status_code.h" |
| #include "content/common/service_worker/service_worker_types.h" |
| @@ -46,6 +47,7 @@ namespace content { |
| class EmbeddedWorkerRegistry; |
| class ServiceWorkerContextCore; |
| +class ServiceWorkerMojoEventDispatcher; |
| class ServiceWorkerProviderHost; |
| class ServiceWorkerRegistration; |
| class ServiceWorkerURLRequestJob; |
| @@ -354,7 +356,6 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| REQUEST_ACTIVATE, |
| REQUEST_INSTALL, |
| REQUEST_FETCH, |
| - REQUEST_SYNC, |
| REQUEST_NOTIFICATION_CLICK, |
| REQUEST_PUSH, |
| REQUEST_GEOFENCING, |
| @@ -393,6 +394,10 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| const GURL& source_url) override; |
| bool OnMessageReceived(const IPC::Message& message) override; |
| + // Handle callbacks from background sync events |
| + void OnSyncEventFinished(const StatusCallback& callback, |
| + ServiceWorkerStatusCode status); |
| + |
| void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); |
| void DispatchInstallEventAfterStartWorker(const StatusCallback& callback); |
| @@ -416,8 +421,6 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| void OnFetchEventFinished(int request_id, |
| ServiceWorkerFetchEventResult result, |
| const ServiceWorkerResponse& response); |
| - void OnSyncEventFinished(int request_id, |
| - blink::WebServiceWorkerEventResult result); |
| void OnNotificationClickEventFinished(int request_id); |
| void OnPushEventFinished(int request_id, |
| blink::WebServiceWorkerEventResult result); |
| @@ -490,6 +493,8 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| // and records metrics about startup. |
| void RecordStartWorkerResult(ServiceWorkerStatusCode status); |
| + void StopIfRedundant(); |
| + |
| template <typename IDMAP> |
| void RemoveCallbackAndStopIfRedundant(IDMAP* callbacks, int request_id); |
| @@ -523,7 +528,6 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_; |
| IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_; |
| IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_; |
| - IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_; |
|
jkarlin
2015/06/17 15:17:29
You're going to need to keep this, for the reasons
iclelland
2015/06/18 16:01:14
As we discussed, I've reinstated all of the callba
|
| IDMap<StatusCallback, IDMapOwnPointer> notification_click_callbacks_; |
| IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_; |
| IDMap<StatusCallback, IDMapOwnPointer> geofencing_callbacks_; |
| @@ -568,6 +572,8 @@ class CONTENT_EXPORT ServiceWorkerVersion |
| scoped_ptr<PingController> ping_controller_; |
| scoped_ptr<Metrics> metrics_; |
| + scoped_ptr<ServiceWorkerMojoEventDispatcher> mojo_event_dispatcher_; |
|
jkarlin
2015/06/17 15:17:29
Why a scoped_ptr? This could just be a member.
iclelland
2015/06/18 16:01:14
No good reason, I suppose; I've untangled the #inc
|
| + |
| base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |