| 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_READING_LIST_CORE_READING_LIST_STORE_H_ | 5 #ifndef COMPONENTS_READING_LIST_CORE_READING_LIST_STORE_H_ |
| 6 #define COMPONENTS_READING_LIST_CORE_READING_LIST_STORE_H_ | 6 #define COMPONENTS_READING_LIST_CORE_READING_LIST_STORE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/threading/non_thread_safe.h" | 11 #include "base/sequence_checker.h" |
| 12 #include "components/reading_list/core/reading_list_model_storage.h" | 12 #include "components/reading_list/core/reading_list_model_storage.h" |
| 13 #include "components/reading_list/core/reading_list_store_delegate.h" | 13 #include "components/reading_list/core/reading_list_store_delegate.h" |
| 14 #include "components/sync/model/model_error.h" | 14 #include "components/sync/model/model_error.h" |
| 15 #include "components/sync/model/model_type_store.h" | 15 #include "components/sync/model/model_type_store.h" |
| 16 | 16 |
| 17 namespace syncer { | 17 namespace syncer { |
| 18 class MutableDataBatch; | 18 class MutableDataBatch; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class ReadingListModel; | 21 class ReadingListModel; |
| 22 | 22 |
| 23 // A ReadingListModelStorage storing and syncing data in protobufs. | 23 // A ReadingListModelStorage storing and syncing data in protobufs. |
| 24 class ReadingListStore : public ReadingListModelStorage, | 24 class ReadingListStore : public ReadingListModelStorage { |
| 25 public base::NonThreadSafe { | |
| 26 using StoreFactoryFunction = base::Callback<void( | 25 using StoreFactoryFunction = base::Callback<void( |
| 27 const syncer::ModelTypeStore::InitCallback& callback)>; | 26 const syncer::ModelTypeStore::InitCallback& callback)>; |
| 28 | 27 |
| 29 public: | 28 public: |
| 30 ReadingListStore(StoreFactoryFunction create_store_callback, | 29 ReadingListStore(StoreFactoryFunction create_store_callback, |
| 31 const ChangeProcessorFactory& change_processor_factory); | 30 const ChangeProcessorFactory& change_processor_factory); |
| 32 ~ReadingListStore() override; | 31 ~ReadingListStore() override; |
| 33 | 32 |
| 34 std::unique_ptr<ScopedBatchUpdate> EnsureBatchCreated() override; | 33 std::unique_ptr<ScopedBatchUpdate> EnsureBatchCreated() override; |
| 35 | 34 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 std::unique_ptr<syncer::ModelTypeStore> store_; | 160 std::unique_ptr<syncer::ModelTypeStore> store_; |
| 162 ReadingListModel* model_; | 161 ReadingListModel* model_; |
| 163 ReadingListStoreDelegate* delegate_; | 162 ReadingListStoreDelegate* delegate_; |
| 164 StoreFactoryFunction create_store_callback_; | 163 StoreFactoryFunction create_store_callback_; |
| 165 | 164 |
| 166 int pending_transaction_count_; | 165 int pending_transaction_count_; |
| 167 std::unique_ptr<syncer::ModelTypeStore::WriteBatch> batch_; | 166 std::unique_ptr<syncer::ModelTypeStore::WriteBatch> batch_; |
| 168 | 167 |
| 169 base::Clock* clock_; | 168 base::Clock* clock_; |
| 170 | 169 |
| 170 SEQUENCE_CHECKER(sequence_checker_); |
| 171 |
| 171 DISALLOW_COPY_AND_ASSIGN(ReadingListStore); | 172 DISALLOW_COPY_AND_ASSIGN(ReadingListStore); |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 #endif // COMPONENTS_READING_LIST_CORE_READING_LIST_STORE_H_ | 175 #endif // COMPONENTS_READING_LIST_CORE_READING_LIST_STORE_H_ |
| OLD | NEW |