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

Unified Diff: webrtc/p2p/client/basicportallocator.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/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 629218f89a3e1baee6c81a5e0dbce7820218d564..cfad46682b338f6ed2a5ff7b964b16a5bbd0082e 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -114,7 +114,7 @@ BasicPortAllocator::BasicPortAllocator(rtc::NetworkManager* network_manager,
rtc::PacketSocketFactory* socket_factory,
const ServerAddresses& stun_servers)
: network_manager_(network_manager), socket_factory_(socket_factory) {
- RTC_DCHECK(socket_factory_ != NULL);
+ RTC_DCHECK(socket_factory_ != nullptr);
SetConfiguration(stun_servers, std::vector<RelayServerConfig>(), 0, false);
Construct();
}
@@ -125,7 +125,7 @@ BasicPortAllocator::BasicPortAllocator(
const rtc::SocketAddress& relay_address_udp,
const rtc::SocketAddress& relay_address_tcp,
const rtc::SocketAddress& relay_address_ssl)
- : network_manager_(network_manager), socket_factory_(NULL) {
+ : network_manager_(network_manager), socket_factory_(nullptr) {
std::vector<RelayServerConfig> turn_servers;
RelayServerConfig config(RELAY_GTURN);
if (!relay_address_udp.IsNil()) {
@@ -201,7 +201,7 @@ BasicPortAllocatorSession::BasicPortAllocatorSession(
ice_pwd,
allocator->flags()),
allocator_(allocator),
- network_thread_(NULL),
+ network_thread_(nullptr),
socket_factory_(allocator->socket_factory()),
allocation_started_(false),
network_manager_started_(false),
@@ -214,7 +214,7 @@ BasicPortAllocatorSession::BasicPortAllocatorSession(
BasicPortAllocatorSession::~BasicPortAllocatorSession() {
allocator_->network_manager()->StopUpdating();
- if (network_thread_ != NULL)
+ if (network_thread_ != nullptr)
network_thread_->Clear(this);
for (uint32_t i = 0; i < sequences_.size(); ++i) {
@@ -721,7 +721,7 @@ void BasicPortAllocatorSession::OnCandidateReady(
Port* port, const Candidate& c) {
RTC_DCHECK(rtc::Thread::Current() == network_thread_);
PortData* data = FindPort(port);
- RTC_DCHECK(data != NULL);
+ RTC_DCHECK(data != nullptr);
LOG_J(LS_INFO, port) << "Gathered candidate: " << c.ToSensitiveString();
// Discarding any candidate signal if port allocation status is
// already done with gathering.
@@ -833,7 +833,7 @@ void BasicPortAllocatorSession::OnPortComplete(Port* port) {
RTC_DCHECK(rtc::Thread::Current() == network_thread_);
LOG_J(LS_INFO, port) << "Port completed gathering candidates.";
PortData* data = FindPort(port);
- RTC_DCHECK(data != NULL);
+ RTC_DCHECK(data != nullptr);
// Ignore any late signals.
if (!data->inprogress()) {
@@ -850,7 +850,7 @@ void BasicPortAllocatorSession::OnPortError(Port* port) {
RTC_DCHECK(rtc::Thread::Current() == network_thread_);
LOG_J(LS_INFO, port) << "Port encountered error while gathering candidates.";
PortData* data = FindPort(port);
- RTC_DCHECK(data != NULL);
+ RTC_DCHECK(data != nullptr);
// We might have already given up on this port and stopped it.
if (!data->inprogress()) {
return;
@@ -985,7 +985,7 @@ BasicPortAllocatorSession::PortData* BasicPortAllocatorSession::FindPort(
return &*it;
}
}
- return NULL;
+ return nullptr;
}
std::vector<BasicPortAllocatorSession::PortData*>
@@ -1039,9 +1039,8 @@ AllocationSequence::AllocationSequence(BasicPortAllocatorSession* session,
state_(kInit),
flags_(flags),
udp_socket_(),
- udp_port_(NULL),
- phase_(0) {
-}
+ udp_port_(nullptr),
+ phase_(0) {}
void AllocationSequence::Init() {
if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET)) {
@@ -1052,13 +1051,13 @@ void AllocationSequence::Init() {
udp_socket_->SignalReadPacket.connect(
this, &AllocationSequence::OnReadPacket);
}
- // Continuing if |udp_socket_| is NULL, as local TCP and RelayPort using TCP
+ // Continuing if |udp_socket_| is null, as local TCP and RelayPort using TCP
// are next available options to setup a communication channel.
}
}
void AllocationSequence::Clear() {
- udp_port_ = NULL;
+ udp_port_ = nullptr;
turn_ports_.clear();
}
@@ -1195,7 +1194,7 @@ void AllocationSequence::CreateUDPPorts() {
// TODO(mallinath) - Remove UDPPort creating socket after shared socket
// is enabled completely.
- UDPPort* port = NULL;
+ UDPPort* port = nullptr;
bool emit_local_candidate_for_anyaddress =
!IsFlagSet(PORTALLOCATOR_DISABLE_DEFAULT_LOCAL_CANDIDATE);
if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET) && udp_socket_) {
@@ -1344,7 +1343,7 @@ void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) {
PortList::const_iterator relay_port;
for (relay_port = config.ports.begin();
relay_port != config.ports.end(); ++relay_port) {
- TurnPort* port = NULL;
+ TurnPort* port = nullptr;
// Skip UDP connections to relay servers if it's disallowed.
if (IsFlagSet(PORTALLOCATOR_DISABLE_UDP_RELAY) &&
@@ -1392,7 +1391,7 @@ void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) {
*relay_port, config.credentials, config.priority,
session_->allocator()->origin());
}
- RTC_DCHECK(port != NULL);
+ RTC_DCHECK(port != nullptr);
port->SetTlsCertPolicy(config.tls_cert_policy);
session_->AddAllocatedPort(port, this, true);
}
@@ -1438,7 +1437,7 @@ void AllocationSequence::OnReadPacket(
void AllocationSequence::OnPortDestroyed(PortInterface* port) {
if (udp_port_ == port) {
- udp_port_ = NULL;
+ udp_port_ = nullptr;
return;
}

Powered by Google App Engine
This is Rietveld 408576698