base/threading: remove ScopedTracker placed for experiments
[chromium-blink-merge.git] / content / child / service_worker / web_service_worker_registration_impl.h
blob6546c89a332f9d735ac6cfcc7b41c6eee6a2b9af
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_
8 #include <vector>
10 #include "base/compiler_specific.h"
11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistration.h"
14 namespace blink {
15 class WebServiceWorker;
16 class WebServiceWorkerRegistrationProxy;
19 namespace content {
21 class ServiceWorkerRegistrationHandleReference;
22 class ThreadSafeSender;
23 struct ServiceWorkerObjectInfo;
25 class CONTENT_EXPORT WebServiceWorkerRegistrationImpl
26 : NON_EXPORTED_BASE(public blink::WebServiceWorkerRegistration) {
27 public:
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);
36 void OnUpdateFound();
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 WebServiceWorkerUpdateCallbacks* callbacks);
44 virtual void unregister(blink::WebServiceWorkerProvider* provider,
45 WebServiceWorkerUnregistrationCallbacks* callbacks);
47 int64 registration_id() const;
49 private:
50 enum QueuedTaskType {
51 INSTALLING,
52 WAITING,
53 ACTIVE,
54 UPDATE_FOUND,
57 struct QueuedTask {
58 QueuedTask(QueuedTaskType type,
59 blink::WebServiceWorker* worker);
60 QueuedTaskType type;
61 blink::WebServiceWorker* worker;
64 void RunQueuedTasks();
65 void ClearQueuedTasks();
67 scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref_;
68 blink::WebServiceWorkerRegistrationProxy* proxy_;
70 std::vector<QueuedTask> queued_tasks_;
72 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl);
75 } // namespace content
77 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_