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 17a88e9fc5a3638108e605ad8374449fc84417c6..970aafa966c3ccb4245d72f8c7376b08e06cdc50 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; |
@@ -38,7 +39,7 @@ class OperationManager; |
// 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> { |
+ : public zip::ZipReader::Listener { |
public: |
typedef base::Callback<void(bool, const std::string&)> StartWriteCallback; |
typedef base::Callback<void(bool, const std::string&)> CancelWriteCallback; |
@@ -133,6 +134,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, |
@@ -140,6 +142,11 @@ class Operation |
int progress_scale, |
const base::Callback<void(scoped_ptr<std::string>)>& callback); |
+ // Implementation of zip::ZipReader::Listener |
+ virtual void OnUnzipProgress(int progress) OVERRIDE; |
+ virtual void OnUnzipSuccess() OVERRIDE; |
+ virtual void OnUnzipFailed() OVERRIDE; |
+ |
// Runs all cleanup functions. |
void CleanUp(); |
@@ -152,6 +159,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_; |