| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_LOOPBACK_CONNECTION_MANAGER_
H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_LOOPBACK_CONNECTION_MANAGER_
H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/sync/engine_impl/loopback_server/loopback_server.h" |
| 11 #include "components/sync/engine_impl/net/server_connection_manager.h" |
| 12 |
| 13 namespace syncer { |
| 14 |
| 15 // This class implements the ServerConnectionManager interface for a local |
| 16 // in-memory virtual connection to the LoopbackServer. Since there is no network |
| 17 // connection to be established we only have to handle POSTs and they will |
| 18 // always succeed. |
| 19 class LoopbackConnectionManager : public ServerConnectionManager { |
| 20 public: |
| 21 LoopbackConnectionManager(CancelationSignal* signal, |
| 22 const base::FilePath& persistent_file); |
| 23 ~LoopbackConnectionManager() override; |
| 24 |
| 25 private: |
| 26 // Overridden ServerConnectionManager functions. |
| 27 bool PostBufferToPath(PostBufferParams* params, |
| 28 const std::string& path, |
| 29 const std::string& auth_token) override; |
| 30 |
| 31 // The loopback server that will handle the requests locally. |
| 32 LoopbackServer loopback_server_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(LoopbackConnectionManager); |
| 35 }; |
| 36 |
| 37 } // namespace syncer |
| 38 |
| 39 #endif // COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_LOOPBACK_CONNECTION_MANAG
ER_H_ |
| OLD | NEW |