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

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: Created a DRP PageLoadMetricsObserver Created 4 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 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 316bf66638b0475740fb3bea1ff304abc14189a6..df5f3b40b78d7fdc089171c875cf7146c11135a9 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -246,20 +246,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,
@@ -366,20 +376,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