Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: webrtc/base/sslsocketfactory.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/base/sslsocketfactory.cc
diff --git a/webrtc/base/sslsocketfactory.cc b/webrtc/base/sslsocketfactory.cc
index 01d7d8145720e6da37d042276af849ae56b41f40..2e585f60367ea085dabe1e93c86544d03d66411b 100644
--- a/webrtc/base/sslsocketfactory.cc
+++ b/webrtc/base/sslsocketfactory.cc
@@ -30,16 +30,18 @@ namespace rtc {
class ProxySocketAdapter : public AsyncSocketAdapter {
public:
ProxySocketAdapter(SslSocketFactory* factory, int family, int type)
- : AsyncSocketAdapter(NULL), factory_(factory), family_(family),
- type_(type), detect_(NULL) {
- }
+ : AsyncSocketAdapter(nullptr),
+ factory_(factory),
+ family_(family),
+ type_(type),
+ detect_(nullptr) {}
~ProxySocketAdapter() override {
Close();
}
int Connect(const SocketAddress& addr) override {
- RTC_DCHECK(NULL == detect_);
- RTC_DCHECK(NULL == socket_);
+ RTC_DCHECK(nullptr == detect_);
+ RTC_DCHECK(nullptr == socket_);
remote_ = addr;
if (remote_.IsAnyIP() && remote_.hostname().empty()) {
LOG_F(LS_ERROR) << "Empty address";
@@ -65,7 +67,7 @@ class ProxySocketAdapter : public AsyncSocketAdapter {
}
if (detect_) {
detect_->Destroy(false);
- detect_ = NULL;
+ detect_ = nullptr;
}
return 0;
}
@@ -82,7 +84,7 @@ private:
RTC_DCHECK(detect_ == thread);
Attach(factory_->CreateProxySocket(detect_->proxy(), family_, type_));
detect_->Release();
- detect_ = NULL;
+ detect_ = nullptr;
if (0 == AsyncSocketAdapter::Connect(remote_)) {
SignalConnectEvent(this);
} else if (!IsBlockingError(socket_->GetError())) {
@@ -140,7 +142,7 @@ AsyncSocket* SslSocketFactory::CreateProxySocket(const ProxyInfo& proxy,
int type) {
AsyncSocket* socket = factory_->CreateAsyncSocket(family, type);
if (!socket)
- return NULL;
+ return nullptr;
// Binary logging happens at the lowest level
if (!logging_label_.empty() && binary_mode_) {
@@ -163,7 +165,7 @@ AsyncSocket* SslSocketFactory::CreateProxySocket(const ProxyInfo& proxy,
}
if (!proxy_socket) {
delete socket;
- return NULL;
+ return nullptr;
}
socket = proxy_socket; // for our purposes the proxy is now the socket
}
@@ -173,13 +175,13 @@ AsyncSocket* SslSocketFactory::CreateProxySocket(const ProxyInfo& proxy,
if (!ssl_adapter) {
LOG_F(LS_ERROR) << "SSL unavailable";
delete socket;
- return NULL;
+ return nullptr;
}
ssl_adapter->set_ignore_bad_cert(ignore_bad_cert_);
if (ssl_adapter->StartSSL(hostname_.c_str(), true) != 0) {
LOG_F(LS_ERROR) << "SSL failed to start.";
- return NULL;
+ return nullptr;
}
socket = ssl_adapter.release();
}

Powered by Google App Engine
This is Rietveld 408576698