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

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

Issue 175423004: Revert 252466 "In order to support writing on windows we need to..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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: trunk/src/chrome/browser/extensions/api/image_writer_private/operation.h
===================================================================
--- trunk/src/chrome/browser/extensions/api/image_writer_private/operation.h (revision 252593)
+++ trunk/src/chrome/browser/extensions/api/image_writer_private/operation.h (working copy)
@@ -12,7 +12,6 @@
#include "base/memory/weak_ptr.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/timer/timer.h"
-#include "chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h"
#include "chrome/common/extensions/api/image_writer_private.h"
#include "third_party/zlib/google/zip_reader.h"
@@ -71,12 +70,6 @@
int GetProgress();
image_writer_api::Stage GetStage();
-#if !defined(OS_CHROMEOS)
- // Set an ImageWriterClient to use. Should be called only when testing.
- void SetUtilityClientForTesting(
- scoped_refptr<ImageWriterUtilityClient> client);
-#endif
-
protected:
virtual ~Operation();
@@ -117,10 +110,6 @@
// functions will be run on the FILE thread.
void AddCleanUpFunction(const base::Closure& callback);
- // Completes the current operation (progress set to 100) and runs the
- // continuation.
- void CompleteAndContinue(const base::Closure& continuation);
-
// If |file_size| is non-zero, only |file_size| bytes will be read from file,
// otherwise the entire file will be read.
// |progress_scale| is a percentage to which the progress will be scale, e.g.
@@ -146,20 +135,20 @@
private:
friend class base::RefCountedThreadSafe<Operation>;
-#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 StartUtilityClient();
+ // TODO(haven): Clean up these switches. http://crbug.com/292956
+#if defined(OS_LINUX) && !defined(CHROMEOS)
+ void WriteChunk(const int64& bytes_written,
+ const int64& total_size,
+ const base::Closure& continuation);
+ void WriteComplete(const base::Closure& continuation);
- // Stops the client. This must be called to ensure the utility process can
- // shutdown.
- void StopUtilityClient();
+ void VerifyWriteChunk(const int64& bytes_written,
+ const int64& total_size,
+ const base::Closure& continuation);
+ void VerifyWriteComplete(const base::Closure& continuation);
- // Reports progress from the client, transforming from bytes to percentage.
- virtual void WriteImageProgress(int64 total_bytes, int64 curr_bytes);
-
- scoped_refptr<ImageWriterUtilityClient> image_writer_client_;
+ base::PlatformFile image_file_;
+ base::PlatformFile device_file_;
#endif
#if defined(OS_CHROMEOS)
@@ -184,6 +173,7 @@
const base::Callback<void(const std::string&)>& callback);
// Callbacks for zip::ZipReader.
+ void OnUnzipSuccess(const base::Closure& continuation);
void OnUnzipFailure();
void OnUnzipProgress(int64 total_bytes, int64 progress_bytes);

Powered by Google App Engine
This is Rietveld 408576698