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

Side by Side Diff: base/memory/ref_counted_unittest.nc

Issue 2723423002: Start BindStateBase ref count from 1 instead of 0 (Closed)
Patch Set: . Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/memory/ref_counted.h"
6
7 namespace base {
8
9 class InitialRefCountIsZero : public base::RefCounted<InitialRefCountIsZero> {
10 public:
11 InitialRefCountIsZero() {}
12 private:
13 friend class base::RefCounted<InitialRefCountIsZero>;
14 ~InitialRefCountIsZero() {}
15 };
16
17 #if defined(NCTEST_ADOPT_REF_TO_ZERO_START) // [r"fatal error: static_assert fa iled \"Use AdoptRef only for the reference count starts from one\.\""]
18
19 void WontCompile() {
20 AdoptRef(new InitialRefCountIsZero());
21 }
22
23 #endif
24
25 } // namespace base
OLDNEW
« base/memory/ref_counted_unittest.cc ('K') | « base/memory/ref_counted_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698