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

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

Issue 161003002: Do not trigger CrossSiteResourceHandler for streams or user certs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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/cross_site_resource_handler.h" 5 #include "content/browser/loader/cross_site_resource_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // request. 154 // request.
155 // 155 //
156 // Similarly, HTTP 204 (No Content) responses leave us showing the previous 156 // Similarly, HTTP 204 (No Content) responses leave us showing the previous
157 // page. We should allow the navigation to finish without running the unload 157 // page. We should allow the navigation to finish without running the unload
158 // handler or swapping in the pending RenderViewHost. 158 // handler or swapping in the pending RenderViewHost.
159 // 159 //
160 // In both cases, any pending RenderViewHost (if one was created for this 160 // In both cases, any pending RenderViewHost (if one was created for this
161 // navigation) will stick around until the next cross-site navigation, since 161 // navigation) will stick around until the next cross-site navigation, since
162 // we are unable to tell when to destroy it. 162 // we are unable to tell when to destroy it.
163 // See RenderFrameHostManager::RendererAbortedProvisionalLoad. 163 // See RenderFrameHostManager::RendererAbortedProvisionalLoad.
164 if (!swap_needed || info->IsDownload() || 164 if (!swap_needed || info->IsDownload() || info->is_stream() ||
davidben 2014/02/12 19:57:56 It's possible we should just set the IsDownload bi
Zachary Kuznia 2014/02/12 22:04:48 IsDownload and is_stream should be mutually exclus
davidben 2014/02/12 22:18:56 Right, but the question is whether consumers of th
Charlie Reis 2014/02/13 01:45:07 I agree that the current approach is error prone.
davidben 2014/02/13 03:48:28 The other callers seem to be more interested in th
Charlie Reis 2014/02/13 19:33:05 I'll defer to networking folks on that decision, s
165 (response->head.headers.get() && 165 (response->head.headers.get() &&
166 response->head.headers->response_code() == 204)) { 166 response->head.headers->response_code() == 204)) {
167 return next_handler_->OnResponseStarted(request_id, response, defer); 167 return next_handler_->OnResponseStarted(request_id, response, defer);
168 } 168 }
169 169
170 // Now that we know a swap is needed and we have something to commit, we 170 // Now that we know a swap is needed and we have something to commit, we
171 // pause to let the UI thread run the unload handler of the previous page 171 // pause to let the UI thread run the unload handler of the previous page
172 // and set up a transfer if needed. 172 // and set up a transfer if needed.
173 StartCrossSiteTransition(request_id, response, should_transfer); 173 StartCrossSiteTransition(request_id, response, should_transfer);
174 174
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 311
312 void CrossSiteResourceHandler::ResumeIfDeferred() { 312 void CrossSiteResourceHandler::ResumeIfDeferred() {
313 if (did_defer_) { 313 if (did_defer_) {
314 did_defer_ = false; 314 did_defer_ = false;
315 controller()->Resume(); 315 controller()->Resume();
316 } 316 }
317 } 317 }
318 318
319 } // namespace content 319 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698