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

Unified Diff: sync/engine/clear_server_data.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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
« no previous file with comments | « sync/engine/clear_server_data.h ('k') | sync/engine/commit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/clear_server_data.cc
diff --git a/sync/engine/clear_server_data.cc b/sync/engine/clear_server_data.cc
deleted file mode 100644
index 3f09261cf589eb9bea53009afb7c3c36db677fd3..0000000000000000000000000000000000000000
--- a/sync/engine/clear_server_data.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015 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_server_data.h"
-
-#include "base/trace_event/trace_event.h"
-#include "sync/engine/syncer.h"
-#include "sync/engine/syncer_proto_util.h"
-#include "sync/internal_api/public/events/clear_server_data_request_event.h"
-#include "sync/internal_api/public/events/clear_server_data_response_event.h"
-#include "sync/sessions/sync_session.h"
-
-namespace syncer {
-
-ClearServerData::ClearServerData(const std::string& account_name) {
- request_.set_share(account_name);
- request_.set_message_contents(
- sync_pb::ClientToServerMessage::CLEAR_SERVER_DATA);
- request_.mutable_clear_server_data();
-}
-
-ClearServerData::~ClearServerData() {}
-
-SyncerError ClearServerData::SendRequest(sessions::SyncSession* session) {
- if (session->context()->debug_info_getter()) {
- sync_pb::DebugInfo* debug_info = request_.mutable_debug_info();
- session->context()->debug_info_getter()->GetDebugInfo(debug_info);
- }
-
- DVLOG(1) << "Sending ClearServerData message.";
-
- const ClearServerDataRequestEvent request_event(base::Time::Now(), request_);
- session->SendProtocolEvent(request_event);
-
- sync_pb::ClientToServerResponse response;
-
- TRACE_EVENT_BEGIN0("sync", "PostClearServerData");
- const SyncerError post_result = SyncerProtoUtil::PostClientToServerMessage(
- &request_, &response, session, nullptr);
- TRACE_EVENT_END0("sync", "PostClearServerData");
-
- const ClearServerDataResponseEvent response_event(base::Time::Now(),
- post_result, response);
- session->SendProtocolEvent(response_event);
-
- if (post_result != SYNCER_OK) {
- DVLOG(1) << "Post ClearServerData failed";
- return post_result;
- }
-
- if (!response.has_clear_server_data()) {
- DVLOG(1) << "ClearServerData response has no ClearServerData body!";
- return SERVER_RESPONSE_VALIDATION_FAILED;
- }
-
- if (session->context()->debug_info_getter()) {
- DVLOG(1) << "Clearing client debug info.";
- session->context()->debug_info_getter()->ClearDebugInfo();
- }
-
- return post_result;
-}
-
-} // namespace syncer
« no previous file with comments | « sync/engine/clear_server_data.h ('k') | sync/engine/commit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698