Skip to content

Commit

Permalink
Revert "Cherry pick PR #4058: [telemetry] Add telemetry to SbDrmCreat…
Browse files Browse the repository at this point in the history
…eSystem …"

This reverts commit 9fb9073.
  • Loading branch information
johnxwork authored and borongc committed Oct 15, 2024
1 parent 511e8bf commit 7fdf8b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 40 deletions.
22 changes: 2 additions & 20 deletions cobalt/media/base/drm_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()) {
Expand Down
3 changes: 2 additions & 1 deletion cobalt/media/base/drm_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ class DrmSystem : public base::RefCounted<DrmSystem> {
SbDrmStatus status,
const char* error_message);

MediaMetricsProvider media_metrics_provider_;
const SbDrmSystem wrapped_drm_system_;
scoped_refptr<base::SequencedTaskRunner> const task_runner_;

Expand All @@ -254,6 +253,8 @@ class DrmSystem : public base::RefCounted<DrmSystem> {
// Supports concurrent calls to |Session::Update|.
TicketToSessionUpdateMap ticket_to_session_update_map_;

MediaMetricsProvider media_metrics_provider_;

DISALLOW_COPY_AND_ASSIGN(DrmSystem);
};

Expand Down
10 changes: 0 additions & 10 deletions cobalt/media/base/metrics_provider_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 0 additions & 9 deletions tools/metrics/histograms/metadata/cobalt/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,6 @@ Always run the pretty print utility on this file after editing:
<summary>Timing data for closing session of SbDrm.</summary>
</histogram>

<histogram name="Cobalt.Media.SbDrm.Create.LatencyTiming" units="microseconds"
expires_after="never">
<!-- expires-never: Needed for long-term tracking of SbPlayer latencies. -->

<owner>[email protected]</owner>
<owner>[email protected]</owner>
<summary>Timing data for the creation of SbDrm.</summary>
</histogram>

<histogram name="Cobalt.Media.SbDrm.Destroy.LatencyTiming" units="microseconds"
expires_after="never">
<!-- expires-never: Needed for long-term tracking of SbPlayer latencies. -->
Expand Down

0 comments on commit 7fdf8b1

Please sign in to comment.