| 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_CHANGE_LIST_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_PROCESSOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "chrome/browser/chromeos/drive/drive_file_error.h" | 17 #include "chrome/browser/chromeos/drive/drive_file_error.h" |
| 18 #include "chrome/browser/google_apis/drive_api_parser.h" |
| 18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 19 | 20 |
| 20 namespace google_apis { | 21 namespace google_apis { |
| 21 class ResourceList; | 22 class ResourceList; |
| 22 } // google_apis | 23 } // google_apis |
| 23 | 24 |
| 24 namespace drive { | 25 namespace drive { |
| 25 | 26 |
| 26 class DriveEntryProto; | 27 class DriveEntryProto; |
| 27 class DriveResourceMetadata; | 28 class DriveResourceMetadata; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 45 // root feed (false) or a delta feed (true). | 46 // root feed (false) or a delta feed (true). |
| 46 // | 47 // |
| 47 // In the case of processing the root feeds |root_feed_changestamp| is used | 48 // In the case of processing the root feeds |root_feed_changestamp| is used |
| 48 // as its initial changestamp value. The value comes from | 49 // as its initial changestamp value. The value comes from |
| 49 // google_apis::AccountMetadata. | 50 // google_apis::AccountMetadata. |
| 50 // |on_complete_callback| is run after the feed is applied. | 51 // |on_complete_callback| is run after the feed is applied. |
| 51 // |on_complete_callback| must not be null. | 52 // |on_complete_callback| must not be null. |
| 52 // TODO(achuith): Change the type of on_complete_callback to | 53 // TODO(achuith): Change the type of on_complete_callback to |
| 53 // FileOperationCallback instead. | 54 // FileOperationCallback instead. |
| 54 void ApplyFeeds( | 55 void ApplyFeeds( |
| 56 scoped_ptr<google_apis::AboutResource> about_resource, |
| 55 const ScopedVector<google_apis::ResourceList>& feed_list, | 57 const ScopedVector<google_apis::ResourceList>& feed_list, |
| 56 bool is_delta_feed, | 58 bool is_delta_feed, |
| 57 int64 root_feed_changestamp, | |
| 58 const base::Closure& on_complete_callback); | 59 const base::Closure& on_complete_callback); |
| 59 | 60 |
| 60 // Converts list of document feeds from collected feeds into a | 61 // Converts list of document feeds from collected feeds into a |
| 61 // DriveEntryProtoMap. |feed_changestamp| and/or |uma_stats| may be NULL. | 62 // DriveEntryProtoMap. |feed_changestamp| and/or |uma_stats| may be NULL. |
| 62 // entry_proto_map_ and root_upload_url_ are updated as side effects. | 63 // entry_proto_map_ and root_upload_url_ are updated as side effects. |
| 63 void FeedToEntryProtoMap( | 64 void FeedToEntryProtoMap( |
| 64 const ScopedVector<google_apis::ResourceList>& feed_list, | 65 const ScopedVector<google_apis::ResourceList>& feed_list, |
| 65 int64* feed_changestamp, | 66 int64* feed_changestamp, |
| 66 ChangeListToEntryProtoMapUMAStats* uma_stats); | 67 ChangeListToEntryProtoMapUMAStats* uma_stats); |
| 67 | 68 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 173 |
| 173 // Note: This should remain the last member so it'll be destroyed and | 174 // Note: This should remain the last member so it'll be destroyed and |
| 174 // invalidate its weak pointers before any other members are destroyed. | 175 // invalidate its weak pointers before any other members are destroyed. |
| 175 base::WeakPtrFactory<ChangeListProcessor> weak_ptr_factory_; | 176 base::WeakPtrFactory<ChangeListProcessor> weak_ptr_factory_; |
| 176 DISALLOW_COPY_AND_ASSIGN(ChangeListProcessor); | 177 DISALLOW_COPY_AND_ASSIGN(ChangeListProcessor); |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 } // namespace drive | 180 } // namespace drive |
| 180 | 181 |
| 181 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_PROCESSOR_H_ | 182 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_PROCESSOR_H_ |
| OLD | NEW |