OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DOM_DISTILLER_CORE_DOM_DISTILLER_STORE_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_STORE_H_ |
6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_STORE_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_STORE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // 1. convert the change to a SyncChangeList. | 58 // 1. convert the change to a SyncChangeList. |
59 // 2. apply that change to the in-memory model, calculating what changed | 59 // 2. apply that change to the in-memory model, calculating what changed |
60 // (changes_applied) and what is missing--i.e. entries missing for a full merge, | 60 // (changes_applied) and what is missing--i.e. entries missing for a full merge, |
61 // conflict resolution for normal changes-- (changes_missing). | 61 // conflict resolution for normal changes-- (changes_missing). |
62 // 3. send a message (possibly handled asynchronously) containing | 62 // 3. send a message (possibly handled asynchronously) containing |
63 // changes_missing to the source of the change. | 63 // changes_missing to the source of the change. |
64 // 4. send messages (possibly handled asynchronously) containing changes_applied | 64 // 4. send messages (possibly handled asynchronously) containing changes_applied |
65 // to the other (i.e. non-source) two models. | 65 // to the other (i.e. non-source) two models. |
66 // TODO(cjhopman): Support deleting entries. | 66 // TODO(cjhopman): Support deleting entries. |
67 class DomDistillerStore : public syncer::SyncableService, | 67 class DomDistillerStore : public syncer::SyncableService, |
68 DomDistillerStoreInterface { | 68 public DomDistillerStoreInterface { |
69 public: | 69 public: |
70 // Creates storage using the given database for local storage. Initializes the | 70 // Creates storage using the given database for local storage. Initializes the |
71 // database with |database_dir|. | 71 // database with |database_dir|. |
72 DomDistillerStore(scoped_ptr<DomDistillerDatabaseInterface> database, | 72 DomDistillerStore(scoped_ptr<DomDistillerDatabaseInterface> database, |
73 const base::FilePath& database_dir); | 73 const base::FilePath& database_dir); |
74 | 74 |
75 // Creates storage using the given database for local storage. Initializes the | 75 // Creates storage using the given database for local storage. Initializes the |
76 // database with |database_dir|. Also initializes the internal model to | 76 // database with |database_dir|. Also initializes the internal model to |
77 // |initial_model|. | 77 // |initial_model|. |
78 DomDistillerStore(scoped_ptr<DomDistillerDatabaseInterface> database, | 78 DomDistillerStore(scoped_ptr<DomDistillerDatabaseInterface> database, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 DomDistillerModel model_; | 136 DomDistillerModel model_; |
137 | 137 |
138 base::WeakPtrFactory<DomDistillerStore> weak_ptr_factory_; | 138 base::WeakPtrFactory<DomDistillerStore> weak_ptr_factory_; |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(DomDistillerStore); | 140 DISALLOW_COPY_AND_ASSIGN(DomDistillerStore); |
141 }; | 141 }; |
142 | 142 |
143 } // namespace dom_distiller | 143 } // namespace dom_distiller |
144 | 144 |
145 #endif | 145 #endif |
OLD | NEW |