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

Side by Side Diff: chrome/browser/sync_file_system/local/local_file_change_tracker.h

Issue 386373002: [SyncFS] Add per-URL promote of demoted changes in LocalFileChangeTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +test Created 6 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/local/local_file_change_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 // Resets the changes to the ones recorded in mirror for |url|, and 91 // Resets the changes to the ones recorded in mirror for |url|, and
92 // commits the updated change status to database. 92 // commits the updated change status to database.
93 void ResetToMirrorAndCommitChangesForURL(const fileapi::FileSystemURL& url); 93 void ResetToMirrorAndCommitChangesForURL(const fileapi::FileSystemURL& url);
94 94
95 // Re-inserts changes into the separate demoted_changes_ queue. They won't 95 // Re-inserts changes into the separate demoted_changes_ queue. They won't
96 // be fetched by GetNextChangedURLs() unless PromoteDemotedChanges() is 96 // be fetched by GetNextChangedURLs() unless PromoteDemotedChanges() is
97 // called. 97 // called.
98 void DemoteChangesForURL(const fileapi::FileSystemURL& url); 98 void DemoteChangesForURL(const fileapi::FileSystemURL& url);
99 99
100 // Promotes demoted changes for |url| to the normal queue.
101 void PromoteDemotedChangesForURL(const fileapi::FileSystemURL& url);
102
100 // Promotes all demoted changes to the normal queue. Returns true if it has 103 // Promotes all demoted changes to the normal queue. Returns true if it has
101 // promoted any changes. 104 // promoted any changes.
102 bool PromoteDemotedChanges(); 105 bool PromoteDemotedChanges();
103 106
104 // Called by FileSyncService at the startup time to restore last dirty changes 107 // Called by FileSyncService at the startup time to restore last dirty changes
105 // left after the last shutdown (if any). 108 // left after the last shutdown (if any).
106 SyncStatusCode Initialize(fileapi::FileSystemContext* file_system_context); 109 SyncStatusCode Initialize(fileapi::FileSystemContext* file_system_context);
107 110
108 // Resets all the changes recorded for the given |origin| and |type|. 111 // Resets all the changes recorded for the given |origin| and |type|.
109 // TODO(kinuko,nhiroki): Ideally this should be automatically called in 112 // TODO(kinuko,nhiroki): Ideally this should be automatically called in
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // This can be accessed on any threads (with num_changes_lock_). 184 // This can be accessed on any threads (with num_changes_lock_).
182 int64 num_changes_; 185 int64 num_changes_;
183 mutable base::Lock num_changes_lock_; 186 mutable base::Lock num_changes_lock_;
184 187
185 DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker); 188 DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker);
186 }; 189 };
187 190
188 } // namespace sync_file_system 191 } // namespace sync_file_system
189 192
190 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ 193 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/local/local_file_change_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698