summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-20 00:02:21 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-20 00:02:21 +0000
commit729c49e105ff2eff40c230aa9bc5def53ed26a37 (patch)
tree1018cec7ac0b3b0232aa8e84cda9d8b361f940f4 /sync
parent36cd3ef210d89988628cb58bb967755831d50afe (diff)
downloadchromium_src-729c49e105ff2eff40c230aa9bc5def53ed26a37.zip
chromium_src-729c49e105ff2eff40c230aa9bc5def53ed26a37.tar.gz
chromium_src-729c49e105ff2eff40c230aa9bc5def53ed26a37.tar.bz2
sync: Remove ClearUserData command.
BUG=131336 TEST=none Review URL: https://chromiumcodereview.appspot.com/10584019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/engine/all_status.cc2
-rw-r--r--sync/engine/clear_data_command.cc77
-rw-r--r--sync/engine/clear_data_command.h31
-rw-r--r--sync/engine/clear_data_command_unittest.cc117
-rw-r--r--sync/engine/sync_engine_event.h5
-rw-r--r--sync/engine/sync_scheduler.cc20
-rw-r--r--sync/engine/sync_scheduler.h8
-rw-r--r--sync/engine/sync_scheduler_unittest.cc11
-rw-r--r--sync/engine/sync_scheduler_whitebox_unittest.cc17
-rw-r--r--sync/engine/syncer.cc8
-rw-r--r--sync/engine/syncer.h1
-rw-r--r--sync/internal_api/debug_info_event_listener.cc10
-rw-r--r--sync/internal_api/debug_info_event_listener.h2
-rw-r--r--sync/internal_api/js_sync_manager_observer.cc14
-rw-r--r--sync/internal_api/js_sync_manager_observer.h2
-rw-r--r--sync/internal_api/js_sync_manager_observer_unittest.cc8
-rw-r--r--sync/internal_api/public/sync_manager.h8
-rw-r--r--sync/internal_api/sync_manager.cc18
-rw-r--r--sync/internal_api/syncapi_unittest.cc2
-rw-r--r--sync/protocol/get_updates_caller_info.proto5
-rw-r--r--sync/protocol/proto_enum_conversions.cc1
-rw-r--r--sync/protocol/proto_enum_conversions_unittest.cc4
-rw-r--r--sync/protocol/sync.proto18
-rw-r--r--sync/sync.gyp3
-rw-r--r--sync/test/engine/mock_connection_manager.cc17
-rw-r--r--sync/test/engine/mock_connection_manager.h2
26 files changed, 15 insertions, 396 deletions
diff --git a/sync/engine/all_status.cc b/sync/engine/all_status.cc
index 7afd1a4..cf170f0c1 100644
--- a/sync/engine/all_status.cc
+++ b/sync/engine/all_status.cc
@@ -106,8 +106,6 @@ void AllStatus::OnSyncEngineEvent(const SyncEngineEvent& event) {
break;
case SyncEngineEvent::STOP_SYNCING_PERMANENTLY:
case SyncEngineEvent::UPDATED_TOKEN:
- case SyncEngineEvent::CLEAR_SERVER_DATA_FAILED:
- case SyncEngineEvent::CLEAR_SERVER_DATA_SUCCEEDED:
break;
case SyncEngineEvent::ACTIONABLE_ERROR:
status_ = CreateBlankStatus();
diff --git a/sync/engine/clear_data_command.cc b/sync/engine/clear_data_command.cc
deleted file mode 100644
index e7d7343..0000000
--- a/sync/engine/clear_data_command.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/engine/clear_data_command.h"
-
-#include <string>
-
-#include "sync/engine/syncer.h"
-#include "sync/engine/syncer_proto_util.h"
-#include "sync/engine/syncproto.h"
-#include "sync/sessions/sync_session.h"
-
-namespace browser_sync {
-
-using sessions::StatusController;
-using sessions::SyncSession;
-using std::string;
-using syncable::FIRST_REAL_MODEL_TYPE;
-using syncable::MODEL_TYPE_COUNT;
-
-
-ClearDataCommand::ClearDataCommand() {}
-ClearDataCommand::~ClearDataCommand() {}
-
-SyncerError ClearDataCommand::ExecuteImpl(SyncSession* session) {
- ClientToServerMessage client_to_server_message;
- ClientToServerResponse client_to_server_response;
-
- client_to_server_message.set_share(session->context()->account_name());
- client_to_server_message.set_message_contents(
- ClientToServerMessage::CLEAR_DATA);
-
- client_to_server_message.mutable_clear_user_data();
-
- SyncerProtoUtil::AddRequestBirthday(session->context()->directory(),
- &client_to_server_message);
-
- DVLOG(1) << "Clearing server data";
-
- SyncerError result = SyncerProtoUtil::PostClientToServerMessage(
- client_to_server_message,
- &client_to_server_response,
- session);
-
- DVLOG(1) << SyncerProtoUtil::ClientToServerResponseDebugString(
- client_to_server_response);
-
- // TODO(lipalani): This code is wrong. The response error codes it checks
- // have been obsoleted. The only reason it hasn't caused problems is that
- // this code is unreachable. We should do something to clean up this mess.
- // See also: crbug.com/71616.
- //
- // Clear pending indicates that the server has received our clear message
- if (result != SYNCER_OK || !client_to_server_response.has_error_code() ||
- client_to_server_response.error_code() != sync_pb::SyncEnums::SUCCESS) {
- // On failure, subsequent requests to the server will cause it to attempt
- // to resume the clear. The client will handle disabling of sync in
- // response to a store birthday error from the server.
- SyncEngineEvent event(SyncEngineEvent::CLEAR_SERVER_DATA_FAILED);
- session->context()->NotifyListeners(event);
-
- LOG(ERROR) << "Error posting ClearData.";
-
- return result;
- }
-
- SyncEngineEvent event(SyncEngineEvent::CLEAR_SERVER_DATA_SUCCEEDED);
- session->context()->NotifyListeners(event);
-
- session->delegate()->OnShouldStopSyncingPermanently();
-
- DVLOG(1) << "ClearData succeeded.";
- return SYNCER_OK;
-}
-
-} // namespace browser_sync
diff --git a/sync/engine/clear_data_command.h b/sync/engine/clear_data_command.h
deleted file mode 100644
index 258a99c..0000000
--- a/sync/engine/clear_data_command.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SYNC_ENGINE_CLEAR_DATA_COMMAND_H_
-#define SYNC_ENGINE_CLEAR_DATA_COMMAND_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "sync/engine/syncer_command.h"
-#include "sync/internal_api/public/engine/model_safe_worker.h"
-#include "sync/internal_api/public/syncable/model_type.h"
-
-namespace browser_sync {
-
-// Clears server data associated with this user's account
-class ClearDataCommand : public SyncerCommand {
- public:
- ClearDataCommand();
- virtual ~ClearDataCommand();
-
- // SyncerCommand implementation.
- virtual SyncerError ExecuteImpl(sessions::SyncSession* session) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ClearDataCommand);
-};
-
-} // namespace browser_sync
-
-#endif // SYNC_ENGINE_CLEAR_DATA_COMMAND_H_
diff --git a/sync/engine/clear_data_command_unittest.cc b/sync/engine/clear_data_command_unittest.cc
deleted file mode 100644
index b94d08a..0000000
--- a/sync/engine/clear_data_command_unittest.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/engine/clear_data_command.h"
-#include "sync/protocol/autofill_specifics.pb.h"
-#include "sync/protocol/bookmark_specifics.pb.h"
-#include "sync/protocol/preference_specifics.pb.h"
-#include "sync/protocol/sync.pb.h"
-#include "sync/test/engine/syncer_command_test.h"
-#include "sync/test/sessions/test_scoped_session_event_listener.h"
-
-namespace browser_sync {
-
-using sessions::TestScopedSessionEventListener;
-using syncable::FIRST_REAL_MODEL_TYPE;
-using syncable::MODEL_TYPE_COUNT;
-
-// A test fixture for tests exercising ClearDataCommandTest.
-class ClearDataCommandTest : public SyncerCommandTest {
- protected:
- ClearDataCommandTest() {}
- ClearDataCommand command_;
-
- virtual void OnShouldStopSyncingPermanently() {
- on_should_stop_syncing_permanently_called_ = true;
- }
-
- protected:
- bool on_should_stop_syncing_permanently_called_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ClearDataCommandTest);
-};
-
-class ClearEventHandler : public SyncEngineEventListener {
- public:
- ClearEventHandler() {
- ResetReceivedEvents();
- }
- bool ReceievedClearSuccessEvent() { return received_clear_success_event_; }
- bool ReceievedClearFailedEvent() { return received_clear_failed_event_; }
- void ResetReceivedEvents() {
- received_clear_success_event_ = false;
- received_clear_failed_event_ = false;
- }
-
- virtual void OnSyncEngineEvent(const SyncEngineEvent& event) {
- if (event.what_happened == SyncEngineEvent::CLEAR_SERVER_DATA_FAILED) {
- received_clear_failed_event_ = true;
- } else if (event.what_happened ==
- SyncEngineEvent::CLEAR_SERVER_DATA_SUCCEEDED) {
- received_clear_success_event_ = true;
- }
- }
-
- private:
- bool received_clear_success_event_;
- bool received_clear_failed_event_;
-};
-
-TEST_F(ClearDataCommandTest, ClearDataCommandExpectFailed) {
- ConfigureMockServerConnection();
- scoped_ptr<ClearEventHandler> handler(new ClearEventHandler());
- TestScopedSessionEventListener reg(context(), handler.get());
-
- directory()->set_store_birthday(mock_server()->store_birthday());
- mock_server()->SetServerNotReachable();
- on_should_stop_syncing_permanently_called_ = false;
-
- command_.Execute(session());
-
- // Expect that the client sent a clear request, received failure,
- // fired a failure event, but did not disable sync.
- //
- // A failure event will be bubbled back to the user's UI, and the
- // user can press "clear" again.
- //
- // We do not want to disable sync in the client because the user may
- // incorrectly get the impression that their private data has been cleared
- // from the server (from the fact that their data is gone on the client).
- //
- // Any subsequent GetUpdates/Commit requests or attempts to enable sync
- // will cause the server to attempt to resume the clearing process (within
- // a bounded window of time)
- const sync_pb::ClientToServerMessage& r = mock_server()->last_request();
- EXPECT_TRUE(r.has_clear_user_data());
-
- EXPECT_TRUE(handler.get()->ReceievedClearFailedEvent());
-
- EXPECT_FALSE(handler.get()->ReceievedClearSuccessEvent());
- EXPECT_FALSE(on_should_stop_syncing_permanently_called_);
-}
-
-TEST_F(ClearDataCommandTest, ClearDataCommandExpectSuccess) {
- ConfigureMockServerConnection();
- scoped_ptr<ClearEventHandler> handler(new ClearEventHandler());
- TestScopedSessionEventListener reg(context(), handler.get());
-
- directory()->set_store_birthday(mock_server()->store_birthday());
- mock_server()->SetClearUserDataResponseStatus(sync_pb::SyncEnums::SUCCESS);
- on_should_stop_syncing_permanently_called_ = false;
-
- command_.Execute(session());
-
- // Expect that the client sent a clear request, fired off the success event
- // in response, and disabled sync
- const sync_pb::ClientToServerMessage& r = mock_server()->last_request();
- EXPECT_TRUE(r.has_clear_user_data());
-
- EXPECT_TRUE(handler->ReceievedClearSuccessEvent());
- EXPECT_TRUE(on_should_stop_syncing_permanently_called_);
-
- EXPECT_FALSE(handler->ReceievedClearFailedEvent());
-}
-
-} // namespace browser_sync
diff --git a/sync/engine/sync_engine_event.h b/sync/engine/sync_engine_event.h
index e9c52a7..d47edf3 100644
--- a/sync/engine/sync_engine_event.h
+++ b/sync/engine/sync_engine_event.h
@@ -41,11 +41,6 @@ struct SyncEngineEvent {
// data (i.e. as if the user clicked 'Stop Syncing' in the browser.
STOP_SYNCING_PERMANENTLY,
- // These events are sent to indicate when we know the clearing of
- // server data have failed or succeeded.
- CLEAR_SERVER_DATA_SUCCEEDED,
- CLEAR_SERVER_DATA_FAILED,
-
// This event is sent when we receive an actionable error. It is upto
// the listeners to figure out the action to take using the snapshot sent.
ACTIONABLE_ERROR,
diff --git a/sync/engine/sync_scheduler.cc b/sync/engine/sync_scheduler.cc
index f798d67..bf9deec 100644
--- a/sync/engine/sync_scheduler.cc
+++ b/sync/engine/sync_scheduler.cc
@@ -113,7 +113,6 @@ const char* SyncScheduler::SyncSessionJob::GetPurposeString(
ENUM_CASE(UNKNOWN);
ENUM_CASE(POLL);
ENUM_CASE(NUDGE);
- ENUM_CASE(CLEAR_USER_DATA);
ENUM_CASE(CONFIGURATION);
ENUM_CASE(CLEANUP_DISABLED_TYPES);
}
@@ -288,7 +287,6 @@ SyncScheduler::JobProcessDecision SyncScheduler::DecideWhileInWaitInterval(
const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
DCHECK(wait_interval_.get());
- DCHECK_NE(job.purpose, SyncSessionJob::CLEAR_USER_DATA);
DCHECK_NE(job.purpose, SyncSessionJob::CLEANUP_DISABLED_TYPES);
SDVLOG(2) << "DecideWhileInWaitInterval with WaitInterval mode "
@@ -322,8 +320,7 @@ SyncScheduler::JobProcessDecision SyncScheduler::DecideWhileInWaitInterval(
SyncScheduler::JobProcessDecision SyncScheduler::DecideOnJob(
const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
- if (job.purpose == SyncSessionJob::CLEAR_USER_DATA ||
- job.purpose == SyncSessionJob::CLEANUP_DISABLED_TYPES)
+ if (job.purpose == SyncSessionJob::CLEANUP_DISABLED_TYPES)
return CONTINUE;
// See if our type is throttled.
@@ -417,7 +414,6 @@ bool SyncScheduler::ShouldRunJob(const SyncSessionJob& job) {
void SyncScheduler::SaveJob(const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
- DCHECK_NE(job.purpose, SyncSessionJob::CLEAR_USER_DATA);
// TODO(sync): Should we also check that job.purpose !=
// CLEANUP_DISABLED_TYPES? (See http://crbug.com/90868.)
if (job.purpose == SyncSessionJob::NUDGE) {
@@ -449,16 +445,6 @@ struct ModelSafeWorkerGroupIs {
ModelSafeGroup group;
};
-void SyncScheduler::ClearUserData() {
- DCHECK_EQ(MessageLoop::current(), sync_loop_);
- SyncSessionJob job(SyncSessionJob::CLEAR_USER_DATA, TimeTicks::Now(),
- make_linked_ptr(CreateSyncSession(SyncSourceInfo())),
- false,
- FROM_HERE);
-
- DoSyncSessionJob(job);
-}
-
void SyncScheduler::CleanupDisabledTypes() {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
SyncSessionJob job(SyncSessionJob::CLEANUP_DISABLED_TYPES, TimeTicks::Now(),
@@ -655,10 +641,6 @@ void SyncScheduler::SetSyncerStepsForPurpose(
*start = DOWNLOAD_UPDATES;
*end = APPLY_UPDATES;
return;
- case SyncSessionJob::CLEAR_USER_DATA:
- *start = CLEAR_PRIVATE_DATA;
- *end = CLEAR_PRIVATE_DATA;
- return;
case SyncSessionJob::NUDGE:
case SyncSessionJob::POLL:
*start = SYNCER_BEGIN;
diff --git a/sync/engine/sync_scheduler.h b/sync/engine/sync_scheduler.h
index f6a54cc..363b93e 100644
--- a/sync/engine/sync_scheduler.h
+++ b/sync/engine/sync_scheduler.h
@@ -94,9 +94,6 @@ class SyncScheduler : public sessions::SyncSession::Delegate {
syncable::ModelTypeSet types,
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source);
- // TODO(tim): remove this. crbug.com/131336
- void ClearUserData();
-
void CleanupDisabledTypes();
// Change status of notifications in the SyncSessionContext.
@@ -150,9 +147,6 @@ class SyncScheduler : public sessions::SyncSession::Delegate {
// A nudge task can come from a variety of components needing to force
// a sync. The source is inferable from |session.source()|.
NUDGE,
- // The user invoked a function in the UI to clear their entire account
- // and stop syncing (globally).
- CLEAR_USER_DATA,
// Typically used for fetching updates for a subset of the enabled types
// during initial sync or reconfiguration. We don't run all steps of
// the sync cycle for these (e.g. CleanupDisabledTypes is skipped).
@@ -196,8 +190,6 @@ class SyncScheduler : public sessions::SyncSession::Delegate {
FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
SaveNudgeWhileThrottled);
FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
- ContinueClearUserDataUnderAllCircumstances);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
ContinueCanaryJobConfig);
FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
ContinueNudgeWhileExponentialBackOff);
diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc
index a6d8059..d187d7d 100644
--- a/sync/engine/sync_scheduler_unittest.cc
+++ b/sync/engine/sync_scheduler_unittest.cc
@@ -1056,17 +1056,6 @@ TEST_F(SyncSchedulerTest, SyncerSteps) {
StopSyncScheduler();
Mock::VerifyAndClearExpectations(syncer());
- // ClearUserData.
- EXPECT_CALL(*syncer(), SyncShare(_, CLEAR_PRIVATE_DATA, CLEAR_PRIVATE_DATA))
- .WillOnce(Invoke(sessions::test_util::SimulateSuccess));
- StartSyncScheduler(SyncScheduler::NORMAL_MODE);
-
- scheduler()->ClearUserData();
-
- StopSyncScheduler();
- Mock::VerifyAndClearExpectations(syncer());
-
- // Configuration.
EXPECT_CALL(*syncer(), SyncShare(_, DOWNLOAD_UPDATES, APPLY_UPDATES))
.WillOnce(Invoke(sessions::test_util::SimulateSuccess));
StartSyncScheduler(SyncScheduler::CONFIGURATION_MODE);
diff --git a/sync/engine/sync_scheduler_whitebox_unittest.cc b/sync/engine/sync_scheduler_whitebox_unittest.cc
index 34ff7d9..dbfdec1 100644
--- a/sync/engine/sync_scheduler_whitebox_unittest.cc
+++ b/sync/engine/sync_scheduler_whitebox_unittest.cc
@@ -228,23 +228,6 @@ TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileThrottled) {
EXPECT_EQ(decision, SyncScheduler::SAVE);
}
-TEST_F(SyncSchedulerWhiteboxTest,
- ContinueClearUserDataUnderAllCircumstances) {
- InitializeSyncerOnNormalMode();
-
- SetMode(SyncScheduler::CONFIGURATION_MODE);
- SetWaitIntervalToThrottled();
- SyncScheduler::JobProcessDecision decision = CreateAndDecideJob(
- SyncScheduler::SyncSessionJob::CLEAR_USER_DATA);
- EXPECT_EQ(decision, SyncScheduler::CONTINUE);
-
- SetMode(SyncScheduler::NORMAL_MODE);
- SetWaitIntervalToExponentialBackoff();
- decision = CreateAndDecideJob(
- SyncScheduler::SyncSessionJob::CLEAR_USER_DATA);
- EXPECT_EQ(decision, SyncScheduler::CONTINUE);
-}
-
TEST_F(SyncSchedulerWhiteboxTest, ContinueNudgeWhileExponentialBackOff) {
InitializeSyncerOnNormalMode();
SetMode(SyncScheduler::NORMAL_MODE);
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index c17c0f8..01c8ae6 100644
--- a/sync/engine/syncer.cc
+++ b/sync/engine/syncer.cc
@@ -13,7 +13,6 @@
#include "sync/engine/apply_updates_command.h"
#include "sync/engine/build_commit_command.h"
#include "sync/engine/cleanup_disabled_types_command.h"
-#include "sync/engine/clear_data_command.h"
#include "sync/engine/commit.h"
#include "sync/engine/conflict_resolver.h"
#include "sync/engine/download_updates_command.h"
@@ -68,7 +67,6 @@ const char* SyncerStepToString(const SyncerStep step)
ENUM_CASE(COMMIT);
ENUM_CASE(RESOLVE_CONFLICTS);
ENUM_CASE(APPLY_UPDATES_TO_RESOLVE_CONFLICTS);
- ENUM_CASE(CLEAR_PRIVATE_DATA);
ENUM_CASE(SYNCER_END);
}
NOTREACHED();
@@ -226,12 +224,6 @@ void Syncer::SyncShare(sessions::SyncSession* session,
next_step = SYNCER_END;
break;
}
- case CLEAR_PRIVATE_DATA: {
- ClearDataCommand clear_data_command;
- clear_data_command.Execute(session);
- next_step = SYNCER_END;
- break;
- }
case SYNCER_END: {
session->SendEventNotification(SyncEngineEvent::SYNC_CYCLE_ENDED);
next_step = SYNCER_END;
diff --git a/sync/engine/syncer.h b/sync/engine/syncer.h
index 6092f64..9d2c32e 100644
--- a/sync/engine/syncer.h
+++ b/sync/engine/syncer.h
@@ -38,7 +38,6 @@ enum SyncerStep {
COMMIT,
RESOLVE_CONFLICTS,
APPLY_UPDATES_TO_RESOLVE_CONFLICTS,
- CLEAR_PRIVATE_DATA, // TODO(tim): Rename 'private' to 'user'.
SYNCER_END
};
diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc
index 6b3cd23..022bac3 100644
--- a/sync/internal_api/debug_info_event_listener.cc
+++ b/sync/internal_api/debug_info_event_listener.cc
@@ -77,16 +77,6 @@ void DebugInfoEventListener::OnUpdatedToken(const std::string& token) {
CreateAndAddEvent(sync_pb::DebugEventInfo::UPDATED_TOKEN);
}
-void DebugInfoEventListener::OnClearServerDataFailed() {
- // This command is not implemented on the client side.
- NOTREACHED();
-}
-
-void DebugInfoEventListener::OnClearServerDataSucceeded() {
- // This command is not implemented on the client side.
- NOTREACHED();
-}
-
void DebugInfoEventListener::OnEncryptedTypesChanged(
syncable::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 d18f008..d76e9ab 100644
--- a/sync/internal_api/debug_info_event_listener.h
+++ b/sync/internal_api/debug_info_event_listener.h
@@ -45,8 +45,6 @@ class DebugInfoEventListener : public sync_api::SyncManager::Observer,
const std::string& bootstrap_token) OVERRIDE;
virtual void OnStopSyncingPermanently() OVERRIDE;
virtual void OnUpdatedToken(const std::string& token) OVERRIDE;
- virtual void OnClearServerDataFailed() OVERRIDE;
- virtual void OnClearServerDataSucceeded() OVERRIDE;
virtual void OnEncryptedTypesChanged(
syncable::ModelTypeSet encrypted_types,
bool encrypt_everything) OVERRIDE;
diff --git a/sync/internal_api/js_sync_manager_observer.cc b/sync/internal_api/js_sync_manager_observer.cc
index ae1449e..fe9fa65 100644
--- a/sync/internal_api/js_sync_manager_observer.cc
+++ b/sync/internal_api/js_sync_manager_observer.cc
@@ -142,20 +142,6 @@ void JsSyncManagerObserver::OnStopSyncingPermanently() {
HandleJsEvent(FROM_HERE, "onStopSyncingPermanently", JsEventDetails());
}
-void JsSyncManagerObserver::OnClearServerDataSucceeded() {
- if (!event_handler_.IsInitialized()) {
- return;
- }
- HandleJsEvent(FROM_HERE, "onClearServerDataSucceeded", JsEventDetails());
-}
-
-void JsSyncManagerObserver::OnClearServerDataFailed() {
- if (!event_handler_.IsInitialized()) {
- return;
- }
- HandleJsEvent(FROM_HERE, "onClearServerDataFailed", 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 b410eb9..6c0a620 100644
--- a/sync/internal_api/js_sync_manager_observer.h
+++ b/sync/internal_api/js_sync_manager_observer.h
@@ -50,8 +50,6 @@ class JsSyncManagerObserver : public sync_api::SyncManager::Observer {
virtual void OnInitializationComplete(
const WeakHandle<JsBackend>& js_backend, bool success) OVERRIDE;
virtual void OnStopSyncingPermanently() OVERRIDE;
- virtual void OnClearServerDataSucceeded() OVERRIDE;
- virtual void OnClearServerDataFailed() OVERRIDE;
virtual void OnActionableError(
const browser_sync::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 03404ed..0791a89 100644
--- a/sync/internal_api/js_sync_manager_observer_unittest.cc
+++ b/sync/internal_api/js_sync_manager_observer_unittest.cc
@@ -53,20 +53,12 @@ TEST_F(JsSyncManagerObserverTest, NoArgNotifiations) {
HandleJsEvent("onStopSyncingPermanently",
HasDetails(JsEventDetails())));
EXPECT_CALL(mock_js_event_handler_,
- HandleJsEvent("onClearServerDataSucceeded",
- HasDetails(JsEventDetails())));
- EXPECT_CALL(mock_js_event_handler_,
- HandleJsEvent("onClearServerDataFailed",
- HasDetails(JsEventDetails())));
- EXPECT_CALL(mock_js_event_handler_,
HandleJsEvent("onEncryptionComplete",
HasDetails(JsEventDetails())));
js_sync_manager_observer_.OnInitializationComplete(WeakHandle<JsBackend>(),
true);
js_sync_manager_observer_.OnStopSyncingPermanently();
- js_sync_manager_observer_.OnClearServerDataSucceeded();
- js_sync_manager_observer_.OnClearServerDataFailed();
js_sync_manager_observer_.OnEncryptionComplete();
PumpLoop();
}
diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h
index 351cf5c..fc66204 100644
--- a/sync/internal_api/public/sync_manager.h
+++ b/sync/internal_api/public/sync_manager.h
@@ -309,11 +309,6 @@ class SyncManager {
// global stop syncing operation has wiped the store.
virtual void OnStopSyncingPermanently() = 0;
- // After a request to clear server data, these callbacks are invoked to
- // indicate success or failure.
- virtual void OnClearServerDataSucceeded() = 0;
- virtual void OnClearServerDataFailed() = 0;
-
// Called when the set of encrypted types or the encrypt
// everything flag has been changed. Note that encryption isn't
// complete until the OnEncryptionComplete() notification has been
@@ -446,9 +441,6 @@ class SyncManager {
void RequestCleanupDisabledTypes(
const browser_sync::ModelSafeRoutingInfo& routing_info);
- // Request a clearing of all data on the server
- void RequestClearServerData();
-
// 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
// having received OnInitializationCompleted.
diff --git a/sync/internal_api/sync_manager.cc b/sync/internal_api/sync_manager.cc
index cff524d..fdfe229 100644
--- a/sync/internal_api/sync_manager.cc
+++ b/sync/internal_api/sync_manager.cc
@@ -826,12 +826,6 @@ void SyncManager::RequestCleanupDisabledTypes(
}
}
-void SyncManager::RequestClearServerData() {
- DCHECK(thread_checker_.CalledOnValidThread());
- if (data_->scheduler())
- data_->scheduler()->ClearUserData();
-}
-
void SyncManager::RequestConfig(
const browser_sync::ModelSafeRoutingInfo& routing_info,
const ModelTypeSet& types, ConfigureReason reason) {
@@ -2056,18 +2050,6 @@ void SyncManager::SyncInternal::OnSyncEngineEvent(
return;
}
- if (event.what_happened == SyncEngineEvent::CLEAR_SERVER_DATA_SUCCEEDED) {
- FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
- OnClearServerDataSucceeded());
- return;
- }
-
- if (event.what_happened == SyncEngineEvent::CLEAR_SERVER_DATA_FAILED) {
- FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
- OnClearServerDataFailed());
- return;
- }
-
if (event.what_happened == SyncEngineEvent::UPDATED_TOKEN) {
FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
OnUpdatedToken(event.updated_token));
diff --git a/sync/internal_api/syncapi_unittest.cc b/sync/internal_api/syncapi_unittest.cc
index 950a1c9..81fef45 100644
--- a/sync/internal_api/syncapi_unittest.cc
+++ b/sync/internal_api/syncapi_unittest.cc
@@ -698,8 +698,6 @@ class SyncManagerObserverMock : public SyncManager::Observer {
MOCK_METHOD1(OnBootstrapTokenUpdated, void(const std::string&)); // NOLINT
MOCK_METHOD0(OnStopSyncingPermanently, void()); // NOLINT
MOCK_METHOD1(OnUpdatedToken, void(const std::string&)); // NOLINT
- MOCK_METHOD0(OnClearServerDataFailed, void()); // NOLINT
- MOCK_METHOD0(OnClearServerDataSucceeded, void()); // NOLINT
MOCK_METHOD2(OnEncryptedTypesChanged,
void(ModelTypeSet, bool)); // NOLINT
MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT
diff --git a/sync/protocol/get_updates_caller_info.proto b/sync/protocol/get_updates_caller_info.proto
index 41ad2ef..c921a8d 100644
--- a/sync/protocol/get_updates_caller_info.proto
+++ b/sync/protocol/get_updates_caller_info.proto
@@ -19,7 +19,10 @@ message GetUpdatesCallerInfo {
PERIODIC = 4; // The source of the update was periodic polling.
SYNC_CYCLE_CONTINUATION = 5; // The source of the update was a
// continuation of a previous update.
- CLEAR_PRIVATE_DATA = 6; // Source is a call to remove all private data
+
+ // This value is deprecated and was never used in production.
+ // CLEAR_PRIVATE_DATA = 6;
+
NEWLY_SUPPORTED_DATATYPE = 7; // The client is in configuration mode
// because it's syncing all datatypes, and
// support for a new datatype was recently
diff --git a/sync/protocol/proto_enum_conversions.cc b/sync/protocol/proto_enum_conversions.cc
index 864f052..7c6433e 100644
--- a/sync/protocol/proto_enum_conversions.cc
+++ b/sync/protocol/proto_enum_conversions.cc
@@ -79,7 +79,6 @@ const char* GetUpdatesSourceString(
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NOTIFICATION);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PERIODIC);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, SYNC_CYCLE_CONTINUATION);
- ENUM_CASE(sync_pb::GetUpdatesCallerInfo, CLEAR_PRIVATE_DATA);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NEWLY_SUPPORTED_DATATYPE);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, MIGRATION);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NEW_CLIENT);
diff --git a/sync/protocol/proto_enum_conversions_unittest.cc b/sync/protocol/proto_enum_conversions_unittest.cc
index d007348..5fa53b2 100644
--- a/sync/protocol/proto_enum_conversions_unittest.cc
+++ b/sync/protocol/proto_enum_conversions_unittest.cc
@@ -55,6 +55,10 @@ TEST_F(ProtoEnumConversionsTest, GetUpdatesSourceString) {
TestEnumStringFunction(
GetUpdatesSourceString,
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource_MIN,
+ sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION);
+ TestEnumStringFunction(
+ GetUpdatesSourceString,
+ sync_pb::GetUpdatesCallerInfo::NEWLY_SUPPORTED_DATATYPE,
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource_MAX);
}
diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto
index e2dde54..ec9a1d2 100644
--- a/sync/protocol/sync.proto
+++ b/sync/protocol/sync.proto
@@ -455,15 +455,6 @@ message AuthenticateMessage {
required string auth_token = 1;
};
-// This message is sent to the server to clear data. An asynchronous
-// response is returned to the client indicating that the server has received
-// the request and has begun to clear data.
-message ClearUserDataMessage {
-}
-
-message ClearUserDataResponse {
-}
-
message ClientToServerMessage {
required string share = 1;
optional int32 protocol_version = 2 [default = 31];
@@ -478,8 +469,10 @@ message ClientToServerMessage {
optional CommitMessage commit = 4;
optional GetUpdatesMessage get_updates = 5;
optional AuthenticateMessage authenticate = 6;
- // Request to clear all Chromium data from the server
- optional ClearUserDataMessage clear_user_data = 9;
+
+ // Request to clear all Chromium data from the server.
+ // DEPRECATED - this field was never used in production.
+ // optional ClearUserDataMessage clear_user_data = 9;
optional string store_birthday = 7; // Opaque store ID; if it changes, duck!
// The client sets this if it detects a sync issue. The server will tell it
@@ -632,7 +625,8 @@ message ClientToServerResponse {
optional CommitResponse commit = 1;
optional GetUpdatesResponse get_updates = 2;
optional AuthenticateResponse authenticate = 3;
- optional ClearUserDataResponse clear_user_data = 9;
+ // DEPRECATED - this field was never used in production.
+ // optional ClearUserDataResponse clear_user_data = 9;
optional GetUpdatesMetadataResponse stream_metadata = 10;
// If GetUpdatesStreamingResponse is contained in the ClientToServerResponse,
// none of the other fields (error_code and etc) will be set.
diff --git a/sync/sync.gyp b/sync/sync.gyp
index 9d334d0..318f34a 100644
--- a/sync/sync.gyp
+++ b/sync/sync.gyp
@@ -71,8 +71,6 @@
'engine/build_commit_command.h',
'engine/cleanup_disabled_types_command.cc',
'engine/cleanup_disabled_types_command.h',
- 'engine/clear_data_command.cc',
- 'engine/clear_data_command.h',
'engine/commit.cc',
'engine/commit.h',
'engine/conflict_resolver.cc',
@@ -513,7 +511,6 @@
'engine/apply_updates_command_unittest.cc',
'engine/build_commit_command_unittest.cc',
'engine/cleanup_disabled_types_command_unittest.cc',
- 'engine/clear_data_command_unittest.cc',
'engine/download_updates_command_unittest.cc',
'engine/model_changing_syncer_command_unittest.cc',
'engine/nigori_util_unittest.cc',
diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc
index f3c8ccd..84a07dd 100644
--- a/sync/test/engine/mock_connection_manager.cc
+++ b/sync/test/engine/mock_connection_manager.cc
@@ -145,8 +145,6 @@ bool MockConnectionManager::PostBufferToPath(PostBufferParams* params,
ProcessCommit(&post, &response);
} else if (post.message_contents() == ClientToServerMessage::GET_UPDATES) {
ProcessGetUpdates(&post, &response);
- } else if (post.message_contents() == ClientToServerMessage::CLEAR_DATA) {
- ProcessClearData(&post, &response);
} else {
EXPECT_TRUE(false) << "Unknown/unsupported ClientToServerMessage";
return false;
@@ -452,21 +450,6 @@ void MockConnectionManager::ProcessGetUpdates(ClientToServerMessage* csm,
update_queue_.pop_front();
}
-void MockConnectionManager::SetClearUserDataResponseStatus(
- sync_pb::SyncEnums::ErrorType errortype ) {
- // Note: this is not a thread-safe set, ok for now. NOT ok if tests
- // run the syncer on the background thread while this method is called.
- clear_user_data_response_errortype_ = errortype;
-}
-
-void MockConnectionManager::ProcessClearData(ClientToServerMessage* csm,
- ClientToServerResponse* response) {
- CHECK(csm->has_clear_user_data());
- ASSERT_EQ(csm->message_contents(), ClientToServerMessage::CLEAR_DATA);
- response->clear_user_data();
- response->set_error_code(clear_user_data_response_errortype_);
-}
-
bool MockConnectionManager::ShouldConflictThisCommit() {
bool conflict = false;
if (conflict_all_commits_) {
diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
index d979a54..84c802c 100644
--- a/sync/test/engine/mock_connection_manager.h
+++ b/sync/test/engine/mock_connection_manager.h
@@ -121,8 +121,6 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
void FailNextPostBufferToPathCall() { countdown_to_postbuffer_fail_ = 1; }
void FailNthPostBufferToPathCall(int n) { countdown_to_postbuffer_fail_ = n; }
- void SetClearUserDataResponseStatus(sync_pb::SyncEnums::ErrorType errortype);
-
void FailNonPeriodicGetUpdates() { fail_non_periodic_get_updates_ = true; }
// Simple inspectors.