| 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 WebServiceWorkerContextClient_h | 31 #ifndef WebServiceWorkerContextClient_h |
| 32 #define WebServiceWorkerContextClient_h | 32 #define WebServiceWorkerContextClient_h |
| 33 | 33 |
| 34 #include <v8.h> |
| 34 #include <memory> | 35 #include <memory> |
| 35 | 36 #include "mojo/public/cpp/system/data_pipe.h" |
| 36 #include "public/platform/WebMessagePortChannel.h" | 37 #include "public/platform/WebMessagePortChannel.h" |
| 37 #include "public/platform/WebURL.h" | 38 #include "public/platform/WebURL.h" |
| 38 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall
backs.h" | 39 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall
backs.h" |
| 39 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" | 40 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" |
| 40 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" | 41 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
| 41 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb
acks.h" | 42 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb
acks.h" |
| 42 #include "public/web/WebDevToolsAgentClient.h" | 43 #include "public/web/WebDevToolsAgentClient.h" |
| 43 #include "v8/include/v8.h" | 44 #include "v8/include/v8.h" |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 double eventDispatchTime) {} | 165 double eventDispatchTime) {} |
| 165 | 166 |
| 166 // ServiceWorker specific methods. respondFetchEvent will be called after | 167 // ServiceWorker specific methods. respondFetchEvent will be called after |
| 167 // FetchEvent returns a response by the ServiceWorker's script context, and | 168 // FetchEvent returns a response by the ServiceWorker's script context, and |
| 168 // didHandleFetchEvent will be called after the end of FetchEvent's | 169 // didHandleFetchEvent will be called after the end of FetchEvent's |
| 169 // lifecycle. When no response is provided, the browser should fallback to | 170 // lifecycle. When no response is provided, the browser should fallback to |
| 170 // native fetch. EventIDs are the same with the ids passed from | 171 // native fetch. EventIDs are the same with the ids passed from |
| 171 // dispatchFetchEvent respectively. | 172 // dispatchFetchEvent respectively. |
| 172 virtual void respondToFetchEvent(int fetchEventID, double eventDispatchTime) { | 173 virtual void respondToFetchEvent(int fetchEventID, double eventDispatchTime) { |
| 173 } | 174 } |
| 174 virtual void respondToFetchEvent(int fetchEventID, | 175 virtual void respondToFetchEventWithResponse( |
| 175 const WebServiceWorkerResponse& response, | 176 int fetchEventID, |
| 176 double eventDispatchTime) {} | 177 const WebServiceWorkerResponse& response, |
| 178 double eventDispatchTime) {} |
| 179 virtual void respondToFetchEventWithResponseStream( |
| 180 int fetchEventID, |
| 181 const WebServiceWorkerResponse& response, |
| 182 mojo::ScopedDataPipeConsumerHandle data_stream, |
| 183 double eventDispatchTime) {} |
| 177 virtual void respondToPaymentRequestEvent( | 184 virtual void respondToPaymentRequestEvent( |
| 178 int eventId, | 185 int eventId, |
| 179 const WebPaymentAppResponse& response, | 186 const WebPaymentAppResponse& response, |
| 180 double eventDispatchTime) {} | 187 double eventDispatchTime) {} |
| 181 virtual void didHandleFetchEvent(int fetchEventID, | 188 virtual void didHandleFetchEvent(int fetchEventID, |
| 182 WebServiceWorkerEventResult result, | 189 WebServiceWorkerEventResult result, |
| 183 double eventDispatchTime) {} | 190 double eventDispatchTime) {} |
| 184 | 191 |
| 185 // ServiceWorker specific method. Called after InstallEvent (dispatched | 192 // ServiceWorker specific method. Called after InstallEvent (dispatched |
| 186 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's | 193 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // Called when the worker wants to register subscopes to handle via foreign | 313 // Called when the worker wants to register subscopes to handle via foreign |
| 307 // fetch. Will only be called while an install event is in progress. | 314 // fetch. Will only be called while an install event is in progress. |
| 308 virtual void registerForeignFetchScopes( | 315 virtual void registerForeignFetchScopes( |
| 309 const WebVector<WebURL>& subScopes, | 316 const WebVector<WebURL>& subScopes, |
| 310 const WebVector<WebSecurityOrigin>& origins) = 0; | 317 const WebVector<WebSecurityOrigin>& origins) = 0; |
| 311 }; | 318 }; |
| 312 | 319 |
| 313 } // namespace blink | 320 } // namespace blink |
| 314 | 321 |
| 315 #endif // WebServiceWorkerContextClient_h | 322 #endif // WebServiceWorkerContextClient_h |
| OLD | NEW |