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

Side by Side Diff: media/cast/logging/raw_event_subscriber_bundle.cc

Issue 482383005: Cast logging: Additional stats for getStats() API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@REAL-NEW-MASTER
Patch Set: Rebase Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/cast/logging/receiver_time_offset_estimator_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/logging/raw_event_subscriber_bundle.h" 5 #include "media/cast/logging/raw_event_subscriber_bundle.h"
6 6
7 #include "media/cast/cast_environment.h" 7 #include "media/cast/cast_environment.h"
8 #include "media/cast/logging/receiver_time_offset_estimator_impl.h" 8 #include "media/cast/logging/receiver_time_offset_estimator_impl.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 RawEventSubscriberBundle::~RawEventSubscriberBundle() { 47 RawEventSubscriberBundle::~RawEventSubscriberBundle() {
48 if (receiver_offset_estimator_.get()) { 48 if (receiver_offset_estimator_.get()) {
49 cast_environment_->Logging()->RemoveRawEventSubscriber( 49 cast_environment_->Logging()->RemoveRawEventSubscriber(
50 receiver_offset_estimator_.get()); 50 receiver_offset_estimator_.get());
51 } 51 }
52 } 52 }
53 53
54 void RawEventSubscriberBundle::AddEventSubscribers(bool is_audio) { 54 void RawEventSubscriberBundle::AddEventSubscribers(bool is_audio) {
55 if (!receiver_offset_estimator_.get()) { 55 if (!receiver_offset_estimator_.get()) {
56 receiver_offset_estimator_.reset( 56 receiver_offset_estimator_.reset(
57 new ReceiverTimeOffsetEstimatorImpl); 57 new ReceiverTimeOffsetEstimatorImpl(cast_environment_->Clock()));
58 cast_environment_->Logging()->AddRawEventSubscriber( 58 cast_environment_->Logging()->AddRawEventSubscriber(
59 receiver_offset_estimator_.get()); 59 receiver_offset_estimator_.get());
60 } 60 }
61 SubscribersMapByStream::iterator it = subscribers_.find(is_audio); 61 SubscribersMapByStream::iterator it = subscribers_.find(is_audio);
62 if (it != subscribers_.end()) 62 if (it != subscribers_.end())
63 return; 63 return;
64 64
65 subscribers_.insert(std::make_pair( 65 subscribers_.insert(std::make_pair(
66 is_audio, 66 is_audio,
67 make_linked_ptr(new RawEventSubscriberBundleForStream( 67 make_linked_ptr(new RawEventSubscriberBundleForStream(
(...skipping 22 matching lines...) Expand all
90 90
91 StatsEventSubscriber* 91 StatsEventSubscriber*
92 RawEventSubscriberBundle::GetStatsEventSubscriber(bool is_audio) { 92 RawEventSubscriberBundle::GetStatsEventSubscriber(bool is_audio) {
93 SubscribersMapByStream::iterator it = subscribers_.find(is_audio); 93 SubscribersMapByStream::iterator it = subscribers_.find(is_audio);
94 return it == subscribers_.end() ? 94 return it == subscribers_.end() ?
95 NULL : it->second->GetStatsEventSubscriber(); 95 NULL : it->second->GetStatsEventSubscriber();
96 } 96 }
97 97
98 } // namespace cast 98 } // namespace cast
99 } // namespace media 99 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/cast/logging/receiver_time_offset_estimator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698