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

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

Issue 2419173002: Update CPDF_IndirectObjectHolder APIs for unique objects (Closed)
Patch Set: windows Created 4 years, 2 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_data_avail.h" 7 #include "core/fpdfapi/parser/cpdf_data_avail.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 bool bPagePosGot = m_pHintTables->GetPagePos(index, &szPageStartPos, 1764 bool bPagePosGot = m_pHintTables->GetPagePos(index, &szPageStartPos,
1765 &szPageLength, &dwObjNum); 1765 &szPageLength, &dwObjNum);
1766 if (!bPagePosGot) 1766 if (!bPagePosGot)
1767 return nullptr; 1767 return nullptr;
1768 1768
1769 m_syntaxParser.InitParser(m_pFileRead, (uint32_t)szPageStartPos); 1769 m_syntaxParser.InitParser(m_pFileRead, (uint32_t)szPageStartPos);
1770 CPDF_Object* pPageDict = ParseIndirectObjectAt(0, dwObjNum, m_pDocument); 1770 CPDF_Object* pPageDict = ParseIndirectObjectAt(0, dwObjNum, m_pDocument);
1771 if (!pPageDict) 1771 if (!pPageDict)
1772 return nullptr; 1772 return nullptr;
1773 1773
1774 if (!m_pDocument->ReplaceIndirectObjectIfHigherGeneration(dwObjNum, 1774 if (!m_pDocument->ReplaceIndirectObjectIfHigherGeneration(
1775 pPageDict)) { 1775 dwObjNum, UniqueObject(pPageDict))) { // Owner?
1776 return nullptr; 1776 return nullptr;
1777 } 1777 }
1778 return pPageDict->GetDict(); 1778 return pPageDict->GetDict();
1779 } 1779 }
1780 } 1780 }
1781 return m_pDocument->GetPage(index); 1781 return m_pDocument->GetPage(index);
1782 } 1782 }
1783 1783
1784 CPDF_DataAvail::DocFormStatus CPDF_DataAvail::IsFormAvail( 1784 CPDF_DataAvail::DocFormStatus CPDF_DataAvail::IsFormAvail(
1785 DownloadHints* pHints) { 1785 DownloadHints* pHints) {
(...skipping 30 matching lines...) Expand all
1816 return FormAvailable; 1816 return FormAvailable;
1817 } 1817 }
1818 1818
1819 CPDF_DataAvail::PageNode::PageNode() : m_type(PDF_PAGENODE_UNKNOWN) {} 1819 CPDF_DataAvail::PageNode::PageNode() : m_type(PDF_PAGENODE_UNKNOWN) {}
1820 1820
1821 CPDF_DataAvail::PageNode::~PageNode() { 1821 CPDF_DataAvail::PageNode::~PageNode() {
1822 for (int32_t i = 0; i < m_childNode.GetSize(); ++i) 1822 for (int32_t i = 0; i < m_childNode.GetSize(); ++i)
1823 delete m_childNode[i]; 1823 delete m_childNode[i];
1824 m_childNode.RemoveAll(); 1824 m_childNode.RemoveAll();
1825 } 1825 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698