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

Side by Side Diff: sync/engine/model_changing_syncer_command.cc

Issue 14046031: Worker changes to prepare for lock-free shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 "sync/engine/model_changing_syncer_command.h" 5 #include "sync/engine/model_changing_syncer_command.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "sync/sessions/status_controller.h" 10 #include "sync/sessions/status_controller.h"
(...skipping 20 matching lines...) Expand all
31 31
32 sessions::StatusController* status = 32 sessions::StatusController* status =
33 work_session_->mutable_status_controller(); 33 work_session_->mutable_status_controller();
34 sessions::ScopedModelSafeGroupRestriction r(status, group); 34 sessions::ScopedModelSafeGroupRestriction r(status, group);
35 WorkCallback c = base::Bind( 35 WorkCallback c = base::Bind(
36 &ModelChangingSyncerCommand::StartChangingModel, 36 &ModelChangingSyncerCommand::StartChangingModel,
37 // We wait until the callback is executed. So it is safe to use 37 // We wait until the callback is executed. So it is safe to use
38 // unretained. 38 // unretained.
39 base::Unretained(this)); 39 base::Unretained(this));
40 40
41 SyncerError this_worker_result = worker->DoWorkAndWaitUntilDone(c); 41 SyncerError this_worker_result = worker->HandleWork(c);
42 // TODO(rlarocque): Figure out a better way to deal with errors from 42 // TODO(rlarocque): Figure out a better way to deal with errors from
43 // multiple models at once. See also: crbug.com/109422. 43 // multiple models at once. See also: crbug.com/109422.
44 if (this_worker_result != SYNCER_OK) 44 if (this_worker_result != SYNCER_OK)
45 result = this_worker_result; 45 result = this_worker_result;
46 } 46 }
47 47
48 return result; 48 return result;
49 } 49 }
50 50
51 } // namespace syncer 51 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698