OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "blimp/client/session/blimp_client_url_request_context_getter.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" |
| 11 #include "net/proxy/proxy_config_service.h" |
| 12 #include "net/proxy/proxy_service.h" |
| 13 #include "net/url_request/url_request_context.h" |
| 14 |
| 15 namespace blimp { |
| 16 namespace client { |
| 17 |
| 18 BlimpClientURLRequestContextGetter::BlimpClientURLRequestContextGetter( |
| 19 const scoped_refptr<base::SingleThreadTaskRunner>& io_loop_task_runner) |
| 20 : io_loop_task_runner_(io_loop_task_runner) { |
| 21 builder_.set_proxy_config_service( |
| 22 net::ProxyService::CreateSystemProxyConfigService( |
| 23 io_loop_task_runner_, base::ThreadTaskRunnerHandle::Get())); |
| 24 } |
| 25 |
| 26 BlimpClientURLRequestContextGetter::~BlimpClientURLRequestContextGetter() {} |
| 27 |
| 28 net::URLRequestContext* |
| 29 BlimpClientURLRequestContextGetter::GetURLRequestContext() { |
| 30 if (!url_request_context_) |
| 31 url_request_context_ = builder_.Build(); |
| 32 |
| 33 return url_request_context_.get(); |
| 34 } |
| 35 |
| 36 scoped_refptr<base::SingleThreadTaskRunner> |
| 37 BlimpClientURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 38 return io_loop_task_runner_; |
| 39 } |
| 40 |
| 41 } // namespace client |
| 42 } // namespace blimp |
OLD | NEW |