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

Side by Side Diff: core/fpdfapi/parser/cpdf_indirect_object_holder.cpp

Issue 2640143003: Update safe numerics package to get bitwise ops (Closed)
Patch Set: 0 is a perfectly fine value of zero Created 3 years, 11 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
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 #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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698