| Index: content/browser/browsing_data/clear_site_data_throttle.cc
|
| diff --git a/content/browser/browsing_data/clear_site_data_throttle.cc b/content/browser/browsing_data/clear_site_data_throttle.cc
|
| index ca040a49e8e5ba8e435da0a734fd7b5f7e7994ce..c036a988df0c571e099a7db379e0994bf1e725e8 100644
|
| --- a/content/browser/browsing_data/clear_site_data_throttle.cc
|
| +++ b/content/browser/browsing_data/clear_site_data_throttle.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/json/json_reader.h"
|
| #include "base/json/json_string_value_serializer.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "base/metrics/histogram_macros.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/values.h"
|
| @@ -50,6 +51,13 @@ bool AreExperimentalFeaturesEnabled() {
|
| switches::kEnableExperimentalWebPlatformFeatures);
|
| }
|
|
|
| +// Represents the parameters as a single number to be recorded in a histogram.
|
| +int ParametersMask(bool clear_cookies, bool clear_storage, bool clear_cache) {
|
| + return static_cast<int>(clear_cookies) * (1 << 0) +
|
| + static_cast<int>(clear_storage) * (1 << 1) +
|
| + static_cast<int>(clear_cache) * (1 << 2);
|
| +}
|
| +
|
| } // namespace
|
|
|
| // static
|
| @@ -138,6 +146,11 @@ void ClearSiteDataThrottle::HandleHeader() {
|
| return;
|
| }
|
|
|
| + // Record the call parameters.
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "Navigation.ClearSiteData.Parameters",
|
| + ParametersMask(clear_cookies, clear_storage, clear_cache), (1 << 3));
|
| +
|
| // If the header is valid, clear the data for this browser context and origin.
|
| BrowserContext* browser_context =
|
| navigation_handle()->GetWebContents()->GetBrowserContext();
|
| @@ -150,6 +163,7 @@ void ClearSiteDataThrottle::HandleHeader() {
|
| }
|
|
|
| clearing_in_progress_ = true;
|
| + clearing_started_ = base::TimeTicks::Now();
|
| GetContentClient()->browser()->ClearSiteData(
|
| browser_context, origin, clear_cookies, clear_storage, clear_cache,
|
| base::Bind(&ClearSiteDataThrottle::TaskFinished,
|
| @@ -256,6 +270,12 @@ bool ClearSiteDataThrottle::ParseHeader(const std::string& header,
|
| void ClearSiteDataThrottle::TaskFinished() {
|
| DCHECK(clearing_in_progress_);
|
| clearing_in_progress_ = false;
|
| +
|
| + UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.ClearSiteData.Duration",
|
| + base::TimeTicks::Now() - clearing_started_,
|
| + base::TimeDelta::FromMilliseconds(1),
|
| + base::TimeDelta::FromSeconds(1), 50);
|
| +
|
| navigation_handle()->Resume();
|
| }
|
|
|
|
|