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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.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_DRIVE_BACKEND_SYNC_ENGINE_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // LocalChangeProcessor overrides. 94 // LocalChangeProcessor overrides.
95 virtual void ApplyLocalChange( 95 virtual void ApplyLocalChange(
96 const FileChange& local_change, 96 const FileChange& local_change,
97 const base::FilePath& local_path, 97 const base::FilePath& local_path,
98 const SyncFileMetadata& local_metadata, 98 const SyncFileMetadata& local_metadata,
99 const fileapi::FileSystemURL& url, 99 const fileapi::FileSystemURL& url,
100 const SyncStatusCallback& callback) OVERRIDE; 100 const SyncStatusCallback& callback) OVERRIDE;
101 101
102 // SyncTaskManager::Client overrides. 102 // SyncTaskManager::Client overrides.
103 virtual void MaybeScheduleNextTask() OVERRIDE; 103 virtual void MaybeScheduleNextTask() OVERRIDE;
104 virtual void NotifyLastOperationStatus(SyncStatusCode sync_status) OVERRIDE; 104 virtual void NotifyLastOperationStatus(SyncStatusCode sync_status,
105 bool used_network) OVERRIDE;
105 106
106 // drive::DriveNotificationObserver overrides. 107 // drive::DriveNotificationObserver overrides.
107 virtual void OnNotificationReceived() OVERRIDE; 108 virtual void OnNotificationReceived() OVERRIDE;
108 virtual void OnPushNotificationEnabled(bool enabled) OVERRIDE; 109 virtual void OnPushNotificationEnabled(bool enabled) OVERRIDE;
109 110
110 // drive::DriveServiceObserver overrides. 111 // drive::DriveServiceObserver overrides.
111 virtual void OnReadyToSendRequests() OVERRIDE; 112 virtual void OnReadyToSendRequests() OVERRIDE;
112 virtual void OnRefreshTokenInvalid() OVERRIDE; 113 virtual void OnRefreshTokenInvalid() OVERRIDE;
113 114
114 // net::NetworkChangeNotifier::NetworkChangeObserver overrides. 115 // net::NetworkChangeNotifier::NetworkChangeObserver overrides.
(...skipping 18 matching lines...) Expand all
133 SyncStatusCode status); 134 SyncStatusCode status);
134 void DidProcessRemoteChange(RemoteToLocalSyncer* syncer, 135 void DidProcessRemoteChange(RemoteToLocalSyncer* syncer,
135 const SyncFileCallback& callback, 136 const SyncFileCallback& callback,
136 SyncStatusCode status); 137 SyncStatusCode status);
137 void DidApplyLocalChange(LocalToRemoteSyncer* syncer, 138 void DidApplyLocalChange(LocalToRemoteSyncer* syncer,
138 const SyncStatusCallback& callback, 139 const SyncStatusCallback& callback,
139 SyncStatusCode status); 140 SyncStatusCode status);
140 void DidFetchChangeList(SyncStatusCallback& callback); 141 void DidFetchChangeList(SyncStatusCallback& callback);
141 142
142 void MaybeStartFetchChanges(); 143 void MaybeStartFetchChanges();
143 void UpdateServiceStateFromSyncStatusCode(SyncStatusCode state); 144 void UpdateServiceStateFromSyncStatusCode(SyncStatusCode state,
145 bool used_network);
144 void UpdateServiceState(RemoteServiceState state, 146 void UpdateServiceState(RemoteServiceState state,
145 const std::string& description); 147 const std::string& description);
146 void UpdateRegisteredApps(); 148 void UpdateRegisteredApps();
147 149
148 base::FilePath base_dir_; 150 base::FilePath base_dir_;
149 base::FilePath temporary_file_dir_; 151 base::FilePath temporary_file_dir_;
150 152
151 scoped_refptr<base::SequencedTaskRunner> task_runner_; 153 scoped_refptr<base::SequencedTaskRunner> task_runner_;
152 154
153 scoped_ptr<drive::DriveServiceInterface> drive_service_; 155 scoped_ptr<drive::DriveServiceInterface> drive_service_;
(...skipping 24 matching lines...) Expand all
178 180
179 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_; 181 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_;
180 182
181 DISALLOW_COPY_AND_ASSIGN(SyncEngine); 183 DISALLOW_COPY_AND_ASSIGN(SyncEngine);
182 }; 184 };
183 185
184 } // namespace drive_backend 186 } // namespace drive_backend
185 } // namespace sync_file_system 187 } // namespace sync_file_system
186 188
187 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 189 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698