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

Side by Side Diff: chrome/browser/chromeos/drive/sync_client.h

Issue 16628003: drive: Remove FileCacheObserver::OnCacheCommitted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PinAndUnpin Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_CLIENT_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_CLIENT_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_CLIENT_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_CLIENT_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 JobScheduler* scheduler, 62 JobScheduler* scheduler,
63 ResourceMetadata* metadata, 63 ResourceMetadata* metadata,
64 FileCache* cache); 64 FileCache* cache);
65 virtual ~SyncClient(); 65 virtual ~SyncClient();
66 66
67 // FileCache::Observer overrides. 67 // FileCache::Observer overrides.
68 virtual void OnCachePinned(const std::string& resource_id, 68 virtual void OnCachePinned(const std::string& resource_id,
69 const std::string& md5) OVERRIDE; 69 const std::string& md5) OVERRIDE;
70 virtual void OnCacheUnpinned(const std::string& resource_id, 70 virtual void OnCacheUnpinned(const std::string& resource_id,
71 const std::string& md5) OVERRIDE; 71 const std::string& md5) OVERRIDE;
72 virtual void OnCacheCommitted(const std::string& resource_id) OVERRIDE; 72
73 // Adds a fetch task to the queue.
74 void AddFetchTask(const std::string& resource_id);
75
76 // Adds an upload task to the queue.
77 void AddUploadTask(const std::string& resource_id);
73 78
74 // Starts processing the backlog (i.e. pinned-but-not-filed files and 79 // Starts processing the backlog (i.e. pinned-but-not-filed files and
75 // dirty-but-not-uploaded files). Kicks off retrieval of the resource 80 // dirty-but-not-uploaded files). Kicks off retrieval of the resource
76 // IDs of these files, and then starts the sync loop. 81 // IDs of these files, and then starts the sync loop.
77 void StartProcessingBacklog(); 82 void StartProcessingBacklog();
78 83
79 // Starts checking the existing pinned files to see if these are 84 // Starts checking the existing pinned files to see if these are
80 // up-to-date. If stale files are detected, the resource IDs of these files 85 // up-to-date. If stale files are detected, the resource IDs of these files
81 // are added to the queue and the sync loop is started. 86 // are added to the queue and the sync loop is started.
82 void StartCheckingExistingPinnedFiles(); 87 void StartCheckingExistingPinnedFiles();
83 88
84 // Returns the resource IDs in |queue_| for the given sync type. Used only 89 // Returns the resource IDs in |queue_| for the given sync type. Used only
85 // for testing. 90 // for testing.
86 std::vector<std::string> GetResourceIdsForTesting(SyncType sync_type) const; 91 std::vector<std::string> GetResourceIdsForTesting(SyncType sync_type) const;
87 92
88 // Adds the resource ID to the queue. Used only for testing.
89 void AddResourceIdForTesting(SyncType sync_type,
90 const std::string& resource_id) {
91 AddTaskToQueue(sync_type, resource_id);
92 }
93
94 // Sets a delay for testing. 93 // Sets a delay for testing.
95 void set_delay_for_testing(const base::TimeDelta& delay) { 94 void set_delay_for_testing(const base::TimeDelta& delay) {
96 delay_ = delay; 95 delay_ = delay;
97 } 96 }
98 97
99 // Starts the sync loop if it's not running. 98 // Starts the sync loop if it's not running.
100 void StartSyncLoop(); 99 void StartSyncLoop();
101 100
102 private: 101 private:
103 // Adds the given task to the queue. If the same task is queued, remove the 102 // Adds the given task to the queue. If the same task is queued, remove the
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // invalidate its weak pointers before any other members are destroyed. 170 // invalidate its weak pointers before any other members are destroyed.
172 base::WeakPtrFactory<SyncClient> weak_ptr_factory_; 171 base::WeakPtrFactory<SyncClient> weak_ptr_factory_;
173 172
174 DISALLOW_COPY_AND_ASSIGN(SyncClient); 173 DISALLOW_COPY_AND_ASSIGN(SyncClient);
175 }; 174 };
176 175
177 } // namespace internal 176 } // namespace internal
178 } // namespace drive 177 } // namespace drive
179 178
180 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_CLIENT_H_ 179 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_SYNC_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/mock_file_cache_observer.h ('k') | chrome/browser/chromeos/drive/sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698