| 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_PUBLIC_HTTP_BRIDGE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class HttpBridgeTest; | 26 class HttpBridgeTest; |
| 27 | 27 |
| 28 namespace base { | 28 namespace base { |
| 29 class MessageLoop; | 29 class MessageLoop; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace net { | 32 namespace net { |
| 33 class HttpResponseHeaders; | 33 class HttpResponseHeaders; |
| 34 class HttpUserAgentSettings; | 34 class HttpUserAgentSettings; |
| 35 class URLFetcher; | 35 class URLFetcher; |
| 36 class URLRequestJobFactory; |
| 36 } | 37 } |
| 37 | 38 |
| 38 namespace syncer { | 39 namespace syncer { |
| 39 | 40 |
| 40 class CancelationSignal; | 41 class CancelationSignal; |
| 41 | 42 |
| 42 // A bridge between the syncer and Chromium HTTP layers. | 43 // A bridge between the syncer and Chromium HTTP layers. |
| 43 // Provides a way for the sync backend to use Chromium directly for HTTP | 44 // Provides a way for the sync backend to use Chromium directly for HTTP |
| 44 // requests rather than depending on a third party provider (e.g libcurl). | 45 // requests rather than depending on a third party provider (e.g libcurl). |
| 45 // This is a one-time use bridge. Create one for each request you want to make. | 46 // This is a one-time use bridge. Create one for each request you want to make. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 65 network_task_runner, | 66 network_task_runner, |
| 66 const std::string& user_agent); | 67 const std::string& user_agent); |
| 67 | 68 |
| 68 // The destructor MUST be called on the IO thread. | 69 // The destructor MUST be called on the IO thread. |
| 69 virtual ~RequestContext(); | 70 virtual ~RequestContext(); |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 net::URLRequestContext* const baseline_context_; | 73 net::URLRequestContext* const baseline_context_; |
| 73 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 74 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 74 scoped_ptr<net::HttpUserAgentSettings> http_user_agent_settings_; | 75 scoped_ptr<net::HttpUserAgentSettings> http_user_agent_settings_; |
| 76 scoped_ptr<net::URLRequestJobFactory> job_factory_; |
| 75 | 77 |
| 76 DISALLOW_COPY_AND_ASSIGN(RequestContext); | 78 DISALLOW_COPY_AND_ASSIGN(RequestContext); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 // Lazy-getter for RequestContext objects. | 81 // Lazy-getter for RequestContext objects. |
| 80 class SYNC_EXPORT_PRIVATE RequestContextGetter | 82 class SYNC_EXPORT_PRIVATE RequestContextGetter |
| 81 : public net::URLRequestContextGetter { | 83 : public net::URLRequestContextGetter { |
| 82 public: | 84 public: |
| 83 RequestContextGetter( | 85 RequestContextGetter( |
| 84 net::URLRequestContextGetter* baseline_context_getter, | 86 net::URLRequestContextGetter* baseline_context_getter, |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 NetworkTimeUpdateCallback network_time_update_callback_; | 261 NetworkTimeUpdateCallback network_time_update_callback_; |
| 260 | 262 |
| 261 CancelationSignal* const cancelation_signal_; | 263 CancelationSignal* const cancelation_signal_; |
| 262 | 264 |
| 263 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory); | 265 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory); |
| 264 }; | 266 }; |
| 265 | 267 |
| 266 } // namespace syncer | 268 } // namespace syncer |
| 267 | 269 |
| 268 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ | 270 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ |
| OLD | NEW |