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

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

Issue 2250613002: Rework use counter for navigator.share to use [MeasureAs]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webshare-usecounter
Patch Set: 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 | « no previous file | third_party/WebKit/Source/modules/webshare/NavigatorShare.idl » ('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 6fb373c3c4938c80e61e10848e91c9b51dd4cdcd..87fa7f0e4d439a2c58a7e702d0a31b8c1103b68c 100644
--- a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
+++ b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
@@ -9,7 +9,6 @@
#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"
@@ -83,16 +82,14 @@ 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 | « no previous file | third_party/WebKit/Source/modules/webshare/NavigatorShare.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698