diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-02 12:13:05 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-08 14:59:21 +0000 |
commit | ec24b2e338de2a6211723f19f54386c950ac5010 (patch) | |
tree | 02b891c24dd52215363c1a6a99c99e65a1f93729 /core/fxcrt/shared_copy_on_write_unittest.cpp | |
parent | 5553d8b11634935c34e7774325eda6afd61c8f56 (diff) | |
download | pdfium-ec24b2e338de2a6211723f19f54386c950ac5010.tar.xz |
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 <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/shared_copy_on_write_unittest.cpp')
-rw-r--r-- | core/fxcrt/shared_copy_on_write_unittest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 <map> #include <string> +#include "core/fxcrt/retain_ptr.h" #include "testing/gtest/include/gtest/gtest.h" namespace fxcrt { @@ -28,7 +29,7 @@ class Observer { std::map<std::string, int> 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_; |