Stop using some scoped_ptr features that unique_ptr doesn't have

No operator== that accepts one unique_ptr<T> and one T*. No implicit
conversion to bool. No rtc_make_scoped_ptr function.

BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1803833002

Cr-Commit-Position: refs/heads/master@{#12048}
This commit is contained in:
kwiberg 2016-03-17 22:54:44 -07:00 committed by Commit bot
parent 15622c0aaf
commit 1d50ee44fd
5 changed files with 6 additions and 8 deletions

View File

@ -37,7 +37,6 @@ AsyncUDPSocket* AsyncUDPSocket::Create(SocketFactory* factory,
AsyncUDPSocket::AsyncUDPSocket(AsyncSocket* socket)
: socket_(socket) {
ASSERT(socket_);
size_ = BUF_SIZE;
buf_ = new char[size_];

View File

@ -268,7 +268,6 @@ void HttpListenServer::StopListening() {
void HttpListenServer::OnReadEvent(AsyncSocket* socket) {
ASSERT(socket == listener_.get());
ASSERT(listener_);
AsyncSocket* incoming = listener_->Accept(NULL);
if (incoming) {
StreamInterface* stream = new SocketStream(incoming);

View File

@ -65,7 +65,7 @@ class Logger {
void Foo() { Log("Foo()"); }
void Foo() const { Log("Foo() const"); }
static rtc::scoped_ptr<std::vector<std::string>> Setup() {
auto s = rtc_make_scoped_ptr(new std::vector<std::string>);
rtc::scoped_ptr<std::vector<std::string>> s(new std::vector<std::string>);
g_log = s.get();
g_next_id = 0;
return s;

View File

@ -234,7 +234,7 @@ bool DtlsTransportChannelWrapper::SetRemoteFingerprint(
remote_fingerprint_value_ = std::move(remote_fingerprint_value);
remote_fingerprint_algorithm_ = digest_alg;
bool reconnect = dtls_;
bool reconnect = (dtls_ != nullptr);
if (!SetupDtls()) {
set_dtls_state(DTLS_TRANSPORT_FAILED);

View File

@ -382,7 +382,7 @@ void TCPConnection::OnConnectionRequestResponse(ConnectionRequest* req,
}
void TCPConnection::OnConnect(rtc::AsyncPacketSocket* socket) {
ASSERT(socket == socket_);
ASSERT(socket == socket_.get());
// Do not use this connection if the socket bound to a different address than
// the one we asked for. This is seen in Chrome, where TCP sockets cannot be
// given a binding address, and the platform is expected to pick the
@ -412,7 +412,7 @@ void TCPConnection::OnConnect(rtc::AsyncPacketSocket* socket) {
}
void TCPConnection::OnClose(rtc::AsyncPacketSocket* socket, int error) {
ASSERT(socket == socket_);
ASSERT(socket == socket_.get());
LOG_J(LS_INFO, this) << "Connection closed with error " << error;
// Guard against the condition where IPC socket will call OnClose for every
@ -471,12 +471,12 @@ void TCPConnection::OnReadPacket(
rtc::AsyncPacketSocket* socket, const char* data, size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) {
ASSERT(socket == socket_);
ASSERT(socket == socket_.get());
Connection::OnReadPacket(data, size, packet_time);
}
void TCPConnection::OnReadyToSend(rtc::AsyncPacketSocket* socket) {
ASSERT(socket == socket_);
ASSERT(socket == socket_.get());
Connection::OnReadyToSend();
}