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

Side by Side Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 395333004: [SyncFS] Clear sync task runners on shutdown of SyncFileSystemService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/unit_tests.gtest-drmemory.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/sync_file_system/sync_file_system_service.h" 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 base::WeakPtrFactory<RemoteSyncRunner> factory_; 244 base::WeakPtrFactory<RemoteSyncRunner> factory_;
245 DISALLOW_COPY_AND_ASSIGN(RemoteSyncRunner); 245 DISALLOW_COPY_AND_ASSIGN(RemoteSyncRunner);
246 }; 246 };
247 247
248 //----------------------------------------------------------------------------- 248 //-----------------------------------------------------------------------------
249 // SyncFileSystemService 249 // SyncFileSystemService
250 250
251 void SyncFileSystemService::Shutdown() { 251 void SyncFileSystemService::Shutdown() {
252 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 252 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
253 253
254 local_sync_runners_.clear();
255 remote_sync_runners_.clear();
256
254 local_service_->Shutdown(); 257 local_service_->Shutdown();
255 local_service_.reset(); 258 local_service_.reset();
256 259
257 remote_service_.reset(); 260 remote_service_.reset();
258 v2_remote_service_.reset(); 261 v2_remote_service_.reset();
259 262
260 ProfileSyncServiceBase* profile_sync_service = 263 ProfileSyncServiceBase* profile_sync_service =
261 ProfileSyncServiceFactory::GetForProfile(profile_); 264 ProfileSyncServiceFactory::GetForProfile(profile_);
262 if (profile_sync_service) 265 if (profile_sync_service)
263 profile_sync_service->RemoveObserver(this); 266 profile_sync_service->RemoveObserver(this);
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); 752 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get());
750 v2_remote_service_->AddFileStatusObserver(this); 753 v2_remote_service_->AddFileStatusObserver(this);
751 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); 754 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get());
752 v2_remote_service_->SetSyncEnabled(sync_enabled_); 755 v2_remote_service_->SetSyncEnabled(sync_enabled_);
753 remote_sync_runners_.push_back(v2_remote_syncer.release()); 756 remote_sync_runners_.push_back(v2_remote_syncer.release());
754 } 757 }
755 return v2_remote_service_.get(); 758 return v2_remote_service_.get();
756 } 759 }
757 760
758 } // namespace sync_file_system 761 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/unit_tests.gtest-drmemory.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698