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

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

Issue 2452713003: [Sync] Implement MemoryDumpProvider. (Closed)
Patch Set: 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 DoConfigureSyncerTypes(const DoConfigureSyncerTypes& other); 83 DoConfigureSyncerTypes(const DoConfigureSyncerTypes& other);
83 ~DoConfigureSyncerTypes(); 84 ~DoConfigureSyncerTypes();
84 ModelTypeSet to_download; 85 ModelTypeSet to_download;
85 ModelTypeSet to_purge; 86 ModelTypeSet to_purge;
86 ModelTypeSet to_journal; 87 ModelTypeSet to_journal;
87 ModelTypeSet to_unapply; 88 ModelTypeSet to_unapply;
88 }; 89 };
89 90
90 class SyncBackendHostCore 91 class SyncBackendHostCore
91 : public base::RefCountedThreadSafe<SyncBackendHostCore>, 92 : public base::RefCountedThreadSafe<SyncBackendHostCore>,
93 public base::trace_event::MemoryDumpProvider,
92 public SyncEncryptionHandler::Observer, 94 public SyncEncryptionHandler::Observer,
93 public SyncManager::Observer, 95 public SyncManager::Observer,
94 public TypeDebugInfoObserver { 96 public TypeDebugInfoObserver {
95 public: 97 public:
96 SyncBackendHostCore(const std::string& name, 98 SyncBackendHostCore(const std::string& name,
97 const base::FilePath& sync_data_folder_path, 99 const base::FilePath& sync_data_folder_path,
98 bool has_sync_setup_completed, 100 bool has_sync_setup_completed,
99 const base::WeakPtr<SyncBackendHostImpl>& backend); 101 const base::WeakPtr<SyncBackendHostImpl>& backend);
100 102
103 // MemoryDumpProvider implementation.
104 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
105 base::trace_event::ProcessMemoryDump* pmd) override;
106
101 // SyncManager::Observer implementation. The Core just acts like an air 107 // SyncManager::Observer implementation. The Core just acts like an air
102 // traffic controller here, forwarding incoming messages to appropriate 108 // traffic controller here, forwarding incoming messages to appropriate
103 // landing threads. 109 // landing threads.
104 void OnSyncCycleCompleted(const SyncCycleSnapshot& snapshot) override; 110 void OnSyncCycleCompleted(const SyncCycleSnapshot& snapshot) override;
105 void OnInitializationComplete( 111 void OnInitializationComplete(
106 const WeakHandle<JsBackend>& js_backend, 112 const WeakHandle<JsBackend>& js_backend,
107 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener, 113 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener,
108 bool success, 114 bool success,
109 ModelTypeSet restored_types) override; 115 ModelTypeSet restored_types) override;
110 void OnConnectionStatusChange(ConnectionStatus status) override; 116 void OnConnectionStatusChange(ConnectionStatus status) override;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 std::map<ModelType, int64_t> last_invalidation_versions_; 321 std::map<ModelType, int64_t> last_invalidation_versions_;
316 322
317 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; 323 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_;
318 324
319 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); 325 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore);
320 }; 326 };
321 327
322 } // namespace syncer 328 } // namespace syncer
323 329
324 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ 330 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698