1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
10 #include "base/compiler_specific.h"
11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistration.h"
15 class WebServiceWorker
;
16 class WebServiceWorkerRegistrationProxy
;
21 class ServiceWorkerRegistrationHandleReference
;
22 class ThreadSafeSender
;
23 struct ServiceWorkerObjectInfo
;
25 class CONTENT_EXPORT WebServiceWorkerRegistrationImpl
26 : NON_EXPORTED_BASE(public blink::WebServiceWorkerRegistration
) {
28 explicit WebServiceWorkerRegistrationImpl(
29 scoped_ptr
<ServiceWorkerRegistrationHandleReference
> handle_ref
);
30 virtual ~WebServiceWorkerRegistrationImpl();
32 void SetInstalling(blink::WebServiceWorker
* service_worker
);
33 void SetWaiting(blink::WebServiceWorker
* service_worker
);
34 void SetActive(blink::WebServiceWorker
* service_worker
);
38 // blink::WebServiceWorkerRegistration overrides.
39 virtual void setProxy(blink::WebServiceWorkerRegistrationProxy
* proxy
);
40 virtual blink::WebServiceWorkerRegistrationProxy
* proxy();
41 virtual blink::WebURL
scope() const;
42 virtual void update(blink::WebServiceWorkerProvider
* provider
);
43 virtual void unregister(blink::WebServiceWorkerProvider
* provider
,
44 WebServiceWorkerUnregistrationCallbacks
* callbacks
);
46 int64
registration_id() const;
57 QueuedTask(QueuedTaskType type
,
58 blink::WebServiceWorker
* worker
);
60 blink::WebServiceWorker
* worker
;
63 void RunQueuedTasks();
64 void ClearQueuedTasks();
66 scoped_ptr
<ServiceWorkerRegistrationHandleReference
> handle_ref_
;
67 blink::WebServiceWorkerRegistrationProxy
* proxy_
;
69 std::vector
<QueuedTask
> queued_tasks_
;
71 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl
);
74 } // namespace content
76 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_