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

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerRegistration.h

Issue 1165363003: Service Worker: Add ServiceWorkerContainer.getRegistrations() method. (Blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add method getRegistrations to global-interface-listing-expected.txt files. Created 5 years, 6 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
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 ServiceWorkerRegistration_h 5 #ifndef ServiceWorkerRegistration_h
6 #define ServiceWorkerRegistration_h 6 #define ServiceWorkerRegistration_h
7 7
8 #include "core/dom/ActiveDOMObject.h" 8 #include "core/dom/ActiveDOMObject.h"
9 #include "core/events/EventTarget.h" 9 #include "core/events/EventTarget.h"
10 #include "modules/serviceworkers/ServiceWorker.h" 10 #include "modules/serviceworkers/ServiceWorker.h"
11 #include "modules/serviceworkers/ServiceWorkerRegistration.h"
11 #include "platform/Supplementable.h" 12 #include "platform/Supplementable.h"
12 #include "public/platform/WebServiceWorkerRegistration.h" 13 #include "public/platform/WebServiceWorkerRegistration.h"
13 #include "public/platform/WebServiceWorkerRegistrationProxy.h" 14 #include "public/platform/WebServiceWorkerRegistrationProxy.h"
14 #include "wtf/OwnPtr.h" 15 #include "wtf/OwnPtr.h"
15 #include "wtf/PassOwnPtr.h" 16 #include "wtf/PassOwnPtr.h"
16 #include "wtf/PassRefPtr.h" 17 #include "wtf/PassRefPtr.h"
17 #include "wtf/RefCounted.h" 18 #include "wtf/RefCounted.h"
18 19
19 namespace blink { 20 namespace blink {
20 21
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 OwnPtr<WebServiceWorkerRegistration> m_outerRegistration; 78 OwnPtr<WebServiceWorkerRegistration> m_outerRegistration;
78 WebServiceWorkerProvider* m_provider; 79 WebServiceWorkerProvider* m_provider;
79 RefPtrWillBeMember<ServiceWorker> m_installing; 80 RefPtrWillBeMember<ServiceWorker> m_installing;
80 RefPtrWillBeMember<ServiceWorker> m_waiting; 81 RefPtrWillBeMember<ServiceWorker> m_waiting;
81 RefPtrWillBeMember<ServiceWorker> m_active; 82 RefPtrWillBeMember<ServiceWorker> m_active;
82 83
83 bool m_stopped; 84 bool m_stopped;
84 }; 85 };
85 86
87 class ServiceWorkerRegistrationArray {
88 public:
89 typedef WebVector<WebServiceWorkerRegistration*> WebType;
90 static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResol ver* resolver, WebType* webServiceWorkerRegistrationsRaw)
91 {
92 OwnPtr<WebType> webServiceWorkerRegistrations = adoptPtr(webServiceWorke rRegistrationsRaw);
93 HeapVector<Member<ServiceWorkerRegistration>> registrations;
94 for (size_t i = 0; i < webServiceWorkerRegistrations->size(); ++i) {
95 registrations.append(ServiceWorkerRegistration::take(resolver, (*web ServiceWorkerRegistrations)[i]));
96 }
97 return registrations;
98 }
99 static void dispose(WebType* webServiceWorkerRegistrationsRaw)
100 {
101 delete webServiceWorkerRegistrationsRaw;
102 }
103
104 private:
105 WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationArray);
106 ServiceWorkerRegistrationArray() = delete;
107 };
108
86 } // namespace blink 109 } // namespace blink
87 110
88 #endif // ServiceWorkerRegistration_h 111 #endif // ServiceWorkerRegistration_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerContainer.idl ('k') | public/platform/WebServiceWorkerProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698