diff options
| author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 01:41:12 +0000 |
|---|---|---|
| committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 01:41:12 +0000 |
| commit | 05b44a37074316aed12341f9a1296fff2c1afafb (patch) | |
| tree | 7ea390e4ae7c68a3569be39d1281c40a204a4ce5 | |
| parent | a54d402c3bf0a74aff9e4fa04f86b8818c6ebe3a (diff) | |
| download | chromium_src-05b44a37074316aed12341f9a1296fff2c1afafb.zip chromium_src-05b44a37074316aed12341f9a1296fff2c1afafb.tar.gz chromium_src-05b44a37074316aed12341f9a1296fff2c1afafb.tar.bz2 | |
Fix a leak when syncapi is used in test mode, where the session context was being created but not handed over to the syncer thread.
BUG=55031
TEST=unit tests
Review URL: http://codereview.chromium.org/3374002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59031 0039d316-1c4b-4281-b951-d872f2087c98
| -rw-r--r-- | chrome/browser/sync/engine/syncapi.cc | 15 | ||||
| -rw-r--r-- | tools/heapcheck/suppressions.txt | 22 | ||||
| -rw-r--r-- | tools/valgrind/memcheck/suppressions.txt | 23 |
3 files changed, 7 insertions, 53 deletions
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index f6ab657..3efb731 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -1327,15 +1327,14 @@ bool SyncManager::SyncInternal::Init( // Listen to TalkMediator events ourselves talk_mediator_->SetDelegate(this); - LOG(INFO) << "Sync is bringing up SyncSessionContext."; - - // Build a SyncSessionContext and store the worker in it. - SyncSessionContext* context = new SyncSessionContext( - connection_manager_.get(), dir_manager(), model_safe_worker_registrar); - - // The SyncerThread takes ownership of |context|. Test mode does not - // use an actual syncer thread. + // Test mode does not use a syncer context or syncer thread. if (!setup_for_test_mode) { + // Build a SyncSessionContext and store the worker in it. + LOG(INFO) << "Sync is bringing up SyncSessionContext."; + SyncSessionContext* context = new SyncSessionContext( + connection_manager_.get(), dir_manager(), model_safe_worker_registrar); + + // The SyncerThread takes ownership of |context|. syncer_thread_ = new SyncerThread(context); allstatus_.WatchSyncerThread(syncer_thread()); diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt index 375e77e..46b1199 100644 --- a/tools/heapcheck/suppressions.txt +++ b/tools/heapcheck/suppressions.txt @@ -1005,25 +1005,3 @@ fun:RenderViewTest::SimulateElementClick fun:RenderViewTest_PageClickTracker_Test::TestBody } -{ - bug_55031_a - Heapcheck:Leak - fun:SyncSessionContext - fun:sync_api::SyncManager::SyncInternal::Init - fun:sync_api::SyncManager::Init - fun:browser_sync::SyncBackendHost::Core::DoInitialize - fun:browser_sync::SyncBackendHost::Core::DoInitializeForTest - fun:void DispatchToMethod - fun:RunnableMethod::Run -} -{ - bug_55031_b - Heapcheck:Leak - fun:__gnu_cxx::new_allocator::allocate - fun:std::_Vector_base::_M_allocate - fun:std::vector::_M_insert_aux - fun:std::vector::push_back - fun:NotificationRegistrar::Add - fun:browser_sync::::RegistrationTask::Run - fun:MessageLoop::RunTask -} diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt index b0b6a25..68f33f2 100644 --- a/tools/valgrind/memcheck/suppressions.txt +++ b/tools/valgrind/memcheck/suppressions.txt @@ -4289,27 +4289,4 @@ fun:_ZN12RenderWidget18OnHandleInputEventERKN3IPC7MessageE fun:_ZN14RenderViewTest20SimulateElementClickERKSs fun:_ZN36RenderViewTest_PageClickTracker_Test8TestBodyEv -} -{ - bug_55031_a - Memcheck:Leak - fun:_Znw* - fun:_ZN8sync_api11SyncManager12SyncInternal4InitERK8FilePathRKSsibPNS_23HttpPostProviderFactoryEPN12browser_sync24ModelSafeWorkerRegistrarEPKcRKNS_15SyncCredentialsERKN8notifier15NotifierOptionsES6_b - fun:_ZN8sync_api11SyncManager4InitERK8FilePathPKcibPNS_23HttpPostProviderFactoryEPN12browser_sync24ModelSafeWorkerRegistrarES5_RKNS_15SyncCredentialsERKN8notifier15NotifierOptionsERKSsb - fun:_ZN12browser_sync15SyncBackendHost4Core12DoInitializeERKNS1_19DoInitializeOptionsE - fun:_ZN12browser_sync15SyncBackendHost4Core19DoInitializeForTestERKSbIwSt11char_traitsIwESaIwEEPN8sync_api23HttpPostProviderFactoryEb - fun:_Z16DispatchToMethodIN12browser_sync15SyncBackendHost4CoreEMS2_FvRKSbIwSt11char_traitsIwESaIwEEPN8sync_api23HttpPostProviderFactoryEbES6_SB_bEvPT_T0_RK6Tuple3IT1_T2_T3_E - fun:_ZN14RunnableMethodIN12browser_sync15SyncBackendHost4CoreEMS2_FvRKSbIwSt11char_traitsIwESaIwEEPN8sync_api23HttpPostProviderFactoryEbE6Tuple3IS6_SB_bEE3RunEv - fun:_ZN11MessageLoop7RunTaskEP4Task -} -{ - bug_55031_b - Memcheck:Leak - fun:_Znw* - fun:_ZN9__gnu_cxx13new_allocatorIN21NotificationRegistrar6RecordEE8allocateEmPKv - fun:_ZNSt12_Vector_baseIN21NotificationRegistrar6RecordESaIS1_EE11_M_allocateEm - fun:_ZNSt6vectorIN21NotificationRegistrar6RecordESaIS1_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS1_S3_EERKS1_ - fun:_ZNSt6vectorIN21NotificationRegistrar6RecordESaIS1_EE9push_backERKS1_ - fun:_ZN21NotificationRegistrar3AddEP20NotificationObserver16NotificationTypeRK18NotificationSource - fun:_ZN12browser_sync12_GLOBAL__N_116RegistrationTask3RunEv }
\ No newline at end of file |
