From dd1083b47c029d2540aceb246bf80f549781f62f Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Fri, 6 Jul 2018 17:28:46 +0000 Subject: Revert "Avoid duplicate data buffering in CPDF_SyntaxParser::ReadStream()." This reverts commit 77f15f7883638a4ced131d74c053af10a5970ce9. Reason for revert: Causes crbug.com/860210 Bug: chromium:860210 Original change's description: > Avoid duplicate data buffering in CPDF_SyntaxParser::ReadStream(). > > Allow sub-streams created from an IFX_SeekableReadStream to provide > stream data without copying memory. > The data will only reside in the top-level stream. > > For example: > For file > http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf > (18 Mb) > > The memory usage is reduced by ~13 Mb. > > Change-Id: I2595c014d0fbe1fdd181cc04965cfd7d901c2d88 > Reviewed-on: https://pdfium-review.googlesource.com/35930 > Commit-Queue: Art Snake > Reviewed-by: dsinclair TBR=tsepez@chromium.org,dsinclair@chromium.org,art-snake@yandex-team.ru # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I947fca17052765935a952a4f25ca48f6599c4af9 Reviewed-on: https://pdfium-review.googlesource.com/37210 Reviewed-by: Henrique Nakashima Commit-Queue: Henrique Nakashima --- testing/embedder_test.cpp | 4 +--- testing/embedder_test.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'testing') diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index e874640218..e4ac4ad2c7 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -351,9 +351,7 @@ FPDF_DOCUMENT EmbedderTest::OpenSavedDocument(const char* password) { memset(&saved_file_access_, 0, sizeof(saved_file_access_)); saved_file_access_.m_FileLen = data_string_.size(); saved_file_access_.m_GetBlock = GetBlockFromString; - // Copy data to prevent clearing it before saved document close. - saved_document_file_data_ = data_string_; - saved_file_access_.m_Param = &saved_document_file_data_; + saved_file_access_.m_Param = &data_string_; saved_fake_file_access_ = pdfium::MakeUnique(&saved_file_access_); diff --git a/testing/embedder_test.h b/testing/embedder_test.h index b0dada0341..e8f76c058f 100644 --- a/testing/embedder_test.h +++ b/testing/embedder_test.h @@ -260,7 +260,6 @@ class EmbedderTest : public ::testing::Test, int GetPageNumberForSavedPage(FPDF_PAGE page) const; std::string data_string_; - std::string saved_document_file_data_; std::ofstream filestream_; }; -- cgit v1.2.3