Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1643)

Side by Side Diff: content/child/service_worker/web_service_worker_registration_impl.h

Issue 516873002: ServiceWorker: Queue tasks until the registration proxy becomes ready (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile errors Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/child/service_worker/web_service_worker_registration_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_ 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_ 6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
7 7
8 #include <vector>
9
8 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
9 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistration.h" 11 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistration.h"
10 12
11 namespace blink { 13 namespace blink {
12 class WebServiceWorker; 14 class WebServiceWorker;
13 class WebServiceWorkerRegistrationProxy; 15 class WebServiceWorkerRegistrationProxy;
14 } 16 }
15 17
16 namespace content { 18 namespace content {
17 19
(...skipping 13 matching lines...) Expand all
31 void SetActive(blink::WebServiceWorker* service_worker); 33 void SetActive(blink::WebServiceWorker* service_worker);
32 34
33 void OnUpdateFound(); 35 void OnUpdateFound();
34 36
35 // blink::WebServiceWorkerRegistration overrides. 37 // blink::WebServiceWorkerRegistration overrides.
36 virtual void setProxy(blink::WebServiceWorkerRegistrationProxy* proxy); 38 virtual void setProxy(blink::WebServiceWorkerRegistrationProxy* proxy);
37 virtual blink::WebServiceWorkerRegistrationProxy* proxy(); 39 virtual blink::WebServiceWorkerRegistrationProxy* proxy();
38 virtual blink::WebURL scope() const; 40 virtual blink::WebURL scope() const;
39 41
40 private: 42 private:
43 enum QueuedTaskType {
44 INSTALLING,
45 WAITING,
46 ACTIVE,
47 UPDATE_FOUND,
48 };
49
50 struct QueuedTask {
51 QueuedTask(QueuedTaskType type,
52 blink::WebServiceWorker* worker);
53 QueuedTaskType type;
54 blink::WebServiceWorker* worker;
55 };
56
57 void RunQueuedTasks();
58 void ClearQueuedTasks();
59
41 scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref_; 60 scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref_;
42 blink::WebServiceWorkerRegistrationProxy* proxy_; 61 blink::WebServiceWorkerRegistrationProxy* proxy_;
43 62
63 std::vector<QueuedTask> queued_tasks_;
64
44 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl); 65 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl);
45 }; 66 };
46 67
47 } // namespace content 68 } // namespace content
48 69
49 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_ 70 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/service_worker/web_service_worker_registration_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698