| 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 7e45fe121d9959baed490d9c6842b91605d3026f..c59463a0f5be53e900aa07b16ccd38f93eb61dc9 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;
|
| @@ -140,6 +140,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,
|
| @@ -147,6 +148,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();
|
|
|
| @@ -159,6 +165,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_;
|
|
|