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

Unified Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 1988933003: Revert "Introduce AncestorThrottle, which will process 'X-Frame-Options' headers." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 894f6ea13c0bced481e0404917b7837f41a1c2d4..80e4a1dd31182c533afd1aa2d15f5d0757080106 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -6,7 +6,6 @@
#include <utility>
-#include "content/browser/frame_host/ancestor_throttle.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/navigator_delegate.h"
@@ -172,9 +171,9 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
- CHECK_GE(state_, WILL_PROCESS_RESPONSE)
+ CHECK(state_ >= READY_TO_COMMIT)
<< "This accessor should only be called "
- "after a response has been received.";
+ "after the navigation is ready to commit.";
return render_frame_host_;
}
@@ -297,13 +296,10 @@ void NavigationHandleImpl::WillStartRequest(
state_ = WILL_SEND_REQUEST;
complete_callback_ = callback;
- // Register the platform's navigation throttles.
- std::unique_ptr<content::NavigationThrottle> ancestor_throttle =
- content::AncestorThrottle::MaybeCreateThrottleFor(this);
- if (ancestor_throttle)
- throttles_.push_back(std::move(ancestor_throttle));
-
- // Register the embedder's navigation throttles.
+ // Register the navigation throttles. The ScopedVector returned by
+ // GetNavigationThrottles is not assigned to throttles_ directly because it
+ // would overwrite any throttle previously added with
+ // RegisterThrottleForTesting.
ScopedVector<NavigationThrottle> throttles_to_register =
GetContentClient()->browser()->CreateThrottlesForNavigation(this);
if (throttles_to_register.size() > 0) {
@@ -420,7 +416,7 @@ NavigationHandleImpl::CheckWillStartRequest() {
next_index_ = i + 1;
return result;
- case NavigationThrottle::BLOCK_RESPONSE:
+ default:
NOTREACHED();
}
}
@@ -451,7 +447,7 @@ NavigationHandleImpl::CheckWillRedirectRequest() {
next_index_ = i + 1;
return result;
- case NavigationThrottle::BLOCK_RESPONSE:
+ default:
NOTREACHED();
}
}
@@ -477,7 +473,6 @@ NavigationHandleImpl::CheckWillProcessResponse() {
case NavigationThrottle::PROCEED:
continue;
- case NavigationThrottle::BLOCK_RESPONSE:
case NavigationThrottle::CANCEL:
case NavigationThrottle::CANCEL_AND_IGNORE:
state_ = CANCELING;
« no previous file with comments | « content/browser/frame_host/ancestor_throttle_unittest.cc ('k') | content/browser/loader/navigation_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698