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

Side by Side Diff: components/sync_driver/glue/sync_backend_host_core.h

Issue 2084243004: [WIP][tracing] Add memory dump provider for sync Directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 4 years, 5 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 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_driver/glue/sync_backend_host_impl.h" 19 #include "components/sync_driver/glue/sync_backend_host_impl.h"
19 #include "components/sync_driver/system_encryptor.h" 20 #include "components/sync_driver/system_encryptor.h"
20 #include "sync/internal_api/public/base/cancelation_signal.h" 21 #include "sync/internal_api/public/base/cancelation_signal.h"
21 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" 22 #include "sync/internal_api/public/sessions/type_debug_info_observer.h"
22 #include "sync/internal_api/public/shutdown_reason.h" 23 #include "sync/internal_api/public/shutdown_reason.h"
23 #include "sync/internal_api/public/sync_encryption_handler.h" 24 #include "sync/internal_api/public/sync_encryption_handler.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
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( 115 void OnSyncCycleCompleted(
110 const syncer::sessions::SyncSessionSnapshot& snapshot) override; 116 const syncer::sessions::SyncSessionSnapshot& snapshot) override;
111 void OnInitializationComplete( 117 void OnInitializationComplete(
112 const syncer::WeakHandle<syncer::JsBackend>& js_backend, 118 const syncer::WeakHandle<syncer::JsBackend>& js_backend,
113 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& 119 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
114 debug_info_listener, 120 debug_info_listener,
115 bool success, 121 bool success,
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 std::map<syncer::ModelType, int64_t> last_invalidation_versions_; 339 std::map<syncer::ModelType, int64_t> last_invalidation_versions_;
334 340
335 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; 341 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_;
336 342
337 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); 343 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore);
338 }; 344 };
339 345
340 } // namespace browser_sync 346 } // namespace browser_sync
341 347
342 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ 348 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
OLDNEW
« no previous file with comments | « no previous file | components/sync_driver/glue/sync_backend_host_core.cc » ('j') | sync/syncable/directory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698