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

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

Issue 2503813002: Fix and refactor downloaded file handling in the loading stack (Closed)
Patch Set: move to dtor 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
« no previous file with comments | « content/common/url_loader.mojom ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 return; 254 return;
255 client->OnNavigationPreloadError( 255 client->OnNavigationPreloadError(
256 fetch_event_id_, 256 fetch_event_id_,
257 base::MakeUnique<blink::WebServiceWorkerError>( 257 base::MakeUnique<blink::WebServiceWorkerError>(
258 blink::WebServiceWorkerError::ErrorTypeAbort, 258 blink::WebServiceWorkerError::ErrorTypeAbort,
259 blink::WebString::fromUTF8( 259 blink::WebString::fromUTF8(
260 "Service Worker navigation preload aborted. Need to guard with " 260 "Service Worker navigation preload aborted. Need to guard with "
261 "respondWith or waitUntil."))); 261 "respondWith or waitUntil.")));
262 } 262 }
263 263
264 void OnReceiveResponse(const ResourceResponseHead& response_head) override { 264 void OnReceiveResponse(
265 const ResourceResponseHead& response_head,
266 mojom::DownloadedTempFilePtr downloaded_file) override {
265 DCHECK(!response_); 267 DCHECK(!response_);
268 DCHECK(!downloaded_file);
266 response_ = base::MakeUnique<blink::WebServiceWorkerResponse>(); 269 response_ = base::MakeUnique<blink::WebServiceWorkerResponse>();
267 response_->setURL(url_); 270 response_->setURL(url_);
268 DCHECK(response_head.headers); 271 DCHECK(response_head.headers);
269 response_->setStatus(response_head.headers->response_code()); 272 response_->setStatus(response_head.headers->response_code());
270 response_->setStatusText( 273 response_->setStatusText(
271 blink::WebString::fromUTF8(response_head.headers->GetStatusText())); 274 blink::WebString::fromUTF8(response_head.headers->GetStatusText()));
272 response_->setResponseType(blink::WebServiceWorkerResponseTypeBasic); 275 response_->setResponseType(blink::WebServiceWorkerResponseTypeBasic);
273 size_t iter = 0; 276 size_t iter = 0;
274 std::string header_name; 277 std::string header_name;
275 std::string header_value; 278 std::string header_value;
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 } 1308 }
1306 1309
1307 base::WeakPtr<ServiceWorkerContextClient> 1310 base::WeakPtr<ServiceWorkerContextClient>
1308 ServiceWorkerContextClient::GetWeakPtr() { 1311 ServiceWorkerContextClient::GetWeakPtr() {
1309 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); 1312 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread());
1310 DCHECK(context_); 1313 DCHECK(context_);
1311 return context_->weak_factory.GetWeakPtr(); 1314 return context_->weak_factory.GetWeakPtr();
1312 } 1315 }
1313 1316
1314 } // namespace content 1317 } // namespace content
OLDNEW
« no previous file with comments | « content/common/url_loader.mojom ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698