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

Side by Side Diff: components/sync/driver/sync_service_base.h

Issue 2732333003: [Sync] ModelTypeStore factory shouldn't require valid PSS to function correctly (Closed)
Patch Set: Address comments Created 3 years, 9 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/sync_client.h ('k') | components/sync/driver/sync_service_base.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 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_SYNC_DRIVER_SYNC_SERVICE_BASE_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_BASE_H_
6 #define COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_BASE_H_ 6 #define COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_BASE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 30 matching lines...) Expand all
41 const version_info::Channel& channel, 41 const version_info::Channel& channel,
42 const base::FilePath& base_directory, 42 const base::FilePath& base_directory,
43 const std::string& debug_identifier); 43 const std::string& debug_identifier);
44 ~SyncServiceBase() override; 44 ~SyncServiceBase() override;
45 45
46 // SyncService partial implementation. 46 // SyncService partial implementation.
47 void AddObserver(SyncServiceObserver* observer) override; 47 void AddObserver(SyncServiceObserver* observer) override;
48 void RemoveObserver(SyncServiceObserver* observer) override; 48 void RemoveObserver(SyncServiceObserver* observer) override;
49 bool HasObserver(const SyncServiceObserver* observer) const override; 49 bool HasObserver(const SyncServiceObserver* observer) const override;
50 50
51 // Given base path (path to profile) formats path to "Sync Data" folder where
52 // sync engine stores directory database.
53 static base::FilePath FormatSyncDataPath(
54 const base::FilePath& base_directory);
55
56 // Given base path (path to profile) formats path to a folder containing
57 // ModelTypeStore's leveldb database.
58 static base::FilePath FormatSharedModelTypeStorePath(
59 const base::FilePath& base_directory);
60
51 protected: 61 protected:
52 // Notify all observers that a change has occurred. 62 // Notify all observers that a change has occurred.
53 void NotifyObservers(); 63 void NotifyObservers();
54 64
55 // Kicks off asynchronous initialization of the SyncEngine. 65 // Kicks off asynchronous initialization of the SyncEngine.
56 void InitializeEngine(); 66 void InitializeEngine();
57 67
58 // Destroys the |crypto_| object and creates a new one with fresh state. 68 // Destroys the |crypto_| object and creates a new one with fresh state.
59 void ResetCryptoState(); 69 void ResetCryptoState();
60 70
(...skipping 19 matching lines...) Expand all
80 // email address. 90 // email address.
81 const std::unique_ptr<SigninManagerWrapper> signin_; 91 const std::unique_ptr<SigninManagerWrapper> signin_;
82 92
83 // The product channel of the embedder. 93 // The product channel of the embedder.
84 const version_info::Channel channel_; 94 const version_info::Channel channel_;
85 95
86 // The path to the base directory under which sync should store its 96 // The path to the base directory under which sync should store its
87 // information. 97 // information.
88 const base::FilePath base_directory_; 98 const base::FilePath base_directory_;
89 99
90 // The full path to the sync data folder. The folder is not fully deleted when
91 // sync is disabled, since it holds both Directory and ModelTypeStore data.
92 // Directory files will be selectively targeted instead.
93 const base::FilePath sync_data_folder_;
94
95 // An identifier representing this instance for debugging purposes. 100 // An identifier representing this instance for debugging purposes.
96 const std::string debug_identifier_; 101 const std::string debug_identifier_;
97 102
98 // The class that handles getting, setting, and persisting sync 103 // The class that handles getting, setting, and persisting sync
99 // preferences. 104 // preferences.
100 SyncPrefs sync_prefs_; 105 SyncPrefs sync_prefs_;
101 106
102 // A utility object containing logic and state relating to encryption. It is 107 // A utility object containing logic and state relating to encryption. It is
103 // never null. 108 // never null.
104 std::unique_ptr<SyncServiceCrypto> crypto_; 109 std::unique_ptr<SyncServiceCrypto> crypto_;
(...skipping 15 matching lines...) Expand all
120 // this object was created on. 125 // this object was created on.
121 base::ThreadChecker thread_checker_; 126 base::ThreadChecker thread_checker_;
122 127
123 private: 128 private:
124 DISALLOW_COPY_AND_ASSIGN(SyncServiceBase); 129 DISALLOW_COPY_AND_ASSIGN(SyncServiceBase);
125 }; 130 };
126 131
127 } // namespace syncer 132 } // namespace syncer
128 133
129 #endif // COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_BASE_H_ 134 #endif // COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_BASE_H_
OLDNEW
« no previous file with comments | « components/sync/driver/sync_client.h ('k') | components/sync/driver/sync_service_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698