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

Unified Diff: third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp

Issue 1705073003: Add histograms in Blink for Geolocation request timeouts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo. 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp
diff --git a/third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp b/third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp
index 71006682f075a68054590a68240ce23c7c200955..1a0c8a71baba2823820ad2e1304dc73ba535964d 100644
--- a/third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp
+++ b/third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp
@@ -7,6 +7,7 @@
#include "modules/geolocation/Geolocation.h"
#include "modules/geolocation/PositionError.h"
#include "modules/geolocation/PositionOptions.h"
+#include "platform/Histogram.h"
namespace blink {
@@ -20,6 +21,9 @@ GeoNotifier::GeoNotifier(Geolocation* geolocation, PositionCallback* successCall
{
ASSERT(m_geolocation);
ASSERT(m_successCallback);
+
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutHistogram, ("Geolocation.Timeout", 0, 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */));
+ timeoutHistogram.count(m_options.timeout());
}
DEFINE_TRACE(GeoNotifier)
@@ -94,6 +98,10 @@ void GeoNotifier::timerFired(Timer<GeoNotifier>*)
if (m_errorCallback)
m_errorCallback->handleEvent(PositionError::create(PositionError::TIMEOUT, "Timeout expired"));
+
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutExpiredHistogram, ("Geolocation.TimeoutExpired", 0, 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */));
+ timeoutExpiredHistogram.count(m_options.timeout());
+
m_geolocation->requestTimedOut(this);
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698