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

Side by Side Diff: content/browser/service_worker/service_worker_url_loader_job.cc

Issue 2982363002: Add support for fallback content for the frame. This includes main and subframes. (Closed)
Patch Set: rebase to tip Created 3 years, 4 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/browser/service_worker/service_worker_url_loader_job.h" 5 #include "content/browser/service_worker/service_worker_url_loader_job.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "content/browser/blob_storage/blob_url_loader_factory.h" 8 #include "content/browser/blob_storage/blob_url_loader_factory.h"
9 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" 9 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h"
10 #include "content/browser/service_worker/service_worker_version.h" 10 #include "content/browser/service_worker/service_worker_version.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 DeliverErrorResponse(); 244 DeliverErrorResponse();
245 return; 245 return;
246 } 246 }
247 247
248 // Creates a new HttpResponseInfo using the the ServiceWorker script's 248 // Creates a new HttpResponseInfo using the the ServiceWorker script's
249 // HttpResponseInfo to show HTTPS padlock. 249 // HttpResponseInfo to show HTTPS padlock.
250 // TODO(horo): When we support mixed-content (HTTP) no-cors requests from a 250 // TODO(horo): When we support mixed-content (HTTP) no-cors requests from a
251 // ServiceWorker, we have to check the security level of the responses. 251 // ServiceWorker, we have to check the security level of the responses.
252 const net::HttpResponseInfo* main_script_http_info = 252 const net::HttpResponseInfo* main_script_http_info =
253 version->GetMainScriptHttpResponseInfo(); 253 version->GetMainScriptHttpResponseInfo();
254 DCHECK(main_script_http_info); 254 // TODO(kinuko)
255 ssl_info_ = main_script_http_info->ssl_info; 255 // Fix this here.
256 if (main_script_http_info)
257 ssl_info_ = main_script_http_info->ssl_info;
256 258
257 std::move(loader_callback_) 259 std::move(loader_callback_)
258 .Run(base::Bind(&ServiceWorkerURLLoaderJob::StartResponse, 260 .Run(base::Bind(&ServiceWorkerURLLoaderJob::StartResponse,
259 weak_factory_.GetWeakPtr(), response, 261 weak_factory_.GetWeakPtr(), response,
260 base::Passed(std::move(body_as_stream)))); 262 base::Passed(std::move(body_as_stream))));
261 } 263 }
262 264
263 void ServiceWorkerURLLoaderJob::StartResponse( 265 void ServiceWorkerURLLoaderJob::StartResponse(
264 const ServiceWorkerResponse& response, 266 const ServiceWorkerResponse& response,
265 blink::mojom::ServiceWorkerStreamHandlePtr body_as_stream, 267 blink::mojom::ServiceWorkerStreamHandlePtr body_as_stream,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 359 }
358 360
359 void ServiceWorkerURLLoaderJob::OnComplete( 361 void ServiceWorkerURLLoaderJob::OnComplete(
360 const ResourceRequestCompletionStatus& status) { 362 const ResourceRequestCompletionStatus& status) {
361 DCHECK_EQ(Status::kSentHeader, status_); 363 DCHECK_EQ(Status::kSentHeader, status_);
362 status_ = Status::kCompleted; 364 status_ = Status::kCompleted;
363 url_loader_client_->OnComplete(status); 365 url_loader_client_->OnComplete(status);
364 } 366 }
365 367
366 } // namespace content 368 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/url_loader_request_handler.cc ('k') | content/common/throttling_url_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698