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

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

Issue 11876002: Make largest_changestamp setter/getter asynchronous. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: added unit test Created 7 years, 11 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_DRIVE_RESOURCE_METADATA_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // directory names). 83 // directory names).
84 typedef base::Callback<void(DriveFileError error, 84 typedef base::Callback<void(DriveFileError error,
85 const FilePath& drive_file_path, 85 const FilePath& drive_file_path,
86 scoped_ptr<DriveEntryProto> entry_proto)> 86 scoped_ptr<DriveEntryProto> entry_proto)>
87 GetEntryInfoWithFilePathCallback; 87 GetEntryInfoWithFilePathCallback;
88 88
89 // Used to get a set of changed directories for feed processing. 89 // Used to get a set of changed directories for feed processing.
90 typedef base::Callback<void(const std::set<FilePath>&)> 90 typedef base::Callback<void(const std::set<FilePath>&)>
91 GetChildDirectoriesCallback; 91 GetChildDirectoriesCallback;
92 92
93 typedef base::Callback<void(int64)> GetChangestampCallback;
94
93 // This is a part of EntryInfoPairResult. 95 // This is a part of EntryInfoPairResult.
94 struct EntryInfoResult { 96 struct EntryInfoResult {
95 EntryInfoResult(); 97 EntryInfoResult();
96 ~EntryInfoResult(); 98 ~EntryInfoResult();
97 99
98 FilePath path; 100 FilePath path;
99 DriveFileError error; 101 DriveFileError error;
100 scoped_ptr<DriveEntryProto> proto; 102 scoped_ptr<DriveEntryProto> proto;
101 }; 103 };
102 104
(...skipping 22 matching lines...) Expand all
125 DriveResourceMetadata(); 127 DriveResourceMetadata();
126 ~DriveResourceMetadata(); 128 ~DriveResourceMetadata();
127 129
128 // Last time when we dumped serialized file system to disk. 130 // Last time when we dumped serialized file system to disk.
129 const base::Time& last_serialized() const { return last_serialized_; } 131 const base::Time& last_serialized() const { return last_serialized_; }
130 void set_last_serialized(const base::Time& time) { last_serialized_ = time; } 132 void set_last_serialized(const base::Time& time) { last_serialized_ = time; }
131 // Size of serialized file system on disk in bytes. 133 // Size of serialized file system on disk in bytes.
132 size_t serialized_size() const { return serialized_size_; } 134 size_t serialized_size() const { return serialized_size_; }
133 void set_serialized_size(size_t size) { serialized_size_ = size; } 135 void set_serialized_size(size_t size) { serialized_size_ = size; }
134 136
135 // Largest change timestamp that was the source of content for the current
136 // state of the root directory.
137 int64 largest_changestamp() const { return largest_changestamp_; }
138 void set_largest_changestamp(int64 value) { largest_changestamp_ = value; }
139
140 // True if the file system feed is loaded from the cache or from the server. 137 // True if the file system feed is loaded from the cache or from the server.
141 bool loaded() const { return loaded_; } 138 bool loaded() const { return loaded_; }
142 void set_loaded(bool loaded) { loaded_ = loaded; } 139 void set_loaded(bool loaded) { loaded_ = loaded; }
143 140
141 // Largest change timestamp that was the source of content for the current
142 // state of the root directory.
143 void GetLargestChangestamp(const GetChangestampCallback& callback);
144 void SetLargestChangestamp(int64 value,
145 const FileOperationCallback& callback);
146
144 // Add |entry| to directory with path |directory_path| and invoke the 147 // Add |entry| to directory with path |directory_path| and invoke the
145 // callback asynchronously. 148 // callback asynchronously.
146 // |callback| must not be null. 149 // |callback| must not be null.
147 void AddEntryToDirectory(const FilePath& directory_path, 150 void AddEntryToDirectory(const FilePath& directory_path,
148 scoped_ptr<google_apis::ResourceEntry> entry, 151 scoped_ptr<google_apis::ResourceEntry> entry,
149 const FileMoveCallback& callback); 152 const FileMoveCallback& callback);
150 153
151 // Add |entry_proto| to the metadata tree, based on its parent_resource_id. 154 // Add |entry_proto| to the metadata tree, based on its parent_resource_id.
152 // |callback| must not be null. 155 // |callback| must not be null.
153 void AddEntryToParent(const DriveEntryProto& entry_proto, 156 void AddEntryToParent(const DriveEntryProto& entry_proto,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 // This should remain the last member so it'll be destroyed first and 320 // This should remain the last member so it'll be destroyed first and
318 // invalidate its weak pointers before other members are destroyed. 321 // invalidate its weak pointers before other members are destroyed.
319 base::WeakPtrFactory<DriveResourceMetadata> weak_ptr_factory_; 322 base::WeakPtrFactory<DriveResourceMetadata> weak_ptr_factory_;
320 323
321 DISALLOW_COPY_AND_ASSIGN(DriveResourceMetadata); 324 DISALLOW_COPY_AND_ASSIGN(DriveResourceMetadata);
322 }; 325 };
323 326
324 } // namespace drive 327 } // namespace drive
325 328
326 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_ 329 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698