Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: components/sync_driver/change_processor.h

Issue 1966023002: [Sync] Move DataTypeErrorHandler to //sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Found an unsaved buffer :( Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/sync_driver/BUILD.gn ('k') | components/sync_driver/change_processor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SYNC_DRIVER_CHANGE_PROCESSOR_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_
6 #define COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_ 6 #define COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/sync_driver/data_type_error_handler.h"
12 #include "sync/internal_api/public/base_transaction.h" 11 #include "sync/internal_api/public/base_transaction.h"
13 #include "sync/internal_api/public/change_record.h" 12 #include "sync/internal_api/public/change_record.h"
14 #include "sync/internal_api/public/user_share.h" 13 #include "sync/internal_api/public/user_share.h"
15 14
16 namespace syncer { 15 namespace syncer {
16 class DataTypeErrorHandler;
17 class UnrecoverableErrorHandler; 17 class UnrecoverableErrorHandler;
18 } // namespace syncer 18 } // namespace syncer
19 19
20 namespace sync_driver { 20 namespace sync_driver {
21 21
22 class ModelAssociator; 22 class ModelAssociator;
23 23
24 // An interface used to apply changes from the sync model to the browser's 24 // An interface used to apply changes from the sync model to the browser's
25 // native model. This does not currently distinguish between model data types. 25 // native model. This does not currently distinguish between model data types.
26 class ChangeProcessor { 26 class ChangeProcessor {
27 public: 27 public:
28 explicit ChangeProcessor(DataTypeErrorHandler* error_handler); 28 explicit ChangeProcessor(syncer::DataTypeErrorHandler* error_handler);
29 virtual ~ChangeProcessor(); 29 virtual ~ChangeProcessor();
30 30
31 // Call when the processor should accept changes from either provided model 31 // Call when the processor should accept changes from either provided model
32 // and apply them to the other. Both the native model and sync_api are 32 // and apply them to the other. Both the native model and sync_api are
33 // expected to be initialized and loaded. You must have set a valid 33 // expected to be initialized and loaded. You must have set a valid
34 // ModelAssociator and UnrecoverableErrorHandler before using this method, and 34 // ModelAssociator and UnrecoverableErrorHandler before using this method, and
35 // the two models should be associated w.r.t the ModelAssociator provided. 35 // the two models should be associated w.r.t the ModelAssociator provided.
36 void Start(syncer::UserShare* share_handle); 36 void Start(syncer::UserShare* share_handle);
37 37
38 // Changes have been applied to the backend model and are ready to be 38 // Changes have been applied to the backend model and are ready to be
(...skipping 10 matching lines...) Expand all
49 // This function is called once the transactional lock is released and it is 49 // This function is called once the transactional lock is released and it is
50 // safe to perform inter-thread or slow I/O operations. Note that not all 50 // safe to perform inter-thread or slow I/O operations. Note that not all
51 // datatypes need this, so we provide an empty default version. 51 // datatypes need this, so we provide an empty default version.
52 virtual void CommitChangesFromSyncModel(); 52 virtual void CommitChangesFromSyncModel();
53 53
54 protected: 54 protected:
55 // These methods are invoked by Start() and Stop() to do 55 // These methods are invoked by Start() and Stop() to do
56 // implementation-specific work. 56 // implementation-specific work.
57 virtual void StartImpl() = 0; 57 virtual void StartImpl() = 0;
58 58
59 DataTypeErrorHandler* error_handler() const; 59 syncer::DataTypeErrorHandler* error_handler() const;
60 virtual syncer::UserShare* share_handle() const; 60 virtual syncer::UserShare* share_handle() const;
61 61
62 private: 62 private:
63 DataTypeErrorHandler* error_handler_; // Guaranteed to outlive us. 63 syncer::DataTypeErrorHandler* error_handler_; // Guaranteed to outlive us.
64 64
65 // The sync model we are processing changes from. 65 // The sync model we are processing changes from.
66 syncer::UserShare* share_handle_; 66 syncer::UserShare* share_handle_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(ChangeProcessor); 68 DISALLOW_COPY_AND_ASSIGN(ChangeProcessor);
69 }; 69 };
70 70
71 } // namespace sync_driver 71 } // namespace sync_driver
72 72
73 #endif // COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_ 73 #endif // COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_
OLDNEW
« no previous file with comments | « components/sync_driver/BUILD.gn ('k') | components/sync_driver/change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698