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/examples/peerconnection/client/main_wnd.h b/examples/peerconnection/client/main_wnd.h
index 8edf81f..5700258 100644
--- a/examples/peerconnection/client/main_wnd.h
+++ b/examples/peerconnection/client/main_wnd.h
@@ -32,6 +32,7 @@
virtual void DisconnectFromCurrentPeer() = 0;
virtual void UIThreadCallback(int msg_id, void* data) = 0;
virtual void Close() = 0;
+
protected:
virtual ~MainWndCallback() {}
};
@@ -50,7 +51,8 @@
virtual void RegisterObserver(MainWndCallback* callback) = 0;
virtual bool IsWindow() = 0;
- virtual void MessageBox(const char* caption, const char* text,
+ virtual void MessageBox(const char* caption,
+ const char* text,
bool is_error) = 0;
virtual UI current_ui() = 0;
@@ -90,8 +92,7 @@
virtual void SwitchToConnectUI();
virtual void SwitchToPeerList(const Peers& peers);
virtual void SwitchToStreamingUI();
- virtual void MessageBox(const char* caption, const char* text,
- bool is_error);
+ virtual void MessageBox(const char* caption, const char* text, bool is_error);
virtual UI current_ui() { return ui_; }
virtual void StartLocalRenderer(webrtc::VideoTrackInterface* local_video);
@@ -105,17 +106,15 @@
class VideoRenderer : public rtc::VideoSinkInterface<webrtc::VideoFrame> {
public:
- VideoRenderer(HWND wnd, int width, int height,
+ VideoRenderer(HWND wnd,
+ int width,
+ int height,
webrtc::VideoTrackInterface* track_to_render);
virtual ~VideoRenderer();
- void Lock() {
- ::EnterCriticalSection(&buffer_lock_);
- }
+ void Lock() { ::EnterCriticalSection(&buffer_lock_); }
- void Unlock() {
- ::LeaveCriticalSection(&buffer_lock_);
- }
+ void Unlock() { ::LeaveCriticalSection(&buffer_lock_); }
// VideoSinkInterface implementation
void OnFrame(const webrtc::VideoFrame& frame) override;
@@ -145,6 +144,7 @@
public:
explicit AutoLock(T* obj) : obj_(obj) { obj_->Lock(); }
~AutoLock() { obj_->Unlock(); }
+
protected:
T* obj_;
};
@@ -168,8 +168,11 @@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
static bool RegisterWindowClass();
- void CreateChildWindow(HWND* wnd, ChildWindowID id, const wchar_t* class_name,
- DWORD control_style, DWORD ex_style);
+ void CreateChildWindow(HWND* wnd,
+ ChildWindowID id,
+ const wchar_t* class_name,
+ DWORD control_style,
+ DWORD ex_style);
void CreateChildWindows();
void LayoutConnectUI(bool show);