| 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 // FIXME: Remove this macro after the chromium side patch is applied | |
| 46 // See: https://crbug.com/390894 | |
| 47 #define DISABLE_SERVICEWORKER_UNREGISTER_RESOLVE_TO_BOOLEAN | |
| 48 | |
| 49 // 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 |
| 50 // 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 |
| 51 // on the single script context thread. | 47 // on the single script context thread. |
| 52 class WebServiceWorkerProvider { | 48 class WebServiceWorkerProvider { |
| 53 public: | 49 public: |
| 54 // 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 |
| 55 // events. Must be cleared before the client becomes invalid. | 51 // events. Must be cleared before the client becomes invalid. |
| 56 virtual void setClient(WebServiceWorkerProviderClient*) { } | 52 virtual void setClient(WebServiceWorkerProviderClient*) { } |
| 57 | 53 |
| 58 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are | 54 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are |
| 59 // passed to the WebServiceWorkerRegistrationCallbacks implementation. | 55 // passed to the WebServiceWorkerRegistrationCallbacks implementation. |
| 60 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We
bServiceWorkerRegistrationCallbacks; | 56 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We
bServiceWorkerRegistrationCallbacks; |
| 61 #ifdef DISABLE_SERVICEWORKER_UNREGISTER_RESOLVE_TO_BOOLEAN | |
| 62 typedef WebServiceWorkerRegistrationCallbacks WebServiceWorkerUnregistration
Callbacks; | |
| 63 #else | |
| 64 typedef WebCallbacks<bool, WebServiceWorkerError> WebServiceWorkerUnregistra
tionCallbacks; | 57 typedef WebCallbacks<bool, WebServiceWorkerError> WebServiceWorkerUnregistra
tionCallbacks; |
| 65 #endif | |
| 66 | 58 |
| 67 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri
ptUrl, WebServiceWorkerRegistrationCallbacks*) { } | 59 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri
ptUrl, WebServiceWorkerRegistrationCallbacks*) { } |
| 68 | 60 |
| 69 // Unregisters the ServiceWorker for a given scope. | 61 // Unregisters the ServiceWorker for a given scope. |
| 70 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker
UnregistrationCallbacks*) { } | 62 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker
UnregistrationCallbacks*) { } |
| 71 | 63 |
| 72 virtual ~WebServiceWorkerProvider() { } | 64 virtual ~WebServiceWorkerProvider() { } |
| 73 }; | 65 }; |
| 74 | 66 |
| 75 } // namespace blink | 67 } // namespace blink |
| 76 | 68 |
| 77 #endif | 69 #endif |
| OLD | NEW |