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

Unified Diff: components/sync/engine_impl/loopback_server/loopback_connection_manager.cc

Issue 2360703002: [Sync] Implements the loopback sync server. (Closed)
Patch Set: Shuffle and rename stuff around. Created 4 years, 2 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: components/sync/engine_impl/loopback_server/loopback_connection_manager.cc
diff --git a/components/sync/engine_impl/loopback_server/loopback_connection_manager.cc b/components/sync/engine_impl/loopback_server/loopback_connection_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9a4dd88e617ac9cbd29750e1e988ff7e5a5ed487
--- /dev/null
+++ b/components/sync/engine_impl/loopback_server/loopback_connection_manager.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 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 "components/sync/engine_impl/loopback_server/loopback_connection_manager.h"
+
+#include <string>
+
+#include "components/sync/syncable/directory.h"
pavely 2016/10/06 23:48:45 I don't think you need directory.h here.
pastarmovj 2016/10/13 14:13:39 Done.
+
+namespace syncer {
+
+LoopbackConnectionManager::LoopbackConnectionManager(
+ CancelationSignal* signal,
+ const base::FilePath& persistent_file)
+ : ServerConnectionManager("localhost", 0, false, signal),
+ loopback_server_(persistent_file) {}
+
+LoopbackConnectionManager::~LoopbackConnectionManager() {}
+
+bool LoopbackConnectionManager::PostBufferToPath(
+ PostBufferParams* params,
+ const std::string& path,
+ const std::string& auth_token) {
+ loopback_server_.HandleCommand(
+ params->buffer_in, &params->response.server_status,
+ &params->response.response_code, &params->buffer_out);
+ return params->response.server_status == HttpResponse::SERVER_CONNECTION_OK;
+}
+
+} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698