| Index: components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| diff --git a/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc b/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| index 0e755245c872288e89c058fef4010c9bb05cf36e..b6e39f433eb938da8a0f6dcac008310619f6a97a 100644
|
| --- a/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| +++ b/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "base/metrics/histogram_macros.h"
|
| #include "components/subresource_filter/content/browser/async_document_subresource_filter.h"
|
| #include "content/public/browser/navigation_handle.h"
|
| #include "content/public/browser/render_frame_host.h"
|
| @@ -92,6 +93,8 @@ ActivationStateComputingNavigationThrottle::WillProcessResponse() {
|
| base::Bind(&ActivationStateComputingNavigationThrottle::
|
| OnActivationStateComputed,
|
| weak_ptr_factory_.GetWeakPtr()));
|
| +
|
| + defer_time_ = base::TimeTicks::Now();
|
| return content::NavigationThrottle::ThrottleCheckResult::DEFER;
|
| }
|
|
|
| @@ -101,6 +104,15 @@ const char* ActivationStateComputingNavigationThrottle::GetNameForLogging() {
|
|
|
| void ActivationStateComputingNavigationThrottle::OnActivationStateComputed(
|
| ActivationState state) {
|
| + DCHECK(!defer_time_.is_null());
|
| + base::TimeDelta delay = base::TimeTicks::Now() - defer_time_;
|
| + UMA_HISTOGRAM_TIMES("SubresourceFilter.DocumentLoad.ActivationComputingDelay",
|
| + delay);
|
| + if (navigation_handle()->IsInMainFrame()) {
|
| + UMA_HISTOGRAM_TIMES(
|
| + "SubresourceFilter.DocumentLoad.ActivationComputingDelay.MainFrame",
|
| + delay);
|
| + }
|
| navigation_handle()->Resume();
|
| }
|
|
|
|
|