| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 WebServiceWorkerEventResult result, | 156 WebServiceWorkerEventResult result, |
| 156 double event_dispatch_time) {} | 157 double event_dispatch_time) {} |
| 157 | 158 |
| 158 // Called after ExtendableMessageEvent is handled by the ServiceWorker's | 159 // Called after ExtendableMessageEvent is handled by the ServiceWorker's |
| 159 // script context. | 160 // script context. |
| 160 virtual void DidHandleExtendableMessageEvent( | 161 virtual void DidHandleExtendableMessageEvent( |
| 161 int event_id, | 162 int event_id, |
| 162 WebServiceWorkerEventResult result, | 163 WebServiceWorkerEventResult result, |
| 163 double event_dispatch_time) {} | 164 double event_dispatch_time) {} |
| 164 | 165 |
| 165 // ServiceWorker specific methods. respondFetchEvent will be called after | 166 // ServiceWorker specific methods. RespondToFetchEvent* 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. |fetch_event_id|s are the same with the ids passed from |
| 170 // dispatchFetchEvent respectively. | 171 // DispatchFetchEvent respectively. |
| 171 virtual void RespondToFetchEvent(int fetch_event_id, | 172 |
| 172 double event_dispatch_time) {} | 173 // Used when respondWith() is not called. Tells the browser to fall back to |
| 174 // native fetch. |
| 175 virtual void RespondToFetchEventWithNoResponse(int fetch_event_id, |
| 176 double event_dispatch_time) {} |
| 177 // Responds to the fetch event with |response|. |
| 173 virtual void RespondToFetchEvent(int fetch_event_id, | 178 virtual void RespondToFetchEvent(int fetch_event_id, |
| 174 const WebServiceWorkerResponse& response, | 179 const WebServiceWorkerResponse& response, |
| 175 double event_dispatch_time) {} | 180 double event_dispatch_time) {} |
| 181 // Responds to the fetch event with |response|, where body is |
| 182 // |body_as_stream|. |
| 183 virtual void RespondToFetchEventWithResponseStream( |
| 184 int fetch_event_id, |
| 185 const WebServiceWorkerResponse& response, |
| 186 WebServiceWorkerStreamHandle* body_as_stream, |
| 187 double event_dispatch_time) {} |
| 176 virtual void RespondToPaymentRequestEvent( | 188 virtual void RespondToPaymentRequestEvent( |
| 177 int event_id, | 189 int event_id, |
| 178 const WebPaymentAppResponse& response, | 190 const WebPaymentAppResponse& response, |
| 179 double event_dispatch_time) {} | 191 double event_dispatch_time) {} |
| 180 virtual void DidHandleFetchEvent(int fetch_event_id, | 192 virtual void DidHandleFetchEvent(int fetch_event_id, |
| 181 WebServiceWorkerEventResult result, | 193 WebServiceWorkerEventResult result, |
| 182 double event_dispatch_time) {} | 194 double event_dispatch_time) {} |
| 183 | 195 |
| 184 // ServiceWorker specific method. Called after InstallEvent (dispatched | 196 // ServiceWorker specific method. Called after InstallEvent (dispatched |
| 185 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's | 197 // 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 | 312 // 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. | 313 // fetch. Will only be called while an install event is in progress. |
| 302 virtual void RegisterForeignFetchScopes( | 314 virtual void RegisterForeignFetchScopes( |
| 303 const WebVector<WebURL>& sub_scopes, | 315 const WebVector<WebURL>& sub_scopes, |
| 304 const WebVector<WebSecurityOrigin>& origins) = 0; | 316 const WebVector<WebSecurityOrigin>& origins) = 0; |
| 305 }; | 317 }; |
| 306 | 318 |
| 307 } // namespace blink | 319 } // namespace blink |
| 308 | 320 |
| 309 #endif // WebServiceWorkerContextClient_h | 321 #endif // WebServiceWorkerContextClient_h |
| OLD | NEW |