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

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

Issue 1617043002: Introduce AncestorThrottle, which will process 'X-Frame-Options' headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@block-response
Patch Set: CONNECTION_REFUSED Created 4 years, 7 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 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/browser/loader/navigation_resource_throttle.h" 5 #include "content/browser/loader/navigation_resource_throttle.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return "NavigationResourceThrottle"; 228 return "NavigationResourceThrottle";
229 } 229 }
230 230
231 void NavigationResourceThrottle::OnUIChecksPerformed( 231 void NavigationResourceThrottle::OnUIChecksPerformed(
232 NavigationThrottle::ThrottleCheckResult result) { 232 NavigationThrottle::ThrottleCheckResult result) {
233 DCHECK_CURRENTLY_ON(BrowserThread::IO); 233 DCHECK_CURRENTLY_ON(BrowserThread::IO);
234 if (result == NavigationThrottle::CANCEL_AND_IGNORE) { 234 if (result == NavigationThrottle::CANCEL_AND_IGNORE) {
235 controller()->CancelAndIgnore(); 235 controller()->CancelAndIgnore();
236 } else if (result == NavigationThrottle::CANCEL) { 236 } else if (result == NavigationThrottle::CANCEL) {
237 controller()->Cancel(); 237 controller()->Cancel();
238 } else if (result == NavigationThrottle::BLOCK_RESPONSE) {
239 // TODO(mkwst): If we cancel the main frame request with anything other than
240 // 'net::ERR_ABORTED', we'll trigger some special behavior that might not be
241 // desirable here (non-POSTs will reload the page, while POST has some logic
242 // around reloading to avoid duplicating actions server-side). For the
243 // moment, only child frame navigations should be blocked. If we need to
244 // block main frame navigations in the future, we'll need to carefully
245 // consider the right thing to do here.
mmenke 2016/05/05 12:36:27 Can we add a DCHECK here, too (Grab the ResourceRe
246 controller()->CancelWithError(net::ERR_BLOCKED_BY_RESPONSE);
238 } else { 247 } else {
239 controller()->Resume(); 248 controller()->Resume();
240 } 249 }
241 } 250 }
242 251
243 } // namespace content 252 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698