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

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

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing nits Created 4 years, 9 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 05a6a947aa783bfdd0f5ef0c3cee5da09ad343f7..eaea84a9fc3450a25ac5678b05798e5fa64c3cfe 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -58,21 +58,23 @@ NavigationHandleImpl::NavigationHandleImpl(
render_frame_host_(nullptr),
is_same_page_(false),
is_synchronous_(is_synchronous),
is_srcdoc_(is_srcdoc),
was_redirected_(false),
state_(INITIAL),
is_transferring_(false),
frame_tree_node_(frame_tree_node),
next_index_(0),
navigation_start_(navigation_start),
- pending_nav_entry_id_(pending_nav_entry_id) {
+ pending_nav_entry_id_(pending_nav_entry_id),
+ is_using_lofi_(false),
+ used_data_reduction_proxy_(false) {
DCHECK(!navigation_start.is_null());
GetDelegate()->DidStartNavigation(this);
}
NavigationHandleImpl::~NavigationHandleImpl() {
GetDelegate()->DidFinishNavigation(this);
// Cancel the navigation on the IO thread if the NavigationHandle is being
// destroyed in the middle of the NavigationThrottles checks.
if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null())
@@ -250,20 +252,30 @@ NavigationHandleImpl::CallWillRedirectRequestForTesting(
WillRedirectRequest(new_url, new_method_is_post, new_referrer_url,
new_is_external_protocol,
scoped_refptr<net::HttpResponseHeaders>(),
base::Bind(&UpdateThrottleCheckResult, &result));
// Reset the callback to ensure it will not be called later.
complete_callback_.Reset();
return result;
}
+bool NavigationHandleImpl::IsUsingLofi() const {
+ DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE);
+ return is_using_lofi_;
+}
+
+bool NavigationHandleImpl::UsedDataReductionProxy() const {
+ DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE);
+ return used_data_reduction_proxy_;
+}
+
void NavigationHandleImpl::InitServiceWorkerHandle(
ServiceWorkerContextWrapper* service_worker_context) {
DCHECK(IsBrowserSideNavigationEnabled());
service_worker_handle_.reset(
new ServiceWorkerNavigationHandle(service_worker_context));
}
void NavigationHandleImpl::WillStartRequest(
bool is_post,
const Referrer& sanitized_referrer,
@@ -370,20 +382,22 @@ void NavigationHandleImpl::DidCommitNavigation(
RenderFrameHostImpl* render_frame_host) {
DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host);
DCHECK_EQ(frame_tree_node_, render_frame_host->frame_tree_node());
CHECK_EQ(url_, params.url);
is_post_ = params.is_post;
has_user_gesture_ = (params.gesture == NavigationGestureUser);
transition_ = params.transition;
render_frame_host_ = render_frame_host;
is_same_page_ = same_page;
+ is_using_lofi_ = params.is_using_lofi;
+ used_data_reduction_proxy_ = params.used_data_reduction_proxy;
state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE;
}
NavigationThrottle::ThrottleCheckResult
NavigationHandleImpl::CheckWillStartRequest() {
DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START);
DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0);
DCHECK(state_ != DEFERRING_START || next_index_ != 0);
for (size_t i = next_index_; i < throttles_.size(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698