Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: chrome/browser/extensions/api/image_writer_private/operation.h

Issue 61643015: Adds imageWriterPrivate support for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorganization and test updates. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c48c6750abeb370289744caa8c6dba4e2ce3d8e6 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation.h
+++ b/chrome/browser/extensions/api/image_writer_private/operation.h
@@ -11,6 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
#include "chrome/browser/extensions/api/image_writer_private/image_writer_utils.h"
+#include "chrome/browser/image_writer/image_writer.h"
#include "chrome/common/cancelable_task_tracker.h"
#include "chrome/common/extensions/api/image_writer_private.h"
@@ -38,7 +39,8 @@ 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 base::RefCountedThreadSafe<Operation>,
+ public ImageWriter::Delegate {
public:
typedef base::Callback<void(bool, const std::string&)> StartWriteCallback;
typedef base::Callback<void(bool, const std::string&)> CancelWriteCallback;
@@ -58,6 +60,10 @@ class Operation
// Aborts the operation, cancelling it and generating an error.
void Abort();
+
+ virtual void OnWriteImageSucceeded() OVERRIDE;
jam 2013/11/21 19:36:41 nit: convention is to put add // ImageWriter::Del
Drew Haven 2013/11/26 02:10:43 Done. I didn't realize you could put public metho
+ virtual void OnWriteImageFailed(const std::string& message) OVERRIDE;
+ virtual void OnWriteImageProgress(int progress) OVERRIDE;
protected:
virtual ~Operation();
@@ -108,17 +114,6 @@ class 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)

Powered by Google App Engine
This is Rietveld 408576698