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

Unified Diff: webrtc/modules/video_coding/codecs/test/packet_manipulator.cc

Issue 2790533002: Remove ALL usage of CriticalSectionWrapper. (Closed)
Patch Set: remove winXP rw_lock include Created 3 years, 9 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/video_coding/codecs/test/packet_manipulator.cc
diff --git a/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc b/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc
index b554b4e9aec50307a7305959af7a5253d8f78d85..9bde45eeffc808cd16253f6b664d5c8d08e53627 100644
--- a/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc
+++ b/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc
@@ -24,16 +24,11 @@ PacketManipulatorImpl::PacketManipulatorImpl(PacketReader* packet_reader,
: packet_reader_(packet_reader),
config_(config),
active_burst_packets_(0),
- critsect_(CriticalSectionWrapper::CreateCriticalSection()),
random_seed_(1),
verbose_(verbose) {
assert(packet_reader);
}
-PacketManipulatorImpl::~PacketManipulatorImpl() {
- delete critsect_;
-}
-
int PacketManipulatorImpl::ManipulatePackets(
webrtc::EncodedImage* encoded_image) {
int nbr_packets_dropped = 0;
@@ -89,10 +84,10 @@ inline double PacketManipulatorImpl::RandomUniform() {
// Use the previous result as new seed before each rand() call. Doing this
// it doesn't matter if other threads are calling rand() since we'll always
// get the same behavior as long as we're using a fixed initial seed.
- critsect_->Enter();
+ critsect_.Enter();
srand(random_seed_);
random_seed_ = rand(); // NOLINT (rand_r instead of rand)
- critsect_->Leave();
+ critsect_.Leave();
return (random_seed_ + 1.0) / (RAND_MAX + 1.0);
}
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/packet_manipulator.h ('k') | webrtc/modules/video_coding/generic_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698