From 7fdf8b1e3dc2d54fd35bde13c33be75aab4c6ca2 Mon Sep 17 00:00:00 2001 From: johnx Date: Tue, 15 Oct 2024 13:32:40 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"Cherry=20pick=20PR=20#4058:=20[teleme?= =?UTF-8?q?try]=20Add=20telemetry=20to=20SbDrmCreateSystem=20=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9fb90733deadf33810cc3e061000e9eeea87998f. --- cobalt/media/base/drm_system.cc | 22 ++----------------- cobalt/media/base/drm_system.h | 3 ++- cobalt/media/base/metrics_provider_test.cc | 10 --------- .../histograms/metadata/cobalt/histograms.xml | 9 -------- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/cobalt/media/base/drm_system.cc b/cobalt/media/base/drm_system.cc index 8f3ccd8f62b1..21949bc57233 100644 --- a/cobalt/media/base/drm_system.cc +++ b/cobalt/media/base/drm_system.cc @@ -25,23 +25,6 @@ namespace cobalt { namespace media { -SbDrmSystem CreateSbDrmSystemWithHistogram( - const char* key_system, void* context, - SbDrmSessionUpdateRequestFunc update_request_callback, - SbDrmSessionUpdatedFunc session_updated_callback, - SbDrmSessionKeyStatusesChangedFunc key_statuses_changed_callback, - SbDrmServerCertificateUpdatedFunc server_certificate_updated_callback, - SbDrmSessionClosedFunc session_closed_callback, - MediaMetricsProvider& media_metrics_provider) { - media_metrics_provider.StartTrackingAction(MediaAction::SBDRM_CREATE); - auto drm_system = SbDrmCreateSystem( - key_system, context, update_request_callback, session_updated_callback, - key_statuses_changed_callback, server_certificate_updated_callback, - session_closed_callback); - media_metrics_provider.EndTrackingAction(MediaAction::SBDRM_CREATE); - return drm_system; -} - DECLARE_INSTANCE_COUNTER(DrmSystem); DrmSystem::Session::Session( @@ -97,11 +80,10 @@ void DrmSystem::Session::Close() { } DrmSystem::DrmSystem(const char* key_system) - : wrapped_drm_system_(CreateSbDrmSystemWithHistogram( + : wrapped_drm_system_(SbDrmCreateSystem( key_system, this, OnSessionUpdateRequestGeneratedFunc, OnSessionUpdatedFunc, OnSessionKeyStatusesChangedFunc, - OnServerCertificateUpdatedFunc, OnSessionClosedFunc, - media_metrics_provider_)), + OnServerCertificateUpdatedFunc, OnSessionClosedFunc)), task_runner_(base::SequencedTaskRunner::GetCurrentDefault()), ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), weak_this_(weak_ptr_factory_.GetWeakPtr()) { diff --git a/cobalt/media/base/drm_system.h b/cobalt/media/base/drm_system.h index 446735b8919c..c4801c54eb03 100644 --- a/cobalt/media/base/drm_system.h +++ b/cobalt/media/base/drm_system.h @@ -232,7 +232,6 @@ class DrmSystem : public base::RefCounted { SbDrmStatus status, const char* error_message); - MediaMetricsProvider media_metrics_provider_; const SbDrmSystem wrapped_drm_system_; scoped_refptr const task_runner_; @@ -254,6 +253,8 @@ class DrmSystem : public base::RefCounted { // Supports concurrent calls to |Session::Update|. TicketToSessionUpdateMap ticket_to_session_update_map_; + MediaMetricsProvider media_metrics_provider_; + DISALLOW_COPY_AND_ASSIGN(DrmSystem); }; diff --git a/cobalt/media/base/metrics_provider_test.cc b/cobalt/media/base/metrics_provider_test.cc index 648e3d9bd488..734cf1ea1a0a 100644 --- a/cobalt/media/base/metrics_provider_test.cc +++ b/cobalt/media/base/metrics_provider_test.cc @@ -210,16 +210,6 @@ TEST_F(MediaMetricsProviderTest, SbDrmCloseSession) { std::string(kUmaPrefix) + "SbDrm.CloseSession.LatencyTiming", 570, 1); } -TEST_F(MediaMetricsProviderTest, SbDrmCreate) { - metrics_.StartTrackingAction(MediaAction::SBDRM_CREATE); - - clock_.Advance(base::TimeDelta::FromMicroseconds(570)); - metrics_.EndTrackingAction(MediaAction::SBDRM_CREATE); - - histogram_tester_.ExpectUniqueSample( - std::string(kUmaPrefix) + "SbDrm.Create.LatencyTiming", 570, 1); -} - TEST_F(MediaMetricsProviderTest, SbDrmDestroy) { metrics_.StartTrackingAction(MediaAction::SBDRM_DESTROY); diff --git a/tools/metrics/histograms/metadata/cobalt/histograms.xml b/tools/metrics/histograms/metadata/cobalt/histograms.xml index d9b19fa2b4ba..2484e67e93bd 100644 --- a/tools/metrics/histograms/metadata/cobalt/histograms.xml +++ b/tools/metrics/histograms/metadata/cobalt/histograms.xml @@ -284,15 +284,6 @@ Always run the pretty print utility on this file after editing: Timing data for closing session of SbDrm. - - - - borongchen@google.com - cobalt-team@google.com - Timing data for the creation of SbDrm. - -