| 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/user_policy_request_context.h" | 5 #include "components/policy/core/common/cloud/user_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 UserPolicyRequestContext::UserPolicyRequestContext( | 15 UserPolicyRequestContext::UserPolicyRequestContext( |
| 16 scoped_refptr<net::URLRequestContextGetter> user_context_getter, | 16 scoped_refptr<net::URLRequestContextGetter> user_context_getter, |
| 17 scoped_refptr<net::URLRequestContextGetter> system_context_getter, | 17 scoped_refptr<net::URLRequestContextGetter> system_context_getter, |
| 18 const std::string& user_agent) | 18 const std::string& user_agent) |
| 19 : user_context_getter_(user_context_getter), | 19 : user_context_getter_(user_context_getter), |
| 20 system_context_getter_(system_context_getter), | 20 system_context_getter_(system_context_getter), |
| 21 http_user_agent_settings_("*", user_agent) { | 21 http_user_agent_settings_("*", user_agent) { |
| 22 DCHECK(user_context_getter_); | 22 DCHECK(user_context_getter_.get()); |
| 23 } | 23 } |
| 24 | 24 |
| 25 UserPolicyRequestContext::~UserPolicyRequestContext() { | 25 UserPolicyRequestContext::~UserPolicyRequestContext() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 net::URLRequestContext* | 28 net::URLRequestContext* |
| 29 UserPolicyRequestContext::GetURLRequestContext() { | 29 UserPolicyRequestContext::GetURLRequestContext() { |
| 30 DCHECK(GetNetworkTaskRunner()->RunsTasksOnCurrentThread()); | 30 DCHECK(GetNetworkTaskRunner()->RunsTasksOnCurrentThread()); |
| 31 if (!context_.get()) { | 31 if (!context_.get()) { |
| 32 // Create our URLRequestContext(). | 32 // Create our URLRequestContext(). |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 } | 53 } |
| 54 return context_.get(); | 54 return context_.get(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 scoped_refptr<base::SingleThreadTaskRunner> | 57 scoped_refptr<base::SingleThreadTaskRunner> |
| 58 UserPolicyRequestContext::GetNetworkTaskRunner() const { | 58 UserPolicyRequestContext::GetNetworkTaskRunner() const { |
| 59 return user_context_getter_->GetNetworkTaskRunner(); | 59 return user_context_getter_->GetNetworkTaskRunner(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace policy | 62 } // namespace policy |
| OLD | NEW |