| 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 COMPONENTS_UPLOAD_LIST_UPLOAD_LIST_H_ | 5 #ifndef COMPONENTS_UPLOAD_LIST_UPLOAD_LIST_H_ |
| 6 #define COMPONENTS_UPLOAD_LIST_UPLOAD_LIST_H_ | 6 #define COMPONENTS_UPLOAD_LIST_UPLOAD_LIST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 Pending, | 38 Pending, |
| 39 Pending_UserRequested, | 39 Pending_UserRequested, |
| 40 Uploaded, | 40 Uploaded, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 UploadInfo(const std::string& upload_id, | 43 UploadInfo(const std::string& upload_id, |
| 44 const base::Time& upload_time, | 44 const base::Time& upload_time, |
| 45 const std::string& local_id, | 45 const std::string& local_id, |
| 46 const base::Time& capture_time, | 46 const base::Time& capture_time, |
| 47 State state); | 47 State state); |
| 48 // Constructor for locally stored data. |
| 49 UploadInfo(const std::string& local_id, |
| 50 const base::Time& capture_time, |
| 51 State state, |
| 52 int file_size); |
| 48 UploadInfo(const std::string& upload_id, const base::Time& upload_time); | 53 UploadInfo(const std::string& upload_id, const base::Time& upload_time); |
| 49 ~UploadInfo(); | 54 ~UploadInfo(); |
| 50 | 55 |
| 51 // These fields are only valid when |state| == UploadInfo::State::Uploaded. | 56 // These fields are only valid when |state| == UploadInfo::State::Uploaded. |
| 52 std::string upload_id; | 57 std::string upload_id; |
| 53 base::Time upload_time; | 58 base::Time upload_time; |
| 54 | 59 |
| 55 // ID for locally stored data that may or may not be uploaded. | 60 // ID for locally stored data that may or may not be uploaded. |
| 56 std::string local_id; | 61 std::string local_id; |
| 57 | 62 |
| 58 // The time the data was captured. This is useful if the data is stored | 63 // The time the data was captured. This is useful if the data is stored |
| 59 // locally when captured and uploaded at a later time. | 64 // locally when captured and uploaded at a later time. |
| 60 base::Time capture_time; | 65 base::Time capture_time; |
| 61 | 66 |
| 62 State state; | 67 State state; |
| 68 |
| 69 // File size in bytes for locally stored data. |
| 70 int file_size; |
| 63 }; | 71 }; |
| 64 | 72 |
| 65 class Delegate { | 73 class Delegate { |
| 66 public: | 74 public: |
| 67 // Invoked when the upload list has been loaded. Will be called on the | 75 // Invoked when the upload list has been loaded. Will be called on the |
| 68 // UI thread. | 76 // UI thread. |
| 69 virtual void OnUploadListAvailable() = 0; | 77 virtual void OnUploadListAvailable() = 0; |
| 70 | 78 |
| 71 protected: | 79 protected: |
| 72 virtual ~Delegate() {} | 80 virtual ~Delegate() {} |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 Delegate* delegate_; | 134 Delegate* delegate_; |
| 127 | 135 |
| 128 const base::FilePath upload_log_path_; | 136 const base::FilePath upload_log_path_; |
| 129 | 137 |
| 130 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 138 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
| 131 | 139 |
| 132 DISALLOW_COPY_AND_ASSIGN(UploadList); | 140 DISALLOW_COPY_AND_ASSIGN(UploadList); |
| 133 }; | 141 }; |
| 134 | 142 |
| 135 #endif // COMPONENTS_UPLOAD_LIST_UPLOAD_LIST_H_ | 143 #endif // COMPONENTS_UPLOAD_LIST_UPLOAD_LIST_H_ |
| OLD | NEW |