OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 | 4 |
5 #ifndef COMPONENTS_SYNC_CORE_IMPL_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_IMPL_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
6 #define COMPONENTS_SYNC_CORE_IMPL_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 6 #define COMPONENTS_SYNC_CORE_IMPL_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "components/sync/base/sync_export.h" | |
15 #include "components/sync/engine_impl/net/server_connection_manager.h" | 14 #include "components/sync/engine_impl/net/server_connection_manager.h" |
16 | 15 |
17 namespace syncer { | 16 namespace syncer { |
18 | 17 |
19 class HttpPostProviderFactory; | 18 class HttpPostProviderFactory; |
20 class HttpPostProviderInterface; | 19 class HttpPostProviderInterface; |
21 | 20 |
22 // This provides HTTP Post functionality through the interface provided | 21 // This provides HTTP Post functionality through the interface provided |
23 // to the sync API by the application hosting the syncer backend. | 22 // to the sync API by the application hosting the syncer backend. |
24 class SyncAPIBridgedConnection : public ServerConnectionManager::Connection { | 23 class SyncAPIBridgedConnection : public ServerConnectionManager::Connection { |
(...skipping 16 matching lines...) Expand all Loading... |
41 HttpPostProviderFactory* factory_; | 40 HttpPostProviderFactory* factory_; |
42 | 41 |
43 HttpPostProviderInterface* post_provider_; | 42 HttpPostProviderInterface* post_provider_; |
44 | 43 |
45 DISALLOW_COPY_AND_ASSIGN(SyncAPIBridgedConnection); | 44 DISALLOW_COPY_AND_ASSIGN(SyncAPIBridgedConnection); |
46 }; | 45 }; |
47 | 46 |
48 // A ServerConnectionManager subclass used by the syncapi layer. We use a | 47 // A ServerConnectionManager subclass used by the syncapi layer. We use a |
49 // subclass so that we can override MakePost() to generate a POST object using | 48 // subclass so that we can override MakePost() to generate a POST object using |
50 // an instance of the HttpPostProviderFactory class. | 49 // an instance of the HttpPostProviderFactory class. |
51 class SYNC_EXPORT SyncAPIServerConnectionManager | 50 class SyncAPIServerConnectionManager : public ServerConnectionManager { |
52 : public ServerConnectionManager { | |
53 public: | 51 public: |
54 // Takes ownership of factory. | 52 // Takes ownership of factory. |
55 SyncAPIServerConnectionManager(const std::string& server, | 53 SyncAPIServerConnectionManager(const std::string& server, |
56 int port, | 54 int port, |
57 bool use_ssl, | 55 bool use_ssl, |
58 HttpPostProviderFactory* factory, | 56 HttpPostProviderFactory* factory, |
59 CancelationSignal* cancelation_signal); | 57 CancelationSignal* cancelation_signal); |
60 ~SyncAPIServerConnectionManager() override; | 58 ~SyncAPIServerConnectionManager() override; |
61 | 59 |
62 // ServerConnectionManager overrides. | 60 // ServerConnectionManager overrides. |
(...skipping 10 matching lines...) Expand all Loading... |
73 // A factory creating concrete HttpPostProviders for use whenever we need to | 71 // A factory creating concrete HttpPostProviders for use whenever we need to |
74 // issue a POST to sync servers. | 72 // issue a POST to sync servers. |
75 std::unique_ptr<HttpPostProviderFactory> post_provider_factory_; | 73 std::unique_ptr<HttpPostProviderFactory> post_provider_factory_; |
76 | 74 |
77 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); | 75 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); |
78 }; | 76 }; |
79 | 77 |
80 } // namespace syncer | 78 } // namespace syncer |
81 | 79 |
82 #endif // COMPONENTS_SYNC_CORE_IMPL_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 80 #endif // COMPONENTS_SYNC_CORE_IMPL_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
OLD | NEW |