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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 550 |
551 // Helper function for removing |entry| from |directory|. If |entry| is a | 551 // Helper function for removing |entry| from |directory|. If |entry| is a |
552 // directory too, it will collect all its children file paths into | 552 // directory too, it will collect all its children file paths into |
553 // |changed_dirs| as well. | 553 // |changed_dirs| as well. |
554 // static | 554 // static |
555 static void RemoveEntryFromDirectoryAndCollectChangedDirectories( | 555 static void RemoveEntryFromDirectoryAndCollectChangedDirectories( |
556 GDataDirectory* directory, | 556 GDataDirectory* directory, |
557 GDataEntry* entry, | 557 GDataEntry* entry, |
558 std::set<FilePath>* changed_dirs); | 558 std::set<FilePath>* changed_dirs); |
559 | 559 |
| 560 // Callback for GetEntryByResourceIdAsync. |
| 561 // Removes stale entry upon upload of file. |
| 562 static void RemoveStaleEntryOnUpload(const std::string& resource_id, |
| 563 GDataDirectory* parent_dir, |
| 564 GDataEntry* existing_entry); |
| 565 |
560 // Finds directory where new |file| should be added to during feed processing. | 566 // Finds directory where new |file| should be added to during feed processing. |
561 // |orphaned_entries_dir| collects files/dirs that don't have a parent in | 567 // |orphaned_entries_dir| collects files/dirs that don't have a parent in |
562 // either locally cached file system or in this new feed. | 568 // either locally cached file system or in this new feed. |
563 GDataDirectory* FindDirectoryForNewEntry( | 569 GDataDirectory* FindDirectoryForNewEntry( |
564 GDataEntry* new_entry, | 570 GDataEntry* new_entry, |
565 const FileResourceIdMap& file_map, | 571 const FileResourceIdMap& file_map, |
566 GDataDirectoryService* orphaned_entries); | 572 GDataDirectoryService* orphaned_entries); |
567 | 573 |
568 // Converts list of document feeds from collected feeds into | 574 // Converts list of document feeds from collected feeds into |
569 // FileResourceIdMap. | 575 // FileResourceIdMap. |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 936 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
931 | 937 |
932 ObserverList<Observer> observers_; | 938 ObserverList<Observer> observers_; |
933 | 939 |
934 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 940 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
935 }; | 941 }; |
936 | 942 |
937 } // namespace gdata | 943 } // namespace gdata |
938 | 944 |
939 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 945 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |