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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.h

Issue 10352004: gdata: Implement periodic file system update checks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add 2 more DCHECKs to make sure we're not starting/stopping timer when it is already started/stoppe… Created 8 years, 8 months 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/chromeos/gdata/gdata_file_system.h
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h
index c963adc4545962b8d62a31b362e30ad0933a11fc..e8552c5ca9b1958b7561528a0ae644eab1656ed1 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.h
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.h
@@ -18,6 +18,7 @@
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "base/platform_file.h"
+#include "base/timer.h"
#include "base/synchronization/lock.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/chromeos/gdata/find_entry_delegate.h"
@@ -175,6 +176,13 @@ class GDataFileSystemInterface {
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
+ // Starts and stops periodic updates.
+ virtual void StartUpdates() = 0;
+ virtual void StopUpdates() = 0;
+
+ // Checks for updates on the server.
+ virtual void CheckForUpdates() = 0;
+
// Enum defining origin of a cached file.
enum CachedFileOrigin {
CACHED_FILE_FROM_SERVER = 0,
@@ -400,6 +408,9 @@ class GDataFileSystem : public GDataFileSystemInterface,
virtual void Initialize() OVERRIDE;
virtual void AddObserver(Observer* observer) OVERRIDE;
virtual void RemoveObserver(Observer* observer) OVERRIDE;
+ virtual void StartUpdates() OVERRIDE;
+ virtual void StopUpdates() OVERRIDE;
+ virtual void CheckForUpdates() OVERRIDE;
virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE;
virtual void FindEntryByResourceIdSync(const std::string& resource_id,
FindEntryDelegate* delegate) OVERRIDE;
@@ -1333,6 +1344,9 @@ class GDataFileSystem : public GDataFileSystemInterface,
int num_pending_tasks_;
base::Lock num_pending_tasks_lock_;
+ // Periodic timer for checking updates.
+ base::Timer update_timer_;
+
// True if hosted documents should be hidden.
bool hide_hosted_docs_;

Powered by Google App Engine
This is Rietveld 408576698