Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5057)

Unified Diff: chrome/browser/sync/engine/clear_data_command.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/engine/clear_data_command.cc
diff --git a/chrome/browser/sync/engine/clear_data_command.cc b/chrome/browser/sync/engine/clear_data_command.cc
deleted file mode 100644
index e6f21cc811cb8b4e7be170d715b3711bfff5a2e3..0000000000000000000000000000000000000000
--- a/chrome/browser/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 "chrome/browser/sync/engine/clear_data_command.h"
-
-#include <string>
-
-#include "chrome/browser/sync/engine/syncer.h"
-#include "chrome/browser/sync/engine/syncer_proto_util.h"
-#include "chrome/browser/sync/engine/syncproto.h"
-#include "chrome/browser/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
« no previous file with comments | « chrome/browser/sync/engine/clear_data_command.h ('k') | chrome/browser/sync/engine/clear_data_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698