| 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 58c0814617d4bb3100ed8a965fcc395edefdc980..1a4f17ef1e2f1dbdfb4c42797e60a82f31cd5bd5 100644
|
| --- a/chrome/browser/extensions/api/image_writer_private/operation.h
|
| +++ b/chrome/browser/extensions/api/image_writer_private/operation.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/task/cancelable_task_tracker.h"
|
| #include "base/timer/timer.h"
|
| #include "chrome/browser/extensions/api/image_writer_private/image_writer_utils.h"
|
| +#include "chrome/browser/image_writer_client.h"
|
| #include "chrome/common/extensions/api/image_writer_private.h"
|
| #include "third_party/zlib/google/zip_reader.h"
|
|
|
| @@ -116,21 +117,6 @@ class Operation : public base::RefCountedThreadSafe<Operation> {
|
| private:
|
| friend class base::RefCountedThreadSafe<Operation>;
|
|
|
| - // TODO(haven): Clean up these switches. http://crbug.com/292956
|
| -#if defined(OS_LINUX) && !defined(CHROMEOS)
|
| - void WriteRun();
|
| - void WriteChunk(scoped_ptr<image_writer_utils::ImageReader> reader,
|
| - scoped_ptr<image_writer_utils::ImageWriter> writer,
|
| - int64 bytes_written);
|
| - bool WriteCleanUp(scoped_ptr<image_writer_utils::ImageReader> reader,
|
| - scoped_ptr<image_writer_utils::ImageWriter> writer);
|
| - void WriteComplete();
|
| -
|
| - void VerifyWriteStage2(scoped_ptr<std::string> image_hash);
|
| - void VerifyWriteCompare(scoped_ptr<std::string> image_hash,
|
| - scoped_ptr<std::string> device_hash);
|
| -#endif
|
| -
|
| #if defined(OS_CHROMEOS)
|
| void StartWriteOnUIThread();
|
|
|
| @@ -143,6 +129,21 @@ class Operation : public base::RefCountedThreadSafe<Operation> {
|
| void OnBurnError();
|
| #endif
|
|
|
| +#if !defined(OS_CHROMEOS)
|
| + // Ensures the client is started. This may be called many times but will only
|
| + // instantiate one client which should exist for the lifetime of
|
| + void StartImageWriterClient();
|
| +
|
| + // Stops the client. This must be called to ensure the utility process can
|
| + // shutdown.
|
| + void StopImageWriterClient();
|
| +
|
| + // Reports progress from the client, transforming from bytes to percentage.
|
| + virtual void WriteImageProgress(int64 total_bytes, int64 curr_bytes);
|
| +
|
| + scoped_refptr<ImageWriterClient> image_writer_client_;
|
| +#endif
|
| +
|
| // Incrementally calculates the MD5 sum of a file.
|
| void MD5Chunk(scoped_ptr<image_writer_utils::ImageReader> reader,
|
| int64 bytes_processed,
|
|
|