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

Unified Diff: xfa/fgas/font/cfgas_gefont.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/fgas/font/cfgas_gefont.h ('k') | xfa/fxfa/parser/cxfa_dataexporter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/font/cfgas_gefont.cpp
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index 3bca4dc09fa7cf48efafa095bc9a5516cb0b217b..bc971f6294b461c08e1ba46d85d832565fbd1c60 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -72,9 +72,10 @@ CFGAS_GEFont* CFGAS_GEFont::LoadFont(const uint8_t* pBuffer,
}
// static
-CFGAS_GEFont* CFGAS_GEFont::LoadFont(IFGAS_Stream* pFontStream,
- CFGAS_FontMgr* pFontMgr,
- bool bSaveStream) {
+CFGAS_GEFont* CFGAS_GEFont::LoadFont(
+ const CFX_RetainPtr<IFGAS_Stream>& pFontStream,
+ CFGAS_FontMgr* pFontMgr,
+ bool bSaveStream) {
CFGAS_GEFont* pFont = new CFGAS_GEFont(pFontMgr);
if (!pFont->LoadFontInternal(pFontStream, bSaveStream)) {
pFont->Release();
@@ -203,12 +204,13 @@ bool CFGAS_GEFont::LoadFontInternal(const uint8_t* pBuffer, int32_t length) {
return InitFont();
}
-bool CFGAS_GEFont::LoadFontInternal(IFGAS_Stream* pFontStream,
- bool bSaveStream) {
+bool CFGAS_GEFont::LoadFontInternal(
+ const CFX_RetainPtr<IFGAS_Stream>& pFontStream,
+ bool bSaveStream) {
if (m_pFont || m_pFileRead || !pFontStream || pFontStream->GetLength() < 1)
return false;
if (bSaveStream)
- m_pStream.reset(pFontStream);
+ m_pStream = pFontStream;
m_pFileRead = pFontStream->MakeSeekableReadStream();
m_pFont = new CFX_Font;
« no previous file with comments | « xfa/fgas/font/cfgas_gefont.h ('k') | xfa/fxfa/parser/cxfa_dataexporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698