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;
43 int64
registration_id() const;
54 QueuedTask(QueuedTaskType type
,
55 blink::WebServiceWorker
* worker
);
57 blink::WebServiceWorker
* worker
;
60 void RunQueuedTasks();
61 void ClearQueuedTasks();
63 scoped_ptr
<ServiceWorkerRegistrationHandleReference
> handle_ref_
;
64 blink::WebServiceWorkerRegistrationProxy
* proxy_
;
66 std::vector
<QueuedTask
> queued_tasks_
;
68 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl
);
71 } // namespace content
73 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_