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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // 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 |
47 // on the single script context thread. | 47 // on the single script context thread. |
48 class WebServiceWorkerProvider { | 48 class WebServiceWorkerProvider { |
49 public: | 49 public: |
50 // 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 |
51 // events. Must be cleared before the client becomes invalid. | 51 // events. Must be cleared before the client becomes invalid. |
52 virtual void setClient(WebServiceWorkerProviderClient*) { } | 52 virtual void setClient(WebServiceWorkerProviderClient*) { } |
53 | 53 |
54 // FIXME: Remove this macro after two-side patches are landed | 54 // FIXME: Remove this macro after two-side patches are landed |
55 // (http://crbug.com/396400). | 55 // (http://crbug.com/396400). |
56 #define DISABLE_SERVICE_WORKER_REGISTRATION | |
57 #ifdef DISABLE_SERVICE_WORKER_REGISTRATION | 56 #ifdef DISABLE_SERVICE_WORKER_REGISTRATION |
58 // The WebServiceWorker and WebServiceWorkerError ownership are passed to | 57 // The WebServiceWorker and WebServiceWorkerError ownership are passed to |
59 // the WebServiceWorkerCallbacks implementation. | 58 // the WebServiceWorkerCallbacks implementation. |
60 typedef WebCallbacks<WebServiceWorker, WebServiceWorkerError> WebServiceWork
erRegistrationCallbacks; | 59 typedef WebCallbacks<WebServiceWorker, WebServiceWorkerError> WebServiceWork
erRegistrationCallbacks; |
61 #else | 60 #else |
62 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are | 61 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are |
63 // passed to the WebServiceWorkerRegistrationCallbacks implementation. | 62 // passed to the WebServiceWorkerRegistrationCallbacks implementation. |
64 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We
bServiceWorkerRegistrationCallbacks; | 63 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We
bServiceWorkerRegistrationCallbacks; |
65 #endif | 64 #endif |
66 | 65 |
67 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri
ptUrl, WebServiceWorkerRegistrationCallbacks*) { } | 66 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri
ptUrl, WebServiceWorkerRegistrationCallbacks*) { } |
68 | 67 |
69 // Unregisters the ServiceWorker for a given scope. The provider | 68 // Unregisters the ServiceWorker for a given scope. The provider |
70 // must always pass null to onSuccess. | 69 // must always pass null to onSuccess. |
71 // FIXME: "unregister" does not provide a WebServiceWorkerRegistration, | 70 // FIXME: "unregister" does not provide a WebServiceWorkerRegistration, |
72 // revisit this to clean up the the callback type to not take a | 71 // revisit this to clean up the the callback type to not take a |
73 // WebServiceWorkerRegistration*. | 72 // WebServiceWorkerRegistration*. |
74 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker
RegistrationCallbacks*) { } | 73 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker
RegistrationCallbacks*) { } |
75 | 74 |
76 virtual ~WebServiceWorkerProvider() { } | 75 virtual ~WebServiceWorkerProvider() { } |
77 }; | 76 }; |
78 | 77 |
79 } // namespace blink | 78 } // namespace blink |
80 | 79 |
81 #endif | 80 #endif |
OLD | NEW |