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

Unified Diff: webrtc/pc/mediasession.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/pc/mediasession.cc
diff --git a/webrtc/pc/mediasession.cc b/webrtc/pc/mediasession.cc
index c596951f93afac61ab3e33c15ee008aa01197ee9..2fd8d2ed19c827ea9516aa4cb68606c5e4c2eea2 100644
--- a/webrtc/pc/mediasession.cc
+++ b/webrtc/pc/mediasession.cc
@@ -163,7 +163,7 @@ bool CreateMediaCryptos(const std::vector<std::string>& crypto_suites,
const CryptoParamsVec* GetCryptos(const MediaContentDescription* media) {
if (!media) {
- return NULL;
+ return nullptr;
}
return &media->cryptos();
}
@@ -578,7 +578,7 @@ static bool GetCryptosByName(const SessionDescription* sdesc,
// Returns true if the |crypto|'s cipher_suite is not found in |filter|.
static bool CryptoNotFound(const CryptoParams crypto,
const CryptoParamsVec* filter) {
- if (filter == NULL) {
+ if (filter == nullptr) {
return true;
}
for (CryptoParamsVec::const_iterator it = filter->begin();
@@ -947,7 +947,7 @@ static bool FindByUri(const RtpHeaderExtensions& extensions,
it != extensions.end(); ++it) {
// We assume that all URIs are given in a canonical format.
if (it->uri == ext_to_match.uri) {
- if (found_extension != NULL) {
+ if (found_extension != nullptr) {
*found_extension = *it;
}
return true;
@@ -982,7 +982,7 @@ static void FindRtpHdrExtsToOffer(
RtpHeaderExtensions* all_extensions,
UsedRtpHeaderExtensionIds* used_ids) {
for (auto reference_extension : reference_extensions) {
- if (!FindByUri(*offered_extensions, reference_extension, NULL)) {
+ if (!FindByUri(*offered_extensions, reference_extension, nullptr)) {
webrtc::RtpExtension existing;
if (FindByUri(*all_extensions, reference_extension, &existing)) {
offered_extensions->push_back(existing);
@@ -1163,7 +1163,7 @@ static void SetMediaProtocol(bool secure_transport,
static const TransportDescription* GetTransportDescription(
const std::string& content_name,
const SessionDescription* current_description) {
- const TransportDescription* desc = NULL;
+ const TransportDescription* desc = nullptr;
if (current_description) {
const TransportInfo* info =
current_description->GetTransportInfoByName(content_name);
@@ -1358,14 +1358,14 @@ SessionDescription* MediaSessionDescriptionFactory::CreateOffer(
if (!AddAudioContentForOffer(options, current_description,
audio_rtp_extensions, audio_codecs,
&current_streams, offer.get())) {
- return NULL;
+ return nullptr;
}
audio_added = true;
} else if (IsMediaContentOfType(&*it, MEDIA_TYPE_VIDEO)) {
if (!AddVideoContentForOffer(options, current_description,
video_rtp_extensions, video_codecs,
&current_streams, offer.get())) {
- return NULL;
+ return nullptr;
}
video_added = true;
} else if (IsMediaContentOfType(&*it, MEDIA_TYPE_DATA)) {
@@ -1377,7 +1377,7 @@ SessionDescription* MediaSessionDescriptionFactory::CreateOffer(
if (!AddDataContentForOffer(options_copy, current_description,
&data_codecs, &current_streams,
offer.get())) {
- return NULL;
+ return nullptr;
}
data_added = true;
} else {
@@ -1391,18 +1391,18 @@ SessionDescription* MediaSessionDescriptionFactory::CreateOffer(
!AddAudioContentForOffer(options, current_description,
audio_rtp_extensions, audio_codecs,
&current_streams, offer.get())) {
- return NULL;
+ return nullptr;
}
if (!video_added && options.has_video() &&
!AddVideoContentForOffer(options, current_description,
video_rtp_extensions, video_codecs,
&current_streams, offer.get())) {
- return NULL;
+ return nullptr;
}
if (!data_added && options.has_data() &&
!AddDataContentForOffer(options, current_description, &data_codecs,
&current_streams, offer.get())) {
- return NULL;
+ return nullptr;
}
// Bundle the contents together, if we've been asked to do so, and update any
@@ -1416,11 +1416,11 @@ SessionDescription* MediaSessionDescriptionFactory::CreateOffer(
offer->AddGroup(offer_bundle);
if (!UpdateTransportInfoForBundle(offer_bundle, offer.get())) {
LOG(LS_ERROR) << "CreateOffer failed to UpdateTransportInfoForBundle.";
- return NULL;
+ return nullptr;
}
if (!UpdateCryptoParamsForBundle(offer_bundle, offer.get())) {
LOG(LS_ERROR) << "CreateOffer failed to UpdateCryptoParamsForBundle.";
- return NULL;
+ return nullptr;
}
}
@@ -1444,18 +1444,18 @@ SessionDescription* MediaSessionDescriptionFactory::CreateAnswer(
if (IsMediaContentOfType(&*it, MEDIA_TYPE_AUDIO)) {
if (!AddAudioContentForAnswer(offer, options, current_description,
&current_streams, answer.get())) {
- return NULL;
+ return nullptr;
}
} else if (IsMediaContentOfType(&*it, MEDIA_TYPE_VIDEO)) {
if (!AddVideoContentForAnswer(offer, options, current_description,
&current_streams, answer.get())) {
- return NULL;
+ return nullptr;
}
} else {
RTC_DCHECK(IsMediaContentOfType(&*it, MEDIA_TYPE_DATA));
if (!AddDataContentForAnswer(offer, options, current_description,
&current_streams, answer.get())) {
- return NULL;
+ return nullptr;
}
}
}
@@ -1479,12 +1479,12 @@ SessionDescription* MediaSessionDescriptionFactory::CreateAnswer(
// as BUNDLE requires.
if (!UpdateTransportInfoForBundle(answer_bundle, answer.get())) {
LOG(LS_ERROR) << "CreateAnswer failed to UpdateTransportInfoForBundle.";
- return NULL;
+ return nullptr;
}
if (!UpdateCryptoParamsForBundle(answer_bundle, answer.get())) {
LOG(LS_ERROR) << "CreateAnswer failed to UpdateCryptoParamsForBundle.";
- return NULL;
+ return nullptr;
}
}
}
@@ -1621,8 +1621,9 @@ bool MediaSessionDescriptionFactory::AddTransportOffer(
GetTransportDescription(content_name, current_desc);
std::unique_ptr<TransportDescription> new_tdesc(
transport_desc_factory_->CreateOffer(transport_options, current_tdesc));
- bool ret = (new_tdesc.get() != NULL &&
- offer_desc->AddTransportInfo(TransportInfo(content_name, *new_tdesc)));
+ bool ret =
+ (new_tdesc.get() != nullptr &&
+ offer_desc->AddTransportInfo(TransportInfo(content_name, *new_tdesc)));
if (!ret) {
LOG(LS_ERROR)
<< "Failed to AddTransportOffer, content name=" << content_name;
@@ -1636,7 +1637,7 @@ TransportDescription* MediaSessionDescriptionFactory::CreateTransportAnswer(
const TransportOptions& transport_options,
const SessionDescription* current_desc) const {
if (!transport_desc_factory_)
- return NULL;
+ return nullptr;
const TransportDescription* offer_tdesc =
GetTransportDescription(content_name, offer_desc);
const TransportDescription* current_tdesc =
@@ -2080,7 +2081,8 @@ const ContentInfo* GetFirstDataContent(const SessionDescription* sdesc) {
const MediaContentDescription* GetFirstMediaContentDescription(
const SessionDescription* sdesc, MediaType media_type) {
const ContentInfo* content = GetFirstMediaContent(sdesc, media_type);
- const ContentDescription* description = content ? content->description : NULL;
+ const ContentDescription* description =
+ content ? content->description : nullptr;
return static_cast<const MediaContentDescription*>(description);
}
@@ -2153,7 +2155,7 @@ MediaContentDescription* GetFirstMediaContentDescription(
SessionDescription* sdesc,
MediaType media_type) {
ContentInfo* content = GetFirstMediaContent(sdesc, media_type);
- ContentDescription* description = content ? content->description : NULL;
+ ContentDescription* description = content ? content->description : nullptr;
return static_cast<MediaContentDescription*>(description);
}

Powered by Google App Engine
This is Rietveld 408576698