diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-21 20:48:36 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-21 20:48:36 +0000 |
commit | d78354a5e74c5208dd9ebe83717b22223c1e1272 (patch) | |
tree | 4c616bbbfbf1776055d250644e1a47d435b11c8a | |
parent | 41fed979ae412d2475a2860ea1ec95531bebb5af (diff) | |
download | chromium_src-d78354a5e74c5208dd9ebe83717b22223c1e1272.zip chromium_src-d78354a5e74c5208dd9ebe83717b22223c1e1272.tar.gz chromium_src-d78354a5e74c5208dd9ebe83717b22223c1e1272.tar.bz2 |
[Sync] Rename browser_sync to csync in sync/
Update all references from chrome.
Leave possibly-extraneous csync:: qualifications in sync/ for now.
(This will be cleaned up once everything in sync/ is in csync::.)
BUG=128060
TEST=
TBR=jhawkins@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10600002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143449 0039d316-1c4b-4281-b951-d872f2087c98
319 files changed, 1179 insertions, 1158 deletions
diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/chrome/browser/sync/abstract_profile_sync_service_test.cc index e1f91f4..8d42d08 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.cc +++ b/chrome/browser/sync/abstract_profile_sync_service_test.cc @@ -16,7 +16,7 @@ #include "sync/test/engine/test_id_factory.h" #include "sync/util/cryptographer.h" -using browser_sync::TestIdFactory; +using csync::TestIdFactory; using content::BrowserThread; using sync_api::UserShare; using syncable::BASE_VERSION; diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h index 60e63a4..a0935a4 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.h +++ b/chrome/browser/sync/abstract_profile_sync_service_test.h @@ -22,9 +22,9 @@ class ProfileSyncService; class TestProfileSyncService; -namespace browser_sync { +namespace csync { class TestIdFactory; -} // namespace browser_sync +} // namespace csync namespace sync_api { struct UserShare; @@ -36,7 +36,7 @@ class ProfileSyncServiceTestHelper { static bool CreateRoot(syncable::ModelType model_type, sync_api::UserShare* service, - browser_sync::TestIdFactory* ids); + csync::TestIdFactory* ids); static sync_api::ImmutableChangeRecordList MakeSingletonChangeRecordList( int64 node_id, sync_api::ChangeRecord::Action action); diff --git a/chrome/browser/sync/backend_migrator_unittest.cc b/chrome/browser/sync/backend_migrator_unittest.cc index aef740d..e5bb4c1 100644 --- a/chrome/browser/sync/backend_migrator_unittest.cc +++ b/chrome/browser/sync/backend_migrator_unittest.cc @@ -25,9 +25,9 @@ using ::testing::Return; namespace browser_sync { -using sessions::ErrorCounters; -using sessions::SyncerStatus; -using sessions::SyncSessionSnapshot; +using csync::sessions::ErrorCounters; +using csync::sessions::SyncerStatus; +using csync::sessions::SyncSessionSnapshot; class SyncBackendMigratorTest : public testing::Test { public: @@ -107,7 +107,7 @@ class SyncBackendMigratorTest : public testing::Test { syncable::ModelTypeSet preferred_types_; NiceMock<ProfileSyncServiceMock> service_; NiceMock<DataTypeManagerMock> manager_; - TestUserShare test_user_share_; + csync::TestUserShare test_user_share_; scoped_ptr<BackendMigrator> migrator_; }; diff --git a/chrome/browser/sync/backend_unrecoverable_error_handler.cc b/chrome/browser/sync/backend_unrecoverable_error_handler.cc index 395505e..2a683e0 100644 --- a/chrome/browser/sync/backend_unrecoverable_error_handler.cc +++ b/chrome/browser/sync/backend_unrecoverable_error_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,7 +12,7 @@ using content::BrowserThread; namespace browser_sync { BackendUnrecoverableErrorHandler::BackendUnrecoverableErrorHandler( - const WeakHandle<ProfileSyncService>& service) : service_(service) { + const csync::WeakHandle<ProfileSyncService>& service) : service_(service) { } BackendUnrecoverableErrorHandler::~BackendUnrecoverableErrorHandler() { diff --git a/chrome/browser/sync/backend_unrecoverable_error_handler.h b/chrome/browser/sync/backend_unrecoverable_error_handler.h index e63c2e5..c352c05 100644 --- a/chrome/browser/sync/backend_unrecoverable_error_handler.h +++ b/chrome/browser/sync/backend_unrecoverable_error_handler.h @@ -17,16 +17,17 @@ class ProfileSyncService; namespace browser_sync { -class BackendUnrecoverableErrorHandler : public UnrecoverableErrorHandler { +class BackendUnrecoverableErrorHandler + : public csync::UnrecoverableErrorHandler { public: BackendUnrecoverableErrorHandler( - const WeakHandle<ProfileSyncService>& service); + const csync::WeakHandle<ProfileSyncService>& service); virtual ~BackendUnrecoverableErrorHandler(); virtual void OnUnrecoverableError(const tracked_objects::Location& from_here, const std::string& message) OVERRIDE; private: - WeakHandle<ProfileSyncService> service_; + csync::WeakHandle<ProfileSyncService> service_; }; } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_BACKEND_UNRECOVERABLE_ERROR_HANDLER_H_ diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc index 1a595ab..0b94dc0 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc @@ -31,9 +31,9 @@ syncable::ModelType AutofillDataTypeController::type() const { return syncable::AUTOFILL; } -browser_sync::ModelSafeGroup AutofillDataTypeController::model_safe_group() +csync::ModelSafeGroup AutofillDataTypeController::model_safe_group() const { - return browser_sync::GROUP_DB; + return csync::GROUP_DB; } void AutofillDataTypeController::Observe( diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h index 30ef2b6..72b889d 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_data_type_controller.h @@ -30,7 +30,7 @@ class AutofillDataTypeController : public NewNonFrontendDataTypeController, // NewNonFrontendDataTypeController implementation. virtual syncable::ModelType type() const OVERRIDE; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; // content::NotificationObserver implementation. virtual void Observe(int notification_type, diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc index bdd565d..77f3df9 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc @@ -38,9 +38,9 @@ syncable::ModelType AutofillProfileDataTypeController::type() const { return syncable::AUTOFILL_PROFILE; } -browser_sync::ModelSafeGroup +csync::ModelSafeGroup AutofillProfileDataTypeController::model_safe_group() const { - return browser_sync::GROUP_DB; + return csync::GROUP_DB; } void AutofillProfileDataTypeController::Observe( diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h index 7695723..73fd981 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h @@ -30,7 +30,7 @@ class AutofillProfileDataTypeController // NewNonFrontendDataTypeController implementation. virtual syncable::ModelType type() const OVERRIDE; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; // content::NotificationObserver implementation. virtual void Observe(int type, diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc index 08eba94..77132fd 100644 --- a/chrome/browser/sync/glue/bookmark_change_processor.cc +++ b/chrome/browser/sync/glue/bookmark_change_processor.cc @@ -230,7 +230,7 @@ void BookmarkChangeProcessor::BookmarkNodeChanged(BookmarkModel* model, "Could not InitByIdLookup on BookmarkNodeChanged, is_del true"); LOG(ERROR) << "Deleted entry."; } else { - Cryptographer* crypto = trans.GetCryptographer(); + csync::Cryptographer* crypto = trans.GetCryptographer(); syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); const sync_pb::EntitySpecifics& specifics = sync_node.GetEntry()->Get(syncable::SPECIFICS); diff --git a/chrome/browser/sync/glue/browser_thread_model_worker.cc b/chrome/browser/sync/glue/browser_thread_model_worker.cc index 6b11495..2b1a153 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker.cc +++ b/chrome/browser/sync/glue/browser_thread_model_worker.cc @@ -14,13 +14,13 @@ using content::BrowserThread; namespace browser_sync { BrowserThreadModelWorker::BrowserThreadModelWorker( - BrowserThread::ID thread, ModelSafeGroup group) + BrowserThread::ID thread, csync::ModelSafeGroup group) : thread_(thread), group_(group) { } -SyncerError BrowserThreadModelWorker::DoWorkAndWaitUntilDone( - const WorkCallback& work) { - SyncerError error = UNSET; +csync::SyncerError BrowserThreadModelWorker::DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) { + csync::SyncerError error = csync::UNSET; if (BrowserThread::CurrentlyOn(thread_)) { DLOG(WARNING) << "Already on thread " << thread_; return work.Run(); @@ -38,42 +38,42 @@ SyncerError BrowserThreadModelWorker::DoWorkAndWaitUntilDone( return error; } -ModelSafeGroup BrowserThreadModelWorker::GetModelSafeGroup() { +csync::ModelSafeGroup BrowserThreadModelWorker::GetModelSafeGroup() { return group_; } BrowserThreadModelWorker::~BrowserThreadModelWorker() {} void BrowserThreadModelWorker::CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, WaitableEvent* done, - SyncerError* error) { + csync::SyncerError* error) { DCHECK(BrowserThread::CurrentlyOn(thread_)); *error = work.Run(); done->Signal(); } DatabaseModelWorker::DatabaseModelWorker() - : BrowserThreadModelWorker(BrowserThread::DB, GROUP_DB) { + : BrowserThreadModelWorker(BrowserThread::DB, csync::GROUP_DB) { } void DatabaseModelWorker::CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, WaitableEvent* done, - SyncerError* error) { + csync::SyncerError* error) { BrowserThreadModelWorker::CallDoWorkAndSignalTask(work, done, error); } DatabaseModelWorker::~DatabaseModelWorker() {} FileModelWorker::FileModelWorker() - : BrowserThreadModelWorker(BrowserThread::FILE, GROUP_FILE) { + : BrowserThreadModelWorker(BrowserThread::FILE, csync::GROUP_FILE) { } void FileModelWorker::CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, WaitableEvent* done, - SyncerError* error) { + csync::SyncerError* error) { BrowserThreadModelWorker::CallDoWorkAndSignalTask(work, done, error); } diff --git a/chrome/browser/sync/glue/browser_thread_model_worker.h b/chrome/browser/sync/glue/browser_thread_model_worker.h index d78de45..bf055f4 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker.h +++ b/chrome/browser/sync/glue/browser_thread_model_worker.h @@ -19,18 +19,19 @@ class WaitableEvent; namespace browser_sync { -// A ModelSafeWorker for models that accept requests from the syncapi that need -// to be fulfilled on a browser thread, for example autofill on the DB thread. -// TODO(sync): Try to generalize other ModelWorkers (e.g. history, etc). -class BrowserThreadModelWorker : public ModelSafeWorker { +// A csync::ModelSafeWorker for models that accept requests from the +// syncapi that need to be fulfilled on a browser thread, for example +// autofill on the DB thread. TODO(sync): Try to generalize other +// ModelWorkers (e.g. history, etc). +class BrowserThreadModelWorker : public csync::ModelSafeWorker { public: BrowserThreadModelWorker(content::BrowserThread::ID thread, - ModelSafeGroup group); + csync::ModelSafeGroup group); - // ModelSafeWorker implementation. Called on the sync thread. - virtual SyncerError DoWorkAndWaitUntilDone( - const WorkCallback& work) OVERRIDE; - virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; + // csync::ModelSafeWorker implementation. Called on the sync thread. + virtual csync::SyncerError DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) OVERRIDE; + virtual csync::ModelSafeGroup GetModelSafeGroup() OVERRIDE; protected: virtual ~BrowserThreadModelWorker(); @@ -39,13 +40,13 @@ class BrowserThreadModelWorker : public ModelSafeWorker { // an implementation that subclasses should use. This is so that // (subclass)::CallDoWorkAndSignalTask shows up in callstacks. virtual void CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, base::WaitableEvent* done, - SyncerError* error) = 0; + csync::SyncerError* error) = 0; private: content::BrowserThread::ID thread_; - ModelSafeGroup group_; + csync::ModelSafeGroup group_; DISALLOW_COPY_AND_ASSIGN(BrowserThreadModelWorker); }; @@ -59,9 +60,9 @@ class DatabaseModelWorker : public BrowserThreadModelWorker { protected: virtual void CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, base::WaitableEvent* done, - SyncerError* error) OVERRIDE; + csync::SyncerError* error) OVERRIDE; private: virtual ~DatabaseModelWorker(); @@ -73,9 +74,9 @@ class FileModelWorker : public BrowserThreadModelWorker { protected: virtual void CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, base::WaitableEvent* done, - SyncerError* error) OVERRIDE; + csync::SyncerError* error) OVERRIDE; private: virtual ~FileModelWorker(); diff --git a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc index ff59b57..82c3e50 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc @@ -42,7 +42,7 @@ class SyncBrowserThreadModelWorkerTest : public testing::Test { // DoWork hasn't executed within action_timeout_ms() ms. void ScheduleWork() { // We wait until the callback is done. So it is safe to use unretained. - WorkCallback c = base::Bind(&SyncBrowserThreadModelWorkerTest::DoWork, + csync::WorkCallback c = base::Bind(&SyncBrowserThreadModelWorkerTest::DoWork, base::Unretained(this)); timer()->Start( FROM_HERE, @@ -53,13 +53,13 @@ class SyncBrowserThreadModelWorkerTest : public testing::Test { } // This is the work that will be scheduled to be done on the DB thread. - SyncerError DoWork() { + csync::SyncerError DoWork() { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); timer_.Stop(); // Stop the failure timer so the test succeeds. BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, MessageLoop::QuitClosure()); did_do_work_ = true; - return SYNCER_OK; + return csync::SYNCER_OK; } // This will be called by the OneShotTimer and make the test fail unless diff --git a/chrome/browser/sync/glue/change_processor.h b/chrome/browser/sync/glue/change_processor.h index c543a7c..18d2597 100644 --- a/chrome/browser/sync/glue/change_processor.h +++ b/chrome/browser/sync/glue/change_processor.h @@ -12,10 +12,13 @@ class Profile; +namespace csync { +class UnrecoverableErrorHandler; +} // namespace csync + namespace browser_sync { class ModelAssociator; -class UnrecoverableErrorHandler; // An interface used to apply changes from the sync model to the browser's // native model. This does not currently distinguish between model data types. @@ -24,14 +27,15 @@ class ChangeProcessor { explicit ChangeProcessor(DataTypeErrorHandler* error_handler); virtual ~ChangeProcessor(); - // Call when the processor should accept changes from either provided model - // and apply them to the other. Both the chrome model and sync_api are - // expected to be initialized and loaded. You must have set a valid - // ModelAssociator and UnrecoverableErrorHandler before using this method, - // and the two models should be associated w.r.t the ModelAssociator provided. - // It is safe to call Start again after previously Stop()ing the processor. - // Subclasses can extract their associated chrome model from |profile| in - // |StartImpl|. + // Call when the processor should accept changes from either + // provided model and apply them to the other. Both the chrome + // model and sync_api are expected to be initialized and loaded. + // You must have set a valid ModelAssociator and + // csync::UnrecoverableErrorHandler before using this method, and + // the two models should be associated w.r.t the ModelAssociator + // provided. It is safe to call Start again after previously + // Stop()ing the processor. Subclasses can extract their associated + // chrome model from |profile| in |StartImpl|. void Start(Profile* profile, sync_api::UserShare* share_handle); void Stop(); virtual bool IsRunning() const; diff --git a/chrome/browser/sync/glue/chrome_encryptor.h b/chrome/browser/sync/glue/chrome_encryptor.h index a97dccb..310c68e 100644 --- a/chrome/browser/sync/glue/chrome_encryptor.h +++ b/chrome/browser/sync/glue/chrome_encryptor.h @@ -12,7 +12,7 @@ namespace browser_sync { // Encryptor that uses the Chrome password manager's encryptor. -class ChromeEncryptor : public Encryptor { +class ChromeEncryptor : public csync::Encryptor { public: virtual ~ChromeEncryptor(); diff --git a/chrome/browser/sync/glue/chrome_extensions_activity_monitor.h b/chrome/browser/sync/glue/chrome_extensions_activity_monitor.h index 057b480..350d45d 100644 --- a/chrome/browser/sync/glue/chrome_extensions_activity_monitor.h +++ b/chrome/browser/sync/glue/chrome_extensions_activity_monitor.h @@ -14,18 +14,19 @@ namespace browser_sync { -// Chrome-specific implementation of ExtensionsActivityMonitor. +// Chrome-specific implementation of csync::ExtensionsActivityMonitor. // -// As per the requirements of ExtensionsActivityMonitor, all +// As per the requirements of csync::ExtensionsActivityMonitor, all // overridden methods are thread-safe, although this class must be // created and destroyed on the UI thread. class ChromeExtensionsActivityMonitor - : public ExtensionsActivityMonitor, content::NotificationObserver { + : public csync::ExtensionsActivityMonitor, + public content::NotificationObserver { public: ChromeExtensionsActivityMonitor(); virtual ~ChromeExtensionsActivityMonitor(); - // ExtensionsActivityMonitor implementation. + // csync::ExtensionsActivityMonitor implementation. virtual void GetAndClearRecords(Records* buffer) OVERRIDE; virtual void PutRecords(const Records& records) OVERRIDE; diff --git a/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc b/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc index cc4b12f..92bcf98 100644 --- a/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc @@ -83,7 +83,7 @@ class SyncChromeExtensionsActivityMonitorTest : public testing::Test { // Fire some mutating bookmark API events with extension 1, then fire // some mutating and non-mutating bookmark API events with extension // 2. Only the mutating events should be recorded by the -// ExtensionsActivityMonitor. +// csync::ExtensionsActivityMonitor. TEST_F(SyncChromeExtensionsActivityMonitorTest, Basic) { FireBookmarksApiEvent<RemoveBookmarkFunction>(extension1_, 1); FireBookmarksApiEvent<MoveBookmarkFunction>(extension1_, 1); @@ -98,7 +98,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, Basic) { FireBookmarksApiEvent<GetBookmarksFunction>(extension2_, 33); const uint32 writes_by_extension2 = 8; - ExtensionsActivityMonitor::Records results; + csync::ExtensionsActivityMonitor::Records results; monitor_.GetAndClearRecords(&results); EXPECT_EQ(2U, results.size()); @@ -116,7 +116,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, Put) { FireBookmarksApiEvent<CreateBookmarkFunction>(extension1_, 5); FireBookmarksApiEvent<MoveBookmarkFunction>(extension2_, 8); - ExtensionsActivityMonitor::Records results; + csync::ExtensionsActivityMonitor::Records results; monitor_.GetAndClearRecords(&results); EXPECT_EQ(2U, results.size()); @@ -129,7 +129,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, Put) { // Simulate a commit failure, which augments the active record set with the // refugee records. monitor_.PutRecords(results); - ExtensionsActivityMonitor::Records new_records; + csync::ExtensionsActivityMonitor::Records new_records; monitor_.GetAndClearRecords(&new_records); EXPECT_EQ(2U, results.size()); @@ -145,7 +145,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, Put) { TEST_F(SyncChromeExtensionsActivityMonitorTest, MultiGet) { FireBookmarksApiEvent<CreateBookmarkFunction>(extension1_, 5); - ExtensionsActivityMonitor::Records results; + csync::ExtensionsActivityMonitor::Records results; monitor_.GetAndClearRecords(&results); EXPECT_EQ(1U, results.size()); diff --git a/chrome/browser/sync/glue/data_type_controller.h b/chrome/browser/sync/glue/data_type_controller.h index ac27fa9..a8c2e95 100644 --- a/chrome/browser/sync/glue/data_type_controller.h +++ b/chrome/browser/sync/glue/data_type_controller.h @@ -100,7 +100,7 @@ class DataTypeController // The model safe group of this data type. This should reflect the // thread that should be used to modify the data type's native // model. - virtual browser_sync::ModelSafeGroup model_safe_group() const = 0; + virtual csync::ModelSafeGroup model_safe_group() const = 0; // Current state of the data type controller. virtual State state() const = 0; diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc index 7ce982a..c1362bd 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc @@ -38,9 +38,9 @@ syncable::ModelType ExtensionSettingDataTypeController::type() const { return type_; } -browser_sync::ModelSafeGroup +csync::ModelSafeGroup ExtensionSettingDataTypeController::model_safe_group() const { - return browser_sync::GROUP_FILE; + return csync::GROUP_FILE; } ExtensionSettingDataTypeController::~ExtensionSettingDataTypeController() {} diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.h b/chrome/browser/sync/glue/extension_setting_data_type_controller.h index 402ff1a..2147ede 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.h @@ -34,7 +34,7 @@ class ExtensionSettingDataTypeController // NonFrontendDataTypeController implementation virtual syncable::ModelType type() const OVERRIDE; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; private: virtual ~ExtensionSettingDataTypeController(); diff --git a/chrome/browser/sync/glue/fake_data_type_controller.cc b/chrome/browser/sync/glue/fake_data_type_controller.cc index 20f64a2..507f82a 100644 --- a/chrome/browser/sync/glue/fake_data_type_controller.cc +++ b/chrome/browser/sync/glue/fake_data_type_controller.cc @@ -90,9 +90,9 @@ std::string FakeDataTypeController::name() const { } // This isn't called by the DTM. -browser_sync::ModelSafeGroup FakeDataTypeController::model_safe_group() const { +csync::ModelSafeGroup FakeDataTypeController::model_safe_group() const { ADD_FAILURE(); - return browser_sync::GROUP_PASSIVE; + return csync::GROUP_PASSIVE; } DataTypeController::State FakeDataTypeController::state() const { diff --git a/chrome/browser/sync/glue/fake_data_type_controller.h b/chrome/browser/sync/glue/fake_data_type_controller.h index 73abf87..e0161dc 100644 --- a/chrome/browser/sync/glue/fake_data_type_controller.h +++ b/chrome/browser/sync/glue/fake_data_type_controller.h @@ -38,7 +38,7 @@ class FakeDataTypeController : public DataTypeController { virtual std::string name() const OVERRIDE; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; virtual State state() const OVERRIDE; diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.cc b/chrome/browser/sync/glue/frontend_data_type_controller.cc index dc0297b..14d55e2 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller.cc +++ b/chrome/browser/sync/glue/frontend_data_type_controller.cc @@ -120,9 +120,9 @@ void FrontendDataTypeController::Stop() { state_ = NOT_RUNNING; } -browser_sync::ModelSafeGroup FrontendDataTypeController::model_safe_group() +csync::ModelSafeGroup FrontendDataTypeController::model_safe_group() const { - return browser_sync::GROUP_UI; + return csync::GROUP_UI; } std::string FrontendDataTypeController::name() const { diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.h b/chrome/browser/sync/glue/frontend_data_type_controller.h index 82f8775..65bd460 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller.h +++ b/chrome/browser/sync/glue/frontend_data_type_controller.h @@ -48,7 +48,7 @@ class FrontendDataTypeController : public DataTypeController { virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE; virtual void Stop() OVERRIDE; virtual syncable::ModelType type() const = 0; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; virtual std::string name() const OVERRIDE; virtual State state() const OVERRIDE; diff --git a/chrome/browser/sync/glue/frontend_data_type_controller_mock.h b/chrome/browser/sync/glue/frontend_data_type_controller_mock.h index 17f242d..c734429 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller_mock.h +++ b/chrome/browser/sync/glue/frontend_data_type_controller_mock.h @@ -26,7 +26,7 @@ class FrontendDataTypeControllerMock : public FrontendDataTypeController { MOCK_METHOD0(enabled, bool()); MOCK_CONST_METHOD0(type, syncable::ModelType()); MOCK_CONST_METHOD0(name, std::string()); - MOCK_CONST_METHOD0(model_safe_group, browser_sync::ModelSafeGroup()); + MOCK_CONST_METHOD0(model_safe_group, csync::ModelSafeGroup()); MOCK_CONST_METHOD0(state, State()); MOCK_METHOD2(OnUnrecoverableError, void(const tracked_objects::Location&, const std::string&)); diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc index 86f3992..7f09de5 100644 --- a/chrome/browser/sync/glue/generic_change_processor.cc +++ b/chrome/browser/sync/glue/generic_change_processor.cc @@ -362,7 +362,7 @@ SyncError GenericChangeProcessor::ProcessSyncChanges( LOG(ERROR) << "Update: deleted entry."; return error; } else { - Cryptographer* crypto = trans.GetCryptographer(); + csync::Cryptographer* crypto = trans.GetCryptographer(); syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); const sync_pb::EntitySpecifics& specifics = sync_node.GetEntry()->Get(syncable::SPECIFICS); diff --git a/chrome/browser/sync/glue/history_model_worker.cc b/chrome/browser/sync/glue/history_model_worker.cc index 9ad68f1..5480c12 100644 --- a/chrome/browser/sync/glue/history_model_worker.cc +++ b/chrome/browser/sync/glue/history_model_worker.cc @@ -16,9 +16,9 @@ namespace browser_sync { class WorkerTask : public HistoryDBTask { public: WorkerTask( - const WorkCallback& work, + const csync::WorkCallback& work, WaitableEvent* done, - SyncerError* error) + csync::SyncerError* error) : work_(work), done_(done), error_(error) {} virtual bool RunOnDBThread(history::HistoryBackend* backend, @@ -35,9 +35,9 @@ class WorkerTask : public HistoryDBTask { protected: virtual ~WorkerTask() {} - WorkCallback work_; + csync::WorkCallback work_; WaitableEvent* done_; - SyncerError* error_; + csync::SyncerError* error_; }; @@ -46,18 +46,18 @@ HistoryModelWorker::HistoryModelWorker(HistoryService* history_service) CHECK(history_service); } -SyncerError HistoryModelWorker::DoWorkAndWaitUntilDone( - const WorkCallback& work) { +csync::SyncerError HistoryModelWorker::DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) { WaitableEvent done(false, false); - SyncerError error = UNSET; + csync::SyncerError error = csync::UNSET; scoped_refptr<WorkerTask> task(new WorkerTask(work, &done, &error)); history_service_->ScheduleDBTask(task.get(), &cancelable_consumer_); done.Wait(); return error; } -ModelSafeGroup HistoryModelWorker::GetModelSafeGroup() { - return GROUP_HISTORY; +csync::ModelSafeGroup HistoryModelWorker::GetModelSafeGroup() { + return csync::GROUP_HISTORY; } HistoryModelWorker::~HistoryModelWorker() {} diff --git a/chrome/browser/sync/glue/history_model_worker.h b/chrome/browser/sync/glue/history_model_worker.h index 28361f5..e744790 100644 --- a/chrome/browser/sync/glue/history_model_worker.h +++ b/chrome/browser/sync/glue/history_model_worker.h @@ -18,16 +18,16 @@ class HistoryService; namespace browser_sync { -// A ModelSafeWorker for history models that accepts requests +// A csync::ModelSafeWorker for history models that accepts requests // from the syncapi that need to be fulfilled on the history thread. -class HistoryModelWorker : public browser_sync::ModelSafeWorker { +class HistoryModelWorker : public csync::ModelSafeWorker { public: explicit HistoryModelWorker(HistoryService* history_service); - // ModelSafeWorker implementation. Called on syncapi SyncerThread. - virtual SyncerError DoWorkAndWaitUntilDone( - const WorkCallback& work) OVERRIDE; - virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; + // csync::ModelSafeWorker implementation. Called on syncapi SyncerThread. + virtual csync::SyncerError DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) OVERRIDE; + virtual csync::ModelSafeGroup GetModelSafeGroup() OVERRIDE; private: virtual ~HistoryModelWorker(); diff --git a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h index e4f6f59..c1eb295 100644 --- a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h +++ b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h @@ -27,7 +27,7 @@ class NewNonFrontendDataTypeControllerMock MOCK_METHOD0(enabled, bool()); MOCK_CONST_METHOD0(type, syncable::ModelType()); MOCK_CONST_METHOD0(name, std::string()); - MOCK_CONST_METHOD0(model_safe_group, browser_sync::ModelSafeGroup()); + MOCK_CONST_METHOD0(model_safe_group, csync::ModelSafeGroup()); MOCK_CONST_METHOD0(state, State()); MOCK_METHOD2(OnUnrecoverableError, void(const tracked_objects::Location&, const std::string&)); diff --git a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc index d31699b..32ba5f6 100644 --- a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc @@ -75,8 +75,8 @@ class NewNonFrontendDataTypeControllerFake virtual syncable::ModelType type() const OVERRIDE { return AUTOFILL_PROFILE; } - virtual ModelSafeGroup model_safe_group() const OVERRIDE { - return GROUP_DB; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE { + return csync::GROUP_DB; } // Prevent tasks from being posted on the backend thread until diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.h b/chrome/browser/sync/glue/non_frontend_data_type_controller.h index 72144fc..a8fc09c 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller.h +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.h @@ -50,7 +50,7 @@ class NonFrontendDataTypeController : public DataTypeController { virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE; virtual void Stop() OVERRIDE; virtual syncable::ModelType type() const = 0; - virtual browser_sync::ModelSafeGroup model_safe_group() const = 0; + virtual csync::ModelSafeGroup model_safe_group() const = 0; virtual std::string name() const OVERRIDE; virtual State state() const OVERRIDE; diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h b/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h index abe5726..f5d40be 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h @@ -26,7 +26,7 @@ class NonFrontendDataTypeControllerMock : public NonFrontendDataTypeController { MOCK_METHOD0(enabled, bool()); MOCK_CONST_METHOD0(type, syncable::ModelType()); MOCK_CONST_METHOD0(name, std::string()); - MOCK_CONST_METHOD0(model_safe_group, browser_sync::ModelSafeGroup()); + MOCK_CONST_METHOD0(model_safe_group, csync::ModelSafeGroup()); MOCK_CONST_METHOD0(state, State()); MOCK_METHOD2(OnUnrecoverableError, void(const tracked_objects::Location&, const std::string&)); diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc index f3bcfaf..a031b1f 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc @@ -27,7 +27,7 @@ using base::WaitableEvent; using browser_sync::ChangeProcessorMock; using browser_sync::DataTypeController; -using browser_sync::GROUP_DB; +using csync::GROUP_DB; using browser_sync::NonFrontendDataTypeController; using browser_sync::NonFrontendDataTypeControllerMock; using browser_sync::ModelAssociatorMock; @@ -62,8 +62,8 @@ class NonFrontendDataTypeControllerFake : public NonFrontendDataTypeController { mock_(mock) {} virtual syncable::ModelType type() const { return syncable::BOOKMARKS; } - virtual browser_sync::ModelSafeGroup model_safe_group() const { - return GROUP_DB; + virtual csync::ModelSafeGroup model_safe_group() const { + return csync::GROUP_DB; } private: diff --git a/chrome/browser/sync/glue/password_data_type_controller.cc b/chrome/browser/sync/glue/password_data_type_controller.cc index 54aa4609..7736469 100644 --- a/chrome/browser/sync/glue/password_data_type_controller.cc +++ b/chrome/browser/sync/glue/password_data_type_controller.cc @@ -32,9 +32,9 @@ syncable::ModelType PasswordDataTypeController::type() const { return syncable::PASSWORDS; } -browser_sync::ModelSafeGroup PasswordDataTypeController::model_safe_group() +csync::ModelSafeGroup PasswordDataTypeController::model_safe_group() const { - return browser_sync::GROUP_PASSWORD; + return csync::GROUP_PASSWORD; } PasswordDataTypeController::~PasswordDataTypeController() {} diff --git a/chrome/browser/sync/glue/password_data_type_controller.h b/chrome/browser/sync/glue/password_data_type_controller.h index b389913..89bf821 100644 --- a/chrome/browser/sync/glue/password_data_type_controller.h +++ b/chrome/browser/sync/glue/password_data_type_controller.h @@ -26,7 +26,7 @@ class PasswordDataTypeController : public NonFrontendDataTypeController { // NonFrontendDataTypeController implementation virtual syncable::ModelType type() const OVERRIDE; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; protected: virtual ~PasswordDataTypeController(); diff --git a/chrome/browser/sync/glue/password_model_worker.cc b/chrome/browser/sync/glue/password_model_worker.cc index e9faedc..edc59b7 100644 --- a/chrome/browser/sync/glue/password_model_worker.cc +++ b/chrome/browser/sync/glue/password_model_worker.cc @@ -19,10 +19,10 @@ PasswordModelWorker::PasswordModelWorker( DCHECK(password_store); } -SyncerError PasswordModelWorker::DoWorkAndWaitUntilDone( - const WorkCallback& work) { +csync::SyncerError PasswordModelWorker::DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) { WaitableEvent done(false, false); - SyncerError error = UNSET; + csync::SyncerError error = csync::UNSET; password_store_->ScheduleTask( base::Bind(&PasswordModelWorker::CallDoWorkAndSignalTask, this, work, &done, &error)); @@ -30,16 +30,16 @@ SyncerError PasswordModelWorker::DoWorkAndWaitUntilDone( return error; } -ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { - return GROUP_PASSWORD; +csync::ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { + return csync::GROUP_PASSWORD; } PasswordModelWorker::~PasswordModelWorker() {} void PasswordModelWorker::CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, WaitableEvent* done, - SyncerError *error) { + csync::SyncerError *error) { *error = work.Run(); done->Signal(); } diff --git a/chrome/browser/sync/glue/password_model_worker.h b/chrome/browser/sync/glue/password_model_worker.h index b49c82e..a9fcbb94 100644 --- a/chrome/browser/sync/glue/password_model_worker.h +++ b/chrome/browser/sync/glue/password_model_worker.h @@ -21,26 +21,26 @@ class WaitableEvent; namespace browser_sync { -// A ModelSafeWorker for password models that accepts requests +// A csync::ModelSafeWorker for password models that accepts requests // from the syncapi that need to be fulfilled on the password thread, // which is the DB thread on Linux and Windows. -class PasswordModelWorker : public browser_sync::ModelSafeWorker { +class PasswordModelWorker : public csync::ModelSafeWorker { public: explicit PasswordModelWorker( const scoped_refptr<PasswordStore>& password_store); - // ModelSafeWorker implementation. Called on syncapi SyncerThread. - virtual SyncerError DoWorkAndWaitUntilDone( - const WorkCallback& work) OVERRIDE; - virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; + // csync::ModelSafeWorker implementation. Called on syncapi SyncerThread. + virtual csync::SyncerError DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) OVERRIDE; + virtual csync::ModelSafeGroup GetModelSafeGroup() OVERRIDE; private: virtual ~PasswordModelWorker(); void CallDoWorkAndSignalTask( - const WorkCallback& work, + const csync::WorkCallback& work, base::WaitableEvent* done, - SyncerError* error); + csync::SyncerError* error); scoped_refptr<PasswordStore> password_store_; DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 3e3e49d..e0ab5ee 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -504,7 +504,8 @@ void SessionModelAssociator::AssociateTabContents( // (if so, we want to refresh the timestamp). if (!(current_index != prev_tab->current_navigation_index && current_index == i)) { - sync_nav->set_timestamp(TimeToProtoTime(prev_nav_iter->timestamp())); + sync_nav->set_timestamp( + csync::TimeToProtoTime(prev_nav_iter->timestamp())); DVLOG(2) << "Nav to " << sync_nav->virtual_url() << " already known, " << "reusing old timestamp " << sync_nav->timestamp(); } @@ -713,7 +714,8 @@ void SessionModelAssociator::PopulateSessionSpecificsNavigation( sync_pb::SyncEnums_PageTransition_TYPED); } tab_navigation->set_unique_id(navigation.GetUniqueID()); - tab_navigation->set_timestamp(TimeToProtoTime(base::Time::Now())); + tab_navigation->set_timestamp( + csync::TimeToProtoTime(base::Time::Now())); } void SessionModelAssociator::Associate(const SyncedTabDelegate* tab, @@ -888,7 +890,7 @@ void SessionModelAssociator::InitializeCurrentSessionName() { AsWeakPtr(), std::string("TestSessionName"))); } else { - browser_sync::GetSessionName( + csync::GetSessionName( BrowserThread::GetBlockingPool(), base::Bind(&SessionModelAssociator::OnSessionNameInitialized, AsWeakPtr())); @@ -1268,7 +1270,7 @@ void SessionModelAssociator::AppendSessionTabNavigation( } } if (specifics.has_timestamp()) { - timestamp = ProtoTimeToTime(specifics.timestamp()); + timestamp = csync::ProtoTimeToTime(specifics.timestamp()); } if (specifics.has_unique_id()) { unique_id = specifics.unique_id(); diff --git a/chrome/browser/sync/glue/session_model_associator_unittest.cc b/chrome/browser/sync/glue/session_model_associator_unittest.cc index a56f15f..8ecdffc 100644 --- a/chrome/browser/sync/glue/session_model_associator_unittest.cc +++ b/chrome/browser/sync/glue/session_model_associator_unittest.cc @@ -20,9 +20,9 @@ #include "content/public/common/page_transition_types.h" #include "content/public/test/test_browser_thread.h" #include "sync/protocol/session_specifics.pb.h" +#include "sync/util/time.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "sync/util/time.h" using content::BrowserThread; using testing::NiceMock; @@ -595,7 +595,7 @@ TEST_F(SyncSessionModelAssociatorTest, AssociateNewTab) { sync_pb::SessionTab sync_tab; GURL new_url; - int64 now = TimeToProtoTime(base::Time::Now()); + int64 now = csync::TimeToProtoTime(base::Time::Now()); AssociateTabContents(window_mock, tab_mock, &prev_tab, &sync_tab, &new_url); EXPECT_EQ(new_url, entry3->GetVirtualURL()); @@ -649,9 +649,9 @@ TEST_F(SyncSessionModelAssociatorTest, AssociateExistingTab) { AssociateTabContents(window_mock, tab_mock, &prev_tab, &sync_tab, &new_url); // Override the timestamps to arbitrary old values we can compare against. - prev_tab.synced_tab_navigations[0].set_timestamp(ProtoTimeToTime(1)); - prev_tab.synced_tab_navigations[1].set_timestamp(ProtoTimeToTime(2)); - prev_tab.synced_tab_navigations[2].set_timestamp(ProtoTimeToTime(3)); + prev_tab.synced_tab_navigations[0].set_timestamp(csync::ProtoTimeToTime(1)); + prev_tab.synced_tab_navigations[1].set_timestamp(csync::ProtoTimeToTime(2)); + prev_tab.synced_tab_navigations[2].set_timestamp(csync::ProtoTimeToTime(3)); // Now re-associate with the same data. AssociateTabContents(window_mock, tab_mock, &prev_tab, &sync_tab, &new_url); @@ -709,9 +709,9 @@ TEST_F(SyncSessionModelAssociatorTest, AssociateAppendedTab) { AssociateTabContents(window_mock, tab_mock, &prev_tab, &sync_tab, &new_url); // Override the timestamps to arbitrary old values we can compare against. - prev_tab.synced_tab_navigations[0].set_timestamp(ProtoTimeToTime(1)); - prev_tab.synced_tab_navigations[1].set_timestamp(ProtoTimeToTime(2)); - prev_tab.synced_tab_navigations[2].set_timestamp(ProtoTimeToTime(3)); + prev_tab.synced_tab_navigations[0].set_timestamp(csync::ProtoTimeToTime(1)); + prev_tab.synced_tab_navigations[1].set_timestamp(csync::ProtoTimeToTime(2)); + prev_tab.synced_tab_navigations[2].set_timestamp(csync::ProtoTimeToTime(3)); // Add a new entry and change the current navigation index. scoped_ptr<content::NavigationEntry> entry4( @@ -723,7 +723,7 @@ TEST_F(SyncSessionModelAssociatorTest, AssociateAppendedTab) { EXPECT_CALL(tab_mock, GetCurrentEntryIndex()).WillRepeatedly(Return(3)); // The new entry should have a timestamp later than this. - int64 now = TimeToProtoTime(base::Time::Now()); + int64 now = csync::TimeToProtoTime(base::Time::Now()); // Now re-associate with the new version. AssociateTabContents(window_mock, tab_mock, &prev_tab, &sync_tab, &new_url); @@ -791,10 +791,10 @@ TEST_F(SyncSessionModelAssociatorTest, AssociatePrunedTab) { AssociateTabContents(window_mock, tab_mock, &prev_tab, &sync_tab, &new_url); // Override the timestamps to arbitrary old values we can compare against. - prev_tab.synced_tab_navigations[0].set_timestamp(ProtoTimeToTime(1)); - prev_tab.synced_tab_navigations[1].set_timestamp(ProtoTimeToTime(2)); - prev_tab.synced_tab_navigations[2].set_timestamp(ProtoTimeToTime(3)); - prev_tab.synced_tab_navigations[2].set_timestamp(ProtoTimeToTime(4)); + prev_tab.synced_tab_navigations[0].set_timestamp(csync::ProtoTimeToTime(1)); + prev_tab.synced_tab_navigations[1].set_timestamp(csync::ProtoTimeToTime(2)); + prev_tab.synced_tab_navigations[2].set_timestamp(csync::ProtoTimeToTime(3)); + prev_tab.synced_tab_navigations[2].set_timestamp(csync::ProtoTimeToTime(4)); // Reset new tab to have the oldest entry pruned, the current navigation // set to entry3, and a new entry added in place of entry4. @@ -813,7 +813,7 @@ TEST_F(SyncSessionModelAssociatorTest, AssociatePrunedTab) { EXPECT_CALL(tab_mock, GetPendingEntryIndex()).WillRepeatedly(Return(-1)); // The new entry should have a timestamp later than this. - int64 now = TimeToProtoTime(base::Time::Now()); + int64 now = csync::TimeToProtoTime(base::Time::Now()); // Now re-associate with the new version. AssociateTabContents(window_mock, tab_mock, &prev_tab, &sync_tab, &new_url); diff --git a/chrome/browser/sync/glue/shared_change_processor.cc b/chrome/browser/sync/glue/shared_change_processor.cc index a75b355..8944851 100644 --- a/chrome/browser/sync/glue/shared_change_processor.cc +++ b/chrome/browser/sync/glue/shared_change_processor.cc @@ -137,7 +137,7 @@ bool SharedChangeProcessor::CryptoReadyIfNecessary() { } void SharedChangeProcessor::ActivateDataType( - browser_sync::ModelSafeGroup model_safe_group) { + csync::ModelSafeGroup model_safe_group) { DCHECK(backend_loop_.get()); DCHECK(backend_loop_->BelongsToCurrentThread()); AutoLock lock(monitor_lock_); diff --git a/chrome/browser/sync/glue/shared_change_processor.h b/chrome/browser/sync/glue/shared_change_processor.h index 240c8f6..d374087 100644 --- a/chrome/browser/sync/glue/shared_change_processor.h +++ b/chrome/browser/sync/glue/shared_change_processor.h @@ -85,7 +85,7 @@ class SharedChangeProcessor // Register |generic_change_processor_| as the change processor for the // current type on |model_safe_group|. // Does nothing if |disconnected_| is true. - virtual void ActivateDataType(browser_sync::ModelSafeGroup model_safe_group); + virtual void ActivateDataType(csync::ModelSafeGroup model_safe_group); virtual SyncError CreateAndUploadError( const tracked_objects::Location& location, diff --git a/chrome/browser/sync/glue/shared_change_processor_mock.h b/chrome/browser/sync/glue/shared_change_processor_mock.h index accf46a..acc655f 100644 --- a/chrome/browser/sync/glue/shared_change_processor_mock.h +++ b/chrome/browser/sync/glue/shared_change_processor_mock.h @@ -32,7 +32,7 @@ class SharedChangeProcessorMock : public SharedChangeProcessor { bool(bool*)); MOCK_METHOD0(CryptoReadyIfNecessary, bool()); MOCK_METHOD1(ActivateDataType, - void(browser_sync::ModelSafeGroup)); + void(csync::ModelSafeGroup)); protected: virtual ~SharedChangeProcessorMock(); diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index f14106c..9412992 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -61,7 +61,7 @@ typedef GoogleServiceAuthError AuthError; namespace browser_sync { using content::BrowserThread; -using sessions::SyncSessionSnapshot; +using csync::sessions::SyncSessionSnapshot; using sync_api::SyncCredentials; // Helper macros to log with the syncer thread name; useful when there @@ -83,9 +83,9 @@ class SyncBackendHost::Core // traffic controller here, forwarding incoming messages to appropriate // landing threads. virtual void OnSyncCycleCompleted( - const sessions::SyncSessionSnapshot& snapshot) OVERRIDE; + const csync::sessions::SyncSessionSnapshot& snapshot) OVERRIDE; virtual void OnInitializationComplete( - const WeakHandle<JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) OVERRIDE; virtual void OnConnectionStatusChange( sync_api::ConnectionStatus status) OVERRIDE; @@ -102,7 +102,7 @@ class SyncBackendHost::Core bool encrypt_everything) OVERRIDE; virtual void OnEncryptionComplete() OVERRIDE; virtual void OnActionableError( - const browser_sync::SyncProtocolError& sync_error) OVERRIDE; + const csync::SyncProtocolError& sync_error) OVERRIDE; // Note: // @@ -124,11 +124,11 @@ class SyncBackendHost::Core // Called to tell the syncapi to start syncing (generally after // initialization and authentication). - void DoStartSyncing(const ModelSafeRoutingInfo& routing_info); + void DoStartSyncing(const csync::ModelSafeRoutingInfo& routing_info); // Called to cleanup disabled types. void DoRequestCleanupDisabledTypes( - const browser_sync::ModelSafeRoutingInfo& routing_info); + const csync::ModelSafeRoutingInfo& routing_info); // Called to set the passphrase for encryption. void DoSetEncryptionPassphrase(const std::string& passphrase, @@ -160,7 +160,7 @@ class SyncBackendHost::Core void DoShutdown(bool stopping_sync); virtual void DoRequestConfig( - const browser_sync::ModelSafeRoutingInfo& routing_info, + const csync::ModelSafeRoutingInfo& routing_info, syncable::ModelTypeSet types_to_config, sync_api::ConfigureReason reason); @@ -209,7 +209,7 @@ class SyncBackendHost::Core const FilePath sync_data_folder_path_; // Our parent SyncBackendHost. - WeakHandle<SyncBackendHost> host_; + csync::WeakHandle<SyncBackendHost> host_; // The loop where all the sync backend operations happen. // Non-NULL only between calls to DoInitialize() and DoShutdown(). @@ -332,13 +332,14 @@ sync_api::HttpPostProviderFactory* MakeHttpBridgeFactory( void SyncBackendHost::Initialize( SyncFrontend* frontend, - const WeakHandle<JsEventHandler>& event_handler, + const csync::WeakHandle<csync::JsEventHandler>& event_handler, const GURL& sync_service_url, syncable::ModelTypeSet initial_types, const SyncCredentials& credentials, bool delete_sync_data_folder, - UnrecoverableErrorHandler* unrecoverable_error_handler, - ReportUnrecoverableErrorFunction report_unrecoverable_error_function) { + csync::UnrecoverableErrorHandler* unrecoverable_error_handler, + csync::ReportUnrecoverableErrorFunction + report_unrecoverable_error_function) { if (!sync_thread_.Start()) return; @@ -355,8 +356,8 @@ void SyncBackendHost::Initialize( name_, profile_, sync_thread_.message_loop())); - ModelSafeRoutingInfo routing_info; - std::vector<ModelSafeWorker*> workers; + csync::ModelSafeRoutingInfo routing_info; + std::vector<csync::ModelSafeWorker*> workers; registrar_->GetModelSafeRoutingInfo(&routing_info); registrar_->GetWorkers(&workers); @@ -390,7 +391,7 @@ void SyncBackendHost::UpdateCredentials(const SyncCredentials& credentials) { void SyncBackendHost::StartSyncingWithServer() { SDVLOG(1) << "SyncBackendHost::StartSyncingWithServer called."; - ModelSafeRoutingInfo routing_info; + csync::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); sync_thread_.message_loop()->PostTask(FROM_HERE, @@ -585,7 +586,7 @@ void SyncBackendHost::ConfigureDataTypes( // callers can assume that the data types are cleaned up once // configuration is done. if (!types_to_remove_with_nigori.Empty()) { - ModelSafeRoutingInfo routing_info; + csync::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); sync_thread_.message_loop()->PostTask( FROM_HERE, @@ -614,7 +615,7 @@ void SyncBackendHost::EnableEncryptEverything() { } void SyncBackendHost::ActivateDataType( - syncable::ModelType type, ModelSafeGroup group, + syncable::ModelType type, csync::ModelSafeGroup group, ChangeProcessor* change_processor) { registrar_->ActivateDataType(type, group, change_processor, GetUserShare()); } @@ -661,7 +662,7 @@ bool SyncBackendHost::IsCryptographerReady( } void SyncBackendHost::GetModelSafeRoutingInfo( - ModelSafeRoutingInfo* out) const { + csync::ModelSafeRoutingInfo* out) const { if (initialized()) { CHECK(registrar_.get()); registrar_->GetModelSafeRoutingInfo(out); @@ -758,7 +759,7 @@ void SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop() { << "FinishConfigureDataTypesOnFrontendLoop"; - ModelSafeRoutingInfo routing_info; + csync::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); const syncable::ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info); @@ -806,7 +807,7 @@ void SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop() { SDVLOG(1) << "Types " << syncable::ModelTypeSetToString(types_to_config) << " added; calling DoRequestConfig"; - ModelSafeRoutingInfo routing_info; + csync::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); sync_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(&SyncBackendHost::Core::DoRequestConfig, @@ -831,10 +832,10 @@ bool SyncBackendHost::IsDownloadingNigoriForTest() const { SyncBackendHost::DoInitializeOptions::DoInitializeOptions( MessageLoop* sync_loop, SyncBackendRegistrar* registrar, - const ModelSafeRoutingInfo& routing_info, - const std::vector<ModelSafeWorker*>& workers, - ExtensionsActivityMonitor* extensions_activity_monitor, - const WeakHandle<JsEventHandler>& event_handler, + const csync::ModelSafeRoutingInfo& routing_info, + const std::vector<csync::ModelSafeWorker*>& workers, + csync::ExtensionsActivityMonitor* extensions_activity_monitor, + const csync::WeakHandle<csync::JsEventHandler>& event_handler, const GURL& service_url, MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, const sync_api::SyncCredentials& credentials, @@ -843,8 +844,8 @@ SyncBackendHost::DoInitializeOptions::DoInitializeOptions( bool delete_sync_data_folder, const std::string& restored_key_for_bootstrapping, sync_api::SyncManager::TestingMode testing_mode, - UnrecoverableErrorHandler* unrecoverable_error_handler, - ReportUnrecoverableErrorFunction report_unrecoverable_error_function) + csync::UnrecoverableErrorHandler* unrecoverable_error_handler, + csync::ReportUnrecoverableErrorFunction report_unrecoverable_error_function) : sync_loop(sync_loop), registrar(registrar), routing_info(routing_info), @@ -903,7 +904,7 @@ void SyncBackendHost::Core::OnSyncCycleCompleted( void SyncBackendHost::Core::OnInitializationComplete( - const WeakHandle<JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) { DCHECK_EQ(MessageLoop::current(), sync_loop_); host_.Call( @@ -1000,7 +1001,7 @@ void SyncBackendHost::Core::OnEncryptionComplete() { } void SyncBackendHost::Core::OnActionableError( - const browser_sync::SyncProtocolError& sync_error) { + const csync::SyncProtocolError& sync_error) { if (!sync_loop_) return; DCHECK_EQ(MessageLoop::current(), sync_loop_); @@ -1113,13 +1114,13 @@ void SyncBackendHost::Core::DoUpdateEnabledTypes( } void SyncBackendHost::Core::DoStartSyncing( - const ModelSafeRoutingInfo& routing_info) { + const csync::ModelSafeRoutingInfo& routing_info) { DCHECK_EQ(MessageLoop::current(), sync_loop_); sync_manager_->StartSyncingNormally(routing_info); } void SyncBackendHost::Core::DoRequestCleanupDisabledTypes( - const browser_sync::ModelSafeRoutingInfo& routing_info) { + const csync::ModelSafeRoutingInfo& routing_info) { DCHECK_EQ(MessageLoop::current(), sync_loop_); sync_manager_->RequestCleanupDisabledTypes(routing_info); } @@ -1176,7 +1177,7 @@ void SyncBackendHost::Core::DoShutdown(bool sync_disabled) { } void SyncBackendHost::Core::DoRequestConfig( - const browser_sync::ModelSafeRoutingInfo& routing_info, + const csync::ModelSafeRoutingInfo& routing_info, syncable::ModelTypeSet types_to_config, sync_api::ConfigureReason reason) { DCHECK_EQ(MessageLoop::current(), sync_loop_); @@ -1223,7 +1224,7 @@ void SyncBackendHost::Core::SaveChanges() { void SyncBackendHost::AddExperimentalTypes() { CHECK(initialized()); - Experiments experiments; + csync::Experiments experiments; if (core_->sync_manager()->ReceivedExperiment(&experiments)) frontend_->OnExperimentsChanged(experiments); } @@ -1237,7 +1238,7 @@ void SyncBackendHost::OnNigoriDownloadRetry() { } void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop( - const WeakHandle<JsBackend>& js_backend, bool success) { + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) { DCHECK_NE(NOT_ATTEMPTED, initialization_state_); if (!frontend_) return; @@ -1250,7 +1251,8 @@ void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop( DCHECK_EQ(MessageLoop::current(), frontend_loop_); if (!success) { initialization_state_ = NOT_INITIALIZED; - frontend_->OnBackendInitialized(WeakHandle<JsBackend>(), false); + frontend_->OnBackendInitialized( + csync::WeakHandle<csync::JsBackend>(), false); return; } @@ -1309,7 +1311,7 @@ void SyncBackendHost::PersistEncryptionBootstrapToken( } void SyncBackendHost::HandleActionableErrorEventOnFrontendLoop( - const browser_sync::SyncProtocolError& sync_error) { + const csync::SyncProtocolError& sync_error) { if (!frontend_) return; DCHECK_EQ(MessageLoop::current(), frontend_loop_); @@ -1320,7 +1322,7 @@ bool SyncBackendHost::CheckPassphraseAgainstCachedPendingKeys( const std::string& passphrase) const { DCHECK(cached_pending_keys_.has_blob()); DCHECK(!passphrase.empty()); - browser_sync::Nigori nigori; + csync::Nigori nigori; nigori.InitByDerivation("localhost", "dummy", passphrase); std::string plaintext; bool result = nigori.Decrypt(cached_pending_keys_.blob(), &plaintext); @@ -1397,7 +1399,7 @@ void SyncBackendHost::HandleConnectionStatusChangeOnFrontendLoop( } void SyncBackendHost::HandleNigoriConfigurationCompletedOnFrontendLoop( - const WeakHandle<JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, const syncable::ModelTypeSet failed_configuration_types) { HandleInitializationCompletedOnFrontendLoop( js_backend, failed_configuration_types.Empty()); diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index ccda014..2b04143 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.h @@ -62,7 +62,7 @@ class SyncFrontend { // from the 'Backend' in 'OnBackendInitialized' (unfortunately). It // is initialized only if |success| is true. virtual void OnBackendInitialized( - const WeakHandle<JsBackend>& js_backend, bool success) = 0; + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) = 0; // The backend queried the server recently and received some updates. virtual void OnSyncCycleCompleted() = 0; @@ -100,11 +100,11 @@ class SyncFrontend { // below). // // |encrypted_types| will always be a superset of - // Cryptographer::SensitiveTypes(). If |encrypt_everything| is + // csync::Cryptographer::SensitiveTypes(). If |encrypt_everything| is // true, |encrypted_types| will be the set of all known types. // // Until this function is called, observers can assume that the set - // of encrypted types is Cryptographer::SensitiveTypes() and that + // of encrypted types is csync::Cryptographer::SensitiveTypes() and that // the encrypt everything flag is false. virtual void OnEncryptedTypesChanged( syncable::ModelTypeSet encrypted_types, @@ -120,11 +120,11 @@ class SyncFrontend { // Inform the Frontend that new datatypes are available for registration. virtual void OnExperimentsChanged( - const browser_sync::Experiments& experiments) = 0; + const csync::Experiments& experiments) = 0; // Called when the sync cycle returns there is an user actionable error. virtual void OnActionableError( - const browser_sync::SyncProtocolError& error) = 0; + const csync::SyncProtocolError& error) = 0; protected: // Don't delete through SyncFrontend interface. @@ -165,13 +165,13 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // |report_unrecoverable_error_function| can be NULL. // Note: |unrecoverable_error_handler| may be invoked from any thread. void Initialize(SyncFrontend* frontend, - const WeakHandle<JsEventHandler>& event_handler, + const csync::WeakHandle<csync::JsEventHandler>& event_handler, const GURL& service_url, syncable::ModelTypeSet initial_types, const sync_api::SyncCredentials& credentials, bool delete_sync_data_folder, - UnrecoverableErrorHandler* unrecoverable_error_handler, - ReportUnrecoverableErrorFunction + csync::UnrecoverableErrorHandler* unrecoverable_error_handler, + csync::ReportUnrecoverableErrorFunction report_unrecoverable_error_function); // Called from |frontend_loop| to update SyncCredentials. @@ -240,7 +240,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // no changes are dropped between model association and change // processor activation. void ActivateDataType( - syncable::ModelType type, ModelSafeGroup group, + syncable::ModelType type, csync::ModelSafeGroup group, ChangeProcessor* change_processor); // Deactivates change processing for the given data type. @@ -253,7 +253,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // Called from any thread to obtain current status information in detailed or // summarized form. Status GetDetailedStatus(); - sessions::SyncSessionSnapshot GetLastSessionSnapshot() const; + csync::sessions::SyncSessionSnapshot GetLastSessionSnapshot() const; // Determines if the underlying sync engine has made any local changes to // items that have not yet been synced with the server. @@ -271,7 +271,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // using a token previously received. bool IsCryptographerReady(const sync_api::BaseTransaction* trans) const; - void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) const; + void GetModelSafeRoutingInfo(csync::ModelSafeRoutingInfo* out) const; protected: // The types and functions below are protected so that test @@ -287,10 +287,10 @@ class SyncBackendHost : public BackendDataTypeConfigurer { DoInitializeOptions( MessageLoop* sync_loop, SyncBackendRegistrar* registrar, - const ModelSafeRoutingInfo& routing_info, - const std::vector<ModelSafeWorker*>& workers, - ExtensionsActivityMonitor* extensions_activity_monitor, - const WeakHandle<JsEventHandler>& event_handler, + const csync::ModelSafeRoutingInfo& routing_info, + const std::vector<csync::ModelSafeWorker*>& workers, + csync::ExtensionsActivityMonitor* extensions_activity_monitor, + const csync::WeakHandle<csync::JsEventHandler>& event_handler, const GURL& service_url, MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, const sync_api::SyncCredentials& credentials, @@ -299,16 +299,17 @@ class SyncBackendHost : public BackendDataTypeConfigurer { bool delete_sync_data_folder, const std::string& restored_key_for_bootstrapping, sync_api::SyncManager::TestingMode testing_mode, - UnrecoverableErrorHandler* unrecoverable_error_handler, - ReportUnrecoverableErrorFunction report_unrecoverable_error_function); + csync::UnrecoverableErrorHandler* unrecoverable_error_handler, + csync::ReportUnrecoverableErrorFunction + report_unrecoverable_error_function); ~DoInitializeOptions(); MessageLoop* sync_loop; SyncBackendRegistrar* registrar; - ModelSafeRoutingInfo routing_info; - std::vector<ModelSafeWorker*> workers; - ExtensionsActivityMonitor* extensions_activity_monitor; - WeakHandle<JsEventHandler> event_handler; + csync::ModelSafeRoutingInfo routing_info; + std::vector<csync::ModelSafeWorker*> workers; + csync::ExtensionsActivityMonitor* extensions_activity_monitor; + csync::WeakHandle<csync::JsEventHandler> event_handler; GURL service_url; // Overridden by tests. MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; @@ -319,8 +320,8 @@ class SyncBackendHost : public BackendDataTypeConfigurer { bool delete_sync_data_folder; std::string restored_key_for_bootstrapping; sync_api::SyncManager::TestingMode testing_mode; - UnrecoverableErrorHandler* unrecoverable_error_handler; - ReportUnrecoverableErrorFunction report_unrecoverable_error_function; + csync::UnrecoverableErrorHandler* unrecoverable_error_handler; + csync::ReportUnrecoverableErrorFunction report_unrecoverable_error_function; }; // Allows tests to perform alternate core initialization work. @@ -329,7 +330,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // Called from Core::OnSyncCycleCompleted to handle updating frontend // thread components. void HandleSyncCycleCompletedOnFrontendLoop( - const sessions::SyncSessionSnapshot& snapshot); + const csync::sessions::SyncSessionSnapshot& snapshot); // Called to finish the job of ConfigureDataTypes once the syncer is in // configuration mode. @@ -396,7 +397,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // on to |frontend_|, and so that tests can intercept here if they need to // set up initial conditions. virtual void HandleInitializationCompletedOnFrontendLoop( - const WeakHandle<JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success); // Helpers to persist a token that can be used to bootstrap sync encryption @@ -410,7 +411,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // Let the front end handle the actionable error event. void HandleActionableErrorEventOnFrontendLoop( - const browser_sync::SyncProtocolError& sync_error); + const csync::SyncProtocolError& sync_error); // Checks if |passphrase| can be used to decrypt the cryptographer's pending // keys that were cached during NotifyPassphraseRequired. Returns true if @@ -453,7 +454,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // Called when configuration of the Nigori node has completed as // part of the initialization process. void HandleNigoriConfigurationCompletedOnFrontendLoop( - const WeakHandle<JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, syncable::ModelTypeSet failed_configuration_types); // Must be called on |frontend_loop_|. |done_callback| is called on @@ -512,7 +513,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { sync_pb::EncryptedData cached_pending_keys_; // UI-thread cache of the last SyncSessionSnapshot received from syncapi. - sessions::SyncSessionSnapshot last_snapshot_; + csync::sessions::SyncSessionSnapshot last_snapshot_; DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); }; diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc index fa5d33b..8a7b4e1 100644 --- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc @@ -33,7 +33,8 @@ class MockSyncFrontend : public SyncFrontend { public: virtual ~MockSyncFrontend() {} - MOCK_METHOD2(OnBackendInitialized, void(const WeakHandle<JsBackend>&, bool)); + MOCK_METHOD2(OnBackendInitialized, + void(const csync::WeakHandle<csync::JsBackend>&, bool)); MOCK_METHOD0(OnSyncCycleCompleted, void()); MOCK_METHOD1(OnConnectionStatusChange, void(sync_api::ConnectionStatus status)); @@ -49,9 +50,9 @@ class MockSyncFrontend : public SyncFrontend { MOCK_METHOD0(OnEncryptionComplete, void()); MOCK_METHOD1(OnMigrationNeededForTypes, void(syncable::ModelTypeSet)); MOCK_METHOD1(OnExperimentsChanged, - void(const browser_sync::Experiments&)); + void(const csync::Experiments&)); MOCK_METHOD1(OnActionableError, - void(const browser_sync::SyncProtocolError& sync_error)); + void(const csync::SyncProtocolError& sync_error)); MOCK_METHOD0(OnSyncConfigureRetry, void()); }; @@ -103,9 +104,9 @@ TEST_F(SyncBackendHostTest, InitShutdown) { sync_api::SyncCredentials credentials; credentials.email = "user@example.com"; credentials.sync_token = "sync_token"; - browser_sync::TestUnrecoverableErrorHandler handler; + csync::TestUnrecoverableErrorHandler handler; backend.Initialize(&mock_frontend, - WeakHandle<JsEventHandler>(), + csync::WeakHandle<csync::JsEventHandler>(), GURL(k_mock_url), syncable::ModelTypeSet(), credentials, diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc index 409bac1..aaf3d9d 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar.cc +++ b/chrome/browser/sync/glue/sync_backend_registrar.cc @@ -28,23 +28,23 @@ namespace { // Returns true if the current thread is the native thread for the // given group (or if it is undeterminable). -bool IsOnThreadForGroup(ModelSafeGroup group) { +bool IsOnThreadForGroup(csync::ModelSafeGroup group) { switch (group) { - case GROUP_PASSIVE: + case csync::GROUP_PASSIVE: return false; - case GROUP_UI: + case csync::GROUP_UI: return BrowserThread::CurrentlyOn(BrowserThread::UI); - case GROUP_DB: + case csync::GROUP_DB: return BrowserThread::CurrentlyOn(BrowserThread::DB); - case GROUP_FILE: + case csync::GROUP_FILE: return BrowserThread::CurrentlyOn(BrowserThread::FILE); - case GROUP_HISTORY: + case csync::GROUP_HISTORY: // TODO(ncarter): How to determine this? return true; - case GROUP_PASSWORD: + case csync::GROUP_PASSWORD: // TODO(ncarter): How to determine this? return true; - case MODEL_SAFE_GROUP_COUNT: + case csync::MODEL_SAFE_GROUP_COUNT: default: return false; } @@ -64,10 +64,10 @@ SyncBackendRegistrar::SyncBackendRegistrar( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CHECK(profile_); DCHECK(sync_loop_); - workers_[GROUP_DB] = new DatabaseModelWorker(); - workers_[GROUP_FILE] = new FileModelWorker(); - workers_[GROUP_UI] = ui_worker_; - workers_[GROUP_PASSIVE] = new PassiveModelWorker(sync_loop_); + workers_[csync::GROUP_DB] = new DatabaseModelWorker(); + workers_[csync::GROUP_FILE] = new FileModelWorker(); + workers_[csync::GROUP_UI] = ui_worker_; + workers_[csync::GROUP_PASSIVE] = new csync::PassiveModelWorker(sync_loop_); // Any datatypes that we want the syncer to pull down must be in the // routing_info map. We set them to group passive, meaning that @@ -75,13 +75,13 @@ SyncBackendRegistrar::SyncBackendRegistrar( // models. for (syncable::ModelTypeSet::Iterator it = initial_types.First(); it.Good(); it.Inc()) { - routing_info_[it.Get()] = GROUP_PASSIVE; + routing_info_[it.Get()] = csync::GROUP_PASSIVE; } HistoryService* history_service = profile->GetHistoryService( Profile::IMPLICIT_ACCESS); if (history_service) { - workers_[GROUP_HISTORY] = new HistoryModelWorker(history_service); + workers_[csync::GROUP_HISTORY] = new HistoryModelWorker(history_service); } else { LOG_IF(WARNING, initial_types.Has(syncable::TYPED_URLS)) << "History store disabled, cannot sync Omnibox History"; @@ -91,7 +91,7 @@ SyncBackendRegistrar::SyncBackendRegistrar( scoped_refptr<PasswordStore> password_store = PasswordStoreFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); if (password_store.get()) { - workers_[GROUP_PASSWORD] = new PasswordModelWorker(password_store); + workers_[csync::GROUP_PASSWORD] = new PasswordModelWorker(password_store); } else { LOG_IF(WARNING, initial_types.Has(syncable::PASSWORDS)) << "Password store not initialized, cannot sync passwords"; @@ -116,11 +116,11 @@ syncable::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(Intersection(types_to_add, types_to_remove).Empty()); syncable::ModelTypeSet filtered_types_to_add = types_to_add; - if (workers_.count(GROUP_HISTORY) == 0) { + if (workers_.count(csync::GROUP_HISTORY) == 0) { LOG(WARNING) << "No history worker -- removing TYPED_URLS"; filtered_types_to_add.Remove(syncable::TYPED_URLS); } - if (workers_.count(GROUP_PASSWORD) == 0) { + if (workers_.count(csync::GROUP_PASSWORD) == 0) { LOG(WARNING) << "No password worker -- removing PASSWORDS"; filtered_types_to_add.Remove(syncable::PASSWORDS); } @@ -130,10 +130,10 @@ syncable::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes( for (syncable::ModelTypeSet::Iterator it = filtered_types_to_add.First(); it.Good(); it.Inc()) { - // Add a newly specified data type as GROUP_PASSIVE into the + // Add a newly specified data type as csync::GROUP_PASSIVE into the // routing_info, if it does not already exist. if (routing_info_.count(it.Get()) == 0) { - routing_info_[it.Get()] = GROUP_PASSIVE; + routing_info_[it.Get()] = csync::GROUP_PASSIVE; newly_added_types.Put(it.Get()); } } @@ -150,7 +150,7 @@ syncable::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes( << ") and removing types " << syncable::ModelTypeSetToString(types_to_remove) << " to get new routing info " - << ModelSafeRoutingInfoToString(routing_info_); + <<csync::ModelSafeRoutingInfoToString(routing_info_); return newly_added_types; } @@ -169,15 +169,15 @@ void SyncBackendRegistrar::OnSyncerShutdownComplete() { void SyncBackendRegistrar::ActivateDataType( syncable::ModelType type, - ModelSafeGroup group, + csync::ModelSafeGroup group, ChangeProcessor* change_processor, sync_api::UserShare* user_share) { CHECK(IsOnThreadForGroup(group)); base::AutoLock lock(lock_); // Ensure that the given data type is in the PASSIVE group. - ModelSafeRoutingInfo::iterator i = routing_info_.find(type); + csync::ModelSafeRoutingInfo::iterator i = routing_info_.find(type); DCHECK(i != routing_info_.end()); - DCHECK_EQ(i->second, GROUP_PASSIVE); + DCHECK_EQ(i->second, csync::GROUP_PASSIVE); routing_info_[type] = group; CHECK(IsCurrentThreadSafeForModel(type)); @@ -232,7 +232,7 @@ void SyncBackendRegistrar::OnChangesComplete( } void SyncBackendRegistrar::GetWorkers( - std::vector<ModelSafeWorker*>* out) { + std::vector<csync::ModelSafeWorker*>* out) { base::AutoLock lock(lock_); out->clear(); for (WorkerMap::const_iterator it = workers_.begin(); @@ -242,9 +242,9 @@ void SyncBackendRegistrar::GetWorkers( } void SyncBackendRegistrar::GetModelSafeRoutingInfo( - ModelSafeRoutingInfo* out) { + csync::ModelSafeRoutingInfo* out) { base::AutoLock lock(lock_); - ModelSafeRoutingInfo copy(routing_info_); + csync::ModelSafeRoutingInfo copy(routing_info_); out->swap(copy); } @@ -256,7 +256,7 @@ ChangeProcessor* SyncBackendRegistrar::GetProcessor( return NULL; // We can only check if |processor| exists, as otherwise the type is - // mapped to GROUP_PASSIVE. + // mapped to csync::GROUP_PASSIVE. CHECK(IsCurrentThreadSafeForModel(type)); CHECK(processor->IsRunning()); return processor; diff --git a/chrome/browser/sync/glue/sync_backend_registrar.h b/chrome/browser/sync/glue/sync_backend_registrar.h index b9c82c9..11c171d 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar.h +++ b/chrome/browser/sync/glue/sync_backend_registrar.h @@ -79,7 +79,7 @@ class SyncBackendRegistrar : public sync_api::SyncManager::ChangeDelegate { // group) and starts the given change processor. Must be called // from |group|'s native thread. void ActivateDataType(syncable::ModelType type, - ModelSafeGroup group, + csync::ModelSafeGroup group, ChangeProcessor* change_processor, sync_api::UserShare* user_share); @@ -100,12 +100,12 @@ class SyncBackendRegistrar : public sync_api::SyncManager::ChangeDelegate { const sync_api::ImmutableChangeRecordList& changes) OVERRIDE; virtual void OnChangesComplete(syncable::ModelType model_type) OVERRIDE; - void GetWorkers(std::vector<ModelSafeWorker*>* out); - void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out); + void GetWorkers(std::vector<csync::ModelSafeWorker*>* out); + void GetModelSafeRoutingInfo(csync::ModelSafeRoutingInfo* out); private: - typedef std::map<ModelSafeGroup, - scoped_refptr<ModelSafeWorker> > WorkerMap; + typedef std::map<csync::ModelSafeGroup, + scoped_refptr<csync::ModelSafeWorker> > WorkerMap; // Returns the change processor for the given model, or NULL if none // exists. Must be called from |group|'s native thread. @@ -142,11 +142,11 @@ class SyncBackendRegistrar : public sync_api::SyncManager::ChangeDelegate { // destroyed. Unless a worker is no longer needed because all types // that get routed to it have been disabled (from syncing). In that // case, we'll destroy on demand *after* routing any dependent types - // to GROUP_PASSIVE, so that the syncapi doesn't call into garbage. + // to csync::GROUP_PASSIVE, so that the syncapi doesn't call into garbage. // If a key is present, it means at least one ModelType that routes // to that model safe group is being synced. WorkerMap workers_; - ModelSafeRoutingInfo routing_info_; + csync::ModelSafeRoutingInfo routing_info_; // The change processors that handle the different data types. std::map<syncable::ModelType, ChangeProcessor*> processors_; diff --git a/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc b/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc index 8c699f1..49d21f4 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc @@ -48,9 +48,10 @@ class SyncBackendRegistrarTest : public testing::Test { test_user_share_.TearDown(); } - void ExpectRoutingInfo(SyncBackendRegistrar* registrar, - const ModelSafeRoutingInfo& expected_routing_info) { - ModelSafeRoutingInfo routing_info; + void ExpectRoutingInfo( + SyncBackendRegistrar* registrar, + const csync::ModelSafeRoutingInfo& expected_routing_info) { + csync::ModelSafeRoutingInfo routing_info; registrar->GetModelSafeRoutingInfo(&routing_info); EXPECT_EQ(expected_routing_info, routing_info); } @@ -65,7 +66,7 @@ class SyncBackendRegistrarTest : public testing::Test { } MessageLoop loop_; - TestUserShare test_user_share_; + csync::TestUserShare test_user_share_; private: content::TestBrowserThread ui_thread_; @@ -76,11 +77,11 @@ TEST_F(SyncBackendRegistrarTest, ConstructorEmpty) { SyncBackendRegistrar registrar(ModelTypeSet(), "test", &profile, &loop_); EXPECT_FALSE(registrar.IsNigoriEnabled()); { - std::vector<ModelSafeWorker*> workers; + std::vector<csync::ModelSafeWorker*> workers; registrar.GetWorkers(&workers); EXPECT_EQ(4u, workers.size()); } - ExpectRoutingInfo(®istrar, ModelSafeRoutingInfo()); + ExpectRoutingInfo(®istrar, csync::ModelSafeRoutingInfo()); ExpectHasProcessorsForTypes(registrar, ModelTypeSet()); registrar.OnSyncerShutdownComplete(); registrar.StopOnUIThread(); @@ -92,14 +93,14 @@ TEST_F(SyncBackendRegistrarTest, ConstructorNonEmpty) { SyncBackendRegistrar registrar(initial_types, "test", &profile, &loop_); EXPECT_TRUE(registrar.IsNigoriEnabled()); { - std::vector<ModelSafeWorker*> workers; + std::vector<csync::ModelSafeWorker*> workers; registrar.GetWorkers(&workers); EXPECT_EQ(4u, workers.size()); } { - ModelSafeRoutingInfo expected_routing_info; - expected_routing_info[BOOKMARKS] = GROUP_PASSIVE; - expected_routing_info[NIGORI] = GROUP_PASSIVE; + csync::ModelSafeRoutingInfo expected_routing_info; + expected_routing_info[BOOKMARKS] = csync::GROUP_PASSIVE; + expected_routing_info[NIGORI] = csync::GROUP_PASSIVE; // Passwords dropped because of no password store. ExpectRoutingInfo(®istrar, expected_routing_info); } @@ -117,10 +118,10 @@ TEST_F(SyncBackendRegistrarTest, ConfigureDataTypes) { EXPECT_TRUE( registrar.ConfigureDataTypes(types1, ModelTypeSet()).Equals(types1)); { - ModelSafeRoutingInfo expected_routing_info; - expected_routing_info[BOOKMARKS] = GROUP_PASSIVE; - expected_routing_info[NIGORI] = GROUP_PASSIVE; - expected_routing_info[AUTOFILL] = GROUP_PASSIVE; + csync::ModelSafeRoutingInfo expected_routing_info; + expected_routing_info[BOOKMARKS] = csync::GROUP_PASSIVE; + expected_routing_info[NIGORI] = csync::GROUP_PASSIVE; + expected_routing_info[AUTOFILL] = csync::GROUP_PASSIVE; ExpectRoutingInfo(®istrar, expected_routing_info); } ExpectHasProcessorsForTypes(registrar, ModelTypeSet()); @@ -129,16 +130,16 @@ TEST_F(SyncBackendRegistrarTest, ConfigureDataTypes) { const ModelTypeSet types2(PREFERENCES, THEMES); EXPECT_TRUE(registrar.ConfigureDataTypes(types2, types1).Equals(types2)); { - ModelSafeRoutingInfo expected_routing_info; - expected_routing_info[PREFERENCES] = GROUP_PASSIVE; - expected_routing_info[THEMES] = GROUP_PASSIVE; + csync::ModelSafeRoutingInfo expected_routing_info; + expected_routing_info[PREFERENCES] = csync::GROUP_PASSIVE; + expected_routing_info[THEMES] = csync::GROUP_PASSIVE; ExpectRoutingInfo(®istrar, expected_routing_info); } ExpectHasProcessorsForTypes(registrar, ModelTypeSet()); // Remove. EXPECT_TRUE(registrar.ConfigureDataTypes(ModelTypeSet(), types2).Empty()); - ExpectRoutingInfo(®istrar, ModelSafeRoutingInfo()); + ExpectRoutingInfo(®istrar, csync::ModelSafeRoutingInfo()); ExpectHasProcessorsForTypes(registrar, ModelTypeSet()); registrar.OnSyncerShutdownComplete(); @@ -174,12 +175,12 @@ TEST_F(SyncBackendRegistrarTest, ActivateDeactivateUIDataType) { const ModelTypeSet types(BOOKMARKS); EXPECT_TRUE( registrar.ConfigureDataTypes(types, ModelTypeSet()).Equals(types)); - registrar.ActivateDataType(BOOKMARKS, GROUP_UI, + registrar.ActivateDataType(BOOKMARKS, csync::GROUP_UI, &change_processor_mock, test_user_share_.user_share()); { - ModelSafeRoutingInfo expected_routing_info; - expected_routing_info[BOOKMARKS] = GROUP_UI; + csync::ModelSafeRoutingInfo expected_routing_info; + expected_routing_info[BOOKMARKS] = csync::GROUP_UI; ExpectRoutingInfo(®istrar, expected_routing_info); } ExpectHasProcessorsForTypes(registrar, types); @@ -187,7 +188,7 @@ TEST_F(SyncBackendRegistrarTest, ActivateDeactivateUIDataType) { TriggerChanges(®istrar, BOOKMARKS); registrar.DeactivateDataType(BOOKMARKS); - ExpectRoutingInfo(®istrar, ModelSafeRoutingInfo()); + ExpectRoutingInfo(®istrar, csync::ModelSafeRoutingInfo()); ExpectHasProcessorsForTypes(registrar, ModelTypeSet()); // Should do nothing. @@ -221,12 +222,12 @@ TEST_F(SyncBackendRegistrarTest, ActivateDeactivateNonUIDataType) { const ModelTypeSet types(AUTOFILL); EXPECT_TRUE( registrar.ConfigureDataTypes(types, ModelTypeSet()).Equals(types)); - registrar.ActivateDataType(AUTOFILL, GROUP_DB, + registrar.ActivateDataType(AUTOFILL, csync::GROUP_DB, &change_processor_mock, test_user_share_.user_share()); { - ModelSafeRoutingInfo expected_routing_info; - expected_routing_info[AUTOFILL] = GROUP_DB; + csync::ModelSafeRoutingInfo expected_routing_info; + expected_routing_info[AUTOFILL] = csync::GROUP_DB; ExpectRoutingInfo(®istrar, expected_routing_info); } ExpectHasProcessorsForTypes(registrar, types); @@ -234,7 +235,7 @@ TEST_F(SyncBackendRegistrarTest, ActivateDeactivateNonUIDataType) { TriggerChanges(®istrar, AUTOFILL); registrar.DeactivateDataType(AUTOFILL); - ExpectRoutingInfo(®istrar, ModelSafeRoutingInfo()); + ExpectRoutingInfo(®istrar, csync::ModelSafeRoutingInfo()); ExpectHasProcessorsForTypes(registrar, ModelTypeSet()); // Should do nothing. diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc index a6fec6c..32aecb6 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.cc +++ b/chrome/browser/sync/glue/typed_url_change_processor.cc @@ -132,7 +132,7 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode( model_associator_->WriteToSyncNode(url, visit_vector, &update_node); } else if (result == sync_api::BaseNode::INIT_FAILED_DECRYPT_IF_NECESSARY) { // TODO(tim): Investigating bug 121587. - Cryptographer* crypto = trans->GetCryptographer(); + csync::Cryptographer* crypto = trans->GetCryptographer(); syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); const sync_pb::EntitySpecifics& specifics = update_node.GetEntry()->Get(syncable::SPECIFICS); diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc index e951fac..c8097b1 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc @@ -76,9 +76,9 @@ syncable::ModelType TypedUrlDataTypeController::type() const { return syncable::TYPED_URLS; } -browser_sync::ModelSafeGroup TypedUrlDataTypeController::model_safe_group() +csync::ModelSafeGroup TypedUrlDataTypeController::model_safe_group() const { - return browser_sync::GROUP_HISTORY; + return csync::GROUP_HISTORY; } void TypedUrlDataTypeController::SetBackend(history::HistoryBackend* backend) { diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.h b/chrome/browser/sync/glue/typed_url_data_type_controller.h index 411dca5..a7d4471 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.h +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.h @@ -38,7 +38,7 @@ class TypedUrlDataTypeController : public NonFrontendDataTypeController, // NonFrontendDataTypeController implementation virtual syncable::ModelType type() const OVERRIDE; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; // content::NotificationObserver implementation. virtual void Observe(int type, diff --git a/chrome/browser/sync/glue/ui_data_type_controller.cc b/chrome/browser/sync/glue/ui_data_type_controller.cc index ce2711c..cc0e1ea 100644 --- a/chrome/browser/sync/glue/ui_data_type_controller.cc +++ b/chrome/browser/sync/glue/ui_data_type_controller.cc @@ -264,9 +264,9 @@ void UIDataTypeController::StopModels() { // Do nothing by default. } -browser_sync::ModelSafeGroup UIDataTypeController::model_safe_group() const { +csync::ModelSafeGroup UIDataTypeController::model_safe_group() const { DCHECK(syncable::IsRealDataType(type_)); - return browser_sync::GROUP_UI; + return csync::GROUP_UI; } std::string UIDataTypeController::name() const { diff --git a/chrome/browser/sync/glue/ui_data_type_controller.h b/chrome/browser/sync/glue/ui_data_type_controller.h index 3c0e852..ce3d642 100644 --- a/chrome/browser/sync/glue/ui_data_type_controller.h +++ b/chrome/browser/sync/glue/ui_data_type_controller.h @@ -42,7 +42,7 @@ class UIDataTypeController : public DataTypeController { virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE; virtual void Stop() OVERRIDE; virtual syncable::ModelType type() const OVERRIDE; - virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual csync::ModelSafeGroup model_safe_group() const OVERRIDE; virtual std::string name() const OVERRIDE; virtual State state() const OVERRIDE; diff --git a/chrome/browser/sync/glue/ui_model_worker.cc b/chrome/browser/sync/glue/ui_model_worker.cc index 6102b23..0eda00f 100644 --- a/chrome/browser/sync/glue/ui_model_worker.cc +++ b/chrome/browser/sync/glue/ui_model_worker.cc @@ -19,10 +19,10 @@ namespace browser_sync { namespace { // A simple callback to signal a waitable event after running a closure. -void CallDoWorkAndSignalCallback(const WorkCallback& work, +void CallDoWorkAndSignalCallback(const csync::WorkCallback& work, base::WaitableEvent* work_done, UIModelWorker* const scheduler, - SyncerError* error_info) { + csync::SyncerError* error_info) { if (work.is_null()) { // This can happen during tests or cases where there are more than just the // default UIModelWorker in existence and it gets destroyed before @@ -76,8 +76,8 @@ void UIModelWorker::Stop() { state_ = STOPPED; } -SyncerError UIModelWorker::DoWorkAndWaitUntilDone( - const WorkCallback& work) { +csync::SyncerError UIModelWorker::DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) { // In most cases, this method is called in WORKING state. It is possible this // gets called when we are in the RUNNING_MANUAL_SHUTDOWN_PUMP state, because // the UI loop has initiated shutdown but the syncer hasn't got the memo yet. @@ -85,7 +85,7 @@ SyncerError UIModelWorker::DoWorkAndWaitUntilDone( // code handling this case in Stop(). Note there _no_ way we can be in here // with state_ = STOPPED, so it is safe to read / compare in this case. CHECK_NE(ANNOTATE_UNPROTECTED_READ(state_), STOPPED); - SyncerError error_info; + csync::SyncerError error_info; if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { DLOG(WARNING) << "DoWorkAndWaitUntilDone called from " << "ui_loop_. Probably a nested invocation?"; @@ -114,8 +114,8 @@ SyncerError UIModelWorker::DoWorkAndWaitUntilDone( return error_info; } -ModelSafeGroup UIModelWorker::GetModelSafeGroup() { - return GROUP_UI; +csync::ModelSafeGroup UIModelWorker::GetModelSafeGroup() { + return csync::GROUP_UI; } void UIModelWorker::OnSyncerShutdownComplete() { diff --git a/chrome/browser/sync/glue/ui_model_worker.h b/chrome/browser/sync/glue/ui_model_worker.h index 5a8f898..df0e0fb 100644 --- a/chrome/browser/sync/glue/ui_model_worker.h +++ b/chrome/browser/sync/glue/ui_model_worker.h @@ -17,15 +17,15 @@ class MessageLoop; namespace browser_sync { -// A ModelSafeWorker for UI models (e.g. bookmarks) that accepts work requests -// from the syncapi that need to be fulfilled from the MessageLoop home to the -// native model. +// A csync::ModelSafeWorker for UI models (e.g. bookmarks) that +// accepts work requests from the syncapi that need to be fulfilled +// from the MessageLoop home to the native model. // // Lifetime note: Instances of this class will generally be owned by the // SyncerThread. When the SyncerThread _object_ is destroyed, the // UIModelWorker will be destroyed. The SyncerThread object is destroyed // after the actual syncer pthread has exited. -class UIModelWorker : public browser_sync::ModelSafeWorker { +class UIModelWorker : public csync::ModelSafeWorker { public: UIModelWorker(); @@ -35,12 +35,12 @@ class UIModelWorker : public browser_sync::ModelSafeWorker { // processed and that syncapi will not schedule any further work for us to do. void Stop(); - // ModelSafeWorker implementation. Called on syncapi SyncerThread. - virtual SyncerError DoWorkAndWaitUntilDone( - const WorkCallback& work) OVERRIDE; - virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; + // csync::ModelSafeWorker implementation. Called on syncapi SyncerThread. + virtual csync::SyncerError DoWorkAndWaitUntilDone( + const csync::WorkCallback& work) OVERRIDE; + virtual csync::ModelSafeGroup GetModelSafeGroup() OVERRIDE; - // Upon receiving this idempotent call, the ModelSafeWorker can + // Upon receiving this idempotent call, the csync::ModelSafeWorker can // assume no work will ever be scheduled again from now on. If it has any work // that it has not yet completed, it must make sure to run it as soon as // possible as the Syncer is trying to shut down. Called from the CoreThread. diff --git a/chrome/browser/sync/glue/ui_model_worker_unittest.cc b/chrome/browser/sync/glue/ui_model_worker_unittest.cc index 914bbbf..2c89dfe 100644 --- a/chrome/browser/sync/glue/ui_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/ui_model_worker_unittest.cc @@ -15,7 +15,7 @@ #include "testing/gtest/include/gtest/gtest.h" using browser_sync::UIModelWorker; -using browser_sync::SyncerError; +using csync::SyncerError; using content::BrowserThread; // Various boilerplate, primarily for the StopWithPendingWork test. @@ -28,12 +28,12 @@ class UIModelWorkerVisitor { was_run_(was_run) { } virtual ~UIModelWorkerVisitor() { } - virtual SyncerError DoWork() { + virtual csync::SyncerError DoWork() { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); was_run_->Signal(); if (quit_loop_when_run_) MessageLoop::current()->Quit(); - return browser_sync::SYNCER_OK; + return csync::SYNCER_OK; } private: @@ -50,8 +50,8 @@ class Syncer { void SyncShare(UIModelWorkerVisitor* visitor) { // We wait until the callback is executed. So it is safe to use Unretained. - browser_sync::WorkCallback c = base::Bind(&UIModelWorkerVisitor::DoWork, - base::Unretained(visitor)); + csync::WorkCallback c = base::Bind(&UIModelWorkerVisitor::DoWork, + base::Unretained(visitor)); worker_->DoWorkAndWaitUntilDone(c); } private: diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 2784282..56e4c95 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -67,13 +67,13 @@ using browser_sync::ChangeProcessor; using browser_sync::DataTypeController; using browser_sync::DataTypeManager; -using browser_sync::JsBackend; -using browser_sync::JsController; -using browser_sync::JsEventDetails; -using browser_sync::JsEventHandler; +using csync::JsBackend; +using csync::JsController; +using csync::JsEventDetails; +using csync::JsEventHandler; using browser_sync::SyncBackendHost; -using browser_sync::SyncProtocolError; -using browser_sync::WeakHandle; +using csync::SyncProtocolError; +using csync::WeakHandle; using sync_api::SyncCredentials; typedef GoogleServiceAuthError AuthError; @@ -105,9 +105,9 @@ static bool IsTokenServiceRelevant(const std::string& service) { } bool ShouldShowActionOnUI( - const browser_sync::SyncProtocolError& error) { - return (error.action != browser_sync::UNKNOWN_ACTION && - error.action != browser_sync::DISABLE_SYNC_ON_CLIENT); + const csync::SyncProtocolError& error) { + return (error.action != csync::UNKNOWN_ACTION && + error.action != csync::DISABLE_SYNC_ON_CLIENT); } ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory, @@ -128,7 +128,7 @@ ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory, unrecoverable_error_reason_(ERROR_REASON_UNSET), weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), expect_sync_configuration_aborted_(false), - encrypted_types_(browser_sync::Cryptographer::SensitiveTypes()), + encrypted_types_(csync::Cryptographer::SensitiveTypes()), encrypt_everything_(false), encryption_pending_(false), auto_start_enabled_(start_behavior == AUTO_START), @@ -476,7 +476,7 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) { // Shutdown the migrator before the backend to ensure it doesn't pull a null // snapshot. migrator_.reset(); - sync_js_controller_.AttachJsBackend(WeakHandle<JsBackend>()); + sync_js_controller_.AttachJsBackend(WeakHandle<csync::JsBackend>()); // Move aside the backend so nobody else tries to use it while we are // shutting it down. @@ -498,7 +498,7 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) { cached_passphrase_.clear(); encryption_pending_ = false; encrypt_everything_ = false; - encrypted_types_ = browser_sync::Cryptographer::SensitiveTypes(); + encrypted_types_ = csync::Cryptographer::SensitiveTypes(); passphrase_required_reason_ = sync_api::REASON_PASSPHRASE_NOT_REQUIRED; last_auth_error_ = GoogleServiceAuthError::None(); @@ -583,7 +583,7 @@ void ProfileSyncService::RegisterNewDataType(syncable::ModelType data_type) { void ProfileSyncService::OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) { - // Unrecoverable errors that arrive via the UnrecoverableErrorHandler + // Unrecoverable errors that arrive via the csync::UnrecoverableErrorHandler // interface are assumed to originate within the syncer. unrecoverable_error_reason_ = ERROR_REASON_SYNCER; OnUnrecoverableErrorImpl(from_here, message, true); @@ -637,7 +637,7 @@ void ProfileSyncService::DisableBrokenDatatype( } void ProfileSyncService::OnBackendInitialized( - const WeakHandle<JsBackend>& js_backend, bool success) { + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) { if (!HasSyncSetupCompleted()) { UMA_HISTOGRAM_BOOLEAN("Sync.BackendInitializeFirstTimeSuccess", success); } else { @@ -706,7 +706,7 @@ void ProfileSyncService::OnSyncCycleCompleted() { } void ProfileSyncService::OnExperimentsChanged( - const browser_sync::Experiments& experiments) { + const csync::Experiments& experiments) { if (current_experiments.Matches(experiments)) return; @@ -904,12 +904,12 @@ void ProfileSyncService::OnMigrationNeededForTypes( void ProfileSyncService::OnActionableError(const SyncProtocolError& error) { last_actionable_error_ = error; DCHECK_NE(last_actionable_error_.action, - browser_sync::UNKNOWN_ACTION); + csync::UNKNOWN_ACTION); switch (error.action) { - case browser_sync::UPGRADE_CLIENT: - case browser_sync::CLEAR_USER_DATA_AND_RESYNC: - case browser_sync::ENABLE_SYNC_ON_ACCOUNT: - case browser_sync::STOP_AND_RESTART_SYNC: + case csync::UPGRADE_CLIENT: + case csync::CLEAR_USER_DATA_AND_RESYNC: + case csync::ENABLE_SYNC_ON_ACCOUNT: + case csync::STOP_AND_RESTART_SYNC: // TODO(lipalani) : if setup in progress we want to display these // actions in the popup. The current experience might not be optimal for // the user. We just dismiss the dialog. @@ -923,7 +923,7 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) { true, ERROR_REASON_ACTIONABLE_ERROR); break; - case browser_sync::DISABLE_SYNC_ON_CLIENT: + case csync::DISABLE_SYNC_ON_CLIENT: OnStopSyncingPermanently(); break; default: @@ -1076,9 +1076,9 @@ void ProfileSyncService::UpdateSelectedTypesHistogram( void ProfileSyncService::RefreshSpareBootstrapToken( const std::string& passphrase) { browser_sync::ChromeEncryptor encryptor; - browser_sync::Cryptographer temp_cryptographer(&encryptor); + csync::Cryptographer temp_cryptographer(&encryptor); // The first 2 params (hostname and username) doesn't have any effect here. - browser_sync::KeyParams key_params = {"localhost", "dummy", passphrase}; + csync::KeyParams key_params = {"localhost", "dummy", passphrase}; std::string bootstrap_token; if (!temp_cryptographer.AddKey(key_params)) { @@ -1213,13 +1213,13 @@ sync_api::UserShare* ProfileSyncService::GetUserShare() const { return NULL; } -browser_sync::sessions::SyncSessionSnapshot +csync::sessions::SyncSessionSnapshot ProfileSyncService::GetLastSessionSnapshot() const { if (backend_.get() && backend_initialized_) { return backend_->GetLastSessionSnapshot(); } NOTREACHED(); - return browser_sync::sessions::SyncSessionSnapshot(); + return csync::sessions::SyncSessionSnapshot(); } bool ProfileSyncService::HasUnsyncedItems() const { @@ -1236,7 +1236,7 @@ browser_sync::BackendMigrator* } void ProfileSyncService::GetModelSafeRoutingInfo( - browser_sync::ModelSafeRoutingInfo* out) const { + csync::ModelSafeRoutingInfo* out) const { if (backend_.get() && backend_initialized_) { backend_->GetModelSafeRoutingInfo(out); } else { @@ -1245,7 +1245,7 @@ void ProfileSyncService::GetModelSafeRoutingInfo( } void ProfileSyncService::ActivateDataType( - syncable::ModelType type, browser_sync::ModelSafeGroup group, + syncable::ModelType type, csync::ModelSafeGroup group, ChangeProcessor* change_processor) { if (!backend_.get()) { NOTREACHED(); @@ -1554,7 +1554,7 @@ bool ProfileSyncService::HasObserver(Observer* observer) const { return observers_.HasObserver(observer); } -base::WeakPtr<JsController> ProfileSyncService::GetJsController() { +base::WeakPtr<csync::JsController> ProfileSyncService::GetJsController() { return sync_js_controller_.AsWeakPtr(); } diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index d8d1eb8..56c62d4 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -147,7 +147,7 @@ class EncryptedData; // class ProfileSyncService : public browser_sync::SyncFrontend, public browser_sync::SyncPrefObserver, - public browser_sync::UnrecoverableErrorHandler, + public csync::UnrecoverableErrorHandler, public content::NotificationObserver, public ProfileKeyedService { public: @@ -254,7 +254,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // SyncFrontend implementation. virtual void OnBackendInitialized( - const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) OVERRIDE; virtual void OnSyncCycleCompleted() OVERRIDE; virtual void OnSyncConfigureRetry() OVERRIDE; @@ -272,9 +272,9 @@ class ProfileSyncService : public browser_sync::SyncFrontend, virtual void OnMigrationNeededForTypes( syncable::ModelTypeSet types) OVERRIDE; virtual void OnExperimentsChanged( - const browser_sync::Experiments& experiments) OVERRIDE; + const csync::Experiments& experiments) OVERRIDE; virtual void OnActionableError( - const browser_sync::SyncProtocolError& error) OVERRIDE; + const csync::SyncProtocolError& error) OVERRIDE; // Update the last auth error and notify observers of error state. void UpdateAuthErrorState(const GoogleServiceAuthError& error); @@ -355,7 +355,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // Returns a weak pointer to the service's JsController. // Overrideable for testing purposes. - virtual base::WeakPtr<browser_sync::JsController> GetJsController(); + virtual base::WeakPtr<csync::JsController> GetJsController(); // Record stats on various events. static void SyncEvent(SyncEventCodes code); @@ -369,7 +369,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // management. If so, the user is not allowed to configure sync. bool IsManaged() const; - // UnrecoverableErrorHandler implementation. + // csync::UnrecoverableErrorHandler implementation. virtual void OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) OVERRIDE; @@ -394,7 +394,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // ProfileSyncServiceHarness. Figure out a different way to expose // this info to that class, and remove these functions. - virtual browser_sync::sessions::SyncSessionSnapshot + virtual csync::sessions::SyncSessionSnapshot GetLastSessionSnapshot() const; // Returns whether or not the underlying sync engine has made any @@ -414,12 +414,12 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // classes. Figure out a different way to expose this info and // remove this function. void GetModelSafeRoutingInfo( - browser_sync::ModelSafeRoutingInfo* out) const; + csync::ModelSafeRoutingInfo* out) const; // Overridden by tests. // TODO(zea): Remove these and have the dtc's call directly into the SBH. virtual void ActivateDataType( - syncable::ModelType type, browser_sync::ModelSafeGroup group, + syncable::ModelType type, csync::ModelSafeGroup group, browser_sync::ChangeProcessor* change_processor); virtual void DeactivateDataType(syncable::ModelType type); @@ -728,7 +728,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, ObserverList<Observer> observers_; - browser_sync::SyncJsController sync_js_controller_; + csync::SyncJsController sync_js_controller_; content::NotificationRegistrar registrar_; @@ -746,7 +746,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, std::string cached_passphrase_; // The current set of encrypted types. Always a superset of - // Cryptographer::SensitiveTypes(). + // csync::Cryptographer::SensitiveTypes(). syncable::ModelTypeSet encrypted_types_; // Whether we want to encrypt everything. @@ -767,7 +767,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // This is the last |SyncProtocolError| we received from the server that had // an action set on it. - browser_sync::SyncProtocolError last_actionable_error_; + csync::SyncProtocolError last_actionable_error_; // This is used to show sync errors in the wrench menu. scoped_ptr<SyncGlobalError> sync_global_error_; @@ -785,13 +785,13 @@ class ProfileSyncService : public browser_sync::SyncFrontend, bool setup_in_progress_; // The set of currently enabled sync experiments. - browser_sync::Experiments current_experiments; + csync::Experiments current_experiments; DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); }; bool ShouldShowActionOnUI( - const browser_sync::SyncProtocolError& error); + const csync::SyncProtocolError& error); #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc index d3b421a..ca8a3d5 100644 --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc @@ -119,7 +119,7 @@ class TestBookmarkModelAssociator : public BookmarkModelAssociator { // Create new fake tagged nodes at the end of the ordering. node.InitByCreation(type, root, predecessor); node.SetIsFolder(true); - node.entry_->Put(syncable::UNIQUE_SERVER_TAG, tag); + node.GetMutableEntryForTest()->Put(syncable::UNIQUE_SERVER_TAG, tag); node.SetTitle(UTF8ToWide(tag_str)); node.SetExternalId(0); *sync_id = node.GetId(); @@ -128,7 +128,7 @@ class TestBookmarkModelAssociator : public BookmarkModelAssociator { private: sync_api::UserShare* user_share_; - browser_sync::TestIdFactory id_factory_; + csync::TestIdFactory id_factory_; }; namespace { @@ -554,7 +554,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { protected: BookmarkModel* model_; - TestUserShare test_user_share_; + csync::TestUserShare test_user_share_; scoped_ptr<BookmarkChangeProcessor> change_processor_; StrictMock<DataTypeErrorHandlerMock> mock_error_handler_; }; diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc index 130172c..39f0749 100644 --- a/chrome/browser/sync/profile_sync_service_harness.cc +++ b/chrome/browser/sync/profile_sync_service_harness.cc @@ -28,7 +28,7 @@ #include "chrome/common/chrome_switches.h" #include "sync/internal_api/public/sessions/sync_session_snapshot.h" -using browser_sync::sessions::SyncSessionSnapshot; +using csync::sessions::SyncSessionSnapshot; // TODO(rsimha): Remove the following lines once crbug.com/91863 is fixed. // The amount of time for which we wait for a live sync operation to complete. @@ -399,7 +399,7 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() { case WAITING_FOR_ACTIONABLE_ERROR: { DVLOG(1) << GetClientInfoString("WAITING_FOR_ACTIONABLE_ERROR"); ProfileSyncService::Status status = GetStatus(); - if (status.sync_protocol_error.action != browser_sync::UNKNOWN_ACTION && + if (status.sync_protocol_error.action != csync::UNKNOWN_ACTION && service_->HasUnrecoverableError() == true) { // An actionable error has been detected. SignalStateCompleteWithNextState(WAITING_FOR_NOTHING); @@ -597,12 +597,12 @@ bool ProfileSyncServiceHarness::AwaitExponentialBackoffVerification() { bool ProfileSyncServiceHarness::AwaitActionableError() { ProfileSyncService::Status status = GetStatus(); - CHECK(status.sync_protocol_error.action == browser_sync::UNKNOWN_ACTION); + CHECK(status.sync_protocol_error.action == csync::UNKNOWN_ACTION); wait_state_ = WAITING_FOR_ACTIONABLE_ERROR; AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, "Waiting for actionable error"); status = GetStatus(); - return (status.sync_protocol_error.action != browser_sync::UNKNOWN_ACTION && + return (status.sync_protocol_error.action != csync::UNKNOWN_ACTION && service_->HasUnrecoverableError()); } @@ -796,7 +796,7 @@ bool ProfileSyncServiceHarness::IsFullySynced() { // good chance that we're now fully up to date. bool is_fully_synced = snap.syncer_status().num_successful_commits == 0 - && snap.errors().commit_result == browser_sync::SYNCER_OK + && snap.errors().commit_result == csync::SYNCER_OK && IsDataSyncedImpl(snap); DVLOG(1) << GetClientInfoString( @@ -1002,7 +1002,7 @@ std::string ProfileSyncServiceHarness::GetClientInfoString( << (service()->sync_initialized() ? service()->HasUnsyncedItems() : 0) << ", did_commit: " << (snap.syncer_status().num_successful_commits == 0 - && snap.errors().commit_result == browser_sync::SYNCER_OK) + && snap.errors().commit_result == csync::SYNCER_OK) << ", encryption conflicts: " << snap.num_encryption_conflicts() << ", hierarchy conflicts: " diff --git a/chrome/browser/sync/profile_sync_service_harness.h b/chrome/browser/sync/profile_sync_service_harness.h index 6857228..88ebd06 100644 --- a/chrome/browser/sync/profile_sync_service_harness.h +++ b/chrome/browser/sync/profile_sync_service_harness.h @@ -161,7 +161,7 @@ class ProfileSyncServiceHarness bool DisableSyncForAllDatatypes(); // Returns a snapshot of the current sync session. - browser_sync::sessions::SyncSessionSnapshot GetLastSessionSnapshot() const; + csync::sessions::SyncSessionSnapshot GetLastSessionSnapshot() const; // Encrypt the datatype |type|. This method will block while the sync backend // host performs the encryption or a timeout is reached. @@ -290,7 +290,7 @@ class ProfileSyncServiceHarness // A helper for implementing IsDataSynced() and IsFullySynced(). bool IsDataSyncedImpl( - const browser_sync::sessions::SyncSessionSnapshot& snapshot); + const csync::sessions::SyncSessionSnapshot& snapshot); // Returns true if the sync client has no unsynced items. bool IsDataSynced(); diff --git a/chrome/browser/sync/profile_sync_service_mock.h b/chrome/browser/sync/profile_sync_service_mock.h index 981917d..ec8556d 100644 --- a/chrome/browser/sync/profile_sync_service_mock.h +++ b/chrome/browser/sync/profile_sync_service_mock.h @@ -36,7 +36,7 @@ class ProfileSyncServiceMock : public ProfileSyncService { MOCK_METHOD0(DisableForUser, void()); MOCK_METHOD2(OnBackendInitialized, - void(const browser_sync::WeakHandle<browser_sync::JsBackend>&, + void(const csync::WeakHandle<csync::JsBackend>&, bool)); MOCK_METHOD0(OnSyncCycleCompleted, void()); MOCK_METHOD0(OnAuthError, void()); @@ -59,14 +59,14 @@ class ProfileSyncServiceMock : public ProfileSyncService { std::string message)); MOCK_CONST_METHOD0(GetUserShare, sync_api::UserShare*()); MOCK_METHOD3(ActivateDataType, - void(syncable::ModelType, browser_sync::ModelSafeGroup, + void(syncable::ModelType, csync::ModelSafeGroup, browser_sync::ChangeProcessor*)); MOCK_METHOD1(DeactivateDataType, void(syncable::ModelType)); MOCK_METHOD0(InitializeBackend, void()); MOCK_METHOD1(AddObserver, void(Observer*)); MOCK_METHOD1(RemoveObserver, void(Observer*)); - MOCK_METHOD0(GetJsController, base::WeakPtr<browser_sync::JsController>()); + MOCK_METHOD0(GetJsController, base::WeakPtr<csync::JsController>()); MOCK_CONST_METHOD0(HasSyncSetupCompleted, bool()); MOCK_CONST_METHOD0(EncryptEverythingEnabled, bool()); @@ -77,7 +77,7 @@ class ProfileSyncServiceMock : public ProfileSyncService { MOCK_CONST_METHOD0(GetPreferredDataTypes, syncable::ModelTypeSet()); MOCK_CONST_METHOD0(GetRegisteredDataTypes, syncable::ModelTypeSet()); MOCK_CONST_METHOD0(GetLastSessionSnapshot, - browser_sync::sessions::SyncSessionSnapshot()); + csync::sessions::SyncSessionSnapshot()); MOCK_METHOD0(QueryDetailedSyncStatus, browser_sync::SyncBackendHost::Status()); @@ -88,7 +88,7 @@ class ProfileSyncServiceMock : public ProfileSyncService { MOCK_CONST_METHOD0(sync_initialized, bool()); MOCK_CONST_METHOD0(waiting_for_auth, bool()); MOCK_METHOD1(OnActionableError, void( - const browser_sync::SyncProtocolError&)); + const csync::SyncProtocolError&)); MOCK_METHOD0(IsSyncEnabledAndLoggedIn, bool()); MOCK_METHOD0(IsSyncTokenAvailable, bool()); diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc index bedaccc..0f2ff4c 100644 --- a/chrome/browser/sync/profile_sync_service_session_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc @@ -58,7 +58,7 @@ using content::BrowserThread; using sync_api::ChangeRecord; using testing::_; using testing::Return; -using browser_sync::TestIdFactory; +using csync::TestIdFactory; namespace browser_sync { diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc index be6a202..cf3bb78 100644 --- a/chrome/browser/sync/profile_sync_service_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_unittest.cc @@ -245,8 +245,8 @@ TEST_F(ProfileSyncServiceTest, JsControllerHandlersBasic) { EXPECT_TRUE(service_->sync_initialized()); EXPECT_TRUE(service_->GetBackendForTest() != NULL); - JsController* js_controller = service_->GetJsController(); - StrictMock<MockJsEventHandler> event_handler; + csync::JsController* js_controller = service_->GetJsController(); + StrictMock<csync::MockJsEventHandler> event_handler; js_controller->AddJsEventHandler(&event_handler); js_controller->RemoveJsEventHandler(&event_handler); } @@ -255,13 +255,13 @@ TEST_F(ProfileSyncServiceTest, JsControllerHandlersDelayedBackendInitialization) { StartSyncServiceAndSetInitialSyncEnded(true, false, false, true, true, false); - StrictMock<MockJsEventHandler> event_handler; + StrictMock<csync::MockJsEventHandler> event_handler; EXPECT_CALL(event_handler, HandleJsEvent(_, _)).Times(AtLeast(1)); EXPECT_EQ(NULL, service_->GetBackendForTest()); EXPECT_FALSE(service_->sync_initialized()); - JsController* js_controller = service_->GetJsController(); + csync::JsController* js_controller = service_->GetJsController(); js_controller->AddJsEventHandler(&event_handler); // Since we're doing synchronous initialization, backend should be // initialized by this call. @@ -273,16 +273,16 @@ TEST_F(ProfileSyncServiceTest, TEST_F(ProfileSyncServiceTest, JsControllerProcessJsMessageBasic) { StartSyncService(); - StrictMock<MockJsReplyHandler> reply_handler; + StrictMock<csync::MockJsReplyHandler> reply_handler; ListValue arg_list1; arg_list1.Append(Value::CreateBooleanValue(false)); - JsArgList args1(&arg_list1); + csync::JsArgList args1(&arg_list1); EXPECT_CALL(reply_handler, HandleJsReply("getNotificationState", HasArgs(args1))); { - JsController* js_controller = service_->GetJsController(); + csync::JsController* js_controller = service_->GetJsController(); js_controller->ProcessJsMessage("getNotificationState", args1, reply_handler.AsWeakHandle()); } @@ -296,16 +296,16 @@ TEST_F(ProfileSyncServiceTest, JsControllerProcessJsMessageBasicDelayedBackendInitialization) { StartSyncServiceAndSetInitialSyncEnded(true, false, false, true, true, false); - StrictMock<MockJsReplyHandler> reply_handler; + StrictMock<csync::MockJsReplyHandler> reply_handler; ListValue arg_list1; arg_list1.Append(Value::CreateBooleanValue(false)); - JsArgList args1(&arg_list1); + csync::JsArgList args1(&arg_list1); EXPECT_CALL(reply_handler, HandleJsReply("getNotificationState", HasArgs(args1))); { - JsController* js_controller = service_->GetJsController(); + csync::JsController* js_controller = service_->GetJsController(); js_controller->ProcessJsMessage("getNotificationState", args1, reply_handler.AsWeakHandle()); } diff --git a/chrome/browser/sync/retry_verifier.cc b/chrome/browser/sync/retry_verifier.cc index cc3c11a..fa4a8d9 100644 --- a/chrome/browser/sync/retry_verifier.cc +++ b/chrome/browser/sync/retry_verifier.cc @@ -17,18 +17,18 @@ namespace { // the next retry. DelayInfo CalculateDelay(int64 current_delay) { int64 backoff_s = std::max(static_cast<int64>(1), current_delay * - browser_sync::kBackoffRandomizationFactor); + csync::kBackoffRandomizationFactor); DelayInfo delay_info; delay_info.min_delay = backoff_s + (-1 * current_delay/ - browser_sync::kBackoffRandomizationFactor); + csync::kBackoffRandomizationFactor); delay_info.max_delay = backoff_s + current_delay/2; delay_info.min_delay = std::max(static_cast<int64>(1), - std::min(delay_info.min_delay, browser_sync::kMaxBackoffSeconds)); + std::min(delay_info.min_delay, csync::kMaxBackoffSeconds)); delay_info.max_delay = std::max(static_cast<int64>(1), - std::min(delay_info.max_delay, browser_sync::kMaxBackoffSeconds)); + std::min(delay_info.max_delay, csync::kMaxBackoffSeconds)); return delay_info; } @@ -79,7 +79,7 @@ RetryVerifier::~RetryVerifier() { // Initializes the state for verification. void RetryVerifier::Initialize( - const browser_sync::sessions::SyncSessionSnapshot& snap) { + const csync::sessions::SyncSessionSnapshot& snap) { retry_count_ = 0; last_sync_time_ = snap.sync_start_time(); FillDelayTable(delay_table_, kMaxRetry); @@ -88,7 +88,7 @@ void RetryVerifier::Initialize( } void RetryVerifier::VerifyRetryInterval( - const browser_sync::sessions::SyncSessionSnapshot& snap) { + const csync::sessions::SyncSessionSnapshot& snap) { DCHECK(retry_count_ < kMaxRetry); if (retry_count_ == 0) { if (snap.sync_start_time() != last_sync_time_) { diff --git a/chrome/browser/sync/retry_verifier.h b/chrome/browser/sync/retry_verifier.h index 95023e2..ebd1897 100644 --- a/chrome/browser/sync/retry_verifier.h +++ b/chrome/browser/sync/retry_verifier.h @@ -8,11 +8,13 @@ #include "base/time.h" -namespace browser_sync { - +namespace csync { namespace sessions { class SyncSessionSnapshot; } // namespace sessions +} // namespace csync + +namespace browser_sync { // The minimum and maximum wait times for a retry. The actual retry would take // place somewhere in this range. The algorithm that calculates the retry wait @@ -32,9 +34,9 @@ class RetryVerifier { // Initialize with the current sync session snapshot. Using the snapshot // we will figure out when the first retry sync happened. - void Initialize(const browser_sync::sessions::SyncSessionSnapshot& snap); + void Initialize(const csync::sessions::SyncSessionSnapshot& snap); void VerifyRetryInterval( - const browser_sync::sessions::SyncSessionSnapshot& snap); + const csync::sessions::SyncSessionSnapshot& snap); bool done() const { return done_; } bool Succeeded() const { return done() && success_; } diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index 8ab7a62..8f3b79b 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc @@ -166,24 +166,24 @@ string16 GetSyncedStateStatusLabel(ProfileSyncService* service, } void GetStatusForActionableError( - const browser_sync::SyncProtocolError& error, + const csync::SyncProtocolError& error, string16* status_label) { DCHECK(status_label); switch (error.action) { - case browser_sync::STOP_AND_RESTART_SYNC: + case csync::STOP_AND_RESTART_SYNC: status_label->assign( l10n_util::GetStringUTF16(IDS_SYNC_STOP_AND_RESTART_SYNC)); break; - case browser_sync::UPGRADE_CLIENT: + case csync::UPGRADE_CLIENT: status_label->assign( l10n_util::GetStringFUTF16(IDS_SYNC_UPGRADE_CLIENT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); break; - case browser_sync::ENABLE_SYNC_ON_ACCOUNT: + case csync::ENABLE_SYNC_ON_ACCOUNT: status_label->assign( l10n_util::GetStringUTF16(IDS_SYNC_ENABLE_SYNC_ON_ACCOUNT)); break; - case browser_sync::CLEAR_USER_DATA_AND_RESYNC: + case csync::CLEAR_USER_DATA_AND_RESYNC: status_label->assign( l10n_util::GetStringUTF16(IDS_SYNC_CLEAR_USER_DATA)); break; @@ -532,10 +532,10 @@ void ConstructAboutInformation(ProfileSyncService* service, // the values from a single sync cycle. // // |snapshot| could be NULL if sync is not yet initialized. - const browser_sync::sessions::SyncSessionSnapshot& snapshot = + const csync::sessions::SyncSessionSnapshot& snapshot = service->sync_initialized() ? service->GetLastSessionSnapshot() : - browser_sync::sessions::SyncSessionSnapshot(); + csync::sessions::SyncSessionSnapshot(); sync_ui_util::AddStringSyncDetails(sync_summary, "Summary", service->QuerySyncStatusSummary()); @@ -611,7 +611,7 @@ void ConstructAboutInformation(ProfileSyncService* service, details, "Status from Last Completed Session"); sync_ui_util::AddStringSyncDetails( cycles, "Sync Source", - browser_sync::GetUpdatesSourceString( + csync::GetUpdatesSourceString( snapshot.source().updates_source)); sync_ui_util::AddStringSyncDetails( cycles, "Download Step Result", @@ -715,18 +715,18 @@ void ConstructAboutInformation(ProfileSyncService* service, // Now set the actionable errors. if ((full_status.sync_protocol_error.error_type != - browser_sync::UNKNOWN_ERROR) && + csync::UNKNOWN_ERROR) && (full_status.sync_protocol_error.error_type != - browser_sync::SYNC_SUCCESS)) { + csync::SYNC_SUCCESS)) { strings->Set("actionable_error_detected", base::Value::CreateBooleanValue(true)); ListValue* actionable_error = new ListValue(); strings->Set("actionable_error", actionable_error); sync_ui_util::AddStringSyncDetails(actionable_error, "Error Type", - browser_sync::GetSyncErrorTypeString( + csync::GetSyncErrorTypeString( full_status.sync_protocol_error.error_type)); sync_ui_util::AddStringSyncDetails(actionable_error, "Action", - browser_sync::GetClientActionString( + csync::GetClientActionString( full_status.sync_protocol_error.action)); sync_ui_util::AddStringSyncDetails(actionable_error, "url", full_status.sync_protocol_error.url); @@ -758,15 +758,15 @@ void ConstructAboutInformation(ProfileSyncService* service, strings->SetString("unrecoverable_error_message", unrecoverable_error_message); } else if (service->sync_initialized()) { - browser_sync::ModelSafeRoutingInfo routes; + csync::ModelSafeRoutingInfo routes; service->GetModelSafeRoutingInfo(&routes); ListValue* routing_info = new ListValue(); strings->Set("routing_info", routing_info); - browser_sync::ModelSafeRoutingInfo::const_iterator it = routes.begin(); + csync::ModelSafeRoutingInfo::const_iterator it = routes.begin(); for (; it != routes.end(); ++it) { DictionaryValue* val = new DictionaryValue; val->SetString("model_type", ModelTypeToString(it->first)); - val->SetString("group", ModelSafeGroupToString(it->second)); + val->SetString("group", csync::ModelSafeGroupToString(it->second)); routing_info->Append(val); } } diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc index d97366e..10a3976 100644 --- a/chrome/browser/sync/sync_ui_util_unittest.cc +++ b/chrome/browser/sync/sync_ui_util_unittest.cc @@ -257,8 +257,8 @@ void GetDistinctCase(ProfileSyncServiceMock& service, case STATUS_CASE_PROTOCOL_ERROR: { EXPECT_CALL(service, HasSyncSetupCompleted()) .WillOnce(Return(true)); - browser_sync::SyncProtocolError protocolError; - protocolError.action = browser_sync::STOP_AND_RESTART_SYNC; + csync::SyncProtocolError protocolError; + protocolError.action = csync::STOP_AND_RESTART_SYNC; browser_sync::SyncBackendHost::Status status; status.sync_protocol_error = protocolError; EXPECT_CALL(service, QueryDetailedSyncStatus()) diff --git a/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc index 58b3d76..8eef468 100644 --- a/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc @@ -23,10 +23,10 @@ static const int kNumUrls = 163; // This compile assert basically asserts that kNumUrls is right in the // middle between two multiples of kDefaultMaxCommitBatchSize. COMPILE_ASSERT( - ((kNumUrls % browser_sync::kDefaultMaxCommitBatchSize) >= - (browser_sync::kDefaultMaxCommitBatchSize / 2)) && - ((kNumUrls % browser_sync::kDefaultMaxCommitBatchSize) <= - ((browser_sync::kDefaultMaxCommitBatchSize + 1) / 2)), + ((kNumUrls % csync::kDefaultMaxCommitBatchSize) >= + (csync::kDefaultMaxCommitBatchSize / 2)) && + ((kNumUrls % csync::kDefaultMaxCommitBatchSize) <= + ((csync::kDefaultMaxCommitBatchSize + 1) / 2)), kNumUrlsShouldBeBetweenTwoMultiplesOfkDefaultMaxCommitBatchSize); class TypedUrlsSyncPerfTest : public SyncTest { diff --git a/chrome/browser/sync/test/integration/sync_errors_test.cc b/chrome/browser/sync/test/integration/sync_errors_test.cc index b83ac90..5317549 100644 --- a/chrome/browser/sync/test/integration/sync_errors_test.cc +++ b/chrome/browser/sync/test/integration/sync_errors_test.cc @@ -61,9 +61,9 @@ IN_PROC_BROWSER_TEST_F(SyncErrorTest, ActionableErrorTest) { SetTitle(0, node1, L"new_title1"); ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync.")); - browser_sync::SyncProtocolError protocol_error; - protocol_error.error_type = browser_sync::TRANSIENT_ERROR; - protocol_error.action = browser_sync::UPGRADE_CLIENT; + csync::SyncProtocolError protocol_error; + protocol_error.error_type = csync::TRANSIENT_ERROR; + protocol_error.action = csync::UPGRADE_CLIENT; protocol_error.error_description = "Not My Fault"; protocol_error.url = "www.google.com"; TriggerSyncError(protocol_error, SyncTest::ERROR_FREQUENCY_ALWAYS); @@ -84,8 +84,8 @@ IN_PROC_BROWSER_TEST_F(SyncErrorTest, ActionableErrorTest) { IN_PROC_BROWSER_TEST_F(SyncErrorTest, ErrorWhileSettingUp) { ASSERT_TRUE(SetupClients()); - browser_sync::SyncProtocolError protocol_error; - protocol_error.error_type = browser_sync::TRANSIENT_ERROR; + csync::SyncProtocolError protocol_error; + protocol_error.error_type = csync::TRANSIENT_ERROR; protocol_error.error_description = "Not My Fault"; protocol_error.url = "www.google.com"; @@ -120,9 +120,9 @@ IN_PROC_BROWSER_TEST_F(SyncErrorTest, SetTitle(0, node1, L"new_title1"); ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync.")); - browser_sync::SyncProtocolError protocol_error; - protocol_error.error_type = browser_sync::NOT_MY_BIRTHDAY; - protocol_error.action = browser_sync::DISABLE_SYNC_ON_CLIENT; + csync::SyncProtocolError protocol_error; + protocol_error.error_type = csync::NOT_MY_BIRTHDAY; + protocol_error.action = csync::DISABLE_SYNC_ON_CLIENT; protocol_error.error_description = "Not My Fault"; protocol_error.url = "www.google.com"; TriggerSyncError(protocol_error, SyncTest::ERROR_FREQUENCY_ALWAYS); diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index f8665cc..594cd20 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -704,21 +704,21 @@ namespace { sync_pb::SyncEnums::ErrorType GetClientToServerResponseErrorType( - browser_sync::SyncProtocolErrorType error) { + csync::SyncProtocolErrorType error) { switch (error) { - case browser_sync::SYNC_SUCCESS: + case csync::SYNC_SUCCESS: return sync_pb::SyncEnums::SUCCESS; - case browser_sync::NOT_MY_BIRTHDAY: + case csync::NOT_MY_BIRTHDAY: return sync_pb::SyncEnums::NOT_MY_BIRTHDAY; - case browser_sync::THROTTLED: + case csync::THROTTLED: return sync_pb::SyncEnums::THROTTLED; - case browser_sync::CLEAR_PENDING: + case csync::CLEAR_PENDING: return sync_pb::SyncEnums::CLEAR_PENDING; - case browser_sync::TRANSIENT_ERROR: + case csync::TRANSIENT_ERROR: return sync_pb::SyncEnums::TRANSIENT_ERROR; - case browser_sync::MIGRATION_DONE: + case csync::MIGRATION_DONE: return sync_pb::SyncEnums::MIGRATION_DONE; - case browser_sync::UNKNOWN_ERROR: + case csync::UNKNOWN_ERROR: return sync_pb::SyncEnums::UNKNOWN; default: NOTREACHED(); @@ -727,19 +727,19 @@ sync_pb::SyncEnums::ErrorType } sync_pb::SyncEnums::Action GetClientToServerResponseAction( - const browser_sync::ClientAction& action) { + const csync::ClientAction& action) { switch (action) { - case browser_sync::UPGRADE_CLIENT: + case csync::UPGRADE_CLIENT: return sync_pb::SyncEnums::UPGRADE_CLIENT; - case browser_sync::CLEAR_USER_DATA_AND_RESYNC: + case csync::CLEAR_USER_DATA_AND_RESYNC: return sync_pb::SyncEnums::CLEAR_USER_DATA_AND_RESYNC; - case browser_sync::ENABLE_SYNC_ON_ACCOUNT: + case csync::ENABLE_SYNC_ON_ACCOUNT: return sync_pb::SyncEnums::ENABLE_SYNC_ON_ACCOUNT; - case browser_sync::STOP_AND_RESTART_SYNC: + case csync::STOP_AND_RESTART_SYNC: return sync_pb::SyncEnums::STOP_AND_RESTART_SYNC; - case browser_sync::DISABLE_SYNC_ON_CLIENT: + case csync::DISABLE_SYNC_ON_CLIENT: return sync_pb::SyncEnums::DISABLE_SYNC_ON_CLIENT; - case browser_sync::UNKNOWN_ACTION: + case csync::UNKNOWN_ACTION: return sync_pb::SyncEnums::UNKNOWN_ACTION; default: NOTREACHED(); @@ -749,7 +749,7 @@ sync_pb::SyncEnums::Action GetClientToServerResponseAction( } // namespace -void SyncTest::TriggerSyncError(const browser_sync::SyncProtocolError& error, +void SyncTest::TriggerSyncError(const csync::SyncProtocolError& error, SyncErrorFrequency frequency) { ASSERT_TRUE(ServerSupportsErrorTriggering()); std::string path = "chromiumsync/error"; diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h index bb61b35..be961bb 100644 --- a/chrome/browser/sync/test/integration/sync_test.h +++ b/chrome/browser/sync/test/integration/sync_test.h @@ -198,7 +198,7 @@ class SyncTest : public InProcessBrowserTest { // Triggers a sync error on the server. // error: The error the server is expected to return. // frequency: Frequency with which the error is returned. - void TriggerSyncError(const browser_sync::SyncProtocolError& error, + void TriggerSyncError(const csync::SyncProtocolError& error, SyncErrorFrequency frequency); // Triggers the creation the Synced Bookmarks folder on the server. diff --git a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc index 38d128e..f454a1f 100644 --- a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc @@ -245,12 +245,12 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, ASSERT_TRUE(GetClient(1)->AwaitFullSyncCompletion("Initial sync.")); // Following ensures types are enabled and active (see bug 87572). - browser_sync::ModelSafeRoutingInfo routes; + csync::ModelSafeRoutingInfo routes; GetClient(0)->service()->GetModelSafeRoutingInfo(&routes); - ASSERT_EQ(browser_sync::GROUP_PASSWORD, routes[syncable::PASSWORDS]); + ASSERT_EQ(csync::GROUP_PASSWORD, routes[syncable::PASSWORDS]); routes.clear(); GetClient(1)->service()->GetModelSafeRoutingInfo(&routes); - ASSERT_EQ(browser_sync::GROUP_PASSWORD, routes[syncable::PASSWORDS]); + ASSERT_EQ(csync::GROUP_PASSWORD, routes[syncable::PASSWORDS]); } IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index d916409..ddb3094 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -17,11 +17,11 @@ #include "sync/protocol/encryption.pb.h" #include "sync/syncable/directory.h" -using browser_sync::ModelSafeRoutingInfo; -using browser_sync::sessions::ErrorCounters; -using browser_sync::sessions::SyncSessionSnapshot; -using browser_sync::sessions::SyncSourceInfo; -using browser_sync::sessions::SyncerStatus; +using csync::ModelSafeRoutingInfo; +using csync::sessions::ErrorCounters; +using csync::sessions::SyncSessionSnapshot; +using csync::sessions::SyncSourceInfo; +using csync::sessions::SyncerStatus; using sync_api::UserShare; using syncable::Directory; @@ -108,7 +108,7 @@ void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( } // namespace browser_sync -browser_sync::TestIdFactory* TestProfileSyncService::id_factory() { +csync::TestIdFactory* TestProfileSyncService::id_factory() { return &id_factory_; } @@ -154,7 +154,7 @@ void TestProfileSyncService::SetInitialSyncEndedForAllTypes() { } void TestProfileSyncService::OnBackendInitialized( - const browser_sync::WeakHandle<browser_sync::JsBackend>& backend, + const csync::WeakHandle<csync::JsBackend>& backend, bool success) { bool send_passphrase_required = false; if (success) { diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h index 1227e5f..a6650e4 100644 --- a/chrome/browser/sync/test_profile_sync_service.h +++ b/chrome/browser/sync/test_profile_sync_service.h @@ -82,7 +82,7 @@ class TestProfileSyncService : public ProfileSyncService { void SetInitialSyncEndedForAllTypes(); virtual void OnBackendInitialized( - const browser_sync::WeakHandle<browser_sync::JsBackend>& backend, + const csync::WeakHandle<csync::JsBackend>& backend, bool success) OVERRIDE; virtual void Observe(int type, @@ -97,7 +97,7 @@ class TestProfileSyncService : public ProfileSyncService { void fail_initial_download(); void set_use_real_database(); - browser_sync::TestIdFactory* id_factory(); + csync::TestIdFactory* id_factory(); // Override of ProfileSyncService::GetBackendForTest() with a more // specific return type (since C++ supports covariant return types) @@ -109,7 +109,7 @@ class TestProfileSyncService : public ProfileSyncService { virtual void CreateBackend() OVERRIDE; private: - browser_sync::TestIdFactory id_factory_; + csync::TestIdFactory id_factory_; bool synchronous_backend_initialization_; diff --git a/chrome/browser/ui/webui/sync_internals_ui.cc b/chrome/browser/ui/webui/sync_internals_ui.cc index 95717c9..d1b2404 100644 --- a/chrome/browser/ui/webui/sync_internals_ui.cc +++ b/chrome/browser/ui/webui/sync_internals_ui.cc @@ -29,10 +29,10 @@ #include "sync/js/js_event_details.h" #include "ui/base/resource/resource_bundle.h" -using browser_sync::JsArgList; -using browser_sync::JsEventDetails; -using browser_sync::JsReplyHandler; -using browser_sync::WeakHandle; +using csync::JsArgList; +using csync::JsEventDetails; +using csync::JsReplyHandler; +using csync::WeakHandle; using content::WebContents; namespace { diff --git a/chrome/browser/ui/webui/sync_internals_ui.h b/chrome/browser/ui/webui/sync_internals_ui.h index 549396f..24f22f3 100644 --- a/chrome/browser/ui/webui/sync_internals_ui.h +++ b/chrome/browser/ui/webui/sync_internals_ui.h @@ -15,14 +15,14 @@ #include "sync/js/js_event_handler.h" #include "sync/js/js_reply_handler.h" -namespace browser_sync { +namespace csync { class JsController; -} // namespace browser_sync +} // namespace csync // The implementation for the chrome://sync-internals page. class SyncInternalsUI : public content::WebUIController, - public browser_sync::JsEventHandler, - public browser_sync::JsReplyHandler { + public csync::JsEventHandler, + public csync::JsReplyHandler { public: explicit SyncInternalsUI(content::WebUI* web_ui); virtual ~SyncInternalsUI(); @@ -44,19 +44,19 @@ class SyncInternalsUI : public content::WebUIController, const std::string& name, const base::ListValue& args) OVERRIDE; - // browser_sync::JsEventHandler implementation. + // csync::JsEventHandler implementation. virtual void HandleJsEvent( const std::string& name, - const browser_sync::JsEventDetails& details) OVERRIDE; + const csync::JsEventDetails& details) OVERRIDE; - // browser_sync::JsReplyHandler implementation. + // csync::JsReplyHandler implementation. virtual void HandleJsReply( const std::string& name, - const browser_sync::JsArgList& args) OVERRIDE; + const csync::JsArgList& args) OVERRIDE; private: base::WeakPtrFactory<SyncInternalsUI> weak_ptr_factory_; - base::WeakPtr<browser_sync::JsController> js_controller_; + base::WeakPtr<csync::JsController> js_controller_; DISALLOW_COPY_AND_ASSIGN(SyncInternalsUI); }; diff --git a/chrome/browser/ui/webui/sync_internals_ui_unittest.cc b/chrome/browser/ui/webui/sync_internals_ui_unittest.cc index ab0bdaa..cc0010e 100644 --- a/chrome/browser/ui/webui/sync_internals_ui_unittest.cc +++ b/chrome/browser/ui/webui/sync_internals_ui_unittest.cc @@ -31,8 +31,8 @@ namespace { using browser_sync::HasArgsAsList; -using browser_sync::JsArgList; -using browser_sync::JsEventDetails; +using csync::JsArgList; +using csync::JsEventDetails; using content::BrowserThread; using content::WebContents; using testing::_; diff --git a/sync/api/sync_change_unittest.cc b/sync/api/sync_change_unittest.cc index 263abdd..edde073 100644 --- a/sync/api/sync_change_unittest.cc +++ b/sync/api/sync_change_unittest.cc @@ -13,7 +13,7 @@ #include "sync/protocol/sync.pb.h" #include "testing/gtest/include/gtest/gtest.h" -using browser_sync::EntitySpecificsToValue; +using csync::EntitySpecificsToValue; // Ordered list of SyncChange's. typedef std::vector<SyncChange> SyncChangeList; diff --git a/sync/api/sync_data.cc b/sync/api/sync_data.cc index a5a1738..d573b3f 100644 --- a/sync/api/sync_data.cc +++ b/sync/api/sync_data.cc @@ -120,7 +120,7 @@ std::string SyncData::ToString() const { std::string type = syncable::ModelTypeToString(GetDataType()); std::string specifics; scoped_ptr<DictionaryValue> value( - browser_sync::EntitySpecificsToValue(GetSpecifics())); + csync::EntitySpecificsToValue(GetSpecifics())); base::JSONWriter::WriteWithOptions(value.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &specifics); diff --git a/sync/api/sync_data.h b/sync/api/sync_data.h index d6a51ba..974df9b 100644 --- a/sync/api/sync_data.h +++ b/sync/api/sync_data.h @@ -98,7 +98,7 @@ class SyncData { static void Swap(sync_pb::SyncEntity* t1, sync_pb::SyncEntity* t2); }; - typedef browser_sync::Immutable< + typedef csync::Immutable< sync_pb::SyncEntity, ImmutableSyncEntityTraits> ImmutableSyncEntity; diff --git a/sync/engine/all_status.cc b/sync/engine/all_status.cc index cf170f0c1..63a7d0f 100644 --- a/sync/engine/all_status.cc +++ b/sync/engine/all_status.cc @@ -12,7 +12,7 @@ #include "sync/internal_api/public/syncable/model_type.h" #include "sync/sessions/session_state.h" -namespace browser_sync { +namespace csync { AllStatus::AllStatus() { status_.initial_sync_ended = true; @@ -166,4 +166,4 @@ ScopedStatusLock::~ScopedStatusLock() { allstatus_->mutex_.Release(); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/all_status.h b/sync/engine/all_status.h index 68f41f4..93125cd 100644 --- a/sync/engine/all_status.h +++ b/sync/engine/all_status.h @@ -19,7 +19,7 @@ #include "sync/internal_api/public/engine/sync_status.h" #include "sync/internal_api/public/syncable/model_type.h" -namespace browser_sync { +namespace csync { class ScopedStatusLock; struct ServerConnectionEvent; @@ -77,6 +77,6 @@ class ScopedStatusLock { AllStatus* allstatus_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_ALL_STATUS_H_ diff --git a/sync/engine/apply_updates_command.cc b/sync/engine/apply_updates_command.cc index 35490c3..fd18ff2 100644 --- a/sync/engine/apply_updates_command.cc +++ b/sync/engine/apply_updates_command.cc @@ -11,7 +11,7 @@ #include "sync/syncable/read_transaction.h" #include "sync/syncable/write_transaction.h" -namespace browser_sync { +namespace csync { using sessions::SyncSession; @@ -85,4 +85,4 @@ SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( return SYNCER_OK; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/apply_updates_command.h b/sync/engine/apply_updates_command.h index 4282dc1..b6885c3 100644 --- a/sync/engine/apply_updates_command.h +++ b/sync/engine/apply_updates_command.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "sync/engine/model_changing_syncer_command.h" -namespace browser_sync { +namespace csync { class ApplyUpdatesCommand : public ModelChangingSyncerCommand { public: @@ -27,6 +27,6 @@ class ApplyUpdatesCommand : public ModelChangingSyncerCommand { DISALLOW_COPY_AND_ASSIGN(ApplyUpdatesCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_APPLY_UPDATES_COMMAND_H_ diff --git a/sync/engine/apply_updates_command_unittest.cc b/sync/engine/apply_updates_command_unittest.cc index e60c15f..517e7f2 100644 --- a/sync/engine/apply_updates_command_unittest.cc +++ b/sync/engine/apply_updates_command_unittest.cc @@ -25,7 +25,7 @@ #include "sync/util/cryptographer.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { using sessions::SyncSession; using std::string; @@ -531,7 +531,7 @@ TEST_F(ApplyUpdatesCommandTest, DecryptablePassword) { cryptographer = directory()->GetCryptographer(&trans); } - browser_sync::KeyParams params = {"localhost", "dummy", "foobar"}; + csync::KeyParams params = {"localhost", "dummy", "foobar"}; cryptographer->AddKey(params); sync_pb::EntitySpecifics specifics; @@ -1005,4 +1005,4 @@ TEST_F(ApplyUpdatesCommandTest, CannotEncryptUnsyncedChanges) { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/build_commit_command.cc b/sync/engine/build_commit_command.cc index 665613a..c83bd69 100644 --- a/sync/engine/build_commit_command.cc +++ b/sync/engine/build_commit_command.cc @@ -33,7 +33,7 @@ using syncable::MutableEntry; using syncable::SPECIFICS; using syncable::UNSPECIFIED; -namespace browser_sync { +namespace csync { using sessions::SyncSession; @@ -261,4 +261,4 @@ int64 BuildCommitCommand::InterpolatePosition(const int64 lo, } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/build_commit_command.h b/sync/engine/build_commit_command.h index bdcefe1..53bafd7 100644 --- a/sync/engine/build_commit_command.h +++ b/sync/engine/build_commit_command.h @@ -17,7 +17,7 @@ namespace syncable { class Entry; } -namespace browser_sync { +namespace csync { namespace sessions { class OrderedCommitSet; @@ -74,6 +74,6 @@ class BuildCommitCommand : public SyncerCommand { ClientToServerMessage* commit_message_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_BUILD_COMMIT_COMMAND_H_ diff --git a/sync/engine/build_commit_command_unittest.cc b/sync/engine/build_commit_command_unittest.cc index 6263615..f92bcd0 100644 --- a/sync/engine/build_commit_command_unittest.cc +++ b/sync/engine/build_commit_command_unittest.cc @@ -5,7 +5,7 @@ #include "sync/engine/build_commit_command.h" #include "sync/test/engine/syncer_command_test.h" -namespace browser_sync { +namespace csync { // A test fixture for tests exercising ClearDataCommandTest. class BuildCommitCommandTest : public SyncerCommandTest { @@ -102,6 +102,6 @@ TEST_F(BuildCommitCommandTest, InterpolatePosition) { command_.InterpolatePosition(0, BuildCommitCommand::GetGap()*2 + 1)); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/cleanup_disabled_types_command.cc b/sync/engine/cleanup_disabled_types_command.cc index 1a94663..953dc6c 100644 --- a/sync/engine/cleanup_disabled_types_command.cc +++ b/sync/engine/cleanup_disabled_types_command.cc @@ -11,7 +11,7 @@ #include "sync/sessions/sync_session_context.h" #include "sync/syncable/directory.h" -namespace browser_sync { +namespace csync { CleanupDisabledTypesCommand::CleanupDisabledTypesCommand() {} CleanupDisabledTypesCommand::~CleanupDisabledTypesCommand() {} @@ -66,5 +66,5 @@ SyncerError CleanupDisabledTypesCommand::ExecuteImpl( return SYNCER_OK; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/cleanup_disabled_types_command.h b/sync/engine/cleanup_disabled_types_command.h index c855814..45ec01d 100644 --- a/sync/engine/cleanup_disabled_types_command.h +++ b/sync/engine/cleanup_disabled_types_command.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "sync/engine/syncer_command.h" -namespace browser_sync { +namespace csync { // A syncer command that purges (from memory and disk) entries belonging to // a ModelType or ServerModelType that the user has not elected to sync. @@ -40,7 +40,7 @@ class CleanupDisabledTypesCommand : public SyncerCommand { DISALLOW_COPY_AND_ASSIGN(CleanupDisabledTypesCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_CLEANUP_DISABLED_TYPES_COMMAND_H_ diff --git a/sync/engine/cleanup_disabled_types_command_unittest.cc b/sync/engine/cleanup_disabled_types_command_unittest.cc index 665c68c..d386136 100644 --- a/sync/engine/cleanup_disabled_types_command_unittest.cc +++ b/sync/engine/cleanup_disabled_types_command_unittest.cc @@ -12,7 +12,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { @@ -74,4 +74,4 @@ TEST_F(CleanupDisabledTypesCommandTest, TypeDisabled) { } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/commit.cc b/sync/engine/commit.cc index abef162..7cff6cb 100644 --- a/sync/engine/commit.cc +++ b/sync/engine/commit.cc @@ -16,7 +16,7 @@ using syncable::SYNCER; using syncable::WriteTransaction; -namespace browser_sync { +namespace csync { using sessions::SyncSession; using sessions::StatusController; @@ -152,4 +152,4 @@ SyncerError BuildAndPostCommits(Syncer* syncer, return result; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/commit.h b/sync/engine/commit.h index f03ceb0..5e8e0fa 100644 --- a/sync/engine/commit.h +++ b/sync/engine/commit.h @@ -8,7 +8,7 @@ #include "sync/internal_api/public/util/syncer_error.h" -namespace browser_sync { +namespace csync { namespace sessions { class SyncSession; @@ -32,6 +32,6 @@ SyncerError BuildAndPostCommits( Syncer* syncer, sessions::SyncSession* session); -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_COMMIT_H_ diff --git a/sync/engine/conflict_resolver.cc b/sync/engine/conflict_resolver.cc index d775c1d..156bc90 100644 --- a/sync/engine/conflict_resolver.cc +++ b/sync/engine/conflict_resolver.cc @@ -32,7 +32,7 @@ using syncable::IsRealDataType; using syncable::MutableEntry; using syncable::WriteTransaction; -namespace browser_sync { +namespace csync { using sessions::ConflictProgress; using sessions::StatusController; @@ -417,4 +417,4 @@ bool ConflictResolver::ResolveConflicts(syncable::WriteTransaction* trans, return forward_progress; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/conflict_resolver.h b/sync/engine/conflict_resolver.h index d2d89d0..fedaa45 100644 --- a/sync/engine/conflict_resolver.h +++ b/sync/engine/conflict_resolver.h @@ -24,7 +24,7 @@ class MutableEntry; class WriteTransaction; } // namespace syncable -namespace browser_sync { +namespace csync { class Cryptographer; @@ -84,6 +84,6 @@ class ConflictResolver { DISALLOW_COPY_AND_ASSIGN(ConflictResolver); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_CONFLICT_RESOLVER_H_ diff --git a/sync/engine/download_updates_command.cc b/sync/engine/download_updates_command.cc index cc8cf4e..fb74f3d 100644 --- a/sync/engine/download_updates_command.cc +++ b/sync/engine/download_updates_command.cc @@ -15,7 +15,7 @@ using sync_pb::DebugInfo; -namespace browser_sync { +namespace csync { using sessions::StatusController; using sessions::SyncSession; using std::string; @@ -127,4 +127,4 @@ void DownloadUpdatesCommand::AppendClientDebugInfoIfNeeded( } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/download_updates_command.h b/sync/engine/download_updates_command.h index 5eddcce..527844e 100644 --- a/sync/engine/download_updates_command.h +++ b/sync/engine/download_updates_command.h @@ -18,7 +18,7 @@ namespace sync_pb { class EntitySpecifics; } -namespace browser_sync { +namespace csync { // Determine the enabled datatypes, download a batch of updates for them // from the server, place the result in the SyncSession for further processing. @@ -59,7 +59,7 @@ class DownloadUpdatesCommand : public SyncerCommand { DISALLOW_COPY_AND_ASSIGN(DownloadUpdatesCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_DOWNLOAD_UPDATES_COMMAND_H_ diff --git a/sync/engine/download_updates_command_unittest.cc b/sync/engine/download_updates_command_unittest.cc index 9a6c280..9a9739f 100644 --- a/sync/engine/download_updates_command_unittest.cc +++ b/sync/engine/download_updates_command_unittest.cc @@ -11,7 +11,7 @@ #include "sync/test/engine/syncer_command_test.h" using ::testing::_; -namespace browser_sync { +namespace csync { using syncable::FIRST_REAL_MODEL_TYPE; using syncable::MODEL_TYPE_COUNT; @@ -71,4 +71,4 @@ TEST_F(DownloadUpdatesCommandTest, VerifyAppendDebugInfo) { command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/get_commit_ids_command.cc b/sync/engine/get_commit_ids_command.cc index 6936cc7..d3264f2 100644 --- a/sync/engine/get_commit_ids_command.cc +++ b/sync/engine/get_commit_ids_command.cc @@ -19,7 +19,7 @@ using std::set; using std::vector; -namespace browser_sync { +namespace csync { using sessions::OrderedCommitSet; using sessions::SyncSession; @@ -432,4 +432,4 @@ void GetCommitIdsCommand::BuildCommitIds( AddDeletes(write_transaction, ready_unsynced_set); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/get_commit_ids_command.h b/sync/engine/get_commit_ids_command.h index 3e18f60..5d9117f 100644 --- a/sync/engine/get_commit_ids_command.h +++ b/sync/engine/get_commit_ids_command.h @@ -19,7 +19,7 @@ using std::pair; using std::vector; -namespace browser_sync { +namespace csync { // A class that contains the code used to search the syncable::Directory for // locally modified items that are ready to be committed to the server. @@ -135,6 +135,6 @@ class GetCommitIdsCommand : public SyncerCommand { DISALLOW_COPY_AND_ASSIGN(GetCommitIdsCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ diff --git a/sync/engine/model_changing_syncer_command.cc b/sync/engine/model_changing_syncer_command.cc index f6da0f3..08340a4 100644 --- a/sync/engine/model_changing_syncer_command.cc +++ b/sync/engine/model_changing_syncer_command.cc @@ -10,7 +10,7 @@ #include "sync/sessions/status_controller.h" #include "sync/sessions/sync_session.h" -namespace browser_sync { +namespace csync { SyncerError ModelChangingSyncerCommand::ExecuteImpl( sessions::SyncSession* session) { @@ -48,4 +48,4 @@ SyncerError ModelChangingSyncerCommand::ExecuteImpl( return result; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/model_changing_syncer_command.h b/sync/engine/model_changing_syncer_command.h index fba8d11..44f045a 100644 --- a/sync/engine/model_changing_syncer_command.h +++ b/sync/engine/model_changing_syncer_command.h @@ -10,7 +10,7 @@ #include "sync/engine/syncer_command.h" #include "sync/internal_api/public/engine/model_safe_worker.h" -namespace browser_sync { +namespace csync { namespace sessions { class SyncSession; } @@ -31,7 +31,7 @@ class ModelChangingSyncerCommand : public SyncerCommand { virtual ~ModelChangingSyncerCommand() { } // SyncerCommand implementation. Sets work_session to session. - virtual browser_sync::SyncerError ExecuteImpl( + virtual csync::SyncerError ExecuteImpl( sessions::SyncSession* session) OVERRIDE; // Wrapper so implementations don't worry about storing work_session. @@ -72,6 +72,6 @@ class ModelChangingSyncerCommand : public SyncerCommand { DISALLOW_COPY_AND_ASSIGN(ModelChangingSyncerCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_ diff --git a/sync/engine/model_changing_syncer_command_unittest.cc b/sync/engine/model_changing_syncer_command_unittest.cc index 1f1d93d..16e8dab 100644 --- a/sync/engine/model_changing_syncer_command_unittest.cc +++ b/sync/engine/model_changing_syncer_command_unittest.cc @@ -12,7 +12,7 @@ #include "sync/test/engine/syncer_command_test.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { @@ -74,4 +74,4 @@ TEST_F(ModelChangingSyncerCommandTest, Basic) { } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/net/server_connection_manager.cc b/sync/engine/net/server_connection_manager.cc index 5ffd6a7..92f083e 100644 --- a/sync/engine/net/server_connection_manager.cc +++ b/sync/engine/net/server_connection_manager.cc @@ -20,7 +20,7 @@ #include "sync/protocol/sync.pb.h" #include "sync/syncable/directory.h" -namespace browser_sync { +namespace csync { using std::ostream; using std::string; @@ -332,4 +332,4 @@ std::ostream& operator << (std::ostream& s, const struct HttpResponse& hr) { return s; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/net/server_connection_manager.h b/sync/engine/net/server_connection_manager.h index e6e18da..4083ba2 100644 --- a/sync/engine/net/server_connection_manager.h +++ b/sync/engine/net/server_connection_manager.h @@ -26,7 +26,7 @@ namespace sync_pb { class ClientToServerMessage; } -namespace browser_sync { +namespace csync { static const int32 kUnsetResponseCode = -1; static const int32 kUnsetContentLength = -1; @@ -354,6 +354,6 @@ bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, std::ostream& operator<<(std::ostream& s, const struct HttpResponse& hr); -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ diff --git a/sync/engine/net/url_translator.cc b/sync/engine/net/url_translator.cc index 4602bda..3c18794 100644 --- a/sync/engine/net/url_translator.cc +++ b/sync/engine/net/url_translator.cc @@ -13,7 +13,7 @@ using std::string; -namespace browser_sync { +namespace csync { namespace { // Parameters that the server understands. (here, a-Z) @@ -54,4 +54,4 @@ string MakeSyncQueryString(const string& client_id) { return query; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/net/url_translator.h b/sync/engine/net/url_translator.h index 65b7346..1842380 100644 --- a/sync/engine/net/url_translator.h +++ b/sync/engine/net/url_translator.h @@ -11,7 +11,7 @@ #include <string> -namespace browser_sync { +namespace csync { // Convenience wrappers around CgiEscapePath(), used by gaia_auth. std::string CgiEscapeString(const char* src); @@ -23,6 +23,6 @@ std::string MakeSyncServerPath(const std::string& path, std::string MakeSyncQueryString(const std::string& client_id); -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_NET_URL_TRANSLATOR_H_ diff --git a/sync/engine/nigori_util.cc b/sync/engine/nigori_util.cc index 0b34a02..765cf0a 100644 --- a/sync/engine/nigori_util.cc +++ b/sync/engine/nigori_util.cc @@ -20,7 +20,7 @@ namespace syncable { bool ProcessUnsyncedChangesForEncryption( WriteTransaction* const trans, - browser_sync::Cryptographer* cryptographer) { + csync::Cryptographer* cryptographer) { DCHECK(cryptographer->is_ready()); // Get list of all datatypes with unsynced changes. It's possible that our // local changes need to be encrypted if encryption for that datatype was @@ -29,7 +29,7 @@ bool ProcessUnsyncedChangesForEncryption( // changes in this code path are likely due to consistency issues (we have // to be updated to a key we already have, e.g. an old key). std::vector<int64> handles; - browser_sync::SyncerUtil::GetUnsyncedEntries(trans, &handles); + csync::SyncerUtil::GetUnsyncedEntries(trans, &handles); for (size_t i = 0; i < handles.size(); ++i) { MutableEntry entry(trans, GET_BY_HANDLE, handles[i]); const sync_pb::EntitySpecifics& specifics = entry.Get(SPECIFICS); @@ -51,7 +51,7 @@ bool VerifyUnsyncedChangesAreEncrypted( BaseTransaction* const trans, ModelTypeSet encrypted_types) { std::vector<int64> handles; - browser_sync::SyncerUtil::GetUnsyncedEntries(trans, &handles); + csync::SyncerUtil::GetUnsyncedEntries(trans, &handles); for (size_t i = 0; i < handles.size(); ++i) { Entry entry(trans, GET_BY_HANDLE, handles[i]); if (!entry.good()) { @@ -92,7 +92,7 @@ bool SpecificsNeedsEncryption(ModelTypeSet encrypted_types, // Mainly for testing. bool VerifyDataTypeEncryptionForTest( BaseTransaction* const trans, - browser_sync::Cryptographer* cryptographer, + csync::Cryptographer* cryptographer, ModelType type, bool is_encrypted) { if (type == PASSWORDS || type == NIGORI) { @@ -156,7 +156,7 @@ bool VerifyDataTypeEncryptionForTest( } bool UpdateEntryWithEncryption( - browser_sync::Cryptographer* cryptographer, + csync::Cryptographer* cryptographer, const sync_pb::EntitySpecifics& new_specifics, syncable::MutableEntry* entry) { syncable::ModelType type = syncable::GetModelTypeFromSpecifics(new_specifics); diff --git a/sync/engine/nigori_util.h b/sync/engine/nigori_util.h index 2adcc9f..5e5c20a 100644 --- a/sync/engine/nigori_util.h +++ b/sync/engine/nigori_util.h @@ -12,7 +12,7 @@ #include "sync/internal_api/public/syncable/model_type.h" #include "sync/protocol/nigori_specifics.pb.h" -namespace browser_sync { +namespace csync { class Cryptographer; } @@ -43,7 +43,7 @@ bool VerifyUnsyncedChangesAreEncrypted( // or unencrypted, based on |encrypted_types|. bool ProcessUnsyncedChangesForEncryption( WriteTransaction* const trans, - browser_sync::Cryptographer* cryptographer); + csync::Cryptographer* cryptographer); // Returns true if the entry requires encryption but is not encrypted, false // otherwise. Note: this does not check that already encrypted entries are @@ -58,7 +58,7 @@ bool SpecificsNeedsEncryption(ModelTypeSet encrypted_types, // Verifies all data of type |type| is encrypted appropriately. bool VerifyDataTypeEncryptionForTest( BaseTransaction* const trans, - browser_sync::Cryptographer* cryptographer, + csync::Cryptographer* cryptographer, ModelType type, bool is_encrypted) WARN_UNUSED_RESULT; @@ -66,7 +66,7 @@ bool VerifyDataTypeEncryptionForTest( // Returns false if an error encrypting occurred (does not modify |entry|). // Note: gracefully handles new_specifics aliasing with entry->Get(SPECIFICS). bool UpdateEntryWithEncryption( - browser_sync::Cryptographer* cryptographer, + csync::Cryptographer* cryptographer, const sync_pb::EntitySpecifics& new_specifics, MutableEntry* entry); diff --git a/sync/engine/nudge_source.cc b/sync/engine/nudge_source.cc index 50cd7eb..1020fbf 100644 --- a/sync/engine/nudge_source.cc +++ b/sync/engine/nudge_source.cc @@ -6,7 +6,7 @@ #include "base/logging.h" -namespace browser_sync { +namespace csync { #define ENUM_CASE(x) case x: return #x; break @@ -24,4 +24,4 @@ const char* GetNudgeSourceString(NudgeSource nudge_source) { #undef ENUM_CASE -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/nudge_source.h b/sync/engine/nudge_source.h index f3488f4..a842915 100644 --- a/sync/engine/nudge_source.h +++ b/sync/engine/nudge_source.h @@ -6,7 +6,7 @@ #define SYNC_ENGINE_NUDGE_SOURCE_H_ #pragma once -namespace browser_sync { +namespace csync { enum NudgeSource { NUDGE_SOURCE_UNKNOWN = 0, @@ -22,6 +22,6 @@ enum NudgeSource { const char* GetNudgeSourceString(NudgeSource nudge_source); -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_NUDGE_SOURCE_H_ diff --git a/sync/engine/process_commit_response_command.cc b/sync/engine/process_commit_response_command.cc index fbfe941..2a01a30 100644 --- a/sync/engine/process_commit_response_command.cc +++ b/sync/engine/process_commit_response_command.cc @@ -45,7 +45,7 @@ using syncable::SERVER_VERSION; using syncable::SYNCER; using syncable::SYNCING; -namespace browser_sync { +namespace csync { using sessions::OrderedCommitSet; using sessions::StatusController; @@ -477,4 +477,4 @@ void ProcessCommitResponseCommand::ProcessSuccessfulCommitResponse( } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/process_commit_response_command.h b/sync/engine/process_commit_response_command.h index b17809f..98de2f2 100644 --- a/sync/engine/process_commit_response_command.h +++ b/sync/engine/process_commit_response_command.h @@ -21,7 +21,7 @@ class MutableEntry; class Directory; } -namespace browser_sync { +namespace csync { namespace sessions { class OrderedCommitSet; @@ -131,6 +131,6 @@ class ProcessCommitResponseCommand : public ModelChangingSyncerCommand { DISALLOW_COPY_AND_ASSIGN(ProcessCommitResponseCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ diff --git a/sync/engine/process_commit_response_command_unittest.cc b/sync/engine/process_commit_response_command_unittest.cc index bd1b661..0646070 100644 --- a/sync/engine/process_commit_response_command_unittest.cc +++ b/sync/engine/process_commit_response_command_unittest.cc @@ -21,7 +21,7 @@ #include "sync/test/engine/test_id_factory.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { using sessions::SyncSession; using std::string; @@ -119,8 +119,8 @@ class ProcessCommitResponseCommandTest : public SyncerCommandTest { const string& name, syncable::ModelType model_type, sessions::OrderedCommitSet *commit_set, - browser_sync::ClientToServerMessage *commit, - browser_sync::ClientToServerResponse *response) { + csync::ClientToServerMessage *commit, + csync::ClientToServerResponse *response) { bool is_folder = true; int64 metahandle = 0; CreateUnsyncedItem(item_id, parent_id, name, is_folder, model_type, @@ -191,8 +191,8 @@ class ProcessCommitResponseCommandTest : public SyncerCommandTest { TEST_F(ProcessCommitResponseCommandTest, MultipleCommitIdProjections) { sessions::OrderedCommitSet commit_set(session()->routing_info()); - browser_sync::ClientToServerMessage request; - browser_sync::ClientToServerResponse response; + csync::ClientToServerMessage request; + csync::ClientToServerResponse response; Id bookmark_folder_id = id_factory_.NewLocalId(); Id bookmark_id1 = id_factory_.NewLocalId(); @@ -275,8 +275,8 @@ TEST_F(ProcessCommitResponseCommandTest, MultipleCommitIdProjections) { // of the children. TEST_F(ProcessCommitResponseCommandTest, NewFolderCommitKeepsChildOrder) { sessions::OrderedCommitSet commit_set(session()->routing_info()); - browser_sync::ClientToServerMessage request; - browser_sync::ClientToServerResponse response; + csync::ClientToServerMessage request; + csync::ClientToServerResponse response; // Create the parent folder, a new item whose ID will change on commit. Id folder_id = id_factory_.NewLocalId(); @@ -403,8 +403,8 @@ INSTANTIATE_TEST_CASE_P(ProcessCommitResponse, // depending on the test parameter. TEST_P(MixedResult, ExtensionActivity) { sessions::OrderedCommitSet commit_set(session()->routing_info()); - browser_sync::ClientToServerMessage request; - browser_sync::ClientToServerResponse response; + csync::ClientToServerMessage request; + csync::ClientToServerResponse response; EXPECT_NE(routing_info().find(syncable::BOOKMARKS)->second, routing_info().find(syncable::AUTOFILL)->second) @@ -452,4 +452,4 @@ TEST_P(MixedResult, ExtensionActivity) { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/process_updates_command.cc b/sync/engine/process_updates_command.cc index a7073a5..003c59f 100644 --- a/sync/engine/process_updates_command.cc +++ b/sync/engine/process_updates_command.cc @@ -21,7 +21,7 @@ using std::vector; -namespace browser_sync { +namespace csync { using sessions::SyncSession; using sessions::StatusController; @@ -182,4 +182,4 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate( return SUCCESS_PROCESSED; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/process_updates_command.h b/sync/engine/process_updates_command.h index f5f430f..262d5b7 100644 --- a/sync/engine/process_updates_command.h +++ b/sync/engine/process_updates_command.h @@ -18,7 +18,7 @@ namespace sync_pb { class SyncEntity; } -namespace browser_sync { +namespace csync { class Cryptographer; @@ -50,6 +50,6 @@ class ProcessUpdatesCommand : public ModelChangingSyncerCommand { DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ diff --git a/sync/engine/process_updates_command_unittest.cc b/sync/engine/process_updates_command_unittest.cc index 448daea..a8e8ca3 100644 --- a/sync/engine/process_updates_command_unittest.cc +++ b/sync/engine/process_updates_command_unittest.cc @@ -13,7 +13,7 @@ #include "sync/test/engine/syncer_command_test.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { @@ -49,4 +49,4 @@ TEST_F(ProcessUpdatesCommandTest, GetGroupsToChange) { } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/resolve_conflicts_command.cc b/sync/engine/resolve_conflicts_command.cc index bac365f..edef3ff 100644 --- a/sync/engine/resolve_conflicts_command.cc +++ b/sync/engine/resolve_conflicts_command.cc @@ -10,7 +10,7 @@ #include "sync/syncable/directory.h" #include "sync/syncable/write_transaction.h" -namespace browser_sync { +namespace csync { ResolveConflictsCommand::ResolveConflictsCommand() {} ResolveConflictsCommand::~ResolveConflictsCommand() {} @@ -38,4 +38,4 @@ SyncerError ResolveConflictsCommand::ModelChangingExecuteImpl( return SYNCER_OK; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/resolve_conflicts_command.h b/sync/engine/resolve_conflicts_command.h index 8c2c87e4..217ddb2 100644 --- a/sync/engine/resolve_conflicts_command.h +++ b/sync/engine/resolve_conflicts_command.h @@ -10,7 +10,7 @@ #include "base/compiler_specific.h" #include "sync/engine/model_changing_syncer_command.h" -namespace browser_sync { +namespace csync { class ResolveConflictsCommand : public ModelChangingSyncerCommand { public: @@ -28,6 +28,6 @@ class ResolveConflictsCommand : public ModelChangingSyncerCommand { DISALLOW_COPY_AND_ASSIGN(ResolveConflictsCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_RESOLVE_CONFLICTS_COMMAND_H_ diff --git a/sync/engine/resolve_conflicts_command_unittest.cc b/sync/engine/resolve_conflicts_command_unittest.cc index 0265317..ac3e84f 100644 --- a/sync/engine/resolve_conflicts_command_unittest.cc +++ b/sync/engine/resolve_conflicts_command_unittest.cc @@ -12,7 +12,7 @@ #include "sync/test/engine/syncer_command_test.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { @@ -48,4 +48,4 @@ TEST_F(ResolveConflictsCommandTest, GetGroupsToChange) { } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/store_timestamps_command.cc b/sync/engine/store_timestamps_command.cc index 6791ad2..cfbabe6 100644 --- a/sync/engine/store_timestamps_command.cc +++ b/sync/engine/store_timestamps_command.cc @@ -9,7 +9,7 @@ #include "sync/sessions/sync_session.h" #include "sync/syncable/directory.h" -namespace browser_sync { +namespace csync { StoreTimestampsCommand::StoreTimestampsCommand() {} StoreTimestampsCommand::~StoreTimestampsCommand() {} @@ -56,4 +56,4 @@ SyncerError StoreTimestampsCommand::ExecuteImpl( return SYNCER_OK; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/store_timestamps_command.h b/sync/engine/store_timestamps_command.h index ec57052..cd4c054 100644 --- a/sync/engine/store_timestamps_command.h +++ b/sync/engine/store_timestamps_command.h @@ -10,7 +10,7 @@ #include "sync/engine/syncer_command.h" #include "sync/engine/syncer_types.h" -namespace browser_sync { +namespace csync { // A syncer command that extracts the changelog timestamp information from // a GetUpdatesResponse (fetched in DownloadUpdatesCommand) and stores @@ -36,6 +36,6 @@ class StoreTimestampsCommand : public SyncerCommand { DISALLOW_COPY_AND_ASSIGN(StoreTimestampsCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_STORE_TIMESTAMPS_COMMAND_H_ diff --git a/sync/engine/sync_engine_event.cc b/sync/engine/sync_engine_event.cc index 9ffb281..d362448 100644 --- a/sync/engine/sync_engine_event.cc +++ b/sync/engine/sync_engine_event.cc @@ -4,11 +4,11 @@ #include "sync/engine/sync_engine_event.h" -namespace browser_sync { +namespace csync { SyncEngineEvent::SyncEngineEvent(EventCause cause) : what_happened(cause) { } SyncEngineEvent::~SyncEngineEvent() {} -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/sync_engine_event.h b/sync/engine/sync_engine_event.h index d47edf3..e0d011c 100644 --- a/sync/engine/sync_engine_event.h +++ b/sync/engine/sync_engine_event.h @@ -15,7 +15,7 @@ namespace syncable { class Id; } -namespace browser_sync { +namespace csync { struct SyncEngineEvent { enum EventCause { @@ -67,6 +67,6 @@ class SyncEngineEventListener { virtual ~SyncEngineEventListener() {} }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ diff --git a/sync/engine/sync_scheduler.cc b/sync/engine/sync_scheduler.cc index bf9deec..199c507 100644 --- a/sync/engine/sync_scheduler.cc +++ b/sync/engine/sync_scheduler.cc @@ -23,7 +23,7 @@ using base::TimeDelta; using base::TimeTicks; -namespace browser_sync { +namespace csync { using sessions::SyncSession; using sessions::SyncSessionSnapshot; @@ -35,22 +35,22 @@ using sync_pb::GetUpdatesCallerInfo; namespace { bool ShouldRequestEarlyExit( - const browser_sync::SyncProtocolError& error) { + const csync::SyncProtocolError& error) { switch (error.error_type) { - case browser_sync::SYNC_SUCCESS: - case browser_sync::MIGRATION_DONE: - case browser_sync::THROTTLED: - case browser_sync::TRANSIENT_ERROR: + case csync::SYNC_SUCCESS: + case csync::MIGRATION_DONE: + case csync::THROTTLED: + case csync::TRANSIENT_ERROR: return false; - case browser_sync::NOT_MY_BIRTHDAY: - case browser_sync::CLEAR_PENDING: + case csync::NOT_MY_BIRTHDAY: + case csync::CLEAR_PENDING: // If we send terminate sync early then |sync_cycle_ended| notification // would not be sent. If there were no actions then |ACTIONABLE_ERROR| // notification wouldnt be sent either. Then the UI layer would be left // waiting forever. So assert we would send something. - DCHECK(error.action != browser_sync::UNKNOWN_ACTION); + DCHECK(error.action != csync::UNKNOWN_ACTION); return true; - case browser_sync::INVALID_CREDENTIAL: + case csync::INVALID_CREDENTIAL: // The notification for this is handled by PostAndProcessHeaders|. // Server does no have to send any action for this. return true; @@ -63,8 +63,8 @@ bool ShouldRequestEarlyExit( } bool IsActionableError( - const browser_sync::SyncProtocolError& error) { - return (error.action != browser_sync::UNKNOWN_ACTION); + const csync::SyncProtocolError& error) { + return (error.action != csync::UNKNOWN_ACTION); } } // namespace @@ -1140,4 +1140,4 @@ base::TimeDelta SyncScheduler::sessions_commit_delay() const { #undef ENUM_CASE -} // browser_sync +} // csync diff --git a/sync/engine/sync_scheduler.h b/sync/engine/sync_scheduler.h index 363b93e..51f5792 100644 --- a/sync/engine/sync_scheduler.h +++ b/sync/engine/sync_scheduler.h @@ -33,7 +33,7 @@ namespace tracked_objects { class Location; } // namespace tracked_objects -namespace browser_sync { +namespace csync { struct ServerConnectionEvent; @@ -329,8 +329,8 @@ class SyncScheduler : public sessions::SyncSession::Delegate { void OnServerConnectionErrorFixed(); // The pointer is owned by the caller. - browser_sync::sessions::SyncSession* CreateSyncSession( - const browser_sync::sessions::SyncSourceInfo& info); + csync::sessions::SyncSession* CreateSyncSession( + const csync::sessions::SyncSourceInfo& info); // Creates a session for a poll and performs the sync. void PollTimerCallback(); @@ -402,6 +402,6 @@ class SyncScheduler : public sessions::SyncSession::Delegate { DISALLOW_COPY_AND_ASSIGN(SyncScheduler); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc index d187d7d..82628cb 100644 --- a/sync/engine/sync_scheduler_unittest.cc +++ b/sync/engine/sync_scheduler_unittest.cc @@ -30,7 +30,7 @@ using testing::Mock; using testing::Return; using testing::WithArg; -namespace browser_sync { +namespace csync { using sessions::SyncSession; using sessions::SyncSessionContext; using sessions::SyncSessionSnapshot; @@ -1140,4 +1140,4 @@ TEST_F(SyncSchedulerTest, SetsPreviousRoutingInfo) { EXPECT_TRUE(expected == context()->previous_session_routing_info()); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/sync_scheduler_whitebox_unittest.cc b/sync/engine/sync_scheduler_whitebox_unittest.cc index dbfdec1..b6e3234 100644 --- a/sync/engine/sync_scheduler_whitebox_unittest.cc +++ b/sync/engine/sync_scheduler_whitebox_unittest.cc @@ -18,8 +18,8 @@ using base::TimeDelta; using base::TimeTicks; -namespace browser_sync { -using browser_sync::Syncer; +namespace csync { +using csync::Syncer; using sessions::SyncSession; using sessions::SyncSessionContext; using sessions::SyncSourceInfo; @@ -265,4 +265,4 @@ TEST_F(SyncSchedulerWhiteboxTest, ContinueCanaryJobConfig) { EXPECT_EQ(decision, SyncScheduler::CONTINUE); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc index da4e27b..8f87cda 100644 --- a/sync/engine/syncer.cc +++ b/sync/engine/syncer.cc @@ -42,7 +42,7 @@ using syncable::SERVER_POSITION_IN_PARENT; using syncable::SERVER_SPECIFICS; using syncable::SERVER_VERSION; -namespace browser_sync { +namespace csync { using sessions::ScopedSessionContextConflictResolver; using sessions::StatusController; @@ -294,4 +294,4 @@ void ClearServerData(syncable::MutableEntry* entry) { entry->Put(SERVER_POSITION_IN_PARENT, 0); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/syncer.h b/sync/engine/syncer.h index 9d2c32e..edddf9b 100644 --- a/sync/engine/syncer.h +++ b/sync/engine/syncer.h @@ -24,7 +24,7 @@ class Entry; class MutableEntry; } // namespace syncable -namespace browser_sync { +namespace csync { enum SyncerStep { SYNCER_BEGIN, @@ -107,6 +107,6 @@ void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); void ClearServerData(syncable::MutableEntry* entry); const char* SyncerStepToString(const SyncerStep); -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNCER_H_ diff --git a/sync/engine/syncer_command.cc b/sync/engine/syncer_command.cc index 60e8deb..cac1fc5 100644 --- a/sync/engine/syncer_command.cc +++ b/sync/engine/syncer_command.cc @@ -7,7 +7,7 @@ #include "sync/engine/net/server_connection_manager.h" #include "sync/sessions/sync_session.h" -namespace browser_sync { +namespace csync { using sessions::SyncSession; SyncerCommand::SyncerCommand() {} @@ -27,4 +27,4 @@ void SyncerCommand::SendNotifications(SyncSession* session) { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/syncer_command.h b/sync/engine/syncer_command.h index 949d8fd..bb68161 100644 --- a/sync/engine/syncer_command.h +++ b/sync/engine/syncer_command.h @@ -10,7 +10,7 @@ #include "sync/internal_api/public/util/syncer_error.h" -namespace browser_sync { +namespace csync { namespace sessions { class SyncSession; @@ -43,6 +43,6 @@ class SyncerCommand { DISALLOW_COPY_AND_ASSIGN(SyncerCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNCER_COMMAND_H_ diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc index 116556f..8be6888 100644 --- a/sync/engine/syncer_proto_util.cc +++ b/sync/engine/syncer_proto_util.cc @@ -21,7 +21,7 @@ #include "sync/syncable/syncable-inl.h" #include "sync/util/time.h" -using browser_sync::SyncProtocolErrorType; +using csync::SyncProtocolErrorType; using std::string; using std::stringstream; using syncable::BASE_VERSION; @@ -33,7 +33,7 @@ using syncable::IS_UNSYNCED; using syncable::MTIME; using syncable::PARENT_ID; -namespace browser_sync { +namespace csync { using sessions::SyncSession; namespace { @@ -217,7 +217,7 @@ void SyncerProtoUtil::HandleThrottleError( const base::TimeTicks& throttled_until, ThrottledDataTypeTracker* tracker, sessions::SyncSession::Delegate* delegate) { - DCHECK_EQ(error.error_type, browser_sync::THROTTLED); + DCHECK_EQ(error.error_type, csync::THROTTLED); if (error.error_data_types.Empty()) { // No datatypes indicates the client should be completely throttled. delegate->OnSilencedUntil(throttled_until); @@ -244,53 +244,53 @@ SyncProtocolErrorType ConvertSyncProtocolErrorTypePBToLocalType( const sync_pb::SyncEnums::ErrorType& error_type) { switch (error_type) { case sync_pb::SyncEnums::SUCCESS: - return browser_sync::SYNC_SUCCESS; + return csync::SYNC_SUCCESS; case sync_pb::SyncEnums::NOT_MY_BIRTHDAY: - return browser_sync::NOT_MY_BIRTHDAY; + return csync::NOT_MY_BIRTHDAY; case sync_pb::SyncEnums::THROTTLED: - return browser_sync::THROTTLED; + return csync::THROTTLED; case sync_pb::SyncEnums::CLEAR_PENDING: - return browser_sync::CLEAR_PENDING; + return csync::CLEAR_PENDING; case sync_pb::SyncEnums::TRANSIENT_ERROR: - return browser_sync::TRANSIENT_ERROR; + return csync::TRANSIENT_ERROR; case sync_pb::SyncEnums::MIGRATION_DONE: - return browser_sync::MIGRATION_DONE; + return csync::MIGRATION_DONE; case sync_pb::SyncEnums::UNKNOWN: - return browser_sync::UNKNOWN_ERROR; + return csync::UNKNOWN_ERROR; case sync_pb::SyncEnums::USER_NOT_ACTIVATED: case sync_pb::SyncEnums::AUTH_INVALID: case sync_pb::SyncEnums::ACCESS_DENIED: - return browser_sync::INVALID_CREDENTIAL; + return csync::INVALID_CREDENTIAL; default: NOTREACHED(); - return browser_sync::UNKNOWN_ERROR; + return csync::UNKNOWN_ERROR; } } -browser_sync::ClientAction ConvertClientActionPBToLocalClientAction( +csync::ClientAction ConvertClientActionPBToLocalClientAction( const sync_pb::SyncEnums::Action& action) { switch (action) { case sync_pb::SyncEnums::UPGRADE_CLIENT: - return browser_sync::UPGRADE_CLIENT; + return csync::UPGRADE_CLIENT; case sync_pb::SyncEnums::CLEAR_USER_DATA_AND_RESYNC: - return browser_sync::CLEAR_USER_DATA_AND_RESYNC; + return csync::CLEAR_USER_DATA_AND_RESYNC; case sync_pb::SyncEnums::ENABLE_SYNC_ON_ACCOUNT: - return browser_sync::ENABLE_SYNC_ON_ACCOUNT; + return csync::ENABLE_SYNC_ON_ACCOUNT; case sync_pb::SyncEnums::STOP_AND_RESTART_SYNC: - return browser_sync::STOP_AND_RESTART_SYNC; + return csync::STOP_AND_RESTART_SYNC; case sync_pb::SyncEnums::DISABLE_SYNC_ON_CLIENT: - return browser_sync::DISABLE_SYNC_ON_CLIENT; + return csync::DISABLE_SYNC_ON_CLIENT; case sync_pb::SyncEnums::UNKNOWN_ACTION: - return browser_sync::UNKNOWN_ACTION; + return csync::UNKNOWN_ACTION; default: NOTREACHED(); - return browser_sync::UNKNOWN_ACTION; + return csync::UNKNOWN_ACTION; } } -browser_sync::SyncProtocolError ConvertErrorPBToLocalType( +csync::SyncProtocolError ConvertErrorPBToLocalType( const sync_pb::ClientToServerResponse::Error& error) { - browser_sync::SyncProtocolError sync_protocol_error; + csync::SyncProtocolError sync_protocol_error; sync_protocol_error.error_type = ConvertSyncProtocolErrorTypePBToLocalType( error.error_type()); sync_protocol_error.error_description = error.error_description(); @@ -312,13 +312,13 @@ browser_sync::SyncProtocolError ConvertErrorPBToLocalType( } // TODO(lipalani) : Rename these function names as per the CR for issue 7740067. -browser_sync::SyncProtocolError ConvertLegacyErrorCodeToNewError( +csync::SyncProtocolError ConvertLegacyErrorCodeToNewError( const sync_pb::SyncEnums::ErrorType& error_type) { - browser_sync::SyncProtocolError error; + csync::SyncProtocolError error; error.error_type = ConvertSyncProtocolErrorTypePBToLocalType(error_type); if (error_type == sync_pb::SyncEnums::CLEAR_PENDING || error_type == sync_pb::SyncEnums::NOT_MY_BIRTHDAY) { - error.action = browser_sync::DISABLE_SYNC_ON_CLIENT; + error.action = csync::DISABLE_SYNC_ON_CLIENT; } // There is no other action we can compute for legacy server. return error; } @@ -345,11 +345,11 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage( msg, response)) { // There was an error establishing communication with the server. // We can not proceed beyond this point. - const browser_sync::HttpResponse::ServerConnectionCode server_status = + const csync::HttpResponse::ServerConnectionCode server_status = session->context()->connection_manager()->server_status(); - DCHECK_NE(server_status, browser_sync::HttpResponse::NONE); - DCHECK_NE(server_status, browser_sync::HttpResponse::SERVER_CONNECTION_OK); + DCHECK_NE(server_status, csync::HttpResponse::NONE); + DCHECK_NE(server_status, csync::HttpResponse::SERVER_CONNECTION_OK); return ServerConnectionErrorAsSyncerError(server_status); } @@ -358,13 +358,13 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage( session->context()->traffic_recorder()->RecordClientToServerResponse( *response); - browser_sync::SyncProtocolError sync_protocol_error; + csync::SyncProtocolError sync_protocol_error; // Birthday mismatch overrides any error that is sent by the server. if (!VerifyResponseBirthday(dir, response)) { - sync_protocol_error.error_type = browser_sync::NOT_MY_BIRTHDAY; + sync_protocol_error.error_type = csync::NOT_MY_BIRTHDAY; sync_protocol_error.action = - browser_sync::DISABLE_SYNC_ON_CLIENT; + csync::DISABLE_SYNC_ON_CLIENT; } else if (response->has_error()) { // This is a new server. Just get the error from the protocol. sync_protocol_error = ConvertErrorPBToLocalType(response->error()); @@ -384,28 +384,28 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage( // Now do any special handling for the error type and decide on the return // value. switch (sync_protocol_error.error_type) { - case browser_sync::UNKNOWN_ERROR: + case csync::UNKNOWN_ERROR: LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " << "recent version."; return SERVER_RETURN_UNKNOWN_ERROR; - case browser_sync::SYNC_SUCCESS: + case csync::SYNC_SUCCESS: LogResponseProfilingData(*response); return SYNCER_OK; - case browser_sync::THROTTLED: + case csync::THROTTLED: LOG(WARNING) << "Client silenced by server."; HandleThrottleError(sync_protocol_error, base::TimeTicks::Now() + GetThrottleDelay(*response), session->context()->throttled_data_type_tracker(), session->delegate()); return SERVER_RETURN_THROTTLED; - case browser_sync::TRANSIENT_ERROR: + case csync::TRANSIENT_ERROR: return SERVER_RETURN_TRANSIENT_ERROR; - case browser_sync::MIGRATION_DONE: + case csync::MIGRATION_DONE: HandleMigrationDoneResponse(response, session); return SERVER_RETURN_MIGRATION_DONE; - case browser_sync::CLEAR_PENDING: + case csync::CLEAR_PENDING: return SERVER_RETURN_CLEAR_PENDING; - case browser_sync::NOT_MY_BIRTHDAY: + case csync::NOT_MY_BIRTHDAY: return SERVER_RETURN_NOT_MY_BIRTHDAY; default: NOTREACHED(); @@ -542,4 +542,4 @@ std::string SyncerProtoUtil::ClientToServerResponseDebugString( return output; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/syncer_proto_util.h b/sync/engine/syncer_proto_util.h index 3856509..d9ccddc 100644 --- a/sync/engine/syncer_proto_util.h +++ b/sync/engine/syncer_proto_util.h @@ -25,7 +25,7 @@ class ClientToServerResponse; class EntitySpecifics; } // namespace sync_pb -namespace browser_sync { +namespace csync { namespace sessions { class SyncProtocolError; @@ -111,7 +111,7 @@ class SyncerProtoUtil { // Post the message using the scm, and do some processing on the returned // headers. Decode the server response. - static bool PostAndProcessHeaders(browser_sync::ServerConnectionManager* scm, + static bool PostAndProcessHeaders(csync::ServerConnectionManager* scm, sessions::SyncSession* session, const ClientToServerMessage& msg, sync_pb::ClientToServerResponse* response); @@ -122,7 +122,7 @@ class SyncerProtoUtil { static void HandleThrottleError( const SyncProtocolError& error, const base::TimeTicks& throttled_until, - browser_sync::ThrottledDataTypeTracker* tracker, + csync::ThrottledDataTypeTracker* tracker, sessions::SyncSession::Delegate* delegate); friend class SyncerProtoUtilTest; @@ -135,6 +135,6 @@ class SyncerProtoUtil { DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ diff --git a/sync/engine/syncer_proto_util_unittest.cc b/sync/engine/syncer_proto_util_unittest.cc index 7f81221..753e490 100644 --- a/sync/engine/syncer_proto_util_unittest.cc +++ b/sync/engine/syncer_proto_util_unittest.cc @@ -28,7 +28,7 @@ using syncable::Blob; using ::testing::_; -namespace browser_sync { +namespace csync { using sessions::SyncSessionContext; class MockDelegate : public sessions::SyncSession::Delegate { @@ -203,7 +203,7 @@ TEST_F(SyncerProtoUtilTest, AddRequestBirthday) { EXPECT_EQ(msg.store_birthday(), "meat"); } -class DummyConnectionManager : public browser_sync::ServerConnectionManager { +class DummyConnectionManager : public csync::ServerConnectionManager { public: DummyConnectionManager() : ServerConnectionManager("unused", 0, false, "version"), @@ -263,7 +263,7 @@ TEST_F(SyncerProtoUtilTest, PostAndProcessHeaders) { TEST_F(SyncerProtoUtilTest, HandleThrottlingWithDatatypes) { ThrottledDataTypeTracker tracker(NULL); SyncProtocolError error; - error.error_type = browser_sync::THROTTLED; + error.error_type = csync::THROTTLED; syncable::ModelTypeSet types; types.Put(syncable::BOOKMARKS); types.Put(syncable::PASSWORDS); @@ -278,7 +278,7 @@ TEST_F(SyncerProtoUtilTest, HandleThrottlingNoDatatypes) { ThrottledDataTypeTracker tracker(NULL); MockDelegate delegate; SyncProtocolError error; - error.error_type = browser_sync::THROTTLED; + error.error_type = csync::THROTTLED; base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); @@ -287,4 +287,4 @@ TEST_F(SyncerProtoUtilTest, HandleThrottlingNoDatatypes) { SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, &delegate); EXPECT_TRUE(tracker.GetThrottledTypes().Empty()); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/syncer_types.h b/sync/engine/syncer_types.h index 5639d98..474bdaec 100644 --- a/sync/engine/syncer_types.h +++ b/sync/engine/syncer_types.h @@ -8,7 +8,7 @@ // The intent of this is to keep all shared data types and enums for the syncer // in a single place without having dependencies between other files. -namespace browser_sync { +namespace csync { enum UpdateAttemptResponse { // Update was applied or safely ignored. @@ -82,6 +82,6 @@ enum VerifyCommitResult { VERIFY_OK, }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNCER_TYPES_H_ diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc index 81dfec5..4952d4a 100644 --- a/sync/engine/syncer_unittest.cc +++ b/sync/engine/syncer_unittest.cc @@ -62,7 +62,7 @@ using std::multimap; using std::set; using std::string; -namespace browser_sync { +namespace csync { using syncable::BaseTransaction; using syncable::Blob; @@ -561,7 +561,7 @@ class SyncerTest : public testing::Test, scoped_refptr<ModelSafeWorker> worker_; syncable::ModelTypeSet enabled_datatypes_; - browser_sync::TrafficRecorder traffic_recorder_; + csync::TrafficRecorder traffic_recorder_; DISALLOW_COPY_AND_ASSIGN(SyncerTest); }; @@ -715,7 +715,7 @@ TEST_F(SyncerTest, GetCommitIdsFiltersUnreadyEntries) { // Mark bookmarks as encrypted and set the cryptographer to have pending // keys. WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); - browser_sync::Cryptographer other_cryptographer(&encryptor_); + csync::Cryptographer other_cryptographer(&encryptor_); other_cryptographer.AddKey(other_params); sync_pb::EntitySpecifics specifics; sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); @@ -808,7 +808,7 @@ TEST_F(SyncerTest, GetCommitIdsFiltersUnreadyEntries) { TEST_F(SyncerTest, EncryptionAwareConflicts) { KeyParams key_params = {"localhost", "dummy", "foobar"}; - browser_sync::Cryptographer other_cryptographer(&encryptor_); + csync::Cryptographer other_cryptographer(&encryptor_); other_cryptographer.AddKey(key_params); sync_pb::EntitySpecifics bookmark, encrypted_bookmark, modified_bookmark; bookmark.mutable_bookmark()->set_title("title"); @@ -982,7 +982,7 @@ TEST_F(SyncerTest, ReceiveOldNigori) { KeyParams current_key = {"localhost", "dummy", "cur"}; // Data for testing encryption/decryption. - browser_sync::Cryptographer other_cryptographer(&encryptor_); + csync::Cryptographer other_cryptographer(&encryptor_); other_cryptographer.AddKey(old_key); sync_pb::EntitySpecifics other_encrypted_specifics; other_encrypted_specifics.mutable_bookmark()->set_title("title"); @@ -1065,7 +1065,7 @@ TEST_F(SyncerTest, ReceiveOldNigori) { TEST_F(SyncerTest, NigoriConflicts) { KeyParams local_key_params = {"localhost", "dummy", "blargle"}; KeyParams other_key_params = {"localhost", "dummy", "foobar"}; - browser_sync::Cryptographer other_cryptographer(&encryptor_); + csync::Cryptographer other_cryptographer(&encryptor_); other_cryptographer.AddKey(other_key_params); syncable::ModelTypeSet encrypted_types(syncable::PASSWORDS, syncable::NIGORI); sync_pb::EntitySpecifics initial_nigori_specifics; @@ -4832,4 +4832,4 @@ TEST_F(SyncerPositionTiebreakingTest, MidLowHigh) { ExpectLocalOrderIsByServerId(); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc index 0f734cd..f93c58f 100644 --- a/sync/engine/syncer_util.cc +++ b/sync/engine/syncer_util.cc @@ -68,7 +68,7 @@ using syncable::SPECIFICS; using syncable::SYNCER; using syncable::WriteTransaction; -namespace browser_sync { +namespace csync { // Returns the number of unsynced entries. // static @@ -722,4 +722,4 @@ VerifyResult SyncerUtil::VerifyUndelete(syncable::WriteTransaction* trans, return VERIFY_UNDECIDED; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/syncer_util.h b/sync/engine/syncer_util.h index 546ac3ff..e7d0515 100644 --- a/sync/engine/syncer_util.h +++ b/sync/engine/syncer_util.h @@ -19,7 +19,7 @@ #include "sync/syncable/metahandle_set.h" #include "sync/syncable/syncable_id.h" -namespace browser_sync { +namespace csync { class Cryptographer; class SyncEntity; @@ -123,6 +123,6 @@ class SyncerUtil { DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNCER_UTIL_H_ diff --git a/sync/engine/syncproto.h b/sync/engine/syncproto.h index 0f4e21c..ec6c6e4 100644 --- a/sync/engine/syncproto.h +++ b/sync/engine/syncproto.h @@ -12,7 +12,7 @@ #include "sync/protocol/sync.pb.h" #include "sync/syncable/syncable_id.h" -namespace browser_sync { +namespace csync { template<class Base> class IdWrapper : public Base { @@ -82,6 +82,6 @@ typedef sync_pb::CommitResponse CommitResponse; typedef sync_pb::GetUpdatesResponse GetUpdatesResponse; typedef sync_pb::GetUpdatesMessage GetUpdatesMessage; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_SYNCPROTO_H_ diff --git a/sync/engine/syncproto_unittest.cc b/sync/engine/syncproto_unittest.cc index 2c0598b..d641b5d 100644 --- a/sync/engine/syncproto_unittest.cc +++ b/sync/engine/syncproto_unittest.cc @@ -5,7 +5,7 @@ #include "sync/engine/syncproto.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { class SyncProtoTest : public testing::Test { }; @@ -15,4 +15,4 @@ TEST_F(SyncProtoTest, ProtocolVersionPresent) { EXPECT_TRUE(csm.has_protocol_version()); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/throttled_data_type_tracker.cc b/sync/engine/throttled_data_type_tracker.cc index 01317a8..47d68f6 100644 --- a/sync/engine/throttled_data_type_tracker.cc +++ b/sync/engine/throttled_data_type_tracker.cc @@ -7,7 +7,7 @@ #include "sync/engine/all_status.h" #include "sync/internal_api/public/syncable/model_type.h" -namespace browser_sync { +namespace csync { ThrottledDataTypeTracker::ThrottledDataTypeTracker(AllStatus *allstatus) : allstatus_(allstatus) { @@ -69,4 +69,4 @@ syncable::ModelTypeSet ThrottledDataTypeTracker::GetThrottledTypes() const { return types; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/throttled_data_type_tracker.h b/sync/engine/throttled_data_type_tracker.h index aa2835b..f24ab74 100644 --- a/sync/engine/throttled_data_type_tracker.h +++ b/sync/engine/throttled_data_type_tracker.h @@ -11,7 +11,7 @@ #include "base/gtest_prod_util.h" #include "sync/internal_api/public/syncable/model_type.h" -namespace browser_sync { +namespace csync { class AllStatus; @@ -50,6 +50,6 @@ class ThrottledDataTypeTracker { DISALLOW_COPY_AND_ASSIGN(ThrottledDataTypeTracker); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_THROTTLED_DATA_TYPE_TRACKER_H_ diff --git a/sync/engine/throttled_data_type_tracker_unittest.cc b/sync/engine/throttled_data_type_tracker_unittest.cc index cd80436..6273915 100644 --- a/sync/engine/throttled_data_type_tracker_unittest.cc +++ b/sync/engine/throttled_data_type_tracker_unittest.cc @@ -10,7 +10,7 @@ using base::TimeDelta; using base::TimeTicks; -namespace browser_sync { +namespace csync { TEST(ThrottledDataTypeTrackerTest, AddUnthrottleTimeTest) { const syncable::ModelTypeSet types(syncable::BOOKMARKS, syncable::PASSWORDS); @@ -63,5 +63,5 @@ TEST(ThrottledDataTypeTrackerTest, UnthrottleSomeTypesTest) { EXPECT_TRUE(throttler.GetThrottledTypes().Equals(long_throttled)); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/traffic_logger.cc b/sync/engine/traffic_logger.cc index 1f8ba1d..e25fdc8 100644 --- a/sync/engine/traffic_logger.cc +++ b/sync/engine/traffic_logger.cc @@ -13,7 +13,7 @@ #include "sync/protocol/proto_value_conversions.h" #include "sync/protocol/sync.pb.h" -namespace browser_sync { +namespace csync { namespace { template <class T> @@ -43,4 +43,4 @@ void LogClientToServerResponse( "******Server Response******"); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/traffic_logger.h b/sync/engine/traffic_logger.h index 5cb8ffa..93ae2a3 100644 --- a/sync/engine/traffic_logger.h +++ b/sync/engine/traffic_logger.h @@ -15,12 +15,12 @@ class ClientToServerResponse; class ClientToServerMessage; } // namespace sync_pb -namespace browser_sync { +namespace csync { void LogClientToServerMessage(const sync_pb::ClientToServerMessage& msg); void LogClientToServerResponse( const sync_pb::ClientToServerResponse& response); -} // namespace browser_sync +} // namespace csync #endif // CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_LOGGER_H_ diff --git a/sync/engine/traffic_recorder.cc b/sync/engine/traffic_recorder.cc index ae0a059..ade5bd6 100644 --- a/sync/engine/traffic_recorder.cc +++ b/sync/engine/traffic_recorder.cc @@ -12,7 +12,7 @@ #include "sync/protocol/sync.pb.h" #include "sync/sessions/sync_session.h" -namespace browser_sync { +namespace csync { TrafficRecorder::TrafficRecord::TrafficRecord(const std::string& message, TrafficMessageType message_type, @@ -129,5 +129,5 @@ void TrafficRecorder::RecordClientToServerResponse( StoreProtoInQueue(response, CLIENT_TO_SERVER_RESPONSE); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/traffic_recorder.h b/sync/engine/traffic_recorder.h index cfcdcc0..525e735 100644 --- a/sync/engine/traffic_recorder.h +++ b/sync/engine/traffic_recorder.h @@ -19,7 +19,7 @@ class ClientToServerResponse; class ClientToServerMessage; } -namespace browser_sync { +namespace csync { class TrafficRecorder { public: @@ -72,7 +72,7 @@ class TrafficRecorder { DISALLOW_COPY_AND_ASSIGN(TrafficRecorder); }; -} // namespace browser_sync +} // namespace csync #endif // CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_RECORDER_H_ diff --git a/sync/engine/traffic_recorder_unittest.cc b/sync/engine/traffic_recorder_unittest.cc index 89a77a6..637aeeb 100644 --- a/sync/engine/traffic_recorder_unittest.cc +++ b/sync/engine/traffic_recorder_unittest.cc @@ -7,7 +7,7 @@ #include "sync/protocol/sync.pb.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { const unsigned int kMaxMessages = 10; const unsigned int kMaxMessageSize = 5 * 1024; @@ -39,5 +39,5 @@ TEST(TrafficRecorderTest, MaxMessageSizeTest) { EXPECT_TRUE(record.message.empty()); } -} //namespace browser_sync +} //namespace csync diff --git a/sync/engine/update_applicator.cc b/sync/engine/update_applicator.cc index 921cfb5..3986e60 100644 --- a/sync/engine/update_applicator.cc +++ b/sync/engine/update_applicator.cc @@ -16,7 +16,7 @@ using std::vector; -namespace browser_sync { +namespace csync { UpdateApplicator::UpdateApplicator(ConflictResolver* resolver, Cryptographer* cryptographer, @@ -189,4 +189,4 @@ bool UpdateApplicator::ResultTracker::no_conflicts() const { return conflicting_ids_.empty(); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/update_applicator.h b/sync/engine/update_applicator.h index cbd2b5e..fbc8361 100644 --- a/sync/engine/update_applicator.h +++ b/sync/engine/update_applicator.h @@ -24,7 +24,7 @@ class WriteTransaction; class Entry; } -namespace browser_sync { +namespace csync { namespace sessions { class ConflictProgress; @@ -109,6 +109,6 @@ class UpdateApplicator { DISALLOW_COPY_AND_ASSIGN(UpdateApplicator); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_UPDATE_APPLICATOR_H_ diff --git a/sync/engine/verify_updates_command.cc b/sync/engine/verify_updates_command.cc index 40c75cf..91f08f0 100644 --- a/sync/engine/verify_updates_command.cc +++ b/sync/engine/verify_updates_command.cc @@ -18,7 +18,7 @@ #include "sync/syncable/mutable_entry.h" #include "sync/syncable/write_transaction.h" -namespace browser_sync { +namespace csync { using syncable::GET_BY_ID; using syncable::ModelTypeSet; @@ -100,7 +100,7 @@ SyncerError VerifyUpdatesCommand::ModelChangingExecuteImpl( const GetUpdatesResponse& updates = status->updates_response().get_updates(); int update_count = updates.entries().size(); - ModelTypeSet requested_types = browser_sync::GetRoutingInfoTypes( + ModelTypeSet requested_types = csync::GetRoutingInfoTypes( session->routing_info()); DVLOG(1) << update_count << " entries to verify"; @@ -186,4 +186,4 @@ VerifyUpdatesCommand::VerifyUpdateResult VerifyUpdatesCommand::VerifyUpdate( return result; // This might be VERIFY_SUCCESS as well } -} // namespace browser_sync +} // namespace csync diff --git a/sync/engine/verify_updates_command.h b/sync/engine/verify_updates_command.h index 09376f2..b0bf68e 100644 --- a/sync/engine/verify_updates_command.h +++ b/sync/engine/verify_updates_command.h @@ -17,7 +17,7 @@ namespace syncable { class WriteTransaction; } -namespace browser_sync { +namespace csync { // Verifies the response from a GetUpdates request. All invalid updates will be // noted in the SyncSession after this command is executed. @@ -45,6 +45,6 @@ class VerifyUpdatesCommand : public ModelChangingSyncerCommand { DISALLOW_COPY_AND_ASSIGN(VerifyUpdatesCommand); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ diff --git a/sync/engine/verify_updates_command_unittest.cc b/sync/engine/verify_updates_command_unittest.cc index 15324f4..49ac704 100644 --- a/sync/engine/verify_updates_command_unittest.cc +++ b/sync/engine/verify_updates_command_unittest.cc @@ -13,7 +13,7 @@ #include "sync/test/engine/syncer_command_test.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { using sessions::StatusController; using std::string; diff --git a/sync/internal_api/base_node.cc b/sync/internal_api/base_node.cc index a66d452..cd9fb65 100644 --- a/sync/internal_api/base_node.cc +++ b/sync/internal_api/base_node.cc @@ -255,7 +255,7 @@ DictionaryValue* BaseNode::GetDetailsAsValue() const { DictionaryValue* node_info = GetSummaryAsValue(); node_info->SetString( "modificationTime", - browser_sync::GetTimeDebugString(GetModificationTime())); + csync::GetTimeDebugString(GetModificationTime())); node_info->SetString("parentId", base::Int64ToString(GetParentId())); // Specifics are already in the Entry value, so no need to duplicate // it here. diff --git a/sync/internal_api/base_transaction.cc b/sync/internal_api/base_transaction.cc index 23b6944..0f4de7c 100644 --- a/sync/internal_api/base_transaction.cc +++ b/sync/internal_api/base_transaction.cc @@ -7,7 +7,7 @@ #include "sync/syncable/directory.h" #include "sync/util/cryptographer.h" -using browser_sync::Cryptographer; +using csync::Cryptographer; namespace sync_api { @@ -20,7 +20,7 @@ BaseTransaction::BaseTransaction(UserShare* share) { BaseTransaction::~BaseTransaction() { } -browser_sync::Cryptographer* BaseTransaction::GetCryptographer() const { +csync::Cryptographer* BaseTransaction::GetCryptographer() const { return directory_->GetCryptographer(this->GetWrappedTrans()); } diff --git a/sync/internal_api/change_record.cc b/sync/internal_api/change_record.cc index 75a57a5..7a78767 100644 --- a/sync/internal_api/change_record.cc +++ b/sync/internal_api/change_record.cc @@ -42,7 +42,7 @@ DictionaryValue* ChangeRecord::ToValue() const { value->Set("extra", extra->ToValue()); } value->Set("specifics", - browser_sync::EntitySpecificsToValue(specifics)); + csync::EntitySpecificsToValue(specifics)); } return value; } @@ -57,7 +57,7 @@ ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData( ExtraPasswordChangeRecordData::~ExtraPasswordChangeRecordData() {} DictionaryValue* ExtraPasswordChangeRecordData::ToValue() const { - return browser_sync::PasswordSpecificsDataToValue(unencrypted_); + return csync::PasswordSpecificsDataToValue(unencrypted_); } const sync_pb::PasswordSpecificsData& diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc index 022bac3..0057e92 100644 --- a/sync/internal_api/debug_info_event_listener.cc +++ b/sync/internal_api/debug_info_event_listener.cc @@ -4,7 +4,7 @@ #include "sync/internal_api/debug_info_event_listener.h" -using browser_sync::sessions::SyncSessionSnapshot; +using csync::sessions::SyncSessionSnapshot; namespace sync_api { DebugInfoEventListener::DebugInfoEventListener() @@ -44,7 +44,7 @@ void DebugInfoEventListener::OnSyncCycleCompleted( } void DebugInfoEventListener::OnInitializationComplete( - const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) { CreateAndAddEvent(sync_pb::DebugEventInfo::INITIALIZATION_COMPLETE); } @@ -88,7 +88,7 @@ void DebugInfoEventListener::OnEncryptionComplete() { } void DebugInfoEventListener::OnActionableError( - const browser_sync::SyncProtocolError& sync_error) { + const csync::SyncProtocolError& sync_error) { CreateAndAddEvent(sync_pb::DebugEventInfo::ACTIONABLE_ERROR); } diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h index d76e9ab..6a7abf9 100644 --- a/sync/internal_api/debug_info_event_listener.h +++ b/sync/internal_api/debug_info_event_listener.h @@ -24,16 +24,16 @@ const unsigned int kMaxEntries = 6; // Listens to events and records them in a queue. And passes the events to // syncer when requested. class DebugInfoEventListener : public sync_api::SyncManager::Observer, - public browser_sync::sessions::DebugInfoGetter { + public csync::sessions::DebugInfoGetter { public: DebugInfoEventListener(); virtual ~DebugInfoEventListener(); // SyncManager::Observer implementation. virtual void OnSyncCycleCompleted( - const browser_sync::sessions::SyncSessionSnapshot& snapshot) OVERRIDE; + const csync::sessions::SyncSessionSnapshot& snapshot) OVERRIDE; virtual void OnInitializationComplete( - const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) OVERRIDE; virtual void OnConnectionStatusChange( sync_api::ConnectionStatus connection_status) OVERRIDE; @@ -50,7 +50,7 @@ class DebugInfoEventListener : public sync_api::SyncManager::Observer, bool encrypt_everything) OVERRIDE; virtual void OnEncryptionComplete() OVERRIDE; virtual void OnActionableError( - const browser_sync::SyncProtocolError& sync_error) OVERRIDE; + const csync::SyncProtocolError& sync_error) OVERRIDE; // Sync manager events. void OnNudgeFromDatatype(syncable::ModelType datatype); diff --git a/sync/internal_api/js_mutation_event_observer.cc b/sync/internal_api/js_mutation_event_observer.cc index f03d47a..7452846 100644 --- a/sync/internal_api/js_mutation_event_observer.cc +++ b/sync/internal_api/js_mutation_event_observer.cc @@ -13,7 +13,7 @@ #include "sync/js/js_event_details.h" #include "sync/js/js_event_handler.h" -namespace browser_sync { +namespace csync { JsMutationEventObserver::JsMutationEventObserver() : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {} @@ -109,4 +109,4 @@ void JsMutationEventObserver::HandleJsEvent( &JsEventHandler::HandleJsEvent, name, details); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/js_mutation_event_observer.h b/sync/internal_api/js_mutation_event_observer.h index 6e70c19..1185657 100644 --- a/sync/internal_api/js_mutation_event_observer.h +++ b/sync/internal_api/js_mutation_event_observer.h @@ -20,7 +20,7 @@ namespace tracked_objects { class Location; } // namespace tracked_objects -namespace browser_sync { +namespace csync { class JsEventDetails; class JsEventHandler; @@ -65,6 +65,6 @@ class JsMutationEventObserver DISALLOW_COPY_AND_ASSIGN(JsMutationEventObserver); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ diff --git a/sync/internal_api/js_mutation_event_observer_unittest.cc b/sync/internal_api/js_mutation_event_observer_unittest.cc index 8d0e30f..91f9b71 100644 --- a/sync/internal_api/js_mutation_event_observer_unittest.cc +++ b/sync/internal_api/js_mutation_event_observer_unittest.cc @@ -13,7 +13,7 @@ #include "sync/js/js_test_util.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { using ::testing::InSequence; @@ -124,4 +124,4 @@ TEST_F(JsMutationEventObserverTest, OnChangesComplete) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/js_sync_manager_observer.cc b/sync/internal_api/js_sync_manager_observer.cc index fe9fa65..149e8f08 100644 --- a/sync/internal_api/js_sync_manager_observer.cc +++ b/sync/internal_api/js_sync_manager_observer.cc @@ -18,9 +18,9 @@ #include "sync/js/js_event_handler.h" #include "sync/sessions/session_state.h" -namespace browser_sync { +namespace csync { -using browser_sync::SyncProtocolError; +using csync::SyncProtocolError; JsSyncManagerObserver::JsSyncManagerObserver() {} @@ -153,4 +153,4 @@ void JsSyncManagerObserver::HandleJsEvent( &JsEventHandler::HandleJsEvent, name, details); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/js_sync_manager_observer.h b/sync/internal_api/js_sync_manager_observer.h index 6c0a620..a54cfd3 100644 --- a/sync/internal_api/js_sync_manager_observer.h +++ b/sync/internal_api/js_sync_manager_observer.h @@ -18,7 +18,7 @@ namespace tracked_objects { class Location; } // namespace tracked_objects -namespace browser_sync { +namespace csync { class JsEventDetails; class JsEventHandler; @@ -51,7 +51,7 @@ class JsSyncManagerObserver : public sync_api::SyncManager::Observer { const WeakHandle<JsBackend>& js_backend, bool success) OVERRIDE; virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnActionableError( - const browser_sync::SyncProtocolError& sync_protocol_error) OVERRIDE; + const csync::SyncProtocolError& sync_protocol_error) OVERRIDE; private: void HandleJsEvent(const tracked_objects::Location& from_here, @@ -62,6 +62,6 @@ class JsSyncManagerObserver : public sync_api::SyncManager::Observer { DISALLOW_COPY_AND_ASSIGN(JsSyncManagerObserver); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_JS_SYNC_MANAGER_OBSERVER_H_ diff --git a/sync/internal_api/js_sync_manager_observer_unittest.cc b/sync/internal_api/js_sync_manager_observer_unittest.cc index 0791a89..230d17a 100644 --- a/sync/internal_api/js_sync_manager_observer_unittest.cc +++ b/sync/internal_api/js_sync_manager_observer_unittest.cc @@ -16,7 +16,7 @@ #include "sync/protocol/sync_protocol_error.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { using ::testing::InSequence; @@ -94,9 +94,9 @@ TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) { } TEST_F(JsSyncManagerObserverTest, OnActionableError) { - browser_sync::SyncProtocolError sync_error; - sync_error.action = browser_sync::CLEAR_USER_DATA_AND_RESYNC; - sync_error.error_type = browser_sync::TRANSIENT_ERROR; + csync::SyncProtocolError sync_error; + sync_error.action = csync::CLEAR_USER_DATA_AND_RESYNC; + sync_error.error_type = csync::TRANSIENT_ERROR; DictionaryValue expected_details; expected_details.Set("syncError", sync_error.ToValue()); @@ -208,4 +208,4 @@ TEST_F(JsSyncManagerObserverTest, OnEncryptedTypesChanged) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/base_transaction.h b/sync/internal_api/public/base_transaction.h index e2ed24a..15efdb79 100644 --- a/sync/internal_api/public/base_transaction.h +++ b/sync/internal_api/public/base_transaction.h @@ -28,7 +28,7 @@ class BaseTransaction { public: // Provide access to the underlying syncable objects from BaseNode. virtual syncable::BaseTransaction* GetWrappedTrans() const = 0; - browser_sync::Cryptographer* GetCryptographer() const; + csync::Cryptographer* GetCryptographer() const; syncable::Directory* GetDirectory() const { return directory_; diff --git a/sync/internal_api/public/change_record.h b/sync/internal_api/public/change_record.h index f522a3b..6faccd5 100644 --- a/sync/internal_api/public/change_record.h +++ b/sync/internal_api/public/change_record.h @@ -60,7 +60,7 @@ struct ChangeRecord { typedef std::vector<ChangeRecord> ChangeRecordList; -typedef browser_sync::Immutable<ChangeRecordList> ImmutableChangeRecordList; +typedef csync::Immutable<ChangeRecordList> ImmutableChangeRecordList; } // namespace sync_api diff --git a/sync/internal_api/public/change_record_unittest.cc b/sync/internal_api/public/change_record_unittest.cc index 4fb1f01..a2c97b6 100644 --- a/sync/internal_api/public/change_record_unittest.cc +++ b/sync/internal_api/public/change_record_unittest.cc @@ -61,7 +61,7 @@ void CheckChangeRecordValue( EXPECT_TRUE(Value::Equals(extra_value, expected_extra_value.get())); scoped_ptr<DictionaryValue> expected_specifics_value( - browser_sync::EntitySpecificsToValue(record.specifics)); + csync::EntitySpecificsToValue(record.specifics)); ExpectDictDictionaryValue(*expected_specifics_value, value, "specifics"); } diff --git a/sync/internal_api/public/engine/model_safe_worker.cc b/sync/internal_api/public/engine/model_safe_worker.cc index 2718acc..f82b451 100644 --- a/sync/internal_api/public/engine/model_safe_worker.cc +++ b/sync/internal_api/public/engine/model_safe_worker.cc @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/values.h" -namespace browser_sync { +namespace csync { base::DictionaryValue* ModelSafeRoutingInfoToValue( const ModelSafeRoutingInfo& routing_info) { @@ -72,4 +72,4 @@ std::string ModelSafeGroupToString(ModelSafeGroup group) { ModelSafeWorker::~ModelSafeWorker() {} -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/engine/model_safe_worker.h b/sync/internal_api/public/engine/model_safe_worker.h index 1a6c371..e1d6563 100644 --- a/sync/internal_api/public/engine/model_safe_worker.h +++ b/sync/internal_api/public/engine/model_safe_worker.h @@ -19,7 +19,7 @@ namespace base { class DictionaryValue; } // namespace -namespace browser_sync { +namespace csync { typedef base::Callback<enum SyncerError(void)> WorkCallback; @@ -82,6 +82,6 @@ syncable::ModelTypeSet GetRoutingInfoTypes( ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, const ModelSafeRoutingInfo& routes); -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ diff --git a/sync/internal_api/public/engine/model_safe_worker_unittest.cc b/sync/internal_api/public/engine/model_safe_worker_unittest.cc index 5304c13..a8580e1 100644 --- a/sync/internal_api/public/engine/model_safe_worker_unittest.cc +++ b/sync/internal_api/public/engine/model_safe_worker_unittest.cc @@ -8,7 +8,7 @@ #include "base/values.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { class ModelSafeWorkerTest : public ::testing::Test { @@ -52,4 +52,4 @@ TEST_F(ModelSafeWorkerTest, GetRoutingInfoTypes) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/engine/passive_model_worker.cc b/sync/internal_api/public/engine/passive_model_worker.cc index 26fccc1..f33488e 100644 --- a/sync/internal_api/public/engine/passive_model_worker.cc +++ b/sync/internal_api/public/engine/passive_model_worker.cc @@ -6,7 +6,7 @@ #include "base/message_loop.h" -namespace browser_sync { +namespace csync { PassiveModelWorker::PassiveModelWorker(const MessageLoop* sync_loop) : sync_loop_(sync_loop) {} @@ -25,4 +25,4 @@ ModelSafeGroup PassiveModelWorker::GetModelSafeGroup() { return GROUP_PASSIVE; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/engine/passive_model_worker.h b/sync/internal_api/public/engine/passive_model_worker.h index 7c0ddf3..bb0870a 100644 --- a/sync/internal_api/public/engine/passive_model_worker.h +++ b/sync/internal_api/public/engine/passive_model_worker.h @@ -13,7 +13,7 @@ class MessageLoop; -namespace browser_sync { +namespace csync { // Implementation of ModelSafeWorker for passive types. All work is // done on the same thread DoWorkAndWaitUntilDone (i.e., the sync @@ -35,6 +35,6 @@ class PassiveModelWorker : public ModelSafeWorker { DISALLOW_COPY_AND_ASSIGN(PassiveModelWorker); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ diff --git a/sync/internal_api/public/engine/polling_constants.cc b/sync/internal_api/public/engine/polling_constants.cc index d7fe753..bebf180 100644 --- a/sync/internal_api/public/engine/polling_constants.cc +++ b/sync/internal_api/public/engine/polling_constants.cc @@ -5,7 +5,7 @@ #include "base/basictypes.h" #include "sync/internal_api/public/engine/polling_constants.h" -namespace browser_sync { +namespace csync { // Server can overwrite these values via client commands. // Standard short poll. This is used when XMPP is off. @@ -22,5 +22,5 @@ const int64 kMaxBackoffSeconds = 60 * 60 * 4; // 4 hours. // Backoff interval randomization factor. const int kBackoffRandomizationFactor = 2; -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/engine/polling_constants.h b/sync/internal_api/public/engine/polling_constants.h index 9adfe92..cb7f5f5 100644 --- a/sync/internal_api/public/engine/polling_constants.h +++ b/sync/internal_api/public/engine/polling_constants.h @@ -8,13 +8,13 @@ #define SYNC_INTERNAL_API_PUBLIC_ENGINE_POLLING_CONSTANTS_H_ #pragma once -namespace browser_sync { +namespace csync { extern const int64 kDefaultShortPollIntervalSeconds; extern const int64 kDefaultLongPollIntervalSeconds; extern const int64 kMaxBackoffSeconds; extern const int kBackoffRandomizationFactor; -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_POLLING_CONSTANTS_H_ diff --git a/sync/internal_api/public/engine/sync_status.h b/sync/internal_api/public/engine/sync_status.h index f05a5bc..34b951e 100644 --- a/sync/internal_api/public/engine/sync_status.h +++ b/sync/internal_api/public/engine/sync_status.h @@ -29,7 +29,7 @@ struct SyncStatus { // Notifications counters updated by the actions in synapi. int notifications_received; - browser_sync::SyncProtocolError sync_protocol_error; + csync::SyncProtocolError sync_protocol_error; // Number of encryption conflicts counted during most recent sync cycle. int encryption_conflicts; diff --git a/sync/internal_api/public/sessions/error_counters.cc b/sync/internal_api/public/sessions/error_counters.cc index 1982e2d..9ce6772 100644 --- a/sync/internal_api/public/sessions/error_counters.cc +++ b/sync/internal_api/public/sessions/error_counters.cc @@ -4,7 +4,7 @@ #include "sync/internal_api/public/sessions/error_counters.h" -namespace browser_sync { +namespace csync { namespace sessions { ErrorCounters::ErrorCounters() @@ -13,4 +13,4 @@ ErrorCounters::ErrorCounters() } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/sessions/error_counters.h b/sync/internal_api/public/sessions/error_counters.h index e513c84..a5baed7 100644 --- a/sync/internal_api/public/sessions/error_counters.h +++ b/sync/internal_api/public/sessions/error_counters.h @@ -10,7 +10,7 @@ #include "sync/internal_api/public/util/syncer_error.h" #include "sync/protocol/sync_protocol_error.h" -namespace browser_sync { +namespace csync { namespace sessions { // Counters for various errors that can occur repeatedly during a sync session. @@ -27,6 +27,6 @@ struct ErrorCounters { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_SESSIONS_ERROR_COUNTERS_H_ diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.cc b/sync/internal_api/public/sessions/sync_session_snapshot.cc index d058a4f..cf910dad 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.cc +++ b/sync/internal_api/public/sessions/sync_session_snapshot.cc @@ -7,7 +7,7 @@ #include "base/json/json_writer.h" #include "base/values.h" -namespace browser_sync { +namespace csync { namespace sessions { SyncSessionSnapshot::SyncSessionSnapshot() @@ -170,4 +170,4 @@ bool SyncSessionSnapshot::retry_scheduled() const { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.h b/sync/internal_api/public/sessions/sync_session_snapshot.h index 45f6c75..8bd2258 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.h +++ b/sync/internal_api/public/sessions/sync_session_snapshot.h @@ -20,7 +20,7 @@ namespace base { class DictionaryValue; } -namespace browser_sync { +namespace csync { namespace sessions { // An immutable snapshot of state from a SyncSession. Convenient to use as @@ -95,6 +95,6 @@ class SyncSessionSnapshot { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ diff --git a/sync/internal_api/public/sessions/sync_source_info.cc b/sync/internal_api/public/sessions/sync_source_info.cc index 191199b..1b6d72d 100644 --- a/sync/internal_api/public/sessions/sync_source_info.cc +++ b/sync/internal_api/public/sessions/sync_source_info.cc @@ -7,7 +7,7 @@ #include "base/values.h" #include "sync/protocol/proto_enum_conversions.h" -namespace browser_sync { +namespace csync { namespace sessions { SyncSourceInfo::SyncSourceInfo() @@ -33,4 +33,4 @@ DictionaryValue* SyncSourceInfo::ToValue() const { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/sessions/sync_source_info.h b/sync/internal_api/public/sessions/sync_source_info.h index 838e094..cbd66d0 100644 --- a/sync/internal_api/public/sessions/sync_source_info.h +++ b/sync/internal_api/public/sessions/sync_source_info.h @@ -15,7 +15,7 @@ namespace base { class DictionaryValue; } -namespace browser_sync { +namespace csync { namespace sessions { // A container for the source of a sync session. This includes the update @@ -37,6 +37,6 @@ struct SyncSourceInfo { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SOURCE_INFO_H_ diff --git a/sync/internal_api/public/sessions/syncer_status.cc b/sync/internal_api/public/sessions/syncer_status.cc index efa0c43..5b26a24 100644 --- a/sync/internal_api/public/sessions/syncer_status.cc +++ b/sync/internal_api/public/sessions/syncer_status.cc @@ -6,7 +6,7 @@ #include "base/values.h" -namespace browser_sync { +namespace csync { namespace sessions { SyncerStatus::SyncerStatus() @@ -41,4 +41,4 @@ DictionaryValue* SyncerStatus::ToValue() const { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/sessions/syncer_status.h b/sync/internal_api/public/sessions/syncer_status.h index 7331ca3..070f564 100644 --- a/sync/internal_api/public/sessions/syncer_status.h +++ b/sync/internal_api/public/sessions/syncer_status.h @@ -13,7 +13,7 @@ namespace base { class DictionaryValue; } -namespace browser_sync { +namespace csync { namespace sessions { // Data pertaining to the status of an active Syncer object. @@ -45,6 +45,6 @@ struct SyncerStatus { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNCER_STATUS_H_ diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h index e79e071..ac7c1bd 100644 --- a/sync/internal_api/public/sync_manager.h +++ b/sync/internal_api/public/sync_manager.h @@ -25,7 +25,7 @@ #include "sync/internal_api/public/util/weak_handle.h" #include "sync/protocol/sync_protocol_error.h" -namespace browser_sync { +namespace csync { class Encryptor; struct Experiments; class ExtensionsActivityMonitor; @@ -35,7 +35,7 @@ class JsEventHandler; namespace sessions { class SyncSessionSnapshot; } // namespace sessions -} // namespace browser_sync +} // namespace csync namespace csync { class SyncNotifier; @@ -58,7 +58,7 @@ enum ConnectionStatus { CONNECTION_SERVER_ERROR }; -// Reasons due to which browser_sync::Cryptographer might require a passphrase. +// Reasons due to which csync::Cryptographer might require a passphrase. enum PassphraseRequiredReason { REASON_PASSPHRASE_NOT_REQUIRED = 0, // Initial value. REASON_ENCRYPTION = 1, // The cryptographer requires a @@ -184,7 +184,7 @@ class SyncManager { // A round-trip sync-cycle took place and the syncer has resolved any // conflicts that may have arisen. virtual void OnSyncCycleCompleted( - const browser_sync::sessions::SyncSessionSnapshot& snapshot) = 0; + const csync::sessions::SyncSessionSnapshot& snapshot) = 0; // Called when the status of the connection to the sync server has // changed. @@ -300,7 +300,7 @@ class SyncManager { // function getChildNodeIds(id); virtual void OnInitializationComplete( - const browser_sync::WeakHandle<browser_sync::JsBackend>& + const csync::WeakHandle<csync::JsBackend>& js_backend, bool success) = 0; // We are no longer permitted to communicate with the server. Sync should @@ -334,7 +334,7 @@ class SyncManager { virtual void OnEncryptionComplete() = 0; virtual void OnActionableError( - const browser_sync::SyncProtocolError& sync_protocol_error) = 0; + const csync::SyncProtocolError& sync_protocol_error) = 0; protected: virtual ~Observer(); @@ -369,16 +369,16 @@ class SyncManager { // |sync_notifier| is owned and used to listen for notifications. // |report_unrecoverable_error_function| may be NULL. bool Init(const FilePath& database_location, - const browser_sync::WeakHandle<browser_sync::JsEventHandler>& + const csync::WeakHandle<csync::JsEventHandler>& event_handler, const std::string& sync_server_and_path, int sync_server_port, bool use_ssl, const scoped_refptr<base::TaskRunner>& blocking_task_runner, HttpPostProviderFactory* post_factory, - const browser_sync::ModelSafeRoutingInfo& model_safe_routing_info, - const std::vector<browser_sync::ModelSafeWorker*>& workers, - browser_sync::ExtensionsActivityMonitor* + const csync::ModelSafeRoutingInfo& model_safe_routing_info, + const std::vector<csync::ModelSafeWorker*>& workers, + csync::ExtensionsActivityMonitor* extensions_activity_monitor, ChangeDelegate* change_delegate, const std::string& user_agent, @@ -386,10 +386,10 @@ class SyncManager { csync::SyncNotifier* sync_notifier, const std::string& restored_key_for_bootstrapping, TestingMode testing_mode, - browser_sync::Encryptor* encryptor, - browser_sync::UnrecoverableErrorHandler* + csync::Encryptor* encryptor, + csync::UnrecoverableErrorHandler* unrecoverable_error_handler, - browser_sync::ReportUnrecoverableErrorFunction + csync::ReportUnrecoverableErrorFunction report_unrecoverable_error_function); // Throw an unrecoverable error from a transaction (mostly used for @@ -407,7 +407,7 @@ class SyncManager { // Put the syncer in normal mode ready to perform nudges and polls. void StartSyncingNormally( - const browser_sync::ModelSafeRoutingInfo& routing_info); + const csync::ModelSafeRoutingInfo& routing_info); // Attempts to re-encrypt encrypted data types using the passphrase provided. // Notifies observers of the result of the operation via OnPassphraseAccepted @@ -434,12 +434,12 @@ class SyncManager { // Switches the mode of operation to CONFIGURATION_MODE and // schedules a config task to fetch updates for |types|. - void RequestConfig(const browser_sync::ModelSafeRoutingInfo& routing_info, + void RequestConfig(const csync::ModelSafeRoutingInfo& routing_info, const syncable::ModelTypeSet& types, sync_api::ConfigureReason reason); void RequestCleanupDisabledTypes( - const browser_sync::ModelSafeRoutingInfo& routing_info); + const csync::ModelSafeRoutingInfo& routing_info); // Adds a listener to be notified of sync events. // NOTE: It is OK (in fact, it's probably a good idea) to call this before @@ -514,7 +514,7 @@ class SyncManager { // Reads the nigori node to determine if any experimental features should // be enabled. // Note: opens a transaction. May be called on any thread. - bool ReceivedExperiment(browser_sync::Experiments* experiments) const; + bool ReceivedExperiment(csync::Experiments* experiments) const; // Uses a read-only transaction to determine if the directory being synced has // any remaining unsynced items. May be called on any thread. diff --git a/sync/internal_api/public/syncable/model_type.h b/sync/internal_api/public/syncable/model_type.h index b7b5fe3..c8a9905 100644 --- a/sync/internal_api/public/syncable/model_type.h +++ b/sync/internal_api/public/syncable/model_type.h @@ -90,9 +90,9 @@ enum ModelType { MODEL_TYPE_COUNT, }; -typedef browser_sync::EnumSet< +typedef csync::EnumSet< ModelType, FIRST_REAL_MODEL_TYPE, LAST_REAL_MODEL_TYPE> ModelTypeSet; -typedef browser_sync::EnumSet< +typedef csync::EnumSet< ModelType, UNSPECIFIED, LAST_REAL_MODEL_TYPE> FullModelTypeSet; inline ModelType ModelTypeFromInt(int i) { 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 cff4c92..b803b39 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 browser_sync::ModelSafeRoutingInfo; +using csync::ModelSafeRoutingInfo; namespace syncable { ModelTypePayloadMap ModelTypePayloadMapFromEnumSet( @@ -36,10 +36,10 @@ ModelTypeSet ModelTypePayloadMapToEnumSet( } ModelTypePayloadMap ModelTypePayloadMapFromRoutingInfo( - const browser_sync::ModelSafeRoutingInfo& routes, + const csync::ModelSafeRoutingInfo& routes, const std::string& payload) { ModelTypePayloadMap types_with_payloads; - for (browser_sync::ModelSafeRoutingInfo::const_iterator i = routes.begin(); + for (csync::ModelSafeRoutingInfo::const_iterator i = routes.begin(); i != routes.end(); ++i) { types_with_payloads[i->first] = payload; } 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 1bf3884..8f3319a 100644 --- a/sync/internal_api/public/syncable/model_type_payload_map.h +++ b/sync/internal_api/public/syncable/model_type_payload_map.h @@ -37,7 +37,7 @@ ModelTypeSet ModelTypePayloadMapToEnumSet( // Make a TypePayloadMap for all the enabled types in a // ModelSafeRoutingInfo using a default payload. ModelTypePayloadMap ModelTypePayloadMapFromRoutingInfo( - const browser_sync::ModelSafeRoutingInfo& routes, + const csync::ModelSafeRoutingInfo& routes, const std::string& payload); std::string ModelTypePayloadMapToString( @@ -53,7 +53,7 @@ void CoalescePayloads(ModelTypePayloadMap* original, const ModelTypePayloadMap& update); void PurgeStalePayload(ModelTypePayloadMap* original, - const browser_sync::ModelSafeRoutingInfo& routing_info); + const csync::ModelSafeRoutingInfo& routing_info); } // namespace syncable diff --git a/sync/internal_api/public/test/test_user_share.h b/sync/internal_api/public/test/test_user_share.h index 7386b18..91c4e9e 100644 --- a/sync/internal_api/public/test/test_user_share.h +++ b/sync/internal_api/public/test/test_user_share.h @@ -34,7 +34,7 @@ #include "base/basictypes.h" #include "sync/internal_api/public/user_share.h" -namespace browser_sync { +namespace csync { class TestDirectorySetterUpper; @@ -63,6 +63,6 @@ class TestUserShare { DISALLOW_COPY_AND_ASSIGN(TestUserShare); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ diff --git a/sync/internal_api/public/util/enum_set.h b/sync/internal_api/public/util/enum_set.h index de270d8..1a989ed 100644 --- a/sync/internal_api/public/util/enum_set.h +++ b/sync/internal_api/public/util/enum_set.h @@ -13,7 +13,7 @@ #include "base/basictypes.h" #include "base/logging.h" -namespace browser_sync { +namespace csync { // Forward declarations needed for friend declarations. template <typename E, E MinEnumValue, E MaxEnumValue> @@ -281,6 +281,6 @@ EnumSet<E, Min, Max> Difference(EnumSet<E, Min, Max> set1, return EnumSet<E, Min, Max>(set1.enums_ & ~set2.enums_); } -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_UTIL_ENUM_SET_H_ diff --git a/sync/internal_api/public/util/enum_set_unittest.cc b/sync/internal_api/public/util/enum_set_unittest.cc index 2caa1de..1f6223c 100644 --- a/sync/internal_api/public/util/enum_set_unittest.cc +++ b/sync/internal_api/public/util/enum_set_unittest.cc @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { enum TestEnum { @@ -192,4 +192,4 @@ TEST_F(EnumSetTest, Difference) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/util/experiments.h b/sync/internal_api/public/util/experiments.h index 1439e2b..f13c09a 100644 --- a/sync/internal_api/public/util/experiments.h +++ b/sync/internal_api/public/util/experiments.h @@ -8,7 +8,7 @@ #include "sync/internal_api/public/syncable/model_type.h" -namespace browser_sync { +namespace csync { // A structure to hold the enable status of experimental sync features. struct Experiments { diff --git a/sync/internal_api/public/util/immutable.h b/sync/internal_api/public/util/immutable.h index 6624b90..3c20a4f 100644 --- a/sync/internal_api/public/util/immutable.h +++ b/sync/internal_api/public/util/immutable.h @@ -26,7 +26,7 @@ // undesirable. Here's the above code re-written using Immutable<T>: // // void ProcessStuff( -// const browser_sync::Immutable<LargeObjectList>& stuff) { +// const csync::Immutable<LargeObjectList>& stuff) { // for (LargeObjectList::const_iterator it = stuff.Get().begin(); // it != stuff.Get().end(); ++it) { // ... process it ... @@ -72,7 +72,7 @@ #include "base/basictypes.h" #include "base/memory/ref_counted.h" -namespace browser_sync { +namespace csync { namespace internal { // This class is part of the Immutable implementation. DO NOT USE @@ -257,6 +257,6 @@ Immutable<T> MakeImmutable(T* t) { return Immutable<T>(t); } -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_IMMUTABLE_H_ diff --git a/sync/internal_api/public/util/immutable_unittest.cc b/sync/internal_api/public/util/immutable_unittest.cc index ea0b29b..e124b70 100644 --- a/sync/internal_api/public/util/immutable_unittest.cc +++ b/sync/internal_api/public/util/immutable_unittest.cc @@ -16,7 +16,7 @@ #include "base/memory/ref_counted.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { // Helper class that keeps track of the token passed in at // construction and how many times that token is copied. @@ -102,20 +102,20 @@ void swap(ADLToken& t1, ADLToken& t2) { t1.Swap(&t2); } -} // namespace browser_sync +} // namespace csync // Allowed by the standard (17.4.3.1/1). namespace std { template <> -void swap(browser_sync::SpecializationToken& t1, - browser_sync::SpecializationToken& t2) { +void swap(csync::SpecializationToken& t1, + csync::SpecializationToken& t2) { t1.Swap(&t2); } } // namespace -namespace browser_sync { +namespace csync { namespace { class ImmutableTest : public ::testing::Test {}; @@ -247,4 +247,4 @@ TEST_F(ImmutableTest, Set) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/util/report_unrecoverable_error_function.h b/sync/internal_api/public/util/report_unrecoverable_error_function.h index ead73f0..dfe00a8 100644 --- a/sync/internal_api/public/util/report_unrecoverable_error_function.h +++ b/sync/internal_api/public/util/report_unrecoverable_error_function.h @@ -6,7 +6,7 @@ #define SYNC_UTIL_REPORT_UNRECOVERABLE_ERROR_FUNCTION_H_ #pragma once -namespace browser_sync { +namespace csync { // A ReportUnrecoverableErrorFunction is a function that is called // immediately when an unrecoverable error is encountered. Unlike @@ -14,6 +14,6 @@ namespace browser_sync { // context surrounding it. typedef void (*ReportUnrecoverableErrorFunction)(void); -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_REPORT_UNRECOVERABLE_ERROR_FUNCTION_H_ diff --git a/sync/internal_api/public/util/syncer_error.cc b/sync/internal_api/public/util/syncer_error.cc index b4ba578..57cd4ed 100644 --- a/sync/internal_api/public/util/syncer_error.cc +++ b/sync/internal_api/public/util/syncer_error.cc @@ -6,7 +6,7 @@ #include "base/logging.h" -namespace browser_sync { +namespace csync { #define ENUM_CASE(x) case x: return #x; break; const char* GetSyncerErrorString(SyncerError value) { @@ -32,5 +32,5 @@ const char* GetSyncerErrorString(SyncerError value) { } #undef ENUM_CASE -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/util/syncer_error.h b/sync/internal_api/public/util/syncer_error.h index aa6ebb3..8df8afd 100644 --- a/sync/internal_api/public/util/syncer_error.h +++ b/sync/internal_api/public/util/syncer_error.h @@ -6,7 +6,7 @@ #define SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ #pragma once -namespace browser_sync { +namespace csync { // This enum describes all the ways a SyncerCommand can fail. // @@ -41,6 +41,6 @@ enum SyncerError { const char * GetSyncerErrorString(SyncerError); -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ diff --git a/sync/internal_api/public/util/unrecoverable_error_handler.h b/sync/internal_api/public/util/unrecoverable_error_handler.h index aaca1e9..a96a487 100644 --- a/sync/internal_api/public/util/unrecoverable_error_handler.h +++ b/sync/internal_api/public/util/unrecoverable_error_handler.h @@ -10,7 +10,7 @@ #include "base/location.h" -namespace browser_sync { +namespace csync { class UnrecoverableErrorHandler { public: diff --git a/sync/internal_api/public/util/unrecoverable_error_info.cc b/sync/internal_api/public/util/unrecoverable_error_info.cc index 369fa3e..ae17d2f 100644 --- a/sync/internal_api/public/util/unrecoverable_error_info.cc +++ b/sync/internal_api/public/util/unrecoverable_error_info.cc @@ -4,7 +4,7 @@ #include "sync/internal_api/public/util/unrecoverable_error_info.h" -namespace browser_sync { +namespace csync { UnrecoverableErrorInfo::UnrecoverableErrorInfo() : is_set_(false) { @@ -41,4 +41,4 @@ const std::string& UnrecoverableErrorInfo::message() const { return message_; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/util/unrecoverable_error_info.h b/sync/internal_api/public/util/unrecoverable_error_info.h index 64b780a..6e8af72 100644 --- a/sync/internal_api/public/util/unrecoverable_error_info.h +++ b/sync/internal_api/public/util/unrecoverable_error_info.h @@ -12,7 +12,7 @@ #include "base/location.h" -namespace browser_sync { +namespace csync { class UnrecoverableErrorInfo { public: @@ -36,6 +36,6 @@ class UnrecoverableErrorInfo { bool is_set_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_UNRECOVERABLE_ERROR_INFO_H_ diff --git a/sync/internal_api/public/util/weak_handle.cc b/sync/internal_api/public/util/weak_handle.cc index 136fc58..9de3f9b 100644 --- a/sync/internal_api/public/util/weak_handle.cc +++ b/sync/internal_api/public/util/weak_handle.cc @@ -10,7 +10,7 @@ #include "base/location.h" #include "base/message_loop_proxy.h" -namespace browser_sync { +namespace csync { namespace internal { diff --git a/sync/internal_api/public/util/weak_handle.h b/sync/internal_api/public/util/weak_handle.h index 653da60..fc7909e 100644 --- a/sync/internal_api/public/util/weak_handle.h +++ b/sync/internal_api/public/util/weak_handle.h @@ -68,7 +68,7 @@ namespace tracked_objects { class Location; } // namespace tracked_objects -namespace browser_sync { +namespace csync { template <typename T> class WeakHandle; @@ -286,7 +286,7 @@ class WeakHandle { // Note that this doesn't override the regular copy constructor, so // that one can be called on any thread. template <typename U> - WeakHandle(const browser_sync::WeakHandle<U>& other) // NOLINT + WeakHandle(const csync::WeakHandle<U>& other) // NOLINT : core_( other.IsInitialized() ? new internal::WeakHandleCore<T>(other.Get()) : @@ -374,6 +374,6 @@ WeakHandle<T> MakeWeakHandle(const base::WeakPtr<T>& ptr) { return WeakHandle<T>(ptr); } -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_WEAK_HANDLE_H_ diff --git a/sync/internal_api/public/util/weak_handle_unittest.cc b/sync/internal_api/public/util/weak_handle_unittest.cc index af919ad..67c7b20 100644 --- a/sync/internal_api/public/util/weak_handle_unittest.cc +++ b/sync/internal_api/public/util/weak_handle_unittest.cc @@ -13,7 +13,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { using ::testing::_; using ::testing::SaveArg; @@ -323,4 +323,4 @@ TEST_F(WeakHandleTest, TypeConversionConstructorUninitializedAssignment) { EXPECT_FALSE(base_weak_handle.IsInitialized()); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/public/write_node.h b/sync/internal_api/public/write_node.h index ba61122..670c82b 100644 --- a/sync/internal_api/public/write_node.h +++ b/sync/internal_api/public/write_node.h @@ -14,7 +14,7 @@ #include "sync/internal_api/public/base_node.h" #include "sync/internal_api/public/syncable/model_type.h" -namespace browser_sync { +namespace csync { class Cryptographer; class TestBookmarkModelAssociator; } @@ -173,8 +173,9 @@ class WriteNode : public BaseNode { virtual const BaseTransaction* GetTransaction() const OVERRIDE; + syncable::MutableEntry* GetMutableEntryForTest(); + private: - friend class browser_sync::TestBookmarkModelAssociator; FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, EncryptBookmarksWithLegacyData); void* operator new(size_t size); // Node is meant for stack use only. diff --git a/sync/internal_api/sync_manager.cc b/sync/internal_api/sync_manager.cc index 96a1ceb..0df325b 100644 --- a/sync/internal_api/sync_manager.cc +++ b/sync/internal_api/sync_manager.cc @@ -60,30 +60,30 @@ #include "sync/util/time.h" using base::TimeDelta; -using browser_sync::AllStatus; -using browser_sync::Cryptographer; -using browser_sync::Encryptor; -using browser_sync::JsArgList; -using browser_sync::JsBackend; -using browser_sync::JsEventDetails; -using browser_sync::JsEventHandler; -using browser_sync::JsEventHandler; -using browser_sync::JsReplyHandler; -using browser_sync::JsMutationEventObserver; -using browser_sync::JsSyncManagerObserver; -using browser_sync::kNigoriTag; -using browser_sync::KeyParams; -using browser_sync::ModelSafeRoutingInfo; -using browser_sync::ReportUnrecoverableErrorFunction; -using browser_sync::ServerConnectionEvent; -using browser_sync::ServerConnectionEventListener; -using browser_sync::SyncEngineEvent; -using browser_sync::SyncEngineEventListener; -using browser_sync::SyncScheduler; -using browser_sync::Syncer; -using browser_sync::UnrecoverableErrorHandler; -using browser_sync::WeakHandle; -using browser_sync::sessions::SyncSessionContext; +using csync::AllStatus; +using csync::Cryptographer; +using csync::Encryptor; +using csync::JsArgList; +using csync::JsBackend; +using csync::JsEventDetails; +using csync::JsEventHandler; +using csync::JsEventHandler; +using csync::JsReplyHandler; +using csync::JsMutationEventObserver; +using csync::JsSyncManagerObserver; +using csync::kNigoriTag; +using csync::KeyParams; +using csync::ModelSafeRoutingInfo; +using csync::ReportUnrecoverableErrorFunction; +using csync::ServerConnectionEvent; +using csync::ServerConnectionEventListener; +using csync::SyncEngineEvent; +using csync::SyncEngineEventListener; +using csync::SyncScheduler; +using csync::Syncer; +using csync::UnrecoverableErrorHandler; +using csync::WeakHandle; +using csync::sessions::SyncSessionContext; using syncable::ImmutableWriteTransactionInfo; using syncable::ModelType; using syncable::ModelTypeSet; @@ -133,7 +133,7 @@ const unsigned int kMaxMessageSizeToRecord = 5 * 1024; // SyncManager's implementation: SyncManager::SyncInternal class SyncManager::SyncInternal : public net::NetworkChangeNotifier::IPAddressObserver, - public browser_sync::Cryptographer::Observer, + public csync::Cryptographer::Observer, public csync::SyncNotifierObserver, public JsBackend, public SyncEngineEventListener, @@ -199,9 +199,9 @@ class SyncManager::SyncInternal bool use_ssl, const scoped_refptr<base::TaskRunner>& blocking_task_runner, HttpPostProviderFactory* post_factory, - const browser_sync::ModelSafeRoutingInfo& model_safe_routing_info, - const std::vector<browser_sync::ModelSafeWorker*>& workers, - browser_sync::ExtensionsActivityMonitor* + const csync::ModelSafeRoutingInfo& model_safe_routing_info, + const std::vector<csync::ModelSafeWorker*>& workers, + csync::ExtensionsActivityMonitor* extensions_activity_monitor, ChangeDelegate* change_delegate, const std::string& user_agent, @@ -228,7 +228,7 @@ class SyncManager::SyncInternal // Tell the sync engine to start the syncing process. void StartSyncingNormally( - const browser_sync::ModelSafeRoutingInfo& routing_info); + const csync::ModelSafeRoutingInfo& routing_info); // Whether or not the Nigori node is encrypted using an explicit passphrase. bool IsUsingExplicitPassphrase(); @@ -552,7 +552,7 @@ class SyncManager::SyncInternal // This can be called from any thread, but only between calls to // OpenDirectory() and ShutdownOnSyncThread(). - browser_sync::WeakHandle<SyncManager::ChangeObserver> change_observer_; + csync::WeakHandle<SyncManager::ChangeObserver> change_observer_; ObserverList<SyncManager::Observer> observers_; @@ -606,12 +606,12 @@ class SyncManager::SyncInternal JsSyncManagerObserver js_sync_manager_observer_; JsMutationEventObserver js_mutation_event_observer_; - browser_sync::ThrottledDataTypeTracker throttled_data_type_tracker_; + csync::ThrottledDataTypeTracker throttled_data_type_tracker_; // This is for keeping track of client events to send to the server. DebugInfoEventListener debug_info_event_listener_; - browser_sync::TrafficRecorder traffic_recorder_; + csync::TrafficRecorder traffic_recorder_; Encryptor* encryptor_; UnrecoverableErrorHandler* unrecoverable_error_handler_; @@ -677,7 +677,7 @@ class NudgeStrategy { break; case ACCOMPANY_ONLY: delay = TimeDelta::FromSeconds( - browser_sync::kDefaultShortPollIntervalSeconds); + csync::kDefaultShortPollIntervalSeconds); break; case CUSTOM: switch (model_type) { @@ -716,9 +716,9 @@ bool SyncManager::Init( bool use_ssl, const scoped_refptr<base::TaskRunner>& blocking_task_runner, HttpPostProviderFactory* post_factory, - const browser_sync::ModelSafeRoutingInfo& model_safe_routing_info, - const std::vector<browser_sync::ModelSafeWorker*>& workers, - browser_sync::ExtensionsActivityMonitor* extensions_activity_monitor, + const csync::ModelSafeRoutingInfo& model_safe_routing_info, + const std::vector<csync::ModelSafeWorker*>& workers, + csync::ExtensionsActivityMonitor* extensions_activity_monitor, ChangeDelegate* change_delegate, const std::string& user_agent, const SyncCredentials& credentials, @@ -775,7 +775,7 @@ syncable::ModelTypeSet SyncManager::InitialSyncEndedTypes() { } void SyncManager::StartSyncingNormally( - const browser_sync::ModelSafeRoutingInfo& routing_info) { + const csync::ModelSafeRoutingInfo& routing_info) { DCHECK(thread_checker_.CalledOnValidThread()); data_->StartSyncingNormally(routing_info); } @@ -819,7 +819,7 @@ bool SyncManager::IsUsingExplicitPassphrase() { } void SyncManager::RequestCleanupDisabledTypes( - const browser_sync::ModelSafeRoutingInfo& routing_info) { + const csync::ModelSafeRoutingInfo& routing_info) { DCHECK(thread_checker_.CalledOnValidThread()); if (data_->scheduler()) { data_->session_context()->set_routing_info(routing_info); @@ -828,7 +828,7 @@ void SyncManager::RequestCleanupDisabledTypes( } void SyncManager::RequestConfig( - const browser_sync::ModelSafeRoutingInfo& routing_info, + const csync::ModelSafeRoutingInfo& routing_info, const ModelTypeSet& types, ConfigureReason reason) { DCHECK(thread_checker_.CalledOnValidThread()); if (!data_->scheduler()) { @@ -851,7 +851,7 @@ void SyncManager::StartConfigurationMode(const base::Closure& callback) { return; } data_->scheduler()->Start( - browser_sync::SyncScheduler::CONFIGURATION_MODE, callback); + csync::SyncScheduler::CONFIGURATION_MODE, callback); } bool SyncManager::SyncInternal::Init( @@ -862,9 +862,9 @@ bool SyncManager::SyncInternal::Init( bool use_ssl, const scoped_refptr<base::TaskRunner>& blocking_task_runner, HttpPostProviderFactory* post_factory, - const browser_sync::ModelSafeRoutingInfo& model_safe_routing_info, - const std::vector<browser_sync::ModelSafeWorker*>& workers, - browser_sync::ExtensionsActivityMonitor* extensions_activity_monitor, + const csync::ModelSafeRoutingInfo& model_safe_routing_info, + const std::vector<csync::ModelSafeWorker*>& workers, + csync::ExtensionsActivityMonitor* extensions_activity_monitor, ChangeDelegate* change_delegate, const std::string& user_agent, const SyncCredentials& credentials, @@ -938,7 +938,7 @@ bool SyncManager::SyncInternal::Init( if (signed_in) { if (scheduler()) { scheduler()->Start( - browser_sync::SyncScheduler::CONFIGURATION_MODE, base::Closure()); + csync::SyncScheduler::CONFIGURATION_MODE, base::Closure()); } initialized_ = true; @@ -974,7 +974,7 @@ void SyncManager::SyncInternal::UpdateCryptographerAndNigori( const std::string& chrome_version, const base::Closure& done_callback) { DCHECK(initialized_); - browser_sync::GetSessionName( + csync::GetSessionName( blocking_task_runner_, base::Bind( &SyncManager::SyncInternal::UpdateCryptographerAndNigoriCallback, @@ -1110,7 +1110,7 @@ void SyncManager::SyncInternal::NotifyCryptographerState( } void SyncManager::SyncInternal::StartSyncingNormally( - const browser_sync::ModelSafeRoutingInfo& routing_info) { + const csync::ModelSafeRoutingInfo& routing_info) { // Start the sync scheduler. if (scheduler()) { // NULL during certain unittests. session_context()->set_routing_info(routing_info); @@ -1123,9 +1123,9 @@ bool SyncManager::SyncInternal::OpenDirectory() { // Set before Open(). change_observer_ = - browser_sync::MakeWeakHandle(js_mutation_event_observer_.AsWeakPtr()); + csync::MakeWeakHandle(js_mutation_event_observer_.AsWeakPtr()); WeakHandle<syncable::TransactionObserver> transaction_observer( - browser_sync::MakeWeakHandle(js_mutation_event_observer_.AsWeakPtr())); + csync::MakeWeakHandle(js_mutation_event_observer_.AsWeakPtr())); syncable::DirOpenResult open_result = syncable::NOT_INITIALIZED; if (testing_mode_ == TEST_IN_MEMORY) { @@ -1736,19 +1736,19 @@ void SyncManager::SyncInternal::OnServerConnectionEvent( const ServerConnectionEvent& event) { DCHECK(thread_checker_.CalledOnValidThread()); if (event.connection_code == - browser_sync::HttpResponse::SERVER_CONNECTION_OK) { + csync::HttpResponse::SERVER_CONNECTION_OK) { FOR_EACH_OBSERVER(SyncManager::Observer, observers_, OnConnectionStatusChange(CONNECTION_OK)); } - if (event.connection_code == browser_sync::HttpResponse::SYNC_AUTH_ERROR) { + if (event.connection_code == csync::HttpResponse::SYNC_AUTH_ERROR) { observing_ip_address_changes_ = false; FOR_EACH_OBSERVER(SyncManager::Observer, observers_, OnConnectionStatusChange(CONNECTION_AUTH_ERROR)); } if (event.connection_code == - browser_sync::HttpResponse::SYNC_SERVER_ERROR) { + csync::HttpResponse::SYNC_SERVER_ERROR) { FOR_EACH_OBSERVER(SyncManager::Observer, observers_, OnConnectionStatusChange(CONNECTION_SERVER_ERROR)); } @@ -1938,7 +1938,7 @@ void SyncManager::SyncInternal::RequestNudge( const tracked_objects::Location& location) { if (scheduler()) { scheduler()->ScheduleNudgeAsync( - TimeDelta::FromMilliseconds(0), browser_sync::NUDGE_SOURCE_LOCAL, + TimeDelta::FromMilliseconds(0), csync::NUDGE_SOURCE_LOCAL, ModelTypeSet(), location); } } @@ -1963,7 +1963,7 @@ void SyncManager::SyncInternal::RequestNudgeForDataTypes( types.First().Get(), this); scheduler()->ScheduleNudgeAsync(nudge_delay, - browser_sync::NUDGE_SOURCE_LOCAL, + csync::NUDGE_SOURCE_LOCAL, types, nudge_location); } @@ -2310,14 +2310,14 @@ void SyncManager::SyncInternal::OnIncomingNotification( if (scheduler()) { scheduler()->ScheduleNudgeWithPayloadsAsync( TimeDelta::FromMilliseconds(kSyncRefreshDelayMsec), - browser_sync::NUDGE_SOURCE_LOCAL_REFRESH, + csync::NUDGE_SOURCE_LOCAL_REFRESH, type_payloads, FROM_HERE); } } else if (!type_payloads.empty()) { if (scheduler()) { scheduler()->ScheduleNudgeWithPayloadsAsync( TimeDelta::FromMilliseconds(kSyncSchedulerDelayMsec), - browser_sync::NUDGE_SOURCE_NOTIFICATION, + csync::NUDGE_SOURCE_NOTIFICATION, type_payloads, FROM_HERE); } allstatus_.IncrementNotificationsReceived(); @@ -2392,7 +2392,7 @@ syncable::ModelTypeSet SyncManager::GetEncryptedDataTypesForTest() const { return GetEncryptedTypes(&trans); } -bool SyncManager::ReceivedExperiment(browser_sync::Experiments* experiments) +bool SyncManager::ReceivedExperiment(csync::Experiments* experiments) const { ReadTransaction trans(FROM_HERE, GetUserShare()); ReadNode node(&trans); diff --git a/sync/internal_api/syncapi_internal.cc b/sync/internal_api/syncapi_internal.cc index 0f7a27a..b8e8c43 100644 --- a/sync/internal_api/syncapi_internal.cc +++ b/sync/internal_api/syncapi_internal.cc @@ -9,7 +9,7 @@ #include "sync/protocol/sync.pb.h" #include "sync/util/cryptographer.h" -using browser_sync::Cryptographer; +using csync::Cryptographer; namespace sync_api { @@ -54,7 +54,7 @@ bool IsNameServerIllegalAfterTrimming(const std::string& name) { } // Compare the values of two EntitySpecifics, accounting for encryption. -bool AreSpecificsEqual(const browser_sync::Cryptographer* cryptographer, +bool AreSpecificsEqual(const csync::Cryptographer* cryptographer, const sync_pb::EntitySpecifics& left, const sync_pb::EntitySpecifics& right) { // Note that we can't compare encrypted strings directly as they are seeded diff --git a/sync/internal_api/syncapi_internal.h b/sync/internal_api/syncapi_internal.h index 162d26f..caeed2b 100644 --- a/sync/internal_api/syncapi_internal.h +++ b/sync/internal_api/syncapi_internal.h @@ -10,7 +10,7 @@ #include <string> -namespace browser_sync { +namespace csync { class Cryptographer; } @@ -22,14 +22,14 @@ class PasswordSpecificsData; namespace sync_api { sync_pb::PasswordSpecificsData* DecryptPasswordSpecifics( const sync_pb::EntitySpecifics& specifics, - browser_sync::Cryptographer* crypto); + csync::Cryptographer* crypto); void SyncAPINameToServerName(const std::string& sync_api_name, std::string* out); bool IsNameServerIllegalAfterTrimming(const std::string& name); -bool AreSpecificsEqual(const browser_sync::Cryptographer* cryptographer, +bool AreSpecificsEqual(const csync::Cryptographer* cryptographer, const sync_pb::EntitySpecifics& left, const sync_pb::EntitySpecifics& right); } diff --git a/sync/internal_api/syncapi_server_connection_manager.cc b/sync/internal_api/syncapi_server_connection_manager.cc index ca849ae..c5f7a74 100644 --- a/sync/internal_api/syncapi_server_connection_manager.cc +++ b/sync/internal_api/syncapi_server_connection_manager.cc @@ -9,12 +9,12 @@ #include "sync/internal_api/public/http_post_provider_factory.h" #include "sync/internal_api/public/http_post_provider_interface.h" -using browser_sync::HttpResponse; +using csync::HttpResponse; namespace sync_api { SyncAPIBridgedConnection::SyncAPIBridgedConnection( - browser_sync::ServerConnectionManager* scm, + csync::ServerConnectionManager* scm, HttpPostProviderFactory* factory) : Connection(scm), factory_(factory) { post_provider_ = factory_->Create(); @@ -99,7 +99,7 @@ SyncAPIServerConnectionManager::SyncAPIServerConnectionManager( SyncAPIServerConnectionManager::~SyncAPIServerConnectionManager() {} -browser_sync::ServerConnectionManager::Connection* +csync::ServerConnectionManager::Connection* SyncAPIServerConnectionManager::MakeConnection() { return new SyncAPIBridgedConnection(this, post_provider_factory_.get()); } diff --git a/sync/internal_api/syncapi_server_connection_manager.h b/sync/internal_api/syncapi_server_connection_manager.h index fafde1e..86982f6 100644 --- a/sync/internal_api/syncapi_server_connection_manager.h +++ b/sync/internal_api/syncapi_server_connection_manager.h @@ -21,9 +21,9 @@ class HttpPostProviderInterface; // This provides HTTP Post functionality through the interface provided // to the sync API by the application hosting the syncer backend. class SyncAPIBridgedConnection - : public browser_sync::ServerConnectionManager::Connection { + : public csync::ServerConnectionManager::Connection { public: - SyncAPIBridgedConnection(browser_sync::ServerConnectionManager* scm, + SyncAPIBridgedConnection(csync::ServerConnectionManager* scm, HttpPostProviderFactory* factory); virtual ~SyncAPIBridgedConnection(); @@ -31,7 +31,7 @@ class SyncAPIBridgedConnection virtual bool Init(const char* path, const std::string& auth_token, const std::string& payload, - browser_sync::HttpResponse* response) OVERRIDE; + csync::HttpResponse* response) OVERRIDE; virtual void Abort() OVERRIDE; @@ -49,7 +49,7 @@ class SyncAPIBridgedConnection // subclass so that we can override MakePost() to generate a POST object using // an instance of the HttpPostProviderFactory class. class SyncAPIServerConnectionManager - : public browser_sync::ServerConnectionManager { + : public csync::ServerConnectionManager { public: // Takes ownership of factory. SyncAPIServerConnectionManager(const std::string& server, diff --git a/sync/internal_api/syncapi_server_connection_manager_unittest.cc b/sync/internal_api/syncapi_server_connection_manager_unittest.cc index 77b5244..e719a21 100644 --- a/sync/internal_api/syncapi_server_connection_manager_unittest.cc +++ b/sync/internal_api/syncapi_server_connection_manager_unittest.cc @@ -17,9 +17,9 @@ #include "testing/gtest/include/gtest/gtest.h" using base::TimeDelta; -using browser_sync::HttpResponse; -using browser_sync::ServerConnectionManager; -using browser_sync::ScopedServerStatusWatcher; +using csync::HttpResponse; +using csync::ServerConnectionManager; +using csync::ScopedServerStatusWatcher; namespace sync_api { namespace { diff --git a/sync/internal_api/syncapi_unittest.cc b/sync/internal_api/syncapi_unittest.cc index b12c048..747b44b 100644 --- a/sync/internal_api/syncapi_unittest.cc +++ b/sync/internal_api/syncapi_unittest.cc @@ -67,24 +67,24 @@ #include "testing/gtest/include/gtest/gtest.h" using base::ExpectDictStringValue; -using browser_sync::Cryptographer; -using browser_sync::FakeEncryptor; -using browser_sync::FakeExtensionsActivityMonitor; -using browser_sync::HasArgsAsList; -using browser_sync::HasDetailsAsDictionary; -using browser_sync::KeyParams; -using browser_sync::kNigoriTag; -using browser_sync::JsArgList; -using browser_sync::JsBackend; -using browser_sync::JsEventHandler; -using browser_sync::JsReplyHandler; -using browser_sync::MockJsEventHandler; -using browser_sync::MockJsReplyHandler; -using browser_sync::ModelSafeRoutingInfo; -using browser_sync::ModelSafeWorker; -using browser_sync::sessions::SyncSessionSnapshot; -using browser_sync::TestUnrecoverableErrorHandler; -using browser_sync::WeakHandle; +using csync::Cryptographer; +using csync::FakeEncryptor; +using csync::FakeExtensionsActivityMonitor; +using csync::HasArgsAsList; +using csync::HasDetailsAsDictionary; +using csync::KeyParams; +using csync::kNigoriTag; +using csync::JsArgList; +using csync::JsBackend; +using csync::JsEventHandler; +using csync::JsReplyHandler; +using csync::MockJsEventHandler; +using csync::MockJsReplyHandler; +using csync::ModelSafeRoutingInfo; +using csync::ModelSafeWorker; +using csync::sessions::SyncSessionSnapshot; +using csync::TestUnrecoverableErrorHandler; +using csync::WeakHandle; using syncable::IS_DEL; using syncable::IS_UNSYNCED; using syncable::kEncryptedString; @@ -121,7 +121,7 @@ void ExpectTimeValue(const base::Time& expected_value, const DictionaryValue& value, const std::string& key) { std::string time_str; EXPECT_TRUE(value.GetString(key, &time_str)); - EXPECT_EQ(browser_sync::GetTimeDebugString(expected_value), time_str); + EXPECT_EQ(csync::GetTimeDebugString(expected_value), time_str); } // Makes a non-folder child of the root node. Returns the id of the @@ -245,7 +245,7 @@ class SyncApiTest : public testing::Test { protected: MessageLoop message_loop_; - browser_sync::TestUserShare test_user_share_; + csync::TestUserShare test_user_share_; }; TEST_F(SyncApiTest, SanityCheckTest) { @@ -705,7 +705,7 @@ class SyncManagerObserverMock : public SyncManager::Observer { void(ModelTypeSet, bool)); // NOLINT MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT MOCK_METHOD1(OnActionableError, - void(const browser_sync::SyncProtocolError&)); // NOLINT + void(const csync::SyncProtocolError&)); // NOLINT }; class SyncNotifierMock : public csync::SyncNotifier { @@ -815,12 +815,12 @@ class SyncManagerTest : public testing::Test, } void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) { - (*out)[syncable::NIGORI] = browser_sync::GROUP_PASSIVE; - (*out)[syncable::BOOKMARKS] = browser_sync::GROUP_PASSIVE; - (*out)[syncable::THEMES] = browser_sync::GROUP_PASSIVE; - (*out)[syncable::SESSIONS] = browser_sync::GROUP_PASSIVE; - (*out)[syncable::PASSWORDS] = browser_sync::GROUP_PASSIVE; - (*out)[syncable::PREFERENCES] = browser_sync::GROUP_PASSIVE; + (*out)[syncable::NIGORI] = csync::GROUP_PASSIVE; + (*out)[syncable::BOOKMARKS] = csync::GROUP_PASSIVE; + (*out)[syncable::THEMES] = csync::GROUP_PASSIVE; + (*out)[syncable::SESSIONS] = csync::GROUP_PASSIVE; + (*out)[syncable::PASSWORDS] = csync::GROUP_PASSIVE; + (*out)[syncable::PREFERENCES] = csync::GROUP_PASSIVE; } virtual void OnChangesApplied( @@ -1844,7 +1844,7 @@ TEST_F(SyncManagerTest, NudgeDelayTest) { EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncable::AUTOFILL), base::TimeDelta::FromSeconds( - browser_sync::kDefaultShortPollIntervalSeconds)); + csync::kDefaultShortPollIntervalSeconds)); EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncable::PREFERENCES), base::TimeDelta::FromMilliseconds( @@ -2463,7 +2463,7 @@ TEST_F(SyncManagerTest, SetPreviouslyEncryptedSpecifics) { EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION)); { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); - browser_sync::Cryptographer* crypto = trans.GetCryptographer(); + csync::Cryptographer* crypto = trans.GetCryptographer(); sync_pb::EntitySpecifics bm_specifics; bm_specifics.mutable_bookmark()->set_title("title"); bm_specifics.mutable_bookmark()->set_url("url"); @@ -2511,4 +2511,4 @@ TEST_F(SyncManagerTest, SetPreviouslyEncryptedSpecifics) { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/test/test_user_share.cc b/sync/internal_api/test/test_user_share.cc index 2fc0d60..1934bc3 100644 --- a/sync/internal_api/test/test_user_share.cc +++ b/sync/internal_api/test/test_user_share.cc @@ -9,7 +9,7 @@ #include "sync/test/engine/test_directory_setter_upper.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { TestUserShare::TestUserShare() : dir_maker_(new TestDirectorySetterUpper()) {} @@ -39,4 +39,4 @@ sync_api::UserShare* TestUserShare::user_share() { return user_share_.get(); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/internal_api/write_node.cc b/sync/internal_api/write_node.cc index e281fcd..24dd9f0 100644 --- a/sync/internal_api/write_node.cc +++ b/sync/internal_api/write_node.cc @@ -21,7 +21,7 @@ #include "sync/syncable/mutable_entry.h" #include "sync/util/cryptographer.h" -using browser_sync::Cryptographer; +using csync::Cryptographer; using std::string; using std::vector; using syncable::kEncryptedString; @@ -205,7 +205,7 @@ void WriteNode::SetEntitySpecifics( if (GetModelType() != syncable::UNSPECIFIED) { DCHECK_EQ(new_specifics_type, GetModelType()); } - browser_sync::Cryptographer* cryptographer = + csync::Cryptographer* cryptographer = GetTransaction()->GetCryptographer(); // Preserve unknown fields. @@ -479,6 +479,10 @@ const BaseTransaction* WriteNode::GetTransaction() const { return transaction_; } +syncable::MutableEntry* WriteNode::GetMutableEntryForTest() { + return entry_; +} + void WriteNode::Remove() { entry_->Put(syncable::IS_DEL, true); MarkForSyncing(); diff --git a/sync/js/js_arg_list.cc b/sync/js/js_arg_list.cc index c95235a..754a2e4 100644 --- a/sync/js/js_arg_list.cc +++ b/sync/js/js_arg_list.cc @@ -6,7 +6,7 @@ #include "base/json/json_writer.h" -namespace browser_sync { +namespace csync { JsArgList::JsArgList() {} @@ -24,4 +24,4 @@ std::string JsArgList::ToString() const { return str; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/js/js_arg_list.h b/sync/js/js_arg_list.h index 40cf712..28244e8 100644 --- a/sync/js/js_arg_list.h +++ b/sync/js/js_arg_list.h @@ -13,7 +13,7 @@ #include "base/values.h" #include "sync/internal_api/public/util/immutable.h" -namespace browser_sync { +namespace csync { // A thin wrapper around Immutable<ListValue>. Used for passing // around argument lists to different threads. @@ -39,6 +39,6 @@ class JsArgList { ImmutableListValue args_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_JS_ARG_LIST_H_ diff --git a/sync/js/js_arg_list_unittest.cc b/sync/js/js_arg_list_unittest.cc index 3f00e4b..55044b7 100644 --- a/sync/js/js_arg_list_unittest.cc +++ b/sync/js/js_arg_list_unittest.cc @@ -7,7 +7,7 @@ #include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { class JsArgListTest : public testing::Test {}; @@ -37,4 +37,4 @@ TEST_F(JsArgListTest, FromList) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/js/js_backend.h b/sync/js/js_backend.h index 3c7f89a..f0febee 100644 --- a/sync/js/js_backend.h +++ b/sync/js/js_backend.h @@ -10,7 +10,7 @@ #include <string> -namespace browser_sync { +namespace csync { class JsArgList; class JsEventHandler; @@ -36,6 +36,6 @@ class JsBackend { virtual ~JsBackend() {} }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_JS_BACKEND_H_ diff --git a/sync/js/js_controller.h b/sync/js/js_controller.h index d0deb20..e1a0d8a 100644 --- a/sync/js/js_controller.h +++ b/sync/js/js_controller.h @@ -10,7 +10,7 @@ #include <string> -namespace browser_sync { +namespace csync { class JsArgList; class JsEventHandler; @@ -45,6 +45,6 @@ class JsController { virtual ~JsController() {} }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_JS_CONTROLLER_H_ diff --git a/sync/js/js_event_details.cc b/sync/js/js_event_details.cc index b455b01..c5e3f71 100644 --- a/sync/js/js_event_details.cc +++ b/sync/js/js_event_details.cc @@ -6,7 +6,7 @@ #include "base/json/json_writer.h" -namespace browser_sync { +namespace csync { JsEventDetails::JsEventDetails() {} @@ -24,4 +24,4 @@ std::string JsEventDetails::ToString() const { return str; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/js/js_event_details.h b/sync/js/js_event_details.h index fe05066..ad93b67 100644 --- a/sync/js/js_event_details.h +++ b/sync/js/js_event_details.h @@ -13,7 +13,7 @@ #include "base/values.h" #include "sync/internal_api/public/util/immutable.h" -namespace browser_sync { +namespace csync { // A thin wrapper around Immutable<DictionaryValue>. Used for passing // around event details to different threads. @@ -40,6 +40,6 @@ class JsEventDetails { ImmutableDictionaryValue details_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_JS_EVENT_DETAILS_H_ diff --git a/sync/js/js_event_details_unittest.cc b/sync/js/js_event_details_unittest.cc index 01cea19..b734ec9 100644 --- a/sync/js/js_event_details_unittest.cc +++ b/sync/js/js_event_details_unittest.cc @@ -7,7 +7,7 @@ #include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { class JsEventDetailsTest : public testing::Test {}; @@ -33,4 +33,4 @@ TEST_F(JsEventDetailsTest, FromDictionary) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/js/js_event_handler.h b/sync/js/js_event_handler.h index ce15903..9eb73b6 100644 --- a/sync/js/js_event_handler.h +++ b/sync/js/js_event_handler.h @@ -10,7 +10,7 @@ #include <string> -namespace browser_sync { +namespace csync { class JsEventDetails; @@ -25,6 +25,6 @@ class JsEventHandler { virtual ~JsEventHandler() {} }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_JS_EVENT_HANDLER_H_ diff --git a/sync/js/js_reply_handler.h b/sync/js/js_reply_handler.h index 3b10309..9749297 100644 --- a/sync/js/js_reply_handler.h +++ b/sync/js/js_reply_handler.h @@ -10,7 +10,7 @@ #include <string> -namespace browser_sync { +namespace csync { class JsArgList; @@ -25,6 +25,6 @@ class JsReplyHandler { virtual ~JsReplyHandler() {} }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_JS_REPLY_HANDLER_H_ diff --git a/sync/js/js_test_util.cc b/sync/js/js_test_util.cc index 257a947..d90485b 100644 --- a/sync/js/js_test_util.cc +++ b/sync/js/js_test_util.cc @@ -9,7 +9,7 @@ #include "sync/js/js_arg_list.h" #include "sync/js/js_event_details.h" -namespace browser_sync { +namespace csync { void PrintTo(const JsArgList& args, ::std::ostream* os) { *os << args.ToString(); @@ -133,5 +133,5 @@ WeakHandle<JsReplyHandler> MockJsReplyHandler::AsWeakHandle() { return MakeWeakHandle(AsWeakPtr()); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/js/js_test_util.h b/sync/js/js_test_util.h index 3e8b24a..042019b1 100644 --- a/sync/js/js_test_util.h +++ b/sync/js/js_test_util.h @@ -22,7 +22,7 @@ class DictionaryValue; class ListValue; } -namespace browser_sync { +namespace csync { class JsArgList; class JsEventDetails; @@ -104,6 +104,6 @@ class MockJsReplyHandler void(const ::std::string&, const JsArgList&)); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_JS_TEST_UTIL_H_ diff --git a/sync/js/sync_js_controller.cc b/sync/js/sync_js_controller.cc index 0448486..b2f57ea 100644 --- a/sync/js/sync_js_controller.cc +++ b/sync/js/sync_js_controller.cc @@ -8,7 +8,7 @@ #include "sync/js/js_backend.h" #include "sync/js/js_event_details.h" -namespace browser_sync { +namespace csync { SyncJsController::PendingJsMessage::PendingJsMessage( const std::string& name, const JsArgList& args, @@ -80,4 +80,4 @@ void SyncJsController::UpdateBackendEventHandler() { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/js/sync_js_controller.h b/sync/js/sync_js_controller.h index dcc792d2..26ac93ba 100644 --- a/sync/js/sync_js_controller.h +++ b/sync/js/sync_js_controller.h @@ -18,7 +18,7 @@ #include "sync/js/js_controller.h" #include "sync/js/js_event_handler.h" -namespace browser_sync { +namespace csync { class JsBackend; @@ -76,6 +76,6 @@ class SyncJsController DISALLOW_COPY_AND_ASSIGN(SyncJsController); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_JS_SYNC_JS_CONTROLLER_H_ diff --git a/sync/js/sync_js_controller_unittest.cc b/sync/js/sync_js_controller_unittest.cc index 10a982d..3a8728f 100644 --- a/sync/js/sync_js_controller_unittest.cc +++ b/sync/js/sync_js_controller_unittest.cc @@ -12,7 +12,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { using ::testing::_; @@ -123,4 +123,4 @@ TEST_F(SyncJsControllerTest, Events) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/notifier/chrome_invalidation_client.cc b/sync/notifier/chrome_invalidation_client.cc index 3557494..0ec2c40 100644 --- a/sync/notifier/chrome_invalidation_client.cc +++ b/sync/notifier/chrome_invalidation_client.cc @@ -52,7 +52,7 @@ void ChromeInvalidationClient::Start( const std::string& client_id, const std::string& client_info, const std::string& state, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, Listener* listener) { DCHECK(CalledOnValidThread()); diff --git a/sync/notifier/chrome_invalidation_client.h b/sync/notifier/chrome_invalidation_client.h index 2ba7f7a..20733e9 100644 --- a/sync/notifier/chrome_invalidation_client.h +++ b/sync/notifier/chrome_invalidation_client.h @@ -73,7 +73,7 @@ class ChromeInvalidationClient const std::string& client_id, const std::string& client_info, const std::string& state, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, Listener* listener); @@ -140,7 +140,7 @@ class ChromeInvalidationClient notifier::PushClient* const push_client_; ChromeSystemResources chrome_system_resources_; InvalidationVersionMap max_invalidation_versions_; - browser_sync::WeakHandle<InvalidationStateTracker> + csync::WeakHandle<InvalidationStateTracker> invalidation_state_tracker_; Listener* listener_; scoped_ptr<invalidation::InvalidationClient> invalidation_client_; diff --git a/sync/notifier/chrome_invalidation_client_unittest.cc b/sync/notifier/chrome_invalidation_client_unittest.cc index 8cfe490..fae864d 100644 --- a/sync/notifier/chrome_invalidation_client_unittest.cc +++ b/sync/notifier/chrome_invalidation_client_unittest.cc @@ -66,7 +66,7 @@ class ChromeInvalidationClientTest : public testing::Test { virtual void SetUp() { client_.Start(kClientId, kClientInfo, kState, InvalidationVersionMap(), - browser_sync::MakeWeakHandle( + csync::MakeWeakHandle( mock_invalidation_state_tracker_.AsWeakPtr()), &mock_listener_); } diff --git a/sync/notifier/invalidation_notifier.cc b/sync/notifier/invalidation_notifier.cc index 119c54d0..a57336e 100644 --- a/sync/notifier/invalidation_notifier.cc +++ b/sync/notifier/invalidation_notifier.cc @@ -20,7 +20,7 @@ InvalidationNotifier::InvalidationNotifier( scoped_ptr<notifier::PushClient> push_client, const InvalidationVersionMap& initial_max_invalidation_versions, const std::string& initial_invalidation_state, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info) : state_(STOPPED), diff --git a/sync/notifier/invalidation_notifier.h b/sync/notifier/invalidation_notifier.h index cc5dab2..b47f76f 100644 --- a/sync/notifier/invalidation_notifier.h +++ b/sync/notifier/invalidation_notifier.h @@ -43,7 +43,7 @@ class InvalidationNotifier scoped_ptr<notifier::PushClient> push_client, const InvalidationVersionMap& initial_max_invalidation_versions, const std::string& initial_invalidation_state, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info); @@ -84,7 +84,7 @@ class InvalidationNotifier const InvalidationVersionMap initial_max_invalidation_versions_; // Passed to |invalidation_client_|. - const browser_sync::WeakHandle<InvalidationStateTracker> + const csync::WeakHandle<InvalidationStateTracker> invalidation_state_tracker_; // Passed to |invalidation_client_|. diff --git a/sync/notifier/invalidation_notifier_unittest.cc b/sync/notifier/invalidation_notifier_unittest.cc index 16ad31a..4001223 100644 --- a/sync/notifier/invalidation_notifier_unittest.cc +++ b/sync/notifier/invalidation_notifier_unittest.cc @@ -48,7 +48,7 @@ class InvalidationNotifierTest : public testing::Test { scoped_ptr<notifier::PushClient>(new notifier::FakePushClient()), InvalidationVersionMap(), initial_invalidation_state, - browser_sync::MakeWeakHandle(mock_tracker_.AsWeakPtr()), + csync::MakeWeakHandle(mock_tracker_.AsWeakPtr()), "fake_client_info")); invalidation_notifier_->AddObserver(&mock_observer_); } diff --git a/sync/notifier/non_blocking_invalidation_notifier.cc b/sync/notifier/non_blocking_invalidation_notifier.cc index f5fc0b2..4f3459d 100644 --- a/sync/notifier/non_blocking_invalidation_notifier.cc +++ b/sync/notifier/non_blocking_invalidation_notifier.cc @@ -23,7 +23,7 @@ class NonBlockingInvalidationNotifier::Core // Called on parent thread. |delegate_observer| should be // initialized. explicit Core( - const browser_sync::WeakHandle<SyncNotifierObserver>& + const csync::WeakHandle<SyncNotifierObserver>& delegate_observer); // Helpers called on I/O thread. @@ -31,7 +31,7 @@ class NonBlockingInvalidationNotifier::Core const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, const std::string& initial_invalidation_state, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info); void Teardown(); @@ -56,7 +56,7 @@ class NonBlockingInvalidationNotifier::Core ~Core(); // The variables below should be used only on the I/O thread. - const browser_sync::WeakHandle<SyncNotifierObserver> delegate_observer_; + const csync::WeakHandle<SyncNotifierObserver> delegate_observer_; scoped_ptr<InvalidationNotifier> invalidation_notifier_; scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; @@ -64,7 +64,7 @@ class NonBlockingInvalidationNotifier::Core }; NonBlockingInvalidationNotifier::Core::Core( - const browser_sync::WeakHandle<SyncNotifierObserver>& + const csync::WeakHandle<SyncNotifierObserver>& delegate_observer) : delegate_observer_(delegate_observer) { DCHECK(delegate_observer_.IsInitialized()); @@ -77,7 +77,7 @@ void NonBlockingInvalidationNotifier::Core::Initialize( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, const std::string& initial_invalidation_state, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info) { DCHECK(notifier_options.request_context_getter); @@ -155,12 +155,12 @@ NonBlockingInvalidationNotifier::NonBlockingInvalidationNotifier( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, const std::string& initial_invalidation_state, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info) : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), core_( - new Core(browser_sync::MakeWeakHandle( + new Core(csync::MakeWeakHandle( weak_ptr_factory_.GetWeakPtr()))), parent_task_runner_( base::ThreadTaskRunnerHandle::Get()), diff --git a/sync/notifier/non_blocking_invalidation_notifier.h b/sync/notifier/non_blocking_invalidation_notifier.h index 9eedd75..0385c72 100644 --- a/sync/notifier/non_blocking_invalidation_notifier.h +++ b/sync/notifier/non_blocking_invalidation_notifier.h @@ -38,7 +38,7 @@ class NonBlockingInvalidationNotifier const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, const std::string& initial_invalidation_state, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info); diff --git a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc b/sync/notifier/non_blocking_invalidation_notifier_unittest.cc index f749e22..2c4cfa7 100644 --- a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc +++ b/sync/notifier/non_blocking_invalidation_notifier_unittest.cc @@ -43,7 +43,7 @@ class NonBlockingInvalidationNotifierTest : public testing::Test { notifier_options, InvalidationVersionMap(), std::string(), // initial_invalidation_state - browser_sync::MakeWeakHandle( + csync::MakeWeakHandle( base::WeakPtr<csync::InvalidationStateTracker>()), "fake_client_info")); invalidation_notifier_->AddObserver(&mock_observer_); diff --git a/sync/notifier/sync_notifier_factory.cc b/sync/notifier/sync_notifier_factory.cc index b78fac7..d528987 100644 --- a/sync/notifier/sync_notifier_factory.cc +++ b/sync/notifier/sync_notifier_factory.cc @@ -19,7 +19,7 @@ SyncNotifier* CreateDefaultSyncNotifier( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, const std::string& initial_invalidation_state, - const browser_sync::WeakHandle<InvalidationStateTracker>& + const csync::WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info) { if (notifier_options.notification_method == notifier::NOTIFICATION_P2P) { diff --git a/sync/notifier/sync_notifier_factory.h b/sync/notifier/sync_notifier_factory.h index 323c09b..851db09 100644 --- a/sync/notifier/sync_notifier_factory.h +++ b/sync/notifier/sync_notifier_factory.h @@ -40,7 +40,7 @@ class SyncNotifierFactory { const std::string client_info_; const InvalidationVersionMap initial_max_invalidation_versions_; const std::string initial_invalidation_state_; - const browser_sync::WeakHandle<InvalidationStateTracker> + const csync::WeakHandle<InvalidationStateTracker> invalidation_state_tracker_; }; diff --git a/sync/protocol/proto_enum_conversions.cc b/sync/protocol/proto_enum_conversions.cc index 7c6433e..f8fc148 100644 --- a/sync/protocol/proto_enum_conversions.cc +++ b/sync/protocol/proto_enum_conversions.cc @@ -9,7 +9,7 @@ #include "base/basictypes.h" #include "base/logging.h" -namespace browser_sync { +namespace csync { #define ASSERT_ENUM_BOUNDS(enum_parent, enum_type, enum_min, enum_max) \ COMPILE_ASSERT(enum_parent::enum_type##_MIN == enum_parent::enum_min, \ diff --git a/sync/protocol/proto_enum_conversions.h b/sync/protocol/proto_enum_conversions.h index abb65ed1..f9c07da 100644 --- a/sync/protocol/proto_enum_conversions.h +++ b/sync/protocol/proto_enum_conversions.h @@ -14,7 +14,7 @@ // Utility functions to get the string equivalent for some sync proto // enums. -namespace browser_sync { +namespace csync { // The returned strings (which don't have to be freed) are in ASCII. // The result of passing in an invalid enum value is undefined. @@ -45,6 +45,6 @@ const char* GetDeviceTypeString( const char* GetFaviconTypeString( sync_pb::SessionTab::FaviconType favicon_type); -} // namespace browser_sync +} // namespace csync #endif // SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_ diff --git a/sync/protocol/proto_enum_conversions_unittest.cc b/sync/protocol/proto_enum_conversions_unittest.cc index 5fa53b2..eb69d5a 100644 --- a/sync/protocol/proto_enum_conversions_unittest.cc +++ b/sync/protocol/proto_enum_conversions_unittest.cc @@ -10,7 +10,7 @@ #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { class ProtoEnumConversionsTest : public testing::Test { @@ -90,4 +90,4 @@ TEST_F(ProtoEnumConversionsTest, GetActionString) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc index 4f31b8e..8b2e819 100644 --- a/sync/protocol/proto_value_conversions.cc +++ b/sync/protocol/proto_value_conversions.cc @@ -29,7 +29,7 @@ #include "sync/protocol/theme_specifics.pb.h" #include "sync/protocol/typed_url_specifics.pb.h" -namespace browser_sync { +namespace csync { namespace { @@ -593,4 +593,4 @@ DictionaryValue* ClientToServerMessageToValue( #undef SET_FIELD -} // namespace browser_sync +} // namespace csync diff --git a/sync/protocol/proto_value_conversions.h b/sync/protocol/proto_value_conversions.h index 4fa8ca5..6c61903 100644 --- a/sync/protocol/proto_value_conversions.h +++ b/sync/protocol/proto_value_conversions.h @@ -50,7 +50,7 @@ class TypedUrlSpecifics; // // TODO(akalin): Improve enum support. -namespace browser_sync { +namespace csync { // Ownership of all returned DictionaryValues are transferred to the // caller. @@ -148,6 +148,6 @@ base::DictionaryValue* ClientToServerResponseToValue( bool include_specifics); -} // namespace browser_sync +} // namespace csync #endif // SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ diff --git a/sync/protocol/proto_value_conversions_unittest.cc b/sync/protocol/proto_value_conversions_unittest.cc index 4c4c6a7..6363c736 100644 --- a/sync/protocol/proto_value_conversions_unittest.cc +++ b/sync/protocol/proto_value_conversions_unittest.cc @@ -27,7 +27,7 @@ #include "sync/protocol/typed_url_specifics.pb.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { class ProtoValueConversionsTest : public testing::Test { @@ -250,4 +250,4 @@ TEST_F(ProtoValueConversionsTest, ClientToServerResponseToValue) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/protocol/sync_protocol_error.cc b/sync/protocol/sync_protocol_error.cc index 544d98a..61c0351 100644 --- a/sync/protocol/sync_protocol_error.cc +++ b/sync/protocol/sync_protocol_error.cc @@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/values.h" -namespace browser_sync { +namespace csync { #define ENUM_CASE(x) case x: return #x; break; const char* GetSyncErrorTypeString(SyncProtocolErrorType type) { @@ -59,5 +59,5 @@ DictionaryValue* SyncProtocolError::ToValue() const { return value; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/protocol/sync_protocol_error.h b/sync/protocol/sync_protocol_error.h index be43980..fc83de1 100644 --- a/sync/protocol/sync_protocol_error.h +++ b/sync/protocol/sync_protocol_error.h @@ -10,7 +10,7 @@ #include "base/values.h" #include "sync/internal_api/public/syncable/model_type.h" -namespace browser_sync{ +namespace csync{ enum SyncProtocolErrorType { // Success case. @@ -76,6 +76,6 @@ struct SyncProtocolError { const char* GetSyncErrorTypeString(SyncProtocolErrorType type); const char* GetClientActionString(ClientAction action); -} // namespace browser_sync +} // namespace csync #endif // SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ diff --git a/sync/sessions/debug_info_getter.h b/sync/sessions/debug_info_getter.h index 257a853..3dea807 100644 --- a/sync/sessions/debug_info_getter.h +++ b/sync/sessions/debug_info_getter.h @@ -7,7 +7,7 @@ #include "sync/protocol/sync.pb.h" -namespace browser_sync { +namespace csync { namespace sessions { // This is the interface that needs to be implemented by the event listener @@ -21,7 +21,7 @@ class DebugInfoGetter { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_SESSIONS_DEBUG_INFO_GETTER_H_ diff --git a/sync/sessions/ordered_commit_set.cc b/sync/sessions/ordered_commit_set.cc index c3fc5d0..91bc5e2 100644 --- a/sync/sessions/ordered_commit_set.cc +++ b/sync/sessions/ordered_commit_set.cc @@ -8,11 +8,11 @@ #include "base/logging.h" -namespace browser_sync { +namespace csync { namespace sessions { OrderedCommitSet::OrderedCommitSet( - const browser_sync::ModelSafeRoutingInfo& routes) + const csync::ModelSafeRoutingInfo& routes) : routes_(routes) { } @@ -32,7 +32,7 @@ void OrderedCommitSet::AddCommitItem(const int64 metahandle, } const OrderedCommitSet::Projection& OrderedCommitSet::GetCommitIdProjection( - browser_sync::ModelSafeGroup group) const { + csync::ModelSafeGroup group) const { Projections::const_iterator i = projections_.find(group); DCHECK(i != projections_.end()); return i->second; @@ -124,5 +124,5 @@ void OrderedCommitSet::operator=(const OrderedCommitSet& other) { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/ordered_commit_set.h b/sync/sessions/ordered_commit_set.h index e29737f..7c1937e 100644 --- a/sync/sessions/ordered_commit_set.h +++ b/sync/sessions/ordered_commit_set.h @@ -14,7 +14,7 @@ #include "sync/internal_api/public/syncable/model_type.h" #include "sync/syncable/syncable_id.h" -namespace browser_sync { +namespace csync { namespace sessions { // TODO(ncarter): This code is more generic than just Commit and can @@ -30,7 +30,7 @@ class OrderedCommitSet { typedef std::vector<size_t> Projection; // TODO(chron): Reserve space according to batch size? - explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes); + explicit OrderedCommitSet(const csync::ModelSafeRoutingInfo& routes); ~OrderedCommitSet(); bool HaveCommitItem(const int64 metahandle) const { @@ -65,7 +65,7 @@ class OrderedCommitSet { // response one ModelSafeGroup at a time. See GetCommitIdAt for how the // indices contained in the returned Projection can be used. const Projection& GetCommitIdProjection( - browser_sync::ModelSafeGroup group) const; + csync::ModelSafeGroup group) const; size_t Size() const { return commit_ids_.size(); @@ -89,7 +89,7 @@ class OrderedCommitSet { void operator=(const OrderedCommitSet& other); private: // A set of CommitIdProjections associated with particular ModelSafeGroups. - typedef std::map<browser_sync::ModelSafeGroup, Projection> Projections; + typedef std::map<csync::ModelSafeGroup, Projection> Projections; // Helper container for return value of GetCommitItemAt. struct CommitItem { @@ -115,11 +115,11 @@ class OrderedCommitSet { // and shouldn't take up too much extra space since commit lists are small. std::vector<syncable::ModelType> types_; - browser_sync::ModelSafeRoutingInfo routes_; + csync::ModelSafeRoutingInfo routes_; }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_SESSIONS_ORDERED_COMMIT_SET_H_ diff --git a/sync/sessions/ordered_commit_set_unittest.cc b/sync/sessions/ordered_commit_set_unittest.cc index 6310c9d..85ca08f 100644 --- a/sync/sessions/ordered_commit_set_unittest.cc +++ b/sync/sessions/ordered_commit_set_unittest.cc @@ -11,17 +11,17 @@ using std::vector; class OrderedCommitSetTest : public testing::Test { public: OrderedCommitSetTest() { - routes_[syncable::BOOKMARKS] = browser_sync::GROUP_UI; - routes_[syncable::PREFERENCES] = browser_sync::GROUP_UI; - routes_[syncable::AUTOFILL] = browser_sync::GROUP_DB; - routes_[syncable::TOP_LEVEL_FOLDER] = browser_sync::GROUP_PASSIVE; + routes_[syncable::BOOKMARKS] = csync::GROUP_UI; + routes_[syncable::PREFERENCES] = csync::GROUP_UI; + routes_[syncable::AUTOFILL] = csync::GROUP_DB; + routes_[syncable::TOP_LEVEL_FOLDER] = csync::GROUP_PASSIVE; } protected: - browser_sync::TestIdFactory ids_; - browser_sync::ModelSafeRoutingInfo routes_; + csync::TestIdFactory ids_; + csync::ModelSafeRoutingInfo routes_; }; -namespace browser_sync { +namespace csync { namespace sessions { TEST_F(OrderedCommitSetTest, Projections) { @@ -128,5 +128,5 @@ TEST_F(OrderedCommitSetTest, AddAndRemoveEntries) { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/session_state.cc b/sync/sessions/session_state.cc index 1eaf2d0..7562522 100644 --- a/sync/sessions/session_state.cc +++ b/sync/sessions/session_state.cc @@ -13,7 +13,7 @@ using std::set; using std::vector; -namespace browser_sync { +namespace csync { namespace sessions { ConflictProgress::ConflictProgress(bool* dirty_flag) @@ -155,4 +155,4 @@ PerModelSafeGroupState::~PerModelSafeGroupState() { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/session_state.h b/sync/sessions/session_state.h index ae55acb..5384f44 100644 --- a/sync/sessions/session_state.h +++ b/sync/sessions/session_state.h @@ -23,7 +23,7 @@ #include "sync/internal_api/public/sessions/syncer_status.h" #include "sync/syncable/syncable_id.h" -namespace browser_sync { +namespace csync { namespace sessions { class UpdateProgress; @@ -196,6 +196,6 @@ struct PerModelSafeGroupState { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_SESSIONS_SESSION_STATE_H_ diff --git a/sync/sessions/session_state_unittest.cc b/sync/sessions/session_state_unittest.cc index a1a0898..8e396c9 100644 --- a/sync/sessions/session_state_unittest.cc +++ b/sync/sessions/session_state_unittest.cc @@ -17,7 +17,7 @@ #include "sync/internal_api/public/sessions/syncer_status.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace sessions { namespace { @@ -152,4 +152,4 @@ TEST_F(SessionStateTest, SyncSessionSnapshotToValue) { } // namespace } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/status_controller.cc b/sync/sessions/status_controller.cc index 0e8e6a6..1339da8 100644 --- a/sync/sessions/status_controller.cc +++ b/sync/sessions/status_controller.cc @@ -10,7 +10,7 @@ #include "sync/internal_api/public/syncable/model_type.h" #include "sync/protocol/sync_protocol_error.h" -namespace browser_sync { +namespace csync { namespace sessions { using syncable::FIRST_REAL_MODEL_TYPE; @@ -287,4 +287,4 @@ bool StatusController::debug_info_sent() const { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/status_controller.h b/sync/sessions/status_controller.h index ebb77ba..7fc49f8 100644 --- a/sync/sessions/status_controller.h +++ b/sync/sessions/status_controller.h @@ -42,7 +42,7 @@ #include "sync/sessions/ordered_commit_set.h" #include "sync/sessions/session_state.h" -namespace browser_sync { +namespace csync { namespace sessions { class StatusController { diff --git a/sync/sessions/status_controller_unittest.cc b/sync/sessions/status_controller_unittest.cc index 2e0f44d..84d352f 100644 --- a/sync/sessions/status_controller_unittest.cc +++ b/sync/sessions/status_controller_unittest.cc @@ -6,7 +6,7 @@ #include "sync/test/engine/test_id_factory.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace sessions { class StatusControllerTest : public testing::Test { @@ -162,4 +162,4 @@ TEST_F(StatusControllerTest, Unrestricted) { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc index eed4f88..876c736 100644 --- a/sync/sessions/sync_session.cc +++ b/sync/sessions/sync_session.cc @@ -11,7 +11,7 @@ #include "sync/internal_api/public/syncable/model_type.h" #include "sync/syncable/directory.h" -namespace browser_sync { +namespace csync { namespace sessions { namespace { @@ -260,4 +260,4 @@ void SyncSession::SetFinished() { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h index c903be9..6ccae9e 100644 --- a/sync/sessions/sync_session.h +++ b/sync/sessions/sync_session.h @@ -37,7 +37,7 @@ namespace syncable { class WriteTransaction; } -namespace browser_sync { +namespace csync { class ModelSafeWorker; namespace sessions { @@ -247,6 +247,6 @@ class ScopedSetSessionWriteTransaction { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_SESSIONS_SYNC_SESSION_H_ diff --git a/sync/sessions/sync_session_context.cc b/sync/sessions/sync_session_context.cc index ce9d938..22f7582 100644 --- a/sync/sessions/sync_session_context.cc +++ b/sync/sessions/sync_session_context.cc @@ -8,7 +8,7 @@ #include "sync/sessions/debug_info_getter.h" #include "sync/util/extensions_activity_monitor.h" -namespace browser_sync { +namespace csync { namespace sessions { const unsigned int kMaxMessagesToRecord = 10; @@ -23,7 +23,7 @@ SyncSessionContext::SyncSessionContext( ThrottledDataTypeTracker* throttled_data_type_tracker, const std::vector<SyncEngineEventListener*>& listeners, DebugInfoGetter* debug_info_getter, - browser_sync::TrafficRecorder* traffic_recorder) + csync::TrafficRecorder* traffic_recorder) : resolver_(NULL), connection_manager_(connection_manager), directory_(directory), @@ -44,4 +44,4 @@ SyncSessionContext::~SyncSessionContext() { } } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h index ebde3f3..20f574c 100644 --- a/sync/sessions/sync_session_context.h +++ b/sync/sessions/sync_session_context.h @@ -34,7 +34,7 @@ namespace syncable { class Directory; } -namespace browser_sync { +namespace csync { class ConflictResolver; class ExtensionsActivityMonitor; @@ -58,7 +58,7 @@ class SyncSessionContext { ThrottledDataTypeTracker* throttled_data_type_tracker, const std::vector<SyncEngineEventListener*>& listeners, DebugInfoGetter* debug_info_getter, - browser_sync::TrafficRecorder* traffic_recorder); + csync::TrafficRecorder* traffic_recorder); ~SyncSessionContext(); ConflictResolver* resolver() { return resolver_; } @@ -124,7 +124,7 @@ class SyncSessionContext { OnSyncEngineEvent(event)); } - browser_sync::TrafficRecorder* traffic_recorder() { + csync::TrafficRecorder* traffic_recorder() { return traffic_recorder_; } @@ -174,7 +174,7 @@ class SyncSessionContext { // client behavior on server side. DebugInfoGetter* const debug_info_getter_; - browser_sync::TrafficRecorder* traffic_recorder_; + csync::TrafficRecorder* traffic_recorder_; DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); }; @@ -203,6 +203,6 @@ class ScopedSessionContextConflictResolver { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc index fa5e986..f1d8031 100644 --- a/sync/sessions/sync_session_unittest.cc +++ b/sync/sessions/sync_session_unittest.cc @@ -23,7 +23,7 @@ using syncable::WriteTransaction; -namespace browser_sync { +namespace csync { namespace sessions { namespace { @@ -537,4 +537,4 @@ TEST_F(SyncSessionTest, CoalescePayloads) { } // namespace } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/test_util.cc b/sync/sessions/test_util.cc index a54c8f00..d1bd5b7 100644 --- a/sync/sessions/test_util.cc +++ b/sync/sessions/test_util.cc @@ -4,7 +4,7 @@ #include "sync/sessions/test_util.h" -namespace browser_sync { +namespace csync { namespace sessions { namespace test_util { @@ -63,4 +63,4 @@ void SimulateSessionsCommitDelayUpdateImpl(sessions::SyncSession* session, } // namespace test_util } // namespace sessions -} // namespace browser_sync +} // namespace csync diff --git a/sync/sessions/test_util.h b/sync/sessions/test_util.h index aad02e2..01fa3aa 100644 --- a/sync/sessions/test_util.h +++ b/sync/sessions/test_util.h @@ -12,7 +12,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace sessions { namespace test_util { @@ -47,6 +47,6 @@ ACTION_P(SimulateSessionsCommitDelayUpdate, poll) { } // namespace test_util } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_SESSIONS_TEST_UTIL_H_ diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc index 40179b2..ec78f29 100644 --- a/sync/syncable/directory.cc +++ b/sync/syncable/directory.cc @@ -21,9 +21,9 @@ #include "sync/syncable/syncable_util.h" #include "sync/syncable/write_transaction.h" -using browser_sync::Encryptor; -using browser_sync::ReportUnrecoverableErrorFunction; -using browser_sync::UnrecoverableErrorHandler; +using csync::Encryptor; +using csync::ReportUnrecoverableErrorFunction; +using csync::UnrecoverableErrorHandler; using std::string; namespace syncable { @@ -113,7 +113,7 @@ const FilePath::CharType Directory::kSyncDatabaseFilename[] = void Directory::InitKernelForTest( const std::string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer) { DCHECK(!kernel_); kernel_ = new Kernel(name, KernelLoadInfo(), delegate, transaction_observer); @@ -145,7 +145,7 @@ Directory::SaveChangesSnapshot::~SaveChangesSnapshot() {} Directory::Kernel::Kernel( const std::string& name, const KernelLoadInfo& info, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer) : refcount(1), next_write_transaction_id(0), @@ -208,7 +208,7 @@ Directory::~Directory() { DirOpenResult Directory::Open( const FilePath& file_path, const string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer) { TRACE_EVENT0("sync", "SyncDatabaseOpen"); @@ -226,7 +226,7 @@ DirOpenResult Directory::Open( DirOpenResult Directory::OpenInMemoryForTest( const string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer) { DirectoryBackingStore* store = new InMemoryDirectoryBackingStore(name); @@ -261,7 +261,7 @@ DirOpenResult Directory::OpenImpl( DirectoryBackingStore* store, const string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer) { DCHECK_EQ(static_cast<DirectoryBackingStore*>(NULL), store_); store_ = store; @@ -797,7 +797,7 @@ string Directory::cache_guid() const { return kernel_->cache_guid; } -browser_sync::Cryptographer* Directory::GetCryptographer( +csync::Cryptographer* Directory::GetCryptographer( const BaseTransaction* trans) { DCHECK_EQ(this, trans->directory()); return &cryptographer_; diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h index dc47732..95ab97a 100644 --- a/sync/syncable/directory.h +++ b/sync/syncable/directory.h @@ -20,7 +20,7 @@ #include "sync/syncable/scoped_kernel_lock.h" #include "sync/util/cryptographer.h" -namespace browser_sync { +namespace csync { class Encryptor; class UnrecoverableErrorHandler; } @@ -201,9 +201,9 @@ class Directory { // Does not take ownership of |encryptor|. // |report_unrecoverable_error_function| may be NULL. Directory( - browser_sync::Encryptor* encryptor, - browser_sync::UnrecoverableErrorHandler* unrecoverable_error_handler, - browser_sync::ReportUnrecoverableErrorFunction + csync::Encryptor* encryptor, + csync::UnrecoverableErrorHandler* unrecoverable_error_handler, + csync::ReportUnrecoverableErrorFunction report_unrecoverable_error_function); virtual ~Directory(); @@ -213,7 +213,7 @@ class Directory { // thread. |transaction_observer| must be initialized. DirOpenResult Open(const FilePath& file_path, const std::string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer); // Same as above, but does not create a file to persist the database. This is @@ -221,7 +221,7 @@ class Directory { // want to pay the performance penalty of using a real database. DirOpenResult OpenInMemoryForTest( const std::string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer); // Stops sending events to the delegate and the transaction @@ -269,7 +269,7 @@ class Directory { // Returns a pointer to our cryptographer. Does not transfer ownership. The // cryptographer is not thread safe; it should not be accessed after the // transaction has been released. - browser_sync::Cryptographer* GetCryptographer(const BaseTransaction* trans); + csync::Cryptographer* GetCryptographer(const BaseTransaction* trans); // Returns true if the directory had encountered an unrecoverable error. // Note: Any function in |Directory| that can be called without holding a @@ -315,7 +315,7 @@ class Directory { DirOpenResult OpenImpl( DirectoryBackingStore* store, const std::string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer); private: @@ -483,7 +483,7 @@ class Directory { void InitKernelForTest( const std::string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer); private: @@ -492,7 +492,7 @@ class Directory { // initialized. Kernel(const std::string& name, const KernelLoadInfo& info, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer); ~Kernel(); @@ -566,7 +566,7 @@ class Directory { DirectoryChangeDelegate* const delegate; // The transaction observer. - const browser_sync::WeakHandle<TransactionObserver> transaction_observer; + const csync::WeakHandle<TransactionObserver> transaction_observer; }; // Helper method used to do searches on |parent_id_child_index|. @@ -605,14 +605,14 @@ class Directory { EntryKernel* GetPossibleLastChildForTest( const ScopedKernelLock& lock, const Id& parent_id); - browser_sync::Cryptographer cryptographer_; + csync::Cryptographer cryptographer_; Kernel* kernel_; DirectoryBackingStore* store_; - browser_sync::UnrecoverableErrorHandler* const unrecoverable_error_handler_; - const browser_sync::ReportUnrecoverableErrorFunction + csync::UnrecoverableErrorHandler* const unrecoverable_error_handler_; + const csync::ReportUnrecoverableErrorFunction report_unrecoverable_error_function_; bool unrecoverable_error_set_; }; diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc index 12bc419..177f1ec 100644 --- a/sync/syncable/directory_backing_store.cc +++ b/sync/syncable/directory_backing_store.cc @@ -50,7 +50,7 @@ void BindFields(const EntryKernel& entry, } for ( ; i < TIME_FIELDS_END; ++i) { statement->BindInt64(index++, - browser_sync::TimeToProtoTime( + csync::TimeToProtoTime( entry.ref(static_cast<TimeField>(i)))); } for ( ; i < ID_FIELDS_END; ++i) { @@ -80,7 +80,7 @@ EntryKernel* UnpackEntry(sql::Statement* statement) { } for ( ; i < TIME_FIELDS_END; ++i) { kernel->put(static_cast<TimeField>(i), - browser_sync::ProtoTimeToTime(statement->ColumnInt64(i))); + csync::ProtoTimeToTime(statement->ColumnInt64(i))); } for ( ; i < ID_FIELDS_END; ++i) { kernel->mutable_ref(static_cast<IdField>(i)).s_ = @@ -996,7 +996,7 @@ bool DirectoryBackingStore::CreateTables() { { // Insert the entry for the root into the metas table. - const int64 now = browser_sync::TimeToProtoTime(base::Time::Now()); + const int64 now = csync::TimeToProtoTime(base::Time::Now()); sql::Statement s(db_->GetUniqueStatement( "INSERT INTO metas " "( id, metahandle, is_dir, ctime, mtime) " diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc index 62b7ccf..bfb01407 100644 --- a/sync/syncable/directory_backing_store_unittest.cc +++ b/sync/syncable/directory_backing_store_unittest.cc @@ -287,7 +287,7 @@ std::map<int64, base::Time> GetExpectedMetaTimes() { expected_meta_proto_times.begin(); it != expected_meta_proto_times.end(); ++it) { expected_meta_times[it->first] = - browser_sync::ProtoTimeToTime(it->second); + csync::ProtoTimeToTime(it->second); } return expected_meta_times; } @@ -327,8 +327,8 @@ std::map<int64, int64> GetMetaProtoTimes(sql::Connection *db) { << t1_expr << " and " << t2_expr << " (internal values: " << t1.ToInternalValue() << " and " << t2.ToInternalValue() - << ") (proto time: " << browser_sync::TimeToProtoTime(t1) - << " and " << browser_sync::TimeToProtoTime(t2) + << ") (proto time: " << csync::TimeToProtoTime(t1) + << " and " << csync::TimeToProtoTime(t2) << ") do not match"; } diff --git a/sync/syncable/entry.cc b/sync/syncable/entry.cc index 3f3e785..b9d05a0 100644 --- a/sync/syncable/entry.cc +++ b/sync/syncable/entry.cc @@ -110,7 +110,7 @@ std::ostream& operator<<(std::ostream& os, const Entry& entry) { } for ( ; i < TIME_FIELDS_END; ++i) { os << g_metas_columns[i].name << ": " - << browser_sync::GetTimeDebugString( + << csync::GetTimeDebugString( kernel->ref(static_cast<TimeField>(i))) << ", "; } for ( ; i < ID_FIELDS_END; ++i) { diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc index 0ea3d4e..83fc2c4 100644 --- a/sync/syncable/entry_kernel.cc +++ b/sync/syncable/entry_kernel.cc @@ -61,7 +61,7 @@ StringValue* Int64ToValue(int64 i) { } StringValue* TimeToValue(const base::Time& t) { - return Value::CreateStringValue(browser_sync::GetTimeDebugString(t)); + return Value::CreateStringValue(csync::GetTimeDebugString(t)); } StringValue* IdToValue(const Id& id) { @@ -119,7 +119,7 @@ DictionaryValue* EntryKernel::ToValue() const { // Proto fields. SetFieldValues(*this, kernel_info, - &GetProtoFieldString, &browser_sync::EntitySpecificsToValue, + &GetProtoFieldString, &csync::EntitySpecificsToValue, PROTO_FIELDS_BEGIN, PROTO_FIELDS_END - 1); // Bit temps. diff --git a/sync/syncable/entry_kernel.h b/sync/syncable/entry_kernel.h index 5c16f1d..3a4e54c 100644 --- a/sync/syncable/entry_kernel.h +++ b/sync/syncable/entry_kernel.h @@ -216,8 +216,8 @@ struct EntryKernel { // Round-trip to proto time format and back so that we have // consistent time resolutions (ms). time_fields[field - TIME_FIELDS_BEGIN] = - browser_sync::ProtoTimeToTime( - browser_sync::TimeToProtoTime(value)); + csync::ProtoTimeToTime( + csync::TimeToProtoTime(value)); } inline void put(IdField field, const Id& value) { id_fields[field - ID_FIELDS_BEGIN] = value; @@ -307,7 +307,7 @@ struct EntryKernelMutation { typedef std::map<int64, EntryKernelMutation> EntryKernelMutationMap; -typedef browser_sync::Immutable<EntryKernelMutationMap> +typedef csync::Immutable<EntryKernelMutationMap> ImmutableEntryKernelMutationMap; // Caller owns the return value. diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc index 7589e7f..19a1588 100644 --- a/sync/syncable/model_type.cc +++ b/sync/syncable/model_type.cc @@ -146,8 +146,8 @@ int GetSpecificsFieldNumberFromModelType(ModelType model_type) { // Note: keep this consistent with GetModelType in syncable.cc! ModelType GetModelType(const sync_pb::SyncEntity& sync_pb_entity) { - const browser_sync::SyncEntity& sync_entity = - static_cast<const browser_sync::SyncEntity&>(sync_pb_entity); + const csync::SyncEntity& sync_entity = + static_cast<const csync::SyncEntity&>(sync_pb_entity); DCHECK(!sync_entity.id().IsRoot()); // Root shouldn't ever go over the wire. if (sync_entity.deleted()) diff --git a/sync/syncable/syncable_id_unittest.cc b/sync/syncable/syncable_id_unittest.cc index 67524b3..605a678 100644 --- a/sync/syncable/syncable_id_unittest.cc +++ b/sync/syncable/syncable_id_unittest.cc @@ -16,7 +16,7 @@ using std::vector; namespace syncable { -using browser_sync::TestIdFactory; +using csync::TestIdFactory; class SyncableIdTest : public testing::Test { }; diff --git a/sync/syncable/syncable_mock.cc b/sync/syncable/syncable_mock.cc index 24990d1..77b4743 100644 --- a/sync/syncable/syncable_mock.cc +++ b/sync/syncable/syncable_mock.cc @@ -7,7 +7,7 @@ #include "base/location.h" #include "sync/test/null_transaction_observer.h" -MockDirectory::MockDirectory(browser_sync::UnrecoverableErrorHandler* handler) +MockDirectory::MockDirectory(csync::UnrecoverableErrorHandler* handler) : Directory(&encryptor_, handler, NULL) { InitKernelForTest("myk", &delegate_, syncable::NullTransactionObserver()); } diff --git a/sync/syncable/syncable_mock.h b/sync/syncable/syncable_mock.h index 0dec075..a829ad2 100644 --- a/sync/syncable/syncable_mock.h +++ b/sync/syncable/syncable_mock.h @@ -20,7 +20,7 @@ using syncable::EntryKernel; class MockDirectory : public Directory { public: - explicit MockDirectory(browser_sync::UnrecoverableErrorHandler* handler); + explicit MockDirectory(csync::UnrecoverableErrorHandler* handler); virtual ~MockDirectory(); MOCK_METHOD1(GetEntryByHandle, syncable::EntryKernel*(int64)); @@ -33,7 +33,7 @@ class MockDirectory : public Directory { MOCK_METHOD1(PurgeEntriesWithTypeIn, void(syncable::ModelTypeSet)); private: - browser_sync::FakeEncryptor encryptor_; + csync::FakeEncryptor encryptor_; syncable::NullDirectoryChangeDelegate delegate_; }; diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc index bc821bf..b820902 100644 --- a/sync/syncable/syncable_unittest.cc +++ b/sync/syncable/syncable_unittest.cc @@ -37,9 +37,9 @@ using base::ExpectDictBooleanValue; using base::ExpectDictStringValue; -using browser_sync::FakeEncryptor; -using browser_sync::TestIdFactory; -using browser_sync::TestUnrecoverableErrorHandler; +using csync::FakeEncryptor; +using csync::TestIdFactory; +using csync::TestUnrecoverableErrorHandler; namespace syncable { @@ -401,7 +401,7 @@ class TestUnsaveableDirectory : public Directory { DirOpenResult OpenUnsaveable( const FilePath& file_path, const std::string& name, DirectoryChangeDelegate* delegate, - const browser_sync::WeakHandle<TransactionObserver>& + const csync::WeakHandle<TransactionObserver>& transaction_observer) { DirectoryBackingStore *store = new UnsaveableBackingStore(name, file_path); DirOpenResult result = @@ -1151,14 +1151,14 @@ TEST_F(SyncableDirectoryTest, GetModelType) { server_item.Put(SERVER_IS_DEL, false); ASSERT_EQ(datatype, server_item.GetServerModelType()); - browser_sync::SyncEntity folder_entity; + csync::SyncEntity folder_entity; folder_entity.set_id(id_factory.NewServerId()); folder_entity.set_deleted(false); folder_entity.set_folder(true); folder_entity.mutable_specifics()->CopyFrom(specifics); ASSERT_EQ(datatype, folder_entity.GetModelType()); - browser_sync::SyncEntity item_entity; + csync::SyncEntity item_entity; item_entity.set_id(id_factory.NewServerId()); item_entity.set_deleted(false); item_entity.set_folder(false); diff --git a/sync/syncable/write_transaction_info.h b/sync/syncable/write_transaction_info.h index 9441bf5..b49c376 100644 --- a/sync/syncable/write_transaction_info.h +++ b/sync/syncable/write_transaction_info.h @@ -32,7 +32,7 @@ struct WriteTransactionInfo { }; typedef - browser_sync::Immutable<WriteTransactionInfo> + csync::Immutable<WriteTransactionInfo> ImmutableWriteTransactionInfo; } // namespace syncable diff --git a/sync/test/engine/fake_model_worker.cc b/sync/test/engine/fake_model_worker.cc index 3c254f5..f394bc0 100644 --- a/sync/test/engine/fake_model_worker.cc +++ b/sync/test/engine/fake_model_worker.cc @@ -4,7 +4,7 @@ #include "sync/test/engine/fake_model_worker.h" -namespace browser_sync { +namespace csync { FakeModelWorker::FakeModelWorker(ModelSafeGroup group) : group_(group) {} @@ -28,4 +28,4 @@ ModelSafeGroup FakeModelWorker::GetModelSafeGroup() { return group_; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/test/engine/fake_model_worker.h b/sync/test/engine/fake_model_worker.h index 59a9e0b..b9ca42d 100644 --- a/sync/test/engine/fake_model_worker.h +++ b/sync/test/engine/fake_model_worker.h @@ -14,7 +14,7 @@ #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/internal_api/public/util/syncer_error.h" -namespace browser_sync { +namespace csync { // Fake implementation of ModelSafeWorker that does work on the // current thread regardless of the group. @@ -35,7 +35,7 @@ class FakeModelWorker : public ModelSafeWorker, public base::NonThreadSafe { DISALLOW_COPY_AND_ASSIGN(FakeModelWorker); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc index f7ecac0..4bf97f5 100644 --- a/sync/test/engine/mock_connection_manager.cc +++ b/sync/test/engine/mock_connection_manager.cc @@ -17,12 +17,12 @@ #include "sync/test/engine/test_id_factory.h" #include "testing/gtest/include/gtest/gtest.h" -using browser_sync::HttpResponse; -using browser_sync::ServerConnectionManager; -using browser_sync::ServerConnectionEventListener; -using browser_sync::ServerConnectionEvent; -using browser_sync::SyncerProtoUtil; -using browser_sync::TestIdFactory; +using csync::HttpResponse; +using csync::ServerConnectionManager; +using csync::ServerConnectionEventListener; +using csync::ServerConnectionEvent; +using csync::SyncerProtoUtil; +using csync::TestIdFactory; using std::map; using std::string; using sync_pb::ClientToServerMessage; @@ -85,7 +85,7 @@ void MockConnectionManager::SetMidCommitObserver( bool MockConnectionManager::PostBufferToPath(PostBufferParams* params, const string& path, const string& auth_token, - browser_sync::ScopedServerStatusWatcher* watcher) { + csync::ScopedServerStatusWatcher* watcher) { ClientToServerMessage post; CHECK(post.ParseFromString(params->buffer_in)); last_request_.CopyFrom(post); diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h index 84c802c..644ef4e 100644 --- a/sync/test/engine/mock_connection_manager.h +++ b/sync/test/engine/mock_connection_manager.h @@ -21,7 +21,7 @@ #include "sync/internal_api/public/syncable/model_type_payload_map.h" #include "sync/protocol/sync.pb.h" -class MockConnectionManager : public browser_sync::ServerConnectionManager { +class MockConnectionManager : public csync::ServerConnectionManager { public: class MidCommitObserver { public: @@ -39,7 +39,7 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { PostBufferParams*, const std::string& path, const std::string& auth_token, - browser_sync::ScopedServerStatusWatcher* watcher) OVERRIDE; + csync::ScopedServerStatusWatcher* watcher) OVERRIDE; // Control of commit response. // NOTE: Commit callback is invoked only once then reset. diff --git a/sync/test/engine/syncer_command_test.cc b/sync/test/engine/syncer_command_test.cc index 9275e17..61313b1 100644 --- a/sync/test/engine/syncer_command_test.cc +++ b/sync/test/engine/syncer_command_test.cc @@ -4,7 +4,7 @@ #include "sync/test/engine/syncer_command_test.h" -namespace browser_sync { +namespace csync { const unsigned int kMaxMessages = 10; const unsigned int kMaxMessageSize = 5 * 1024; @@ -63,4 +63,4 @@ Directory* MockDirectorySyncerCommandTest::directory() { return &mock_directory_; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/test/engine/syncer_command_test.h b/sync/test/engine/syncer_command_test.h index 0fc70b3..e519b6b 100644 --- a/sync/test/engine/syncer_command_test.h +++ b/sync/test/engine/syncer_command_test.h @@ -30,9 +30,9 @@ using ::testing::NiceMock; -namespace browser_sync { +namespace csync { -class MockDebugInfoGetter : public browser_sync::sessions::DebugInfoGetter { +class MockDebugInfoGetter : public csync::sessions::DebugInfoGetter { public: MockDebugInfoGetter(); virtual ~MockDebugInfoGetter(); @@ -233,6 +233,6 @@ class MockDirectorySyncerCommandTest : public SyncerCommandTestBase { MockDirectory mock_directory_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ diff --git a/sync/test/engine/test_directory_setter_upper.cc b/sync/test/engine/test_directory_setter_upper.cc index 5303bea..28b9c5c 100644 --- a/sync/test/engine/test_directory_setter_upper.cc +++ b/sync/test/engine/test_directory_setter_upper.cc @@ -16,7 +16,7 @@ using syncable::NullTransactionObserver; using syncable::ReadTransaction; -namespace browser_sync { +namespace csync { TestDirectorySetterUpper::TestDirectorySetterUpper() : name_("Test") {} @@ -57,4 +57,4 @@ void TestDirectorySetterUpper::RunInvariantCheck() { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/test/engine/test_directory_setter_upper.h b/sync/test/engine/test_directory_setter_upper.h index 7e2f894..17ce8da 100644 --- a/sync/test/engine/test_directory_setter_upper.h +++ b/sync/test/engine/test_directory_setter_upper.h @@ -45,7 +45,7 @@ namespace syncable { class Directory; } -namespace browser_sync { +namespace csync { class TestDirectorySetterUpper { public: @@ -76,6 +76,6 @@ class TestDirectorySetterUpper { DISALLOW_COPY_AND_ASSIGN(TestDirectorySetterUpper); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_ diff --git a/sync/test/engine/test_id_factory.h b/sync/test/engine/test_id_factory.h index cb82ce4..a0163c8 100644 --- a/sync/test/engine/test_id_factory.h +++ b/sync/test/engine/test_id_factory.h @@ -13,7 +13,7 @@ #include "base/string_number_conversions.h" #include "sync/syncable/syncable_id.h" -namespace browser_sync { +namespace csync { class TestIdFactory { public: @@ -67,7 +67,7 @@ class TestIdFactory { int next_value_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_TEST_ENGINE_TEST_ID_FACTORY_H_ diff --git a/sync/test/fake_encryptor.cc b/sync/test/fake_encryptor.cc index 3d03050..bc7f22d 100644 --- a/sync/test/fake_encryptor.cc +++ b/sync/test/fake_encryptor.cc @@ -6,7 +6,7 @@ #include "base/base64.h" -namespace browser_sync { +namespace csync { FakeEncryptor::~FakeEncryptor() {} @@ -20,4 +20,4 @@ bool FakeEncryptor::DecryptString(const std::string& ciphertext, return base::Base64Decode(ciphertext, plaintext); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/test/fake_encryptor.h b/sync/test/fake_encryptor.h index 7e21061..8b83a43 100644 --- a/sync/test/fake_encryptor.h +++ b/sync/test/fake_encryptor.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "sync/util/encryptor.h" -namespace browser_sync { +namespace csync { // Encryptor which simply base64-encodes the plaintext to get the // ciphertext. Obviously, this should be used only for testing. @@ -24,6 +24,6 @@ class FakeEncryptor : public Encryptor { std::string* plaintext) OVERRIDE; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_TEST_FAKE_ENCRYPTOR_H_ diff --git a/sync/test/fake_extensions_activity_monitor.cc b/sync/test/fake_extensions_activity_monitor.cc index 4cf5042..2484448 100644 --- a/sync/test/fake_extensions_activity_monitor.cc +++ b/sync/test/fake_extensions_activity_monitor.cc @@ -6,7 +6,7 @@ #include "base/logging.h" -namespace browser_sync { +namespace csync { FakeExtensionsActivityMonitor::FakeExtensionsActivityMonitor() {} @@ -28,4 +28,4 @@ void FakeExtensionsActivityMonitor::PutRecords(const Records& records) { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/test/fake_extensions_activity_monitor.h b/sync/test/fake_extensions_activity_monitor.h index 4152bf7..3ff0ce7 100644 --- a/sync/test/fake_extensions_activity_monitor.h +++ b/sync/test/fake_extensions_activity_monitor.h @@ -10,7 +10,7 @@ #include "base/threading/non_thread_safe.h" #include "sync/util/extensions_activity_monitor.h" -namespace browser_sync { +namespace csync { // Fake non-thread-safe implementation of ExtensionsActivityMonitor // suitable to be used in single-threaded sync tests. @@ -29,6 +29,6 @@ class FakeExtensionsActivityMonitor Records records_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_ diff --git a/sync/test/null_transaction_observer.cc b/sync/test/null_transaction_observer.cc index 7902433..e400fad 100644 --- a/sync/test/null_transaction_observer.cc +++ b/sync/test/null_transaction_observer.cc @@ -8,8 +8,8 @@ namespace syncable { -browser_sync::WeakHandle<TransactionObserver> NullTransactionObserver() { - return browser_sync::MakeWeakHandle(base::WeakPtr<TransactionObserver>()); +csync::WeakHandle<TransactionObserver> NullTransactionObserver() { + return csync::MakeWeakHandle(base::WeakPtr<TransactionObserver>()); } } // namespace syncable diff --git a/sync/test/null_transaction_observer.h b/sync/test/null_transaction_observer.h index 6fa36e2..b84580e 100644 --- a/sync/test/null_transaction_observer.h +++ b/sync/test/null_transaction_observer.h @@ -14,7 +14,7 @@ class TransactionObserver; // Returns an initialized weak handle to a transaction observer that // does nothing. -browser_sync::WeakHandle<TransactionObserver> NullTransactionObserver(); +csync::WeakHandle<TransactionObserver> NullTransactionObserver(); } // namespace syncable diff --git a/sync/test/sessions/test_scoped_session_event_listener.h b/sync/test/sessions/test_scoped_session_event_listener.h index f2cdadd..17fc160 100644 --- a/sync/test/sessions/test_scoped_session_event_listener.h +++ b/sync/test/sessions/test_scoped_session_event_listener.h @@ -8,7 +8,7 @@ #include "sync/sessions/sync_session_context.h" -namespace browser_sync { +namespace csync { namespace sessions { // Installs a SyncEventListener to a given session context for the lifetime of @@ -31,6 +31,6 @@ class TestScopedSessionEventListener { }; } // namespace sessions -} // namespace browser_sync +} // namespace csync #endif // SYNC_TEST_SESSIONS_TEST_SCOPED_SESSION_EVENT_LISTENER_H_ diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc index e2ab5e2..d316149 100644 --- a/sync/util/cryptographer.cc +++ b/sync/util/cryptographer.cc @@ -10,7 +10,7 @@ #include "base/logging.h" #include "sync/util/encryptor.h" -namespace browser_sync { +namespace csync { const char kNigoriTag[] = "google_chrome_nigori"; @@ -450,4 +450,4 @@ void Cryptographer::InstallKeyBag(const sync_pb::NigoriKeyBag& bag) { } } -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/cryptographer.h b/sync/util/cryptographer.h index b711f29..24dbf1b 100644 --- a/sync/util/cryptographer.h +++ b/sync/util/cryptographer.h @@ -18,7 +18,7 @@ #include "sync/protocol/nigori_specifics.pb.h" #include "sync/util/nigori.h" -namespace browser_sync { +namespace csync { class Encryptor; @@ -248,6 +248,6 @@ class Cryptographer { DISALLOW_COPY_AND_ASSIGN(Cryptographer); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_CRYPTOGRAPHER_H_ diff --git a/sync/util/cryptographer_unittest.cc b/sync/util/cryptographer_unittest.cc index c999916..fbb97ff 100644 --- a/sync/util/cryptographer_unittest.cc +++ b/sync/util/cryptographer_unittest.cc @@ -15,7 +15,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { @@ -388,4 +388,4 @@ TEST_F(SyncCryptographerTest, UnknownSensitiveTypes) { cryptographer_.RemoveObserver(&observer); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/data_type_histogram_unittest.cc b/sync/util/data_type_histogram_unittest.cc index 676ebb7..9b5d0ea 100644 --- a/sync/util/data_type_histogram_unittest.cc +++ b/sync/util/data_type_histogram_unittest.cc @@ -7,7 +7,7 @@ #include "base/time.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { class DataTypeHistogramTest : public testing::Test { @@ -60,4 +60,4 @@ TEST(DataTypeHistogramTest, BasicEnum) { } } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/encryptor.h b/sync/util/encryptor.h index 1549caf..415d6b1 100644 --- a/sync/util/encryptor.h +++ b/sync/util/encryptor.h @@ -8,7 +8,7 @@ #include <string> -namespace browser_sync { +namespace csync { class Encryptor { public: @@ -23,6 +23,6 @@ class Encryptor { virtual ~Encryptor() {} }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_ENCRYPTOR_H_ diff --git a/sync/util/extensions_activity_monitor.cc b/sync/util/extensions_activity_monitor.cc index 0414823..24d3b0f 100644 --- a/sync/util/extensions_activity_monitor.cc +++ b/sync/util/extensions_activity_monitor.cc @@ -4,7 +4,7 @@ #include "sync/util/extensions_activity_monitor.h" -namespace browser_sync { +namespace csync { ExtensionsActivityMonitor::Record::Record() : bookmark_write_count(0U) {} @@ -13,4 +13,4 @@ ExtensionsActivityMonitor::Record::~Record() {} ExtensionsActivityMonitor::~ExtensionsActivityMonitor() {} -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/extensions_activity_monitor.h b/sync/util/extensions_activity_monitor.h index 9a5fdef..4533f17 100644 --- a/sync/util/extensions_activity_monitor.h +++ b/sync/util/extensions_activity_monitor.h @@ -11,7 +11,7 @@ #include "base/basictypes.h" -namespace browser_sync { +namespace csync { // An interface to monitor usage of extensions APIs to send to sync // servers, with the ability to purge data once sync servers have @@ -48,6 +48,6 @@ class ExtensionsActivityMonitor { virtual ~ExtensionsActivityMonitor(); }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_EXTENSIONS_ACTIVITY_MONITOR_H_ diff --git a/sync/util/get_session_name.cc b/sync/util/get_session_name.cc index 5917191..cd26bba 100644 --- a/sync/util/get_session_name.cc +++ b/sync/util/get_session_name.cc @@ -23,7 +23,7 @@ #include "sync/util/session_utils_android.h" #endif -namespace browser_sync { +namespace csync { namespace { @@ -85,4 +85,4 @@ std::string GetSessionNameSynchronouslyForTesting() { return GetSessionNameSynchronously(); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/get_session_name.h b/sync/util/get_session_name.h index dc53295..ea84aee 100644 --- a/sync/util/get_session_name.h +++ b/sync/util/get_session_name.h @@ -15,7 +15,7 @@ namespace base { class TaskRunner; } // namespace base -namespace browser_sync { +namespace csync { void GetSessionName( const scoped_refptr<base::TaskRunner>& task_runner, @@ -23,6 +23,6 @@ void GetSessionName( std::string GetSessionNameSynchronouslyForTesting(); -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_GET_SESSION_NAME_H_ diff --git a/sync/util/get_session_name_mac.h b/sync/util/get_session_name_mac.h index 771f48f..d262f8d 100644 --- a/sync/util/get_session_name_mac.h +++ b/sync/util/get_session_name_mac.h @@ -8,7 +8,7 @@ #include <string> -namespace browser_sync { +namespace csync { namespace internal { // Returns the Hardware model name, without trailing numbers, if @@ -18,6 +18,6 @@ namespace internal { std::string GetHardwareModelName(); } // namespace internal -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_GET_SESSION_NAME_MAC_H_ diff --git a/sync/util/get_session_name_mac.mm b/sync/util/get_session_name_mac.mm index 4b46139..73a77b9 100644 --- a/sync/util/get_session_name_mac.mm +++ b/sync/util/get_session_name_mac.mm @@ -19,7 +19,7 @@ - (NSString*)localizedName; @end -namespace browser_sync { +namespace csync { namespace internal { std::string GetHardwareModelName() { @@ -48,4 +48,4 @@ std::string GetHardwareModelName() { } } // namespace internal -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/get_session_name_unittest.cc b/sync/util/get_session_name_unittest.cc index b335cd0..03c9be4 100644 --- a/sync/util/get_session_name_unittest.cc +++ b/sync/util/get_session_name_unittest.cc @@ -9,7 +9,7 @@ #include "sync/util/get_session_name.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { @@ -45,4 +45,4 @@ TEST_F(GetSessionNameTest, GetSessionName) { } // namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/get_session_name_win.cc b/sync/util/get_session_name_win.cc index 499930b..c79b7845 100644 --- a/sync/util/get_session_name_win.cc +++ b/sync/util/get_session_name_win.cc @@ -6,7 +6,7 @@ #include <windows.h> -namespace browser_sync { +namespace csync { namespace internal { std::string GetComputerName() { @@ -18,4 +18,4 @@ std::string GetComputerName() { } } // namespace internal -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/get_session_name_win.h b/sync/util/get_session_name_win.h index 1d6b1eb..590e679 100644 --- a/sync/util/get_session_name_win.h +++ b/sync/util/get_session_name_win.h @@ -8,12 +8,12 @@ #include <string> -namespace browser_sync { +namespace csync { namespace internal { std::string GetComputerName(); } // namespace internal -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_GET_SESSION_NAME_WIN_H_ diff --git a/sync/util/logging.cc b/sync/util/logging.cc index 3d2a269..9458379 100644 --- a/sync/util/logging.cc +++ b/sync/util/logging.cc @@ -6,7 +6,7 @@ #include "base/location.h" -namespace browser_sync { +namespace csync { bool VlogIsOnForLocation(const tracked_objects::Location& from_here, int verbose_level) { @@ -15,4 +15,4 @@ bool VlogIsOnForLocation(const tracked_objects::Location& from_here, from_here.file_name(), ::strlen(from_here.file_name()))); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/logging.h b/sync/util/logging.h index 45e901e44..97d215b 100644 --- a/sync/util/logging.h +++ b/sync/util/logging.h @@ -14,12 +14,12 @@ namespace tracked_objects { class Location; } // namespace tracked_objects -namespace browser_sync { +namespace csync { bool VlogIsOnForLocation(const tracked_objects::Location& from_here, int verbose_level); -} // namespace browser_sync +} // namespace csync #define VLOG_LOC_STREAM(from_here, verbose_level) \ logging::LogMessage(from_here.file_name(), from_here.line_number(), \ @@ -30,6 +30,6 @@ bool VlogIsOnForLocation(const tracked_objects::Location& from_here, VLOG_LOC_STREAM(from_here, verbose_level), \ ::logging::DEBUG_MODE && \ (VLOG_IS_ON(verbose_level) || \ - ::browser_sync::VlogIsOnForLocation(from_here, verbose_level))) \ + ::csync::VlogIsOnForLocation(from_here, verbose_level))) \ #endif // SYNC_UTIL_LOGGING_H_ diff --git a/sync/util/nigori.cc b/sync/util/nigori.cc index 0b96b37..f68956d 100644 --- a/sync/util/nigori.cc +++ b/sync/util/nigori.cc @@ -23,7 +23,7 @@ using crypto::Encryptor; using crypto::HMAC; using crypto::SymmetricKey; -namespace browser_sync { +namespace csync { // NigoriStream simplifies the concatenation operation of the Nigori protocol. class NigoriStream { @@ -254,4 +254,4 @@ bool Nigori::ExportKeys(std::string* user_key, mac_key_->GetRawKey(mac_key); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/nigori.h b/sync/util/nigori.h index 2606a44..1901211 100644 --- a/sync/util/nigori.h +++ b/sync/util/nigori.h @@ -14,7 +14,7 @@ namespace crypto { class SymmetricKey; } // namespace crypto -namespace browser_sync { +namespace csync { // A (partial) implementation of Nigori, a protocol to securely store secrets in // the cloud. This implementation does not support server authentication or @@ -81,6 +81,6 @@ class Nigori { scoped_ptr<crypto::SymmetricKey> mac_key_; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_NIGORI_H_ diff --git a/sync/util/nigori_unittest.cc b/sync/util/nigori_unittest.cc index 41f8ceb..b014a81 100644 --- a/sync/util/nigori_unittest.cc +++ b/sync/util/nigori_unittest.cc @@ -10,7 +10,7 @@ #include "base/string_util.h" #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { namespace { TEST(SyncNigoriTest, Permute) { @@ -167,4 +167,4 @@ TEST(SyncNigoriTest, MAYBE_ExportImport) { } } // anonymous namespace -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/session_utils_android.cc b/sync/util/session_utils_android.cc index 4eee6a3..a4f4400 100644 --- a/sync/util/session_utils_android.cc +++ b/sync/util/session_utils_android.cc @@ -51,7 +51,7 @@ ScopedJavaLocalRef<jobject> GetContentResolver(JNIEnv* env) { } -namespace browser_sync { +namespace csync { namespace internal { std::string GetAndroidId() { @@ -73,4 +73,4 @@ bool IsTabletUi() { } } // namespace internal -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/session_utils_android.h b/sync/util/session_utils_android.h index 6d09b7c..4da0ea9 100644 --- a/sync/util/session_utils_android.h +++ b/sync/util/session_utils_android.h @@ -8,7 +8,7 @@ #include <string> -namespace browser_sync { +namespace csync { namespace internal { // Return the unique identifier of this device. @@ -21,6 +21,6 @@ std::string GetModel(); bool IsTabletUi(); } // namespace internal -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_SESSION_UTILS_ANDROID_H_ diff --git a/sync/util/test_unrecoverable_error_handler.cc b/sync/util/test_unrecoverable_error_handler.cc index f7df6d4..07367c3 100644 --- a/sync/util/test_unrecoverable_error_handler.cc +++ b/sync/util/test_unrecoverable_error_handler.cc @@ -6,7 +6,7 @@ #include "testing/gtest/include/gtest/gtest.h" -namespace browser_sync { +namespace csync { TestUnrecoverableErrorHandler::TestUnrecoverableErrorHandler() {} @@ -19,5 +19,5 @@ void TestUnrecoverableErrorHandler::OnUnrecoverableError( << from_here.function_name() << ": " << message; } -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/test_unrecoverable_error_handler.h b/sync/util/test_unrecoverable_error_handler.h index d375bd9..758ba79 100644 --- a/sync/util/test_unrecoverable_error_handler.h +++ b/sync/util/test_unrecoverable_error_handler.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "sync/internal_api/public/util/unrecoverable_error_handler.h" -namespace browser_sync { +namespace csync { // Implementation of UnrecoverableErrorHandler that simply adds a // gtest failure. @@ -22,7 +22,7 @@ class TestUnrecoverableErrorHandler : public UnrecoverableErrorHandler { const std::string& message) OVERRIDE; }; -} // namespace browser_sync +} // namespace csync #endif // SYNC_INTERNAL_API_INCLUDES_TEST_UNRECOVERABLE_ERROR_HANDLER_H_ diff --git a/sync/util/time.cc b/sync/util/time.cc index ea0f367..47e6af4 100644 --- a/sync/util/time.cc +++ b/sync/util/time.cc @@ -7,7 +7,7 @@ #include "base/i18n/time_formatting.h" #include "base/utf_string_conversions.h" -namespace browser_sync { +namespace csync { int64 TimeToProtoTime(const base::Time& t) { return (t - base::Time::UnixEpoch()).InMilliseconds(); @@ -21,4 +21,4 @@ std::string GetTimeDebugString(const base::Time& t) { return UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(t)); } -} // namespace browser_sync +} // namespace csync diff --git a/sync/util/time.h b/sync/util/time.h index fc65efa..2c8a9cf 100644 --- a/sync/util/time.h +++ b/sync/util/time.h @@ -13,7 +13,7 @@ #include "base/basictypes.h" #include "base/time.h" -namespace browser_sync { +namespace csync { // Converts a time object to the format used in sync protobufs (ms // since the Unix epoch). @@ -24,6 +24,6 @@ base::Time ProtoTimeToTime(int64 proto_t); std::string GetTimeDebugString(const base::Time& t); -} // namespace browser_sync +} // namespace csync #endif // SYNC_UTIL_TIME_H_ |