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

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

Issue 2561743003: Use associated interface on DownloadedTempFile (Closed)
Patch Set: +\n. +comment. Created 4 years 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 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 fetch_event_id_, 247 fetch_event_id_,
248 base::MakeUnique<blink::WebServiceWorkerError>( 248 base::MakeUnique<blink::WebServiceWorkerError>(
249 blink::WebServiceWorkerError::ErrorTypeAbort, 249 blink::WebServiceWorkerError::ErrorTypeAbort,
250 blink::WebString::fromUTF8( 250 blink::WebString::fromUTF8(
251 "Service Worker navigation preload aborted. Need to guard with " 251 "Service Worker navigation preload aborted. Need to guard with "
252 "respondWith or waitUntil."))); 252 "respondWith or waitUntil.")));
253 } 253 }
254 254
255 void OnReceiveResponse( 255 void OnReceiveResponse(
256 const ResourceResponseHead& response_head, 256 const ResourceResponseHead& response_head,
257 mojom::DownloadedTempFilePtr downloaded_file) override { 257 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file) override {
258 DCHECK(!response_); 258 DCHECK(!response_);
259 DCHECK(!downloaded_file); 259 DCHECK(!downloaded_file.is_valid());
260 response_ = base::MakeUnique<blink::WebServiceWorkerResponse>(); 260 response_ = base::MakeUnique<blink::WebServiceWorkerResponse>();
261 response_->setURLList(std::vector<blink::WebURL>({url_})); 261 response_->setURLList(std::vector<blink::WebURL>({url_}));
262 DCHECK(response_head.headers); 262 DCHECK(response_head.headers);
263 response_->setStatus(response_head.headers->response_code()); 263 response_->setStatus(response_head.headers->response_code());
264 response_->setStatusText( 264 response_->setStatusText(
265 blink::WebString::fromUTF8(response_head.headers->GetStatusText())); 265 blink::WebString::fromUTF8(response_head.headers->GetStatusText()));
266 response_->setResponseType(blink::WebServiceWorkerResponseTypeBasic); 266 response_->setResponseType(blink::WebServiceWorkerResponseTypeBasic);
267 size_t iter = 0; 267 size_t iter = 0;
268 std::string header_name; 268 std::string header_name;
269 std::string header_value; 269 std::string header_value;
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 } 1276 }
1277 1277
1278 base::WeakPtr<ServiceWorkerContextClient> 1278 base::WeakPtr<ServiceWorkerContextClient>
1279 ServiceWorkerContextClient::GetWeakPtr() { 1279 ServiceWorkerContextClient::GetWeakPtr() {
1280 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); 1280 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread());
1281 DCHECK(context_); 1281 DCHECK(context_);
1282 return context_->weak_factory.GetWeakPtr(); 1282 return context_->weak_factory.GetWeakPtr();
1283 } 1283 }
1284 1284
1285 } // namespace content 1285 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698