OLD | NEW |
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_GDATA_GDATA_FILES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 356 |
357 // Last time when we dumped serialized file system to disk. | 357 // Last time when we dumped serialized file system to disk. |
358 const base::Time& last_serialized() const { return last_serialized_; } | 358 const base::Time& last_serialized() const { return last_serialized_; } |
359 void set_last_serialized(const base::Time& time) { last_serialized_ = time; } | 359 void set_last_serialized(const base::Time& time) { last_serialized_ = time; } |
360 // Size of serialized file system on disk in bytes. | 360 // Size of serialized file system on disk in bytes. |
361 const size_t serialized_size() const { return serialized_size_; } | 361 const size_t serialized_size() const { return serialized_size_; } |
362 void set_serialized_size(size_t size) { serialized_size_ = size; } | 362 void set_serialized_size(size_t size) { serialized_size_ = size; } |
363 | 363 |
364 // Largest change timestamp that was the source of content for the current | 364 // Largest change timestamp that was the source of content for the current |
365 // state of the root directory. | 365 // state of the root directory. |
366 const int largest_changestamp() const { return largest_changestamp_; } | 366 const int64 largest_changestamp() const { return largest_changestamp_; } |
367 void set_largest_changestamp(int value) { largest_changestamp_ = value; } | 367 void set_largest_changestamp(int64 value) { largest_changestamp_ = value; } |
368 | 368 |
369 // The root directory content origin. | 369 // The root directory content origin. |
370 const ContentOrigin origin() const { return origin_; } | 370 const ContentOrigin origin() const { return origin_; } |
371 void set_origin(ContentOrigin value) { origin_ = value; } | 371 void set_origin(ContentOrigin value) { origin_ = value; } |
372 | 372 |
| 373 // Sets root directory resource id. |
| 374 void SetRootResourceId(const std::string& root_id); |
| 375 |
373 // Adds |entry| to |directory_path| asynchronously. | 376 // Adds |entry| to |directory_path| asynchronously. |
374 // Must be called on UI thread. |callback| is called on the UI thread. | 377 // Must be called on UI thread. |callback| is called on the UI thread. |
375 void AddEntryToDirectory(const FilePath& directory_path, | 378 void AddEntryToDirectory(const FilePath& directory_path, |
376 GDataEntry* entry, | 379 GDataEntry* entry, |
377 const FileOperationCallback& callback); | 380 const FileOperationCallback& callback); |
378 | 381 |
379 // Adds the entry to resource map. | 382 // Adds the entry to resource map. |
380 void AddEntryToResourceMap(GDataEntry* entry); | 383 void AddEntryToResourceMap(GDataEntry* entry); |
381 | 384 |
382 // Removes the entry from resource map. | 385 // Removes the entry from resource map. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 // Private data members. | 440 // Private data members. |
438 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 441 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
439 scoped_ptr<ResourceMetadataDB> directory_service_db_; | 442 scoped_ptr<ResourceMetadataDB> directory_service_db_; |
440 | 443 |
441 ResourceMap resource_map_; | 444 ResourceMap resource_map_; |
442 | 445 |
443 scoped_ptr<GDataDirectory> root_; // Stored in the serialized proto. | 446 scoped_ptr<GDataDirectory> root_; // Stored in the serialized proto. |
444 | 447 |
445 base::Time last_serialized_; | 448 base::Time last_serialized_; |
446 size_t serialized_size_; | 449 size_t serialized_size_; |
447 int largest_changestamp_; // Stored in the serialized proto. | 450 int64 largest_changestamp_; // Stored in the serialized proto. |
448 ContentOrigin origin_; | 451 ContentOrigin origin_; |
449 | 452 |
450 // This should remain the last member so it'll be destroyed first and | 453 // This should remain the last member so it'll be destroyed first and |
451 // invalidate its weak pointers before other members are destroyed. | 454 // invalidate its weak pointers before other members are destroyed. |
452 base::WeakPtrFactory<GDataDirectoryService> weak_ptr_factory_; | 455 base::WeakPtrFactory<GDataDirectoryService> weak_ptr_factory_; |
453 | 456 |
454 DISALLOW_COPY_AND_ASSIGN(GDataDirectoryService); | 457 DISALLOW_COPY_AND_ASSIGN(GDataDirectoryService); |
455 }; | 458 }; |
456 | 459 |
457 } // namespace gdata | 460 } // namespace gdata |
458 | 461 |
459 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 462 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
OLD | NEW |