OLD | NEW |
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_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "net/base/network_change_notifier.h" | 11 #include "net/base/network_change_notifier.h" |
12 #include "sync/base/sync_export.h" | 12 #include "sync/base/sync_export.h" |
13 #include "sync/engine/all_status.h" | 13 #include "sync/engine/all_status.h" |
14 #include "sync/engine/net/server_connection_manager.h" | 14 #include "sync/engine/net/server_connection_manager.h" |
15 #include "sync/engine/sync_engine_event_listener.h" | 15 #include "sync/engine/sync_engine_event_listener.h" |
16 #include "sync/engine/traffic_recorder.h" | |
17 #include "sync/internal_api/change_reorder_buffer.h" | 16 #include "sync/internal_api/change_reorder_buffer.h" |
18 #include "sync/internal_api/debug_info_event_listener.h" | 17 #include "sync/internal_api/debug_info_event_listener.h" |
19 #include "sync/internal_api/js_mutation_event_observer.h" | 18 #include "sync/internal_api/js_mutation_event_observer.h" |
20 #include "sync/internal_api/js_sync_encryption_handler_observer.h" | 19 #include "sync/internal_api/js_sync_encryption_handler_observer.h" |
21 #include "sync/internal_api/js_sync_manager_observer.h" | 20 #include "sync/internal_api/js_sync_manager_observer.h" |
22 #include "sync/internal_api/public/sync_manager.h" | 21 #include "sync/internal_api/public/sync_manager.h" |
23 #include "sync/internal_api/public/user_share.h" | 22 #include "sync/internal_api/public/user_share.h" |
24 #include "sync/internal_api/sync_encryption_handler_impl.h" | 23 #include "sync/internal_api/sync_encryption_handler_impl.h" |
25 #include "sync/js/js_backend.h" | 24 #include "sync/js/js_backend.h" |
26 #include "sync/notifier/invalidation_handler.h" | 25 #include "sync/notifier/invalidation_handler.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 265 |
267 // Helper function used only by the constructor. | 266 // Helper function used only by the constructor. |
268 void BindJsMessageHandler( | 267 void BindJsMessageHandler( |
269 const std::string& name, UnboundJsMessageHandler unbound_message_handler); | 268 const std::string& name, UnboundJsMessageHandler unbound_message_handler); |
270 | 269 |
271 // JS message handlers. | 270 // JS message handlers. |
272 JsArgList GetAllNodes(const JsArgList& args); | 271 JsArgList GetAllNodes(const JsArgList& args); |
273 JsArgList GetNodeSummariesById(const JsArgList& args); | 272 JsArgList GetNodeSummariesById(const JsArgList& args); |
274 JsArgList GetNodeDetailsById(const JsArgList& args); | 273 JsArgList GetNodeDetailsById(const JsArgList& args); |
275 JsArgList GetChildNodeIds(const JsArgList& args); | 274 JsArgList GetChildNodeIds(const JsArgList& args); |
276 JsArgList GetClientServerTraffic(const JsArgList& args); | |
277 | 275 |
278 syncable::Directory* directory(); | 276 syncable::Directory* directory(); |
279 | 277 |
280 base::FilePath database_path_; | 278 base::FilePath database_path_; |
281 | 279 |
282 const std::string name_; | 280 const std::string name_; |
283 | 281 |
284 base::ThreadChecker thread_checker_; | 282 base::ThreadChecker thread_checker_; |
285 | 283 |
286 // Thread-safe handle used by | 284 // Thread-safe handle used by |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 349 |
352 // These are for interacting with chrome://sync-internals. | 350 // These are for interacting with chrome://sync-internals. |
353 JsMessageHandlerMap js_message_handlers_; | 351 JsMessageHandlerMap js_message_handlers_; |
354 JsSyncManagerObserver js_sync_manager_observer_; | 352 JsSyncManagerObserver js_sync_manager_observer_; |
355 JsMutationEventObserver js_mutation_event_observer_; | 353 JsMutationEventObserver js_mutation_event_observer_; |
356 JsSyncEncryptionHandlerObserver js_sync_encryption_handler_observer_; | 354 JsSyncEncryptionHandlerObserver js_sync_encryption_handler_observer_; |
357 | 355 |
358 // This is for keeping track of client events to send to the server. | 356 // This is for keeping track of client events to send to the server. |
359 DebugInfoEventListener debug_info_event_listener_; | 357 DebugInfoEventListener debug_info_event_listener_; |
360 | 358 |
361 TrafficRecorder traffic_recorder_; | |
362 | |
363 Encryptor* encryptor_; | 359 Encryptor* encryptor_; |
364 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler_; | 360 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler_; |
365 ReportUnrecoverableErrorFunction report_unrecoverable_error_function_; | 361 ReportUnrecoverableErrorFunction report_unrecoverable_error_function_; |
366 | 362 |
367 // Sync's encryption handler. It tracks the set of encrypted types, manages | 363 // Sync's encryption handler. It tracks the set of encrypted types, manages |
368 // changing passphrases, and in general handles sync-specific interactions | 364 // changing passphrases, and in general handles sync-specific interactions |
369 // with the cryptographer. | 365 // with the cryptographer. |
370 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; | 366 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; |
371 | 367 |
372 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_; | 368 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_; |
373 | 369 |
374 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); | 370 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); |
375 }; | 371 }; |
376 | 372 |
377 } // namespace syncer | 373 } // namespace syncer |
378 | 374 |
379 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 375 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
OLD | NEW |