| 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_DRIVE_GDATA_WAPI_FEED_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_GDATA_WAPI_FEED_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_GDATA_WAPI_FEED_PROCESSOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "chrome/browser/google_apis/gdata_errorcode.h" | 14 #include "chrome/browser/google_apis/gdata_errorcode.h" |
| 15 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 15 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
| 16 | 16 |
| 17 namespace gdata { | 17 namespace drive { |
| 18 | 18 |
| 19 class DriveDirectory; | 19 class DriveDirectory; |
| 20 class DriveEntry; | 20 class DriveEntry; |
| 21 class DriveResourceMetadata; | 21 class DriveResourceMetadata; |
| 22 | 22 |
| 23 typedef std::map<std::string /* resource_id */, DriveEntry*> | 23 typedef std::map<std::string /* resource_id */, DriveEntry*> |
| 24 FileResourceIdMap; | 24 FileResourceIdMap; |
| 25 | 25 |
| 26 // Struct used to record UMA stats with FeedToFileResourceMap(). | 26 // Struct used to record UMA stats with FeedToFileResourceMap(). |
| 27 struct FeedToFileResourceMapUmaStats { | 27 struct FeedToFileResourceMapUmaStats { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 39 explicit GDataWapiFeedProcessor(DriveResourceMetadata* resource_metadata); | 39 explicit GDataWapiFeedProcessor(DriveResourceMetadata* resource_metadata); |
| 40 ~GDataWapiFeedProcessor(); | 40 ~GDataWapiFeedProcessor(); |
| 41 | 41 |
| 42 // Applies the documents feeds to the file system using |resource_metadata_|. | 42 // Applies the documents feeds to the file system using |resource_metadata_|. |
| 43 // | 43 // |
| 44 // |start_changestamp| determines the type of feed to process. The value is | 44 // |start_changestamp| determines the type of feed to process. The value is |
| 45 // set to zero for the root feeds, every other value is for the delta feeds. | 45 // set to zero for the root feeds, every other value is for the delta feeds. |
| 46 // | 46 // |
| 47 // In the case of processing the root feeds |root_feed_changestamp| is used | 47 // In the case of processing the root feeds |root_feed_changestamp| is used |
| 48 // as its initial changestamp value. The value comes from | 48 // as its initial changestamp value. The value comes from |
| 49 // AccountMetadataFeed. | 49 // gdata::AccountMetadataFeed. |
| 50 DriveFileError ApplyFeeds(const ScopedVector<DocumentFeed>& feed_list, | 50 DriveFileError ApplyFeeds(const ScopedVector<gdata::DocumentFeed>& feed_list, |
| 51 int64 start_changestamp, | 51 int64 start_changestamp, |
| 52 int64 root_feed_changestamp, | 52 int64 root_feed_changestamp, |
| 53 std::set<FilePath>* changed_dirs); | 53 std::set<FilePath>* changed_dirs); |
| 54 | 54 |
| 55 // Converts list of document feeds from collected feeds into | 55 // Converts list of document feeds from collected feeds into |
| 56 // FileResourceIdMap. | 56 // FileResourceIdMap. |
| 57 DriveFileError FeedToFileResourceMap( | 57 DriveFileError FeedToFileResourceMap( |
| 58 const ScopedVector<DocumentFeed>& feed_list, | 58 const ScopedVector<gdata::DocumentFeed>& feed_list, |
| 59 FileResourceIdMap* file_map, | 59 FileResourceIdMap* file_map, |
| 60 int64* feed_changestamp, | 60 int64* feed_changestamp, |
| 61 FeedToFileResourceMapUmaStats* uma_stats); | 61 FeedToFileResourceMapUmaStats* uma_stats); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Updates UMA histograms about file counts. | 64 // Updates UMA histograms about file counts. |
| 65 void UpdateFileCountUmaHistograms( | 65 void UpdateFileCountUmaHistograms( |
| 66 const FeedToFileResourceMapUmaStats& uma_stats) const; | 66 const FeedToFileResourceMapUmaStats& uma_stats) const; |
| 67 | 67 |
| 68 // Applies the pre-processed feed from |file_map| map onto the file system. | 68 // Applies the pre-processed feed from |file_map| map onto the file system. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 97 // either locally cached file system or in this new feed. | 97 // either locally cached file system or in this new feed. |
| 98 DriveDirectory* FindDirectoryForNewEntry( | 98 DriveDirectory* FindDirectoryForNewEntry( |
| 99 DriveEntry* new_entry, | 99 DriveEntry* new_entry, |
| 100 const FileResourceIdMap& file_map, | 100 const FileResourceIdMap& file_map, |
| 101 DriveResourceMetadata* orphaned_ressources); | 101 DriveResourceMetadata* orphaned_ressources); |
| 102 | 102 |
| 103 DriveResourceMetadata* resource_metadata_; // Not owned. | 103 DriveResourceMetadata* resource_metadata_; // Not owned. |
| 104 DISALLOW_COPY_AND_ASSIGN(GDataWapiFeedProcessor); | 104 DISALLOW_COPY_AND_ASSIGN(GDataWapiFeedProcessor); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace gdata | 107 } // namespace drive |
| 108 | 108 |
| 109 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_GDATA_WAPI_FEED_PROCESSOR_H_ | 109 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_GDATA_WAPI_FEED_PROCESSOR_H_ |
| OLD | NEW |