Index: chrome/browser/extensions/api/image_writer_private/operation.h |
diff --git a/chrome/browser/extensions/api/image_writer_private/operation.h b/chrome/browser/extensions/api/image_writer_private/operation.h |
index ce62f65d17196e37ad3e1002d4c67171831d76d1..80092cfa59a807f4e683a458ef76a47a531aef52 100644 |
--- a/chrome/browser/extensions/api/image_writer_private/operation.h |
+++ b/chrome/browser/extensions/api/image_writer_private/operation.h |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/extensions/api/image_writer_private/image_writer_utils.h" |
#include "chrome/common/cancelable_task_tracker.h" |
#include "chrome/common/extensions/api/image_writer_private.h" |
+#include "third_party/zlib/google/zip_reader.h" |
namespace image_writer_api = extensions::api::image_writer_private; |
@@ -37,8 +38,7 @@ class OperationManager; |
// Run, Complete. Start and Complete run on the UI thread and are responsible |
// for advancing to the next stage and other UI interaction. The Run phase does |
// the work on the FILE thread and calls SendProgress or Error as appropriate. |
-class Operation |
- : public base::RefCountedThreadSafe<Operation> { |
+class Operation : public base::RefCountedThreadSafe<Operation> { |
public: |
typedef base::Callback<void(bool, const std::string&)> StartWriteCallback; |
typedef base::Callback<void(bool, const std::string&)> CancelWriteCallback; |
@@ -143,6 +143,7 @@ class Operation |
void OnBurnError(); |
#endif |
+ // Incrementally calculates the MD5 sum of a file. |
void MD5Chunk(scoped_ptr<image_writer_utils::ImageReader> reader, |
int64 bytes_processed, |
int64 bytes_total, |
@@ -150,6 +151,11 @@ class Operation |
int progress_scale, |
const base::Callback<void(scoped_ptr<std::string>)>& callback); |
+ // Callbacks for zip::ZipReader. |
+ void OnUnzipSuccess(); |
+ void OnUnzipFailure(); |
+ void OnUnzipProgress(int64 total_bytes, int64 progress_bytes); |
+ |
// Runs all cleanup functions. |
void CleanUp(); |
@@ -162,6 +168,9 @@ class Operation |
// memory here. This requires that we only do one MD5 sum at a time. |
base::MD5Context md5_context_; |
+ // Zip reader for unzip operations. |
+ zip::ZipReader zip_reader_; |
+ |
// CleanUp operations that must be run. All these functions are run on the |
// FILE thread. |
std::vector<base::Closure> cleanup_functions_; |