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

Unified Diff: sync/engine/model_changing_syncer_command.cc

Issue 72403003: sync: Per-type update application (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix typo Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/model_changing_syncer_command.h ('k') | sync/engine/model_changing_syncer_command_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/model_changing_syncer_command.cc
diff --git a/sync/engine/model_changing_syncer_command.cc b/sync/engine/model_changing_syncer_command.cc
deleted file mode 100644
index a79362645ff7b73ef28c5ba0d75a686d493eb7cb..0000000000000000000000000000000000000000
--- a/sync/engine/model_changing_syncer_command.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/engine/model_changing_syncer_command.h"
-
-#include "base/basictypes.h"
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "sync/sessions/status_controller.h"
-#include "sync/sessions/sync_session.h"
-
-namespace syncer {
-
-SyncerError ModelChangingSyncerCommand::ExecuteImpl(
- sessions::SyncSession* session) {
- work_session_ = session;
- SyncerError result = SYNCER_OK;
-
- const std::set<ModelSafeGroup>& groups_to_change =
- GetGroupsToChange(*work_session_);
- for (size_t i = 0; i < session->context()->workers().size(); ++i) {
- ModelSafeWorker* worker = session->context()->workers()[i].get();
- ModelSafeGroup group = worker->GetModelSafeGroup();
- // Skip workers whose group isn't active.
- if (groups_to_change.count(group) == 0u) {
- DVLOG(2) << "Skipping worker for group "
- << ModelSafeGroupToString(group);
- continue;
- }
-
- sessions::StatusController* status =
- work_session_->mutable_status_controller();
- sessions::ScopedModelSafeGroupRestriction r(status, group);
- WorkCallback c = base::Bind(
- &ModelChangingSyncerCommand::StartChangingModel,
- // We wait until the callback is executed. So it is safe to use
- // unretained.
- base::Unretained(this));
-
- SyncerError this_worker_result = worker->DoWorkAndWaitUntilDone(c);
- // TODO(rlarocque): Figure out a better way to deal with errors from
- // multiple models at once. See also: crbug.com/109422.
- if (this_worker_result != SYNCER_OK)
- result = this_worker_result;
- }
-
- return result;
-}
-
-} // namespace syncer
« no previous file with comments | « sync/engine/model_changing_syncer_command.h ('k') | sync/engine/model_changing_syncer_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698