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

Side by Side Diff: chrome/browser/sync_file_system/sync_task_manager.h

Issue 87463002: Only re-enable remote service if the task used the network. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_SYNC_FILE_SYSTEM_SYNC_TASK_MANAGER_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_TASK_MANAGER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_TASK_MANAGER_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_TASK_MANAGER_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 26 matching lines...) Expand all
37 37
38 class Client { 38 class Client {
39 public: 39 public:
40 virtual ~Client() {} 40 virtual ~Client() {}
41 41
42 // Called when the manager is idle. 42 // Called when the manager is idle.
43 virtual void MaybeScheduleNextTask() = 0; 43 virtual void MaybeScheduleNextTask() = 0;
44 44
45 // Called when the manager is notified a task is done. 45 // Called when the manager is notified a task is done.
46 virtual void NotifyLastOperationStatus( 46 virtual void NotifyLastOperationStatus(
47 SyncStatusCode last_operation_status) = 0; 47 SyncStatusCode last_operation_status,
48 bool last_operation_used_network) = 0;
48 }; 49 };
49 50
50 explicit SyncTaskManager(base::WeakPtr<Client> client); 51 explicit SyncTaskManager(base::WeakPtr<Client> client);
51 virtual ~SyncTaskManager(); 52 virtual ~SyncTaskManager();
52 53
53 // This needs to be called to start task scheduling. 54 // This needs to be called to start task scheduling.
54 // If |status| is not SYNC_STATUS_OK calling this may change the 55 // If |status| is not SYNC_STATUS_OK calling this may change the
55 // service status. This should not be called more than once. 56 // service status. This should not be called more than once.
56 void Initialize(SyncStatusCode status); 57 void Initialize(SyncStatusCode status);
57 58
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // until it finished. And the task must return the instance through 118 // until it finished. And the task must return the instance through
118 // NotifyTaskDone when the task finished. 119 // NotifyTaskDone when the task finished.
119 scoped_ptr<TaskToken> token_; 120 scoped_ptr<TaskToken> token_;
120 121
121 DISALLOW_COPY_AND_ASSIGN(SyncTaskManager); 122 DISALLOW_COPY_AND_ASSIGN(SyncTaskManager);
122 }; 123 };
123 124
124 } // namespace sync_file_system 125 } // namespace sync_file_system
125 126
126 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_TASK_MANAGER_H_ 127 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_TASK_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/sync_task.h ('k') | chrome/browser/sync_file_system/sync_task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698