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

Side by Side Diff: public/platform/WebServiceWorkerProvider.h

Issue 1143293003: Service Worker: Add ServiceWorkerContainer.getRegistrations() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unused param in claim-not-using-registration.html 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
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerRegistration.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebServiceWorkerProvider_h 31 #ifndef WebServiceWorkerProvider_h
32 #define WebServiceWorkerProvider_h 32 #define WebServiceWorkerProvider_h
33 33
34 #include "public/platform/WebCallbacks.h" 34 #include "public/platform/WebCallbacks.h"
35 #include "public/platform/WebServiceWorkerRegistration.h"
36 #include "public/platform/WebVector.h"
35 37
36 namespace blink { 38 namespace blink {
37 39
38 class WebURL; 40 class WebURL;
39 class WebServiceWorker; 41 class WebServiceWorker;
40 class WebServiceWorkerProviderClient; 42 class WebServiceWorkerProviderClient;
41 class WebServiceWorkerRegistration;
42 struct WebServiceWorkerError; 43 struct WebServiceWorkerError;
43 44
44 // Created on the main thread, and may be passed to another script context 45 // Created on the main thread, and may be passed to another script context
45 // thread (e.g. worker thread) later. All methods of this class must be called 46 // thread (e.g. worker thread) later. All methods of this class must be called
46 // on the single script context thread. 47 // on the single script context thread.
47 class WebServiceWorkerProvider { 48 class WebServiceWorkerProvider {
48 public: 49 public:
49 // Called when a client wants to start listening to the service worker 50 // Called when a client wants to start listening to the service worker
50 // events. Must be cleared before the client becomes invalid. 51 // events. Must be cleared before the client becomes invalid.
51 virtual void setClient(WebServiceWorkerProviderClient*) { } 52 virtual void setClient(WebServiceWorkerProviderClient*) { }
52 53
53 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are 54 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are
54 // passed to the WebServiceWorkerRegistrationCallbacks implementation. 55 // passed to the WebServiceWorkerRegistrationCallbacks implementation.
55 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerRegistrationCallbacks; 56 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerRegistrationCallbacks;
56 typedef WebCallbacks<bool, WebServiceWorkerError> WebServiceWorkerUnregistra tionCallbacks; 57 typedef WebCallbacks<bool, WebServiceWorkerError> WebServiceWorkerUnregistra tionCallbacks;
57 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerGetRegistrationCallbacks; 58 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerGetRegistrationCallbacks;
59 typedef WebCallbacks<WebVector<WebServiceWorkerRegistration*>, WebServiceWor kerError> WebServiceWorkerGetRegistrationsCallbacks;
58 typedef WebCallbacks<WebServiceWorkerRegistration, void> WebServiceWorkerGet RegistrationForReadyCallbacks; 60 typedef WebCallbacks<WebServiceWorkerRegistration, void> WebServiceWorkerGet RegistrationForReadyCallbacks;
59 61
60 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri ptUrl, WebServiceWorkerRegistrationCallbacks*) { } 62 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri ptUrl, WebServiceWorkerRegistrationCallbacks*) { }
61 63
62 // Unregisters the ServiceWorker for a given scope. 64 // Unregisters the ServiceWorker for a given scope.
63 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker UnregistrationCallbacks*) { } 65 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker UnregistrationCallbacks*) { }
64 66
65 virtual void getRegistration(const WebURL& documentURL, WebServiceWorkerGetR egistrationCallbacks*) { } 67 virtual void getRegistration(const WebURL& documentURL, WebServiceWorkerGetR egistrationCallbacks*) { }
68 virtual void getRegistrations(WebServiceWorkerGetRegistrationsCallbacks*) { }
66 virtual void getRegistrationForReady(WebServiceWorkerGetRegistrationForReady Callbacks*) { } 69 virtual void getRegistrationForReady(WebServiceWorkerGetRegistrationForReady Callbacks*) { }
67 70
68 virtual ~WebServiceWorkerProvider() { } 71 virtual ~WebServiceWorkerProvider() { }
69 }; 72 };
70 73
71 } // namespace blink 74 } // namespace blink
72 75
73 #endif 76 #endif
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerRegistration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698