| Index: components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.cc b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| index c8bd56ac526e7eb390799443b470c1957289b9f3..9ec33a0c0dad2acddaf3318d1b75203112c7527e 100644
|
| --- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/location.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| +#include "base/metrics/user_metrics.h"
|
| #include "components/page_load_metrics/browser/page_load_metrics_macros.h"
|
| #include "components/page_load_metrics/common/page_load_metrics_messages.h"
|
| #include "components/page_load_metrics/common/page_load_timing.h"
|
| @@ -160,6 +161,11 @@ void PageLoadTracker::Commit(content::NavigationHandle* navigation_handle) {
|
| OnCommit(navigation_handle));
|
| }
|
|
|
| +void PageLoadTracker::Redirect(content::NavigationHandle* navigation_handle) {
|
| + FOR_EACH_OBSERVER(PageLoadMetricsObserver, *observers_,
|
| + OnRedirect(navigation_handle));
|
| +}
|
| +
|
| bool PageLoadTracker::UpdateTiming(const PageLoadTiming& new_timing) {
|
| // Throw away IPCs that are not relevant to the current navigation.
|
| // Two timing structures cannot refer to the same navigation if they indicate
|
| @@ -481,6 +487,16 @@ void MetricsWebContentsObserver::DidFinishNavigation(
|
| committed_load_->Commit(navigation_handle);
|
| }
|
|
|
| +void MetricsWebContentsObserver::DidRedirectNavigation(
|
| + content::NavigationHandle* navigation_handle) {
|
| + if (!navigation_handle->IsInMainFrame())
|
| + return;
|
| + auto it = provisional_loads_.find(navigation_handle);
|
| + if (it == provisional_loads_.end())
|
| + return;
|
| + it->second->Redirect(navigation_handle);
|
| +}
|
| +
|
| void MetricsWebContentsObserver::WasShown() {
|
| in_foreground_ = true;
|
| if (committed_load_)
|
|
|