Migrate template alias nullability annotations to macros.
absl::Nonnull -> absl_nonnull, absl::Nullable -> absl_nullable,
and absl::NullabilityUnknown -> absl_nullability_unknown.
The new macros are positioned as a qualifier on the affected type,
similar to const, rather than as a templated type wrapping the affected
type.
Bug: webrtc:407433459
No-Iwyu: No regressions introduced by this CL
Change-Id: Id6b1a58296d52c86db3ae44e90849affc904d335
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/384220
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44301}
diff --git a/api/audio/audio_processing.cc b/api/audio/audio_processing.cc
index 1f866e0..2941001 100644
--- a/api/audio/audio_processing.cc
+++ b/api/audio/audio_processing.cc
@@ -214,21 +214,21 @@
return builder.str();
}
-absl::Nonnull<std::unique_ptr<AudioProcessingBuilderInterface>>
+absl_nonnull std::unique_ptr<AudioProcessingBuilderInterface>
CustomAudioProcessing(
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing) {
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing) {
class Builder : public AudioProcessingBuilderInterface {
public:
- explicit Builder(absl::Nonnull<scoped_refptr<AudioProcessing>> ap)
+ explicit Builder(absl_nonnull scoped_refptr<AudioProcessing> ap)
: ap_(std::move(ap)) {}
- absl::Nullable<scoped_refptr<AudioProcessing>> Build(
+ absl_nullable scoped_refptr<AudioProcessing> Build(
const Environment& /*env*/) override {
return std::move(ap_);
}
private:
- absl::Nonnull<scoped_refptr<AudioProcessing>> ap_;
+ absl_nonnull scoped_refptr<AudioProcessing> ap_;
};
RTC_CHECK(audio_processing);
diff --git a/api/audio/audio_processing.h b/api/audio/audio_processing.h
index 36b956e..f15eec1 100644
--- a/api/audio/audio_processing.h
+++ b/api/audio/audio_processing.h
@@ -633,14 +633,14 @@
// return value of true indicates that the file has been
// sucessfully opened, while a value of false indicates that
// opening the file failed.
- virtual bool CreateAndAttachAecDump(
- absl::string_view file_name,
- int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) = 0;
- virtual bool CreateAndAttachAecDump(
- absl::Nonnull<FILE*> handle,
- int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) = 0;
+ virtual bool CreateAndAttachAecDump(absl::string_view file_name,
+ int64_t max_log_size_bytes,
+ TaskQueueBase* absl_nonnull
+ worker_queue) = 0;
+ virtual bool CreateAndAttachAecDump(FILE* absl_nonnull handle,
+ int64_t max_log_size_bytes,
+ TaskQueueBase* absl_nonnull
+ worker_queue) = 0;
// TODO(webrtc:5298) Deprecated variant.
// Attaches provided webrtc::AecDump for recording debugging
@@ -738,7 +738,7 @@
public:
virtual ~AudioProcessingBuilderInterface() = default;
- virtual absl::Nullable<scoped_refptr<AudioProcessing>> Build(
+ virtual absl_nullable scoped_refptr<AudioProcessing> Build(
const Environment& env) = 0;
};
@@ -747,9 +747,9 @@
// nullptr `audio_processing` is not supported as in some scenarios that imply
// no audio processing, while in others - default builtin audio processing.
// Callers should be explicit which of these two behaviors they want.
-absl::Nonnull<std::unique_ptr<AudioProcessingBuilderInterface>>
+absl_nonnull std::unique_ptr<AudioProcessingBuilderInterface>
CustomAudioProcessing(
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing);
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing);
// Experimental interface for a custom analysis submodule.
class CustomAudioAnalyzer {
diff --git a/api/audio/builtin_audio_processing_builder.cc b/api/audio/builtin_audio_processing_builder.cc
index 293750a..2a7c2c6 100644
--- a/api/audio/builtin_audio_processing_builder.cc
+++ b/api/audio/builtin_audio_processing_builder.cc
@@ -21,7 +21,7 @@
namespace webrtc {
-absl::Nullable<scoped_refptr<AudioProcessing>>
+absl_nullable scoped_refptr<AudioProcessing>
BuiltinAudioProcessingBuilder::Build(const Environment& env) {
return make_ref_counted<AudioProcessingImpl>(
env, config_, std::move(capture_post_processing_),
diff --git a/api/audio/builtin_audio_processing_builder.h b/api/audio/builtin_audio_processing_builder.h
index d7d606c..962a68c 100644
--- a/api/audio/builtin_audio_processing_builder.h
+++ b/api/audio/builtin_audio_processing_builder.h
@@ -79,7 +79,7 @@
// Creates an APM instance with the specified config or the default one if
// unspecified. Injects the specified components transferring the ownership
// to the newly created APM instance.
- absl::Nullable<scoped_refptr<AudioProcessing>> Build(
+ absl_nullable scoped_refptr<AudioProcessing> Build(
const Environment& env) override;
private:
diff --git a/api/audio/echo_canceller3_factory.cc b/api/audio/echo_canceller3_factory.cc
index ca463c0..e513a29 100644
--- a/api/audio/echo_canceller3_factory.cc
+++ b/api/audio/echo_canceller3_factory.cc
@@ -25,7 +25,7 @@
EchoCanceller3Factory::EchoCanceller3Factory(const EchoCanceller3Config& config)
: config_(config) {}
-absl::Nonnull<std::unique_ptr<EchoControl>> EchoCanceller3Factory::Create(
+absl_nonnull std::unique_ptr<EchoControl> EchoCanceller3Factory::Create(
const Environment& env,
int sample_rate_hz,
int num_render_channels,
diff --git a/api/audio/echo_canceller3_factory.h b/api/audio/echo_canceller3_factory.h
index 1c27d40..289b16a 100644
--- a/api/audio/echo_canceller3_factory.h
+++ b/api/audio/echo_canceller3_factory.h
@@ -31,7 +31,7 @@
explicit EchoCanceller3Factory(const EchoCanceller3Config& config);
// Creates an EchoCanceller3 with a specified channel count and sampling rate.
- absl::Nonnull<std::unique_ptr<EchoControl>> Create(
+ absl_nonnull std::unique_ptr<EchoControl> Create(
const Environment& env,
int sample_rate_hz,
int num_render_channels,
diff --git a/api/audio/echo_control.h b/api/audio/echo_control.h
index 3874d2b..d1a1faa 100644
--- a/api/audio/echo_control.h
+++ b/api/audio/echo_control.h
@@ -67,7 +67,7 @@
public:
virtual ~EchoControlFactory() = default;
- virtual absl::Nonnull<std::unique_ptr<EchoControl>> Create(
+ virtual absl_nonnull std::unique_ptr<EchoControl> Create(
const Environment& env,
int sample_rate_hz,
int num_render_channels,
diff --git a/api/audio_codecs/audio_decoder_factory.h b/api/audio_codecs/audio_decoder_factory.h
index 3b09486..775afaf 100644
--- a/api/audio_codecs/audio_decoder_factory.h
+++ b/api/audio_codecs/audio_decoder_factory.h
@@ -45,7 +45,7 @@
// Note: Implementations need to be robust against combinations other than
// one encoder, one decoder getting the same ID; such decoders must still
// work.
- virtual absl::Nullable<std::unique_ptr<AudioDecoder>> Create(
+ virtual absl_nullable std::unique_ptr<AudioDecoder> Create(
const Environment& env,
const SdpAudioFormat& format,
std::optional<AudioCodecPairId> codec_pair_id) = 0;
diff --git a/api/audio_codecs/audio_decoder_factory_template.h b/api/audio_codecs/audio_decoder_factory_template.h
index 6cf0bee..89a0514 100644
--- a/api/audio_codecs/audio_decoder_factory_template.h
+++ b/api/audio_codecs/audio_decoder_factory_template.h
@@ -40,7 +40,7 @@
return false;
}
- static absl::Nullable<std::unique_ptr<AudioDecoder>> MakeAudioDecoder(
+ static absl_nullable std::unique_ptr<AudioDecoder> MakeAudioDecoder(
const Environment& /* env */,
const SdpAudioFormat& /* format */,
std::optional<AudioCodecPairId> /* codec_pair_id */) {
@@ -59,7 +59,7 @@
std::declval<typename Trait::Config>(),
std::declval<std::optional<AudioCodecPairId>>())),
std::unique_ptr<AudioDecoder>>>>
-absl::Nullable<std::unique_ptr<AudioDecoder>> CreateDecoder(
+absl_nullable std::unique_ptr<AudioDecoder> CreateDecoder(
Rank1,
const Environment& env,
const typename Trait::Config& config,
@@ -73,7 +73,7 @@
std::declval<typename Trait::Config>(),
std::declval<std::optional<AudioCodecPairId>>())),
std::unique_ptr<AudioDecoder>>>>
-absl::Nullable<std::unique_ptr<AudioDecoder>> CreateDecoder(
+absl_nullable std::unique_ptr<AudioDecoder> CreateDecoder(
Rank0,
const Environment& /* env */,
const typename Trait::Config& config,
@@ -98,7 +98,7 @@
return opt_config ? true : Helper<Ts...>::IsSupportedDecoder(format);
}
- static absl::Nullable<std::unique_ptr<AudioDecoder>> MakeAudioDecoder(
+ static absl_nullable std::unique_ptr<AudioDecoder> MakeAudioDecoder(
const Environment& env,
const SdpAudioFormat& format,
std::optional<AudioCodecPairId> codec_pair_id) {
@@ -122,7 +122,7 @@
return Helper<Ts...>::IsSupportedDecoder(format);
}
- absl::Nullable<std::unique_ptr<AudioDecoder>> Create(
+ absl_nullable std::unique_ptr<AudioDecoder> Create(
const Environment& env,
const SdpAudioFormat& format,
std::optional<AudioCodecPairId> codec_pair_id) override {
diff --git a/api/audio_codecs/audio_encoder_factory.h b/api/audio_codecs/audio_encoder_factory.h
index c73fe22..18afd58 100644
--- a/api/audio_codecs/audio_encoder_factory.h
+++ b/api/audio_codecs/audio_encoder_factory.h
@@ -58,7 +58,7 @@
// Creates an AudioEncoder for the specified format.
// Returns null if the format isn't supported.
- virtual absl::Nullable<std::unique_ptr<AudioEncoder>> Create(
+ virtual absl_nullable std::unique_ptr<AudioEncoder> Create(
const Environment& env,
const SdpAudioFormat& format,
Options options) = 0;
diff --git a/api/audio_codecs/audio_encoder_factory_template.h b/api/audio_codecs/audio_encoder_factory_template.h
index bab725d..cd2b034 100644
--- a/api/audio_codecs/audio_encoder_factory_template.h
+++ b/api/audio_codecs/audio_encoder_factory_template.h
@@ -41,7 +41,7 @@
const SdpAudioFormat& /* format */) {
return std::nullopt;
}
- static absl::Nullable<std::unique_ptr<AudioEncoder>> CreateAudioEncoder(
+ static absl_nullable std::unique_ptr<AudioEncoder> CreateAudioEncoder(
const Environment& /* env */,
const SdpAudioFormat& /* format */,
const AudioEncoderFactory::Options& /* options */) {
@@ -60,7 +60,7 @@
std::declval<typename Trait::Config>(),
std::declval<AudioEncoderFactory::Options>())),
std::unique_ptr<AudioEncoder>>>>
-absl::Nullable<std::unique_ptr<AudioEncoder>> CreateEncoder(
+absl_nullable std::unique_ptr<AudioEncoder> CreateEncoder(
Rank1,
const Environment& env,
const typename Trait::Config& config,
@@ -75,7 +75,7 @@
int{},
std::declval<std::optional<AudioCodecPairId>>())),
std::unique_ptr<AudioEncoder>>>>
-absl::Nullable<std::unique_ptr<AudioEncoder>> CreateEncoder(
+absl_nullable std::unique_ptr<AudioEncoder> CreateEncoder(
Rank0,
const Environment& /* env */,
const typename Trait::Config& config,
@@ -104,7 +104,7 @@
: Helper<Ts...>::QueryAudioEncoder(format);
}
- static absl::Nullable<std::unique_ptr<AudioEncoder>> CreateAudioEncoder(
+ static absl_nullable std::unique_ptr<AudioEncoder> CreateAudioEncoder(
const Environment& env,
const SdpAudioFormat& format,
const AudioEncoderFactory::Options& options) {
@@ -129,7 +129,7 @@
return Helper<Ts...>::QueryAudioEncoder(format);
}
- absl::Nullable<std::unique_ptr<AudioEncoder>> Create(
+ absl_nullable std::unique_ptr<AudioEncoder> Create(
const Environment& env,
const SdpAudioFormat& format,
Options options) override {
diff --git a/api/enable_media.cc b/api/enable_media.cc
index cc15ec6..f659c3a 100644
--- a/api/enable_media.cc
+++ b/api/enable_media.cc
@@ -46,7 +46,7 @@
std::unique_ptr<MediaEngineInterface> CreateMediaEngine(
const Environment& env,
PeerConnectionFactoryDependencies& deps) override {
- absl::Nullable<scoped_refptr<AudioProcessing>> audio_processing =
+ absl_nullable scoped_refptr<AudioProcessing> audio_processing =
deps.audio_processing_builder != nullptr
? std::move(deps.audio_processing_builder)->Build(env)
#pragma clang diagnostic push
diff --git a/api/environment/environment.h b/api/environment/environment.h
index 20547b9..ea396de 100644
--- a/api/environment/environment.h
+++ b/api/environment/environment.h
@@ -94,10 +94,10 @@
private:
friend class EnvironmentFactory;
Environment(scoped_refptr<const rtc::RefCountedBase> storage,
- absl::Nonnull<const FieldTrialsView*> field_trials,
- absl::Nonnull<Clock*> clock,
- absl::Nonnull<TaskQueueFactory*> task_queue_factory,
- absl::Nonnull<RtcEventLog*> event_log)
+ const FieldTrialsView* absl_nonnull field_trials,
+ Clock* absl_nonnull clock,
+ TaskQueueFactory* absl_nonnull task_queue_factory,
+ RtcEventLog* absl_nonnull event_log)
: storage_(std::move(storage)),
field_trials_(field_trials),
clock_(clock),
@@ -112,10 +112,10 @@
// `storage_` is alive.
scoped_refptr<const rtc::RefCountedBase> storage_;
- absl::Nonnull<const FieldTrialsView*> field_trials_;
- absl::Nonnull<Clock*> clock_;
- absl::Nonnull<TaskQueueFactory*> task_queue_factory_;
- absl::Nonnull<RtcEventLog*> event_log_;
+ const FieldTrialsView* absl_nonnull field_trials_;
+ Clock* absl_nonnull clock_;
+ TaskQueueFactory* absl_nonnull task_queue_factory_;
+ RtcEventLog* absl_nonnull event_log_;
};
//------------------------------------------------------------------------------
diff --git a/api/environment/environment_factory.cc b/api/environment/environment_factory.cc
index 293ef6c..50bee27 100644
--- a/api/environment/environment_factory.cc
+++ b/api/environment/environment_factory.cc
@@ -30,12 +30,12 @@
namespace {
template <typename T>
-void Store(absl::Nonnull<std::unique_ptr<T>> value,
+void Store(absl_nonnull std::unique_ptr<T> value,
scoped_refptr<const rtc::RefCountedBase>& leaf) {
class StorageNode : public rtc::RefCountedBase {
public:
StorageNode(scoped_refptr<const rtc::RefCountedBase> parent,
- absl::Nonnull<std::unique_ptr<T>> value)
+ absl_nonnull std::unique_ptr<T> value)
: parent_(std::move(parent)), value_(std::move(value)) {}
StorageNode(const StorageNode&) = delete;
@@ -45,7 +45,7 @@
private:
scoped_refptr<const rtc::RefCountedBase> parent_;
- absl::Nonnull<std::unique_ptr<T>> value_;
+ absl_nonnull std::unique_ptr<T> value_;
};
// Utilities provided with ownership form a tree:
@@ -68,14 +68,14 @@
event_log_(env.event_log_) {}
void EnvironmentFactory::Set(
- absl::Nullable<std::unique_ptr<const FieldTrialsView>> utility) {
+ absl_nullable std::unique_ptr<const FieldTrialsView> utility) {
if (utility != nullptr) {
field_trials_ = utility.get();
Store(std::move(utility), leaf_);
}
}
-void EnvironmentFactory::Set(absl::Nullable<std::unique_ptr<Clock>> utility) {
+void EnvironmentFactory::Set(absl_nullable std::unique_ptr<Clock> utility) {
if (utility != nullptr) {
clock_ = utility.get();
Store(std::move(utility), leaf_);
@@ -83,7 +83,7 @@
}
void EnvironmentFactory::Set(
- absl::Nullable<std::unique_ptr<TaskQueueFactory>> utility) {
+ absl_nullable std::unique_ptr<TaskQueueFactory> utility) {
if (utility != nullptr) {
task_queue_factory_ = utility.get();
Store(std::move(utility), leaf_);
@@ -91,7 +91,7 @@
}
void EnvironmentFactory::Set(
- absl::Nullable<std::unique_ptr<RtcEventLog>> utility) {
+ absl_nullable std::unique_ptr<RtcEventLog> utility) {
if (utility != nullptr) {
event_log_ = utility.get();
Store(std::move(utility), leaf_);
diff --git a/api/environment/environment_factory.h b/api/environment/environment_factory.h
index 9a06ca7..d308963 100644
--- a/api/environment/environment_factory.h
+++ b/api/environment/environment_factory.h
@@ -50,15 +50,15 @@
~EnvironmentFactory() = default;
- void Set(absl::Nullable<std::unique_ptr<const FieldTrialsView>> utility);
- void Set(absl::Nullable<std::unique_ptr<Clock>> utility);
- void Set(absl::Nullable<std::unique_ptr<TaskQueueFactory>> utility);
- void Set(absl::Nullable<std::unique_ptr<RtcEventLog>> utility);
+ void Set(absl_nullable std::unique_ptr<const FieldTrialsView> utility);
+ void Set(absl_nullable std::unique_ptr<Clock> utility);
+ void Set(absl_nullable std::unique_ptr<TaskQueueFactory> utility);
+ void Set(absl_nullable std::unique_ptr<RtcEventLog> utility);
- void Set(absl::Nullable<const FieldTrialsView*> utility);
- void Set(absl::Nullable<Clock*> utility);
- void Set(absl::Nullable<TaskQueueFactory*> utility);
- void Set(absl::Nullable<RtcEventLog*> utility);
+ void Set(const FieldTrialsView* absl_nullable utility);
+ void Set(Clock* absl_nullable utility);
+ void Set(TaskQueueFactory* absl_nullable utility);
+ void Set(RtcEventLog* absl_nullable utility);
Environment Create() const;
@@ -67,10 +67,10 @@
scoped_refptr<const rtc::RefCountedBase> leaf_;
- absl::Nullable<const FieldTrialsView*> field_trials_ = nullptr;
- absl::Nullable<Clock*> clock_ = nullptr;
- absl::Nullable<TaskQueueFactory*> task_queue_factory_ = nullptr;
- absl::Nullable<RtcEventLog*> event_log_ = nullptr;
+ const FieldTrialsView* absl_nullable field_trials_ = nullptr;
+ Clock* absl_nullable clock_ = nullptr;
+ TaskQueueFactory* absl_nullable task_queue_factory_ = nullptr;
+ RtcEventLog* absl_nullable event_log_ = nullptr;
};
// Helper for concise way to create an environment.
@@ -93,25 +93,25 @@
//------------------------------------------------------------------------------
inline void EnvironmentFactory::Set(
- absl::Nullable<const FieldTrialsView*> utility) {
+ const FieldTrialsView* absl_nullable utility) {
if (utility != nullptr) {
field_trials_ = utility;
}
}
-inline void EnvironmentFactory::Set(absl::Nullable<Clock*> utility) {
+inline void EnvironmentFactory::Set(Clock* absl_nullable utility) {
if (utility != nullptr) {
clock_ = utility;
}
}
-inline void EnvironmentFactory::Set(absl::Nullable<TaskQueueFactory*> utility) {
+inline void EnvironmentFactory::Set(TaskQueueFactory* absl_nullable utility) {
if (utility != nullptr) {
task_queue_factory_ = utility;
}
}
-inline void EnvironmentFactory::Set(absl::Nullable<RtcEventLog*> utility) {
+inline void EnvironmentFactory::Set(RtcEventLog* absl_nullable utility) {
if (utility != nullptr) {
event_log_ = utility;
}
diff --git a/api/make_ref_counted.h b/api/make_ref_counted.h
index b5f4e99..0185430 100644
--- a/api/make_ref_counted.h
+++ b/api/make_ref_counted.h
@@ -86,7 +86,7 @@
typename std::enable_if<std::is_convertible_v<T*, RefCountInterface*> &&
std::is_abstract_v<T>,
T>::type* = nullptr>
-absl::Nonnull<scoped_refptr<T>> make_ref_counted(Args&&... args) {
+absl_nonnull scoped_refptr<T> make_ref_counted(Args&&... args) {
return scoped_refptr<T>(new RefCountedObject<T>(std::forward<Args>(args)...));
}
@@ -99,7 +99,7 @@
!std::is_convertible_v<T*, RefCountInterface*> &&
webrtc_make_ref_counted_internal::HasAddRefAndRelease<T>::value,
T>::type* = nullptr>
-absl::Nonnull<scoped_refptr<T>> make_ref_counted(Args&&... args) {
+absl_nonnull scoped_refptr<T> make_ref_counted(Args&&... args) {
return scoped_refptr<T>(new T(std::forward<Args>(args)...));
}
@@ -113,7 +113,7 @@
!webrtc_make_ref_counted_internal::HasAddRefAndRelease<T>::value,
T>::type* = nullptr>
-absl::Nonnull<scoped_refptr<FinalRefCountedObject<T>>> make_ref_counted(
+absl_nonnull scoped_refptr<FinalRefCountedObject<T>> make_ref_counted(
Args&&... args) {
return scoped_refptr<FinalRefCountedObject<T>>(
new FinalRefCountedObject<T>(std::forward<Args>(args)...));
diff --git a/api/rtc_event_log/rtc_event_log_factory.cc b/api/rtc_event_log/rtc_event_log_factory.cc
index bfe272d..6a8ac33 100644
--- a/api/rtc_event_log/rtc_event_log_factory.cc
+++ b/api/rtc_event_log/rtc_event_log_factory.cc
@@ -23,7 +23,7 @@
namespace webrtc {
-absl::Nonnull<std::unique_ptr<RtcEventLog>> RtcEventLogFactory::Create(
+absl_nonnull std::unique_ptr<RtcEventLog> RtcEventLogFactory::Create(
const Environment& env) const {
#ifndef WEBRTC_ENABLE_RTC_EVENT_LOG
return std::make_unique<RtcEventLogNull>();
diff --git a/api/rtc_event_log/rtc_event_log_factory.h b/api/rtc_event_log/rtc_event_log_factory.h
index df07e2d..c00821b 100644
--- a/api/rtc_event_log/rtc_event_log_factory.h
+++ b/api/rtc_event_log/rtc_event_log_factory.h
@@ -31,7 +31,7 @@
~RtcEventLogFactory() override = default;
- absl::Nonnull<std::unique_ptr<RtcEventLog>> Create(
+ absl_nonnull std::unique_ptr<RtcEventLog> Create(
const Environment& env) const override;
};
diff --git a/api/rtc_event_log/rtc_event_log_factory_interface.h b/api/rtc_event_log/rtc_event_log_factory_interface.h
index 3135584..e9cd1e5 100644
--- a/api/rtc_event_log/rtc_event_log_factory_interface.h
+++ b/api/rtc_event_log/rtc_event_log_factory_interface.h
@@ -26,7 +26,7 @@
public:
virtual ~RtcEventLogFactoryInterface() = default;
- virtual absl::Nonnull<std::unique_ptr<RtcEventLog>> Create(
+ virtual absl_nonnull std::unique_ptr<RtcEventLog> Create(
const Environment& env) const = 0;
};
diff --git a/api/scoped_refptr.h b/api/scoped_refptr.h
index e327474..bdd1c7a 100644
--- a/api/scoped_refptr.h
+++ b/api/scoped_refptr.h
@@ -78,7 +78,7 @@
scoped_refptr() : ptr_(nullptr) {}
scoped_refptr(std::nullptr_t) : ptr_(nullptr) {} // NOLINT(runtime/explicit)
- explicit scoped_refptr(absl::Nullable<T*> p) : ptr_(p) {
+ explicit scoped_refptr(T* absl_nullable p) : ptr_(p) {
if (ptr_)
ptr_->AddRef();
}
@@ -121,7 +121,7 @@
return retVal;
}
- scoped_refptr<T>& operator=(absl::Nullable<T*> p) {
+ scoped_refptr<T>& operator=(T* absl_nullable p) {
// AddRef first so that self assignment should work
if (p)
p->AddRef();
@@ -151,7 +151,7 @@
return *this;
}
- void swap(absl::Nonnull<T**> pp) noexcept {
+ void swap(T** absl_nonnull pp) noexcept {
T* p = ptr_;
ptr_ = *pp;
*pp = p;
diff --git a/api/task_queue/pending_task_safety_flag.cc b/api/task_queue/pending_task_safety_flag.cc
index 421f732..9a87211 100644
--- a/api/task_queue/pending_task_safety_flag.cc
+++ b/api/task_queue/pending_task_safety_flag.cc
@@ -41,9 +41,9 @@
// Creates a flag, but with its SequenceChecker explicitly initialized for
// a given task queue and the `alive()` flag specified.
rtc::scoped_refptr<PendingTaskSafetyFlag>
-PendingTaskSafetyFlag::CreateAttachedToTaskQueue(
- bool alive,
- absl::Nonnull<TaskQueueBase*> attached_queue) {
+PendingTaskSafetyFlag::CreateAttachedToTaskQueue(bool alive,
+ TaskQueueBase* absl_nonnull
+ attached_queue) {
RTC_DCHECK(attached_queue) << "Null TaskQueue provided";
return rtc::scoped_refptr<PendingTaskSafetyFlag>(
new PendingTaskSafetyFlag(alive, attached_queue));
diff --git a/api/task_queue/pending_task_safety_flag.h b/api/task_queue/pending_task_safety_flag.h
index 09c0e94..367c8b0 100644
--- a/api/task_queue/pending_task_safety_flag.h
+++ b/api/task_queue/pending_task_safety_flag.h
@@ -73,7 +73,7 @@
// a given task queue and the `alive()` flag specified.
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateAttachedToTaskQueue(
bool alive,
- absl::Nonnull<TaskQueueBase*> attached_queue);
+ TaskQueueBase* absl_nonnull attached_queue);
// Same as `CreateDetached()` except the initial state of the returned flag
// will be `!alive()`.
@@ -102,8 +102,7 @@
protected:
explicit PendingTaskSafetyFlag(bool alive) : alive_(alive) {}
- PendingTaskSafetyFlag(bool alive,
- absl::Nonnull<TaskQueueBase*> attached_queue)
+ PendingTaskSafetyFlag(bool alive, TaskQueueBase* absl_nonnull attached_queue)
: alive_(alive), main_sequence_(attached_queue) {}
private:
diff --git a/api/test/audioproc_float.cc b/api/test/audioproc_float.cc
index 6572a50..c1b6042 100644
--- a/api/test/audioproc_float.cc
+++ b/api/test/audioproc_float.cc
@@ -27,14 +27,14 @@
}
int AudioprocFloat(
- absl::Nonnull<std::unique_ptr<BuiltinAudioProcessingBuilder>> ap_builder,
+ absl_nonnull std::unique_ptr<BuiltinAudioProcessingBuilder> ap_builder,
int argc,
char* argv[]) {
return AudioprocFloatImpl(std::move(ap_builder), argc, argv);
}
int AudioprocFloat(
- absl::Nonnull<std::unique_ptr<AudioProcessingBuilderInterface>> ap_builder,
+ absl_nonnull std::unique_ptr<AudioProcessingBuilderInterface> ap_builder,
int argc,
char* argv[]) {
return AudioprocFloatImpl(std::move(ap_builder), argc, argv);
diff --git a/api/test/audioproc_float.h b/api/test/audioproc_float.h
index 572834d..e065ef3 100644
--- a/api/test/audioproc_float.h
+++ b/api/test/audioproc_float.h
@@ -36,11 +36,11 @@
// using the BuiltinAudioProcessingBuilder is deactivated.
int AudioprocFloat(int argc, char* argv[]);
int AudioprocFloat(
- absl::Nonnull<std::unique_ptr<BuiltinAudioProcessingBuilder>> ap_builder,
+ absl_nonnull std::unique_ptr<BuiltinAudioProcessingBuilder> ap_builder,
int argc,
char* argv[]);
int AudioprocFloat(
- absl::Nonnull<std::unique_ptr<AudioProcessingBuilderInterface>> ap_builder,
+ absl_nonnull std::unique_ptr<AudioProcessingBuilderInterface> ap_builder,
int argc,
char* argv[]);
diff --git a/api/test/create_frame_generator.cc b/api/test/create_frame_generator.cc
index ff93a19..12e071d 100644
--- a/api/test/create_frame_generator.cc
+++ b/api/test/create_frame_generator.cc
@@ -73,7 +73,7 @@
frame_repeat_count);
}
-absl::Nonnull<std::unique_ptr<FrameGeneratorInterface>>
+absl_nonnull std::unique_ptr<FrameGeneratorInterface>
CreateFromIvfFileFrameGenerator(const Environment& env,
absl::string_view filename,
std::optional<int> fps_hint) {
diff --git a/api/test/create_frame_generator.h b/api/test/create_frame_generator.h
index c308e95..0ed83c2 100644
--- a/api/test/create_frame_generator.h
+++ b/api/test/create_frame_generator.h
@@ -55,7 +55,7 @@
size_t height,
int frame_repeat_count = 1);
-absl::Nonnull<std::unique_ptr<FrameGeneratorInterface>>
+absl_nonnull std::unique_ptr<FrameGeneratorInterface>
CreateFromIvfFileFrameGenerator(const Environment& env,
absl::string_view filename,
std::optional<int> fps_hint = std::nullopt);
diff --git a/api/test/create_time_controller.cc b/api/test/create_time_controller.cc
index 2a533ad..611a694 100644
--- a/api/test/create_time_controller.cc
+++ b/api/test/create_time_controller.cc
@@ -41,8 +41,8 @@
class TimeControllerBasedFactory : public MediaFactory {
public:
TimeControllerBasedFactory(
- absl::Nonnull<Clock*> clock,
- absl::Nonnull<std::unique_ptr<MediaFactory>> media_factory)
+ Clock* absl_nonnull clock,
+ absl_nonnull std::unique_ptr<MediaFactory> media_factory)
: clock_(clock), media_factory_(std::move(media_factory)) {}
std::unique_ptr<Call> CreateCall(CallConfig config) override {
@@ -60,8 +60,8 @@
}
private:
- absl::Nonnull<Clock*> clock_;
- absl::Nonnull<std::unique_ptr<MediaFactory>> media_factory_;
+ Clock* absl_nonnull clock_;
+ absl_nonnull std::unique_ptr<MediaFactory> media_factory_;
};
EnableMediaWithDefaults(deps);
diff --git a/api/test/network_emulation_manager.h b/api/test/network_emulation_manager.h
index fa8c8bf..15a4b0f 100644
--- a/api/test/network_emulation_manager.h
+++ b/api/test/network_emulation_manager.h
@@ -337,7 +337,7 @@
// available network interfaces for PeerConnection. If endpoint is enabled, it
// will be immediately available for PeerConnection, otherwise user will be
// able to enable endpoint later to make it available for PeerConnection.
- virtual absl::Nonnull<EmulatedNetworkManagerInterface*>
+ virtual EmulatedNetworkManagerInterface* absl_nonnull
CreateEmulatedNetworkManagerInterface(
const std::vector<EmulatedEndpoint*>& endpoints) = 0;
diff --git a/api/test/peer_network_dependencies.h b/api/test/peer_network_dependencies.h
index 6b631c0..fe2fdbf 100644
--- a/api/test/peer_network_dependencies.h
+++ b/api/test/peer_network_dependencies.h
@@ -27,9 +27,9 @@
public:
virtual ~PeerNetworkDependencies() = default;
- virtual absl::Nonnull<Thread*> network_thread() = 0;
- virtual absl::Nonnull<SocketFactory*> socket_factory() = 0;
- virtual absl::Nonnull<std::unique_ptr<NetworkManager>>
+ virtual Thread* absl_nonnull network_thread() = 0;
+ virtual SocketFactory* absl_nonnull socket_factory() = 0;
+ virtual absl_nonnull std::unique_ptr<NetworkManager>
ReleaseNetworkManager() = 0;
};
diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc
index 88a3e7a..04a69ee 100644
--- a/call/rtp_video_sender.cc
+++ b/call/rtp_video_sender.cc
@@ -392,7 +392,7 @@
RtpVideoSender::RtpVideoSender(
const Environment& env,
- absl::Nonnull<TaskQueueBase*> transport_queue,
+ TaskQueueBase* absl_nonnull transport_queue,
const std::map<uint32_t, RtpState>& suspended_ssrcs,
const std::map<uint32_t, RtpPayloadState>& states,
const RtpConfig& rtp_config,
diff --git a/call/rtp_video_sender.h b/call/rtp_video_sender.h
index 969b736..fa20385 100644
--- a/call/rtp_video_sender.h
+++ b/call/rtp_video_sender.h
@@ -85,7 +85,7 @@
// Rtp modules are assumed to be sorted in simulcast index order.
RtpVideoSender(
const Environment& env,
- absl::Nonnull<TaskQueueBase*> transport_queue,
+ TaskQueueBase* absl_nonnull transport_queue,
const std::map<uint32_t, RtpState>& suspended_ssrcs,
const std::map<uint32_t, RtpPayloadState>& states,
const RtpConfig& rtp_config,
diff --git a/logging/rtc_event_log/fake_rtc_event_log_factory.cc b/logging/rtc_event_log/fake_rtc_event_log_factory.cc
index cbc6c89..d5be8fd 100644
--- a/logging/rtc_event_log/fake_rtc_event_log_factory.cc
+++ b/logging/rtc_event_log/fake_rtc_event_log_factory.cc
@@ -19,7 +19,7 @@
namespace webrtc {
-absl::Nonnull<std::unique_ptr<RtcEventLog>> FakeRtcEventLogFactory::Create(
+absl_nonnull std::unique_ptr<RtcEventLog> FakeRtcEventLogFactory::Create(
const Environment& /*env*/) const {
auto fake_event_log = std::make_unique<FakeRtcEventLog>();
const_cast<FakeRtcEventLog*&>(last_log_created_) = fake_event_log.get();
diff --git a/logging/rtc_event_log/fake_rtc_event_log_factory.h b/logging/rtc_event_log/fake_rtc_event_log_factory.h
index 0d6d076..71489cc 100644
--- a/logging/rtc_event_log/fake_rtc_event_log_factory.h
+++ b/logging/rtc_event_log/fake_rtc_event_log_factory.h
@@ -25,7 +25,7 @@
FakeRtcEventLogFactory() = default;
~FakeRtcEventLogFactory() override = default;
- absl::Nonnull<std::unique_ptr<RtcEventLog>> Create(
+ absl_nonnull std::unique_ptr<RtcEventLog> Create(
const Environment& env) const override;
FakeRtcEventLog* last_log_created() { return last_log_created_; }
diff --git a/media/base/fake_media_engine.h b/media/base/fake_media_engine.h
index af8808e..f8bdcc7 100644
--- a/media/base/fake_media_engine.h
+++ b/media/base/fake_media_engine.h
@@ -868,7 +868,7 @@
const webrtc::SdpAudioFormat& format) override {
return std::nullopt;
}
- absl::Nullable<std::unique_ptr<webrtc::AudioEncoder>> Create(
+ absl_nullable std::unique_ptr<webrtc::AudioEncoder> Create(
const webrtc::Environment& env,
const webrtc::SdpAudioFormat& format,
Options options) override {
@@ -894,7 +894,7 @@
bool IsSupportedDecoder(const webrtc::SdpAudioFormat& format) override {
return false;
}
- absl::Nullable<std::unique_ptr<webrtc::AudioDecoder>> Create(
+ absl_nullable std::unique_ptr<webrtc::AudioDecoder> Create(
const webrtc::Environment& env,
const webrtc::SdpAudioFormat& format,
std::optional<webrtc::AudioCodecPairId> codec_pair_id) override {
diff --git a/media/engine/simulcast_encoder_adapter.cc b/media/engine/simulcast_encoder_adapter.cc
index 6770f13..30ee4b7 100644
--- a/media/engine/simulcast_encoder_adapter.cc
+++ b/media/engine/simulcast_encoder_adapter.cc
@@ -254,8 +254,8 @@
SimulcastEncoderAdapter::SimulcastEncoderAdapter(
const Environment& env,
- absl::Nonnull<VideoEncoderFactory*> primary_factory,
- absl::Nullable<VideoEncoderFactory*> fallback_factory,
+ VideoEncoderFactory* absl_nonnull primary_factory,
+ VideoEncoderFactory* absl_nullable fallback_factory,
const SdpVideoFormat& format)
: env_(env),
inited_(0),
diff --git a/media/engine/simulcast_encoder_adapter.h b/media/engine/simulcast_encoder_adapter.h
index 63e1075..1461416 100644
--- a/media/engine/simulcast_encoder_adapter.h
+++ b/media/engine/simulcast_encoder_adapter.h
@@ -50,8 +50,8 @@
// `fallback_factory`, if non-null, is used to create fallback encoder that
// will be used if InitEncode() fails for the primary encoder.
SimulcastEncoderAdapter(const Environment& env,
- absl::Nonnull<VideoEncoderFactory*> primary_factory,
- absl::Nullable<VideoEncoderFactory*> fallback_factory,
+ VideoEncoderFactory* absl_nonnull primary_factory,
+ VideoEncoderFactory* absl_nullable fallback_factory,
const SdpVideoFormat& format);
~SimulcastEncoderAdapter() override;
diff --git a/modules/audio_processing/aec_dump/aec_dump_factory.h b/modules/audio_processing/aec_dump/aec_dump_factory.h
index 0d258a9..9a68691 100644
--- a/modules/audio_processing/aec_dump/aec_dump_factory.h
+++ b/modules/audio_processing/aec_dump/aec_dump_factory.h
@@ -29,18 +29,18 @@
// The AecDump takes responsibility for `handle` and closes it in the
// destructor. A non-null return value indicates that the file has been
// sucessfully opened.
- static absl::Nullable<std::unique_ptr<AecDump>> Create(
+ static absl_nullable std::unique_ptr<AecDump> Create(
FileWrapper file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
- static absl::Nullable<std::unique_ptr<AecDump>> Create(
+ TaskQueueBase* absl_nonnull worker_queue);
+ static absl_nullable std::unique_ptr<AecDump> Create(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
- static absl::Nullable<std::unique_ptr<AecDump>> Create(
- absl::Nonnull<FILE*> handle,
+ TaskQueueBase* absl_nonnull worker_queue);
+ static absl_nullable std::unique_ptr<AecDump> Create(
+ FILE* absl_nonnull handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
+ TaskQueueBase* absl_nonnull worker_queue);
};
} // namespace webrtc
diff --git a/modules/audio_processing/aec_dump/aec_dump_impl.cc b/modules/audio_processing/aec_dump/aec_dump_impl.cc
index 5a0c10f..0c19650 100644
--- a/modules/audio_processing/aec_dump/aec_dump_impl.cc
+++ b/modules/audio_processing/aec_dump/aec_dump_impl.cc
@@ -60,7 +60,7 @@
AecDumpImpl::AecDumpImpl(FileWrapper debug_file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue)
+ TaskQueueBase* absl_nonnull worker_queue)
: debug_file_(std::move(debug_file)),
num_bytes_left_for_log_(max_log_size_bytes),
worker_queue_(worker_queue) {}
@@ -255,10 +255,10 @@
});
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create(
FileWrapper file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
RTC_DCHECK(worker_queue);
if (!file.is_open())
return nullptr;
@@ -267,18 +267,18 @@
worker_queue);
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return Create(FileWrapper::OpenWriteOnly(file_name), max_log_size_bytes,
worker_queue);
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
- absl::Nonnull<FILE*> handle,
+absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create(
+ FILE* absl_nonnull handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return Create(FileWrapper(handle), max_log_size_bytes, worker_queue);
}
diff --git a/modules/audio_processing/aec_dump/aec_dump_impl.h b/modules/audio_processing/aec_dump/aec_dump_impl.h
index dc8239b..7638758 100644
--- a/modules/audio_processing/aec_dump/aec_dump_impl.h
+++ b/modules/audio_processing/aec_dump/aec_dump_impl.h
@@ -39,7 +39,7 @@
// `max_log_size_bytes == -1` means the log size will be unlimited.
AecDumpImpl(FileWrapper debug_file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue);
+ TaskQueueBase* absl_nonnull worker_queue);
AecDumpImpl(const AecDumpImpl&) = delete;
AecDumpImpl& operator=(const AecDumpImpl&) = delete;
~AecDumpImpl() override;
@@ -74,7 +74,7 @@
FileWrapper debug_file_;
int64_t num_bytes_left_for_log_ = 0;
RaceChecker race_checker_;
- absl::Nonnull<TaskQueueBase*> worker_queue_;
+ TaskQueueBase* absl_nonnull worker_queue_;
CaptureStreamInfo capture_stream_info_;
};
} // namespace webrtc
diff --git a/modules/audio_processing/aec_dump/null_aec_dump_factory.cc b/modules/audio_processing/aec_dump/null_aec_dump_factory.cc
index 63929af..9ab5d14 100644
--- a/modules/audio_processing/aec_dump/null_aec_dump_factory.cc
+++ b/modules/audio_processing/aec_dump/null_aec_dump_factory.cc
@@ -16,24 +16,24 @@
namespace webrtc {
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create(
FileWrapper file,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return nullptr;
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
+absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create(
absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return nullptr;
}
-absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create(
- absl::Nonnull<FILE*> handle,
+absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create(
+ FILE* absl_nonnull handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+ TaskQueueBase* absl_nonnull worker_queue) {
return nullptr;
}
} // namespace webrtc
diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc
index 0e969d2..9ac05bf 100644
--- a/modules/audio_processing/audio_processing_impl.cc
+++ b/modules/audio_processing/audio_processing_impl.cc
@@ -1786,10 +1786,10 @@
capture_.recommended_input_volume = capture_.applied_input_volume;
}
-bool AudioProcessingImpl::CreateAndAttachAecDump(
- absl::string_view file_name,
- int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+bool AudioProcessingImpl::CreateAndAttachAecDump(absl::string_view file_name,
+ int64_t max_log_size_bytes,
+ TaskQueueBase* absl_nonnull
+ worker_queue) {
std::unique_ptr<AecDump> aec_dump =
AecDumpFactory::Create(file_name, max_log_size_bytes, worker_queue);
if (!aec_dump) {
@@ -1800,10 +1800,10 @@
return true;
}
-bool AudioProcessingImpl::CreateAndAttachAecDump(
- FILE* handle,
- int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+bool AudioProcessingImpl::CreateAndAttachAecDump(FILE* handle,
+ int64_t max_log_size_bytes,
+ TaskQueueBase* absl_nonnull
+ worker_queue) {
std::unique_ptr<AecDump> aec_dump =
AecDumpFactory::Create(handle, max_log_size_bytes, worker_queue);
if (!aec_dump) {
diff --git a/modules/audio_processing/audio_processing_impl.h b/modules/audio_processing/audio_processing_impl.h
index 6026ade..6eeaab6 100644
--- a/modules/audio_processing/audio_processing_impl.h
+++ b/modules/audio_processing/audio_processing_impl.h
@@ -73,14 +73,14 @@
int Initialize() override;
int Initialize(const ProcessingConfig& processing_config) override;
void ApplyConfig(const AudioProcessing::Config& config) override;
- bool CreateAndAttachAecDump(
- absl::string_view file_name,
- int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) override;
- bool CreateAndAttachAecDump(
- FILE* handle,
- int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue) override;
+ bool CreateAndAttachAecDump(absl::string_view file_name,
+ int64_t max_log_size_bytes,
+ TaskQueueBase* absl_nonnull
+ worker_queue) override;
+ bool CreateAndAttachAecDump(FILE* handle,
+ int64_t max_log_size_bytes,
+ TaskQueueBase* absl_nonnull
+ worker_queue) override;
// TODO(webrtc:5298) Deprecated variant.
void AttachAecDump(std::unique_ptr<AecDump> aec_dump) override;
void DetachAecDump() override;
diff --git a/modules/audio_processing/include/mock_audio_processing.h b/modules/audio_processing/include/mock_audio_processing.h
index ccdd1f6..ba11e9c 100644
--- a/modules/audio_processing/include/mock_audio_processing.h
+++ b/modules/audio_processing/include/mock_audio_processing.h
@@ -159,13 +159,13 @@
CreateAndAttachAecDump,
(absl::string_view file_name,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue),
+ TaskQueueBase* absl_nonnull worker_queue),
(override));
MOCK_METHOD(bool,
CreateAndAttachAecDump,
(FILE * handle,
int64_t max_log_size_bytes,
- absl::Nonnull<TaskQueueBase*> worker_queue),
+ TaskQueueBase* absl_nonnull worker_queue),
(override));
MOCK_METHOD(void, AttachAecDump, (std::unique_ptr<AecDump>), (override));
MOCK_METHOD(void, DetachAecDump, (), (override));
diff --git a/modules/audio_processing/test/aec_dump_based_simulator.cc b/modules/audio_processing/test/aec_dump_based_simulator.cc
index d972af6..b0a41a1 100644
--- a/modules/audio_processing/test/aec_dump_based_simulator.cc
+++ b/modules/audio_processing/test/aec_dump_based_simulator.cc
@@ -97,7 +97,7 @@
AecDumpBasedSimulator::AecDumpBasedSimulator(
const SimulationSettings& settings,
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing)
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing)
: AudioProcessingSimulator(settings, std::move(audio_processing)) {
MaybeOpenCallOrderFile();
}
diff --git a/modules/audio_processing/test/aec_dump_based_simulator.h b/modules/audio_processing/test/aec_dump_based_simulator.h
index 913a7c4..e5bee33 100644
--- a/modules/audio_processing/test/aec_dump_based_simulator.h
+++ b/modules/audio_processing/test/aec_dump_based_simulator.h
@@ -36,7 +36,7 @@
public:
AecDumpBasedSimulator(
const SimulationSettings& settings,
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing);
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing);
AecDumpBasedSimulator() = delete;
AecDumpBasedSimulator(const AecDumpBasedSimulator&) = delete;
diff --git a/modules/audio_processing/test/audio_processing_simulator.cc b/modules/audio_processing/test/audio_processing_simulator.cc
index 20de5f6..ce085c5 100644
--- a/modules/audio_processing/test/audio_processing_simulator.cc
+++ b/modules/audio_processing/test/audio_processing_simulator.cc
@@ -93,7 +93,7 @@
AudioProcessingSimulator::AudioProcessingSimulator(
const SimulationSettings& settings,
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing)
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing)
: settings_(settings),
ap_(std::move(audio_processing)),
applied_input_volume_(settings.initial_mic_level),
diff --git a/modules/audio_processing/test/audio_processing_simulator.h b/modules/audio_processing/test/audio_processing_simulator.h
index 8b6f95c..4e9ee70 100644
--- a/modules/audio_processing/test/audio_processing_simulator.h
+++ b/modules/audio_processing/test/audio_processing_simulator.h
@@ -166,7 +166,7 @@
public:
AudioProcessingSimulator(
const SimulationSettings& settings,
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing);
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing);
AudioProcessingSimulator() = delete;
AudioProcessingSimulator(const AudioProcessingSimulator&) = delete;
diff --git a/modules/audio_processing/test/audioproc_float_impl.cc b/modules/audio_processing/test/audioproc_float_impl.cc
index 8740ac0..2941621 100644
--- a/modules/audio_processing/test/audioproc_float_impl.cc
+++ b/modules/audio_processing/test/audioproc_float_impl.cc
@@ -810,7 +810,7 @@
}
int RunSimulation(
- absl::Nonnull<std::unique_ptr<AudioProcessingBuilderInterface>> ap_builder,
+ absl_nonnull std::unique_ptr<AudioProcessingBuilderInterface> ap_builder,
bool builtin_builder_provided,
int argc,
char* argv[]) {
@@ -869,7 +869,7 @@
} // namespace
int AudioprocFloatImpl(
- absl::Nonnull<std::unique_ptr<BuiltinAudioProcessingBuilder>> ap_builder,
+ absl_nonnull std::unique_ptr<BuiltinAudioProcessingBuilder> ap_builder,
int argc,
char* argv[]) {
return RunSimulation(std::move(ap_builder), /*builtin_builder_provided=*/true,
@@ -877,7 +877,7 @@
}
int AudioprocFloatImpl(
- absl::Nonnull<std::unique_ptr<AudioProcessingBuilderInterface>> ap_builder,
+ absl_nonnull std::unique_ptr<AudioProcessingBuilderInterface> ap_builder,
int argc,
char* argv[]) {
return RunSimulation(std::move(ap_builder),
diff --git a/modules/audio_processing/test/audioproc_float_impl.h b/modules/audio_processing/test/audioproc_float_impl.h
index bcb64d0..6681605 100644
--- a/modules/audio_processing/test/audioproc_float_impl.h
+++ b/modules/audio_processing/test/audioproc_float_impl.h
@@ -21,12 +21,12 @@
namespace test {
int AudioprocFloatImpl(
- absl::Nonnull<std::unique_ptr<BuiltinAudioProcessingBuilder>> ap_builder,
+ absl_nonnull std::unique_ptr<BuiltinAudioProcessingBuilder> ap_builder,
int argc,
char* argv[]);
int AudioprocFloatImpl(
- absl::Nonnull<std::unique_ptr<AudioProcessingBuilderInterface>> ap_builder,
+ absl_nonnull std::unique_ptr<AudioProcessingBuilderInterface> ap_builder,
int argc,
char* argv[]);
diff --git a/modules/audio_processing/test/wav_based_simulator.cc b/modules/audio_processing/test/wav_based_simulator.cc
index 724afca..24d68b6 100644
--- a/modules/audio_processing/test/wav_based_simulator.cc
+++ b/modules/audio_processing/test/wav_based_simulator.cc
@@ -63,7 +63,7 @@
WavBasedSimulator::WavBasedSimulator(
const SimulationSettings& settings,
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing)
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing)
: AudioProcessingSimulator(settings, std::move(audio_processing)) {
if (settings_.call_order_input_filename) {
call_chain_ = WavBasedSimulator::GetCustomEventChain(
diff --git a/modules/audio_processing/test/wav_based_simulator.h b/modules/audio_processing/test/wav_based_simulator.h
index 7ac538d..b5399c6 100644
--- a/modules/audio_processing/test/wav_based_simulator.h
+++ b/modules/audio_processing/test/wav_based_simulator.h
@@ -27,7 +27,7 @@
public:
WavBasedSimulator(
const SimulationSettings& settings,
- absl::Nonnull<scoped_refptr<AudioProcessing>> audio_processing);
+ absl_nonnull scoped_refptr<AudioProcessing> audio_processing);
WavBasedSimulator() = delete;
WavBasedSimulator(const WavBasedSimulator&) = delete;
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
index d9b2d7e..5847b08 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
@@ -98,7 +98,7 @@
RemoteBitrateEstimatorAbsSendTime::RemoteBitrateEstimatorAbsSendTime(
const Environment& env,
- absl::Nonnull<RemoteBitrateObserver*> observer)
+ RemoteBitrateObserver* absl_nonnull observer)
: env_(env), observer_(observer), remote_rate_(env_.field_trials()) {
RTC_LOG(LS_INFO) << "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
}
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
index 66272b4..a2b781a 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h
@@ -37,9 +37,9 @@
class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
public:
- RemoteBitrateEstimatorAbsSendTime(
- const Environment& env,
- absl::Nonnull<RemoteBitrateObserver*> observer);
+ RemoteBitrateEstimatorAbsSendTime(const Environment& env,
+ RemoteBitrateObserver* absl_nonnull
+ observer);
RemoteBitrateEstimatorAbsSendTime() = delete;
RemoteBitrateEstimatorAbsSendTime(const RemoteBitrateEstimatorAbsSendTime&) =
@@ -99,7 +99,7 @@
void TimeoutStreams(Timestamp now);
const Environment env_;
- const absl::Nonnull<RemoteBitrateObserver*> observer_;
+ RemoteBitrateObserver* absl_nonnull const observer_;
std::unique_ptr<InterArrival> inter_arrival_;
std::unique_ptr<OveruseEstimator> estimator_;
OveruseDetector detector_;
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
index 9e47a9f..b05610d 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
@@ -48,7 +48,7 @@
RemoteBitrateEstimatorSingleStream::RemoteBitrateEstimatorSingleStream(
const Environment& env,
- absl::Nonnull<RemoteBitrateObserver*> observer)
+ RemoteBitrateObserver* absl_nonnull observer)
: env_(env),
observer_(observer),
incoming_bitrate_(kBitrateWindow),
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
index 18eaad3..9f87823 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
@@ -35,9 +35,9 @@
class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator {
public:
- RemoteBitrateEstimatorSingleStream(
- const Environment& env,
- absl::Nonnull<RemoteBitrateObserver*> observer);
+ RemoteBitrateEstimatorSingleStream(const Environment& env,
+ RemoteBitrateObserver* absl_nonnull
+ observer);
RemoteBitrateEstimatorSingleStream() = delete;
RemoteBitrateEstimatorSingleStream(
@@ -69,7 +69,7 @@
std::vector<uint32_t> GetSsrcs() const;
const Environment env_;
- const absl::Nonnull<RemoteBitrateObserver*> observer_;
+ RemoteBitrateObserver* absl_nonnull const observer_;
std::map<uint32_t, Detector> overuse_detectors_;
BitrateTracker incoming_bitrate_;
DataRate last_valid_incoming_bitrate_;
diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
index 4b9479e..f119e19 100644
--- a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
+++ b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
@@ -857,7 +857,7 @@
} // namespace
-absl::Nonnull<std::unique_ptr<VideoEncoder>> CreateLibaomAv1Encoder(
+absl_nonnull std::unique_ptr<VideoEncoder> CreateLibaomAv1Encoder(
const Environment& env,
LibaomAv1EncoderSettings settings) {
return std::make_unique<LibaomAv1Encoder>(env, std::move(settings));
diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.h b/modules/video_coding/codecs/av1/libaom_av1_encoder.h
index 63fd3fc..e2becda 100644
--- a/modules/video_coding/codecs/av1/libaom_av1_encoder.h
+++ b/modules/video_coding/codecs/av1/libaom_av1_encoder.h
@@ -23,7 +23,7 @@
// A map of max pixel count --> cpu speed.
std::map<int, int> max_pixel_count_to_cpu_speed;
};
-absl::Nonnull<std::unique_ptr<VideoEncoder>> CreateLibaomAv1Encoder(
+absl_nonnull std::unique_ptr<VideoEncoder> CreateLibaomAv1Encoder(
const Environment& env,
LibaomAv1EncoderSettings settings = {});
diff --git a/modules/video_coding/codecs/h264/h264.cc b/modules/video_coding/codecs/h264/h264.cc
index 927bf7c..9609021 100644
--- a/modules/video_coding/codecs/h264/h264.cc
+++ b/modules/video_coding/codecs/h264/h264.cc
@@ -133,7 +133,7 @@
return {};
}
-absl::Nonnull<std::unique_ptr<VideoEncoder>> CreateH264Encoder(
+absl_nonnull std::unique_ptr<VideoEncoder> CreateH264Encoder(
[[maybe_unused]] const Environment& env,
[[maybe_unused]] H264EncoderSettings settings) {
#if defined(WEBRTC_USE_H264)
diff --git a/modules/video_coding/codecs/h264/include/h264.h b/modules/video_coding/codecs/h264/include/h264.h
index 6e4bc9f..6255ce9 100644
--- a/modules/video_coding/codecs/h264/include/h264.h
+++ b/modules/video_coding/codecs/h264/include/h264.h
@@ -66,7 +66,7 @@
H264PacketizationMode packetization_mode =
H264PacketizationMode::NonInterleaved;
};
-absl::Nonnull<std::unique_ptr<VideoEncoder>> CreateH264Encoder(
+absl_nonnull std::unique_ptr<VideoEncoder> CreateH264Encoder(
const Environment& env,
H264EncoderSettings settings = {});
diff --git a/modules/video_coding/codecs/vp8/include/vp8.h b/modules/video_coding/codecs/vp8/include/vp8.h
index 8dd7c57..d0eeba4 100644
--- a/modules/video_coding/codecs/vp8/include/vp8.h
+++ b/modules/video_coding/codecs/vp8/include/vp8.h
@@ -26,7 +26,7 @@
// VideoEncoder::GetEncoderInfo(). No override is done if empty.
std::vector<VideoEncoder::ResolutionBitrateLimits> resolution_bitrate_limits;
};
-absl::Nonnull<std::unique_ptr<VideoEncoder>> CreateVp8Encoder(
+absl_nonnull std::unique_ptr<VideoEncoder> CreateVp8Encoder(
const Environment& env,
Vp8EncoderSettings settings = {});
diff --git a/modules/video_coding/codecs/vp9/include/vp9.h b/modules/video_coding/codecs/vp9/include/vp9.h
index ddb2000..ffbb7bb 100644
--- a/modules/video_coding/codecs/vp9/include/vp9.h
+++ b/modules/video_coding/codecs/vp9/include/vp9.h
@@ -37,7 +37,7 @@
struct Vp9EncoderSettings {
VP9Profile profile = VP9Profile::kProfile0;
};
-absl::Nonnull<std::unique_ptr<VideoEncoder>> CreateVp9Encoder(
+absl_nonnull std::unique_ptr<VideoEncoder> CreateVp9Encoder(
const Environment& env,
Vp9EncoderSettings settings = {});
diff --git a/modules/video_coding/codecs/vp9/vp9.cc b/modules/video_coding/codecs/vp9/vp9.cc
index 36f5c15..7c0a8ae 100644
--- a/modules/video_coding/codecs/vp9/vp9.cc
+++ b/modules/video_coding/codecs/vp9/vp9.cc
@@ -71,7 +71,7 @@
#endif
}
-absl::Nonnull<std::unique_ptr<VideoEncoder>> CreateVp9Encoder(
+absl_nonnull std::unique_ptr<VideoEncoder> CreateVp9Encoder(
const Environment& env,
Vp9EncoderSettings settings) {
#ifdef RTC_ENABLE_VP9
diff --git a/p2p/client/basic_port_allocator.cc b/p2p/client/basic_port_allocator.cc
index abcc99b..13dbfc0 100644
--- a/p2p/client/basic_port_allocator.cc
+++ b/p2p/client/basic_port_allocator.cc
@@ -185,10 +185,10 @@
BasicPortAllocator::BasicPortAllocator(
const webrtc::Environment& env,
- absl::Nonnull<webrtc::NetworkManager*> network_manager,
- absl::Nonnull<webrtc::PacketSocketFactory*> socket_factory,
- absl::Nullable<webrtc::TurnCustomizer*> turn_customizer,
- absl::Nullable<RelayPortFactoryInterface*> relay_port_factory)
+ webrtc::NetworkManager* absl_nonnull network_manager,
+ webrtc::PacketSocketFactory* absl_nonnull socket_factory,
+ webrtc::TurnCustomizer* absl_nullable turn_customizer,
+ RelayPortFactoryInterface* absl_nullable relay_port_factory)
: env_(env),
network_manager_(network_manager),
socket_factory_(socket_factory),
diff --git a/p2p/client/basic_port_allocator.h b/p2p/client/basic_port_allocator.h
index a19ef7f..713ca4d 100644
--- a/p2p/client/basic_port_allocator.h
+++ b/p2p/client/basic_port_allocator.h
@@ -50,10 +50,10 @@
public:
BasicPortAllocator(
const webrtc::Environment& env,
- absl::Nonnull<webrtc::NetworkManager*> network_manager,
- absl::Nonnull<webrtc::PacketSocketFactory*> socket_factory,
- absl::Nullable<webrtc::TurnCustomizer*> turn_customizer = nullptr,
- absl::Nullable<RelayPortFactoryInterface*> relay_port_factory = nullptr);
+ webrtc::NetworkManager* absl_nonnull network_manager,
+ webrtc::PacketSocketFactory* absl_nonnull socket_factory,
+ webrtc::TurnCustomizer* absl_nullable turn_customizer = nullptr,
+ RelayPortFactoryInterface* absl_nullable relay_port_factory = nullptr);
BasicPortAllocator(const BasicPortAllocator&) = delete;
BasicPortAllocator& operator=(const BasicPortAllocator&) = delete;
diff --git a/p2p/test/fake_port_allocator.h b/p2p/test/fake_port_allocator.h
index b59b377..91aaa6f 100644
--- a/p2p/test/fake_port_allocator.h
+++ b/p2p/test/fake_port_allocator.h
@@ -234,8 +234,8 @@
class FakePortAllocator : public webrtc::PortAllocator {
public:
FakePortAllocator(const webrtc::Environment& env,
- absl::Nonnull<webrtc::SocketFactory*> socket_factory,
- absl::Nonnull<webrtc::TaskQueueBase*> network_thread =
+ webrtc::SocketFactory* absl_nonnull socket_factory,
+ webrtc::TaskQueueBase* absl_nonnull network_thread =
webrtc::TaskQueueBase::Current())
: env_(env), network_thread_(network_thread), factory_(socket_factory) {
RTC_CHECK(network_thread);
@@ -266,7 +266,7 @@
private:
const webrtc::Environment env_;
- absl::Nonnull<webrtc::TaskQueueBase*> network_thread_;
+ webrtc::TaskQueueBase* absl_nonnull network_thread_;
webrtc::BasicPacketSocketFactory factory_;
bool mdns_obfuscation_enabled_ = false;
};
diff --git a/pc/test/enable_fake_media.cc b/pc/test/enable_fake_media.cc
index b2ea89a..7421343 100644
--- a/pc/test/enable_fake_media.cc
+++ b/pc/test/enable_fake_media.cc
@@ -30,11 +30,11 @@
void EnableFakeMedia(
PeerConnectionFactoryDependencies& deps,
- absl::Nonnull<std::unique_ptr<FakeMediaEngine>> fake_media_engine) {
+ absl_nonnull std::unique_ptr<FakeMediaEngine> fake_media_engine) {
class FakeMediaFactory : public MediaFactory {
public:
explicit FakeMediaFactory(
- absl::Nonnull<std::unique_ptr<FakeMediaEngine>> fake)
+ absl_nonnull std::unique_ptr<FakeMediaEngine> fake)
: fake_(std::move(fake)) {}
std::unique_ptr<Call> CreateCall(CallConfig config) override {
@@ -50,7 +50,7 @@
}
private:
- absl::Nullable<std::unique_ptr<FakeMediaEngine>> fake_;
+ absl_nullable std::unique_ptr<FakeMediaEngine> fake_;
};
deps.media_factory =
diff --git a/pc/test/enable_fake_media.h b/pc/test/enable_fake_media.h
index 82c55ad..6a8d3c4 100644
--- a/pc/test/enable_fake_media.h
+++ b/pc/test/enable_fake_media.h
@@ -28,7 +28,7 @@
// Enables media support backed by the 'fake_media_engine'.
void EnableFakeMedia(
PeerConnectionFactoryDependencies& deps,
- absl::Nonnull<std::unique_ptr<cricket::FakeMediaEngine>> fake_media_engine);
+ absl_nonnull std::unique_ptr<cricket::FakeMediaEngine> fake_media_engine);
// Enables media support backed by unspecified lightweight fake implementation.
void EnableFakeMedia(PeerConnectionFactoryDependencies& deps);
diff --git a/rtc_base/network.cc b/rtc_base/network.cc
index f77a2ba..877d312 100644
--- a/rtc_base/network.cc
+++ b/rtc_base/network.cc
@@ -561,8 +561,8 @@
BasicNetworkManager::BasicNetworkManager(
const Environment& env,
- absl::Nonnull<SocketFactory*> socket_factory,
- absl::Nullable<rtc::NetworkMonitorFactory*> network_monitor_factory)
+ SocketFactory* absl_nonnull socket_factory,
+ rtc::NetworkMonitorFactory* absl_nullable network_monitor_factory)
: env_(env),
field_trials_(&env_->field_trials()),
network_monitor_factory_(network_monitor_factory),
diff --git a/rtc_base/network.h b/rtc_base/network.h
index 18778d4..b30afa0 100644
--- a/rtc_base/network.h
+++ b/rtc_base/network.h
@@ -487,8 +487,8 @@
public:
BasicNetworkManager(
const Environment& env,
- absl::Nonnull<SocketFactory*> socket_factory,
- absl::Nullable<NetworkMonitorFactory*> network_monitor_factory = nullptr);
+ SocketFactory* absl_nonnull socket_factory,
+ NetworkMonitorFactory* absl_nullable network_monitor_factory = nullptr);
// TODO: bugs.webrtc.org/405883462 - Deprecate and remove two constructors
// below when chromium is updated not to use these constructors.
@@ -585,8 +585,8 @@
AlwaysValidPointer<const FieldTrialsView, FieldTrialBasedConfig>
field_trials_;
std::vector<std::string> network_ignore_list_;
- absl::Nullable<NetworkMonitorFactory*> const network_monitor_factory_;
- absl::Nonnull<SocketFactory*> const socket_factory_;
+ NetworkMonitorFactory* absl_nullable const network_monitor_factory_;
+ SocketFactory* absl_nonnull const socket_factory_;
std::unique_ptr<NetworkMonitorInterface> network_monitor_
RTC_GUARDED_BY(thread_);
bool allow_mac_based_ipv6_ RTC_GUARDED_BY(thread_) = false;
diff --git a/test/fuzzers/audio_processing_configs_fuzzer.cc b/test/fuzzers/audio_processing_configs_fuzzer.cc
index bd56fb3..afe58ad 100644
--- a/test/fuzzers/audio_processing_configs_fuzzer.cc
+++ b/test/fuzzers/audio_processing_configs_fuzzer.cc
@@ -47,10 +47,10 @@
return *env;
}
-rtc::scoped_refptr<AudioProcessing> CreateApm(
- test::FuzzDataHelper* fuzz_data,
- std::string* field_trial_string,
- absl::Nonnull<TaskQueueBase*> worker_queue) {
+rtc::scoped_refptr<AudioProcessing> CreateApm(test::FuzzDataHelper* fuzz_data,
+ std::string* field_trial_string,
+ TaskQueueBase* absl_nonnull
+ worker_queue) {
// Parse boolean values for optionally enabling different
// configurable public components of APM.
bool use_ts = fuzz_data->ReadOrDefaultValue(true);
diff --git a/test/network/emulated_network_manager.cc b/test/network/emulated_network_manager.cc
index e66c05d..7220806 100644
--- a/test/network/emulated_network_manager.cc
+++ b/test/network/emulated_network_manager.cc
@@ -34,9 +34,9 @@
// Framework assumes that rtc::NetworkManager is called from network thread.
class EmulatedNetworkManager::NetworkManagerImpl : public NetworkManagerBase {
public:
- explicit NetworkManagerImpl(
- absl::Nonnull<Thread*> network_thread,
- absl::Nonnull<EndpointsContainer*> endpoints_container)
+ explicit NetworkManagerImpl(Thread* absl_nonnull network_thread,
+ EndpointsContainer* absl_nonnull
+ endpoints_container)
: network_thread_(network_thread),
endpoints_container_(endpoints_container) {}
@@ -50,8 +50,8 @@
std::vector<const Network*> GetAnyAddressNetworks() override { return {}; }
private:
- const absl::Nonnull<Thread*> network_thread_;
- const absl::Nonnull<const EndpointsContainer*> endpoints_container_;
+ Thread* absl_nonnull const network_thread_;
+ const EndpointsContainer* absl_nonnull const endpoints_container_;
bool sent_first_update_ RTC_GUARDED_BY(network_thread_) = false;
int start_count_ RTC_GUARDED_BY(network_thread_) = 0;
};
@@ -73,7 +73,7 @@
EmulatedNetworkManager::~EmulatedNetworkManager() = default;
-absl::Nonnull<std::unique_ptr<NetworkManager>>
+absl_nonnull std::unique_ptr<NetworkManager>
EmulatedNetworkManager::ReleaseNetworkManager() {
RTC_CHECK(network_manager_ != nullptr)
<< "ReleaseNetworkManager can be called at most once.";
@@ -81,7 +81,7 @@
}
void EmulatedNetworkManager::UpdateNetworks() {
- absl::Nonnull<NetworkManagerImpl*> network_manager = network_manager_ptr_;
+ NetworkManagerImpl* absl_nonnull network_manager = network_manager_ptr_;
network_thread_->PostTask(
[network_manager] { network_manager->UpdateNetworksOnce(); });
}
diff --git a/test/network/emulated_network_manager.h b/test/network/emulated_network_manager.h
index 87c8915..ad32235 100644
--- a/test/network/emulated_network_manager.h
+++ b/test/network/emulated_network_manager.h
@@ -31,22 +31,20 @@
class EmulatedNetworkManager : public EmulatedNetworkManagerInterface {
public:
- EmulatedNetworkManager(
- absl::Nonnull<TimeController*> time_controller,
- absl::Nonnull<TaskQueueBase*> task_queue,
- absl::Nonnull<EndpointsContainer*> endpoints_container);
+ EmulatedNetworkManager(TimeController* absl_nonnull time_controller,
+ TaskQueueBase* absl_nonnull task_queue,
+ EndpointsContainer* absl_nonnull endpoints_container);
~EmulatedNetworkManager() override;
void UpdateNetworks();
- absl::Nonnull<Thread*> network_thread() override {
+ Thread* absl_nonnull network_thread() override {
return network_thread_.get();
}
- absl::Nonnull<rtc::SocketFactory*> socket_factory() override {
+ rtc::SocketFactory* absl_nonnull socket_factory() override {
return socket_server_;
}
- absl::Nonnull<std::unique_ptr<NetworkManager>> ReleaseNetworkManager()
- override;
+ absl_nonnull std::unique_ptr<NetworkManager> ReleaseNetworkManager() override;
std::vector<EmulatedEndpoint*> endpoints() const override {
return endpoints_container_->GetEndpoints();
@@ -57,19 +55,19 @@
private:
class NetworkManagerImpl;
- const absl::Nonnull<TaskQueueBase*> task_queue_;
- const absl::Nonnull<const EndpointsContainer*> endpoints_container_;
+ TaskQueueBase* absl_nonnull const task_queue_;
+ const EndpointsContainer* absl_nonnull const endpoints_container_;
// Socket server is owned by the `network_thread_'
- const absl::Nonnull<rtc::SocketServer*> socket_server_;
+ rtc::SocketServer* absl_nonnull const socket_server_;
- const absl::Nonnull<std::unique_ptr<Thread>> network_thread_;
- absl::Nullable<std::unique_ptr<NetworkManagerImpl>> network_manager_;
+ const absl_nonnull std::unique_ptr<Thread> network_thread_;
+ absl_nullable std::unique_ptr<NetworkManagerImpl> network_manager_;
// Keep pointer to the network manager when it is extracted to be injected
// into PeerConnectionFactory. That is brittle and may crash if a test would
// try to use emulated network after related PeerConnectionFactory is deleted.
- const absl::Nonnull<NetworkManagerImpl*> network_manager_ptr_;
+ NetworkManagerImpl* absl_nonnull const network_manager_ptr_;
};
} // namespace test
diff --git a/test/network/network_emulation.cc b/test/network/network_emulation.cc
index 4aa7be3..715b8ab 100644
--- a/test/network/network_emulation.cc
+++ b/test/network/network_emulation.cc
@@ -359,7 +359,7 @@
LinkEmulation::LinkEmulation(
Clock* clock,
- absl::Nonnull<TaskQueueBase*> task_queue,
+ TaskQueueBase* absl_nonnull task_queue,
std::unique_ptr<NetworkBehaviorInterface> network_behavior,
EmulatedNetworkReceiverInterface* receiver,
EmulatedNetworkStatsGatheringMode stats_gathering_mode,
@@ -464,7 +464,7 @@
});
}
-NetworkRouterNode::NetworkRouterNode(absl::Nonnull<TaskQueueBase*> task_queue)
+NetworkRouterNode::NetworkRouterNode(TaskQueueBase* absl_nonnull task_queue)
: task_queue_(task_queue) {}
void NetworkRouterNode::OnPacketReceived(EmulatedIpPacket packet) {
@@ -540,7 +540,7 @@
EmulatedNetworkNode::EmulatedNetworkNode(
Clock* clock,
- absl::Nonnull<TaskQueueBase*> task_queue,
+ TaskQueueBase* absl_nonnull task_queue,
std::unique_ptr<NetworkBehaviorInterface> network_behavior,
EmulatedNetworkStatsGatheringMode stats_gathering_mode,
bool fake_dtls_handshake_sizes)
@@ -593,11 +593,11 @@
config.allow_receive_packets_with_different_dest_ip),
log_name(ip.ToString() + " (" + config.name.value_or("") + ")") {}
-EmulatedEndpointImpl::EmulatedEndpointImpl(
- const Options& options,
- bool is_enabled,
- absl::Nonnull<TaskQueueBase*> task_queue,
- Clock* clock)
+EmulatedEndpointImpl::EmulatedEndpointImpl(const Options& options,
+ bool is_enabled,
+ TaskQueueBase* absl_nonnull
+ task_queue,
+ Clock* clock)
: options_(options),
is_enabled_(is_enabled),
clock_(clock),
diff --git a/test/network/network_emulation.h b/test/network/network_emulation.h
index 99fbe05..2bd523b 100644
--- a/test/network/network_emulation.h
+++ b/test/network/network_emulation.h
@@ -147,7 +147,7 @@
class LinkEmulation : public EmulatedNetworkReceiverInterface {
public:
LinkEmulation(Clock* clock,
- absl::Nonnull<TaskQueueBase*> task_queue,
+ TaskQueueBase* absl_nonnull task_queue,
std::unique_ptr<NetworkBehaviorInterface> network_behavior,
EmulatedNetworkReceiverInterface* receiver,
EmulatedNetworkStatsGatheringMode stats_gathering_mode,
@@ -168,7 +168,7 @@
size_t GetPacketSizeForEmulation(const EmulatedIpPacket& packet) const;
Clock* const clock_;
- const absl::Nonnull<TaskQueueBase*> task_queue_;
+ TaskQueueBase* absl_nonnull const task_queue_;
const std::unique_ptr<NetworkBehaviorInterface> network_behavior_
RTC_GUARDED_BY(task_queue_);
EmulatedNetworkReceiverInterface* const receiver_;
@@ -187,7 +187,7 @@
// the packet will be silently dropped.
class NetworkRouterNode : public EmulatedNetworkReceiverInterface {
public:
- explicit NetworkRouterNode(absl::Nonnull<TaskQueueBase*> task_queue);
+ explicit NetworkRouterNode(TaskQueueBase* absl_nonnull task_queue);
void OnPacketReceived(EmulatedIpPacket packet) override;
void SetReceiver(const IPAddress& dest_ip,
@@ -201,7 +201,7 @@
void SetFilter(std::function<bool(const EmulatedIpPacket&)> filter);
private:
- const absl::Nonnull<TaskQueueBase*> task_queue_;
+ TaskQueueBase* absl_nonnull const task_queue_;
std::optional<EmulatedNetworkReceiverInterface*> default_receiver_
RTC_GUARDED_BY(task_queue_);
std::map<IPAddress, EmulatedNetworkReceiverInterface*> routing_
@@ -225,7 +225,7 @@
// they are ready.
EmulatedNetworkNode(
Clock* clock,
- absl::Nonnull<TaskQueueBase*> task_queue,
+ TaskQueueBase* absl_nonnull task_queue,
std::unique_ptr<NetworkBehaviorInterface> network_behavior,
EmulatedNetworkStatsGatheringMode stats_gathering_mode,
bool fake_dtls_handshake_sizes);
@@ -285,7 +285,7 @@
EmulatedEndpointImpl(const Options& options,
bool is_enabled,
- absl::Nonnull<TaskQueueBase*> task_queue,
+ TaskQueueBase* absl_nonnull task_queue,
Clock* clock);
~EmulatedEndpointImpl() override;
@@ -344,7 +344,7 @@
const Options options_;
bool is_enabled_ RTC_GUARDED_BY(enable_state_mutex_);
Clock* const clock_;
- const absl::Nonnull<TaskQueueBase*> task_queue_;
+ TaskQueueBase* absl_nonnull const task_queue_;
std::unique_ptr<Network> network_;
NetworkRouterNode router_;
diff --git a/test/network/network_emulation_manager.cc b/test/network/network_emulation_manager.cc
index 0eaa189..fb8921e 100644
--- a/test/network/network_emulation_manager.cc
+++ b/test/network/network_emulation_manager.cc
@@ -301,7 +301,7 @@
});
}
-absl::Nonnull<EmulatedNetworkManagerInterface*>
+EmulatedNetworkManagerInterface* absl_nonnull
NetworkEmulationManagerImpl::CreateEmulatedNetworkManagerInterface(
const std::vector<EmulatedEndpoint*>& endpoints) {
std::vector<EmulatedEndpointImpl*> endpoint_impls;
diff --git a/test/network/network_emulation_manager.h b/test/network/network_emulation_manager.h
index 96c1f8a..c790a96 100644
--- a/test/network/network_emulation_manager.h
+++ b/test/network/network_emulation_manager.h
@@ -81,7 +81,7 @@
std::unique_ptr<CrossTrafficGenerator> generator) override;
void StopCrossTraffic(CrossTrafficGenerator* generator) override;
- absl::Nonnull<EmulatedNetworkManagerInterface*>
+ EmulatedNetworkManagerInterface* absl_nonnull
CreateEmulatedNetworkManagerInterface(
const std::vector<EmulatedEndpoint*>& endpoints) override;
diff --git a/test/wait_until_internal.h b/test/wait_until_internal.h
index 86ebd27..ce1f709 100644
--- a/test/wait_until_internal.h
+++ b/test/wait_until_internal.h
@@ -26,11 +26,11 @@
// This is inspired by testing::ExplainMatchResult and
// testing::internal::MatchPrintAndExplain.
template <typename T, typename M>
-bool ExplainMatchResult(
- const M& matcher,
- const T& value,
- absl::Nonnull<::testing::StringMatchResultListener*> listener,
- absl::string_view value_name) {
+bool ExplainMatchResult(const M& matcher,
+ const T& value,
+ ::testing::StringMatchResultListener* absl_nonnull
+ listener,
+ absl::string_view value_name) {
// SafeMatcherCast is required for matchers whose type does not match the
// argument type.
::testing::Matcher<const T&> safe_matcher =