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

Unified Diff: xfa/fxfa/app/xfa_ffapp.cpp

Issue 2545953002: Make concrete stream classes private to .cpp, part 3 (Closed)
Patch Set: 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 | « no previous file | xfa/fxfa/app/xfa_ffapp_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffapp.cpp
diff --git a/xfa/fxfa/app/xfa_ffapp.cpp b/xfa/fxfa/app/xfa_ffapp.cpp
index 797c3e72f0fbf2810bb4d53a663e8fa860700661..9c0411b731e1b7f3c941db991126f0cebdc58c2b 100644
--- a/xfa/fxfa/app/xfa_ffapp.cpp
+++ b/xfa/fxfa/app/xfa_ffapp.cpp
@@ -21,6 +21,22 @@
#include "xfa/fxfa/xfa_ffwidgethandler.h"
#include "xfa/fxfa/xfa_fontmgr.h"
+namespace {
+
+class CXFA_FileRead : public IFX_SeekableReadStream {
+ public:
+ explicit CXFA_FileRead(const std::vector<CPDF_Stream*>& streams);
+ ~CXFA_FileRead() override;
+
+ // IFX_SeekableReadStream
+ FX_FILESIZE GetSize() override;
+ bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
+ void Release() override;
+
+ private:
+ CFX_ObjectArray<CPDF_StreamAcc> m_Data;
+};
+
CXFA_FileRead::CXFA_FileRead(const std::vector<CPDF_Stream*>& streams) {
for (CPDF_Stream* pStream : streams) {
CPDF_StreamAcc& acc = m_Data.Add();
@@ -72,6 +88,13 @@ void CXFA_FileRead::Release() {
delete this;
}
+} // namespace
+
+IFX_SeekableReadStream* MakeSeekableReadStream(
+ const std::vector<CPDF_Stream*>& streams) {
+ return new CXFA_FileRead(streams);
+}
+
CXFA_FFApp::CXFA_FFApp(IXFA_AppProvider* pProvider)
: m_pProvider(pProvider),
m_pWidgetMgrDelegate(nullptr),
« no previous file with comments | « no previous file | xfa/fxfa/app/xfa_ffapp_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698