OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 (*assigns_)++; | 120 (*assigns_)++; |
121 } | 121 } |
122 | 122 |
123 return *this; | 123 return *this; |
124 } | 124 } |
125 | 125 |
126 int copies() const { | 126 int copies() const { |
127 return *copies_; | 127 return *copies_; |
128 } | 128 } |
129 | 129 |
130 int assigns() const { | |
131 return *assigns_; | |
132 } | |
133 | |
134 private: | 130 private: |
135 int* copies_; | 131 int* copies_; |
136 int* assigns_; | 132 int* assigns_; |
137 }; | 133 }; |
138 | 134 |
139 class DeleteCounter { | 135 class DeleteCounter { |
140 public: | 136 public: |
141 explicit DeleteCounter(int* deletes) | 137 explicit DeleteCounter(int* deletes) |
142 : deletes_(deletes) { | 138 : deletes_(deletes) { |
143 } | 139 } |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 base::Callback<void(int)> null_cb; | 820 base::Callback<void(int)> null_cb; |
825 ASSERT_TRUE(null_cb.is_null()); | 821 ASSERT_TRUE(null_cb.is_null()); |
826 EXPECT_DEATH(base::Bind(null_cb, 42), ""); | 822 EXPECT_DEATH(base::Bind(null_cb, 42), ""); |
827 } | 823 } |
828 | 824 |
829 #endif // (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) && | 825 #endif // (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) && |
830 // GTEST_HAS_DEATH_TEST | 826 // GTEST_HAS_DEATH_TEST |
831 | 827 |
832 } // namespace | 828 } // namespace |
833 } // namespace base | 829 } // namespace base |
OLD | NEW |