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

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

Issue 8366030: Introduce the plumbing necessary to report Unrecoverable error from model safe workers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/engine/model_changing_syncer_command.h" 5 #include "chrome/browser/sync/engine/model_changing_syncer_command.h"
6 6
7 #include "base/callback_old.h" 7 #include "base/callback_old.h"
8 #include "chrome/browser/sync/engine/model_safe_worker.h" 8 #include "chrome/browser/sync/engine/model_safe_worker.h"
9 #include "chrome/browser/sync/sessions/status_controller.h" 9 #include "chrome/browser/sync/sessions/status_controller.h"
10 #include "chrome/browser/sync/sessions/sync_session.h" 10 #include "chrome/browser/sync/sessions/sync_session.h"
11 #include "chrome/browser/sync/sessions/unrecoverable_error_info.h"
11 12
12 namespace browser_sync { 13 namespace browser_sync {
14 using sessions::UnrecoverableErrorInfo;
13 15
14 void ModelChangingSyncerCommand::ExecuteImpl(sessions::SyncSession* session) { 16 void ModelChangingSyncerCommand::ExecuteImpl(sessions::SyncSession* session) {
15 work_session_ = session; 17 work_session_ = session;
16 if (!ModelNeutralExecuteImpl(work_session_)) { 18 if (!ModelNeutralExecuteImpl(work_session_)) {
17 return; 19 return;
18 } 20 }
19 21
20 // Project the list of active types (i.e., types in the routing 22 // Project the list of active types (i.e., types in the routing
21 // info) to a list of groups. 23 // info) to a list of groups.
22 // 24 //
(...skipping 15 matching lines...) Expand all
38 ModelSafeGroup group = worker->GetModelSafeGroup(); 40 ModelSafeGroup group = worker->GetModelSafeGroup();
39 // Skip workers whose group isn't active. 41 // Skip workers whose group isn't active.
40 if (active_groups.find(group) == active_groups.end()) { 42 if (active_groups.find(group) == active_groups.end()) {
41 VLOG(2) << "Skipping worker for group " 43 VLOG(2) << "Skipping worker for group "
42 << ModelSafeGroupToString(group); 44 << ModelSafeGroupToString(group);
43 continue; 45 continue;
44 } 46 }
45 47
46 sessions::StatusController* status = work_session_->status_controller(); 48 sessions::StatusController* status = work_session_->status_controller();
47 sessions::ScopedModelSafeGroupRestriction r(status, group); 49 sessions::ScopedModelSafeGroupRestriction r(status, group);
48 scoped_ptr<Callback0::Type> c(NewCallback(this, 50 scoped_ptr<Callback1<UnrecoverableErrorInfo*>::Type> c(
51 NewCallback(this,
49 &ModelChangingSyncerCommand::StartChangingModel)); 52 &ModelChangingSyncerCommand::StartChangingModel));
50 worker->DoWorkAndWaitUntilDone(c.get()); 53 UnrecoverableErrorInfo error_info =
54 worker->DoWorkAndWaitUntilDone(c.get());
akalin 2011/10/25 03:20:06 Plumb up the error_info all the way up to StartCha
55
56 // TODO(lipalani): Check if there is an unrecoverable error from error_info
57 // and do apropriate actions.
51 } 58 }
52 } 59 }
53 60
54 bool ModelChangingSyncerCommand::ModelNeutralExecuteImpl( 61 bool ModelChangingSyncerCommand::ModelNeutralExecuteImpl(
55 sessions::SyncSession* session) { 62 sessions::SyncSession* session) {
56 return true; 63 return true;
57 } 64 }
58 65
59 } // namespace browser_sync 66 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698