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_WAPI_FEED_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_PROCESSOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_PROCESSOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_PROCESSOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Applies the documents feeds to the file system using |directory_service_|. | 44 // Applies the documents feeds to the file system using |directory_service_|. |
45 // | 45 // |
46 // |start_changestamp| determines the type of feed to process. The value is | 46 // |start_changestamp| determines the type of feed to process. The value is |
47 // set to zero for the root feeds, every other value is for the delta feeds. | 47 // set to zero for the root feeds, every other value is for the delta feeds. |
48 // | 48 // |
49 // In the case of processing the root feeds |root_feed_changestamp| is used | 49 // In the case of processing the root feeds |root_feed_changestamp| is used |
50 // as its initial changestamp value. The value comes from | 50 // as its initial changestamp value. The value comes from |
51 // AccountMetadataFeed. | 51 // AccountMetadataFeed. |
52 GDataFileError ApplyFeeds(const std::vector<DocumentFeed*>& feed_list, | 52 GDataFileError ApplyFeeds(const std::vector<DocumentFeed*>& feed_list, |
53 int start_changestamp, | 53 int64 start_changestamp, |
54 int root_feed_changestamp, | 54 int64 root_feed_changestamp, |
55 std::set<FilePath>* changed_dirs); | 55 std::set<FilePath>* changed_dirs); |
56 | 56 |
57 // Converts list of document feeds from collected feeds into | 57 // Converts list of document feeds from collected feeds into |
58 // FileResourceIdMap. | 58 // FileResourceIdMap. |
59 GDataFileError FeedToFileResourceMap( | 59 GDataFileError FeedToFileResourceMap( |
60 const std::vector<DocumentFeed*>& feed_list, | 60 const std::vector<DocumentFeed*>& feed_list, |
61 FileResourceIdMap* file_map, | 61 FileResourceIdMap* file_map, |
62 int* feed_changestamp, | 62 int64* feed_changestamp, |
63 FeedToFileResourceMapUmaStats* uma_stats); | 63 FeedToFileResourceMapUmaStats* uma_stats); |
64 | 64 |
65 private: | 65 private: |
66 // Updates UMA histograms about file counts. | 66 // Updates UMA histograms about file counts. |
67 void UpdateFileCountUmaHistograms( | 67 void UpdateFileCountUmaHistograms( |
68 const FeedToFileResourceMapUmaStats& uma_stats) const; | 68 const FeedToFileResourceMapUmaStats& uma_stats) const; |
69 | 69 |
70 // Applies the pre-processed feed from |file_map| map onto the file system. | 70 // Applies the pre-processed feed from |file_map| map onto the file system. |
71 // All entries in |file_map| will be erased (i.e. the map becomes empty), | 71 // All entries in |file_map| will be erased (i.e. the map becomes empty), |
72 // and values are deleted. | 72 // and values are deleted. |
73 void ApplyFeedFromFileUrlMap(bool is_delta_feed, | 73 void ApplyFeedFromFileUrlMap(bool is_delta_feed, |
74 int feed_changestamp, | 74 int64 feed_changestamp, |
75 FileResourceIdMap* file_map, | 75 FileResourceIdMap* file_map, |
76 std::set<FilePath>* changed_dirs); | 76 std::set<FilePath>* changed_dirs); |
77 | 77 |
78 // Helper function for adding new |file| from the feed into |directory|. It | 78 // Helper function for adding new |file| from the feed into |directory|. It |
79 // checks the type of file and updates |changed_dirs| if this file adding | 79 // checks the type of file and updates |changed_dirs| if this file adding |
80 // operation needs to raise directory notification update. If file is being | 80 // operation needs to raise directory notification update. If file is being |
81 // added to |orphaned_dir_service| such notifications are not raised since | 81 // added to |orphaned_dir_service| such notifications are not raised since |
82 // we ignore such files and don't add them to the file system now. | 82 // we ignore such files and don't add them to the file system now. |
83 static void AddEntryToDirectoryAndCollectChangedDirectories( | 83 static void AddEntryToDirectoryAndCollectChangedDirectories( |
84 GDataEntry* entry, | 84 GDataEntry* entry, |
(...skipping 17 matching lines...) Expand all Loading... |
102 const FileResourceIdMap& file_map, | 102 const FileResourceIdMap& file_map, |
103 GDataDirectoryService* orphaned_dir_service); | 103 GDataDirectoryService* orphaned_dir_service); |
104 | 104 |
105 GDataDirectoryService* directory_service_; // Not owned by the class. | 105 GDataDirectoryService* directory_service_; // Not owned by the class. |
106 DISALLOW_COPY_AND_ASSIGN(GDataWapiFeedProcessor); | 106 DISALLOW_COPY_AND_ASSIGN(GDataWapiFeedProcessor); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace gdata | 109 } // namespace gdata |
110 | 110 |
111 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_PROCESSOR_H_ | 111 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_PROCESSOR_H_ |
OLD | NEW |