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

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

Issue 2417793002: Introduce FetchEventPreloadHandle to pass the preload response to FetchEvent. (Closed)
Patch Set: incorporated dchecng's comment 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
« no previous file with comments | « content/common/service_worker/fetch_event_dispatcher.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/renderer/service_worker/service_worker_context_client.h" 5 #include "content/renderer/service_worker/service_worker_context_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 mojo::MakeStrongBinding(base::MakeUnique<FetchEventDispatcherImpl>(), 230 mojo::MakeStrongBinding(base::MakeUnique<FetchEventDispatcherImpl>(),
231 std::move(request)); 231 std::move(request));
232 } 232 }
233 233
234 FetchEventDispatcherImpl() {} 234 FetchEventDispatcherImpl() {}
235 235
236 ~FetchEventDispatcherImpl() override {} 236 ~FetchEventDispatcherImpl() override {}
237 237
238 void DispatchFetchEvent(int fetch_event_id, 238 void DispatchFetchEvent(int fetch_event_id,
239 const ServiceWorkerFetchRequest& request, 239 const ServiceWorkerFetchRequest& request,
240 mojom::FetchEventPreloadHandlePtr preload_handle,
240 const DispatchFetchEventCallback& callback) override { 241 const DispatchFetchEventCallback& callback) override {
241 ServiceWorkerContextClient* client = 242 ServiceWorkerContextClient* client =
242 ServiceWorkerContextClient::ThreadSpecificInstance(); 243 ServiceWorkerContextClient::ThreadSpecificInstance();
243 if (!client) { 244 if (!client) {
244 callback.Run(SERVICE_WORKER_ERROR_ABORT, base::Time::Now()); 245 callback.Run(SERVICE_WORKER_ERROR_ABORT, base::Time::Now());
245 return; 246 return;
246 } 247 }
248 if (preload_handle) {
249 // TODO(horo): Implement this to pass |preload_handle| to FetchEvent.
250 NOTIMPLEMENTED();
251 return;
252 }
247 client->DispatchFetchEvent(fetch_event_id, request, callback); 253 client->DispatchFetchEvent(fetch_event_id, request, callback);
248 } 254 }
249 255
250 private: 256 private:
251 DISALLOW_COPY_AND_ASSIGN(FetchEventDispatcherImpl); 257 DISALLOW_COPY_AND_ASSIGN(FetchEventDispatcherImpl);
252 }; 258 };
253 259
254 ServiceWorkerContextClient* 260 ServiceWorkerContextClient*
255 ServiceWorkerContextClient::ThreadSpecificInstance() { 261 ServiceWorkerContextClient::ThreadSpecificInstance() {
256 return g_worker_client_tls.Pointer()->Get(); 262 return g_worker_client_tls.Pointer()->Get();
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 } 1142 }
1137 1143
1138 base::WeakPtr<ServiceWorkerContextClient> 1144 base::WeakPtr<ServiceWorkerContextClient>
1139 ServiceWorkerContextClient::GetWeakPtr() { 1145 ServiceWorkerContextClient::GetWeakPtr() {
1140 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); 1146 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread());
1141 DCHECK(context_); 1147 DCHECK(context_);
1142 return context_->weak_factory.GetWeakPtr(); 1148 return context_->weak_factory.GetWeakPtr();
1143 } 1149 }
1144 1150
1145 } // namespace content 1151 } // namespace content
OLDNEW
« no previous file with comments | « content/common/service_worker/fetch_event_dispatcher.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698