From fbda17d61de1e02799f5d77dceb23df3688b764e Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 30 Aug 2016 10:32:36 -0700 Subject: Make CPDF_TextState have a CPDF_TextStateData rather than inheriting one. Review-Url: https://codereview.chromium.org/2287313004 --- core/fxcrt/cfx_count_ref_unittest.cpp | 10 +++++----- core/fxcrt/include/cfx_count_ref.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'core/fxcrt') diff --git a/core/fxcrt/cfx_count_ref_unittest.cpp b/core/fxcrt/cfx_count_ref_unittest.cpp index 7651c93f25..6cb9f4a2fe 100644 --- a/core/fxcrt/cfx_count_ref_unittest.cpp +++ b/core/fxcrt/cfx_count_ref_unittest.cpp @@ -58,7 +58,7 @@ TEST(fxcrt, CountRefCopy) { Observer observer; { CFX_CountRef ptr1; - ptr1.New(&observer, std::string("one")); + ptr1.Emplace(&observer, std::string("one")); { CFX_CountRef ptr2 = ptr1; EXPECT_EQ(1, observer.GetConstructionCount("one")); @@ -79,8 +79,8 @@ TEST(fxcrt, CountRefAssignOverOld) { Observer observer; { CFX_CountRef ptr1; - ptr1.New(&observer, std::string("one")); - ptr1.New(&observer, std::string("two")); + ptr1.Emplace(&observer, std::string("one")); + ptr1.Emplace(&observer, std::string("two")); EXPECT_EQ(1, observer.GetConstructionCount("one")); EXPECT_EQ(1, observer.GetConstructionCount("two")); EXPECT_EQ(1, observer.GetDestructionCount("one")); @@ -93,9 +93,9 @@ TEST(fxcrt, CountRefAssignOverRetained) { Observer observer; { CFX_CountRef ptr1; - ptr1.New(&observer, std::string("one")); + ptr1.Emplace(&observer, std::string("one")); CFX_CountRef ptr2(ptr1); - ptr1.New(&observer, std::string("two")); + ptr1.Emplace(&observer, std::string("two")); EXPECT_EQ(1, observer.GetConstructionCount("one")); EXPECT_EQ(1, observer.GetConstructionCount("two")); EXPECT_EQ(0, observer.GetDestructionCount("one")); diff --git a/core/fxcrt/include/cfx_count_ref.h b/core/fxcrt/include/cfx_count_ref.h index 954b72bf88..aac18b166a 100644 --- a/core/fxcrt/include/cfx_count_ref.h +++ b/core/fxcrt/include/cfx_count_ref.h @@ -18,7 +18,7 @@ class CFX_CountRef { ~CFX_CountRef() {} template - ObjClass* New(Args... params) { + ObjClass* Emplace(Args... params) { m_pObject.Reset(new CountedObj(params...)); return m_pObject.Get(); } @@ -35,7 +35,7 @@ class CFX_CountRef { template ObjClass* GetPrivateCopy(Args... params) { if (!m_pObject) - return New(params...); + return Emplace(params...); if (!m_pObject->HasOneRef()) m_pObject.Reset(new CountedObj(*m_pObject)); return m_pObject.Get(); -- cgit v1.2.3