OLD | NEW |
---|---|
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 24 matching lines...) Expand all Loading... | |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class WebString; | 38 class WebString; |
39 class WebURL; | 39 class WebURL; |
40 class WebServiceWorker; | 40 class WebServiceWorker; |
41 class WebServiceWorkerProviderClient; | 41 class WebServiceWorkerProviderClient; |
42 class WebServiceWorkerRegistration; | 42 class WebServiceWorkerRegistration; |
43 struct WebServiceWorkerError; | 43 struct WebServiceWorkerError; |
44 | 44 |
45 #define SERVICEWORKER_UNREGISTER_DISABLE_NEW_FEATURE | |
nhiroki
2014/08/28 10:13:21
Can you add FIXME comment and a link to the issue
shimazu
2014/08/29 07:07:07
Done.
| |
46 | |
45 // Created on the main thread, and may be passed to another script context | 47 // Created on the main thread, and may be passed to another script context |
46 // thread (e.g. worker thread) later. All methods of this class must be called | 48 // thread (e.g. worker thread) later. All methods of this class must be called |
47 // on the single script context thread. | 49 // on the single script context thread. |
48 class WebServiceWorkerProvider { | 50 class WebServiceWorkerProvider { |
49 public: | 51 public: |
50 // Called when a client wants to start listening to the service worker | 52 // Called when a client wants to start listening to the service worker |
51 // events. Must be cleared before the client becomes invalid. | 53 // events. Must be cleared before the client becomes invalid. |
52 virtual void setClient(WebServiceWorkerProviderClient*) { } | 54 virtual void setClient(WebServiceWorkerProviderClient*) { } |
53 | 55 |
54 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are | 56 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are |
55 // passed to the WebServiceWorkerRegistrationCallbacks implementation. | 57 // passed to the WebServiceWorkerRegistrationCallbacks implementation. |
56 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerRegistrationCallbacks; | 58 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerRegistrationCallbacks; |
59 #ifdef SERVICEWORKER_UNREGISTER_DISABLE_NEW_FEATURE | |
60 typedef WebServiceWorkerRegistrationCallbacks WebServiceWorkerUnRegistration Callbacks; | |
nhiroki
2014/08/28 10:13:21
nit: s/UnRegistration/Unregistration/
shimazu
2014/08/29 07:07:07
Done.
| |
61 #else | |
62 typedef WebCallbacks<bool, WebServiceWorkerError> WebServiceWorkerUnRegistra tionCallbacks; | |
nhiroki
2014/08/28 10:13:21
ditto.
shimazu
2014/08/29 07:07:07
Done.
| |
63 #endif | |
57 | 64 |
58 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri ptUrl, WebServiceWorkerRegistrationCallbacks*) { } | 65 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri ptUrl, WebServiceWorkerRegistrationCallbacks*) { } |
59 | 66 |
60 // Unregisters the ServiceWorker for a given scope. The provider | 67 // Unregisters the ServiceWorker for a given scope. |
61 // must always pass null to onSuccess. | 68 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker UnRegistrationCallbacks*) { } |
62 // FIXME: "unregister" does not provide a WebServiceWorkerRegistration, | |
63 // revisit this to clean up the the callback type to not take a | |
64 // WebServiceWorkerRegistration*. | |
65 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker RegistrationCallbacks*) { } | |
66 | 69 |
67 virtual ~WebServiceWorkerProvider() { } | 70 virtual ~WebServiceWorkerProvider() { } |
68 }; | 71 }; |
69 | 72 |
70 } // namespace blink | 73 } // namespace blink |
71 | 74 |
72 #endif | 75 #endif |
OLD | NEW |