| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_STORE_TYPES_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_STORE_TYPES_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_STORE_TYPES_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_STORE_TYPES_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 // This file contains common types and callbacks used by storage of various | 13 // This file contains common types and callbacks used by storage of various |
| 14 // offline page related components. | 14 // offline page related components. |
| 15 namespace offline_pages { | 15 namespace offline_pages { |
| 16 | 16 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 33 STORE_ERROR, | 33 STORE_ERROR, |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // List of item action statuses mapped to item ID. | 36 // List of item action statuses mapped to item ID. |
| 37 typedef std::vector<std::pair<int64_t, ItemActionStatus>> MultipleItemStatuses; | 37 typedef std::vector<std::pair<int64_t, ItemActionStatus>> MultipleItemStatuses; |
| 38 | 38 |
| 39 // Collective result for store update. | 39 // Collective result for store update. |
| 40 template <typename T> | 40 template <typename T> |
| 41 class StoreUpdateResult { | 41 class StoreUpdateResult { |
| 42 public: | 42 public: |
| 43 explicit StoreUpdateResult(StoreState state) | 43 explicit StoreUpdateResult(StoreState state) : store_state(state) {} |
| 44 : store_state(state) {} | |
| 45 ~StoreUpdateResult() {} | 44 ~StoreUpdateResult() {} |
| 46 | 45 |
| 47 // List of Offline ID to item action status mappings. | 46 // List of Offline ID to item action status mappings. |
| 48 // It is meant to be consumed by the original caller of the operation. | 47 // It is meant to be consumed by the original caller of the operation. |
| 49 MultipleItemStatuses item_statuses; | 48 MultipleItemStatuses item_statuses; |
| 50 | 49 |
| 51 // List of successfully updated offline page items as seen after operation | 50 // List of successfully updated offline page items as seen after operation |
| 52 // concludes. It is meant to be used when passing to the observers. | 51 // concludes. It is meant to be used when passing to the observers. |
| 53 std::vector<T> updated_items; | 52 std::vector<T> updated_items; |
| 54 | 53 |
| 55 // State of the store after the operation is done. | 54 // State of the store after the operation is done. |
| 56 StoreState store_state; | 55 StoreState store_state; |
| 57 }; | 56 }; |
| 58 | 57 |
| 59 } // namespace offline_pages | 58 } // namespace offline_pages |
| 60 | 59 |
| 61 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_STORE_TYPES_H_ | 60 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_STORE_TYPES_H_ |
| OLD | NEW |