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

Side by Side Diff: chrome/browser/metrics/first_web_contents_profiler.cc

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Overall code cleanup to request reviewers to PTAL. Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #if !defined(OS_ANDROID) 5 #if !defined(OS_ANDROID)
6 6
7 #include "chrome/browser/metrics/first_web_contents_profiler.h" 7 #include "chrome/browser/metrics/first_web_contents_profiler.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 void FirstWebContentsProfiler::DidStartNavigation( 81 void FirstWebContentsProfiler::DidStartNavigation(
82 content::NavigationHandle* navigation_handle) { 82 content::NavigationHandle* navigation_handle) {
83 if (collected_main_navigation_start_metric_) 83 if (collected_main_navigation_start_metric_)
84 return; 84 return;
85 if (startup_metric_utils::WasNonBrowserUIDisplayed()) { 85 if (startup_metric_utils::WasNonBrowserUIDisplayed()) {
86 FinishedCollectingMetrics(FinishReason::ABANDON_BLOCKING_UI); 86 FinishedCollectingMetrics(FinishReason::ABANDON_BLOCKING_UI);
87 return; 87 return;
88 } 88 }
89 89
90 // TODO(carlosk): this DCHECK is hit when PlzNavigate is enabled. See
91 // crbug.com/610771.
90 // The first navigation has to be the main frame's. 92 // The first navigation has to be the main frame's.
91 DCHECK(navigation_handle->IsInMainFrame()); 93 DCHECK(navigation_handle->IsInMainFrame());
92 94
93 collected_main_navigation_start_metric_ = true; 95 collected_main_navigation_start_metric_ = true;
94 startup_metric_utils::RecordFirstWebContentsMainNavigationStart( 96 startup_metric_utils::RecordFirstWebContentsMainNavigationStart(
95 base::TimeTicks::Now()); 97 base::TimeTicks::Now());
96 } 98 }
97 99
98 void FirstWebContentsProfiler::DidFinishNavigation( 100 void FirstWebContentsProfiler::DidFinishNavigation(
99 content::NavigationHandle* navigation_handle) { 101 content::NavigationHandle* navigation_handle) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 157 }
156 if (!collected_load_metric_) { 158 if (!collected_load_metric_) {
157 UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoLoad", 159 UMA_HISTOGRAM_ENUMERATION("Startup.FirstWebContents.FinishReason_NoLoad",
158 finish_reason, FinishReason::ENUM_MAX); 160 finish_reason, FinishReason::ENUM_MAX);
159 } 161 }
160 162
161 delete this; 163 delete this;
162 } 164 }
163 165
164 #endif // !defined(OS_ANDROID) 166 #endif // !defined(OS_ANDROID)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698