Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "core/fpdfapi/parser/cpdf_indirect_object_holder.h" | 7 #include "core/fpdfapi/parser/cpdf_indirect_object_holder.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "core/fpdfapi/parser/cpdf_object.h" | 12 #include "core/fpdfapi/parser/cpdf_object.h" |
| 13 #include "core/fpdfapi/parser/cpdf_parser.h" | 13 #include "core/fpdfapi/parser/cpdf_parser.h" |
| 14 #include "third_party/base/logging.h" | |
|
dsinclair
2017/01/23 14:46:33
?
Tom Sepez
2017/01/23 18:19:14
IWYU for invocation of CHECK() at line 56
| |
| 14 | 15 |
| 15 CPDF_IndirectObjectHolder::CPDF_IndirectObjectHolder() | 16 CPDF_IndirectObjectHolder::CPDF_IndirectObjectHolder() |
| 16 : m_LastObjNum(0), | 17 : m_LastObjNum(0), |
| 17 m_pByteStringPool(pdfium::MakeUnique<CFX_ByteStringPool>()) {} | 18 m_pByteStringPool(pdfium::MakeUnique<CFX_ByteStringPool>()) {} |
| 18 | 19 |
| 19 CPDF_IndirectObjectHolder::~CPDF_IndirectObjectHolder() { | 20 CPDF_IndirectObjectHolder::~CPDF_IndirectObjectHolder() { |
| 20 m_pByteStringPool.DeleteObject(); // Make weak. | 21 m_pByteStringPool.DeleteObject(); // Make weak. |
| 21 } | 22 } |
| 22 | 23 |
| 23 CPDF_Object* CPDF_IndirectObjectHolder::GetIndirectObject( | 24 CPDF_Object* CPDF_IndirectObjectHolder::GetIndirectObject( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 return true; | 78 return true; |
| 78 } | 79 } |
| 79 | 80 |
| 80 void CPDF_IndirectObjectHolder::DeleteIndirectObject(uint32_t objnum) { | 81 void CPDF_IndirectObjectHolder::DeleteIndirectObject(uint32_t objnum) { |
| 81 CPDF_Object* pObj = GetIndirectObject(objnum); | 82 CPDF_Object* pObj = GetIndirectObject(objnum); |
| 82 if (!pObj || pObj->GetObjNum() == CPDF_Object::kInvalidObjNum) | 83 if (!pObj || pObj->GetObjNum() == CPDF_Object::kInvalidObjNum) |
| 83 return; | 84 return; |
| 84 | 85 |
| 85 m_IndirectObjs.erase(objnum); | 86 m_IndirectObjs.erase(objnum); |
| 86 } | 87 } |
| OLD | NEW |