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

Unified Diff: xfa/fxfa/parser/cxfa_node.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/fxfa/parser/cxfa_dataexporter.cpp ('k') | xfa/fxfa/parser/cxfa_simple_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/cxfa_node.cpp
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 5dd6c527171faf59f5cc0d99b631404d7250aca9..f3f79cbbec3aa763673f7fdd7b40f91e9bc65383 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1445,11 +1445,9 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
IFX_MemoryStream::Create(true);
// Note: ambiguious below without static_cast.
- std::unique_ptr<IFGAS_Stream, ReleaseDeleter<IFGAS_Stream>> pStream(
- IFGAS_Stream::CreateStream(
- CFX_RetainPtr<IFX_SeekableWriteStream>(pMemoryStream),
- FX_STREAMACCESS_Text | FX_STREAMACCESS_Write |
- FX_STREAMACCESS_Append));
+ CFX_RetainPtr<IFGAS_Stream> pStream = IFGAS_Stream::CreateStream(
+ CFX_RetainPtr<IFX_SeekableWriteStream>(pMemoryStream),
+ FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | FX_STREAMACCESS_Append);
if (!pStream) {
pArguments->GetReturnValue()->SetString(bsXMLHeader);
@@ -1458,9 +1456,9 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
pStream->SetCodePage(FX_CODEPAGE_UTF8);
pStream->WriteData(bsXMLHeader.raw_str(), bsXMLHeader.GetLength());
if (GetPacketID() == XFA_XDPPACKET_Form)
- XFA_DataExporter_RegenerateFormFile(this, pStream.get(), nullptr, true);
+ XFA_DataExporter_RegenerateFormFile(this, pStream, nullptr, true);
else
- pElement->SaveXMLNode(pStream.get());
+ pElement->SaveXMLNode(pStream);
// TODO(weili): Check whether we need to save pretty print XML, pdfium:501.
// For now, just put it here to avoid unused variable warning.
(void)bPrettyMode;
« no previous file with comments | « xfa/fxfa/parser/cxfa_dataexporter.cpp ('k') | xfa/fxfa/parser/cxfa_simple_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698