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

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

Issue 1424003006: DataReductionProxyNavigationThrottle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge-session-throttle
Patch Set: Created 5 years 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 59c4d21f6fd95dfd86d893b91691707334b28246..f7a6219cee049156a2b5a50432481032bc9c3173 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -42,10 +42,12 @@ NavigationHandleImpl::NavigationHandleImpl(
FrameTreeNode* frame_tree_node,
const base::TimeTicks& navigation_start)
: url_(url),
+ original_url_(url),
is_post_(false),
has_user_gesture_(false),
transition_(ui::PAGE_TRANSITION_LINK),
is_external_protocol_(false),
+ is_prefetch_(false),
net_error_code_(net::OK),
render_frame_host_(nullptr),
is_same_page_(false),
@@ -78,6 +80,10 @@ const GURL& NavigationHandleImpl::GetURL() {
return url_;
}
+const GURL& NavigationHandleImpl::GetOriginalURL() {
+ return original_url_;
+}
+
bool NavigationHandleImpl::IsInMainFrame() {
return frame_tree_node_->IsMainFrame();
}
@@ -116,6 +122,12 @@ bool NavigationHandleImpl::IsExternalProtocol() {
return is_external_protocol_;
}
+bool NavigationHandleImpl::IsPrefetch() {
+ CHECK_NE(INITIAL, state_)
+ << "This accessor should not be called before the request is started.";
+ return is_prefetch_;
+}
+
net::Error NavigationHandleImpl::GetNetErrorCode() {
return net_error_code_;
}
@@ -185,7 +197,7 @@ NavigationHandleImpl::CallWillStartRequestForTesting(
bool is_external_protocol) {
NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
WillStartRequest(is_post, sanitized_referrer, has_user_gesture, transition,
- is_external_protocol,
+ is_external_protocol, false,
base::Bind(&UpdateThrottleCheckResult, &result));
// Reset the callback to ensure it will not be called later.
@@ -233,6 +245,7 @@ void NavigationHandleImpl::WillStartRequest(
bool has_user_gesture,
ui::PageTransition transition,
bool is_external_protocol,
+ bool is_prefetch,
const ThrottleChecksFinishedCallback& callback) {
// Update the navigation parameters.
is_post_ = is_post;
@@ -240,6 +253,7 @@ void NavigationHandleImpl::WillStartRequest(
has_user_gesture_ = has_user_gesture;
transition_ = transition;
is_external_protocol_ = is_external_protocol;
+ is_prefetch_ = is_prefetch;
state_ = WILL_SEND_REQUEST;
complete_callback_ = callback;
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/browser/frame_host/navigation_handle_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698