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

Unified Diff: webrtc/modules/rtp_rtcp/source/ssrc_database.h

Issue 1623543002: Refactor RtpSender and SSRCDatabase a bit. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove thread checker due to voe::ChannelOwner Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/ssrc_database.h
diff --git a/webrtc/modules/rtp_rtcp/source/ssrc_database.h b/webrtc/modules/rtp_rtcp/source/ssrc_database.h
index 7a3133638d7eb20e5e7cefb58e5f9fca027d0ae6..77086c8a5ad09a22d7d8feb99cdff9beb032a596 100644
--- a/webrtc/modules/rtp_rtcp/source/ssrc_database.h
+++ b/webrtc/modules/rtp_rtcp/source/ssrc_database.h
@@ -13,38 +13,31 @@
#include <set>
+#include "webrtc/base/criticalsection.h"
#include "webrtc/base/random.h"
#include "webrtc/base/scoped_ptr.h"
the sun 2016/01/25 11:24:57 dd
tommi 2016/01/25 12:28:33 Done.
-#include "webrtc/system_wrappers/include/static_instance.h"
+#include "webrtc/base/thread_annotations.h"
#include "webrtc/typedefs.h"
namespace webrtc {
-class CriticalSectionWrapper;
class SSRCDatabase {
public:
- static SSRCDatabase* GetSSRCDatabase();
- static void ReturnSSRCDatabase();
+ SSRCDatabase();
+ ~SSRCDatabase();
uint32_t CreateSSRC();
void RegisterSSRC(uint32_t ssrc);
void ReturnSSRC(uint32_t ssrc);
- protected:
- SSRCDatabase();
- virtual ~SSRCDatabase();
-
- static SSRCDatabase* CreateInstance() { return new SSRCDatabase(); }
-
private:
- // Friend function to allow the SSRC destructor to be accessed from the
- // template class.
- friend SSRCDatabase* GetStaticInstance<SSRCDatabase>(
- CountOperation count_operation);
-
- rtc::scoped_ptr<CriticalSectionWrapper> crit_;
+ rtc::CriticalSection crit_;
Random random_ GUARDED_BY(crit_);
std::set<uint32_t> ssrcs_ GUARDED_BY(crit_);
+ // TODO(tommi): Use a thread checker to ensure the object is created and
+ // deleted on the same thread. At the moment this isn't possible due to
+ // voe::ChannelOwner in voice engine. To reproduce, run:
+ // voe_auto_test --automated --gtest_filter=*MixManyChannelsForStressOpus
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698