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

Unified Diff: third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp

Issue 2234723002: Added UseCounter for navigator.share (WebShareShare). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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 | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | 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/webshare/NavigatorShare.cpp
diff --git a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
index 87fa7f0e4d439a2c58a7e702d0a31b8c1103b68c..6fb373c3c4938c80e61e10848e91c9b51dd4cdcd 100644
--- a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
+++ b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
@@ -9,6 +9,7 @@
#include "core/dom/ExceptionCode.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Navigator.h"
+#include "core/frame/UseCounter.h"
#include "modules/webshare/ShareData.h"
#include "platform/UserGestureIndicator.h"
#include "platform/mojo/MojoHelper.h"
@@ -82,14 +83,16 @@ const char* NavigatorShare::supplementName()
ScriptPromise NavigatorShare::share(ScriptState* scriptState, const ShareData& shareData)
{
+ Document* doc = toDocument(scriptState->getExecutionContext());
+ DCHECK(doc);
+ UseCounter::count(*doc, UseCounter::WebShareShare);
+
if (!UserGestureIndicator::utilizeUserGesture()) {
DOMException* error = DOMException::create(SecurityError, "Must be handling a user gesture to perform a share request.");
return ScriptPromise::rejectWithDOMException(scriptState, error);
}
if (!m_service) {
- Document* doc = toDocument(scriptState->getExecutionContext());
- DCHECK(doc);
LocalFrame* frame = doc->frame();
DCHECK(frame);
frame->interfaceProvider()->getInterface(mojo::GetProxy(&m_service));
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698