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

Unified Diff: Source/modules/presentation/PresentationSession.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/PresentationSession.cpp
diff --git a/Source/modules/presentation/PresentationSession.cpp b/Source/modules/presentation/PresentationSession.cpp
index 253ff2cf7d856cae7908822bcb87ee7dcaae6924..8be0c9d2254155c74ef6521b6da31cbac68375f9 100644
--- a/Source/modules/presentation/PresentationSession.cpp
+++ b/Source/modules/presentation/PresentationSession.cpp
@@ -15,6 +15,7 @@
#include "core/fileapi/FileReaderLoader.h"
#include "core/fileapi/FileReaderLoaderClient.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/UseCounter.h"
#include "modules/EventTargetModules.h"
#include "modules/presentation/Presentation.h"
#include "modules/presentation/PresentationController.h"
@@ -156,7 +157,18 @@ ExecutionContext* PresentationSession::executionContext() const
{
if (!frame())
return nullptr;
- return frame()->document();}
+ return frame()->document();
+}
+
+bool PresentationSession::addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, bool capture)
+{
+ if (eventType == EventTypeNames::statechange)
+ UseCounter::count(executionContext(), UseCounter::PresentationSessionStateChangeEventListener);
+ else if (eventType == EventTypeNames::message)
+ UseCounter::count(executionContext(), UseCounter::PresentationSessionMessageEventListener);
+
+ return EventTarget::addEventListener(eventType, listener, capture);
+}
DEFINE_TRACE(PresentationSession)
{
« no previous file with comments | « Source/modules/presentation/PresentationSession.h ('k') | Source/modules/presentation/PresentationSession.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698