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

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: 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 f18ccffbce35dc8f60adf2f4ed314a7416f34497..a5f809ce614b09e47b924cbf4101a7cb818058ee 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/PresentationController.h"
@@ -60,6 +61,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

Powered by Google App Engine
This is Rietveld 408576698