| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #include "components/sync/engine_impl/loopback_server/loopback_connection_manage
r.h" | 4 #include "components/sync/engine_impl/loopback_server/loopback_connection_manage
r.h" |
| 5 | 5 |
| 6 #include <string> | |
| 7 | |
| 8 namespace syncer { | 6 namespace syncer { |
| 9 | 7 |
| 10 LoopbackConnectionManager::LoopbackConnectionManager( | 8 LoopbackConnectionManager::LoopbackConnectionManager( |
| 11 CancelationSignal* signal, | 9 CancelationSignal* signal, |
| 12 const base::FilePath& persistent_file) | 10 const base::FilePath& persistent_file) |
| 13 : ServerConnectionManager("localhost", 0, false, signal), | 11 : ServerConnectionManager("localhost", 0, false, signal), |
| 14 loopback_server_(persistent_file) {} | 12 loopback_server_(persistent_file) {} |
| 15 | 13 |
| 16 LoopbackConnectionManager::~LoopbackConnectionManager() {} | 14 LoopbackConnectionManager::~LoopbackConnectionManager() {} |
| 17 | 15 |
| 18 bool LoopbackConnectionManager::PostBufferToPath( | 16 bool LoopbackConnectionManager::PostBufferToPath( |
| 19 PostBufferParams* params, | 17 PostBufferParams* params, |
| 20 const std::string& path, | 18 const std::string& path, |
| 21 const std::string& auth_token) { | 19 const std::string& auth_token) { |
| 22 loopback_server_.HandleCommand( | 20 loopback_server_.HandleCommand( |
| 23 params->buffer_in, ¶ms->response.server_status, | 21 params->buffer_in, ¶ms->response.server_status, |
| 24 ¶ms->response.response_code, ¶ms->buffer_out); | 22 ¶ms->response.response_code, ¶ms->buffer_out); |
| 25 return params->response.server_status == HttpResponse::SERVER_CONNECTION_OK; | 23 return params->response.server_status == HttpResponse::SERVER_CONNECTION_OK; |
| 26 } | 24 } |
| 27 | 25 |
| 28 } // namespace syncer | 26 } // namespace syncer |
| OLD | NEW |