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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_registrar.cc

Issue 130193002: sync: Consistently refcount ModelSafeWorkers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix standalone sync client Created 6 years, 11 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
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/glue/sync_backend_registrar.h" 5 #include "chrome/browser/sync/glue/sync_backend_registrar.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (!processor) 256 if (!processor)
257 return; 257 return;
258 258
259 // This call just notifies the processor that it can commit; it 259 // This call just notifies the processor that it can commit; it
260 // already buffered any changes it plans to makes so needs no 260 // already buffered any changes it plans to makes so needs no
261 // further information. 261 // further information.
262 processor->CommitChangesFromSyncModel(); 262 processor->CommitChangesFromSyncModel();
263 } 263 }
264 264
265 void SyncBackendRegistrar::GetWorkers( 265 void SyncBackendRegistrar::GetWorkers(
266 std::vector<syncer::ModelSafeWorker*>* out) { 266 std::vector<scoped_refptr<syncer::ModelSafeWorker> >* out) {
267 base::AutoLock lock(lock_); 267 base::AutoLock lock(lock_);
268 out->clear(); 268 out->clear();
269 for (WorkerMap::const_iterator it = workers_.begin(); 269 for (WorkerMap::const_iterator it = workers_.begin();
270 it != workers_.end(); ++it) { 270 it != workers_.end(); ++it) {
271 out->push_back(it->second.get()); 271 out->push_back(it->second.get());
272 } 272 }
273 } 273 }
274 274
275 void SyncBackendRegistrar::GetModelSafeRoutingInfo( 275 void SyncBackendRegistrar::GetModelSafeRoutingInfo(
276 syncer::ModelSafeRoutingInfo* out) { 276 syncer::ModelSafeRoutingInfo* out) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 base::Bind(&SyncBackendRegistrar::OnWorkerUnregistrationDone, 367 base::Bind(&SyncBackendRegistrar::OnWorkerUnregistrationDone,
368 base::Unretained(this))); 368 base::Unretained(this)));
369 } 369 }
370 } 370 }
371 371
372 base::Thread* SyncBackendRegistrar::sync_thread() { 372 base::Thread* SyncBackendRegistrar::sync_thread() {
373 return sync_thread_.get(); 373 return sync_thread_.get();
374 } 374 }
375 375
376 } // namespace browser_sync 376 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_registrar.h ('k') | chrome/browser/sync/glue/sync_backend_registrar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698