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

Unified Diff: Source/modules/presentation/PresentationRequest.cpp

Issue 1290693003: Presentation API: add UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 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
Index: Source/modules/presentation/PresentationRequest.cpp
diff --git a/Source/modules/presentation/PresentationRequest.cpp b/Source/modules/presentation/PresentationRequest.cpp
index 2b34273e0ae4af8144be4acbe5b90ab6199d3f35..63f8aa2b4bbeda17b2af28b4d2738fad84e4dbfb 100644
--- a/Source/modules/presentation/PresentationRequest.cpp
+++ b/Source/modules/presentation/PresentationRequest.cpp
@@ -11,6 +11,7 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/Document.h"
#include "core/dom/ExecutionContext.h"
+#include "core/frame/UseCounter.h"
#include "modules/EventTargetModules.h"
#include "modules/presentation/PresentationAvailability.h"
#include "modules/presentation/PresentationAvailabilityCallbacks.h"
@@ -61,6 +62,14 @@ ExecutionContext* PresentationRequest::executionContext() const
return ActiveDOMObject::executionContext();
}
+bool PresentationRequest::addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, bool capture)
+{
+ if (eventType == EventTypeNames::sessionconnect)
+ UseCounter::count(executionContext(), UseCounter::PresentationRequestSessionConnectEventListener);
+
+ return EventTarget::addEventListener(eventType, listener, capture);
+}
+
bool PresentationRequest::hasPendingActivity() const
{
// Prevents garbage collecting of this object when not hold by another
« no previous file with comments | « Source/modules/presentation/PresentationRequest.h ('k') | Source/modules/presentation/PresentationRequest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698