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

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

Issue 1612423002: Don't send the body of the redirected request to the ServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated falken's comment Created 4 years, 11 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 | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-redirect-body.html » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_request_job.h" 5 #include "content/browser/service_worker/service_worker_url_request_job.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 return; 439 return;
440 } 440 }
441 441
442 NOTREACHED(); 442 NOTREACHED();
443 } 443 }
444 444
445 scoped_ptr<ServiceWorkerFetchRequest> 445 scoped_ptr<ServiceWorkerFetchRequest>
446 ServiceWorkerURLRequestJob::CreateFetchRequest() { 446 ServiceWorkerURLRequestJob::CreateFetchRequest() {
447 std::string blob_uuid; 447 std::string blob_uuid;
448 uint64_t blob_size = 0; 448 uint64_t blob_size = 0;
449 CreateRequestBodyBlob(&blob_uuid, &blob_size); 449 // The upload data in URLRequest may have been cleared while handing redirect.
450 if (request_->has_upload())
451 CreateRequestBodyBlob(&blob_uuid, &blob_size);
450 scoped_ptr<ServiceWorkerFetchRequest> request( 452 scoped_ptr<ServiceWorkerFetchRequest> request(
451 new ServiceWorkerFetchRequest()); 453 new ServiceWorkerFetchRequest());
452 request->mode = request_mode_; 454 request->mode = request_mode_;
453 request->is_main_resource_load = is_main_resource_load_; 455 request->is_main_resource_load = is_main_resource_load_;
454 request->request_context_type = request_context_type_; 456 request->request_context_type = request_context_type_;
455 request->frame_type = frame_type_; 457 request->frame_type = frame_type_;
456 request->url = request_->url(); 458 request->url = request_->url();
457 request->method = request_->method(); 459 request->method = request_->method();
458 const net::HttpRequestHeaders& headers = request_->extra_request_headers(); 460 const net::HttpRequestHeaders& headers = request_->extra_request_headers();
459 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext();) { 461 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext();) {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 base::TimeTicks() /* service_worker_ready_time */); 828 base::TimeTicks() /* service_worker_ready_time */);
827 return; 829 return;
828 } 830 }
829 delegate_->OnStartCompleted(true /* was_fetched_via_service_worker */, 831 delegate_->OnStartCompleted(true /* was_fetched_via_service_worker */,
830 fall_back_required_, response_url_, 832 fall_back_required_, response_url_,
831 service_worker_response_type_, worker_start_time_, 833 service_worker_response_type_, worker_start_time_,
832 worker_ready_time_); 834 worker_ready_time_);
833 } 835 }
834 836
835 } // namespace content 837 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-redirect-body.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698