| 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_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
| 17 #include "base/trace_event/memory_dump_provider.h" |
| 17 #include "components/invalidation/public/invalidation.h" | 18 #include "components/invalidation/public/invalidation.h" |
| 18 #include "components/sync/base/cancelation_signal.h" | 19 #include "components/sync/base/cancelation_signal.h" |
| 19 #include "components/sync/core/shutdown_reason.h" | 20 #include "components/sync/core/shutdown_reason.h" |
| 20 #include "components/sync/core/sync_encryption_handler.h" | 21 #include "components/sync/core/sync_encryption_handler.h" |
| 21 #include "components/sync/driver/glue/sync_backend_host_impl.h" | 22 #include "components/sync/driver/glue/sync_backend_host_impl.h" |
| 22 #include "components/sync/driver/system_encryptor.h" | 23 #include "components/sync/driver/system_encryptor.h" |
| 23 #include "components/sync/engine/cycle/type_debug_info_observer.h" | 24 #include "components/sync/engine/cycle/type_debug_info_observer.h" |
| 24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 25 | 26 |
| 26 namespace browser_sync { | 27 namespace browser_sync { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 DoConfigureSyncerTypes(const DoConfigureSyncerTypes& other); | 88 DoConfigureSyncerTypes(const DoConfigureSyncerTypes& other); |
| 88 ~DoConfigureSyncerTypes(); | 89 ~DoConfigureSyncerTypes(); |
| 89 syncer::ModelTypeSet to_download; | 90 syncer::ModelTypeSet to_download; |
| 90 syncer::ModelTypeSet to_purge; | 91 syncer::ModelTypeSet to_purge; |
| 91 syncer::ModelTypeSet to_journal; | 92 syncer::ModelTypeSet to_journal; |
| 92 syncer::ModelTypeSet to_unapply; | 93 syncer::ModelTypeSet to_unapply; |
| 93 }; | 94 }; |
| 94 | 95 |
| 95 class SyncBackendHostCore | 96 class SyncBackendHostCore |
| 96 : public base::RefCountedThreadSafe<SyncBackendHostCore>, | 97 : public base::RefCountedThreadSafe<SyncBackendHostCore>, |
| 98 public base::trace_event::MemoryDumpProvider, |
| 97 public syncer::SyncEncryptionHandler::Observer, | 99 public syncer::SyncEncryptionHandler::Observer, |
| 98 public syncer::SyncManager::Observer, | 100 public syncer::SyncManager::Observer, |
| 99 public syncer::TypeDebugInfoObserver { | 101 public syncer::TypeDebugInfoObserver { |
| 100 public: | 102 public: |
| 101 SyncBackendHostCore(const std::string& name, | 103 SyncBackendHostCore(const std::string& name, |
| 102 const base::FilePath& sync_data_folder_path, | 104 const base::FilePath& sync_data_folder_path, |
| 103 bool has_sync_setup_completed, | 105 bool has_sync_setup_completed, |
| 104 const base::WeakPtr<SyncBackendHostImpl>& backend); | 106 const base::WeakPtr<SyncBackendHostImpl>& backend); |
| 105 | 107 |
| 108 // MemoryDumpProvider implementation. |
| 109 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 110 base::trace_event::ProcessMemoryDump* pmd) override; |
| 111 |
| 106 // SyncManager::Observer implementation. The Core just acts like an air | 112 // SyncManager::Observer implementation. The Core just acts like an air |
| 107 // traffic controller here, forwarding incoming messages to appropriate | 113 // traffic controller here, forwarding incoming messages to appropriate |
| 108 // landing threads. | 114 // landing threads. |
| 109 void OnSyncCycleCompleted(const syncer::SyncCycleSnapshot& snapshot) override; | 115 void OnSyncCycleCompleted(const syncer::SyncCycleSnapshot& snapshot) override; |
| 110 void OnInitializationComplete( | 116 void OnInitializationComplete( |
| 111 const syncer::WeakHandle<syncer::JsBackend>& js_backend, | 117 const syncer::WeakHandle<syncer::JsBackend>& js_backend, |
| 112 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 118 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
| 113 debug_info_listener, | 119 debug_info_listener, |
| 114 bool success, | 120 bool success, |
| 115 syncer::ModelTypeSet restored_types) override; | 121 syncer::ModelTypeSet restored_types) override; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 std::map<syncer::ModelType, int64_t> last_invalidation_versions_; | 331 std::map<syncer::ModelType, int64_t> last_invalidation_versions_; |
| 326 | 332 |
| 327 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; | 333 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; |
| 328 | 334 |
| 329 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); | 335 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); |
| 330 }; | 336 }; |
| 331 | 337 |
| 332 } // namespace browser_sync | 338 } // namespace browser_sync |
| 333 | 339 |
| 334 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 340 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
| OLD | NEW |