Index: chrome/browser/sync_file_system/drive_file_sync_service.h |
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.h b/chrome/browser/sync_file_system/drive_file_sync_service.h |
index adeb56025cc9982645b0a4f12eed6459eecb30c3..bfbffe0e3df33b68526a72194fb04712aba02a39 100644 |
--- a/chrome/browser/sync_file_system/drive_file_sync_service.h |
+++ b/chrome/browser/sync_file_system/drive_file_sync_service.h |
@@ -16,6 +16,7 @@ |
#include "base/memory/weak_ptr.h" |
#include "base/observer_list.h" |
#include "base/threading/non_thread_safe.h" |
+#include "base/timer.h" |
#include "chrome/browser/google_apis/drive_service_interface.h" |
#include "chrome/browser/google_apis/gdata_wapi_parser.h" |
#include "chrome/browser/sync_file_system/local_change_processor.h" |
@@ -277,10 +278,10 @@ class DriveFileSyncService |
fileapi::SyncStatusCode status); |
void AppendNewRemoteChange(const GURL& origin, |
- google_apis::DocumentEntry* entry, |
+ const google_apis::DocumentEntry& entry, |
int64 changestamp, |
RemoteSyncType sync_type); |
- void CancelRemoteChange(const fileapi::FileSystemURL& url); |
+ void RemoveRemoteChange(const fileapi::FileSystemURL& url); |
void MaybeMarkAsIncrementalSyncOrigin(const GURL& origin); |
// This returns false if no change is found for the |url|. |
@@ -294,6 +295,14 @@ class DriveFileSyncService |
FilePath temporary_file_dir_; |
+ void FetchChangesForIncrementalSync(); |
+ void DidFetchChangesForIncrementalSync( |
+ scoped_ptr<TaskToken> token, |
+ google_apis::GDataErrorCode error, |
+ scoped_ptr<google_apis::DocumentFeed> changes); |
+ bool GetOriginForEntry(const google_apis::DocumentEntry& entry, GURL* origin); |
+ void SchedulePolling(); |
+ |
scoped_ptr<DriveMetadataStore> metadata_store_; |
scoped_ptr<DriveFileSyncClient> sync_client_; |
@@ -301,7 +310,8 @@ class DriveFileSyncService |
RemoteServiceState state_; |
std::deque<base::Closure> pending_tasks_; |
- int64 largest_changestamp_; |
+ int64 largest_fetched_changestamp_; |
+ |
PendingChangeQueue pending_changes_; |
URLToChange url_to_change_; |
@@ -314,6 +324,10 @@ class DriveFileSyncService |
// NotifyTaskDone when the task finished. |
scoped_ptr<TaskToken> token_; |
+ base::OneShotTimer<DriveFileSyncService> polling_timer_; |
+ base::TimeDelta polling_delay_; |
+ bool polling_enabled_; |
+ |
ObserverList<Observer> observers_; |
// Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer |