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 SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // 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 |
49 // an instance of the HttpPostProviderFactory class. | 49 // an instance of the HttpPostProviderFactory class. |
50 class SYNC_EXPORT_PRIVATE SyncAPIServerConnectionManager | 50 class SYNC_EXPORT_PRIVATE SyncAPIServerConnectionManager |
51 : public ServerConnectionManager { | 51 : public ServerConnectionManager { |
52 public: | 52 public: |
53 // Takes ownership of factory. | 53 // Takes ownership of factory. |
54 SyncAPIServerConnectionManager(const std::string& server, | 54 SyncAPIServerConnectionManager(const std::string& server, |
55 int port, | 55 int port, |
56 bool use_ssl, | 56 bool use_ssl, |
57 bool use_oauth2_token, | 57 bool use_oauth2_token, |
58 HttpPostProviderFactory* factory); | 58 HttpPostProviderFactory* factory, |
| 59 CancelationSignal* cancelation_signal); |
59 virtual ~SyncAPIServerConnectionManager(); | 60 virtual ~SyncAPIServerConnectionManager(); |
60 | 61 |
61 // ServerConnectionManager overrides. | 62 // ServerConnectionManager overrides. |
62 virtual Connection* MakeConnection() OVERRIDE; | 63 virtual Connection* MakeConnection() OVERRIDE; |
63 virtual void TerminateAllIO() OVERRIDE; | |
64 | 64 |
65 private: | 65 private: |
| 66 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, |
| 67 VeryEarlyAbortPost); |
66 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, EarlyAbortPost); | 68 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, EarlyAbortPost); |
67 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, AbortPost); | 69 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, AbortPost); |
68 | 70 |
69 // A factory creating concrete HttpPostProviders for use whenever we need to | 71 // A factory creating concrete HttpPostProviders for use whenever we need to |
70 // issue a POST to sync servers. | 72 // issue a POST to sync servers. |
71 scoped_ptr<HttpPostProviderFactory> post_provider_factory_; | 73 scoped_ptr<HttpPostProviderFactory> post_provider_factory_; |
72 | 74 |
73 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); | 75 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); |
74 }; | 76 }; |
75 | 77 |
76 } // namespace syncer | 78 } // namespace syncer |
77 | 79 |
78 #endif // SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 80 #endif // SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
OLD | NEW |