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

Side by Side Diff: components/sync/driver/glue/sync_backend_host_core.h

Issue 2452713003: [Sync] Implement MemoryDumpProvider. (Closed)
Patch Set: Fix presumit; fix Windows; git cl format Created 4 years, 1 month 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 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 <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "base/trace_event/memory_dump_provider.h"
18 #include "components/invalidation/public/invalidation.h" 19 #include "components/invalidation/public/invalidation.h"
19 #include "components/sync/base/cancelation_signal.h" 20 #include "components/sync/base/cancelation_signal.h"
20 #include "components/sync/base/system_encryptor.h" 21 #include "components/sync/base/system_encryptor.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/engine/cycle/type_debug_info_observer.h" 23 #include "components/sync/engine/cycle/type_debug_info_observer.h"
23 #include "components/sync/engine/shutdown_reason.h" 24 #include "components/sync/engine/shutdown_reason.h"
24 #include "components/sync/engine/sync_encryption_handler.h" 25 #include "components/sync/engine/sync_encryption_handler.h"
25 #include "url/gurl.h" 26 #include "url/gurl.h"
26 27
27 namespace syncer { 28 namespace syncer {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 DoConfigureSyncerTypes(const DoConfigureSyncerTypes& other); 87 DoConfigureSyncerTypes(const DoConfigureSyncerTypes& other);
87 ~DoConfigureSyncerTypes(); 88 ~DoConfigureSyncerTypes();
88 ModelTypeSet to_download; 89 ModelTypeSet to_download;
89 ModelTypeSet to_purge; 90 ModelTypeSet to_purge;
90 ModelTypeSet to_journal; 91 ModelTypeSet to_journal;
91 ModelTypeSet to_unapply; 92 ModelTypeSet to_unapply;
92 }; 93 };
93 94
94 class SyncBackendHostCore 95 class SyncBackendHostCore
95 : public base::RefCountedThreadSafe<SyncBackendHostCore>, 96 : public base::RefCountedThreadSafe<SyncBackendHostCore>,
97 public base::trace_event::MemoryDumpProvider,
96 public SyncEncryptionHandler::Observer, 98 public SyncEncryptionHandler::Observer,
97 public SyncManager::Observer, 99 public SyncManager::Observer,
98 public TypeDebugInfoObserver { 100 public TypeDebugInfoObserver {
99 public: 101 public:
100 SyncBackendHostCore(const std::string& name, 102 SyncBackendHostCore(const std::string& name,
101 const base::FilePath& sync_data_folder_path, 103 const base::FilePath& sync_data_folder_path,
102 bool has_sync_setup_completed, 104 bool has_sync_setup_completed,
103 const base::WeakPtr<SyncBackendHostImpl>& backend); 105 const base::WeakPtr<SyncBackendHostImpl>& backend);
104 106
107 // MemoryDumpProvider implementation.
108 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
109 base::trace_event::ProcessMemoryDump* pmd) override;
110
105 // SyncManager::Observer implementation. The Core just acts like an air 111 // SyncManager::Observer implementation. The Core just acts like an air
106 // traffic controller here, forwarding incoming messages to appropriate 112 // traffic controller here, forwarding incoming messages to appropriate
107 // landing threads. 113 // landing threads.
108 void OnSyncCycleCompleted(const SyncCycleSnapshot& snapshot) override; 114 void OnSyncCycleCompleted(const SyncCycleSnapshot& snapshot) override;
109 void OnInitializationComplete( 115 void OnInitializationComplete(
110 const WeakHandle<JsBackend>& js_backend, 116 const WeakHandle<JsBackend>& js_backend,
111 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener, 117 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener,
112 bool success, 118 bool success,
113 ModelTypeSet restored_types) override; 119 ModelTypeSet restored_types) override;
114 void OnConnectionStatusChange(ConnectionStatus status) override; 120 void OnConnectionStatusChange(ConnectionStatus status) override;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 std::map<ModelType, int64_t> last_invalidation_versions_; 325 std::map<ModelType, int64_t> last_invalidation_versions_;
320 326
321 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; 327 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_;
322 328
323 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); 329 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore);
324 }; 330 };
325 331
326 } // namespace syncer 332 } // namespace syncer
327 333
328 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ 334 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
OLDNEW
« no previous file with comments | « components/sync/base/unique_position.cc ('k') | components/sync/driver/glue/sync_backend_host_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698