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 10916174: Implement a bag of chips for sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/engine/syncer_proto_util.h"
10 #include "sync/sessions/status_controller.h" 11 #include "sync/sessions/status_controller.h"
11 #include "sync/sessions/sync_session.h" 12 #include "sync/sessions/sync_session.h"
12 13
13 namespace syncer { 14 namespace syncer {
14 15
15 SyncerError ModelChangingSyncerCommand::ExecuteImpl( 16 SyncerError ModelChangingSyncerCommand::ExecuteImpl(
16 sessions::SyncSession* session) { 17 sessions::SyncSession* session) {
17 work_session_ = session; 18 work_session_ = session;
18 SyncerError result = SYNCER_OK; 19 SyncerError result = SYNCER_OK;
19 20
(...skipping 18 matching lines...) Expand all
38 // unretained. 39 // unretained.
39 base::Unretained(this)); 40 base::Unretained(this));
40 41
41 SyncerError this_worker_result = worker->DoWorkAndWaitUntilDone(c); 42 SyncerError this_worker_result = worker->DoWorkAndWaitUntilDone(c);
42 // TODO(rlarocque): Figure out a better way to deal with errors from 43 // TODO(rlarocque): Figure out a better way to deal with errors from
43 // multiple models at once. See also: crbug.com/109422. 44 // multiple models at once. See also: crbug.com/109422.
44 if (this_worker_result != SYNCER_OK) 45 if (this_worker_result != SYNCER_OK)
45 result = this_worker_result; 46 result = this_worker_result;
46 } 47 }
47 48
49 if (result == SYNCER_OK) {
50 // In case of success, persist an eventul bag of chips.
51 SyncerProtoUtil::PersistBagOfChips(session->context()->directory(),
Nicolas Zea 2012/09/07 18:38:43 we actually want to be able to persist the bag of
qsr 2012/09/10 08:12:37 And I was missing one of the 2. Thanks. On the o
52 session->status_controller().updates_response());
53 }
54
48 return result; 55 return result;
49 } 56 }
50 57
51 } // namespace syncer 58 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698