| 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/engine/app/blimp_system_url_request_context_getter.h" |
| 6 |
| 7 #include <utility> |
| 8 #include <vector> |
| 9 |
| 10 #include "base/logging.h" |
| 11 #include "base/single_thread_task_runner.h" |
| 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "net/url_request/url_request_context.h" |
| 14 #include "net/url_request/url_request_context_builder.h" |
| 15 |
| 16 namespace blimp { |
| 17 namespace engine { |
| 18 |
| 19 BlimpSystemURLRequestContextGetter::BlimpSystemURLRequestContextGetter() { |
| 20 // Must first be created on the UI thread. |
| 21 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 22 } |
| 23 |
| 24 BlimpSystemURLRequestContextGetter::~BlimpSystemURLRequestContextGetter() {} |
| 25 |
| 26 net::URLRequestContext* |
| 27 BlimpSystemURLRequestContextGetter::GetURLRequestContext() { |
| 28 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 29 if (!url_request_context_) { |
| 30 // Use default values |
| 31 net::URLRequestContextBuilder builder; |
| 32 url_request_context_ = builder.Build(); |
| 33 } |
| 34 return url_request_context_.get(); |
| 35 } |
| 36 |
| 37 scoped_refptr<base::SingleThreadTaskRunner> |
| 38 BlimpSystemURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 39 return content::BrowserThread::GetMessageLoopProxyForThread( |
| 40 content::BrowserThread::IO); |
| 41 } |
| 42 |
| 43 } // namespace engine |
| 44 } // namespace blimp |
| OLD | NEW |