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

Side by Side Diff: sync/internal_api/sync_manager_impl.h

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_ 5 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_
6 #define SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_ 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 ModelTypeSet to_download, 88 ModelTypeSet to_download,
89 ModelTypeSet to_purge, 89 ModelTypeSet to_purge,
90 ModelTypeSet to_journal, 90 ModelTypeSet to_journal,
91 ModelTypeSet to_unapply, 91 ModelTypeSet to_unapply,
92 const ModelSafeRoutingInfo& new_routing_info, 92 const ModelSafeRoutingInfo& new_routing_info,
93 const base::Closure& ready_task, 93 const base::Closure& ready_task,
94 const base::Closure& retry_task) override; 94 const base::Closure& retry_task) override;
95 void SetInvalidatorEnabled(bool invalidator_enabled) override; 95 void SetInvalidatorEnabled(bool invalidator_enabled) override;
96 void OnIncomingInvalidation( 96 void OnIncomingInvalidation(
97 syncer::ModelType type, 97 syncer::ModelType type,
98 scoped_ptr<InvalidationInterface> invalidation) override; 98 std::unique_ptr<InvalidationInterface> invalidation) override;
99 void AddObserver(SyncManager::Observer* observer) override; 99 void AddObserver(SyncManager::Observer* observer) override;
100 void RemoveObserver(SyncManager::Observer* observer) override; 100 void RemoveObserver(SyncManager::Observer* observer) override;
101 SyncStatus GetDetailedStatus() const override; 101 SyncStatus GetDetailedStatus() const override;
102 void SaveChanges() override; 102 void SaveChanges() override;
103 void ShutdownOnSyncThread(ShutdownReason reason) override; 103 void ShutdownOnSyncThread(ShutdownReason reason) override;
104 UserShare* GetUserShare() override; 104 UserShare* GetUserShare() override;
105 syncer_v2::SyncContextProxy* GetSyncContextProxy() override; 105 syncer_v2::SyncContextProxy* GetSyncContextProxy() override;
106 const std::string cache_guid() override; 106 const std::string cache_guid() override;
107 bool ReceivedExperiment(Experiments* experiments) override; 107 bool ReceivedExperiment(Experiments* experiments) override;
108 bool HasUnsyncedItems() override; 108 bool HasUnsyncedItems() override;
109 SyncEncryptionHandler* GetEncryptionHandler() override; 109 SyncEncryptionHandler* GetEncryptionHandler() override;
110 ScopedVector<syncer::ProtocolEvent> GetBufferedProtocolEvents() override; 110 ScopedVector<syncer::ProtocolEvent> GetBufferedProtocolEvents() override;
111 scoped_ptr<base::ListValue> GetAllNodesForType( 111 std::unique_ptr<base::ListValue> GetAllNodesForType(
112 syncer::ModelType type) override; 112 syncer::ModelType type) override;
113 void RegisterDirectoryTypeDebugInfoObserver( 113 void RegisterDirectoryTypeDebugInfoObserver(
114 syncer::TypeDebugInfoObserver* observer) override; 114 syncer::TypeDebugInfoObserver* observer) override;
115 void UnregisterDirectoryTypeDebugInfoObserver( 115 void UnregisterDirectoryTypeDebugInfoObserver(
116 syncer::TypeDebugInfoObserver* observer) override; 116 syncer::TypeDebugInfoObserver* observer) override;
117 bool HasDirectoryTypeDebugInfoObserver( 117 bool HasDirectoryTypeDebugInfoObserver(
118 syncer::TypeDebugInfoObserver* observer) override; 118 syncer::TypeDebugInfoObserver* observer) override;
119 void RequestEmitDebugInfo() override; 119 void RequestEmitDebugInfo() override;
120 void ClearServerData(const ClearServerDataCallback& callback) override; 120 void ClearServerData(const ClearServerDataCallback& callback) override;
121 void OnCookieJarChanged(bool account_mismatch) override; 121 void OnCookieJarChanged(bool account_mismatch) override;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 UserShare share_; 282 UserShare share_;
283 283
284 // This can be called from any thread, but only between calls to 284 // This can be called from any thread, but only between calls to
285 // OpenDirectory() and ShutdownOnSyncThread(). 285 // OpenDirectory() and ShutdownOnSyncThread().
286 WeakHandle<SyncManager::ChangeObserver> change_observer_; 286 WeakHandle<SyncManager::ChangeObserver> change_observer_;
287 287
288 base::ObserverList<SyncManager::Observer> observers_; 288 base::ObserverList<SyncManager::Observer> observers_;
289 289
290 // The ServerConnectionManager used to abstract communication between the 290 // The ServerConnectionManager used to abstract communication between the
291 // client (the Syncer) and the sync server. 291 // client (the Syncer) and the sync server.
292 scoped_ptr<SyncAPIServerConnectionManager> connection_manager_; 292 std::unique_ptr<SyncAPIServerConnectionManager> connection_manager_;
293 293
294 // Maintains state that affects the way we interact with different sync types. 294 // Maintains state that affects the way we interact with different sync types.
295 // This state changes when entering or exiting a configuration cycle. 295 // This state changes when entering or exiting a configuration cycle.
296 scoped_ptr<ModelTypeRegistry> model_type_registry_; 296 std::unique_ptr<ModelTypeRegistry> model_type_registry_;
297 297
298 // Thread-safe wrapper for main interface for non-blocking sync types. 298 // Thread-safe wrapper for main interface for non-blocking sync types.
299 scoped_ptr<syncer_v2::SyncContextProxy> sync_context_proxy_; 299 std::unique_ptr<syncer_v2::SyncContextProxy> sync_context_proxy_;
300 300
301 // A container of various bits of information used by the SyncScheduler to 301 // A container of various bits of information used by the SyncScheduler to
302 // create SyncSessions. Must outlive the SyncScheduler. 302 // create SyncSessions. Must outlive the SyncScheduler.
303 scoped_ptr<sessions::SyncSessionContext> session_context_; 303 std::unique_ptr<sessions::SyncSessionContext> session_context_;
304 304
305 // The scheduler that runs the Syncer. Needs to be explicitly 305 // The scheduler that runs the Syncer. Needs to be explicitly
306 // Start()ed. 306 // Start()ed.
307 scoped_ptr<SyncScheduler> scheduler_; 307 std::unique_ptr<SyncScheduler> scheduler_;
308 308
309 // A multi-purpose status watch object that aggregates stats from various 309 // A multi-purpose status watch object that aggregates stats from various
310 // sync components. 310 // sync components.
311 AllStatus allstatus_; 311 AllStatus allstatus_;
312 312
313 // Each element of this map is a store of change records produced by 313 // Each element of this map is a store of change records produced by
314 // HandleChangeEventFromSyncer during the CALCULATE_CHANGES step. The changes 314 // HandleChangeEventFromSyncer during the CALCULATE_CHANGES step. The changes
315 // are grouped by model type, and are stored here in tree order to be 315 // are grouped by model type, and are stored here in tree order to be
316 // forwarded to the observer slightly later, at the TRANSACTION_ENDING step 316 // forwarded to the observer slightly later, at the TRANSACTION_ENDING step
317 // by HandleTransactionEndingChangeEvent. The list is cleared after observer 317 // by HandleTransactionEndingChangeEvent. The list is cleared after observer
(...skipping 20 matching lines...) Expand all
338 // This is for keeping track of client events to send to the server. 338 // This is for keeping track of client events to send to the server.
339 DebugInfoEventListener debug_info_event_listener_; 339 DebugInfoEventListener debug_info_event_listener_;
340 340
341 ProtocolEventBuffer protocol_event_buffer_; 341 ProtocolEventBuffer protocol_event_buffer_;
342 342
343 base::Closure report_unrecoverable_error_function_; 343 base::Closure report_unrecoverable_error_function_;
344 344
345 // Sync's encryption handler. It tracks the set of encrypted types, manages 345 // Sync's encryption handler. It tracks the set of encrypted types, manages
346 // changing passphrases, and in general handles sync-specific interactions 346 // changing passphrases, and in general handles sync-specific interactions
347 // with the cryptographer. 347 // with the cryptographer.
348 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; 348 std::unique_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_;
349 349
350 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_; 350 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_;
351 351
352 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); 352 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl);
353 }; 353 };
354 354
355 } // namespace syncer 355 } // namespace syncer
356 356
357 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_ 357 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698