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

Side by Side Diff: content/browser/loader/resource_loader.cc

Issue 1271733002: [2/3 chromium] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add TODO Created 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/loader/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 !ChildProcessSecurityPolicyImpl::GetInstance()-> 273 !ChildProcessSecurityPolicyImpl::GetInstance()->
274 CanRequestURL(info->GetChildID(), redirect_info.new_url)) { 274 CanRequestURL(info->GetChildID(), redirect_info.new_url)) {
275 DVLOG(1) << "Denied unauthorized request for " 275 DVLOG(1) << "Denied unauthorized request for "
276 << redirect_info.new_url.possibly_invalid_spec(); 276 << redirect_info.new_url.possibly_invalid_spec();
277 277
278 // Tell the renderer that this request was disallowed. 278 // Tell the renderer that this request was disallowed.
279 Cancel(); 279 Cancel();
280 return; 280 return;
281 } 281 }
282 282
283 if (info->fetch_redirect_mode() == FETCH_REDIRECT_MODE_ERROR) {
284 Cancel();
285 return;
286 } else if (info->fetch_redirect_mode() == FETCH_REDIRECT_MODE_MANUAL) {
287 CompleteResponseStarted();
yhirano 2015/08/10 08:27:25 You might want to notify the upload progress. (or
horo 2015/08/10 08:57:10 Done. Added comment.
288 // We don't need to read the response body because there is no way to read
289 // the body of opaque-redirect filtered response's internal response.
290 // TODO(horo): When we will support any API which exposes the internal body,
291 // we have to read the body before calling ResponseCompleted().
292 ResponseCompleted();
yhirano 2015/08/10 08:27:26 What happens when deferred?
horo 2015/08/10 08:57:10 Who can set |defer|? I think ResourceLoader::OnRec
yhirano 2015/08/10 09:02:51 |deferred_stage_| may be set in |CompleteResponseS
horo 2015/08/10 09:42:29 Ah, I see. I think we should change deferred_stage
293 return;
294 }
295
283 delegate_->DidReceiveRedirect(this, redirect_info.new_url); 296 delegate_->DidReceiveRedirect(this, redirect_info.new_url);
284 297
285 if (delegate_->HandleExternalProtocol(this, redirect_info.new_url)) { 298 if (delegate_->HandleExternalProtocol(this, redirect_info.new_url)) {
286 // The request is complete so we can remove it. 299 // The request is complete so we can remove it.
287 CancelAndIgnore(); 300 CancelAndIgnore();
288 return; 301 return;
289 } 302 }
290 303
291 scoped_refptr<ResourceResponse> response(new ResourceResponse()); 304 scoped_refptr<ResourceResponse> response(new ResourceResponse());
292 PopulateResourceResponse(info, request_.get(), response.get()); 305 PopulateResourceResponse(info, request_.get(), response.get());
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 case net::URLRequestStatus::FAILED: 777 case net::URLRequestStatus::FAILED:
765 status = STATUS_UNDEFINED; 778 status = STATUS_UNDEFINED;
766 break; 779 break;
767 } 780 }
768 781
769 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); 782 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX);
770 } 783 }
771 } 784 }
772 785
773 } // namespace content 786 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/loader/resource_request_info_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698