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

Unified Diff: base/memory/ref_counted_delete_on_sequence.h

Issue 2723423002: Start BindStateBase ref count from 1 instead of 0 (Closed)
Patch Set: s/MAKE_REF_COUNT_START_FROM_ONE/REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE()/ Created 3 years, 9 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
« no previous file with comments | « base/memory/ref_counted.cc ('k') | base/memory/ref_counted_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted_delete_on_sequence.h
diff --git a/base/memory/ref_counted_delete_on_sequence.h b/base/memory/ref_counted_delete_on_sequence.h
index a7600f9f8546068f5bcba4b124e61d0e95b1c6c7..2be035ce16d9967f7b40b446a702244e6b99be7d 100644
--- a/base/memory/ref_counted_delete_on_sequence.h
+++ b/base/memory/ref_counted_delete_on_sequence.h
@@ -33,10 +33,14 @@ namespace base {
template <class T>
class RefCountedDeleteOnSequence : public subtle::RefCountedThreadSafeBase {
public:
+ static constexpr subtle::StartRefCountFromZeroTag kRefCountPreference =
+ subtle::kStartRefCountFromZeroTag;
+
// A SequencedTaskRunner for the current sequence can be acquired by calling
// SequencedTaskRunnerHandle::Get().
RefCountedDeleteOnSequence(scoped_refptr<SequencedTaskRunner> task_runner)
- : task_runner_(std::move(task_runner)) {
+ : subtle::RefCountedThreadSafeBase(T::kRefCountPreference),
+ task_runner_(std::move(task_runner)) {
DCHECK(task_runner_);
}
« no previous file with comments | « base/memory/ref_counted.cc ('k') | base/memory/ref_counted_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698