mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Allow absl::Nonnull and absl::Nullable.
This CL includes follow-up changes from https://webrtc-review.googlesource.com/c/src/+/324280 Bug: none Change-Id: I6abad16e05cac7197c51ffa7b1d3fb991843df6e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325243 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41030}
This commit is contained in:
parent
bcaaefdcfc
commit
fd3b346e27
5 changed files with 12 additions and 4 deletions
1
DEPS
1
DEPS
|
@ -2602,6 +2602,7 @@ include_rules = [
|
||||||
"+absl/base/attributes.h",
|
"+absl/base/attributes.h",
|
||||||
"+absl/base/config.h",
|
"+absl/base/config.h",
|
||||||
"+absl/base/const_init.h",
|
"+absl/base/const_init.h",
|
||||||
|
"+absl/base/nullability.h",
|
||||||
"+absl/base/macros.h",
|
"+absl/base/macros.h",
|
||||||
"+absl/cleanup/cleanup.h",
|
"+absl/cleanup/cleanup.h",
|
||||||
"+absl/container/inlined_vector.h",
|
"+absl/container/inlined_vector.h",
|
||||||
|
|
|
@ -132,7 +132,10 @@ rtc_library("pending_task_safety_flag") {
|
||||||
"../../rtc_base/system:no_unique_address",
|
"../../rtc_base/system:no_unique_address",
|
||||||
"../../rtc_base/system:rtc_export",
|
"../../rtc_base/system:rtc_export",
|
||||||
]
|
]
|
||||||
absl_deps = [ "//third_party/abseil-cpp/absl/functional:any_invocable" ]
|
absl_deps = [
|
||||||
|
"//third_party/abseil-cpp/absl/base:nullability",
|
||||||
|
"//third_party/abseil-cpp/absl/functional:any_invocable",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtc_include_tests) {
|
if (rtc_include_tests) {
|
||||||
|
|
|
@ -37,7 +37,8 @@ PendingTaskSafetyFlag::CreateDetached() {
|
||||||
rtc::scoped_refptr<PendingTaskSafetyFlag>
|
rtc::scoped_refptr<PendingTaskSafetyFlag>
|
||||||
PendingTaskSafetyFlag::CreateAttachedToTaskQueue(
|
PendingTaskSafetyFlag::CreateAttachedToTaskQueue(
|
||||||
bool alive,
|
bool alive,
|
||||||
TaskQueueBase* attached_queue) {
|
absl::Nonnull<TaskQueueBase*> attached_queue) {
|
||||||
|
RTC_DCHECK(attached_queue) << "Null TaskQueue provided";
|
||||||
return rtc::scoped_refptr<PendingTaskSafetyFlag>(
|
return rtc::scoped_refptr<PendingTaskSafetyFlag>(
|
||||||
new PendingTaskSafetyFlag(alive, attached_queue));
|
new PendingTaskSafetyFlag(alive, attached_queue));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "absl/base/nullability.h"
|
||||||
#include "absl/functional/any_invocable.h"
|
#include "absl/functional/any_invocable.h"
|
||||||
#include "api/ref_counted_base.h"
|
#include "api/ref_counted_base.h"
|
||||||
#include "api/scoped_refptr.h"
|
#include "api/scoped_refptr.h"
|
||||||
|
@ -72,7 +73,7 @@ class RTC_EXPORT PendingTaskSafetyFlag final
|
||||||
// a given task queue and the `alive()` flag specified.
|
// a given task queue and the `alive()` flag specified.
|
||||||
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateAttachedToTaskQueue(
|
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateAttachedToTaskQueue(
|
||||||
bool alive,
|
bool alive,
|
||||||
TaskQueueBase* attached_queue);
|
absl::Nonnull<TaskQueueBase*> attached_queue);
|
||||||
|
|
||||||
// Same as `CreateDetached()` except the initial state of the returned flag
|
// Same as `CreateDetached()` except the initial state of the returned flag
|
||||||
// will be `!alive()`.
|
// will be `!alive()`.
|
||||||
|
@ -101,7 +102,8 @@ class RTC_EXPORT PendingTaskSafetyFlag final
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit PendingTaskSafetyFlag(bool alive) : alive_(alive) {}
|
explicit PendingTaskSafetyFlag(bool alive) : alive_(alive) {}
|
||||||
PendingTaskSafetyFlag(bool alive, TaskQueueBase* attached_queue)
|
PendingTaskSafetyFlag(bool alive,
|
||||||
|
absl::Nonnull<TaskQueueBase*> attached_queue)
|
||||||
: alive_(alive), main_sequence_(attached_queue) {}
|
: alive_(alive), main_sequence_(attached_queue) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -29,6 +29,7 @@ will generate a shared library.
|
||||||
* `absl::bind_front`
|
* `absl::bind_front`
|
||||||
* `absl::Cleanup`
|
* `absl::Cleanup`
|
||||||
* `absl::InlinedVector`
|
* `absl::InlinedVector`
|
||||||
|
* `absl::Nonnull` and `absl::Nullable`
|
||||||
* `absl::WrapUnique`
|
* `absl::WrapUnique`
|
||||||
* `absl::optional` and related stuff from `absl/types/optional.h`.
|
* `absl::optional` and related stuff from `absl/types/optional.h`.
|
||||||
* `absl::string_view`
|
* `absl::string_view`
|
||||||
|
|
Loading…
Reference in a new issue