Miscellaneous fixes for virtual/override/final specifiers to match style guide.
[chromium-blink-merge.git] / content / child / service_worker / web_service_worker_registration_impl.h
blob52ee1029ddf10ce6c902d9cec95bc5686b899466
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 "third_party/WebKit/public/platform/WebServiceWorkerRegistration.h"
13 namespace blink {
14 class WebServiceWorker;
15 class WebServiceWorkerRegistrationProxy;
18 namespace content {
20 class ServiceWorkerRegistrationHandleReference;
21 class ThreadSafeSender;
22 struct ServiceWorkerObjectInfo;
24 class WebServiceWorkerRegistrationImpl
25 : NON_EXPORTED_BASE(public blink::WebServiceWorkerRegistration) {
26 public:
27 explicit WebServiceWorkerRegistrationImpl(
28 scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref);
29 virtual ~WebServiceWorkerRegistrationImpl();
31 void SetInstalling(blink::WebServiceWorker* service_worker);
32 void SetWaiting(blink::WebServiceWorker* service_worker);
33 void SetActive(blink::WebServiceWorker* service_worker);
35 void OnUpdateFound();
37 // blink::WebServiceWorkerRegistration overrides.
38 virtual void setProxy(blink::WebServiceWorkerRegistrationProxy* proxy);
39 virtual blink::WebServiceWorkerRegistrationProxy* proxy();
40 virtual blink::WebURL scope() const;
42 int64 registration_id() const;
44 private:
45 enum QueuedTaskType {
46 INSTALLING,
47 WAITING,
48 ACTIVE,
49 UPDATE_FOUND,
52 struct QueuedTask {
53 QueuedTask(QueuedTaskType type,
54 blink::WebServiceWorker* worker);
55 QueuedTaskType type;
56 blink::WebServiceWorker* worker;
59 void RunQueuedTasks();
60 void ClearQueuedTasks();
62 scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref_;
63 blink::WebServiceWorkerRegistrationProxy* proxy_;
65 std::vector<QueuedTask> queued_tasks_;
67 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl);
70 } // namespace content
72 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_