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

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: Fixes comment. Created 6 years, 10 months 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 58c0814617d4bb3100ed8a965fcc395edefdc980..2d9622eb1c5de68eba37d811b2370e6ba7f25086 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,19 +117,20 @@ 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);
+#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 the
+ // Operation.
+ 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
#if defined(OS_CHROMEOS)

Powered by Google App Engine
This is Rietveld 408576698