Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_JOB_LIST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_JOB_LIST_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_LIST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_LIST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 TYPE_UPLOAD_EXISTING_FILE, | 36 TYPE_UPLOAD_EXISTING_FILE, |
| 37 TYPE_CREATE_FILE, | 37 TYPE_CREATE_FILE, |
| 38 TYPE_ADD_PERMISSION, | 38 TYPE_ADD_PERMISSION, |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 // Returns the string representation of |type|. | 41 // Returns the string representation of |type|. |
| 42 std::string JobTypeToString(JobType type); | 42 std::string JobTypeToString(JobType type); |
| 43 | 43 |
| 44 // Current state of the job. | 44 // Current state of the job. |
| 45 enum JobState { | 45 enum JobState { |
| 46 // The job is newed and file data, but not yet queued. | |
| 47 STATE_NEW, | |
|
hirono
2014/08/28 08:31:38
Why is this state needed?
iseki
2014/08/29 01:58:00
Done.
| |
| 48 | |
| 46 // The job is queued, but not yet executed. | 49 // The job is queued, but not yet executed. |
| 47 STATE_NONE, | 50 STATE_NONE, |
| 48 | 51 |
| 49 // The job is in the process of being handled. | 52 // The job is in the process of being handled. |
| 50 STATE_RUNNING, | 53 STATE_RUNNING, |
| 51 | 54 |
| 52 // The job failed, but has been re-added to the queue. | 55 // The job failed, but has been re-added to the queue. |
| 53 STATE_RETRY, | 56 STATE_RETRY, |
| 54 }; | 57 }; |
| 55 | 58 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 82 int64 num_total_bytes; | 85 int64 num_total_bytes; |
| 83 | 86 |
| 84 // Drive path of the file that this job acts on. | 87 // Drive path of the file that this job acts on. |
| 85 base::FilePath file_path; | 88 base::FilePath file_path; |
| 86 | 89 |
| 87 // Time when the job is started (i.e. the request is sent to the server). | 90 // Time when the job is started (i.e. the request is sent to the server). |
| 88 base::Time start_time; | 91 base::Time start_time; |
| 89 | 92 |
| 90 // Returns the string representation of the job info. | 93 // Returns the string representation of the job info. |
| 91 std::string ToString() const; | 94 std::string ToString() const; |
| 95 | |
| 96 // Total number of job. | |
| 97 long num_total_jobs; | |
| 92 }; | 98 }; |
| 93 | 99 |
| 94 // Checks if |job_info| represents a job for currently active file transfer. | 100 // Checks if |job_info| represents a job for currently active file transfer. |
| 95 bool IsActiveFileTransferJobInfo(const JobInfo& job_info); | 101 bool IsActiveFileTransferJobInfo(const JobInfo& job_info); |
| 96 | 102 |
| 97 // The interface for observing JobListInterface. | 103 // The interface for observing JobListInterface. |
| 98 // All events are notified in the UI thread. | 104 // All events are notified in the UI thread. |
| 99 class JobListObserver { | 105 class JobListObserver { |
| 100 public: | 106 public: |
| 101 // Called when a new job id added. | 107 // Called when a new job id added. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 131 // Cancels the job. | 137 // Cancels the job. |
| 132 virtual void CancelJob(JobID job_id) = 0; | 138 virtual void CancelJob(JobID job_id) = 0; |
| 133 | 139 |
| 134 // Cancels all the jobs. | 140 // Cancels all the jobs. |
| 135 virtual void CancelAllJobs() = 0; | 141 virtual void CancelAllJobs() = 0; |
| 136 }; | 142 }; |
| 137 | 143 |
| 138 } // namespace drive | 144 } // namespace drive |
| 139 | 145 |
| 140 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_LIST_H_ | 146 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_LIST_H_ |
| OLD | NEW |