| OLD | NEW |
| 1 // Copyright 2017 The Chromium OS Authors. All rights reserved. | 1 // Copyright 2017 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPRESSOR_H_ | 5 #ifndef COMPRESSOR_H_ |
| 6 #define COMPRESSOR_H_ | 6 #define COMPRESSOR_H_ |
| 7 | 7 |
| 8 #include <ctime> | 8 #include <ctime> |
| 9 #include <pthread.h> | 9 #include <pthread.h> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Adds an entry to the archive. | 38 // Adds an entry to the archive. |
| 39 void AddToArchive(const pp::VarDictionary& dictionary); | 39 void AddToArchive(const pp::VarDictionary& dictionary); |
| 40 | 40 |
| 41 // Processes a file chunk sent from JavaScript. | 41 // Processes a file chunk sent from JavaScript. |
| 42 void ReadFileChunkDone(const pp::VarDictionary& dictionary); | 42 void ReadFileChunkDone(const pp::VarDictionary& dictionary); |
| 43 | 43 |
| 44 // Receives a write chunk response from JavaScript. | 44 // Receives a write chunk response from JavaScript. |
| 45 void WriteChunkDone(const pp::VarDictionary& dictionary); | 45 void WriteChunkDone(const pp::VarDictionary& dictionary); |
| 46 | 46 |
| 47 // Releases all resources obtained by libarchive. | 47 // Releases all resources obtained by minizip. |
| 48 void CloseArchive(const pp::VarDictionary& dictionary); | 48 void CloseArchive(const pp::VarDictionary& dictionary); |
| 49 | 49 |
| 50 // A getter function for the message sender. | 50 // A getter function for the message sender. |
| 51 JavaScriptMessageSenderInterface* message_sender() { return message_sender_; } | 51 JavaScriptMessageSenderInterface* message_sender() { return message_sender_; } |
| 52 | 52 |
| 53 // A getter function for the requestor. | 53 // A getter function for the requestor. |
| 54 JavaScriptCompressorRequestorInterface* requestor() { return requestor_; } | 54 JavaScriptCompressorRequestorInterface* requestor() { return requestor_; } |
| 55 | 55 |
| 56 // A getter function for the compressor id. | 56 // A getter function for the compressor id. |
| 57 int compressor_id() { return compressor_id_; } | 57 int compressor_id() { return compressor_id_; } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 75 // this thread are executed in order, so a new job must wait for the last job | 75 // this thread are executed in order, so a new job must wait for the last job |
| 76 // to finish. | 76 // to finish. |
| 77 pp::SimpleThread worker_; | 77 pp::SimpleThread worker_; |
| 78 | 78 |
| 79 // Callback factory used to submit jobs to worker_. | 79 // Callback factory used to submit jobs to worker_. |
| 80 pp::CompletionCallbackFactory<Compressor> callback_factory_; | 80 pp::CompletionCallbackFactory<Compressor> callback_factory_; |
| 81 | 81 |
| 82 // A requestor for making calls to JavaScript. | 82 // A requestor for making calls to JavaScript. |
| 83 JavaScriptCompressorRequestorInterface* requestor_; | 83 JavaScriptCompressorRequestorInterface* requestor_; |
| 84 | 84 |
| 85 // Libarchive wrapper instance per compressor, shared across all operations. | 85 // Minizip wrapper instance per compressor, shared across all operations. |
| 86 CompressorArchive* compressor_archive_; | 86 CompressorArchive* compressor_archive_; |
| 87 | 87 |
| 88 // An instance that takes care of all IO operations. | 88 // An instance that takes care of all IO operations. |
| 89 CompressorStream* compressor_stream_; | 89 CompressorStream* compressor_stream_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 #endif /// COMPRESSOR_H_ | 92 #endif /// COMPRESSOR_H_ |
| OLD | NEW |