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

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

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

Powered by Google App Engine
This is Rietveld 408576698