diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 19:25:19 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 19:25:19 +0000 |
commit | 55525ed26f1783d4ba392b39693f5b1e8d19768e (patch) | |
tree | 5d287246d6385e7d4f7785e0e1e160b36023d85a | |
parent | cb4a4c6ed973644de031480c820a5caa70a79b3d (diff) | |
download | chromium_src-55525ed26f1783d4ba392b39693f5b1e8d19768e.zip chromium_src-55525ed26f1783d4ba392b39693f5b1e8d19768e.tar.gz chromium_src-55525ed26f1783d4ba392b39693f5b1e8d19768e.tar.bz2 |
sync: Remove dead code related to ClearUserData
Removes some code left over from the ClearUserData feature. These are
mostly functions named 'OnStopSyncingPermanently'.
Also renames ProfileSyncService::OnStopSyncingPermanently to
StopSyncingPermanently. This makes it easier to distinguish from the
now deprecated SyncManagerObserver callback. The new name is more
appropriate name since this function is not really a callback or event
handler anymore.
BUG=342932
Review URL: https://codereview.chromium.org/153643006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250775 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_host_core.cc | 9 | ||||
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_host_core.h | 1 | ||||
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_host_impl.cc | 6 | ||||
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc | 1 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 6 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.h | 4 | ||||
-rw-r--r-- | chrome/browser/ui/webui/sync_setup_handler.cc | 8 | ||||
-rw-r--r-- | components/sync_driver/sync_frontend.h | 4 | ||||
-rw-r--r-- | sync/internal_api/debug_info_event_listener.cc | 5 | ||||
-rw-r--r-- | sync/internal_api/debug_info_event_listener.h | 1 | ||||
-rw-r--r-- | sync/internal_api/js_sync_manager_observer.cc | 7 | ||||
-rw-r--r-- | sync/internal_api/js_sync_manager_observer.h | 1 | ||||
-rw-r--r-- | sync/internal_api/js_sync_manager_observer_unittest.cc | 11 | ||||
-rw-r--r-- | sync/internal_api/public/sync_manager.h | 6 | ||||
-rw-r--r-- | sync/internal_api/sync_manager_impl_unittest.cc | 1 |
15 files changed, 10 insertions, 61 deletions
diff --git a/chrome/browser/sync/glue/sync_backend_host_core.cc b/chrome/browser/sync/glue/sync_backend_host_core.cc index 8d7d4a7..9a3886c 100644 --- a/chrome/browser/sync/glue/sync_backend_host_core.cc +++ b/chrome/browser/sync/glue/sync_backend_host_core.cc @@ -261,15 +261,6 @@ void SyncBackendHostCore::OnBootstrapTokenUpdated( type); } -void SyncBackendHostCore::OnStopSyncingPermanently() { - if (!sync_loop_) - return; - DCHECK_EQ(base::MessageLoop::current(), sync_loop_); - host_.Call( - FROM_HERE, - &SyncBackendHostImpl::HandleStopSyncingPermanentlyOnFrontendLoop); -} - void SyncBackendHostCore::OnEncryptedTypesChanged( syncer::ModelTypeSet encrypted_types, bool encrypt_everything) { diff --git a/chrome/browser/sync/glue/sync_backend_host_core.h b/chrome/browser/sync/glue/sync_backend_host_core.h index 4e1b921..eab4e94 100644 --- a/chrome/browser/sync/glue/sync_backend_host_core.h +++ b/chrome/browser/sync/glue/sync_backend_host_core.h @@ -99,7 +99,6 @@ class SyncBackendHostCore syncer::ModelTypeSet restored_types) OVERRIDE; virtual void OnConnectionStatusChange( syncer::ConnectionStatus status) OVERRIDE; - virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnActionableError( const syncer::SyncProtocolError& sync_error) OVERRIDE; diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc index 8aff13d..6d6a3ac 100644 --- a/chrome/browser/sync/glue/sync_backend_host_impl.cc +++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc @@ -725,12 +725,6 @@ void SyncBackendHostImpl::HandlePassphraseTypeChangedOnFrontendLoop( cached_explicit_passphrase_time_ = explicit_passphrase_time; } -void SyncBackendHostImpl::HandleStopSyncingPermanentlyOnFrontendLoop() { - if (!frontend_) - return; - frontend_->OnStopSyncingPermanently(); -} - void SyncBackendHostImpl::HandleConnectionStatusChangeOnFrontendLoop( syncer::ConnectionStatus status) { if (!frontend_) diff --git a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc index d1a2bfe..2154721 100644 --- a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc @@ -72,7 +72,6 @@ class MockSyncFrontend : public SyncFrontend { MOCK_METHOD0(OnSyncCycleCompleted, void()); MOCK_METHOD1(OnConnectionStatusChange, void(syncer::ConnectionStatus status)); - MOCK_METHOD0(OnStopSyncingPermanently, void()); MOCK_METHOD0(OnClearServerDataSucceeded, void()); MOCK_METHOD0(OnClearServerDataFailed, void()); MOCK_METHOD2(OnPassphraseRequired, diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 03a996a..c6c8095 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -1222,7 +1222,7 @@ void ProfileSyncService::OnConnectionStatusChange( } } -void ProfileSyncService::OnStopSyncingPermanently() { +void ProfileSyncService::StopSyncingPermanently() { sync_prefs_.SetStartSuppressed(true); DisableForUser(); } @@ -1336,7 +1336,7 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) { // actions in the popup. The current experience might not be optimal for // the user. We just dismiss the dialog. if (setup_in_progress_) { - OnStopSyncingPermanently(); + StopSyncingPermanently(); expect_sync_configuration_aborted_ = true; } // Trigger an unrecoverable error to stop syncing. @@ -1346,7 +1346,7 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) { ERROR_REASON_ACTIONABLE_ERROR); break; case syncer::DISABLE_SYNC_ON_CLIENT: - OnStopSyncingPermanently(); + StopSyncingPermanently(); #if !defined(OS_CHROMEOS) // On desktop Chrome, sign out the user after a dashboard clear. // TODO(rsimha): Revisit this for M30. See http://crbug.com/252049. diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index e2d509b..1399bb5 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -362,6 +362,9 @@ class ProfileSyncService // Disables sync for user. Use ShowLoginDialog to enable. virtual void DisableForUser(); + // Disables sync for the user and prevents it from starting on next restart. + virtual void StopSyncingPermanently(); + // SyncFrontend implementation. virtual void OnBackendInitialized( const syncer::WeakHandle<syncer::JsBackend>& js_backend, @@ -372,7 +375,6 @@ class ProfileSyncService virtual void OnSyncConfigureRetry() OVERRIDE; virtual void OnConnectionStatusChange( syncer::ConnectionStatus status) OVERRIDE; - virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnPassphraseRequired( syncer::PassphraseRequiredReason reason, const sync_pb::EncryptedData& pending_keys) OVERRIDE; diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc index 1bd655d..23ae8b1e 100644 --- a/chrome/browser/ui/webui/sync_setup_handler.cc +++ b/chrome/browser/ui/webui/sync_setup_handler.cc @@ -640,13 +640,13 @@ void SyncSetupHandler::HandleConfigure(const base::ListValue* args) { // Disable sync, but remain signed in if the user selected "Sync nothing" in // the advanced settings dialog. Note: In order to disable sync across - // restarts on Chrome OS, we must call OnStopSyncingPermanently(), which + // restarts on Chrome OS, we must call StopSyncingPermanently(), which // suppresses sync startup in addition to disabling it. if (configuration.sync_nothing) { ProfileSyncService::SyncEvent( ProfileSyncService::STOP_FROM_ADVANCED_DIALOG); CloseUI(); - service->OnStopSyncingPermanently(); + service->StopSyncingPermanently(); service->SetSetupInProgress(false); return; } @@ -806,11 +806,11 @@ void SyncSetupHandler::CloseSyncSetup() { // If the user clicked "Cancel" while setting up sync, disable sync // because we don't want the sync backend to remain in the initialized // state. Note: In order to disable sync across restarts on Chrome OS, we - // must call OnStopSyncingPermanently(), which suppresses sync startup in + // must call StopSyncingPermanently(), which suppresses sync startup in // addition to disabling it. if (sync_service) { DVLOG(1) << "Sync setup aborted by user action"; - sync_service->OnStopSyncingPermanently(); + sync_service->StopSyncingPermanently(); #if !defined(OS_CHROMEOS) // Sign out the user on desktop Chrome if they click cancel during // initial setup. diff --git a/components/sync_driver/sync_frontend.h b/components/sync_driver/sync_frontend.h index 2b30df1..f7ed853 100644 --- a/components/sync_driver/sync_frontend.h +++ b/components/sync_driver/sync_frontend.h @@ -57,10 +57,6 @@ class SyncFrontend { virtual void OnConnectionStatusChange( syncer::ConnectionStatus status) = 0; - // We are no longer permitted to communicate with the server. Sync should - // be disabled and state cleaned up at once. - virtual void OnStopSyncingPermanently() = 0; - // The syncer requires a passphrase to decrypt sensitive updates. This is // called when the first sensitive data type is setup by the user and anytime // the passphrase is changed by another synced client. |reason| denotes why diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc index f46c4ee..ec30da8 100644 --- a/sync/internal_api/debug_info_event_listener.cc +++ b/sync/internal_api/debug_info_event_listener.cc @@ -84,11 +84,6 @@ void DebugInfoEventListener::OnBootstrapTokenUpdated( CreateAndAddEvent(sync_pb::DebugEventInfo::KEYSTORE_TOKEN_UPDATED); } -void DebugInfoEventListener::OnStopSyncingPermanently() { - DCHECK(thread_checker_.CalledOnValidThread()); - CreateAndAddEvent(sync_pb::DebugEventInfo::STOP_SYNCING_PERMANENTLY); -} - void DebugInfoEventListener::OnEncryptedTypesChanged( ModelTypeSet encrypted_types, bool encrypt_everything) { diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h index 15cc0a6..661d476 100644 --- a/sync/internal_api/debug_info_event_listener.h +++ b/sync/internal_api/debug_info_event_listener.h @@ -48,7 +48,6 @@ class SYNC_EXPORT_PRIVATE DebugInfoEventListener bool success, ModelTypeSet restored_types) OVERRIDE; virtual void OnConnectionStatusChange( ConnectionStatus connection_status) OVERRIDE; - virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnActionableError( const SyncProtocolError& sync_error) OVERRIDE; diff --git a/sync/internal_api/js_sync_manager_observer.cc b/sync/internal_api/js_sync_manager_observer.cc index 9f8848d..e74db84 100644 --- a/sync/internal_api/js_sync_manager_observer.cc +++ b/sync/internal_api/js_sync_manager_observer.cc @@ -78,13 +78,6 @@ void JsSyncManagerObserver::OnInitializationComplete( JsEventDetails(&details)); } -void JsSyncManagerObserver::OnStopSyncingPermanently() { - if (!event_handler_.IsInitialized()) { - return; - } - HandleJsEvent(FROM_HERE, "onStopSyncingPermanently", JsEventDetails()); -} - void JsSyncManagerObserver::HandleJsEvent( const tracked_objects::Location& from_here, const std::string& name, const JsEventDetails& details) { diff --git a/sync/internal_api/js_sync_manager_observer.h b/sync/internal_api/js_sync_manager_observer.h index 17a40e7..45b8f05 100644 --- a/sync/internal_api/js_sync_manager_observer.h +++ b/sync/internal_api/js_sync_manager_observer.h @@ -40,7 +40,6 @@ class SYNC_EXPORT_PRIVATE JsSyncManagerObserver : public SyncManager::Observer { const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener, bool success, syncer::ModelTypeSet restored_types) OVERRIDE; - virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnActionableError( const SyncProtocolError& sync_protocol_error) OVERRIDE; diff --git a/sync/internal_api/js_sync_manager_observer_unittest.cc b/sync/internal_api/js_sync_manager_observer_unittest.cc index e4b8c64..46f0319 100644 --- a/sync/internal_api/js_sync_manager_observer_unittest.cc +++ b/sync/internal_api/js_sync_manager_observer_unittest.cc @@ -44,17 +44,6 @@ class JsSyncManagerObserverTest : public testing::Test { } }; -TEST_F(JsSyncManagerObserverTest, NoArgNotifiations) { - InSequence dummy; - - EXPECT_CALL(mock_js_event_handler_, - HandleJsEvent("onStopSyncingPermanently", - HasDetails(JsEventDetails()))); - - js_sync_manager_observer_.OnStopSyncingPermanently(); - PumpLoop(); -} - TEST_F(JsSyncManagerObserverTest, OnInitializationComplete) { base::DictionaryValue expected_details; syncer::ModelTypeSet restored_types; diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h index de8ee79..54e12b6 100644 --- a/sync/internal_api/public/sync_manager.h +++ b/sync/internal_api/public/sync_manager.h @@ -219,12 +219,6 @@ class SYNC_EXPORT SyncManager : public syncer::InvalidationHandler { bool success, ModelTypeSet restored_types) = 0; - // We are no longer permitted to communicate with the server. Sync should - // be disabled and state cleaned up at once. This can happen for a number - // of reasons, e.g. swapping from a test instance to production, or a - // global stop syncing operation has wiped the store. - virtual void OnStopSyncingPermanently() = 0; - virtual void OnActionableError( const SyncProtocolError& sync_protocol_error) = 0; diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index 29d80e0..369b1d8 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -645,7 +645,6 @@ class SyncManagerObserverMock : public SyncManager::Observer { bool, syncer::ModelTypeSet)); // NOLINT MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); // NOLINT - MOCK_METHOD0(OnStopSyncingPermanently, void()); // NOLINT MOCK_METHOD1(OnUpdatedToken, void(const std::string&)); // NOLINT MOCK_METHOD1(OnActionableError, void(const SyncProtocolError&)); // NOLINT |