OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 void set_task_blocker(scoped_ptr<TaskBlocker> task_blocker); | 56 void set_task_blocker(scoped_ptr<TaskBlocker> task_blocker); |
57 const TaskBlocker* task_blocker() const; | 57 const TaskBlocker* task_blocker() const; |
58 void clear_task_blocker(); | 58 void clear_task_blocker(); |
59 | 59 |
60 int64_t token_id() const { return token_id_; } | 60 int64_t token_id() const { return token_id_; } |
61 | 61 |
62 void InitializeTaskLog(const std::string& task_description); | 62 void InitializeTaskLog(const std::string& task_description); |
63 void FinalizeTaskLog(const std::string& result_description); | 63 void FinalizeTaskLog(const std::string& result_description); |
64 void RecordLog(const std::string& message); | 64 void RecordLog(const std::string& message); |
65 | 65 |
66 bool has_task_log() const { return task_log_; } | 66 bool has_task_log() const { return !!task_log_; } |
67 void SetTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log); | 67 void SetTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log); |
68 scoped_ptr<TaskLogger::TaskLog> PassTaskLog(); | 68 scoped_ptr<TaskLogger::TaskLog> PassTaskLog(); |
69 | 69 |
70 private: | 70 private: |
71 SyncTaskToken(const base::WeakPtr<SyncTaskManager>& manager, | 71 SyncTaskToken(const base::WeakPtr<SyncTaskManager>& manager, |
72 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 72 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
73 int64_t token_id, | 73 int64_t token_id, |
74 scoped_ptr<TaskBlocker> task_blocker, | 74 scoped_ptr<TaskBlocker> task_blocker, |
75 const SyncStatusCallback& callback); | 75 const SyncStatusCallback& callback); |
76 | 76 |
77 base::WeakPtr<SyncTaskManager> manager_; | 77 base::WeakPtr<SyncTaskManager> manager_; |
78 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 78 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
79 tracked_objects::Location location_; | 79 tracked_objects::Location location_; |
80 int64_t token_id_; | 80 int64_t token_id_; |
81 SyncStatusCallback callback_; | 81 SyncStatusCallback callback_; |
82 | 82 |
83 scoped_ptr<TaskLogger::TaskLog> task_log_; | 83 scoped_ptr<TaskLogger::TaskLog> task_log_; |
84 scoped_ptr<TaskBlocker> task_blocker_; | 84 scoped_ptr<TaskBlocker> task_blocker_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(SyncTaskToken); | 86 DISALLOW_COPY_AND_ASSIGN(SyncTaskToken); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace drive_backend | 89 } // namespace drive_backend |
90 } // namespace sync_file_system | 90 } // namespace sync_file_system |
91 | 91 |
92 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ | 92 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ |
OLD | NEW |