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

Unified Diff: third_party/WebKit/Source/modules/mediasession/MediaSession.cpp

Issue 2665733003: Add rappor metrics to track Media Session API usage (Closed)
Patch Set: Created 3 years, 11 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 | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
diff --git a/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp b/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
index 70f4bb5b66227d2e7340c65d7a9cbb526b7c9899..2d4bf562a11294cc79a10f4d378210e0b2ee433d 100644
--- a/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
+++ b/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
@@ -13,6 +13,7 @@
#include "modules/mediasession/MediaMetadataSanitizer.h"
#include "platform/UserGestureIndicator.h"
#include "public/platform/InterfaceProvider.h"
+#include "public/platform/Platform.h"
#include "wtf/Optional.h"
#include <memory>
@@ -205,8 +206,12 @@ mojom::blink::MediaSessionService* MediaSession::getService() {
return nullptr;
interfaceProvider->getInterface(mojo::MakeRequest(&m_service));
- if (m_service.get())
+ if (m_service.get()) {
+ // Record the eTLD+1 of the frame using the API.
+ Platform::current()->recordRapporURL("Media.Session.APIUsage.Origin",
+ document->url());
m_service->SetClient(m_clientBinding.CreateInterfacePtrAndBind());
+ }
return m_service.get();
}
« no previous file with comments | « no previous file | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698