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

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: rebase Created 8 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 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 da161bc8b3233b432fa3976347eefb10ccf4f9e3..1c4ad54094ec6064e391510d591aba3c39c229b1 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"
@@ -278,10 +279,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|.
@@ -295,6 +296,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_;
@@ -302,7 +311,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_;
@@ -315,6 +325,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

Powered by Google App Engine
This is Rietveld 408576698