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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_service.h

Issue 11421125: Implement polling part of DriveFileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for optional changestamp field Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 04ddeffcb4f1dcac5ab94f7a447c0ba291094eb3..292c761e2e4bd14c8c0bf71df9adea34137a5fd3 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,7 +278,7 @@ 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);
@@ -289,6 +290,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_;
@@ -296,7 +305,9 @@ class DriveFileSyncService
RemoteServiceState state_;
std::deque<base::Closure> pending_tasks_;
- int64 largest_changestamp_;
+ int64 largest_synced_changestamp_;
+ int64 largest_fetched_changestamp_;
+
PendingChangeQueue pending_changes_;
URLToChange url_to_change_;
@@ -309,6 +320,9 @@ class DriveFileSyncService
// NotifyTaskDone when the task finished.
scoped_ptr<TaskToken> token_;
+ base::OneShotTimer<DriveFileSyncService> polling_timer_;
+ base::TimeDelta polling_delay_;
+
ObserverList<Observer> observers_;
// Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer

Powered by Google App Engine
This is Rietveld 408576698