| 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 21 matching lines...) Expand all Loading... |
| 32 #define WebServiceWorkerContextClient_h | 32 #define WebServiceWorkerContextClient_h |
| 33 | 33 |
| 34 #include <memory> | 34 #include <memory> |
| 35 | 35 |
| 36 #include "public/platform/WebMessagePortChannel.h" | 36 #include "public/platform/WebMessagePortChannel.h" |
| 37 #include "public/platform/WebURL.h" | 37 #include "public/platform/WebURL.h" |
| 38 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall
backs.h" | 38 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall
backs.h" |
| 39 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" | 39 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" |
| 40 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" | 40 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
| 41 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb
acks.h" | 41 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb
acks.h" |
| 42 #include "public/platform/modules/serviceworker/WebServiceWorkerStreamHandle.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 { |
| 46 | 47 |
| 47 struct WebPaymentAppResponse; | 48 struct WebPaymentAppResponse; |
| 48 struct WebServiceWorkerClientQueryOptions; | 49 struct WebServiceWorkerClientQueryOptions; |
| 49 class WebServiceWorkerContextProxy; | 50 class WebServiceWorkerContextProxy; |
| 50 class WebServiceWorkerNetworkProvider; | 51 class WebServiceWorkerNetworkProvider; |
| 51 class WebServiceWorkerProvider; | 52 class WebServiceWorkerProvider; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 double eventDispatchTime) {} | 164 double eventDispatchTime) {} |
| 164 | 165 |
| 165 // ServiceWorker specific methods. respondFetchEvent will be called after | 166 // ServiceWorker specific methods. respondFetchEvent will be called after |
| 166 // FetchEvent returns a response by the ServiceWorker's script context, and | 167 // FetchEvent returns a response by the ServiceWorker's script context, and |
| 167 // didHandleFetchEvent will be called after the end of FetchEvent's | 168 // didHandleFetchEvent will be called after the end of FetchEvent's |
| 168 // lifecycle. When no response is provided, the browser should fallback to | 169 // lifecycle. When no response is provided, the browser should fallback to |
| 169 // native fetch. EventIDs are the same with the ids passed from | 170 // native fetch. EventIDs are the same with the ids passed from |
| 170 // dispatchFetchEvent respectively. | 171 // dispatchFetchEvent respectively. |
| 171 virtual void respondToFetchEvent(int fetchEventID, double eventDispatchTime) { | 172 virtual void respondToFetchEvent(int fetchEventID, double eventDispatchTime) { |
| 172 } | 173 } |
| 173 virtual void respondToFetchEvent(int fetchEventID, | 174 virtual void respondToFetchEventWithResponse( |
| 174 const WebServiceWorkerResponse& response, | 175 int fetchEventID, |
| 175 double eventDispatchTime) {} | 176 const WebServiceWorkerResponse& response, |
| 177 double eventDispatchTime) {} |
| 178 virtual void respondToFetchEventWithResponseStream( |
| 179 int fetchEventID, |
| 180 const WebServiceWorkerResponse& response, |
| 181 WebServiceWorkerStreamHandle* streamHandle, |
| 182 double eventDispatchTime) {} |
| 176 virtual void respondToPaymentRequestEvent( | 183 virtual void respondToPaymentRequestEvent( |
| 177 int eventId, | 184 int eventId, |
| 178 const WebPaymentAppResponse& response, | 185 const WebPaymentAppResponse& response, |
| 179 double eventDispatchTime) {} | 186 double eventDispatchTime) {} |
| 180 virtual void didHandleFetchEvent(int fetchEventID, | 187 virtual void didHandleFetchEvent(int fetchEventID, |
| 181 WebServiceWorkerEventResult result, | 188 WebServiceWorkerEventResult result, |
| 182 double eventDispatchTime) {} | 189 double eventDispatchTime) {} |
| 183 | 190 |
| 184 // ServiceWorker specific method. Called after InstallEvent (dispatched | 191 // ServiceWorker specific method. Called after InstallEvent (dispatched |
| 185 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's | 192 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Called when the worker wants to register subscopes to handle via foreign | 307 // Called when the worker wants to register subscopes to handle via foreign |
| 301 // fetch. Will only be called while an install event is in progress. | 308 // fetch. Will only be called while an install event is in progress. |
| 302 virtual void registerForeignFetchScopes( | 309 virtual void registerForeignFetchScopes( |
| 303 const WebVector<WebURL>& subScopes, | 310 const WebVector<WebURL>& subScopes, |
| 304 const WebVector<WebSecurityOrigin>& origins) = 0; | 311 const WebVector<WebSecurityOrigin>& origins) = 0; |
| 305 }; | 312 }; |
| 306 | 313 |
| 307 } // namespace blink | 314 } // namespace blink |
| 308 | 315 |
| 309 #endif // WebServiceWorkerContextClient_h | 316 #endif // WebServiceWorkerContextClient_h |
| OLD | NEW |