Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextClient.h

Issue 2703343002: ServiceWorker: Use mojo's data pipe for respondWith(stream) (Closed)
Patch Set: Addressed falken's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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.
falken 2017/04/19 06:56:52 maybe add an empty line to make clear that "Used w
shimazu 2017/04/19 08:32:16 Done.
171 virtual void RespondToFetchEvent(int fetch_event_id, 172 // Used when respondWith() is not called. Tells the browser to fall back to
172 double event_dispatch_time) {} 173 // native fetch.
174 virtual void RespondToFetchEventWithNoResponse(int fetch_event_id,
175 double event_dispatch_time) {}
176 // Responds to the fetch event with |response|.
173 virtual void RespondToFetchEvent(int fetch_event_id, 177 virtual void RespondToFetchEvent(int fetch_event_id,
174 const WebServiceWorkerResponse& response, 178 const WebServiceWorkerResponse& response,
175 double event_dispatch_time) {} 179 double event_dispatch_time) {}
180 // Responds to the fetch event with |response|, where body is
181 // |body_as_stream|.
182 virtual void RespondToFetchEventWithResponseStream(
183 int fetch_event_id,
184 const WebServiceWorkerResponse& response,
185 WebServiceWorkerStreamHandle* body_as_stream,
186 double event_dispatch_time) {}
176 virtual void RespondToPaymentRequestEvent( 187 virtual void RespondToPaymentRequestEvent(
177 int event_id, 188 int event_id,
178 const WebPaymentAppResponse& response, 189 const WebPaymentAppResponse& response,
179 double event_dispatch_time) {} 190 double event_dispatch_time) {}
180 virtual void DidHandleFetchEvent(int fetch_event_id, 191 virtual void DidHandleFetchEvent(int fetch_event_id,
181 WebServiceWorkerEventResult result, 192 WebServiceWorkerEventResult result,
182 double event_dispatch_time) {} 193 double event_dispatch_time) {}
183 194
184 // ServiceWorker specific method. Called after InstallEvent (dispatched 195 // ServiceWorker specific method. Called after InstallEvent (dispatched
185 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's 196 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // Called when the worker wants to register subscopes to handle via foreign 311 // 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. 312 // fetch. Will only be called while an install event is in progress.
302 virtual void RegisterForeignFetchScopes( 313 virtual void RegisterForeignFetchScopes(
303 const WebVector<WebURL>& sub_scopes, 314 const WebVector<WebURL>& sub_scopes,
304 const WebVector<WebSecurityOrigin>& origins) = 0; 315 const WebVector<WebSecurityOrigin>& origins) = 0;
305 }; 316 };
306 317
307 } // namespace blink 318 } // namespace blink
308 319
309 #endif // WebServiceWorkerContextClient_h 320 #endif // WebServiceWorkerContextClient_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698