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

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 acd873c236032532c94c703ace2593d2fe00f167..ad215642b19a2b9efe977d242b5166551f32c430 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/sync_file_system/drive_file_sync_client.h"
#include "chrome/browser/sync_file_system/local_change_processor.h"
#include "chrome/browser/sync_file_system/remote_file_sync_service.h"
@@ -280,10 +281,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|.
@@ -297,6 +298,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_;
@@ -304,7 +313,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_;
@@ -317,6 +327,10 @@ class DriveFileSyncService
// NotifyTaskDone when the task finished.
scoped_ptr<TaskToken> token_;
+ base::OneShotTimer<DriveFileSyncService> polling_timer_;
+ int64 polling_delay_seconds_;
+ 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