Chromium Code Reviews| 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_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 529 void UpdateFileCountUmaHistograms( | 529 void UpdateFileCountUmaHistograms( |
| 530 const FeedToFileResourceMapUmaStats& uma_stats) const; | 530 const FeedToFileResourceMapUmaStats& uma_stats) const; |
| 531 | 531 |
| 532 // Applies the pre-processed feed from |file_map| map onto the file system. | 532 // Applies the pre-processed feed from |file_map| map onto the file system. |
| 533 // All entries in |file_map| will be erased (i.e. the map becomes empty), | 533 // All entries in |file_map| will be erased (i.e. the map becomes empty), |
| 534 // and values are deleted. | 534 // and values are deleted. |
| 535 void ApplyFeedFromFileUrlMap(bool is_delta_feed, | 535 void ApplyFeedFromFileUrlMap(bool is_delta_feed, |
| 536 int feed_changestamp, | 536 int feed_changestamp, |
| 537 FileResourceIdMap* file_map); | 537 FileResourceIdMap* file_map); |
| 538 | 538 |
| 539 // Helper function for adding new |file| from the feed into |directory|. It | |
| 540 // checks the type of file and updates |changed_dirs| if this file adding | |
| 541 // operation needs to raise directory notification update. If file is being | |
| 542 // added to |orphaned_dir_service| such notifications are not raised since | |
| 543 // we ignore such files and don't add them to the file system now. | |
| 544 // static | |
| 545 static void AddEntryToDirectoryAndCollectChangedDirectories( | |
|
achuithb
2012/07/31 00:06:52
Why are these moved here from anon namespace?
satorux1
2012/07/31 00:28:30
so that GDataDirectory::AddEntry() can be called.
| |
| 546 GDataEntry* entry, | |
| 547 GDataDirectory* directory, | |
| 548 GDataDirectoryService* orphaned_dir_service, | |
| 549 std::set<FilePath>* changed_dirs); | |
| 550 | |
| 551 // Helper function for removing |entry| from |directory|. If |entry| is a | |
| 552 // directory too, it will collect all its children file paths into | |
| 553 // |changed_dirs| as well. | |
| 554 // static | |
| 555 static void RemoveEntryFromDirectoryAndCollectChangedDirectories( | |
| 556 GDataDirectory* directory, | |
| 557 GDataEntry* entry, | |
| 558 std::set<FilePath>* changed_dirs); | |
| 559 | |
| 539 // Finds directory where new |file| should be added to during feed processing. | 560 // Finds directory where new |file| should be added to during feed processing. |
| 540 // |orphaned_entries_dir| collects files/dirs that don't have a parent in | 561 // |orphaned_entries_dir| collects files/dirs that don't have a parent in |
| 541 // either locally cached file system or in this new feed. | 562 // either locally cached file system or in this new feed. |
| 542 GDataDirectory* FindDirectoryForNewEntry( | 563 GDataDirectory* FindDirectoryForNewEntry( |
| 543 GDataEntry* new_entry, | 564 GDataEntry* new_entry, |
| 544 const FileResourceIdMap& file_map, | 565 const FileResourceIdMap& file_map, |
| 545 GDataDirectoryService* orphaned_entries); | 566 GDataDirectoryService* orphaned_entries); |
| 546 | 567 |
| 547 // Converts list of document feeds from collected feeds into | 568 // Converts list of document feeds from collected feeds into |
| 548 // FileResourceIdMap. | 569 // FileResourceIdMap. |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 909 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 930 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
| 910 | 931 |
| 911 ObserverList<Observer> observers_; | 932 ObserverList<Observer> observers_; |
| 912 | 933 |
| 913 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 934 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 914 }; | 935 }; |
| 915 | 936 |
| 916 } // namespace gdata | 937 } // namespace gdata |
| 917 | 938 |
| 918 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 939 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |