From c10c23a2b1999b1cb0354fd4db9837dc63a3d833 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 26 Aug 2016 16:52:33 -0700 Subject: Add -> operators to CFX_CountRef. Allows CFX_CountRefs to behave more like pointers. Rename SetNull() to Clear() for consistency with other ptrs. Change GetPrivateCopy() into MakePrivateCopy() with no return, since the -> operators are clearer than getting an object pointer. Review-Url: https://codereview.chromium.org/2283113002 --- core/fxcrt/cfx_count_ref_unittest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/fxcrt/cfx_count_ref_unittest.cpp') diff --git a/core/fxcrt/cfx_count_ref_unittest.cpp b/core/fxcrt/cfx_count_ref_unittest.cpp index 7651c93f25..2a36292b54 100644 --- a/core/fxcrt/cfx_count_ref_unittest.cpp +++ b/core/fxcrt/cfx_count_ref_unittest.cpp @@ -109,16 +109,19 @@ TEST(fxcrt, CountRefGetModify) { Observer observer; { CFX_CountRef ptr; - EXPECT_NE(nullptr, ptr.GetPrivateCopy(&observer, std::string("one"))); + ptr.MakePrivateCopy(&observer, std::string("one")); + EXPECT_NE(nullptr, ptr.GetObject()); EXPECT_EQ(1, observer.GetConstructionCount("one")); EXPECT_EQ(0, observer.GetDestructionCount("one")); - EXPECT_NE(nullptr, ptr.GetPrivateCopy(&observer, std::string("one"))); + ptr.MakePrivateCopy(&observer, std::string("one")); + EXPECT_NE(nullptr, ptr.GetObject()); EXPECT_EQ(1, observer.GetConstructionCount("one")); EXPECT_EQ(0, observer.GetDestructionCount("one")); { CFX_CountRef other(ptr); - EXPECT_NE(nullptr, ptr.GetPrivateCopy(&observer, std::string("one"))); + ptr.MakePrivateCopy(&observer, std::string("one")); + EXPECT_NE(nullptr, ptr.GetObject()); EXPECT_EQ(2, observer.GetConstructionCount("one")); EXPECT_EQ(0, observer.GetDestructionCount("one")); } -- cgit v1.2.3