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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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 WebServiceWorker_h | 31 #ifndef WebServiceWorker_h |
32 #define WebServiceWorker_h | 32 #define WebServiceWorker_h |
33 | 33 |
| 34 #include "public/platform/WebCallbacks.h" |
34 #include "public/platform/WebCommon.h" | 35 #include "public/platform/WebCommon.h" |
35 #include "public/platform/WebMessagePortChannel.h" | 36 #include "public/platform/WebMessagePortChannel.h" |
36 #include "public/platform/WebString.h" | 37 #include "public/platform/WebString.h" |
37 #include "public/platform/WebURL.h" | 38 #include "public/platform/WebURL.h" |
38 #include "public/platform/WebVector.h" | 39 #include "public/platform/WebVector.h" |
| 40 #include "public/platform/modules/serviceworker/WebServiceWorkerError.h" |
39 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" | 41 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" |
40 | 42 |
41 namespace blink { | 43 namespace blink { |
42 | 44 |
43 class WebSecurityOrigin; | 45 class WebSecurityOrigin; |
44 class WebServiceWorkerProvider; | 46 class WebServiceWorkerProvider; |
45 class WebServiceWorkerProxy; | 47 class WebServiceWorkerProxy; |
46 typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray; | 48 typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray; |
47 | 49 |
48 class WebServiceWorker { | 50 class WebServiceWorker { |
49 public: | 51 public: |
| 52 using WebSetNavigationPreloadCallbacks = |
| 53 WebCallbacks<void, const WebServiceWorkerError&>; |
| 54 using WebGetNavigationPreloadCallbacks = |
| 55 WebCallbacks<const WebString&, const WebServiceWorkerError&>; |
| 56 |
50 // The handle interface that retains a reference to the implementation of | 57 // The handle interface that retains a reference to the implementation of |
51 // WebServiceWorker in the embedder and is owned by ServiceWorker object in | 58 // WebServiceWorker in the embedder and is owned by ServiceWorker object in |
52 // Blink. The embedder must keep the service worker representation while | 59 // Blink. The embedder must keep the service worker representation while |
53 // Blink is owning this handle. | 60 // Blink is owning this handle. |
54 class Handle { | 61 class Handle { |
55 public: | 62 public: |
56 virtual ~Handle() {} | 63 virtual ~Handle() {} |
57 virtual WebServiceWorker* serviceWorker() { return nullptr; } | 64 virtual WebServiceWorker* serviceWorker() { return nullptr; } |
58 }; | 65 }; |
59 | 66 |
(...skipping 11 matching lines...) Expand all Loading... |
71 return WebServiceWorkerStateUnknown; | 78 return WebServiceWorkerStateUnknown; |
72 } | 79 } |
73 | 80 |
74 // Callee receives ownership of the passed vector. | 81 // Callee receives ownership of the passed vector. |
75 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 | 82 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 |
76 virtual void postMessage(WebServiceWorkerProvider*, | 83 virtual void postMessage(WebServiceWorkerProvider*, |
77 const WebString&, | 84 const WebString&, |
78 const WebSecurityOrigin&, | 85 const WebSecurityOrigin&, |
79 WebMessagePortChannelArray*) = 0; | 86 WebMessagePortChannelArray*) = 0; |
80 | 87 |
| 88 virtual void setNavigationPreload(const WebString& /* value */, |
| 89 WebSetNavigationPreloadCallbacks*) {} |
| 90 virtual void getNavigationPreload(WebGetNavigationPreloadCallbacks*) {} |
81 virtual void terminate() {} | 91 virtual void terminate() {} |
82 }; | 92 }; |
83 } | 93 } |
84 | 94 |
85 #endif // WebServiceWorker_h | 95 #endif // WebServiceWorker_h |
OLD | NEW |