Stop using 'using namespace'.
This CL removes all the instances of 'using namespace' from C++ code
(more info https://abseil.io/tips/153).
Bug: webrtc:9855
Change-Id: Ic940fe87c5047742cfa6d60857d2f97be380ed18
Reviewed-on: https://webrtc-review.googlesource.com/c/113948
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25985}
diff --git a/rtc_base/testutils.h b/rtc_base/testutils.h
index 5a2a3bd..7ec0c12 100644
--- a/rtc_base/testutils.h
+++ b/rtc_base/testutils.h
@@ -23,8 +23,6 @@
namespace webrtc {
namespace testing {
-using namespace rtc;
-
///////////////////////////////////////////////////////////////////////////////
// StreamSink - Monitor asynchronously signalled events from StreamInterface
// or AsyncSocket (which should probably be a StreamInterface.
@@ -34,10 +32,10 @@
// event.
enum StreamSinkEvent {
- SSE_OPEN = SE_OPEN,
- SSE_READ = SE_READ,
- SSE_WRITE = SE_WRITE,
- SSE_CLOSE = SE_CLOSE,
+ SSE_OPEN = rtc::SE_OPEN,
+ SSE_READ = rtc::SE_READ,
+ SSE_WRITE = rtc::SE_WRITE,
+ SSE_CLOSE = rtc::SE_CLOSE,
SSE_ERROR = 16
};
@@ -46,25 +44,25 @@
StreamSink();
~StreamSink() override;
- void Monitor(StreamInterface* stream) {
+ void Monitor(rtc::StreamInterface* stream) {
stream->SignalEvent.connect(this, &StreamSink::OnEvent);
events_.erase(stream);
}
- void Unmonitor(StreamInterface* stream) {
+ void Unmonitor(rtc::StreamInterface* stream) {
stream->SignalEvent.disconnect(this);
// In case you forgot to unmonitor a previous object with this address
events_.erase(stream);
}
- bool Check(StreamInterface* stream,
+ bool Check(rtc::StreamInterface* stream,
StreamSinkEvent event,
bool reset = true) {
return DoCheck(stream, event, reset);
}
- int Events(StreamInterface* stream, bool reset = true) {
+ int Events(rtc::StreamInterface* stream, bool reset = true) {
return DoEvents(stream, reset);
}
- void Monitor(AsyncSocket* socket) {
+ void Monitor(rtc::AsyncSocket* socket) {
socket->SignalConnectEvent.connect(this, &StreamSink::OnConnectEvent);
socket->SignalReadEvent.connect(this, &StreamSink::OnReadEvent);
socket->SignalWriteEvent.connect(this, &StreamSink::OnWriteEvent);
@@ -72,33 +70,35 @@
// In case you forgot to unmonitor a previous object with this address
events_.erase(socket);
}
- void Unmonitor(AsyncSocket* socket) {
+ void Unmonitor(rtc::AsyncSocket* socket) {
socket->SignalConnectEvent.disconnect(this);
socket->SignalReadEvent.disconnect(this);
socket->SignalWriteEvent.disconnect(this);
socket->SignalCloseEvent.disconnect(this);
events_.erase(socket);
}
- bool Check(AsyncSocket* socket, StreamSinkEvent event, bool reset = true) {
+ bool Check(rtc::AsyncSocket* socket,
+ StreamSinkEvent event,
+ bool reset = true) {
return DoCheck(socket, event, reset);
}
- int Events(AsyncSocket* socket, bool reset = true) {
+ int Events(rtc::AsyncSocket* socket, bool reset = true) {
return DoEvents(socket, reset);
}
private:
typedef std::map<void*, int> EventMap;
- void OnEvent(StreamInterface* stream, int events, int error) {
+ void OnEvent(rtc::StreamInterface* stream, int events, int error) {
if (error) {
events = SSE_ERROR;
}
AddEvents(stream, events);
}
- void OnConnectEvent(AsyncSocket* socket) { AddEvents(socket, SSE_OPEN); }
- void OnReadEvent(AsyncSocket* socket) { AddEvents(socket, SSE_READ); }
- void OnWriteEvent(AsyncSocket* socket) { AddEvents(socket, SSE_WRITE); }
- void OnCloseEvent(AsyncSocket* socket, int error) {
+ void OnConnectEvent(rtc::AsyncSocket* socket) { AddEvents(socket, SSE_OPEN); }
+ void OnReadEvent(rtc::AsyncSocket* socket) { AddEvents(socket, SSE_READ); }
+ void OnWriteEvent(rtc::AsyncSocket* socket) { AddEvents(socket, SSE_WRITE); }
+ void OnCloseEvent(rtc::AsyncSocket* socket, int error) {
AddEvents(socket, (0 == error) ? SSE_CLOSE : SSE_ERROR);
}