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 WebServiceWorkerContextProxy_h | 31 #ifndef WebServiceWorkerContextProxy_h |
32 #define WebServiceWorkerContextProxy_h | 32 #define WebServiceWorkerContextProxy_h |
33 | 33 |
| 34 #include "base/time/time.h" |
34 #include "public/platform/WebMessagePortChannel.h" | 35 #include "public/platform/WebMessagePortChannel.h" |
35 #include "public/platform/modules/serviceworker/WebServiceWorker.h" | 36 #include "public/platform/modules/serviceworker/WebServiceWorker.h" |
36 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" | 37 #include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h" |
37 | 38 |
38 #include <memory> | 39 #include <memory> |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 class WebDataConsumerHandle; | 43 class WebDataConsumerHandle; |
43 class WebServiceWorkerRequest; | 44 class WebServiceWorkerRequest; |
44 class WebString; | 45 class WebString; |
45 struct WebNotificationData; | 46 struct WebNotificationData; |
46 struct WebPaymentAppRequestData; | 47 struct WebPaymentAppRequestData; |
47 struct WebServiceWorkerClientInfo; | 48 struct WebServiceWorkerClientInfo; |
48 struct WebServiceWorkerError; | 49 struct WebServiceWorkerError; |
| 50 class WebURL; |
49 class WebURLResponse; | 51 class WebURLResponse; |
50 | 52 |
51 // A proxy interface to talk to the worker's GlobalScope implementation. | 53 // A proxy interface to talk to the worker's GlobalScope implementation. |
52 // All methods of this class must be called on the worker thread. | 54 // All methods of this class must be called on the worker thread. |
53 class WebServiceWorkerContextProxy { | 55 class WebServiceWorkerContextProxy { |
54 public: | 56 public: |
55 virtual ~WebServiceWorkerContextProxy() {} | 57 virtual ~WebServiceWorkerContextProxy() {} |
56 | 58 |
57 virtual void setRegistration( | 59 virtual void setRegistration( |
58 std::unique_ptr<WebServiceWorkerRegistration::Handle>) = 0; | 60 std::unique_ptr<WebServiceWorkerRegistration::Handle>) = 0; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 95 |
94 // Once the ServiceWorker has finished handling the sync event, | 96 // Once the ServiceWorker has finished handling the sync event, |
95 // didHandleSyncEvent is called on the context client. | 97 // didHandleSyncEvent is called on the context client. |
96 virtual void dispatchSyncEvent(int syncEventID, | 98 virtual void dispatchSyncEvent(int syncEventID, |
97 const WebString& tag, | 99 const WebString& tag, |
98 LastChanceOption) = 0; | 100 LastChanceOption) = 0; |
99 | 101 |
100 virtual void dispatchPaymentRequestEvent(int eventID, | 102 virtual void dispatchPaymentRequestEvent(int eventID, |
101 const WebPaymentAppRequestData&) = 0; | 103 const WebPaymentAppRequestData&) = 0; |
102 | 104 |
| 105 // Called when the ServiceWorker received a FetchEvent which has triggered a |
| 106 // navigation preload request. |sentTimestamp| and |sentWallTime| are for |
| 107 // reporting to DevTools. |
| 108 virtual void onNavigationPreloadSent(int fetchEventID, |
| 109 const WebURL&, |
| 110 base::TimeTicks sentTimestamp, |
| 111 base::Time sentWallTime) = 0; |
103 virtual void onNavigationPreloadResponse( | 112 virtual void onNavigationPreloadResponse( |
104 int fetchEventID, | 113 int fetchEventID, |
105 std::unique_ptr<WebURLResponse>, | 114 std::unique_ptr<WebURLResponse>, |
106 std::unique_ptr<WebDataConsumerHandle>) = 0; | 115 std::unique_ptr<WebDataConsumerHandle>) = 0; |
107 virtual void onNavigationPreloadError( | 116 virtual void onNavigationPreloadError( |
108 int fetchEventID, | 117 int fetchEventID, |
109 std::unique_ptr<WebServiceWorkerError>) = 0; | 118 std::unique_ptr<WebServiceWorkerError>) = 0; |
| 119 virtual void onNavigationPreloadCompleted(int fetchEventID, |
| 120 int64_t encodedDataLength) = 0; |
110 }; | 121 }; |
111 | 122 |
112 } // namespace blink | 123 } // namespace blink |
113 | 124 |
114 #endif // WebServiceWorkerContextProxy_h | 125 #endif // WebServiceWorkerContextProxy_h |
OLD | NEW |