From ec24b2e338de2a6211723f19f54386c950ac5010 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 2 Jan 2018 12:13:05 -0500 Subject: Make SharedCopyOnWrite use Retainables This CL removes the CountedObject from SharedCopyOnWrite and instead converts the items being shared into Retainable subclasses. BUG: chromium:792372 Change-Id: I9570a521f2fc2434013c3ccb103273bdd2440bb8 Reviewed-on: https://pdfium-review.googlesource.com/22010 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- core/fxcrt/shared_copy_on_write_unittest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fxcrt/shared_copy_on_write_unittest.cpp') diff --git a/core/fxcrt/shared_copy_on_write_unittest.cpp b/core/fxcrt/shared_copy_on_write_unittest.cpp index 01cc09468c..57e33d1019 100644 --- a/core/fxcrt/shared_copy_on_write_unittest.cpp +++ b/core/fxcrt/shared_copy_on_write_unittest.cpp @@ -7,6 +7,7 @@ #include #include +#include "core/fxcrt/retain_ptr.h" #include "testing/gtest/include/gtest/gtest.h" namespace fxcrt { @@ -28,7 +29,7 @@ class Observer { std::map destruction_counts_; }; -class Object { +class Object : public Retainable { public: Object(Observer* observer, const std::string& name) : name_(name), observer_(observer) { @@ -37,7 +38,7 @@ class Object { Object(const Object& that) : name_(that.name_), observer_(that.observer_) { observer_->OnConstruct(name_); } - ~Object() { observer_->OnDestruct(name_); } + ~Object() override { observer_->OnDestruct(name_); } private: std::string name_; -- cgit v1.2.3