Enable cpplint for webrtc/modules/pacing and fix all uncovered cpplint errors.
This CL enableds cpplint for webrtc/modules/pacing.
BUG=webrtc:5460
NOTRY=true
TESTED=Fixed issues reported by:
find webrtc/modules/pacing -type f -name *.cc -o -name *.h | xargs cpplint.py
followed by 'git cl presubmit'.
Review URL: https://codereview.webrtc.org/1674423002
Cr-Commit-Position: refs/heads/master@{#11531}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index ce175a4..7388cf8 100755
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -21,6 +21,7 @@
'webrtc/common_video',
'webrtc/examples',
'webrtc/modules/bitrate_controller',
+ 'webrtc/modules/pacing',
'webrtc/modules/remote_bitrate_estimator',
'webrtc/modules/rtp_rtcp',
'webrtc/modules/video_coding',
diff --git a/webrtc/modules/pacing/mock/mock_paced_sender.h b/webrtc/modules/pacing/mock/mock_paced_sender.h
index 01d5f6a..c710dbc 100644
--- a/webrtc/modules/pacing/mock/mock_paced_sender.h
+++ b/webrtc/modules/pacing/mock/mock_paced_sender.h
@@ -11,10 +11,10 @@
#ifndef WEBRTC_MODULES_PACING_MOCK_MOCK_PACED_SENDER_H_
#define WEBRTC_MODULES_PACING_MOCK_MOCK_PACED_SENDER_H_
-#include "testing/gmock/include/gmock/gmock.h"
-
#include <vector>
+#include "testing/gmock/include/gmock/gmock.h"
+
#include "webrtc/modules/pacing/paced_sender.h"
#include "webrtc/system_wrappers/include/clock.h"
diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc
index 25ca2cf..23b172c 100644
--- a/webrtc/modules/pacing/paced_sender.cc
+++ b/webrtc/modules/pacing/paced_sender.cc
@@ -10,9 +10,11 @@
#include "webrtc/modules/pacing/paced_sender.h"
+#include <algorithm>
#include <map>
#include <queue>
#include <set>
+#include <vector>
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
diff --git a/webrtc/modules/pacing/paced_sender_unittest.cc b/webrtc/modules/pacing/paced_sender_unittest.cc
index 588bf3b..f40dba3 100644
--- a/webrtc/modules/pacing/paced_sender_unittest.cc
+++ b/webrtc/modules/pacing/paced_sender_unittest.cc
@@ -288,7 +288,7 @@
TimeToSendPacket(ssrc, queued_sequence_number++, _, false))
.Times(1)
.WillRepeatedly(Return(true));
- }
+ }
EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess());
EXPECT_EQ(0, send_bucket_->Process());
}
@@ -422,7 +422,8 @@
int64_t start_time = clock_.TimeInMilliseconds();
size_t media_bytes = 0;
while (clock_.TimeInMilliseconds() - start_time < kBitrateWindow) {
- size_t media_payload = rand() % 100 + 200; // [200, 300] bytes.
+ int rand_value = rand(); // NOLINT (rand_r instead of rand)
+ size_t media_payload = rand_value % 100 + 200; // [200, 300] bytes.
send_bucket_->InsertPacket(PacedSender::kNormalPriority, ssrc,
sequence_number++, capture_time_ms,
media_payload, false);
diff --git a/webrtc/modules/pacing/packet_router.cc b/webrtc/modules/pacing/packet_router.cc
index e98ab0c..ac75d2c 100644
--- a/webrtc/modules/pacing/packet_router.cc
+++ b/webrtc/modules/pacing/packet_router.cc
@@ -40,7 +40,7 @@
}
return false;
}
-}
+} // namespace
PacketRouter::PacketRouter() : transport_seq_(0) {
pacer_thread_checker_.DetachFromThread();