Reformat the WebRTC code base
Running clang-format with chromium's style guide.
The goal is n-fold:
* providing consistency and readability (that's what code guidelines are for)
* preventing noise with presubmit checks and git cl format
* building on the previous point: making it easier to automatically fix format issues
* you name it
Please consider using git-hyper-blame to ignore this commit.
Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
diff --git a/rtc_base/sigslot_unittest.cc b/rtc_base/sigslot_unittest.cc
index 234bf45..114a59f 100644
--- a/rtc_base/sigslot_unittest.cc
+++ b/rtc_base/sigslot_unittest.cc
@@ -28,33 +28,32 @@
sigslot::signal0<> signal_;
};
-template<class slot_policy = sigslot::single_threaded,
- class signal_policy = sigslot::single_threaded>
+template <class slot_policy = sigslot::single_threaded,
+ class signal_policy = sigslot::single_threaded>
class SigslotReceiver : public sigslot::has_slots<slot_policy> {
public:
SigslotReceiver() : signal_(nullptr), signal_count_(0) {}
- ~SigslotReceiver() {
- }
+ ~SigslotReceiver() {}
// Provide copy constructor so that tests can exercise the has_slots copy
// constructor.
SigslotReceiver(const SigslotReceiver&) = default;
void Connect(sigslot::signal0<signal_policy>* signal) {
- if (!signal) return;
+ if (!signal)
+ return;
Disconnect();
signal_ = signal;
signal->connect(this,
&SigslotReceiver<slot_policy, signal_policy>::OnSignal);
}
void Disconnect() {
- if (!signal_) return;
+ if (!signal_)
+ return;
signal_->disconnect(this);
signal_ = nullptr;
}
- void OnSignal() {
- ++signal_count_;
- }
+ void OnSignal() { ++signal_count_; }
int signal_count() { return signal_count_; }
private:
@@ -62,8 +61,8 @@
int signal_count_;
};
-template<class slot_policy = sigslot::single_threaded,
- class mt_signal_policy = sigslot::multi_threaded_local>
+template <class slot_policy = sigslot::single_threaded,
+ class mt_signal_policy = sigslot::multi_threaded_local>
class SigslotSlotTest : public testing::Test {
protected:
SigslotSlotTest() {
@@ -71,12 +70,8 @@
TemplateIsMT(&mt_policy);
}
- virtual void SetUp() {
- Connect();
- }
- virtual void TearDown() {
- Disconnect();
- }
+ virtual void SetUp() { Connect(); }
+ virtual void TearDown() { Disconnect(); }
void Disconnect() {
st_receiver_.Disconnect();
@@ -99,12 +94,12 @@
typedef SigslotSlotTest<> SigslotSTSlotTest;
typedef SigslotSlotTest<sigslot::multi_threaded_local,
- sigslot::multi_threaded_local> SigslotMTSlotTest;
+ sigslot::multi_threaded_local>
+ SigslotMTSlotTest;
class multi_threaded_local_fake : public sigslot::multi_threaded_local {
public:
- multi_threaded_local_fake() : lock_count_(0), unlock_count_(0) {
- }
+ multi_threaded_local_fake() : lock_count_(0), unlock_count_(0) {}
void lock() { ++lock_count_; }
void unlock() { ++unlock_count_; }
@@ -118,8 +113,8 @@
int unlock_count_;
};
-typedef SigslotSlotTest<multi_threaded_local_fake,
- multi_threaded_local_fake> SigslotMTLockBase;
+typedef SigslotSlotTest<multi_threaded_local_fake, multi_threaded_local_fake>
+ SigslotMTLockBase;
class SigslotMTLockTest : public SigslotMTLockBase {
protected:
@@ -329,9 +324,7 @@
}
private:
- void Disconnect() {
- signal_->disconnect_all();
- }
+ void Disconnect() { signal_->disconnect_all(); }
sigslot::signal<>* signal_;
};