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

Unified Diff: xfa/fde/css/fde_csssyntax.cpp

Issue 2559763002: Refcount IFGAS_ streams all the time, too (Closed)
Patch Set: more 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fde/css/fde_csssyntax.h ('k') | xfa/fde/xml/fde_xml_imp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/css/fde_csssyntax.cpp
diff --git a/xfa/fde/css/fde_csssyntax.cpp b/xfa/fde/css/fde_csssyntax.cpp
index bdad0155d5903075c1b5da6d83bd0ead16c0d30f..50ad1908575e780f1ba21f5c362eb6d1d999f2ab 100644
--- a/xfa/fde/css/fde_csssyntax.cpp
+++ b/xfa/fde/css/fde_csssyntax.cpp
@@ -35,7 +35,7 @@ CFDE_CSSSyntaxParser::~CFDE_CSSSyntaxParser() {
m_TextPlane.Reset();
}
-bool CFDE_CSSSyntaxParser::Init(IFGAS_Stream* pStream,
+bool CFDE_CSSSyntaxParser::Init(const CFX_RetainPtr<IFGAS_Stream>& pStream,
int32_t iCSSPlaneSize,
int32_t iTextDataSize,
bool bOnlyDeclaration) {
@@ -433,22 +433,25 @@ bool CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) {
m_bExtBuf = false;
return ExpandBuf(iAllocSize);
}
-int32_t CFDE_CSSTextBuf::LoadFromStream(IFGAS_Stream* pTxtStream,
- int32_t iStreamOffset,
- int32_t iMaxChars,
- bool& bEOS) {
+
+int32_t CFDE_CSSTextBuf::LoadFromStream(
+ const CFX_RetainPtr<IFGAS_Stream>& pTxtStream,
+ int32_t iStreamOffset,
+ int32_t iMaxChars,
+ bool& bEOS) {
ASSERT(iStreamOffset >= 0 && iMaxChars > 0);
Clear();
m_bExtBuf = false;
- if (!ExpandBuf(iMaxChars)) {
+ if (!ExpandBuf(iMaxChars))
return 0;
- }
- if (pTxtStream->GetPosition() != iStreamOffset) {
+
+ if (pTxtStream->GetPosition() != iStreamOffset)
pTxtStream->Seek(FX_STREAMSEEK_Begin, iStreamOffset);
- }
+
m_iDatLen = pTxtStream->ReadString(m_pBuffer, iMaxChars, bEOS);
return m_iDatLen;
}
+
bool CFDE_CSSTextBuf::ExpandBuf(int32_t iDesiredSize) {
if (m_bExtBuf) {
return false;
« no previous file with comments | « xfa/fde/css/fde_csssyntax.h ('k') | xfa/fde/xml/fde_xml_imp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698