| Index: chrome/browser/chromeos/drive/drive_scheduler.h
|
| diff --git a/chrome/browser/chromeos/drive/drive_scheduler.h b/chrome/browser/chromeos/drive/drive_scheduler.h
|
| index 8359f770b76dda871c3db7f48b3878d8bfde1611..3bedacdcc2f68336b80ef87e4255de84b2d84678 100644
|
| --- a/chrome/browser/chromeos/drive/drive_scheduler.h
|
| +++ b/chrome/browser/chromeos/drive/drive_scheduler.h
|
| @@ -32,6 +32,7 @@ class DriveScheduler
|
|
|
| // Enum representing the type of job.
|
| enum JobType {
|
| + TYPE_MOVE,
|
| TYPE_REMOVE,
|
| };
|
|
|
| @@ -78,6 +79,11 @@ class DriveScheduler
|
| // other functions.
|
| void Initialize();
|
|
|
| + // Adds a move operation to the queue.
|
| + void Move(const FilePath& src_file_path,
|
| + const FilePath& dest_file_path,
|
| + const FileOperationCallback& callback);
|
| +
|
| // Adds a remove operation to the queue.
|
| void Remove(const FilePath& file_path,
|
| bool is_recursive,
|
| @@ -86,23 +92,24 @@ class DriveScheduler
|
| private:
|
| friend class DriveSchedulerTest;
|
|
|
| - // Data specific to a remove operation.
|
| - struct RemoveJobPrivate {
|
| - RemoveJobPrivate(bool in_is_recursive, FileOperationCallback in_callback);
|
| - ~RemoveJobPrivate();
|
| -
|
| - bool is_recursive;
|
| - FileOperationCallback callback;
|
| - };
|
| -
|
| // Represents a single entry in the job queue.
|
| struct QueueEntry {
|
| - QueueEntry(JobType in_job_type, FilePath in_file_path);
|
| + QueueEntry(JobType in_job_type,
|
| + FilePath in_file_path,
|
| + FileOperationCallback in_callback);
|
| ~QueueEntry();
|
|
|
| JobInfo job_info;
|
|
|
| - scoped_ptr<RemoveJobPrivate> remove_private;
|
| + // Callback for when the operation completes.
|
| + // Used by: TYPE_MOVE, TYPE_REMOVE
|
| + FileOperationCallback callback;
|
| +
|
| + // Destination of the operation. Used by: TYPE_MOVE
|
| + FilePath dest_file_path;
|
| +
|
| + // Whether the operation is recursive. Used by: TYPE_REMOVE
|
| + bool is_recursive;
|
| };
|
|
|
| // Adds the specified job to the queue. Takes ownership of |job|
|
| @@ -127,10 +134,9 @@ class DriveScheduler
|
| // Resets the throttle delay to the initial value, and continues the job loop.
|
| void ResetThrottleAndContinueJobLoop();
|
|
|
| - // Callback for job of TYPE_REMOVE finishing. Retries the job if needed,
|
| - // otherwise cleans up the job, invokes the callback, and continues the job
|
| - // loop.
|
| - void OnRemoveDone(int job_id, DriveFileError error);
|
| + // Callback for job finishing. Retries the job if needed, otherwise cleans up
|
| + // the job, invokes the callback, and continues the job loop.
|
| + void OnJobDone(int job_id, DriveFileError error);
|
|
|
| // net::NetworkChangeNotifier::ConnectionTypeObserver override.
|
| virtual void OnConnectionTypeChanged(
|
|
|