Value: static constexpr ::base::cef_subtle::StartRefCountFromOneTag \
kRefCountPreference = ::base::cef_subtle::kStartRefCountFromOneTag
The reference count starts from zero by default, and we intended to migrate to start-from-one ref count.
Put REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() to the ref counted class to opt-in.
If an object has start-from-one ref count, the first scoped_refptr need to be created by base::AdoptRef() or base::MakeRefCounted(). We can use base::MakeRefCounted() to create create both type of ref counted object.
The motivations to use start-from-one ref count are:
- Start-from-one ref count doesn't need the ref count increment for the first reference.
- It can detect an invalid object acquisition for a being-deleted object that has zero ref count. That tends to happen on custom deleter that delays the deletion. TODO(tzik): Implement invalid acquisition detection.
- Behavior parity to Blink's WTF::RefCounted, whose count starts from one. And start-from-one ref count is a step to merge WTF::RefCounted into base::RefCounted.