diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 46be5ff06f..6e5fb591cf 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -15,6 +15,7 @@ import sys # Directories that will be scanned by cpplint by the presubmit script. CPPLINT_DIRS = [ + 'webrtc/api', 'webrtc/audio', 'webrtc/call', 'webrtc/common_video', diff --git a/webrtc/api/datachannelinterface.h b/webrtc/api/datachannelinterface.h index 8b788c0468..5fa657dc53 100644 --- a/webrtc/api/datachannelinterface.h +++ b/webrtc/api/datachannelinterface.h @@ -75,7 +75,7 @@ class DataChannelObserver { // A data buffer was successfully received. virtual void OnMessage(const DataBuffer& buffer) = 0; // The data channel's buffered_amount has changed. - virtual void OnBufferedAmountChange(uint64_t previous_amount){}; + virtual void OnBufferedAmountChange(uint64_t previous_amount) {} protected: virtual ~DataChannelObserver() {} diff --git a/webrtc/api/fakemetricsobserver.h b/webrtc/api/fakemetricsobserver.h index baac0ca8f0..90046c91bf 100644 --- a/webrtc/api/fakemetricsobserver.h +++ b/webrtc/api/fakemetricsobserver.h @@ -13,6 +13,7 @@ #include #include +#include #include "webrtc/api/peerconnectioninterface.h" #include "webrtc/base/thread_checker.h" diff --git a/webrtc/api/jsepicecandidate.h b/webrtc/api/jsepicecandidate.h index 7e9500bcea..af064315e0 100644 --- a/webrtc/api/jsepicecandidate.h +++ b/webrtc/api/jsepicecandidate.h @@ -14,6 +14,8 @@ #define WEBRTC_API_JSEPICECANDIDATE_H_ #include +#include +#include #include "webrtc/api/jsep.h" #include "webrtc/base/constructormagic.h" diff --git a/webrtc/api/mediaconstraintsinterface.cc b/webrtc/api/mediaconstraintsinterface.cc index 5361a281a1..f393a2e886 100644 --- a/webrtc/api/mediaconstraintsinterface.cc +++ b/webrtc/api/mediaconstraintsinterface.cc @@ -70,7 +70,7 @@ void ConstraintToOptional(const webrtc::MediaConstraintsInterface* constraints, *value_out = rtc::Optional(value); } } -} +} // namespace namespace webrtc { diff --git a/webrtc/api/mediastreamproxy.h b/webrtc/api/mediastreamproxy.h index 4253a093c4..fe113001b5 100644 --- a/webrtc/api/mediastreamproxy.h +++ b/webrtc/api/mediastreamproxy.h @@ -11,6 +11,8 @@ #ifndef WEBRTC_API_MEDIASTREAMPROXY_H_ #define WEBRTC_API_MEDIASTREAMPROXY_H_ +#include + #include "webrtc/api/mediastreaminterface.h" #include "webrtc/api/proxy.h" diff --git a/webrtc/api/mediastreamtrackproxy.h b/webrtc/api/mediastreamtrackproxy.h index da371f8cf6..9a3cb42366 100644 --- a/webrtc/api/mediastreamtrackproxy.h +++ b/webrtc/api/mediastreamtrackproxy.h @@ -14,6 +14,8 @@ #ifndef WEBRTC_API_MEDIASTREAMTRACKPROXY_H_ #define WEBRTC_API_MEDIASTREAMTRACKPROXY_H_ +#include + #include "webrtc/api/mediastreaminterface.h" #include "webrtc/api/proxy.h" diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h index b1b996fc08..0280c18dbd 100644 --- a/webrtc/api/peerconnectioninterface.h +++ b/webrtc/api/peerconnectioninterface.h @@ -288,7 +288,7 @@ class PeerConnectionInterface : public rtc::RefCountInterface { // Chrome in particular. RTCConfiguration() = default; - RTCConfiguration(RTCConfigurationType type) { + explicit RTCConfiguration(RTCConfigurationType type) { if (type == RTCConfigurationType::kAggressive) { // These parameters are also defined in Java and IOS configurations, // so their values may be overwritten by the Java or IOS configuration. @@ -669,7 +669,7 @@ class PeerConnectionObserver { // Triggered when a remote peer opens a data channel. virtual void OnDataChannel( - rtc::scoped_refptr data_channel){}; + rtc::scoped_refptr data_channel) {} // Deprecated; please use the version that uses a scoped_refptr. virtual void OnDataChannel(DataChannelInterface* data_channel) {} diff --git a/webrtc/api/peerconnectionproxy.h b/webrtc/api/peerconnectionproxy.h index ed707b3c45..76b45d6ee2 100644 --- a/webrtc/api/peerconnectionproxy.h +++ b/webrtc/api/peerconnectionproxy.h @@ -11,6 +11,9 @@ #ifndef WEBRTC_API_PEERCONNECTIONPROXY_H_ #define WEBRTC_API_PEERCONNECTIONPROXY_H_ +#include +#include + #include "webrtc/api/peerconnectioninterface.h" #include "webrtc/api/proxy.h" diff --git a/webrtc/api/proxy.h b/webrtc/api/proxy.h index 51cdd296cf..f834790f64 100644 --- a/webrtc/api/proxy.h +++ b/webrtc/api/proxy.h @@ -52,6 +52,7 @@ #define WEBRTC_API_PROXY_H_ #include +#include #include "webrtc/base/event.h" #include "webrtc/base/thread.h" @@ -349,6 +350,7 @@ class MethodCall5 : public rtc::Message, T5 a5_; }; + // Helper macros to reduce code duplication. #define PROXY_MAP_BOILERPLATE(c) \ template \ @@ -363,6 +365,9 @@ class MethodCall5 : public rtc::Message, const INTERNAL_CLASS* internal() const { return c_.get(); } \ INTERNAL_CLASS* internal() { return c_.get(); } +#define END_PROXY_MAP() \ + }; + #define SIGNALING_PROXY_MAP_BOILERPLATE(c) \ protected: \ c##ProxyWithInternal(rtc::Thread* signaling_thread, INTERNAL_CLASS* c) \ @@ -448,13 +453,13 @@ class MethodCall5 : public rtc::Message, private: \ rtc::Thread* destructor_thread() const { return signaling_thread_; } \ \ - public: + public: // NOLINTNEXTLINE #define PROXY_WORKER_THREAD_DESTRUCTOR() \ private: \ rtc::Thread* destructor_thread() const { return worker_thread_; } \ \ - public: + public: // NOLINTNEXTLINE #define PROXY_METHOD0(r, method) \ r method() override { \ @@ -549,10 +554,6 @@ class MethodCall5 : public rtc::Message, return call.Marshal(RTC_FROM_HERE, worker_thread_); \ } -#define END_PROXY_MAP() \ - } \ - ; - } // namespace webrtc #endif // WEBRTC_API_PROXY_H_ diff --git a/webrtc/api/stats/rtcstats_objects.h b/webrtc/api/stats/rtcstats_objects.h index c5277e7bc0..ac00386370 100644 --- a/webrtc/api/stats/rtcstats_objects.h +++ b/webrtc/api/stats/rtcstats_objects.h @@ -12,6 +12,7 @@ #define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ #include +#include #include "webrtc/api/stats/rtcstats.h" diff --git a/webrtc/api/statstypes.h b/webrtc/api/statstypes.h index 8f90c88686..40d26ab284 100644 --- a/webrtc/api/statstypes.h +++ b/webrtc/api/statstypes.h @@ -18,6 +18,7 @@ #include #include #include +#include #include "webrtc/base/basictypes.h" #include "webrtc/base/constructormagic.h" @@ -234,7 +235,7 @@ class StatsReport { // Protected since users of the IdBase type will be using the Id typedef. virtual bool Equals(const IdBase& other) const; - IdBase(StatsType type); // Only meant for derived classes. + explicit IdBase(StatsType type); // Only meant for derived classes. const StatsType type_; static const char kSeparator = '_'; diff --git a/webrtc/api/umametrics.h b/webrtc/api/umametrics.h index 3e92bace12..89994476a9 100644 --- a/webrtc/api/umametrics.h +++ b/webrtc/api/umametrics.h @@ -113,7 +113,6 @@ enum IceCandidatePairType { class MetricsObserverInterface : public rtc::RefCountInterface { public: - // |type| is the type of the enum counter to be incremented. |counter| // is the particular counter in that type. |counter_max| is the next sequence // number after the highest counter.