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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc

Issue 1877253002: Replaced CriticalSectionWrapper with rtc::CriticalSection in rtp_rtcp module (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: git cl format dtmf_queue.cc Created 4 years, 8 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/rtp_header_parser.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc b/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc
index d4cbe544cc6c1c9aa4ea5dba9b15e51b590e887e..2cec8a3e0f6c8c17ec4495ba74de0d0e54a112a2 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_header_parser.cc
@@ -9,10 +9,9 @@
*/
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
-#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/base/criticalsection.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
namespace webrtc {
@@ -30,7 +29,7 @@ class RtpHeaderParserImpl : public RtpHeaderParser {
bool DeregisterRtpHeaderExtension(RTPExtensionType type) override;
private:
- rtc::scoped_ptr<CriticalSectionWrapper> critical_section_;
+ rtc::CriticalSection critical_section_;
RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(critical_section_);
};
@@ -38,8 +37,7 @@ RtpHeaderParser* RtpHeaderParser::Create() {
return new RtpHeaderParserImpl;
}
-RtpHeaderParserImpl::RtpHeaderParserImpl()
- : critical_section_(CriticalSectionWrapper::CreateCriticalSection()) {}
+RtpHeaderParserImpl::RtpHeaderParserImpl() {}
bool RtpHeaderParser::IsRtcp(const uint8_t* packet, size_t length) {
RtpUtility::RtpHeaderParser rtp_parser(packet, length);
@@ -54,7 +52,7 @@ bool RtpHeaderParserImpl::Parse(const uint8_t* packet,
RtpHeaderExtensionMap map;
{
- CriticalSectionScoped cs(critical_section_.get());
+ rtc::CritScope cs(&critical_section_);
rtp_header_extension_map_.GetCopy(&map);
}
@@ -67,12 +65,12 @@ bool RtpHeaderParserImpl::Parse(const uint8_t* packet,
bool RtpHeaderParserImpl::RegisterRtpHeaderExtension(RTPExtensionType type,
uint8_t id) {
- CriticalSectionScoped cs(critical_section_.get());
+ rtc::CritScope cs(&critical_section_);
return rtp_header_extension_map_.Register(type, id) == 0;
}
bool RtpHeaderParserImpl::DeregisterRtpHeaderExtension(RTPExtensionType type) {
- CriticalSectionScoped cs(critical_section_.get());
+ rtc::CritScope cs(&critical_section_);
return rtp_header_extension_map_.Deregister(type) == 0;
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_packet_history.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698