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

Unified Diff: third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp

Issue 2082463002: Measure the usage of navigator.vibrate in for user gesture & subframe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/vibration/NavigatorVibration.cpp
diff --git a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp
index ae5ca2c5c3622862bdb791b90a39b4e520bbbc8e..5d3a843d239b0be2132d70b48104eb46692f1f5b 100644
--- a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp
+++ b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp
@@ -24,6 +24,8 @@
#include "core/frame/UseCounter.h"
#include "core/page/Page.h"
#include "modules/vibration/VibrationController.h"
+#include "platform/Histogram.h"
+#include "platform/UserGestureIndicator.h"
namespace blink {
@@ -81,6 +83,11 @@ bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& p
if (!frame->page()->isPageVisible())
return false;
+ if (frame->isCrossOrigin()) {
Michael van Ouwerkerk 2016/06/20 13:00:01 Recording whether a user gesture is present would
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, crossOriginVibrateHistogram, ("WebModules.CrossOriginVibrate", 2));
+ crossOriginVibrateHistogram.count(UserGestureIndicator::processingUserGesture() ? 1 : 0);
Michael van Ouwerkerk 2016/06/20 13:00:01 To make the data consistent with the use counters
+ }
mlamouri (slow - plz ping) 2016/06/20 10:39:20 Would that make sense to integrate with the Naviga
ojan 2016/06/20 14:04:09 I didn't realize we had NavigatorVibrateSubFrame a
+
return NavigatorVibration::from(navigator).controller()->vibrate(pattern);
}
« 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