From 16ba8da295ed65af14b3ea32c14ea6e288f6b467 Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Sun, 17 Apr 2016 00:12:10 -0700 Subject: [PATCH] Map to raw pointer instead of scoped_ptr - Fixes Mac build. - Mapping to scoped_ptr doesn't work, instead use raw pointer and STLValueDeleter. Change-Id: If17e43d9d4aba8c92a76d2b1ca99a64c6a2b0e84 --- packager/hls/base/simple_hls_notifier.cc | 6 ++++-- packager/hls/base/simple_hls_notifier.h | 4 +++- packager/hls/base/simple_hls_notifier_unittest.cc | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packager/hls/base/simple_hls_notifier.cc b/packager/hls/base/simple_hls_notifier.cc index e500e5e345..2ffa5ddb59 100644 --- a/packager/hls/base/simple_hls_notifier.cc +++ b/packager/hls/base/simple_hls_notifier.cc @@ -43,7 +43,8 @@ SimpleHlsNotifier::SimpleHlsNotifier(const std::string& prefix, prefix_(prefix), output_dir_(output_dir), media_playlist_factory_(new MediaPlaylistFactory()), - master_playlist_(new MasterPlaylist(master_playlist_name)) {} + master_playlist_(new MasterPlaylist(master_playlist_name)), + media_playlist_map_deleter_(&media_playlist_map_) {} SimpleHlsNotifier::~SimpleHlsNotifier() {} @@ -74,7 +75,8 @@ bool SimpleHlsNotifier::NotifyNewStream(const MediaInfo& media_info, base::AutoLock auto_lock(lock_); master_playlist_->AddMediaPlaylist(media_playlist.get()); - media_playlist_map_.insert(std::make_pair(*stream_id, media_playlist.Pass())); + media_playlist_map_.insert( + std::make_pair(*stream_id, media_playlist.release())); return true; } diff --git a/packager/hls/base/simple_hls_notifier.h b/packager/hls/base/simple_hls_notifier.h index 44f8c345c9..ed8a1a0d07 100644 --- a/packager/hls/base/simple_hls_notifier.h +++ b/packager/hls/base/simple_hls_notifier.h @@ -10,6 +10,7 @@ #include "packager/base/atomic_sequence_num.h" #include "packager/base/macros.h" #include "packager/base/memory/scoped_ptr.h" +#include "packager/base/stl_util.h" #include "packager/base/synchronization/lock.h" #include "packager/hls/base/hls_notifier.h" #include "packager/hls/base/master_playlist.h" @@ -72,7 +73,8 @@ class SimpleHlsNotifier : public HlsNotifier { scoped_ptr media_playlist_factory_; scoped_ptr master_playlist_; - std::map> media_playlist_map_; + std::map media_playlist_map_; + STLValueDeleter media_playlist_map_deleter_; base::AtomicSequenceNumber sequence_number_; diff --git a/packager/hls/base/simple_hls_notifier_unittest.cc b/packager/hls/base/simple_hls_notifier_unittest.cc index ad6d28fe55..3de47ab469 100644 --- a/packager/hls/base/simple_hls_notifier_unittest.cc +++ b/packager/hls/base/simple_hls_notifier_unittest.cc @@ -65,7 +65,7 @@ class SimpleHlsNotifierTest : public ::testing::Test { notifier_.master_playlist_ = playlist.Pass(); } - const std::map>& GetMediaPlaylistMap() { + const std::map& GetMediaPlaylistMap() { return notifier_.media_playlist_map_; }