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

Unified Diff: ui/file_manager/zip_archiver/cpp/compressor_stream.h

Issue 2807063002: Replace Libarchive with MiniZip. (Closed)
Patch Set: Fix the code according to the comments. Created 3 years, 8 months 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
Index: ui/file_manager/zip_archiver/cpp/compressor_stream.h
diff --git a/ui/file_manager/zip_archiver/cpp/compressor_stream.h b/ui/file_manager/zip_archiver/cpp/compressor_stream.h
index de1f420913fa415f1048431689fe4711c9799c7e..12ab8d72d264f1d436cdb2a6c34a1f816659a0a1 100644
--- a/ui/file_manager/zip_archiver/cpp/compressor_stream.h
+++ b/ui/file_manager/zip_archiver/cpp/compressor_stream.h
@@ -15,15 +15,18 @@ class CompressorStream {
public:
virtual ~CompressorStream() {}
+ virtual int64_t Flush() = 0;
mtomasz 2017/04/11 06:36:45 Please add a comment for this method.
+
// Writes the given buffer onto the archive. After sending a write chunk
// request to JavaScript, it waits until WriteChunkDone() is called in the
// main thread. Thus, This method must not be called in the main thread.
- virtual int64_t Write(int64_t bytes_to_write,
- const pp::VarArrayBuffer& buffer) = 0;
+ virtual int64_t Write(int64_t zip_offset,
+ int64_t zip_length,
+ const char* zip_buffer) = 0;
// Called when write chunk done response arrives from JavaScript. Sends a
// signal to invoke Write function in another thread again.
- virtual void WriteChunkDone(int64_t write_bytes) = 0;
+ virtual int64_t WriteChunkDone(int64_t write_bytes) = 0;
// Reads a file chunk from the entry that is currently being processed. After
// sending a read file chunk request to JavaScript, it waits until
@@ -35,8 +38,8 @@ class CompressorStream {
// the binary data in the given buffer to destination_buffer_ and Sends a
// signal to invoke Read function in another thread again. buffer must not be
// const because buffer.Map() and buffer.Unmap() can not be called with const.
- virtual void ReadFileChunkDone(int64_t read_bytes,
- pp::VarArrayBuffer* buffer) = 0;
+ virtual int64_t ReadFileChunkDone(int64_t read_bytes,
+ pp::VarArrayBuffer* buffer) = 0;
};
#endif // COMPRESSOR_STREAM_H_

Powered by Google App Engine
This is Rietveld 408576698