Replace NULL with nullptr or null in webrtc/api/.

BUG=webrtc:7147

Review-Url: https://codereview.webrtc.org/2715103002
Cr-Commit-Position: refs/heads/master@{#16880}
This commit is contained in:
deadbeef 2017-02-27 14:47:33 -08:00 committed by Commit bot
parent f265188a5c
commit 8d60a946ae
9 changed files with 19 additions and 16 deletions

View File

@ -68,8 +68,8 @@ class IceCandidateInterface {
};
// Creates a IceCandidateInterface based on SDP string.
// Returns NULL if the sdp string can't be parsed.
// |error| may be NULL.
// Returns null if the sdp string can't be parsed.
// |error| may be null.
IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid,
int sdp_mline_index,
const std::string& sdp,
@ -141,8 +141,8 @@ class SessionDescriptionInterface {
};
// Creates a SessionDescriptionInterface based on the SDP string and the type.
// Returns NULL if the sdp string can't be parsed or the type is unsupported.
// |error| may be NULL.
// Returns null if the sdp string can't be parsed or the type is unsupported.
// |error| may be null.
SessionDescriptionInterface* CreateSessionDescription(const std::string& type,
const std::string& sdp,
SdpParseError* error);

View File

@ -31,7 +31,7 @@ class JsepIceCandidate : public IceCandidateInterface {
JsepIceCandidate(const std::string& sdp_mid, int sdp_mline_index,
const cricket::Candidate& candidate);
~JsepIceCandidate();
// |err| may be NULL.
// |err| may be null.
bool Initialize(const std::string& sdp, SdpParseError* err);
void SetCandidate(const cricket::Candidate& candidate) {
candidate_ = candidate;

View File

@ -35,7 +35,7 @@ class JsepSessionDescription : public SessionDescriptionInterface {
explicit JsepSessionDescription(const std::string& type);
virtual ~JsepSessionDescription();
// |error| may be NULL.
// |error| may be null.
bool Initialize(const std::string& sdp, SdpParseError* error);
// Takes ownership of |description|.

View File

@ -260,7 +260,7 @@ class AudioTrackInterface : public MediaStreamTrackInterface {
// virtual after it's implemented in chromium.
virtual bool GetSignalLevel(int* level) { return false; }
// Get the audio processor used by the audio track. Return NULL if the track
// Get the audio processor used by the audio track. Return null if the track
// does not have any processor.
// TODO(deadbeef): Make the interface pure virtual.
virtual rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor() {

View File

@ -27,7 +27,7 @@ class Notifier : public T {
}
virtual void RegisterObserver(ObserverInterface* observer) {
RTC_DCHECK(observer != NULL);
RTC_DCHECK(observer != nullptr);
observers_.push_back(observer);
}

View File

@ -532,7 +532,7 @@ class PeerConnectionInterface : public rtc::RefCountInterface {
return false;
}
// Returns pointer to a DtmfSender on success. Otherwise returns NULL.
// Returns pointer to a DtmfSender on success. Otherwise returns null.
//
// This API is no longer part of the standard; instead DtmfSenders are
// obtained from RtpSenders. Which is what the implementation does; it finds
@ -922,8 +922,8 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
}
// A video source creator that allows selection of resolution and frame rate.
// |constraints| decides video resolution and frame rate but can be NULL.
// In the NULL case, use the version above.
// |constraints| decides video resolution and frame rate but can be null.
// In the null case, use the version above.
//
// |constraints| is only used for the invocation of this method, and can
// safely be destroyed afterwards.
@ -952,7 +952,7 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
const std::string& label,
VideoTrackSourceInterface* source) = 0;
// Creates an new AudioTrack. At the moment |source| can be NULL.
// Creates an new AudioTrack. At the moment |source| can be null.
virtual rtc::scoped_refptr<AudioTrackInterface>
CreateAudioTrack(const std::string& label,
AudioSourceInterface* source) = 0;

View File

@ -128,7 +128,7 @@ class SynchronousMethodCall
void Invoke(const rtc::Location& posted_from, rtc::Thread* t) {
if (t->IsCurrent()) {
proxy_->OnMessage(NULL);
proxy_->OnMessage(nullptr);
} else {
e_.reset(new rtc::Event(false, false));
t->Post(posted_from, this, 0);
@ -137,7 +137,10 @@ class SynchronousMethodCall
}
private:
void OnMessage(rtc::Message*) { proxy_->OnMessage(NULL); e_->Set(); }
void OnMessage(rtc::Message*) {
proxy_->OnMessage(nullptr);
e_->Set();
}
std::unique_ptr<rtc::Event> e_;
rtc::MessageHandler* proxy_;
};

View File

@ -779,7 +779,7 @@ StatsReport* StatsCollection::ReplaceOrAddNew(const StatsReport::Id& id) {
return InsertNew(id);
}
// Looks for a report with the given |id|. If one is not found, NULL
// Looks for a report with the given |id|. If one is not found, null
// will be returned.
StatsReport* StatsCollection::Find(const StatsReport::Id& id) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());

View File

@ -415,7 +415,7 @@ class StatsCollection {
StatsReport* FindOrAddNew(const StatsReport::Id& id);
StatsReport* ReplaceOrAddNew(const StatsReport::Id& id);
// Looks for a report with the given |id|. If one is not found, NULL
// Looks for a report with the given |id|. If one is not found, null
// will be returned.
StatsReport* Find(const StatsReport::Id& id);