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

Unified Diff: webrtc/examples/peerconnection/client/peer_connection_client.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/examples/peerconnection/client/peer_connection_client.cc
diff --git a/webrtc/examples/peerconnection/client/peer_connection_client.cc b/webrtc/examples/peerconnection/client/peer_connection_client.cc
index ab9cd328ba559f21c998661d541c83ae790669f1..651d2a4803c9e159d6243c506b01fe6c2c778356 100644
--- a/webrtc/examples/peerconnection/client/peer_connection_client.cc
+++ b/webrtc/examples/peerconnection/client/peer_connection_client.cc
@@ -36,7 +36,7 @@ rtc::AsyncSocket* CreateClientSocket(int family) {
return sock;
#elif defined(WEBRTC_POSIX)
rtc::Thread* thread = rtc::Thread::Current();
- RTC_DCHECK(thread != NULL);
+ RTC_DCHECK(thread != nullptr);
return thread->socketserver()->CreateAsyncSocket(family, SOCK_STREAM);
#else
#error Platform not supported.
@@ -46,18 +46,17 @@ rtc::AsyncSocket* CreateClientSocket(int family) {
} // namespace
PeerConnectionClient::PeerConnectionClient()
- : callback_(NULL),
- resolver_(NULL),
- state_(NOT_CONNECTED),
- my_id_(-1) {
-}
+ : callback_(nullptr),
+ resolver_(nullptr),
+ state_(NOT_CONNECTED),
+ my_id_(-1) {}
PeerConnectionClient::~PeerConnectionClient() {
}
void PeerConnectionClient::InitSocketSignals() {
- RTC_DCHECK(control_socket_.get() != NULL);
- RTC_DCHECK(hanging_get_.get() != NULL);
+ RTC_DCHECK(control_socket_.get() != nullptr);
+ RTC_DCHECK(hanging_get_.get() != nullptr);
control_socket_->SignalCloseEvent.connect(this,
&PeerConnectionClient::OnClose);
hanging_get_->SignalCloseEvent.connect(this,
@@ -129,7 +128,7 @@ void PeerConnectionClient::OnResolveResult(
if (resolver_->GetError() != 0) {
callback_->OnServerConnectionFailure();
resolver_->Destroy(false);
- resolver_ = NULL;
+ resolver_ = nullptr;
state_ = NOT_CONNECTED;
} else {
server_address_ = resolver_->address();
@@ -216,9 +215,9 @@ void PeerConnectionClient::Close() {
hanging_get_->Close();
onconnect_data_.clear();
peers_.clear();
- if (resolver_ != NULL) {
+ if (resolver_ != nullptr) {
resolver_->Destroy(false);
- resolver_ = NULL;
+ resolver_ = nullptr;
}
my_id_ = -1;
state_ = NOT_CONNECTED;
@@ -264,7 +263,7 @@ bool PeerConnectionClient::GetHeaderValue(const std::string& data,
size_t eoh,
const char* header_pattern,
size_t* value) {
- RTC_DCHECK(value != NULL);
+ RTC_DCHECK(value != nullptr);
size_t found = data.find(header_pattern);
if (found != std::string::npos && found < eoh) {
*value = atoi(&data[found + strlen(header_pattern)]);
@@ -276,7 +275,7 @@ bool PeerConnectionClient::GetHeaderValue(const std::string& data,
bool PeerConnectionClient::GetHeaderValue(const std::string& data, size_t eoh,
const char* header_pattern,
std::string* value) {
- RTC_DCHECK(value != NULL);
+ RTC_DCHECK(value != nullptr);
size_t found = data.find(header_pattern);
if (found != std::string::npos && found < eoh) {
size_t begin = found + strlen(header_pattern);
@@ -425,9 +424,9 @@ bool PeerConnectionClient::ParseEntry(const std::string& entry,
std::string* name,
int* id,
bool* connected) {
- RTC_DCHECK(name != NULL);
- RTC_DCHECK(id != NULL);
- RTC_DCHECK(connected != NULL);
+ RTC_DCHECK(name != nullptr);
+ RTC_DCHECK(id != nullptr);
+ RTC_DCHECK(connected != nullptr);
RTC_DCHECK(!entry.empty());
*connected = false;

Powered by Google App Engine
This is Rietveld 408576698