Enable the clang style plugin in rtc_base/
Enabled the plugin and cleaned up all issues it found. Bug: webrtc:163 Change-Id: Id63f0deb7b335690157ab157c35177b7836688da Reviewed-on: https://webrtc-review.googlesource.com/14660 Commit-Queue: Steve Anton <steveanton@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20401}
This commit is contained in:
@ -30,7 +30,7 @@ namespace rtc {
|
||||
class Win32Socket : public AsyncSocket {
|
||||
public:
|
||||
Win32Socket();
|
||||
virtual ~Win32Socket();
|
||||
~Win32Socket() override;
|
||||
|
||||
bool CreateT(int family, int type);
|
||||
|
||||
@ -38,25 +38,27 @@ class Win32Socket : public AsyncSocket {
|
||||
void SetTimeout(int ms);
|
||||
|
||||
// AsyncSocket Interface
|
||||
virtual SocketAddress GetLocalAddress() const;
|
||||
virtual SocketAddress GetRemoteAddress() const;
|
||||
virtual int Bind(const SocketAddress& addr);
|
||||
virtual int Connect(const SocketAddress& addr);
|
||||
virtual int Send(const void *buffer, size_t length);
|
||||
virtual int SendTo(const void *buffer, size_t length, const SocketAddress& addr);
|
||||
virtual int Recv(void* buffer, size_t length, int64_t* timestamp);
|
||||
virtual int RecvFrom(void* buffer,
|
||||
size_t length,
|
||||
SocketAddress* out_addr,
|
||||
int64_t* timestamp);
|
||||
virtual int Listen(int backlog);
|
||||
virtual Win32Socket *Accept(SocketAddress *out_addr);
|
||||
virtual int Close();
|
||||
virtual int GetError() const;
|
||||
virtual void SetError(int error);
|
||||
virtual ConnState GetState() const;
|
||||
virtual int GetOption(Option opt, int* value);
|
||||
virtual int SetOption(Option opt, int value);
|
||||
SocketAddress GetLocalAddress() const override;
|
||||
SocketAddress GetRemoteAddress() const override;
|
||||
int Bind(const SocketAddress& addr) override;
|
||||
int Connect(const SocketAddress& addr) override;
|
||||
int Send(const void* buffer, size_t length) override;
|
||||
int SendTo(const void* buffer,
|
||||
size_t length,
|
||||
const SocketAddress& addr) override;
|
||||
int Recv(void* buffer, size_t length, int64_t* timestamp) override;
|
||||
int RecvFrom(void* buffer,
|
||||
size_t length,
|
||||
SocketAddress* out_addr,
|
||||
int64_t* timestamp) override;
|
||||
int Listen(int backlog) override;
|
||||
Win32Socket* Accept(SocketAddress* out_addr) override;
|
||||
int Close() override;
|
||||
int GetError() const override;
|
||||
void SetError(int error) override;
|
||||
ConnState GetState() const override;
|
||||
int GetOption(Option opt, int* value) override;
|
||||
int SetOption(Option opt, int value) override;
|
||||
|
||||
private:
|
||||
void CreateSink();
|
||||
@ -93,22 +95,22 @@ class Win32Socket : public AsyncSocket {
|
||||
class Win32SocketServer : public SocketServer {
|
||||
public:
|
||||
Win32SocketServer();
|
||||
virtual ~Win32SocketServer();
|
||||
~Win32SocketServer() override;
|
||||
|
||||
void set_modeless_dialog(HWND hdlg) {
|
||||
hdlg_ = hdlg;
|
||||
}
|
||||
|
||||
// SocketServer Interface
|
||||
virtual Socket* CreateSocket(int type);
|
||||
virtual Socket* CreateSocket(int family, int type);
|
||||
Socket* CreateSocket(int type) override;
|
||||
Socket* CreateSocket(int family, int type) override;
|
||||
|
||||
virtual AsyncSocket* CreateAsyncSocket(int type);
|
||||
virtual AsyncSocket* CreateAsyncSocket(int family, int type);
|
||||
AsyncSocket* CreateAsyncSocket(int type) override;
|
||||
AsyncSocket* CreateAsyncSocket(int family, int type) override;
|
||||
|
||||
virtual void SetMessageQueue(MessageQueue* queue);
|
||||
virtual bool Wait(int cms, bool process_io);
|
||||
virtual void WakeUp();
|
||||
void SetMessageQueue(MessageQueue* queue) override;
|
||||
bool Wait(int cms, bool process_io) override;
|
||||
void WakeUp() override;
|
||||
|
||||
void Pump();
|
||||
|
||||
@ -119,7 +121,7 @@ class Win32SocketServer : public SocketServer {
|
||||
public:
|
||||
explicit MessageWindow(Win32SocketServer* ss) : ss_(ss) {}
|
||||
private:
|
||||
virtual bool OnMessage(UINT msg, WPARAM wp, LPARAM lp, LRESULT& result);
|
||||
bool OnMessage(UINT msg, WPARAM wp, LPARAM lp, LRESULT& result) override;
|
||||
Win32SocketServer* ss_;
|
||||
};
|
||||
|
||||
@ -137,18 +139,12 @@ class Win32SocketServer : public SocketServer {
|
||||
|
||||
class Win32Thread : public Thread {
|
||||
public:
|
||||
explicit Win32Thread(SocketServer* ss) : Thread(ss), id_(0) {}
|
||||
virtual ~Win32Thread() {
|
||||
Stop();
|
||||
}
|
||||
virtual void Run() {
|
||||
id_ = GetCurrentThreadId();
|
||||
Thread::Run();
|
||||
id_ = 0;
|
||||
}
|
||||
virtual void Quit() {
|
||||
PostThreadMessage(id_, WM_QUIT, 0, 0);
|
||||
}
|
||||
explicit Win32Thread(SocketServer* ss);
|
||||
~Win32Thread() override;
|
||||
|
||||
void Run() override;
|
||||
void Quit() override;
|
||||
|
||||
private:
|
||||
DWORD id_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user