From 00b4e5f928016ad89286843b3b92c2dec35c78ac Mon Sep 17 00:00:00 2001 From: miu Date: Tue, 3 Nov 2015 11:58:04 -0800 Subject: [Cast] Thread-safe LogEventDispatcher for packet/frame event logging. Removed LoggingImpl and LoggingRaw, and replaced with a thread-safe LogEventDispatcher. Interface changes were made to allow passing logging event data without extra copying. BUG=530841 Review URL: https://codereview.chromium.org/1418583003 Cr-Commit-Position: refs/heads/master@{#357590} --- media/cast/cast_environment.cc | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'media/cast/cast_environment.cc') diff --git a/media/cast/cast_environment.cc b/media/cast/cast_environment.cc index f22f0a4..e3def4f 100644 --- a/media/cast/cast_environment.cc +++ b/media/cast/cast_environment.cc @@ -10,14 +10,6 @@ using base::SingleThreadTaskRunner; -namespace { - -void DeleteLoggingOnMainThread(scoped_ptr logging) { - logging.reset(); -} - -} // namespace - namespace media { namespace cast { @@ -30,17 +22,9 @@ CastEnvironment::CastEnvironment( audio_thread_proxy_(audio_thread_proxy), video_thread_proxy_(video_thread_proxy), clock_(clock.Pass()), - logging_(new LoggingImpl) {} + logger_(this) {} -CastEnvironment::~CastEnvironment() { - // Logging must be deleted on the main thread. - if (main_thread_proxy_.get() && - !main_thread_proxy_->RunsTasksOnCurrentThread()) { - main_thread_proxy_->PostTask( - FROM_HERE, - base::Bind(&DeleteLoggingOnMainThread, base::Passed(&logging_))); - } -} +CastEnvironment::~CastEnvironment() {} bool CastEnvironment::PostTask(ThreadId identifier, const tracked_objects::Location& from_here, -- cgit v1.1