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

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

Issue 2451493002: Refcount all the IFX_ stream classes all the time. (Closed)
Patch Set: Clean up cast expression Created 4 years 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_syntax_parser.h" 7 #include "core/fpdfapi/parser/cpdf_syntax_parser.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 int numMarkers = ReadEOLMarkers(m_Pos); 749 int numMarkers = ReadEOLMarkers(m_Pos);
750 if (m_WordSize == static_cast<unsigned int>(kEndObjStr.GetLength()) && 750 if (m_WordSize == static_cast<unsigned int>(kEndObjStr.GetLength()) &&
751 numMarkers != 0 && 751 numMarkers != 0 &&
752 FXSYS_memcmp(m_WordBuffer, kEndObjStr.raw_str(), 752 FXSYS_memcmp(m_WordBuffer, kEndObjStr.raw_str(),
753 kEndObjStr.GetLength()) == 0) { 753 kEndObjStr.GetLength()) == 0) {
754 m_Pos = streamStartPos; 754 m_Pos = streamStartPos;
755 } 755 }
756 return pStream; 756 return pStream;
757 } 757 }
758 758
759 void CPDF_SyntaxParser::InitParser(IFX_SeekableReadStream* pFileAccess, 759 void CPDF_SyntaxParser::InitParser(
760 uint32_t HeaderOffset) { 760 const CFX_RetainPtr<IFX_SeekableReadStream>& pFileAccess,
761 uint32_t HeaderOffset) {
761 FX_Free(m_pFileBuf); 762 FX_Free(m_pFileBuf);
762 763
763 m_pFileBuf = FX_Alloc(uint8_t, m_BufSize); 764 m_pFileBuf = FX_Alloc(uint8_t, m_BufSize);
764 m_HeaderOffset = HeaderOffset; 765 m_HeaderOffset = HeaderOffset;
765 m_FileLen = pFileAccess->GetSize(); 766 m_FileLen = pFileAccess->GetSize();
766 m_Pos = 0; 767 m_Pos = 0;
767 m_pFileAccess = pFileAccess; 768 m_pFileAccess = pFileAccess;
768 m_BufOffset = 0; 769 m_BufOffset = 0;
769 pFileAccess->ReadBlock(m_pFileBuf, 0, 770 pFileAccess->ReadBlock(m_pFileBuf, 0,
770 std::min(m_BufSize, static_cast<uint32_t>(m_FileLen))); 771 std::min(m_BufSize, static_cast<uint32_t>(m_FileLen)));
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 if (limit && m_Pos == limit) 902 if (limit && m_Pos == limit)
902 return -1; 903 return -1;
903 } 904 }
904 return -1; 905 return -1;
905 } 906 }
906 907
907 void CPDF_SyntaxParser::SetEncrypt( 908 void CPDF_SyntaxParser::SetEncrypt(
908 std::unique_ptr<CPDF_CryptoHandler> pCryptoHandler) { 909 std::unique_ptr<CPDF_CryptoHandler> pCryptoHandler) {
909 m_pCryptoHandler = std::move(pCryptoHandler); 910 m_pCryptoHandler = std::move(pCryptoHandler);
910 } 911 }
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cpdf_syntax_parser.h ('k') | core/fpdfapi/parser/cpdf_syntax_parser_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698