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

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

Issue 2482973002: Rename CPDF_Linearized to CPDF_LinearizedHeader (Closed)
Patch Set: Remove if Created 4 years, 1 month 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>
11 #include <utility> 11 #include <utility>
12 12
13 #include "core/fpdfapi/cpdf_modulemgr.h" 13 #include "core/fpdfapi/cpdf_modulemgr.h"
14 #include "core/fpdfapi/parser/cpdf_array.h" 14 #include "core/fpdfapi/parser/cpdf_array.h"
15 #include "core/fpdfapi/parser/cpdf_dictionary.h" 15 #include "core/fpdfapi/parser/cpdf_dictionary.h"
16 #include "core/fpdfapi/parser/cpdf_document.h" 16 #include "core/fpdfapi/parser/cpdf_document.h"
17 #include "core/fpdfapi/parser/cpdf_hint_tables.h" 17 #include "core/fpdfapi/parser/cpdf_hint_tables.h"
18 #include "core/fpdfapi/parser/cpdf_linearized.h" 18 #include "core/fpdfapi/parser/cpdf_linearized_header.h"
19 #include "core/fpdfapi/parser/cpdf_name.h" 19 #include "core/fpdfapi/parser/cpdf_name.h"
20 #include "core/fpdfapi/parser/cpdf_number.h" 20 #include "core/fpdfapi/parser/cpdf_number.h"
21 #include "core/fpdfapi/parser/cpdf_reference.h" 21 #include "core/fpdfapi/parser/cpdf_reference.h"
22 #include "core/fpdfapi/parser/cpdf_stream.h" 22 #include "core/fpdfapi/parser/cpdf_stream.h"
23 #include "core/fpdfapi/parser/fpdf_parser_utility.h" 23 #include "core/fpdfapi/parser/fpdf_parser_utility.h"
24 #include "core/fxcrt/fx_ext.h" 24 #include "core/fxcrt/fx_ext.h"
25 #include "core/fxcrt/fx_safe_types.h" 25 #include "core/fxcrt/fx_safe_types.h"
26 #include "third_party/base/stl_util.h" 26 #include "third_party/base/stl_util.h"
27 27
28 CPDF_DataAvail::FileAvail::~FileAvail() {} 28 CPDF_DataAvail::FileAvail::~FileAvail() {}
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 m_dwHeaderOffset = offset; 776 m_dwHeaderOffset = offset;
777 m_syntaxParser.InitParser(file.get(), offset); 777 m_syntaxParser.InitParser(file.get(), offset);
778 m_syntaxParser.RestorePos(m_syntaxParser.m_HeaderOffset + 9); 778 m_syntaxParser.RestorePos(m_syntaxParser.m_HeaderOffset + 9);
779 779
780 bool bNumber; 780 bool bNumber;
781 CFX_ByteString wordObjNum = m_syntaxParser.GetNextWord(&bNumber); 781 CFX_ByteString wordObjNum = m_syntaxParser.GetNextWord(&bNumber);
782 if (!bNumber) 782 if (!bNumber)
783 return false; 783 return false;
784 784
785 uint32_t objnum = FXSYS_atoui(wordObjNum.c_str()); 785 uint32_t objnum = FXSYS_atoui(wordObjNum.c_str());
786 m_pLinearized = CPDF_Linearized::CreateForObject(pdfium::WrapUnique( 786 m_pLinearized = CPDF_LinearizedHeader::CreateForObject(pdfium::WrapUnique(
787 ParseIndirectObjectAt(m_syntaxParser.m_HeaderOffset + 9, objnum))); 787 ParseIndirectObjectAt(m_syntaxParser.m_HeaderOffset + 9, objnum)));
788 if (!m_pLinearized || 788 if (!m_pLinearized ||
789 m_pLinearized->GetFileSize() != m_pFileRead->GetSize()) { 789 m_pLinearized->GetFileSize() != m_pFileRead->GetSize()) {
790 m_pLinearized.reset(); 790 m_pLinearized.reset();
791 return false; 791 return false;
792 } 792 }
793 return true; 793 return true;
794 } 794 }
795 795
796 bool CPDF_DataAvail::CheckEnd(DownloadHints* pHints) { 796 bool CPDF_DataAvail::CheckEnd(DownloadHints* pHints) {
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 return FormAvailable; 1726 return FormAvailable;
1727 } 1727 }
1728 1728
1729 CPDF_DataAvail::PageNode::PageNode() : m_type(PDF_PAGENODE_UNKNOWN) {} 1729 CPDF_DataAvail::PageNode::PageNode() : m_type(PDF_PAGENODE_UNKNOWN) {}
1730 1730
1731 CPDF_DataAvail::PageNode::~PageNode() { 1731 CPDF_DataAvail::PageNode::~PageNode() {
1732 for (int32_t i = 0; i < m_childNode.GetSize(); ++i) 1732 for (int32_t i = 0; i < m_childNode.GetSize(); ++i)
1733 delete m_childNode[i]; 1733 delete m_childNode[i];
1734 m_childNode.RemoveAll(); 1734 m_childNode.RemoveAll();
1735 } 1735 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698