summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 01:27:24 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 01:27:24 +0000
commit2ba45d1412dd0bbfea931a497efad37540a8d9df (patch)
tree9246e360987027c8791d0c41f5c0d894af97bf31
parentf0df532fea3f2cae2c7c03bca681542e4b11e3f2 (diff)
downloadchromium_src-2ba45d1412dd0bbfea931a497efad37540a8d9df.zip
chromium_src-2ba45d1412dd0bbfea931a497efad37540a8d9df.tar.gz
chromium_src-2ba45d1412dd0bbfea931a497efad37540a8d9df.tar.bz2
sync: Get rid of "using namespace syncable;"
BUG=82078 TEST=None R=akalin@chromium.org Review URL: http://codereview.chromium.org/7016010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85087 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/engine/get_commit_ids_command.cc11
-rw-r--r--chrome/browser/sync/engine/process_updates_command.cc21
-rw-r--r--chrome/browser/sync/glue/ui_model_worker_unittest.cc1
3 files changed, 16 insertions, 17 deletions
diff --git a/chrome/browser/sync/engine/get_commit_ids_command.cc b/chrome/browser/sync/engine/get_commit_ids_command.cc
index cb5349e..903d0e9 100644
--- a/chrome/browser/sync/engine/get_commit_ids_command.cc
+++ b/chrome/browser/sync/engine/get_commit_ids_command.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -50,23 +50,22 @@ void GetCommitIdsCommand::AddUncommittedParentsAndTheirPredecessors(
syncable::BaseTransaction* trans,
syncable::Id parent_id,
const ModelSafeRoutingInfo& routes) {
- using namespace syncable;
OrderedCommitSet item_dependencies(routes);
// Climb the tree adding entries leaf -> root.
while (!parent_id.ServerKnows()) {
- Entry parent(trans, GET_BY_ID, parent_id);
+ syncable::Entry parent(trans, syncable::GET_BY_ID, parent_id);
CHECK(parent.good()) << "Bad user-only parent in item path.";
- int64 handle = parent.Get(META_HANDLE);
+ int64 handle = parent.Get(syncable::META_HANDLE);
if (ordered_commit_set_->HaveCommitItem(handle) ||
item_dependencies.HaveCommitItem(handle)) {
break;
}
- if (!AddItemThenPredecessors(trans, &parent, IS_UNSYNCED,
+ if (!AddItemThenPredecessors(trans, &parent, syncable::IS_UNSYNCED,
&item_dependencies)) {
break; // Parent was already present in the set.
}
- parent_id = parent.Get(PARENT_ID);
+ parent_id = parent.Get(syncable::PARENT_ID);
}
// Reverse what we added to get the correct order.
diff --git a/chrome/browser/sync/engine/process_updates_command.cc b/chrome/browser/sync/engine/process_updates_command.cc
index d55582e..5cae263 100644
--- a/chrome/browser/sync/engine/process_updates_command.cc
+++ b/chrome/browser/sync/engine/process_updates_command.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -94,11 +94,10 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
const sync_pb::SyncEntity& proto_update) {
const SyncEntity& update = *static_cast<const SyncEntity*>(&proto_update);
- using namespace syncable;
syncable::Id server_id = update.id();
const std::string name = SyncerProtoUtil::NameFromSyncEntity(update);
- WriteTransaction trans(dir, SYNCER, __FILE__, __LINE__);
+ syncable::WriteTransaction trans(dir, syncable::SYNCER, __FILE__, __LINE__);
// Look to see if there's a local item that should recieve this update,
// maybe due to a duplicate client tag or a lost commit response.
@@ -113,7 +112,7 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
// We take a two step approach. First we store the entries data in the
// server fields of a local entry and then move the data to the local fields
- MutableEntry target_entry(&trans, GET_BY_ID, local_id);
+ syncable::MutableEntry target_entry(&trans, syncable::GET_BY_ID, local_id);
// We need to run the Verify checks again; the world could have changed
// since VerifyUpdatesCommand.
@@ -134,23 +133,25 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
// IS_UNAPPLIED_UPDATE to true. If the item is UNSYNCED, it's committable
// from the new state; it may commit before the conflict resolver gets
// a crack at it.
- if (target_entry.Get(IS_UNSYNCED) || target_entry.Get(BASE_VERSION) > 0) {
+ if (target_entry.Get(syncable::IS_UNSYNCED) ||
+ target_entry.Get(syncable::BASE_VERSION) > 0) {
// If either of these conditions are met, then we can expect valid client
// fields for this entry. When BASE_VERSION is positive, consistency is
// enforced on the client fields at update-application time. Otherwise,
// we leave the BASE_VERSION field alone; it'll get updated the first time
// we successfully apply this update.
- target_entry.Put(BASE_VERSION, update.version());
+ target_entry.Put(syncable::BASE_VERSION, update.version());
}
// Force application of this update, no matter what.
- target_entry.Put(IS_UNAPPLIED_UPDATE, true);
+ target_entry.Put(syncable::IS_UNAPPLIED_UPDATE, true);
}
SyncerUtil::UpdateServerFieldsFromUpdate(&target_entry, update, name);
- if (target_entry.Get(SERVER_VERSION) == target_entry.Get(BASE_VERSION) &&
- !target_entry.Get(IS_UNSYNCED) &&
- !target_entry.Get(IS_UNAPPLIED_UPDATE)) {
+ if (target_entry.Get(syncable::SERVER_VERSION) ==
+ target_entry.Get(syncable::BASE_VERSION) &&
+ !target_entry.Get(syncable::IS_UNSYNCED) &&
+ !target_entry.Get(syncable::IS_UNAPPLIED_UPDATE)) {
// If these don't match, it means that we have a different view of the
// truth from other clients. That's a sync bug, though we may be able
// to recover the next time this item commits.
diff --git a/chrome/browser/sync/glue/ui_model_worker_unittest.cc b/chrome/browser/sync/glue/ui_model_worker_unittest.cc
index c44af67..05422c9 100644
--- a/chrome/browser/sync/glue/ui_model_worker_unittest.cc
+++ b/chrome/browser/sync/glue/ui_model_worker_unittest.cc
@@ -13,7 +13,6 @@
#include "testing/gtest/include/gtest/gtest.h"
using browser_sync::UIModelWorker;
-using namespace sync_api;
// Various boilerplate, primarily for the StopWithPendingWork test.