summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/sync/abstract_profile_sync_service_test.cc32
-rw-r--r--chrome/browser/sync/glue/bookmark_change_processor.cc4
-rw-r--r--chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc2
-rw-r--r--chrome/browser/sync/glue/generic_change_processor.cc2
-rw-r--r--chrome/browser/sync/glue/session_model_associator.cc3
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc2
-rw-r--r--chrome/browser/sync/glue/typed_url_change_processor.cc2
-rw-r--r--chrome/browser/sync/profile_sync_service_autofill_unittest.cc35
-rw-r--r--chrome/browser/sync/profile_sync_service_bookmark_unittest.cc3
-rw-r--r--chrome/browser/sync/profile_sync_service_password_unittest.cc2
-rw-r--r--chrome/browser/sync/profile_sync_service_typed_url_unittest.cc2
-rw-r--r--chrome/browser/sync/test_profile_sync_service.cc2
-rw-r--r--sync/engine/build_commit_command.cc8
-rw-r--r--sync/engine/build_commit_command.h8
-rw-r--r--sync/engine/commit.cc5
-rw-r--r--sync/engine/conflict_resolver.cc10
-rw-r--r--sync/engine/conflict_resolver.h4
-rw-r--r--sync/engine/net/server_connection_manager.h8
-rw-r--r--sync/engine/process_commit_response_command.cc20
-rw-r--r--sync/engine/process_commit_response_command.h12
-rw-r--r--sync/engine/process_updates_command.h8
-rw-r--r--sync/engine/syncer.cc14
-rw-r--r--sync/engine/syncer.h4
-rw-r--r--sync/engine/syncer_proto_util.cc8
-rw-r--r--sync/engine/syncer_proto_util.h22
-rw-r--r--sync/engine/syncer_proto_util_unittest.cc3
-rw-r--r--sync/engine/syncer_util.cc5
-rw-r--r--sync/engine/update_applicator.h10
-rw-r--r--sync/engine/verify_updates_command.h4
-rw-r--r--sync/internal_api/base_node.cc3
-rw-r--r--sync/internal_api/change_record.cc1
-rw-r--r--sync/internal_api/debug_info_event_listener.cc4
-rw-r--r--sync/internal_api/debug_info_event_listener.h1
-rw-r--r--sync/internal_api/debug_info_event_listener_unittest.cc5
-rw-r--r--sync/internal_api/http_bridge.cc4
-rw-r--r--sync/internal_api/http_bridge_unittest.cc4
-rw-r--r--sync/internal_api/public/base_node.h10
-rw-r--r--sync/internal_api/public/base_transaction.h4
-rw-r--r--sync/internal_api/public/http_bridge.h4
-rw-r--r--sync/internal_api/public/syncable/model_type.h52
-rw-r--r--sync/internal_api/public/syncable/model_type_payload_map.cc4
-rw-r--r--sync/internal_api/public/syncable/model_type_payload_map.h17
-rw-r--r--sync/internal_api/public/syncable/model_type_payload_map_unittest.cc2
-rw-r--r--sync/internal_api/public/syncable/model_type_test_util.cc2
-rw-r--r--sync/internal_api/public/syncable/model_type_test_util.h2
-rw-r--r--sync/internal_api/public/test/test_entry_factory.h4
-rw-r--r--sync/internal_api/public/user_share.h4
-rw-r--r--sync/internal_api/public/write_node.h17
-rw-r--r--sync/internal_api/public/write_transaction.h10
-rw-r--r--sync/internal_api/sync_manager.cc34
-rw-r--r--sync/internal_api/syncapi_unittest.cc34
-rw-r--r--sync/internal_api/test/test_entry_factory.cc5
-rw-r--r--sync/internal_api/write_node.cc6
-rw-r--r--sync/sessions/ordered_commit_set_unittest.cc9
-rw-r--r--sync/sessions/sync_session.h6
-rw-r--r--sync/sessions/sync_session_context.h8
-rw-r--r--sync/sessions/sync_session_unittest.cc3
-rw-r--r--sync/syncable/base_transaction.cc2
-rw-r--r--sync/syncable/base_transaction.h4
-rw-r--r--sync/syncable/blob.h2
-rw-r--r--sync/syncable/dir_open_result.h2
-rw-r--r--sync/syncable/directory.cc7
-rw-r--r--sync/syncable/directory.h3
-rw-r--r--sync/syncable/directory_backing_store.cc2
-rw-r--r--sync/syncable/directory_backing_store.h2
-rw-r--r--sync/syncable/directory_backing_store_unittest.cc2
-rw-r--r--sync/syncable/directory_change_delegate.h2
-rw-r--r--sync/syncable/entry.cc2
-rw-r--r--sync/syncable/entry.h2
-rw-r--r--sync/syncable/entry_kernel.cc4
-rw-r--r--sync/syncable/entry_kernel.h2
-rw-r--r--sync/syncable/in_memory_directory_backing_store.cc2
-rw-r--r--sync/syncable/in_memory_directory_backing_store.h2
-rw-r--r--sync/syncable/metahandle_set.h4
-rw-r--r--sync/syncable/model_type.cc2
-rw-r--r--sync/syncable/model_type_unittest.cc2
-rw-r--r--sync/syncable/mutable_entry.cc4
-rw-r--r--sync/syncable/mutable_entry.h2
-rw-r--r--sync/syncable/nigori_util.cc2
-rw-r--r--sync/syncable/nigori_util.h8
-rw-r--r--sync/syncable/nigori_util_unittest.cc2
-rw-r--r--sync/syncable/on_disk_directory_backing_store.cc2
-rw-r--r--sync/syncable/on_disk_directory_backing_store.h2
-rw-r--r--sync/syncable/read_transaction.cc4
-rw-r--r--sync/syncable/read_transaction.h3
-rw-r--r--sync/syncable/scoped_index_updater.h2
-rw-r--r--sync/syncable/scoped_kernel_lock.h2
-rw-r--r--sync/syncable/syncable-inl.h2
-rw-r--r--sync/syncable/syncable_changes_version.h2
-rw-r--r--sync/syncable/syncable_columns.h2
-rw-r--r--sync/syncable/syncable_enum_conversions.cc2
-rw-r--r--sync/syncable/syncable_enum_conversions.h2
-rw-r--r--sync/syncable/syncable_enum_conversions_unittest.cc2
-rw-r--r--sync/syncable/syncable_id.cc2
-rw-r--r--sync/syncable/syncable_id.h5
-rw-r--r--sync/syncable/syncable_id_unittest.cc2
-rw-r--r--sync/syncable/syncable_mock.cc6
-rw-r--r--sync/syncable/syncable_mock.h7
-rw-r--r--sync/syncable/syncable_unittest.cc2
-rw-r--r--sync/syncable/syncable_util.cc2
-rw-r--r--sync/syncable/syncable_util.h2
-rw-r--r--sync/syncable/transaction_observer.h2
-rw-r--r--sync/syncable/write_transaction.cc2
-rw-r--r--sync/syncable/write_transaction.h2
-rw-r--r--sync/syncable/write_transaction_info.cc2
-rw-r--r--sync/syncable/write_transaction_info.h2
-rw-r--r--sync/test/engine/mock_connection_manager.cc104
-rw-r--r--sync/test/engine/mock_connection_manager.h4
-rw-r--r--sync/test/engine/syncer_command_test.cc4
-rw-r--r--sync/test/engine/syncer_command_test.h10
-rw-r--r--sync/test/engine/test_directory_setter_upper.cc5
-rw-r--r--sync/test/engine/test_syncable_utils.cc2
-rw-r--r--sync/test/engine/test_syncable_utils.h2
-rw-r--r--sync/test/null_directory_change_delegate.cc2
-rw-r--r--sync/test/null_directory_change_delegate.h2
-rw-r--r--sync/test/null_transaction_observer.cc2
-rw-r--r--sync/test/null_transaction_observer.h2
-rw-r--r--sync/test/test_directory_backing_store.cc2
-rw-r--r--sync/test/test_directory_backing_store.h2
119 files changed, 466 insertions, 313 deletions
diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/chrome/browser/sync/abstract_profile_sync_service_test.cc
index a1eb5df..82b6d5d 100644
--- a/chrome/browser/sync/abstract_profile_sync_service_test.cc
+++ b/chrome/browser/sync/abstract_profile_sync_service_test.cc
@@ -19,20 +19,20 @@
using syncer::TestIdFactory;
using content::BrowserThread;
using syncer::UserShare;
-using syncable::BASE_VERSION;
-using syncable::CREATE;
-using syncable::IS_DEL;
-using syncable::IS_DIR;
-using syncable::IS_UNAPPLIED_UPDATE;
-using syncable::IS_UNSYNCED;
-using syncable::ModelType;
-using syncable::MutableEntry;
-using syncable::SERVER_IS_DIR;
-using syncable::SERVER_VERSION;
-using syncable::SPECIFICS;
-using syncable::UNIQUE_SERVER_TAG;
-using syncable::UNITTEST;
-using syncable::WriteTransaction;
+using syncer::syncable::BASE_VERSION;
+using syncer::syncable::CREATE;
+using syncer::syncable::IS_DEL;
+using syncer::syncable::IS_DIR;
+using syncer::syncable::IS_UNAPPLIED_UPDATE;
+using syncer::syncable::IS_UNSYNCED;
+using syncer::syncable::ModelType;
+using syncer::syncable::MutableEntry;
+using syncer::syncable::SERVER_IS_DIR;
+using syncer::syncable::SERVER_VERSION;
+using syncer::syncable::SPECIFICS;
+using syncer::syncable::UNIQUE_SERVER_TAG;
+using syncer::syncable::UNITTEST;
+using syncer::syncable::WriteTransaction;
/* static */
const std::string ProfileSyncServiceTestHelper::GetTagForType(
@@ -44,7 +44,7 @@ const std::string ProfileSyncServiceTestHelper::GetTagForType(
bool ProfileSyncServiceTestHelper::CreateRoot(ModelType model_type,
UserShare* user_share,
TestIdFactory* ids) {
- syncable::Directory* directory = user_share->directory.get();
+ syncer::syncable::Directory* directory = user_share->directory.get();
std::string tag_name = GetTagForType(model_type);
@@ -61,7 +61,7 @@ bool ProfileSyncServiceTestHelper::CreateRoot(ModelType model_type,
node.Put(SERVER_VERSION, 20);
node.Put(BASE_VERSION, 20);
node.Put(IS_DEL, false);
- node.Put(syncable::ID, ids->MakeServer(tag_name));
+ node.Put(syncer::syncable::ID, ids->MakeServer(tag_name));
sync_pb::EntitySpecifics specifics;
syncable::AddDefaultFieldValue(model_type, &specifics);
node.Put(SPECIFICS, specifics);
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index e459e52..fcce75e 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -224,7 +224,7 @@ void BookmarkChangeProcessor::BookmarkNodeChanged(BookmarkModel* model,
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"Could not InitByIdLookup on BookmarkNodeChanged, good() failed");
LOG(ERROR) << "Bad entry.";
- } else if (sync_node.GetEntry()->Get(syncable::IS_DEL)) {
+ } else if (sync_node.GetEntry()->Get(syncer::syncable::IS_DEL)) {
error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
"Could not InitByIdLookup on BookmarkNodeChanged, is_del true");
LOG(ERROR) << "Deleted entry.";
@@ -232,7 +232,7 @@ void BookmarkChangeProcessor::BookmarkNodeChanged(BookmarkModel* model,
syncer::Cryptographer* crypto = trans.GetCryptographer();
syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes());
const sync_pb::EntitySpecifics& specifics =
- sync_node.GetEntry()->Get(syncable::SPECIFICS);
+ sync_node.GetEntry()->Get(syncer::syncable::SPECIFICS);
CHECK(specifics.has_encrypted());
const bool can_decrypt = crypto->CanDecrypt(specifics.encrypted());
const bool agreement = encrypted_types.Has(syncable::BOOKMARKS);
diff --git a/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc b/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc
index c7c1f25..6159524 100644
--- a/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc
+++ b/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc
@@ -25,7 +25,7 @@ namespace {
using ::testing::NiceMock;
using ::testing::StrictMock;
using content::BrowserThread;
-using syncable::HasModelTypes;
+using syncer::syncable::HasModelTypes;
class MockChromeSyncNotificationBridge : public ChromeSyncNotificationBridge {
public:
diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc
index a12df1c..1bbeb4e 100644
--- a/chrome/browser/sync/glue/generic_change_processor.cc
+++ b/chrome/browser/sync/glue/generic_change_processor.cc
@@ -368,7 +368,7 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges(
syncer::Cryptographer* crypto = trans.GetCryptographer();
syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes());
const sync_pb::EntitySpecifics& specifics =
- sync_node.GetEntry()->Get(syncable::SPECIFICS);
+ sync_node.GetEntry()->Get(syncer::syncable::SPECIFICS);
CHECK(specifics.has_encrypted());
const bool can_decrypt = crypto->CanDecrypt(specifics.encrypted());
const bool agreement = encrypted_types.Has(type);
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index a2cf336..c6e4cbc 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -841,7 +841,8 @@ void SessionModelAssociator::InitializeCurrentMachineTag(
DVLOG(1) << "Restoring persisted session sync guid: "
<< persisted_guid;
} else {
- syncable::Directory* dir = trans->GetWrappedWriteTrans()->directory();
+ syncer::syncable::Directory* dir =
+ trans->GetWrappedWriteTrans()->directory();
current_machine_tag_ = "session_sync";
current_machine_tag_.append(dir->cache_guid());
DVLOG(1) << "Creating session sync guid: " << current_machine_tag_;
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 6c33d3f..01a943a 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -357,7 +357,7 @@ std::string MakeUserAgentForSyncApi() {
syncer::HttpPostProviderFactory* MakeHttpBridgeFactory(
const scoped_refptr<net::URLRequestContextGetter>& getter) {
- return new HttpBridgeFactory(getter, MakeUserAgentForSyncApi());
+ return new syncer::HttpBridgeFactory(getter, MakeUserAgentForSyncApi());
}
} // namespace
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc
index f54829a..c96903f 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -135,7 +135,7 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode(
syncer::Cryptographer* crypto = trans->GetCryptographer();
syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes());
const sync_pb::EntitySpecifics& specifics =
- update_node.GetEntry()->Get(syncable::SPECIFICS);
+ update_node.GetEntry()->Get(syncer::syncable::SPECIFICS);
CHECK(specifics.has_encrypted());
const bool can_decrypt = crypto->CanDecrypt(specifics.encrypted());
const bool agreement = encrypted_types.Has(syncable::TYPED_URLS);
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
index 9e7c67f..cf2e09f 100644
--- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
@@ -68,16 +68,16 @@ using browser_sync::DataTypeController;
using browser_sync::GenericChangeProcessor;
using browser_sync::SharedChangeProcessor;
using content::BrowserThread;
-using syncable::AUTOFILL;
-using syncable::BASE_VERSION;
-using syncable::CREATE;
-using syncable::GET_BY_SERVER_TAG;
-using syncable::MutableEntry;
-using syncable::SERVER_SPECIFICS;
-using syncable::SPECIFICS;
-using syncable::UNITTEST;
-using syncable::WriterTag;
-using syncable::WriteTransaction;
+using syncer::syncable::AUTOFILL;
+using syncer::syncable::BASE_VERSION;
+using syncer::syncable::CREATE;
+using syncer::syncable::GET_BY_SERVER_TAG;
+using syncer::syncable::MutableEntry;
+using syncer::syncable::SERVER_SPECIFICS;
+using syncer::syncable::SPECIFICS;
+using syncer::syncable::UNITTEST;
+using syncer::syncable::WriterTag;
+using syncer::syncable::WriteTransaction;
using syncer::BaseNode;
using testing::_;
using testing::DoAll;
@@ -632,7 +632,7 @@ class WriteTransactionTest: public WriteTransaction {
public:
WriteTransactionTest(const tracked_objects::Location& from_here,
WriterTag writer,
- syncable::Directory* directory,
+ syncer::syncable::Directory* directory,
scoped_ptr<WaitableEvent>* wait_for_syncapi)
: WriteTransaction(from_here, writer, directory),
wait_for_syncapi_(wait_for_syncapi) { }
@@ -668,7 +668,7 @@ class FakeServerUpdater : public base::RefCountedThreadSafe<FakeServerUpdater> {
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
syncer::UserShare* user_share = service_->GetUserShare();
- syncable::Directory* directory = user_share->directory.get();
+ syncer::syncable::Directory* directory = user_share->directory.get();
// Create autofill protobuf.
std::string tag = AutocompleteSyncableService::KeyToTag(
@@ -697,14 +697,15 @@ class FakeServerUpdater : public base::RefCountedThreadSafe<FakeServerUpdater> {
// Simulates effects of UpdateLocalDataFromServerData
MutableEntry parent(&trans, GET_BY_SERVER_TAG,
syncable::ModelTypeToRootTag(syncable::AUTOFILL));
- MutableEntry item(&trans, CREATE, parent.Get(syncable::ID), tag);
+ MutableEntry item(&trans, CREATE, parent.Get(syncer::syncable::ID), tag);
ASSERT_TRUE(item.good());
item.Put(SPECIFICS, entity_specifics);
item.Put(SERVER_SPECIFICS, entity_specifics);
item.Put(BASE_VERSION, 1);
- syncable::Id server_item_id = service_->id_factory()->NewServerId();
- item.Put(syncable::ID, server_item_id);
- syncable::Id new_predecessor;
+ syncer::syncable::Id server_item_id =
+ service_->id_factory()->NewServerId();
+ item.Put(syncer::syncable::ID, server_item_id);
+ syncer::syncable::Id new_predecessor;
ASSERT_TRUE(item.PutPredecessor(new_predecessor));
}
DVLOG(1) << "FakeServerUpdater finishing.";
@@ -743,7 +744,7 @@ class FakeServerUpdater : public base::RefCountedThreadSafe<FakeServerUpdater> {
scoped_ptr<WaitableEvent>* wait_for_start_;
scoped_ptr<WaitableEvent>* wait_for_syncapi_;
WaitableEvent is_finished_;
- syncable::Id parent_id_;
+ syncer::syncable::Id parent_id_;
};
namespace {
diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
index 21ae983..ea47a1c 100644
--- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
@@ -119,7 +119,8 @@ class TestBookmarkModelAssociator : public BookmarkModelAssociator {
// Create new fake tagged nodes at the end of the ordering.
node.InitByCreation(type, root, predecessor);
node.SetIsFolder(true);
- node.GetMutableEntryForTest()->Put(syncable::UNIQUE_SERVER_TAG, tag);
+ node.GetMutableEntryForTest()->Put(
+ syncer::syncable::UNIQUE_SERVER_TAG, tag);
node.SetTitle(UTF8ToWide(tag_str));
node.SetExternalId(0);
*sync_id = node.GetId();
diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc
index b1d0547..f02bb22 100644
--- a/chrome/browser/sync/profile_sync_service_password_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc
@@ -49,7 +49,7 @@ using browser_sync::PasswordChangeProcessor;
using browser_sync::PasswordDataTypeController;
using browser_sync::PasswordModelAssociator;
using content::BrowserThread;
-using syncable::WriteTransaction;
+using syncer::syncable::WriteTransaction;
using testing::_;
using testing::AtLeast;
using testing::DoAll;
diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
index 336a566..06d480a 100644
--- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
@@ -54,7 +54,7 @@ using browser_sync::TypedUrlModelAssociator;
using history::HistoryBackend;
using history::URLID;
using history::URLRow;
-using syncable::WriteTransaction;
+using syncer::syncable::WriteTransaction;
using testing::_;
using testing::DoAll;
using testing::Return;
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc
index 2725140..fa597b4 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/chrome/browser/sync/test_profile_sync_service.cc
@@ -22,7 +22,7 @@ using syncer::sessions::ModelNeutralState;
using syncer::sessions::SyncSessionSnapshot;
using syncer::sessions::SyncSourceInfo;
using syncer::UserShare;
-using syncable::Directory;
+using syncer::syncable::Directory;
namespace browser_sync {
diff --git a/sync/engine/build_commit_command.cc b/sync/engine/build_commit_command.cc
index f3c0a9f..69f94ec 100644
--- a/sync/engine/build_commit_command.cc
+++ b/sync/engine/build_commit_command.cc
@@ -23,6 +23,10 @@
using std::set;
using std::string;
using std::vector;
+
+namespace syncer {
+
+using sessions::SyncSession;
using syncable::Entry;
using syncable::IS_DEL;
using syncable::SERVER_POSITION_IN_PARENT;
@@ -33,10 +37,6 @@ using syncable::MutableEntry;
using syncable::SPECIFICS;
using syncable::UNSPECIFIED;
-namespace syncer {
-
-using sessions::SyncSession;
-
// static
int64 BuildCommitCommand::GetFirstPosition() {
return std::numeric_limits<int64>::min();
diff --git a/sync/engine/build_commit_command.h b/sync/engine/build_commit_command.h
index d72765b..b7dbee0 100644
--- a/sync/engine/build_commit_command.h
+++ b/sync/engine/build_commit_command.h
@@ -13,16 +13,16 @@
#include "sync/engine/syncproto.h"
#include "sync/syncable/entry_kernel.h"
-namespace syncable {
-class Entry;
-}
-
namespace syncer {
namespace sessions {
class OrderedCommitSet;
}
+namespace syncable {
+class Entry;
+}
+
// A class that contains the code used to serialize a set of sync items into a
// protobuf commit message. This conversion process references the
// syncable::Directory, which is why it must be called within the same
diff --git a/sync/engine/commit.cc b/sync/engine/commit.cc
index 734cd6c..02bee1e 100644
--- a/sync/engine/commit.cc
+++ b/sync/engine/commit.cc
@@ -13,13 +13,12 @@
#include "sync/syncable/mutable_entry.h"
#include "sync/syncable/write_transaction.h"
-using syncable::SYNCER;
-using syncable::WriteTransaction;
-
namespace syncer {
using sessions::SyncSession;
using sessions::StatusController;
+using syncable::SYNCER;
+using syncable::WriteTransaction;
namespace {
diff --git a/sync/engine/conflict_resolver.cc b/sync/engine/conflict_resolver.cc
index 54bcb60..c10b21c 100644
--- a/sync/engine/conflict_resolver.cc
+++ b/sync/engine/conflict_resolver.cc
@@ -23,6 +23,11 @@
using std::list;
using std::map;
using std::set;
+
+namespace syncer {
+
+using sessions::ConflictProgress;
+using sessions::StatusController;
using syncable::BaseTransaction;
using syncable::Directory;
using syncable::Entry;
@@ -32,11 +37,6 @@ using syncable::IsRealDataType;
using syncable::MutableEntry;
using syncable::WriteTransaction;
-namespace syncer {
-
-using sessions::ConflictProgress;
-using sessions::StatusController;
-
namespace {
const int SYNC_CYCLES_BEFORE_ADMITTING_DEFEAT = 8;
diff --git a/sync/engine/conflict_resolver.h b/sync/engine/conflict_resolver.h
index 733348c..e0fce1d 100644
--- a/sync/engine/conflict_resolver.h
+++ b/sync/engine/conflict_resolver.h
@@ -17,6 +17,8 @@
#include "base/gtest_prod_util.h"
#include "sync/engine/syncer_types.h"
+namespace syncer {
+
namespace syncable {
class BaseTransaction;
class Id;
@@ -24,8 +26,6 @@ class MutableEntry;
class WriteTransaction;
} // namespace syncable
-namespace syncer {
-
class Cryptographer;
namespace sessions {
diff --git a/sync/engine/net/server_connection_manager.h b/sync/engine/net/server_connection_manager.h
index a94582b..3f7cce2 100644
--- a/sync/engine/net/server_connection_manager.h
+++ b/sync/engine/net/server_connection_manager.h
@@ -18,16 +18,16 @@
#include "base/threading/thread_checker.h"
#include "sync/syncable/syncable_id.h"
-namespace syncable {
-class Directory;
-}
-
namespace sync_pb {
class ClientToServerMessage;
}
namespace syncer {
+namespace syncable {
+class Directory;
+}
+
static const int32 kUnsetResponseCode = -1;
static const int32 kUnsetContentLength = -1;
static const int32 kUnsetPayloadLength = -1;
diff --git a/sync/engine/process_commit_response_command.cc b/sync/engine/process_commit_response_command.cc
index 766a6b3..26be776 100644
--- a/sync/engine/process_commit_response_command.cc
+++ b/sync/engine/process_commit_response_command.cc
@@ -22,14 +22,19 @@
#include "sync/syncable/write_transaction.h"
#include "sync/util/time.h"
-using syncable::WriteTransaction;
-using syncable::MutableEntry;
-using syncable::Entry;
-
using std::set;
using std::string;
using std::vector;
+namespace syncer {
+
+using sessions::OrderedCommitSet;
+using sessions::StatusController;
+using sessions::SyncSession;
+using sessions::ConflictProgress;
+using syncable::WriteTransaction;
+using syncable::MutableEntry;
+using syncable::Entry;
using syncable::BASE_VERSION;
using syncable::GET_BY_ID;
using syncable::ID;
@@ -45,13 +50,6 @@ using syncable::SERVER_VERSION;
using syncable::SYNCER;
using syncable::SYNCING;
-namespace syncer {
-
-using sessions::OrderedCommitSet;
-using sessions::StatusController;
-using sessions::SyncSession;
-using sessions::ConflictProgress;
-
ProcessCommitResponseCommand::ProcessCommitResponseCommand(
const sessions::OrderedCommitSet& commit_set,
const ClientToServerMessage& commit_message,
diff --git a/sync/engine/process_commit_response_command.h b/sync/engine/process_commit_response_command.h
index 80c5753..ef5ab08 100644
--- a/sync/engine/process_commit_response_command.h
+++ b/sync/engine/process_commit_response_command.h
@@ -14,6 +14,12 @@
#include "sync/engine/model_changing_syncer_command.h"
#include "sync/engine/syncproto.h"
+namespace syncer {
+
+namespace sessions {
+class OrderedCommitSet;
+}
+
namespace syncable {
class Id;
class WriteTransaction;
@@ -21,12 +27,6 @@ class MutableEntry;
class Directory;
}
-namespace syncer {
-
-namespace sessions {
-class OrderedCommitSet;
-}
-
// A class that processes the server's response to our commmit attempt. Note
// that some of the preliminary processing is performed in
// PostClientToServerMessage command.
diff --git a/sync/engine/process_updates_command.h b/sync/engine/process_updates_command.h
index 6aeb181..9ec9b31 100644
--- a/sync/engine/process_updates_command.h
+++ b/sync/engine/process_updates_command.h
@@ -10,16 +10,16 @@
#include "sync/engine/model_changing_syncer_command.h"
#include "sync/engine/syncer_types.h"
-namespace syncable {
-class WriteTransaction;
-}
-
namespace sync_pb {
class SyncEntity;
}
namespace syncer {
+namespace syncable {
+class WriteTransaction;
+}
+
class Cryptographer;
// A syncer command for processing updates.
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index 3e8e456..ff28c73 100644
--- a/sync/engine/syncer.cc
+++ b/sync/engine/syncer.cc
@@ -31,6 +31,13 @@
using base::Time;
using base::TimeDelta;
using sync_pb::ClientCommand;
+
+namespace syncer {
+
+using sessions::ScopedSessionContextConflictResolver;
+using sessions::StatusController;
+using sessions::SyncSession;
+using sessions::ConflictProgress;
using syncable::IS_UNAPPLIED_UPDATE;
using syncable::SERVER_CTIME;
using syncable::SERVER_IS_DEL;
@@ -42,13 +49,6 @@ using syncable::SERVER_POSITION_IN_PARENT;
using syncable::SERVER_SPECIFICS;
using syncable::SERVER_VERSION;
-namespace syncer {
-
-using sessions::ScopedSessionContextConflictResolver;
-using sessions::StatusController;
-using sessions::SyncSession;
-using sessions::ConflictProgress;
-
#define ENUM_CASE(x) case x: return #x
const char* SyncerStepToString(const SyncerStep step)
{
diff --git a/sync/engine/syncer.h b/sync/engine/syncer.h
index 8369d80..18f9fd2 100644
--- a/sync/engine/syncer.h
+++ b/sync/engine/syncer.h
@@ -19,13 +19,13 @@
#include "sync/sessions/sync_session.h"
#include "sync/util/extensions_activity_monitor.h"
+namespace syncer {
+
namespace syncable {
class Entry;
class MutableEntry;
} // namespace syncable
-namespace syncer {
-
enum SyncerStep {
SYNCER_BEGIN,
CLEANUP_DISABLED_TYPES,
diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc
index e88bc06..cac0516 100644
--- a/sync/engine/syncer_proto_util.cc
+++ b/sync/engine/syncer_proto_util.cc
@@ -21,9 +21,12 @@
#include "sync/syncable/syncable-inl.h"
#include "sync/util/time.h"
-using syncer::SyncProtocolErrorType;
using std::string;
using std::stringstream;
+
+namespace syncer {
+
+using sessions::SyncSession;
using syncable::BASE_VERSION;
using syncable::CTIME;
using syncable::ID;
@@ -33,9 +36,6 @@ using syncable::IS_UNSYNCED;
using syncable::MTIME;
using syncable::PARENT_ID;
-namespace syncer {
-using sessions::SyncSession;
-
namespace {
// Time to backoff syncing after receiving a throttled response.
diff --git a/sync/engine/syncer_proto_util.h b/sync/engine/syncer_proto_util.h
index 4e9614c..de46091 100644
--- a/sync/engine/syncer_proto_util.h
+++ b/sync/engine/syncer_proto_util.h
@@ -15,29 +15,29 @@
#include "sync/sessions/sync_session.h"
#include "sync/syncable/blob.h"
-namespace syncable {
-class Directory;
-class Entry;
-} // namespace syncable
-
namespace sync_pb {
class ClientToServerResponse;
class EntitySpecifics;
-} // namespace sync_pb
+}
namespace syncer {
-namespace sessions {
-class SyncProtocolError;
-class SyncSessionContext;
-}
-
class ClientToServerMessage;
class ThrottledDataTypeTracker;
class ServerConnectionManager;
class SyncEntity;
class CommitResponse_EntryResponse;
+namespace sessions {
+class SyncProtocolError;
+class SyncSessionContext;
+}
+
+namespace syncable {
+class Directory;
+class Entry;
+}
+
class SyncerProtoUtil {
public:
// Posts the given message and fills the buffer with the returned value.
diff --git a/sync/engine/syncer_proto_util_unittest.cc b/sync/engine/syncer_proto_util_unittest.cc
index 7c496ee..4f31ac0 100644
--- a/sync/engine/syncer_proto_util_unittest.cc
+++ b/sync/engine/syncer_proto_util_unittest.cc
@@ -25,11 +25,12 @@
#include "sync/test/engine/test_directory_setter_upper.h"
#include "testing/gtest/include/gtest/gtest.h"
-using syncable::Blob;
using ::testing::_;
namespace syncer {
+
using sessions::SyncSessionContext;
+using syncable::Blob;
class MockDelegate : public sessions::SyncSession::Delegate {
public:
diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc
index 9232f60..270eafd 100644
--- a/sync/engine/syncer_util.cc
+++ b/sync/engine/syncer_util.cc
@@ -31,6 +31,8 @@
#include "sync/util/cryptographer.h"
#include "sync/util/time.h"
+namespace syncer {
+
using syncable::BASE_VERSION;
using syncable::CHANGES_VERSION;
using syncable::CREATE_NEW_UPDATE_ITEM;
@@ -52,7 +54,6 @@ using syncable::NON_UNIQUE_NAME;
using syncable::BASE_SERVER_SPECIFICS;
using syncable::PARENT_ID;
using syncable::PREV_ID;
-using syncable::ReadTransaction;
using syncable::SERVER_CTIME;
using syncable::SERVER_IS_DEL;
using syncable::SERVER_IS_DIR;
@@ -68,8 +69,6 @@ using syncable::SPECIFICS;
using syncable::SYNCER;
using syncable::WriteTransaction;
-namespace syncer {
-
syncable::Id FindLocalIdToUpdate(
syncable::BaseTransaction* trans,
const SyncEntity& update) {
diff --git a/sync/engine/update_applicator.h b/sync/engine/update_applicator.h
index de05999..ea16fa2 100644
--- a/sync/engine/update_applicator.h
+++ b/sync/engine/update_applicator.h
@@ -19,11 +19,6 @@
#include "sync/internal_api/public/engine/model_safe_worker.h"
#include "sync/syncable/syncable_id.h"
-namespace syncable {
-class WriteTransaction;
-class Entry;
-}
-
namespace syncer {
namespace sessions {
@@ -31,6 +26,11 @@ class ConflictProgress;
class UpdateProgress;
}
+namespace syncable {
+class WriteTransaction;
+class Entry;
+}
+
class ConflictResolver;
class Cryptographer;
diff --git a/sync/engine/verify_updates_command.h b/sync/engine/verify_updates_command.h
index 27b0b41..cc11935 100644
--- a/sync/engine/verify_updates_command.h
+++ b/sync/engine/verify_updates_command.h
@@ -13,12 +13,12 @@
#include "sync/engine/syncproto.h"
#include "sync/internal_api/public/engine/model_safe_worker.h"
+namespace syncer {
+
namespace syncable {
class WriteTransaction;
}
-namespace syncer {
-
// Verifies the response from a GetUpdates request. All invalid updates will be
// noted in the SyncSession after this command is executed.
class VerifyUpdatesCommand : public ModelChangingSyncerCommand {
diff --git a/sync/internal_api/base_node.cc b/sync/internal_api/base_node.cc
index 7563d02..911bc6a 100644
--- a/sync/internal_api/base_node.cc
+++ b/sync/internal_api/base_node.cc
@@ -25,11 +25,12 @@
#include "sync/syncable/syncable_id.h"
#include "sync/util/time.h"
-using syncable::SPECIFICS;
using sync_pb::AutofillProfileSpecifics;
namespace syncer {
+using syncable::SPECIFICS;
+
// Helper function to look up the int64 metahandle of an object given the ID
// string.
static int64 IdToMetahandle(syncable::BaseTransaction* trans,
diff --git a/sync/internal_api/change_record.cc b/sync/internal_api/change_record.cc
index d75b903..b956c9b 100644
--- a/sync/internal_api/change_record.cc
+++ b/sync/internal_api/change_record.cc
@@ -66,4 +66,3 @@ const sync_pb::PasswordSpecificsData&
}
} // namespace syncer
-
diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc
index 27b6a10..99f5411 100644
--- a/sync/internal_api/debug_info_event_listener.cc
+++ b/sync/internal_api/debug_info_event_listener.cc
@@ -4,9 +4,10 @@
#include "sync/internal_api/debug_info_event_listener.h"
-using syncer::sessions::SyncSessionSnapshot;
namespace syncer {
+using syncer::sessions::SyncSessionSnapshot;
+
DebugInfoEventListener::DebugInfoEventListener()
: events_dropped_(false),
cryptographer_has_pending_keys_(false),
@@ -158,4 +159,5 @@ void DebugInfoEventListener::AddEventToQueue(
}
events_.push(event_info);
}
+
} // namespace syncer
diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h
index f671dd2..8fe9847 100644
--- a/sync/internal_api/debug_info_event_listener.h
+++ b/sync/internal_api/debug_info_event_listener.h
@@ -87,4 +87,5 @@ class DebugInfoEventListener : public syncer::SyncManager::Observer,
};
} // namespace syncer
+
#endif // SYNC_INTERNAL_API_DEBUG_INFO_EVENT_LISTENER_H_
diff --git a/sync/internal_api/debug_info_event_listener_unittest.cc b/sync/internal_api/debug_info_event_listener_unittest.cc
index e37c8e2..72f9039 100644
--- a/sync/internal_api/debug_info_event_listener_unittest.cc
+++ b/sync/internal_api/debug_info_event_listener_unittest.cc
@@ -2,13 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
#include "sync/internal_api/debug_info_event_listener.h"
+
#include "testing/gtest/include/gtest/gtest.h"
+namespace syncer {
+
typedef testing::Test DebugInfoEventListenerTest;
-namespace syncer {
TEST_F(DebugInfoEventListenerTest, VerifyEventsAdded) {
syncer::DebugInfoEventListener debug_info_event_listener;
debug_info_event_listener.CreateAndAddEvent(
diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc
index 3822399..5c5073d 100644
--- a/sync/internal_api/http_bridge.cc
+++ b/sync/internal_api/http_bridge.cc
@@ -19,7 +19,7 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_status.h"
-namespace browser_sync {
+namespace syncer {
HttpBridge::RequestContextGetter::RequestContextGetter(
net::URLRequestContextGetter* baseline_context_getter,
@@ -314,4 +314,4 @@ void HttpBridge::OnURLFetchComplete(const net::URLFetcher* source) {
http_post_completed_.Signal();
}
-} // namespace browser_sync
+} // namespace syncer
diff --git a/sync/internal_api/http_bridge_unittest.cc b/sync/internal_api/http_bridge_unittest.cc
index a4a4ceb..bd2e0f8 100644
--- a/sync/internal_api/http_bridge_unittest.cc
+++ b/sync/internal_api/http_bridge_unittest.cc
@@ -12,7 +12,7 @@
#include "sync/internal_api/public/http_bridge.h"
#include "testing/gtest/include/gtest/gtest.h"
-using browser_sync::HttpBridge;
+namespace syncer {
namespace {
// TODO(timsteele): Should use PathService here. See Chromium Issue 3113.
@@ -402,3 +402,5 @@ TEST_F(SyncHttpBridgeTest, AbortAndReleaseBeforeFetchComplete) {
sync_thread.Stop();
io_thread()->Stop();
}
+
+} // namespace syncer
diff --git a/sync/internal_api/public/base_node.h b/sync/internal_api/public/base_node.h
index 4b1924f..666c231 100644
--- a/sync/internal_api/public/base_node.h
+++ b/sync/internal_api/public/base_node.h
@@ -22,11 +22,6 @@ namespace base {
class DictionaryValue;
}
-namespace syncable {
-class BaseTransaction;
-class Entry;
-}
-
namespace sync_pb {
class AppSpecifics;
class AutofillSpecifics;
@@ -46,6 +41,11 @@ namespace syncer {
class BaseTransaction;
+namespace syncable {
+class BaseTransaction;
+class Entry;
+}
+
// A valid BaseNode will never have an ID of zero.
static const int64 kInvalidId = 0;
diff --git a/sync/internal_api/public/base_transaction.h b/sync/internal_api/public/base_transaction.h
index 067239b..09d8a58 100644
--- a/sync/internal_api/public/base_transaction.h
+++ b/sync/internal_api/public/base_transaction.h
@@ -10,13 +10,13 @@
#include "sync/util/cryptographer.h"
+namespace syncer {
+
namespace syncable {
class BaseTransaction;
class Directory;
}
-namespace syncer {
-
// Sync API's BaseTransaction, ReadTransaction, and WriteTransaction allow for
// batching of several read and/or write operations. The read and write
// operations are performed by creating ReadNode and WriteNode instances using
diff --git a/sync/internal_api/public/http_bridge.h b/sync/internal_api/public/http_bridge.h
index 74eaa2c..16d59d8 100644
--- a/sync/internal_api/public/http_bridge.h
+++ b/sync/internal_api/public/http_bridge.h
@@ -29,7 +29,7 @@ class HttpResponseHeaders;
class URLFetcher;
}
-namespace browser_sync {
+namespace syncer {
// A bridge between the syncer and Chromium HTTP layers.
// Provides a way for the sync backend to use Chromium directly for HTTP
@@ -227,6 +227,6 @@ class HttpBridgeFactory : public syncer::HttpPostProviderFactory {
DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory);
};
-} // namespace browser_sync
+} // namespace syncer
#endif // SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_
diff --git a/sync/internal_api/public/syncable/model_type.h b/sync/internal_api/public/syncable/model_type.h
index e134ee6..a63ac65 100644
--- a/sync/internal_api/public/syncable/model_type.h
+++ b/sync/internal_api/public/syncable/model_type.h
@@ -28,6 +28,8 @@ class EntitySpecifics;
class SyncEntity;
}
+namespace syncer {
+
namespace syncable {
enum ModelType {
@@ -172,4 +174,54 @@ bool IsRealDataType(ModelType model_type);
} // namespace syncable
+} // namespace syncer
+
+// TODO(akalin): Move the names below to the 'syncer' namespace once
+// we move this file to public/base.
+namespace syncable {
+
+using syncer::syncable::ModelType;
+using syncer::syncable::ModelTypeSet;
+using syncer::syncable::FullModelTypeSet;
+using syncer::syncable::UNSPECIFIED;
+using syncer::syncable::TOP_LEVEL_FOLDER;
+using syncer::syncable::BOOKMARKS;
+using syncer::syncable::FIRST_REAL_MODEL_TYPE;
+using syncer::syncable::PREFERENCES;
+using syncer::syncable::PASSWORDS;
+using syncer::syncable::AUTOFILL_PROFILE;
+using syncer::syncable::AUTOFILL;
+using syncer::syncable::THEMES;
+using syncer::syncable::TYPED_URLS;
+using syncer::syncable::EXTENSIONS;
+using syncer::syncable::NIGORI;
+using syncer::syncable::SEARCH_ENGINES;
+using syncer::syncable::SESSIONS;
+using syncer::syncable::APPS;
+using syncer::syncable::APP_SETTINGS;
+using syncer::syncable::EXTENSION_SETTINGS;
+using syncer::syncable::APP_NOTIFICATIONS;
+using syncer::syncable::LAST_REAL_MODEL_TYPE;
+using syncer::syncable::MODEL_TYPE_COUNT;
+using syncer::syncable::ModelTypeFromInt;
+using syncer::syncable::AddDefaultFieldValue;
+using syncer::syncable::GetModelType;
+using syncer::syncable::GetModelTypeFromSpecifics;
+using syncer::syncable::ShouldMaintainPosition;
+using syncer::syncable::GetModelTypeFromSpecificsFieldNumber;
+using syncer::syncable::GetSpecificsFieldNumberFromModelType;
+using syncer::syncable::ModelTypeToString;
+using syncer::syncable::ModelTypeToValue;
+using syncer::syncable::ModelTypeFromValue;
+using syncer::syncable::ModelTypeFromString;
+using syncer::syncable::ModelTypeSetToString;
+using syncer::syncable::ModelTypeSetToValue;
+using syncer::syncable::ModelTypeSetFromValue;
+using syncer::syncable::ModelTypeToRootTag;
+using syncer::syncable::RealModelTypeToNotificationType;
+using syncer::syncable::NotificationTypeToRealModelType;
+using syncer::syncable::IsRealDataType;
+
+} // namespace syncable
+
#endif // SYNC_INTERNAL_API_PUBLIC_SYNCABLE_MODEL_TYPE_H_
diff --git a/sync/internal_api/public/syncable/model_type_payload_map.cc b/sync/internal_api/public/syncable/model_type_payload_map.cc
index 97646b7c..4857178 100644
--- a/sync/internal_api/public/syncable/model_type_payload_map.cc
+++ b/sync/internal_api/public/syncable/model_type_payload_map.cc
@@ -11,7 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
-using syncer::ModelSafeRoutingInfo;
+namespace syncer {
namespace syncable {
ModelTypePayloadMap ModelTypePayloadMapFromEnumSet(
@@ -103,3 +103,5 @@ void PurgeStalePayload(ModelTypePayloadMap* original,
}
} // namespace syncable
+} // namespace syncer
+
diff --git a/sync/internal_api/public/syncable/model_type_payload_map.h b/sync/internal_api/public/syncable/model_type_payload_map.h
index 5ea9919..077206b 100644
--- a/sync/internal_api/public/syncable/model_type_payload_map.h
+++ b/sync/internal_api/public/syncable/model_type_payload_map.h
@@ -18,6 +18,7 @@ namespace base {
class DictionaryValue;
}
+namespace syncer {
namespace syncable {
// A container that contains a set of datatypes with possible string
@@ -56,5 +57,21 @@ void PurgeStalePayload(ModelTypePayloadMap* original,
const syncer::ModelSafeRoutingInfo& routing_info);
} // namespace syncable
+} // namespace syncer
+
+// TODO(akalin): Move the names below to the 'syncer' namespace once
+// we move this file to public/base.
+namespace syncable {
+
+using ::syncer::syncable::ModelTypePayloadMap;
+using ::syncer::syncable::ModelTypePayloadMapFromEnumSet;
+using ::syncer::syncable::ModelTypePayloadMapToEnumSet;
+using ::syncer::syncable::ModelTypePayloadMapFromRoutingInfo;
+using ::syncer::syncable::ModelTypePayloadMapToString;
+using ::syncer::syncable::ModelTypePayloadMapToValue;
+using ::syncer::syncable::CoalescePayloads;
+using ::syncer::syncable::PurgeStalePayload;
+
+} // namespace syncable
#endif // SYNC_INTERNAL_PUBLIC_API_SYNCABLE_MODEL_TYPE_PAYLOAD_MAP_H_
diff --git a/sync/internal_api/public/syncable/model_type_payload_map_unittest.cc b/sync/internal_api/public/syncable/model_type_payload_map_unittest.cc
index 4a18b34..dad782b 100644
--- a/sync/internal_api/public/syncable/model_type_payload_map_unittest.cc
+++ b/sync/internal_api/public/syncable/model_type_payload_map_unittest.cc
@@ -12,6 +12,7 @@
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace syncer {
namespace syncable {
namespace {
@@ -44,3 +45,4 @@ TEST_F(ModelTypePayloadMapTest, TypePayloadMapToValue) {
} // namespace
} // namespace syncable
+} // namespace syncer
diff --git a/sync/internal_api/public/syncable/model_type_test_util.cc b/sync/internal_api/public/syncable/model_type_test_util.cc
index 36d1673..0ceaab2 100644
--- a/sync/internal_api/public/syncable/model_type_test_util.cc
+++ b/sync/internal_api/public/syncable/model_type_test_util.cc
@@ -4,6 +4,7 @@
#include "sync/internal_api/public/syncable/model_type_test_util.h"
+namespace syncer {
namespace syncable {
void PrintTo(ModelTypeSet model_types, ::std::ostream* os) {
@@ -50,3 +51,4 @@ class HasModelTypesMatcher
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/internal_api/public/syncable/model_type_test_util.h b/sync/internal_api/public/syncable/model_type_test_util.h
index 173212f..f60e1c0 100644
--- a/sync/internal_api/public/syncable/model_type_test_util.h
+++ b/sync/internal_api/public/syncable/model_type_test_util.h
@@ -11,6 +11,7 @@
#include "sync/internal_api/public/syncable/model_type.h"
#include "testing/gmock/include/gmock/gmock.h"
+namespace syncer {
namespace syncable {
// Defined for googletest. Forwards to ModelTypeSetToString().
@@ -22,5 +23,6 @@ void PrintTo(ModelTypeSet model_types, ::std::ostream* os);
::testing::Matcher<ModelTypeSet> HasModelTypes(ModelTypeSet expected_types);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_INTERNAL_PUBLIC_API_SYNCABLE_MODEL_TYPE_TEST_UTIL_H_
diff --git a/sync/internal_api/public/test/test_entry_factory.h b/sync/internal_api/public/test/test_entry_factory.h
index bb96f2f..6f794d57 100644
--- a/sync/internal_api/public/test/test_entry_factory.h
+++ b/sync/internal_api/public/test/test_entry_factory.h
@@ -11,13 +11,13 @@
#include "sync/internal_api/public/syncable/model_type.h"
#include "sync/protocol/sync.pb.h"
+namespace syncer {
+
namespace syncable {
class Directory;
class Id;
}
-namespace syncer {
-
class TestEntryFactory {
public:
explicit TestEntryFactory(syncable::Directory* dir);
diff --git a/sync/internal_api/public/user_share.h b/sync/internal_api/public/user_share.h
index d7936a4..008755d 100644
--- a/sync/internal_api/public/user_share.h
+++ b/sync/internal_api/public/user_share.h
@@ -10,12 +10,12 @@
#include "base/memory/scoped_ptr.h"
+namespace syncer {
+
namespace syncable {
class Directory;
}
-namespace syncer {
-
// A UserShare encapsulates the syncable pieces that represent an authenticated
// user and their data (share).
// This encompasses all pieces required to build transaction objects on the
diff --git a/sync/internal_api/public/write_node.h b/sync/internal_api/public/write_node.h
index b113187..d97c586 100644
--- a/sync/internal_api/public/write_node.h
+++ b/sync/internal_api/public/write_node.h
@@ -14,16 +14,6 @@
#include "sync/internal_api/public/base_node.h"
#include "sync/internal_api/public/syncable/model_type.h"
-namespace syncer {
-class Cryptographer;
-class TestBookmarkModelAssociator;
-}
-
-namespace syncable {
-class Entry;
-class MutableEntry;
-}
-
namespace sync_pb {
class AppSpecifics;
class AutofillSpecifics;
@@ -40,8 +30,15 @@ class TypedUrlSpecifics;
namespace syncer {
+class Cryptographer;
+class TestBookmarkModelAssociator;
class WriteTransaction;
+namespace syncable {
+class Entry;
+class MutableEntry;
+}
+
// WriteNode extends BaseNode to add mutation, and wraps
// syncable::MutableEntry. A WriteTransaction is needed to create a WriteNode.
class WriteNode : public BaseNode {
diff --git a/sync/internal_api/public/write_transaction.h b/sync/internal_api/public/write_transaction.h
index e72ae71..df27cad 100644
--- a/sync/internal_api/public/write_transaction.h
+++ b/sync/internal_api/public/write_transaction.h
@@ -9,17 +9,17 @@
#include "base/compiler_specific.h"
#include "sync/internal_api/public/base_transaction.h"
-namespace syncable {
-class BaseTransaction;
-class WriteTransaction;
-} // namespace syncable
-
namespace tracked_objects {
class Location;
} // namespace tracked_objects
namespace syncer {
+namespace syncable {
+class BaseTransaction;
+class WriteTransaction;
+} // namespace syncable
+
// Sync API's WriteTransaction is a read/write BaseTransaction. It wraps
// a syncable::WriteTransaction.
//
diff --git a/sync/internal_api/sync_manager.cc b/sync/internal_api/sync_manager.cc
index 9ba62a4..0e5debb 100644
--- a/sync/internal_api/sync_manager.cc
+++ b/sync/internal_api/sync_manager.cc
@@ -62,34 +62,6 @@
#include "sync/util/time.h"
using base::TimeDelta;
-using syncer::AllStatus;
-using syncer::Cryptographer;
-using syncer::Encryptor;
-using syncer::JsArgList;
-using syncer::JsBackend;
-using syncer::JsEventDetails;
-using syncer::JsEventHandler;
-using syncer::JsEventHandler;
-using syncer::JsReplyHandler;
-using syncer::JsMutationEventObserver;
-using syncer::JsSyncManagerObserver;
-using syncer::kNigoriTag;
-using syncer::KeyParams;
-using syncer::ModelSafeRoutingInfo;
-using syncer::ReportUnrecoverableErrorFunction;
-using syncer::ServerConnectionEvent;
-using syncer::ServerConnectionEventListener;
-using syncer::SyncEngineEvent;
-using syncer::SyncEngineEventListener;
-using syncer::SyncScheduler;
-using syncer::Syncer;
-using syncer::UnrecoverableErrorHandler;
-using syncer::WeakHandle;
-using syncer::sessions::SyncSessionContext;
-using syncable::ImmutableWriteTransactionInfo;
-using syncable::ModelType;
-using syncable::ModelTypeSet;
-using syncable::SPECIFICS;
using sync_pb::GetUpdatesCallerInfo;
namespace {
@@ -124,6 +96,12 @@ static const int kNigoriOverwriteLimit = 10;
namespace syncer {
+using sessions::SyncSessionContext;
+using syncable::ImmutableWriteTransactionInfo;
+using syncable::ModelType;
+using syncable::ModelTypeSet;
+using syncable::SPECIFICS;
+
const int SyncManager::kDefaultNudgeDelayMilliseconds = 200;
const int SyncManager::kPreferencesNudgeDelayMilliseconds = 2000;
diff --git a/sync/internal_api/syncapi_unittest.cc b/sync/internal_api/syncapi_unittest.cc
index 64e5570..12429ed6 100644
--- a/sync/internal_api/syncapi_unittest.cc
+++ b/sync/internal_api/syncapi_unittest.cc
@@ -67,31 +67,6 @@
#include "testing/gtest/include/gtest/gtest.h"
using base::ExpectDictStringValue;
-using syncer::Cryptographer;
-using syncer::FakeEncryptor;
-using syncer::FakeExtensionsActivityMonitor;
-using syncer::HasArgsAsList;
-using syncer::HasDetailsAsDictionary;
-using syncer::KeyParams;
-using syncer::kNigoriTag;
-using syncer::JsArgList;
-using syncer::JsBackend;
-using syncer::JsEventHandler;
-using syncer::JsReplyHandler;
-using syncer::MockJsEventHandler;
-using syncer::MockJsReplyHandler;
-using syncer::ModelSafeRoutingInfo;
-using syncer::ModelSafeWorker;
-using syncer::sessions::SyncSessionSnapshot;
-using syncer::TestUnrecoverableErrorHandler;
-using syncer::WeakHandle;
-using syncable::IS_DEL;
-using syncable::IS_UNSYNCED;
-using syncable::kEncryptedString;
-using syncable::ModelTypeSet;
-using syncable::ModelType;
-using syncable::NON_UNIQUE_NAME;
-using syncable::SPECIFICS;
using testing::_;
using testing::AnyNumber;
using testing::AtLeast;
@@ -102,6 +77,15 @@ using testing::StrictMock;
namespace syncer {
+using sessions::SyncSessionSnapshot;
+using syncable::IS_DEL;
+using syncable::IS_UNSYNCED;
+using syncable::kEncryptedString;
+using syncable::ModelTypeSet;
+using syncable::ModelType;
+using syncable::NON_UNIQUE_NAME;
+using syncable::SPECIFICS;
+
namespace {
const char kTestChromeVersion[] = "test chrome version";
diff --git a/sync/internal_api/test/test_entry_factory.cc b/sync/internal_api/test/test_entry_factory.cc
index 6731f72..bccb432 100644
--- a/sync/internal_api/test/test_entry_factory.cc
+++ b/sync/internal_api/test/test_entry_factory.cc
@@ -11,13 +11,14 @@
#include "sync/test/engine/test_id_factory.h"
using std::string;
+
+namespace syncer {
+
using syncable::Id;
using syncable::MutableEntry;
using syncable::UNITTEST;
using syncable::WriteTransaction;
-namespace syncer {
-
TestEntryFactory::TestEntryFactory(syncable::Directory *dir)
: directory_(dir), next_revision_(1) {
}
diff --git a/sync/internal_api/write_node.cc b/sync/internal_api/write_node.cc
index ce8ce2e..5a303c4 100644
--- a/sync/internal_api/write_node.cc
+++ b/sync/internal_api/write_node.cc
@@ -21,14 +21,14 @@
#include "sync/syncable/nigori_util.h"
#include "sync/util/cryptographer.h"
-using syncer::Cryptographer;
using std::string;
using std::vector;
-using syncable::kEncryptedString;
-using syncable::SPECIFICS;
namespace syncer {
+using syncable::kEncryptedString;
+using syncable::SPECIFICS;
+
static const char kDefaultNameForNewNodes[] = " ";
void WriteNode::SetIsFolder(bool folder) {
diff --git a/sync/sessions/ordered_commit_set_unittest.cc b/sync/sessions/ordered_commit_set_unittest.cc
index fcdc891..8bf420a 100644
--- a/sync/sessions/ordered_commit_set_unittest.cc
+++ b/sync/sessions/ordered_commit_set_unittest.cc
@@ -8,6 +8,10 @@
using std::vector;
+namespace syncer {
+namespace sessions {
+namespace {
+
class OrderedCommitSetTest : public testing::Test {
public:
OrderedCommitSetTest() {
@@ -21,9 +25,6 @@ class OrderedCommitSetTest : public testing::Test {
syncer::ModelSafeRoutingInfo routes_;
};
-namespace syncer {
-namespace sessions {
-
TEST_F(OrderedCommitSetTest, Projections) {
vector<syncable::Id> expected;
for (int i = 0; i < 8; i++)
@@ -127,6 +128,6 @@ TEST_F(OrderedCommitSetTest, AddAndRemoveEntries) {
ASSERT_TRUE(commit_set.Empty());
}
+} // namespace
} // namespace sessions
} // namespace syncer
-
diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h
index e847ddb..a402fa6 100644
--- a/sync/sessions/sync_session.h
+++ b/sync/sessions/sync_session.h
@@ -33,13 +33,13 @@
#include "sync/sessions/sync_session_context.h"
#include "sync/util/extensions_activity_monitor.h"
+namespace syncer {
+class ModelSafeWorker;
+
namespace syncable {
class WriteTransaction;
}
-namespace syncer {
-class ModelSafeWorker;
-
namespace sessions {
class SyncSession {
diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h
index ab54042..8edc18f 100644
--- a/sync/sessions/sync_session_context.h
+++ b/sync/sessions/sync_session_context.h
@@ -30,10 +30,6 @@
#include "sync/internal_api/public/engine/model_safe_worker.h"
#include "sync/sessions/debug_info_getter.h"
-namespace syncable {
-class Directory;
-}
-
namespace syncer {
class ConflictResolver;
@@ -41,6 +37,10 @@ class ExtensionsActivityMonitor;
class ServerConnectionManager;
class ThrottledDataTypeTracker;
+namespace syncable {
+class Directory;
+}
+
// Default number of items a client can commit in a single message.
static const int kDefaultMaxCommitBatchSize = 25;
diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc
index fb6c684..1edef4d 100644
--- a/sync/sessions/sync_session_unittest.cc
+++ b/sync/sessions/sync_session_unittest.cc
@@ -21,9 +21,10 @@
#include "sync/test/fake_extensions_activity_monitor.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace syncer {
+
using syncable::WriteTransaction;
-namespace syncer {
namespace sessions {
namespace {
diff --git a/sync/syncable/base_transaction.cc b/sync/syncable/base_transaction.cc
index b27e31a..233da88 100644
--- a/sync/syncable/base_transaction.cc
+++ b/sync/syncable/base_transaction.cc
@@ -7,6 +7,7 @@
#include "base/debug/trace_event.h"
#include "sync/syncable/directory.h"
+namespace syncer {
namespace syncable {
void BaseTransaction::Lock() {
@@ -66,3 +67,4 @@ BaseTransaction::~BaseTransaction() {
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/base_transaction.h b/sync/syncable/base_transaction.h
index 2de4608..cab9e39 100644
--- a/sync/syncable/base_transaction.h
+++ b/sync/syncable/base_transaction.h
@@ -9,6 +9,7 @@
#include "base/location.h"
#include "sync/syncable/syncable_id.h"
+namespace syncer {
namespace syncable {
class Directory;
@@ -76,6 +77,7 @@ class BaseTransaction {
DISALLOW_COPY_AND_ASSIGN(BaseTransaction);
};
-}
+} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_BASE_TRANSACTION_H_
diff --git a/sync/syncable/blob.h b/sync/syncable/blob.h
index 7266763..a944e02 100644
--- a/sync/syncable/blob.h
+++ b/sync/syncable/blob.h
@@ -10,10 +10,12 @@
#include "base/basictypes.h" // For uint8.
+namespace syncer {
namespace syncable {
typedef std::vector<uint8> Blob;
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_BLOB_H_
diff --git a/sync/syncable/dir_open_result.h b/sync/syncable/dir_open_result.h
index 8fe5171..69bb08d 100644
--- a/sync/syncable/dir_open_result.h
+++ b/sync/syncable/dir_open_result.h
@@ -6,6 +6,7 @@
#define SYNC_SYNCABLE_DIR_OPEN_RESULT_H_
#pragma once
+namespace syncer {
namespace syncable {
enum DirOpenResult { NOT_INITIALIZED,
OPENED, // success.
@@ -18,5 +19,6 @@ enum DirOpenResult { NOT_INITIALIZED,
FAILED_IN_UNITTEST, // For tests.
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_DIR_OPEN_RESULT_H_
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index 654519e..7c6391b 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -21,11 +21,9 @@
#include "sync/syncable/syncable_util.h"
#include "sync/syncable/write_transaction.h"
-using syncer::Encryptor;
-using syncer::ReportUnrecoverableErrorFunction;
-using syncer::UnrecoverableErrorHandler;
using std::string;
+namespace syncer {
namespace syncable {
namespace {
@@ -1293,4 +1291,5 @@ ScopedKernelLock::ScopedKernelLock(const Directory* dir)
: scoped_lock_(dir->kernel_->mutex), dir_(const_cast<Directory*>(dir)) {
}
-}
+} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h
index b66a6e5..8bae8f3 100644
--- a/sync/syncable/directory.h
+++ b/sync/syncable/directory.h
@@ -21,9 +21,9 @@
#include "sync/util/cryptographer.h"
namespace syncer {
+
class Encryptor;
class UnrecoverableErrorHandler;
-}
namespace syncable {
@@ -617,5 +617,6 @@ class Directory {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_DIRECTORY_H_
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
index 6813cd7..033ec8f 100644
--- a/sync/syncable/directory_backing_store.cc
+++ b/sync/syncable/directory_backing_store.cc
@@ -29,6 +29,7 @@
using std::string;
+namespace syncer {
namespace syncable {
// This just has to be big enough to hold an UPDATE or INSERT statement that
@@ -1083,3 +1084,4 @@ bool DirectoryBackingStore::CreateShareInfoTableVersion71(
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/directory_backing_store.h b/sync/syncable/directory_backing_store.h
index 2463521..282e56c 100644
--- a/sync/syncable/directory_backing_store.h
+++ b/sync/syncable/directory_backing_store.h
@@ -21,6 +21,7 @@ namespace sync_pb {
class EntitySpecifics;
}
+namespace syncer {
namespace syncable {
struct ColumnSpec;
@@ -163,5 +164,6 @@ class DirectoryBackingStore : public base::NonThreadSafe {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_
diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc
index eb892c5..aefdc43 100644
--- a/sync/syncable/directory_backing_store_unittest.cc
+++ b/sync/syncable/directory_backing_store_unittest.cc
@@ -23,6 +23,7 @@
#include "sync/util/time.h"
#include "testing/gtest/include/gtest/gtest-param-test.h"
+namespace syncer {
namespace syncable {
extern const int32 kCurrentDBVersion;
@@ -2159,3 +2160,4 @@ TEST_F(DirectoryBackingStoreTest, GenerateCacheGUID) {
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/directory_change_delegate.h b/sync/syncable/directory_change_delegate.h
index fdd7294..d99fc3e 100644
--- a/sync/syncable/directory_change_delegate.h
+++ b/sync/syncable/directory_change_delegate.h
@@ -9,6 +9,7 @@
#include "sync/internal_api/public/syncable/model_type.h"
#include "sync/syncable/write_transaction_info.h"
+namespace syncer {
namespace syncable {
// This is an interface for listening to directory change events, triggered by
@@ -41,5 +42,6 @@ class DirectoryChangeDelegate {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_
diff --git a/sync/syncable/entry.cc b/sync/syncable/entry.cc
index bb57564..170924e 100644
--- a/sync/syncable/entry.cc
+++ b/sync/syncable/entry.cc
@@ -14,6 +14,7 @@
using std::string;
+namespace syncer {
namespace syncable {
Entry::Entry(BaseTransaction* trans, GetById, const Id& id)
@@ -141,3 +142,4 @@ std::ostream& operator<<(std::ostream& os, const Entry& entry) {
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/entry.h b/sync/syncable/entry.h
index 374bb36..f0add9f 100644
--- a/sync/syncable/entry.h
+++ b/sync/syncable/entry.h
@@ -10,7 +10,6 @@
namespace syncer {
class ReadNode;
-}
namespace syncable {
@@ -150,5 +149,6 @@ class Entry {
std::ostream& operator<<(std::ostream& os, const Entry& entry);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_ENTRY_H_
diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc
index 99511d9..28b6b0f 100644
--- a/sync/syncable/entry_kernel.cc
+++ b/sync/syncable/entry_kernel.cc
@@ -8,6 +8,7 @@
#include "sync/protocol/proto_value_conversions.h"
#include "sync/syncable/syncable_enum_conversions.h"
+namespace syncer {
namespace syncable {
EntryKernel::EntryKernel() : dirty_(false) {
@@ -148,4 +149,5 @@ DictionaryValue* EntryKernelMutationToValue(
return dict;
}
-}
+} // namespace syncer
+} // namespace syncable
diff --git a/sync/syncable/entry_kernel.h b/sync/syncable/entry_kernel.h
index 9314797..fba1b88 100644
--- a/sync/syncable/entry_kernel.h
+++ b/sync/syncable/entry_kernel.h
@@ -15,6 +15,7 @@
#include "sync/syncable/syncable_id.h"
#include "sync/util/time.h"
+namespace syncer {
namespace syncable {
// Things you need to update if you change any of the fields below:
@@ -319,5 +320,6 @@ base::ListValue* EntryKernelMutationMapToValue(
const EntryKernelMutationMap& mutations);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_
diff --git a/sync/syncable/in_memory_directory_backing_store.cc b/sync/syncable/in_memory_directory_backing_store.cc
index a737ae0..b2797a7 100644
--- a/sync/syncable/in_memory_directory_backing_store.cc
+++ b/sync/syncable/in_memory_directory_backing_store.cc
@@ -4,6 +4,7 @@
#include "sync/syncable/in_memory_directory_backing_store.h"
+namespace syncer {
namespace syncable {
InMemoryDirectoryBackingStore::InMemoryDirectoryBackingStore(
@@ -32,3 +33,4 @@ DirOpenResult InMemoryDirectoryBackingStore::Load(
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/in_memory_directory_backing_store.h b/sync/syncable/in_memory_directory_backing_store.h
index 15f3171..7cb6b9f3 100644
--- a/sync/syncable/in_memory_directory_backing_store.h
+++ b/sync/syncable/in_memory_directory_backing_store.h
@@ -8,6 +8,7 @@
#include "sync/syncable/directory_backing_store.h"
+namespace syncer {
namespace syncable {
// This implementation of DirectoryBackingStore is used in tests that do not
@@ -28,5 +29,6 @@ class InMemoryDirectoryBackingStore : public DirectoryBackingStore {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_IN_MEMORY_DIRECTORY_BACKING_STORE_H_
diff --git a/sync/syncable/metahandle_set.h b/sync/syncable/metahandle_set.h
index 42fd04f..0522825 100644
--- a/sync/syncable/metahandle_set.h
+++ b/sync/syncable/metahandle_set.h
@@ -7,10 +7,12 @@
#include "base/basictypes.h"
+namespace syncer {
namespace syncable {
typedef std::set<int64> MetahandleSet;
-}
+} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_METAHANDLE_SET_
diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc
index 1eb4cc0..35bdc89 100644
--- a/sync/syncable/model_type.cc
+++ b/sync/syncable/model_type.cc
@@ -23,6 +23,7 @@
#include "sync/protocol/theme_specifics.pb.h"
#include "sync/protocol/typed_url_specifics.pb.h"
+namespace syncer {
namespace syncable {
void AddDefaultFieldValue(syncable::ModelType datatype,
@@ -540,3 +541,4 @@ bool IsRealDataType(ModelType model_type) {
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/model_type_unittest.cc b/sync/syncable/model_type_unittest.cc
index c8a53f7..ad9d8aa 100644
--- a/sync/syncable/model_type_unittest.cc
+++ b/sync/syncable/model_type_unittest.cc
@@ -11,6 +11,7 @@
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace syncer {
namespace syncable {
namespace {
@@ -74,3 +75,4 @@ TEST_F(ModelTypeTest, IsRealDataType) {
} // namespace
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc
index 77aa32c..64b5f7f 100644
--- a/sync/syncable/mutable_entry.cc
+++ b/sync/syncable/mutable_entry.cc
@@ -15,6 +15,7 @@
using std::string;
+namespace syncer {
namespace syncable {
MutableEntry::MutableEntry(WriteTransaction* trans, Create,
@@ -407,4 +408,5 @@ bool MutableEntry::Put(BitTemp field, bool value) {
return true;
}
-}
+} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/mutable_entry.h b/sync/syncable/mutable_entry.h
index 331ea19..e3ea4c9 100644
--- a/sync/syncable/mutable_entry.h
+++ b/sync/syncable/mutable_entry.h
@@ -11,7 +11,6 @@
namespace syncer {
class WriteNode;
-}
namespace syncable {
@@ -115,5 +114,6 @@ class MutableEntry : public Entry {
bool MarkForSyncing(syncable::MutableEntry* e);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_MUTABLE_ENTRY_H_
diff --git a/sync/syncable/nigori_util.cc b/sync/syncable/nigori_util.cc
index e80a124..0228a48 100644
--- a/sync/syncable/nigori_util.cc
+++ b/sync/syncable/nigori_util.cc
@@ -16,6 +16,7 @@
#include "sync/syncable/write_transaction.h"
#include "sync/util/cryptographer.h"
+namespace syncer {
namespace syncable {
bool ProcessUnsyncedChangesForEncryption(
@@ -247,3 +248,4 @@ bool UpdateEntryWithEncryption(
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/nigori_util.h b/sync/syncable/nigori_util.h
index 940b135..7425d24 100644
--- a/sync/syncable/nigori_util.h
+++ b/sync/syncable/nigori_util.h
@@ -12,14 +12,13 @@
#include "sync/internal_api/public/syncable/model_type.h"
#include "sync/protocol/nigori_specifics.pb.h"
-namespace syncer {
-class Cryptographer;
-}
-
namespace sync_pb {
class EntitySpecifics;
}
+namespace syncer {
+class Cryptographer;
+
namespace syncable {
const char kEncryptedString[] = "encrypted";
@@ -71,5 +70,6 @@ bool UpdateEntryWithEncryption(
MutableEntry* entry);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_NIGORI_UTIL_H_
diff --git a/sync/syncable/nigori_util_unittest.cc b/sync/syncable/nigori_util_unittest.cc
index 0ca239a..52e39a0 100644
--- a/sync/syncable/nigori_util_unittest.cc
+++ b/sync/syncable/nigori_util_unittest.cc
@@ -8,6 +8,7 @@
#include "sync/util/cryptographer.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace syncer {
namespace syncable {
typedef testing::Test NigoriUtilTest;
@@ -46,3 +47,4 @@ TEST(NigoriUtilTest, SpecificsNeedsEncryption) {
// are tested in apply_updates_command_unittest.cc
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/on_disk_directory_backing_store.cc b/sync/syncable/on_disk_directory_backing_store.cc
index 22ffb77..1f43da6 100644
--- a/sync/syncable/on_disk_directory_backing_store.cc
+++ b/sync/syncable/on_disk_directory_backing_store.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
+namespace syncer {
namespace syncable {
OnDiskDirectoryBackingStore::OnDiskDirectoryBackingStore(
@@ -39,3 +40,4 @@ DirOpenResult OnDiskDirectoryBackingStore::Load(
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/on_disk_directory_backing_store.h b/sync/syncable/on_disk_directory_backing_store.h
index 9c114a5..5576a9b 100644
--- a/sync/syncable/on_disk_directory_backing_store.h
+++ b/sync/syncable/on_disk_directory_backing_store.h
@@ -9,6 +9,7 @@
#include "base/file_path.h"
#include "sync/syncable/directory_backing_store.h"
+namespace syncer {
namespace syncable {
// This is the concrete class that provides a useful implementation of
@@ -26,5 +27,6 @@ class OnDiskDirectoryBackingStore : public DirectoryBackingStore {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_
diff --git a/sync/syncable/read_transaction.cc b/sync/syncable/read_transaction.cc
index a71f1b3..9fb635e 100644
--- a/sync/syncable/read_transaction.cc
+++ b/sync/syncable/read_transaction.cc
@@ -4,6 +4,7 @@
#include "sync/syncable/read_transaction.h"
+namespace syncer {
namespace syncable {
ReadTransaction::ReadTransaction(const tracked_objects::Location& location,
@@ -17,4 +18,5 @@ ReadTransaction::~ReadTransaction() {
Unlock();
}
-} // namespace syncable
+} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/read_transaction.h b/sync/syncable/read_transaction.h
index a6c51f5..c2b6a01 100644
--- a/sync/syncable/read_transaction.h
+++ b/sync/syncable/read_transaction.h
@@ -10,8 +10,6 @@
namespace syncer {
class ReadTransaction;
-}
-
namespace syncable {
// Locks db in constructor, unlocks in destructor.
@@ -30,5 +28,6 @@ class ReadTransaction : public BaseTransaction {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_READ_TRANSACTION_H_
diff --git a/sync/syncable/scoped_index_updater.h b/sync/syncable/scoped_index_updater.h
index f24d0d2..a8cfbd1 100644
--- a/sync/syncable/scoped_index_updater.h
+++ b/sync/syncable/scoped_index_updater.h
@@ -7,6 +7,7 @@
#include "sync/syncable/directory.h"
+namespace syncer {
namespace syncable {
class ScopedKernelLock;
@@ -51,5 +52,6 @@ class ScopedIndexUpdater {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SCOPED_INDEX_UPDATER_H_
diff --git a/sync/syncable/scoped_kernel_lock.h b/sync/syncable/scoped_kernel_lock.h
index aaac150..d37cc92 100644
--- a/sync/syncable/scoped_kernel_lock.h
+++ b/sync/syncable/scoped_kernel_lock.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/synchronization/lock.h"
+namespace syncer {
namespace syncable {
class Directory;
@@ -24,5 +25,6 @@ class ScopedKernelLock {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SCOPED_KERNEL_LOCK_H_
diff --git a/sync/syncable/syncable-inl.h b/sync/syncable/syncable-inl.h
index 5b8046b..49b3bf8 100644
--- a/sync/syncable/syncable-inl.h
+++ b/sync/syncable/syncable-inl.h
@@ -8,6 +8,7 @@
#include "sync/syncable/entry_kernel.h"
+namespace syncer {
namespace syncable {
template <typename FieldType, FieldType field_index>
@@ -20,5 +21,6 @@ class LessField {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SYNCABLE_INL_H_
diff --git a/sync/syncable/syncable_changes_version.h b/sync/syncable/syncable_changes_version.h
index 38aae2c..e42e70f 100644
--- a/sync/syncable/syncable_changes_version.h
+++ b/sync/syncable/syncable_changes_version.h
@@ -6,6 +6,7 @@
#define SYNC_SYNCABLE_SYNCABLE_CHANGES_VERSION_H_
#pragma once
+namespace syncer {
namespace syncable {
// For the most part, the sync engine treats version numbers as opaque values.
@@ -26,5 +27,6 @@ enum {
#define CHANGES_VERSION_STRING "-1"
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SYNCABLE_CHANGES_VERSION_H_
diff --git a/sync/syncable/syncable_columns.h b/sync/syncable/syncable_columns.h
index faf0da7..3ed3e1b 100644
--- a/sync/syncable/syncable_columns.h
+++ b/sync/syncable/syncable_columns.h
@@ -9,6 +9,7 @@
#include "sync/syncable/entry_kernel.h"
#include "sync/syncable/syncable_changes_version.h"
+namespace syncer {
namespace syncable {
struct ColumnSpec {
@@ -70,5 +71,6 @@ static inline const char* ColumnName(int field) {
}
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SYNCABLE_COLUMNS_H_
diff --git a/sync/syncable/syncable_enum_conversions.cc b/sync/syncable/syncable_enum_conversions.cc
index e3131c3..9a8b892 100644
--- a/sync/syncable/syncable_enum_conversions.cc
+++ b/sync/syncable/syncable_enum_conversions.cc
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+namespace syncer {
namespace syncable {
// We can't tokenize expected_min/expected_max since it can be a
@@ -162,3 +163,4 @@ const char* GetBitTempString(BitTemp bit_temp) {
#undef ASSERT_ENUM_BOUNDS
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_enum_conversions.h b/sync/syncable/syncable_enum_conversions.h
index 1c058408..688d0b1 100644
--- a/sync/syncable/syncable_enum_conversions.h
+++ b/sync/syncable/syncable_enum_conversions.h
@@ -13,6 +13,7 @@
// Utility functions to get the string equivalent for some syncable
// enums.
+namespace syncer {
namespace syncable {
// The returned strings (which don't have to be freed) are in ASCII.
@@ -41,5 +42,6 @@ const char* GetProtoFieldString(ProtoField proto_field);
const char* GetBitTempString(BitTemp bit_temp);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SYNCABLE_ENUM_CONVERSIONS_H_
diff --git a/sync/syncable/syncable_enum_conversions_unittest.cc b/sync/syncable/syncable_enum_conversions_unittest.cc
index bba88ea..636d555 100644
--- a/sync/syncable/syncable_enum_conversions_unittest.cc
+++ b/sync/syncable/syncable_enum_conversions_unittest.cc
@@ -10,6 +10,7 @@
#include "testing/gtest/include/gtest/gtest.h"
+namespace syncer {
namespace syncable {
namespace {
@@ -83,3 +84,4 @@ TEST_F(SyncableEnumConversionsTest, GetBitTempString) {
} // namespace
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_id.cc b/sync/syncable/syncable_id.cc
index 92a7411..0187482 100644
--- a/sync/syncable/syncable_id.cc
+++ b/sync/syncable/syncable_id.cc
@@ -11,6 +11,7 @@
using std::ostream;
using std::string;
+namespace syncer {
namespace syncable {
ostream& operator<<(ostream& out, const Id& id) {
@@ -68,3 +69,4 @@ Id GetNullId() {
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_id.h b/sync/syncable/syncable_id.h
index bcc66f5..6c451ad 100644
--- a/sync/syncable/syncable_id.h
+++ b/sync/syncable/syncable_id.h
@@ -23,12 +23,10 @@ namespace sql {
class Statement;
}
+namespace syncer {
namespace syncable {
struct EntryKernel;
class Id;
-}
-
-namespace syncable {
std::ostream& operator<<(std::ostream& out, const Id& id);
@@ -127,5 +125,6 @@ class Id {
Id GetNullId();
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SYNCABLE_ID_H_
diff --git a/sync/syncable/syncable_id_unittest.cc b/sync/syncable/syncable_id_unittest.cc
index fc774525..9ecdbdc 100644
--- a/sync/syncable/syncable_id_unittest.cc
+++ b/sync/syncable/syncable_id_unittest.cc
@@ -14,6 +14,7 @@
using std::vector;
+namespace syncer {
namespace syncable {
using syncer::TestIdFactory;
@@ -94,3 +95,4 @@ TEST(SyncableIdTest, ToValue) {
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_mock.cc b/sync/syncable/syncable_mock.cc
index 950f14e..9a57e15 100644
--- a/sync/syncable/syncable_mock.cc
+++ b/sync/syncable/syncable_mock.cc
@@ -9,6 +9,9 @@
#include "sync/test/null_transaction_observer.h"
+namespace syncer {
+namespace syncable {
+
MockDirectory::MockDirectory(syncer::UnrecoverableErrorHandler* handler)
: Directory(&encryptor_, handler, NULL,
new syncable::InMemoryDirectoryBackingStore("store")) {
@@ -21,3 +24,6 @@ MockSyncableWriteTransaction::MockSyncableWriteTransaction(
const tracked_objects::Location& from_here, Directory *directory)
: WriteTransaction(from_here, syncable::UNITTEST, directory) {
}
+
+} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_mock.h b/sync/syncable/syncable_mock.h
index 82eac1a..c742792 100644
--- a/sync/syncable/syncable_mock.h
+++ b/sync/syncable/syncable_mock.h
@@ -15,8 +15,8 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-using syncable::Directory;
-using syncable::EntryKernel;
+namespace syncer {
+namespace syncable {
class MockDirectory : public Directory {
public:
@@ -43,6 +43,7 @@ class MockSyncableWriteTransaction : public syncable::WriteTransaction {
const tracked_objects::Location& from_here, Directory *directory);
};
+} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SYNCABLE_MOCK_H_
-
diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc
index be22c0b..ec02d80 100644
--- a/sync/syncable/syncable_unittest.cc
+++ b/sync/syncable/syncable_unittest.cc
@@ -42,6 +42,7 @@ using syncer::FakeEncryptor;
using syncer::TestIdFactory;
using syncer::TestUnrecoverableErrorHandler;
+namespace syncer {
namespace syncable {
class SyncableKernelTest : public testing::Test {};
@@ -1937,3 +1938,4 @@ TEST_F(SyncableClientTagTest, TestClientTagIndexDuplicateServer) {
} // namespace
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_util.cc b/sync/syncable/syncable_util.cc
index 046c369..b4829cf 100644
--- a/sync/syncable/syncable_util.cc
+++ b/sync/syncable/syncable_util.cc
@@ -12,6 +12,7 @@
#include "sync/syncable/syncable_id.h"
#include "sync/syncable/write_transaction.h"
+namespace syncer {
namespace syncable {
// Returns the number of unsynced entries.
@@ -112,3 +113,4 @@ bool SyncAssert(bool condition,
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/syncable_util.h b/sync/syncable/syncable_util.h
index ad951fe..425621e 100644
--- a/sync/syncable/syncable_util.h
+++ b/sync/syncable/syncable_util.h
@@ -13,6 +13,7 @@ namespace tracked_objects {
class Location;
}
+namespace syncer {
namespace syncable {
class BaseTransaction;
@@ -35,5 +36,6 @@ int GetUnsyncedEntries(BaseTransaction* trans,
std::vector<int64> *handles);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_SYNCABLE_UTIL_H_
diff --git a/sync/syncable/transaction_observer.h b/sync/syncable/transaction_observer.h
index f5430ba..dc9478d 100644
--- a/sync/syncable/transaction_observer.h
+++ b/sync/syncable/transaction_observer.h
@@ -9,6 +9,7 @@
#include "sync/internal_api/public/syncable/model_type.h"
#include "sync/syncable/write_transaction_info.h"
+namespace syncer {
namespace syncable {
class TransactionObserver {
@@ -21,5 +22,6 @@ class TransactionObserver {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_TRANSACTION_OBSERVER_H_
diff --git a/sync/syncable/write_transaction.cc b/sync/syncable/write_transaction.cc
index 40801a5..09759b6 100644
--- a/sync/syncable/write_transaction.cc
+++ b/sync/syncable/write_transaction.cc
@@ -9,6 +9,7 @@
#include "sync/syncable/transaction_observer.h"
#include "sync/syncable/write_transaction_info.h"
+namespace syncer {
namespace syncable {
WriteTransaction::WriteTransaction(const tracked_objects::Location& location,
@@ -139,3 +140,4 @@ std::string WriterTagToString(WriterTag writer_tag) {
#undef ENUM_CASE
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/write_transaction.h b/sync/syncable/write_transaction.h
index 685e447..0b92d8a 100644
--- a/sync/syncable/write_transaction.h
+++ b/sync/syncable/write_transaction.h
@@ -9,6 +9,7 @@
#include "sync/syncable/base_transaction.h"
#include "sync/syncable/entry_kernel.h"
+namespace syncer {
namespace syncable {
// Locks db in constructor, unlocks in destructor.
@@ -44,5 +45,6 @@ class WriteTransaction : public BaseTransaction {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_WRITE_TRANSACTION_H_
diff --git a/sync/syncable/write_transaction_info.cc b/sync/syncable/write_transaction_info.cc
index 0d6cef2..04bdf3d 100644
--- a/sync/syncable/write_transaction_info.cc
+++ b/sync/syncable/write_transaction_info.cc
@@ -6,6 +6,7 @@
#include "base/string_number_conversions.h"
+namespace syncer {
namespace syncable {
WriteTransactionInfo::WriteTransactionInfo(
@@ -44,3 +45,4 @@ base::DictionaryValue* WriteTransactionInfo::ToValue(
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/syncable/write_transaction_info.h b/sync/syncable/write_transaction_info.h
index e8a2eae..bd5d52d 100644
--- a/sync/syncable/write_transaction_info.h
+++ b/sync/syncable/write_transaction_info.h
@@ -9,6 +9,7 @@
#include "sync/syncable/base_transaction.h"
#include "sync/syncable/entry_kernel.h"
+namespace syncer {
namespace syncable {
// A struct describing the changes made during a transaction.
@@ -36,5 +37,6 @@ typedef
ImmutableWriteTransactionInfo;
} // namespace syncable
+} // namespace syncer
#endif // SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_
diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc
index fdbecd4..77323c4 100644
--- a/sync/test/engine/mock_connection_manager.cc
+++ b/sync/test/engine/mock_connection_manager.cc
@@ -17,22 +17,15 @@
#include "sync/test/engine/test_id_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
-using syncer::HttpResponse;
-using syncer::ServerConnectionManager;
-using syncer::ServerConnectionEventListener;
-using syncer::ServerConnectionEvent;
-using syncer::SyncerProtoUtil;
-using syncer::TestIdFactory;
using std::map;
using std::string;
-using sync_pb::ClientToServerMessage;
-using sync_pb::ClientToServerResponse;
using sync_pb::CommitMessage;
using sync_pb::CommitResponse;
-using sync_pb::CommitResponse_EntryResponse;
using sync_pb::GetUpdatesMessage;
using sync_pb::SyncEnums;
-using sync_pb::SyncEntity;
+
+namespace syncer {
+
using syncable::FIRST_REAL_MODEL_TYPE;
using syncable::MODEL_TYPE_COUNT;
using syncable::ModelType;
@@ -205,11 +198,12 @@ void MockConnectionManager::AddDefaultBookmarkData(sync_pb::SyncEntity* entity,
}
}
-SyncEntity* MockConnectionManager::AddUpdateDirectory(int id,
- int parent_id,
- string name,
- int64 version,
- int64 sync_ts) {
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateDirectory(
+ int id,
+ int parent_id,
+ string name,
+ int64 version,
+ int64 sync_ts) {
return AddUpdateDirectory(TestIdFactory::FromNumber(id),
TestIdFactory::FromNumber(parent_id),
name,
@@ -223,9 +217,10 @@ sync_pb::ClientCommand* MockConnectionManager::GetNextClientCommand() {
return client_command_.get();
}
-SyncEntity* MockConnectionManager::AddUpdateBookmark(int id, int parent_id,
- string name, int64 version,
- int64 sync_ts) {
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateBookmark(
+ int id, int parent_id,
+ string name, int64 version,
+ int64 sync_ts) {
return AddUpdateBookmark(TestIdFactory::FromNumber(id),
TestIdFactory::FromNumber(parent_id),
name,
@@ -233,10 +228,10 @@ SyncEntity* MockConnectionManager::AddUpdateBookmark(int id, int parent_id,
sync_ts);
}
-SyncEntity* MockConnectionManager::AddUpdateSpecifics(
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateSpecifics(
int id, int parent_id, string name, int64 version, int64 sync_ts,
bool is_dir, int64 position, const sync_pb::EntitySpecifics& specifics) {
- SyncEntity* ent = AddUpdateMeta(
+ sync_pb::SyncEntity* ent = AddUpdateMeta(
TestIdFactory::FromNumber(id).GetServerId(),
TestIdFactory::FromNumber(parent_id).GetServerId(),
name, version, sync_ts);
@@ -249,7 +244,7 @@ SyncEntity* MockConnectionManager::AddUpdateSpecifics(
sync_pb::SyncEntity* MockConnectionManager::SetNigori(
int id, int64 version,int64 sync_ts,
const sync_pb::EntitySpecifics& specifics) {
- SyncEntity* ent = GetUpdateResponse()->add_entries();
+ sync_pb::SyncEntity* ent = GetUpdateResponse()->add_entries();
ent->set_id_string(TestIdFactory::FromNumber(id).GetServerId());
ent->set_parent_id_string(TestIdFactory::FromNumber(0).GetServerId());
ent->set_server_defined_unique_tag(syncable::ModelTypeToRootTag(
@@ -266,18 +261,21 @@ sync_pb::SyncEntity* MockConnectionManager::SetNigori(
return ent;
}
-SyncEntity* MockConnectionManager::AddUpdateFull(string id, string parent_id,
- string name, int64 version,
- int64 sync_ts, bool is_dir) {
- SyncEntity* ent = AddUpdateMeta(id, parent_id, name, version, sync_ts);
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateFull(
+ string id, string parent_id,
+ string name, int64 version,
+ int64 sync_ts, bool is_dir) {
+ sync_pb::SyncEntity* ent =
+ AddUpdateMeta(id, parent_id, name, version, sync_ts);
AddDefaultBookmarkData(ent, is_dir);
return ent;
}
-SyncEntity* MockConnectionManager::AddUpdateMeta(string id, string parent_id,
- string name, int64 version,
- int64 sync_ts) {
- SyncEntity* ent = GetUpdateResponse()->add_entries();
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateMeta(
+ string id, string parent_id,
+ string name, int64 version,
+ int64 sync_ts) {
+ sync_pb::SyncEntity* ent = GetUpdateResponse()->add_entries();
ent->set_id_string(id);
ent->set_parent_id_string(parent_id);
ent->set_non_unique_name(name);
@@ -290,22 +288,24 @@ SyncEntity* MockConnectionManager::AddUpdateMeta(string id, string parent_id,
return ent;
}
-SyncEntity* MockConnectionManager::AddUpdateDirectory(string id,
- string parent_id,
- string name,
- int64 version,
- int64 sync_ts) {
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateDirectory(
+ string id,
+ string parent_id,
+ string name,
+ int64 version,
+ int64 sync_ts) {
return AddUpdateFull(id, parent_id, name, version, sync_ts, true);
}
-SyncEntity* MockConnectionManager::AddUpdateBookmark(string id,
- string parent_id,
- string name, int64 version,
- int64 sync_ts) {
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateBookmark(
+ string id,
+ string parent_id,
+ string name, int64 version,
+ int64 sync_ts) {
return AddUpdateFull(id, parent_id, name, version, sync_ts, false);
}
-SyncEntity* MockConnectionManager::AddUpdateFromLastCommit() {
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateFromLastCommit() {
EXPECT_EQ(1, last_sent_commit().entries_size());
EXPECT_EQ(1, last_commit_response().entryresponse_size());
EXPECT_EQ(CommitResponse::SUCCESS,
@@ -315,7 +315,7 @@ SyncEntity* MockConnectionManager::AddUpdateFromLastCommit() {
AddUpdateTombstone(syncable::Id::CreateFromServerId(
last_sent_commit().entries(0).id_string()));
} else {
- SyncEntity* ent = GetUpdateResponse()->add_entries();
+ sync_pb::SyncEntity* ent = GetUpdateResponse()->add_entries();
ent->CopyFrom(last_sent_commit().entries(0));
ent->clear_insert_after_item_id();
ent->clear_old_parent_id();
@@ -334,7 +334,7 @@ SyncEntity* MockConnectionManager::AddUpdateFromLastCommit() {
void MockConnectionManager::AddUpdateTombstone(const syncable::Id& id) {
// Tombstones have only the ID set and dummy values for the required fields.
- SyncEntity* ent = GetUpdateResponse()->add_entries();
+ sync_pb::SyncEntity* ent = GetUpdateResponse()->add_entries();
ent->set_id_string(id.GetServerId());
ent->set_version(0);
ent->set_name("");
@@ -386,8 +386,9 @@ void MockConnectionManager::SetChangesRemaining(int64 timestamp) {
GetUpdateResponse()->set_changes_remaining(timestamp);
}
-void MockConnectionManager::ProcessGetUpdates(ClientToServerMessage* csm,
- ClientToServerResponse* response) {
+void MockConnectionManager::ProcessGetUpdates(
+ sync_pb::ClientToServerMessage* csm,
+ sync_pb::ClientToServerResponse* response) {
CHECK(csm->has_get_updates());
ASSERT_EQ(csm->message_contents(), ClientToServerMessage::GET_UPDATES);
const GetUpdatesMessage& gu = csm->get_updates();
@@ -463,8 +464,9 @@ bool MockConnectionManager::ShouldConflictThisCommit() {
return conflict;
}
-void MockConnectionManager::ProcessCommit(ClientToServerMessage* csm,
- ClientToServerResponse* response_buffer) {
+void MockConnectionManager::ProcessCommit(
+ sync_pb::ClientToServerMessage* csm,
+ sync_pb::ClientToServerResponse* response_buffer) {
CHECK(csm->has_commit());
ASSERT_EQ(csm->message_contents(), ClientToServerMessage::COMMIT);
map <string, string> changed_ids;
@@ -472,7 +474,7 @@ void MockConnectionManager::ProcessCommit(ClientToServerMessage* csm,
CommitResponse* commit_response = response_buffer->mutable_commit();
commit_messages_.push_back(new CommitMessage);
commit_messages_.back()->CopyFrom(commit_message);
- map<string, CommitResponse_EntryResponse*> response_map;
+ map<string, sync_pb::CommitResponse_EntryResponse*> response_map;
for (int i = 0; i < commit_message.entries_size() ; i++) {
const sync_pb::SyncEntity& entry = commit_message.entries(i);
CHECK(entry.has_id_string());
@@ -488,7 +490,7 @@ void MockConnectionManager::ProcessCommit(ClientToServerMessage* csm,
}
if (response_map.end() == response_map.find(id))
response_map[id] = commit_response->add_entryresponse();
- CommitResponse_EntryResponse* er = response_map[id];
+ sync_pb::CommitResponse_EntryResponse* er = response_map[id];
if (ShouldConflictThisCommit()) {
er->set_response_type(CommitResponse::CONFLICT);
continue;
@@ -516,21 +518,21 @@ void MockConnectionManager::ProcessCommit(ClientToServerMessage* csm,
commit_responses_.push_back(new CommitResponse(*commit_response));
}
-SyncEntity* MockConnectionManager::AddUpdateDirectory(
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateDirectory(
syncable::Id id, syncable::Id parent_id, string name, int64 version,
int64 sync_ts) {
return AddUpdateDirectory(id.GetServerId(), parent_id.GetServerId(),
name, version, sync_ts);
}
-SyncEntity* MockConnectionManager::AddUpdateBookmark(
+sync_pb::SyncEntity* MockConnectionManager::AddUpdateBookmark(
syncable::Id id, syncable::Id parent_id, string name, int64 version,
int64 sync_ts) {
return AddUpdateBookmark(id.GetServerId(), parent_id.GetServerId(),
name, version, sync_ts);
}
-SyncEntity* MockConnectionManager::GetMutableLastUpdate() {
+sync_pb::SyncEntity* MockConnectionManager::GetMutableLastUpdate() {
sync_pb::GetUpdatesResponse* updates = GetUpdateResponse();
EXPECT_GT(updates->entries_size(), 0);
return updates->mutable_entries()->Mutable(updates->entries_size() - 1);
@@ -594,3 +596,5 @@ void MockConnectionManager::UpdateConnectionStatus() {
server_status_ = HttpResponse::SERVER_CONNECTION_OK;
}
}
+
+} // namespace syncer
diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
index 1fe264e..c787027 100644
--- a/sync/test/engine/mock_connection_manager.h
+++ b/sync/test/engine/mock_connection_manager.h
@@ -21,6 +21,8 @@
#include "sync/internal_api/public/syncable/model_type_payload_map.h"
#include "sync/protocol/sync.pb.h"
+namespace syncer {
+
class MockConnectionManager : public syncer::ServerConnectionManager {
public:
class MidCommitObserver {
@@ -348,4 +350,6 @@ class MockConnectionManager : public syncer::ServerConnectionManager {
DISALLOW_COPY_AND_ASSIGN(MockConnectionManager);
};
+} // namespace syncer
+
#endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_
diff --git a/sync/test/engine/syncer_command_test.cc b/sync/test/engine/syncer_command_test.cc
index 0d215c2..2439c1b 100644
--- a/sync/test/engine/syncer_command_test.cc
+++ b/sync/test/engine/syncer_command_test.cc
@@ -26,7 +26,7 @@ void SyncerCommandTestBase::SetUp() {
void SyncerCommandTestBase::TearDown() {
}
-Directory* SyncerCommandTest::directory() {
+syncable::Directory* SyncerCommandTest::directory() {
return dir_maker_.directory();
}
@@ -59,7 +59,7 @@ void MockDirectorySyncerCommandTest::SetUp() {
ResetContext();
}
-Directory* MockDirectorySyncerCommandTest::directory() {
+syncable::Directory* MockDirectorySyncerCommandTest::directory() {
return &mock_directory_;
}
diff --git a/sync/test/engine/syncer_command_test.h b/sync/test/engine/syncer_command_test.h
index bcb0846..3db8ae8 100644
--- a/sync/test/engine/syncer_command_test.h
+++ b/sync/test/engine/syncer_command_test.h
@@ -211,7 +211,7 @@ class SyncerCommandTest : public SyncerCommandTestBase {
public:
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
- virtual Directory* directory() OVERRIDE;
+ virtual syncable::Directory* directory() OVERRIDE;
private:
TestDirectorySetterUpper dir_maker_;
@@ -221,16 +221,16 @@ class MockDirectorySyncerCommandTest : public SyncerCommandTestBase {
public:
MockDirectorySyncerCommandTest();
virtual ~MockDirectorySyncerCommandTest();
- virtual Directory* directory() OVERRIDE;
+ virtual syncable::Directory* directory() OVERRIDE;
- MockDirectory* mock_directory() {
- return static_cast<MockDirectory*>(directory());
+ syncable::MockDirectory* mock_directory() {
+ return static_cast<syncable::MockDirectory*>(directory());
}
virtual void SetUp() OVERRIDE;
TestUnrecoverableErrorHandler handler_;
- MockDirectory mock_directory_;
+ syncable::MockDirectory mock_directory_;
};
} // namespace syncer
diff --git a/sync/test/engine/test_directory_setter_upper.cc b/sync/test/engine/test_directory_setter_upper.cc
index 557e950..1a68389 100644
--- a/sync/test/engine/test_directory_setter_upper.cc
+++ b/sync/test/engine/test_directory_setter_upper.cc
@@ -14,11 +14,10 @@
#include "sync/test/null_transaction_observer.h"
#include "testing/gtest/include/gtest/gtest.h"
-using syncable::NullTransactionObserver;
-using syncable::ReadTransaction;
-
namespace syncer {
+using syncable::NullTransactionObserver;
+
TestDirectorySetterUpper::TestDirectorySetterUpper() : name_("Test") {}
TestDirectorySetterUpper::~TestDirectorySetterUpper() {}
diff --git a/sync/test/engine/test_syncable_utils.cc b/sync/test/engine/test_syncable_utils.cc
index c899ad3..3873420 100644
--- a/sync/test/engine/test_syncable_utils.cc
+++ b/sync/test/engine/test_syncable_utils.cc
@@ -12,6 +12,7 @@
using std::string;
+namespace syncer {
namespace syncable {
int CountEntriesWithName(BaseTransaction* rtrans,
@@ -62,3 +63,4 @@ Id GetOnlyEntryWithName(BaseTransaction* rtrans,
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/test/engine/test_syncable_utils.h b/sync/test/engine/test_syncable_utils.h
index c10b5e2..5ab4b0a 100644
--- a/sync/test/engine/test_syncable_utils.h
+++ b/sync/test/engine/test_syncable_utils.h
@@ -11,6 +11,7 @@
#include <string>
+namespace syncer {
namespace syncable {
class BaseTransaction;
@@ -35,5 +36,6 @@ Id GetOnlyEntryWithName(BaseTransaction* rtrans,
const std::string& name);
} // namespace syncable
+} // namespace syncer
#endif // SYNC_TEST_ENGINE_TEST_SYNCABLE_UTILS_H_
diff --git a/sync/test/null_directory_change_delegate.cc b/sync/test/null_directory_change_delegate.cc
index c1918fc..e28fc6a 100644
--- a/sync/test/null_directory_change_delegate.cc
+++ b/sync/test/null_directory_change_delegate.cc
@@ -4,6 +4,7 @@
#include "sync/test/null_directory_change_delegate.h"
+namespace syncer {
namespace syncable {
NullDirectoryChangeDelegate::~NullDirectoryChangeDelegate() {}
@@ -27,3 +28,4 @@ void NullDirectoryChangeDelegate::HandleTransactionCompleteChangeEvent(
ModelTypeSet models_with_changes) {}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/test/null_directory_change_delegate.h b/sync/test/null_directory_change_delegate.h
index 884ae1a..e5b88ff 100644
--- a/sync/test/null_directory_change_delegate.h
+++ b/sync/test/null_directory_change_delegate.h
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "sync/syncable/directory_change_delegate.h"
+namespace syncer {
namespace syncable {
// DirectoryChangeDelegate that does nothing in all delegate methods.
@@ -30,5 +31,6 @@ class NullDirectoryChangeDelegate : public DirectoryChangeDelegate {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_TEST_NULL_DIRECTORY_CHANGE_DELEGATE_H_
diff --git a/sync/test/null_transaction_observer.cc b/sync/test/null_transaction_observer.cc
index 657e2a4..f8313ba 100644
--- a/sync/test/null_transaction_observer.cc
+++ b/sync/test/null_transaction_observer.cc
@@ -6,6 +6,7 @@
#include "base/memory/weak_ptr.h"
+namespace syncer {
namespace syncable {
syncer::WeakHandle<TransactionObserver> NullTransactionObserver() {
@@ -13,3 +14,4 @@ syncer::WeakHandle<TransactionObserver> NullTransactionObserver() {
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/test/null_transaction_observer.h b/sync/test/null_transaction_observer.h
index eca3e7f..ab12f8c 100644
--- a/sync/test/null_transaction_observer.h
+++ b/sync/test/null_transaction_observer.h
@@ -8,6 +8,7 @@
#include "sync/internal_api/public/util/weak_handle.h"
+namespace syncer {
namespace syncable {
class TransactionObserver;
@@ -17,5 +18,6 @@ class TransactionObserver;
syncer::WeakHandle<TransactionObserver> NullTransactionObserver();
} // namespace syncable
+} // namespace syncer
#endif // SYNC_TEST_NULL_TRANSACTION_OBSERVER_H_
diff --git a/sync/test/test_directory_backing_store.cc b/sync/test/test_directory_backing_store.cc
index 8a168a4..271605c 100644
--- a/sync/test/test_directory_backing_store.cc
+++ b/sync/test/test_directory_backing_store.cc
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+namespace syncer {
namespace syncable {
TestDirectoryBackingStore::TestDirectoryBackingStore(
@@ -39,3 +40,4 @@ DirOpenResult TestDirectoryBackingStore::Load(
}
} // namespace syncable
+} // namespace syncer
diff --git a/sync/test/test_directory_backing_store.h b/sync/test/test_directory_backing_store.h
index c78d27e..5ed119b0 100644
--- a/sync/test/test_directory_backing_store.h
+++ b/sync/test/test_directory_backing_store.h
@@ -9,6 +9,7 @@
#include "base/gtest_prod_util.h"
#include "sync/syncable/directory_backing_store.h"
+namespace syncer {
namespace syncable {
// This implementation of DirectoryBackingStore does not manage its own
@@ -49,5 +50,6 @@ class TestDirectoryBackingStore : public DirectoryBackingStore {
};
} // namespace syncable
+} // namespace syncer
#endif // SYNC_TEST_TEST_DIRECTORY_BACKING_STORE_H_