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

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

Issue 1202633007: Add UseCounter for navigator.vibrate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 5 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 | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/vibration/NavigatorVibration.cpp
diff --git a/Source/modules/vibration/NavigatorVibration.cpp b/Source/modules/vibration/NavigatorVibration.cpp
index 7a62bf3265a5e3a333eb80783df572d6022f902d..c8315fbf019086b851ac919b81ff90116437e71c 100644
--- a/Source/modules/vibration/NavigatorVibration.cpp
+++ b/Source/modules/vibration/NavigatorVibration.cpp
@@ -23,6 +23,7 @@
#include "bindings/modules/v8/UnionTypesModules.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Navigator.h"
+#include "core/frame/UseCounter.h"
#include "core/page/PageVisibilityState.h"
#include "public/platform/Platform.h"
@@ -168,6 +169,10 @@ bool NavigatorVibration::vibrate(Navigator& navigator, const VibrationPattern& p
if (!navigator.frame())
return false;
+ UseCounter::count(navigator.frame(), UseCounter::NavigatorVibrate);
+ if (!navigator.frame()->isMainFrame())
+ UseCounter::count(navigator.frame(), UseCounter::NavigatorVibrateSubFrame);
+
Page* page = navigator.frame()->page();
if (!page)
return false;
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698