OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "components/policy/policy_export.h" |
6 #include "net/url_request/static_http_user_agent_settings.h" | 7 #include "net/url_request/static_http_user_agent_settings.h" |
7 #include "net/url_request/url_request_context_getter.h" | 8 #include "net/url_request/url_request_context_getter.h" |
8 | 9 |
9 #ifndef CHROME_BROWSER_POLICY_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_ | 10 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_ |
10 #define CHROME_BROWSER_POLICY_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_ | 11 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_ |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 class HttpNetworkLayer; | 14 class HttpNetworkLayer; |
14 } | 15 } |
15 | 16 |
16 namespace policy { | 17 namespace policy { |
17 | 18 |
18 class SystemPolicyRequestContext | 19 class POLICY_EXPORT SystemPolicyRequestContext |
19 : public net::URLRequestContextGetter { | 20 : public net::URLRequestContextGetter { |
20 public: | 21 public: |
21 SystemPolicyRequestContext( | 22 SystemPolicyRequestContext( |
22 scoped_refptr<net::URLRequestContextGetter> system_context_getter, | 23 scoped_refptr<net::URLRequestContextGetter> system_context_getter, |
23 const std::string& user_agent); | 24 const std::string& user_agent); |
24 | 25 |
25 // Overridden from net::URLRequestContextGetter: | 26 // Overridden from net::URLRequestContextGetter: |
26 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; | 27 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; |
27 virtual scoped_refptr<base::SingleThreadTaskRunner> | 28 virtual scoped_refptr<base::SingleThreadTaskRunner> |
28 GetNetworkTaskRunner() const OVERRIDE; | 29 GetNetworkTaskRunner() const OVERRIDE; |
29 | 30 |
30 protected: | 31 protected: |
31 virtual ~SystemPolicyRequestContext(); | 32 virtual ~SystemPolicyRequestContext(); |
32 | 33 |
33 private: | 34 private: |
34 scoped_refptr<net::URLRequestContextGetter> system_context_getter_; | 35 scoped_refptr<net::URLRequestContextGetter> system_context_getter_; |
35 | 36 |
36 // The lazy-initialized URLRequestContext associated with this getter. | 37 // The lazy-initialized URLRequestContext associated with this getter. |
37 scoped_ptr<net::URLRequestContext> context_; | 38 scoped_ptr<net::URLRequestContext> context_; |
38 | 39 |
39 // HttpNetworkLayer associated with |context_|. | 40 // HttpNetworkLayer associated with |context_|. |
40 scoped_ptr<net::HttpNetworkLayer> http_transaction_factory_; | 41 scoped_ptr<net::HttpNetworkLayer> http_transaction_factory_; |
41 | 42 |
42 net::StaticHttpUserAgentSettings http_user_agent_settings_; | 43 net::StaticHttpUserAgentSettings http_user_agent_settings_; |
43 DISALLOW_COPY_AND_ASSIGN(SystemPolicyRequestContext); | 44 DISALLOW_COPY_AND_ASSIGN(SystemPolicyRequestContext); |
44 }; | 45 }; |
45 | 46 |
46 } // namespace policy | 47 } // namespace policy |
47 | 48 |
48 #endif // CHROME_BROWSER_POLICY_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_ | 49 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_SYSTEM_POLICY_REQUEST_CONTEXT_H_ |
OLD | NEW |