| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // currently active profile. | 51 // currently active profile. |
| 52 RequestContext( | 52 RequestContext( |
| 53 net::URLRequestContext* baseline_context, | 53 net::URLRequestContext* baseline_context, |
| 54 const scoped_refptr<base::SingleThreadTaskRunner>& | 54 const scoped_refptr<base::SingleThreadTaskRunner>& |
| 55 network_task_runner, | 55 network_task_runner, |
| 56 const std::string& user_agent); | 56 const std::string& user_agent); |
| 57 | 57 |
| 58 // The destructor MUST be called on the IO thread. | 58 // The destructor MUST be called on the IO thread. |
| 59 virtual ~RequestContext(); | 59 virtual ~RequestContext(); |
| 60 | 60 |
| 61 virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE; | |
| 62 | |
| 63 private: | 61 private: |
| 64 net::URLRequestContext* const baseline_context_; | 62 net::URLRequestContext* const baseline_context_; |
| 65 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 63 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 66 const std::string user_agent_; | 64 scoped_ptr<net::ConstHttpUserAgentSettings> |
| 65 const_http_user_agent_settings_; |
| 67 | 66 |
| 68 DISALLOW_COPY_AND_ASSIGN(RequestContext); | 67 DISALLOW_COPY_AND_ASSIGN(RequestContext); |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 // Lazy-getter for RequestContext objects. | 70 // Lazy-getter for RequestContext objects. |
| 72 class RequestContextGetter : public net::URLRequestContextGetter { | 71 class RequestContextGetter : public net::URLRequestContextGetter { |
| 73 public: | 72 public: |
| 74 RequestContextGetter( | 73 RequestContextGetter( |
| 75 net::URLRequestContextGetter* baseline_context_getter, | 74 net::URLRequestContextGetter* baseline_context_getter, |
| 76 const std::string& user_agent); | 75 const std::string& user_agent); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 221 |
| 223 const scoped_refptr<HttpBridge::RequestContextGetter> | 222 const scoped_refptr<HttpBridge::RequestContextGetter> |
| 224 request_context_getter_; | 223 request_context_getter_; |
| 225 | 224 |
| 226 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory); | 225 DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory); |
| 227 }; | 226 }; |
| 228 | 227 |
| 229 } // namespace syncer | 228 } // namespace syncer |
| 230 | 229 |
| 231 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ | 230 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_BRIDGE_H_ |
| OLD | NEW |