| 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 "components/policy/core/common/cloud/system_policy_request_context.h" | 5 #include "components/policy/core/common/cloud/system_policy_request_context.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "net/cookies/cookie_monster.h" | 9 #include "net/cookies/cookie_monster.h" |
| 10 #include "net/http/http_network_layer.h" | 10 #include "net/http/http_network_layer.h" |
| 11 #include "net/url_request/url_request_context.h" | 11 #include "net/url_request/url_request_context.h" |
| 12 | 12 |
| 13 namespace policy { | 13 namespace policy { |
| 14 | 14 |
| 15 SystemPolicyRequestContext::SystemPolicyRequestContext( | 15 SystemPolicyRequestContext::SystemPolicyRequestContext( |
| 16 scoped_refptr<net::URLRequestContextGetter> system_context_getter, | 16 scoped_refptr<net::URLRequestContextGetter> system_context_getter, |
| 17 const std::string& user_agent) | 17 const std::string& user_agent) |
| 18 : system_context_getter_(system_context_getter), | 18 : system_context_getter_(system_context_getter), |
| 19 http_user_agent_settings_("*", user_agent) { | 19 http_user_agent_settings_("*", user_agent) { |
| 20 DCHECK(system_context_getter); | 20 DCHECK(system_context_getter.get()); |
| 21 } | 21 } |
| 22 | 22 |
| 23 SystemPolicyRequestContext::~SystemPolicyRequestContext() { | 23 SystemPolicyRequestContext::~SystemPolicyRequestContext() { |
| 24 } | 24 } |
| 25 | 25 |
| 26 net::URLRequestContext* | 26 net::URLRequestContext* |
| 27 SystemPolicyRequestContext::GetURLRequestContext() { | 27 SystemPolicyRequestContext::GetURLRequestContext() { |
| 28 DCHECK(GetNetworkTaskRunner()->RunsTasksOnCurrentThread()); | 28 DCHECK(GetNetworkTaskRunner()->RunsTasksOnCurrentThread()); |
| 29 if (!context_.get()) { | 29 if (!context_.get()) { |
| 30 // Create our URLRequestContext(). | 30 // Create our URLRequestContext(). |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 return context_.get(); | 64 return context_.get(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 scoped_refptr<base::SingleThreadTaskRunner> | 67 scoped_refptr<base::SingleThreadTaskRunner> |
| 68 SystemPolicyRequestContext::GetNetworkTaskRunner() const { | 68 SystemPolicyRequestContext::GetNetworkTaskRunner() const { |
| 69 return system_context_getter_->GetNetworkTaskRunner(); | 69 return system_context_getter_->GetNetworkTaskRunner(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace policy | 72 } // namespace policy |
| OLD | NEW |