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

Side by Side Diff: content/renderer/service_worker/service_worker_context_client.h

Issue 2416843002: Implement FetchEvent.navigationPreload (Closed)
Patch Set: Created 4 years, 2 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 blink::WebServiceWorkerClientCallbacks*) override; 186 blink::WebServiceWorkerClientCallbacks*) override;
187 void navigate(const blink::WebString& uuid, 187 void navigate(const blink::WebString& uuid,
188 const blink::WebURL&, 188 const blink::WebURL&,
189 blink::WebServiceWorkerClientCallbacks*) override; 189 blink::WebServiceWorkerClientCallbacks*) override;
190 void skipWaiting( 190 void skipWaiting(
191 blink::WebServiceWorkerSkipWaitingCallbacks* callbacks) override; 191 blink::WebServiceWorkerSkipWaitingCallbacks* callbacks) override;
192 void claim(blink::WebServiceWorkerClientsClaimCallbacks* callbacks) override; 192 void claim(blink::WebServiceWorkerClientsClaimCallbacks* callbacks) override;
193 void registerForeignFetchScopes( 193 void registerForeignFetchScopes(
194 const blink::WebVector<blink::WebURL>& sub_scopes, 194 const blink::WebVector<blink::WebURL>& sub_scopes,
195 const blink::WebVector<blink::WebSecurityOrigin>& origins) override; 195 const blink::WebVector<blink::WebSecurityOrigin>& origins) override;
196 void registerPreloadResponseCallback(
197 int eventID,
198 blink::WebServiceWorkerPreloadResponseCallbacks*) override;
196 199
197 virtual void DispatchSyncEvent( 200 virtual void DispatchSyncEvent(
198 const std::string& tag, 201 const std::string& tag,
199 blink::WebServiceWorkerContextProxy::LastChanceOption last_chance, 202 blink::WebServiceWorkerContextProxy::LastChanceOption last_chance,
200 const SyncCallback& callback); 203 const SyncCallback& callback);
201 204
202 private: 205 private:
203 struct WorkerContextData; 206 struct WorkerContextData;
204 class FetchEventDispatcherImpl; 207 class FetchEventDispatcherImpl;
208 class PreloadRequest;
205 209
206 // Get routing_id for sending message to the ServiceWorkerVersion 210 // Get routing_id for sending message to the ServiceWorkerVersion
207 // in the browser process. 211 // in the browser process.
208 int GetRoutingID() const { return embedded_worker_id_; } 212 int GetRoutingID() const { return embedded_worker_id_; }
209 213
210 void Send(IPC::Message* message); 214 void Send(IPC::Message* message);
211 void SendWorkerStarted(); 215 void SendWorkerStarted();
212 void SetRegistrationInServiceWorkerGlobalScope( 216 void SetRegistrationInServiceWorkerGlobalScope(
213 const ServiceWorkerRegistrationObjectInfo& info, 217 const ServiceWorkerRegistrationObjectInfo& info,
214 const ServiceWorkerVersionAttributes& attrs); 218 const ServiceWorkerVersionAttributes& attrs);
215 219
216 void OnActivateEvent(int request_id); 220 void OnActivateEvent(int request_id);
217 void OnExtendableMessageEvent( 221 void OnExtendableMessageEvent(
218 int request_id, 222 int request_id,
219 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params); 223 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params);
220 void OnInstallEvent(int request_id); 224 void OnInstallEvent(int request_id);
221 void DispatchFetchEvent(int fetch_event_id, 225 void DispatchFetchEvent(int fetch_event_id,
222 const ServiceWorkerFetchRequest& request, 226 const ServiceWorkerFetchRequest& request,
227 std::unique_ptr<PreloadRequest> preload_request,
223 const FetchCallback& callback); 228 const FetchCallback& callback);
224 void OnNotificationClickEvent( 229 void OnNotificationClickEvent(
225 int request_id, 230 int request_id,
226 const std::string& notification_id, 231 const std::string& notification_id,
227 const PlatformNotificationData& notification_data, 232 const PlatformNotificationData& notification_data,
228 int action_index, 233 int action_index,
229 const base::NullableString16& reply); 234 const base::NullableString16& reply);
230 void OnPushEvent(int request_id, const PushEventPayload& payload); 235 void OnPushEvent(int request_id, const PushEventPayload& payload);
231 void OnNotificationCloseEvent( 236 void OnNotificationCloseEvent(
232 int request_id, 237 int request_id,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // Initialized on the worker thread in workerContextStarted and 278 // Initialized on the worker thread in workerContextStarted and
274 // destructed on the worker thread in willDestroyWorkerContext. 279 // destructed on the worker thread in willDestroyWorkerContext.
275 std::unique_ptr<WorkerContextData> context_; 280 std::unique_ptr<WorkerContextData> context_;
276 281
277 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); 282 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient);
278 }; 283 };
279 284
280 } // namespace content 285 } // namespace content
281 286
282 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ 287 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698