Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: core/fxcrt/include/cfx_count_ref.h

Issue 2301263003: Make CPDF_ClipPath have a CPDF_ClipPathData rather than inheriting (Closed)
Patch Set: safe bool while we're at it Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_page/include/cpdf_clippath.h ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FXCRT_INCLUDE_CFX_COUNT_REF_H_ 7 #ifndef CORE_FXCRT_INCLUDE_CFX_COUNT_REF_H_
8 #define CORE_FXCRT_INCLUDE_CFX_COUNT_REF_H_ 8 #define CORE_FXCRT_INCLUDE_CFX_COUNT_REF_H_
9 9
10 #include "core/fxcrt/include/cfx_retain_ptr.h" 10 #include "core/fxcrt/include/cfx_retain_ptr.h"
11 #include "core/fxcrt/include/fx_system.h" 11 #include "core/fxcrt/include/fx_system.h"
12 12
13 // A shared object with Copy on Write semantics that makes it appear as
14 // if each one were independent.
13 template <class ObjClass> 15 template <class ObjClass>
14 class CFX_CountRef { 16 class CFX_CountRef {
15 public: 17 public:
16 CFX_CountRef() {} 18 CFX_CountRef() {}
17 CFX_CountRef(const CFX_CountRef& other) : m_pObject(other.m_pObject) {} 19 CFX_CountRef(const CFX_CountRef& other) : m_pObject(other.m_pObject) {}
18 ~CFX_CountRef() {} 20 ~CFX_CountRef() {}
19 21
20 template <typename... Args> 22 template <typename... Args>
21 ObjClass* Emplace(Args... params) { 23 ObjClass* Emplace(Args... params) {
22 m_pObject.Reset(new CountedObj(params...)); 24 m_pObject.Reset(new CountedObj(params...));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 65 }
64 66
65 private: 67 private:
66 intptr_t m_RefCount; 68 intptr_t m_RefCount;
67 }; 69 };
68 70
69 CFX_RetainPtr<CountedObj> m_pObject; 71 CFX_RetainPtr<CountedObj> m_pObject;
70 }; 72 };
71 73
72 #endif // CORE_FXCRT_INCLUDE_CFX_COUNT_REF_H_ 74 #endif // CORE_FXCRT_INCLUDE_CFX_COUNT_REF_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/include/cpdf_clippath.h ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698