Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 | 14 |
| 14 class GURL; | 15 class GURL; |
| 15 | 16 |
| 16 namespace offline_pages { | 17 namespace offline_pages { |
| 17 | 18 |
| 18 struct OfflinePageItem; | 19 struct OfflinePageItem; |
| 19 | 20 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 50 enum ItemActionStatus { | 51 enum ItemActionStatus { |
| 51 SUCCESS, | 52 SUCCESS, |
| 52 ALREADY_EXISTS, | 53 ALREADY_EXISTS, |
| 53 DOESNT_EXIST, | 54 DOESNT_EXIST, |
| 54 STORE_ERROR, | 55 STORE_ERROR, |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 typedef base::Callback<void(LoadStatus, const std::vector<OfflinePageItem>&)> | 58 typedef base::Callback<void(LoadStatus, const std::vector<OfflinePageItem>&)> |
| 58 LoadCallback; | 59 LoadCallback; |
| 59 typedef base::Callback<void(ItemActionStatus)> AddCallback; | 60 typedef base::Callback<void(ItemActionStatus)> AddCallback; |
| 60 typedef base::Callback<void(bool)> UpdateCallback; | 61 typedef base::Callback<void(const std::map<int64_t, ItemActionStatus>&, |
|
dougarnett
2016/09/15 19:57:24
perhaps in the future, if we never end up using SU
dougarnett
2016/09/15 19:57:24
nit - seems like successful collection should come
fgorski
2016/09/19 23:24:29
Done.(Callback redesigned in patch 1)
fgorski
2016/09/19 23:24:29
Done. (Callback redesigned in patch 1)
| |
| 62 const std::vector<OfflinePageItem>&)> | |
| 63 UpdateCallback; | |
| 61 typedef base::Callback<void(bool)> ResetCallback; | 64 typedef base::Callback<void(bool)> ResetCallback; |
| 62 | 65 |
| 63 OfflinePageMetadataStore(); | 66 OfflinePageMetadataStore(); |
| 64 virtual ~OfflinePageMetadataStore(); | 67 virtual ~OfflinePageMetadataStore(); |
| 65 | 68 |
| 66 // Get all of the offline pages from the store. | 69 // Get all of the offline pages from the store. |
| 67 virtual void GetOfflinePages(const LoadCallback& callback) = 0; | 70 virtual void GetOfflinePages(const LoadCallback& callback) = 0; |
| 68 | 71 |
| 69 // Asynchronously adds an offline page item metadata to the store. | 72 // Asynchronously adds an offline page item metadata to the store. |
| 70 virtual void AddOfflinePage(const OfflinePageItem& offline_page, | 73 virtual void AddOfflinePage(const OfflinePageItem& offline_page, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 82 // Resets the store. | 85 // Resets the store. |
| 83 virtual void Reset(const ResetCallback& callback) = 0; | 86 virtual void Reset(const ResetCallback& callback) = 0; |
| 84 | 87 |
| 85 // Gets the store state. | 88 // Gets the store state. |
| 86 virtual StoreState state() const = 0; | 89 virtual StoreState state() const = 0; |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 } // namespace offline_pages | 92 } // namespace offline_pages |
| 90 | 93 |
| 91 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ | 94 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_ |
| OLD | NEW |