| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "headless/lib/browser/headless_browser_context.h" | 5 #include "headless/lib/browser/headless_browser_context.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 content::BackgroundSyncController* | 133 content::BackgroundSyncController* |
| 134 HeadlessBrowserContext::GetBackgroundSyncController() { | 134 HeadlessBrowserContext::GetBackgroundSyncController() { |
| 135 return nullptr; | 135 return nullptr; |
| 136 } | 136 } |
| 137 | 137 |
| 138 net::URLRequestContextGetter* HeadlessBrowserContext::CreateRequestContext( | 138 net::URLRequestContextGetter* HeadlessBrowserContext::CreateRequestContext( |
| 139 content::ProtocolHandlerMap* protocol_handlers, | 139 content::ProtocolHandlerMap* protocol_handlers, |
| 140 content::URLRequestInterceptorScopedVector request_interceptors) { | 140 content::URLRequestInterceptorScopedVector request_interceptors) { |
| 141 scoped_refptr<HeadlessURLRequestContextGetter> url_request_context_getter( | 141 scoped_refptr<HeadlessURLRequestContextGetter> url_request_context_getter( |
| 142 new HeadlessURLRequestContextGetter( | 142 new HeadlessURLRequestContextGetter( |
| 143 false /* ignore_certificate_errors */, GetPath(), | |
| 144 content::BrowserThread::GetMessageLoopProxyForThread( | 143 content::BrowserThread::GetMessageLoopProxyForThread( |
| 145 content::BrowserThread::IO), | 144 content::BrowserThread::IO), |
| 146 content::BrowserThread::GetMessageLoopProxyForThread( | 145 content::BrowserThread::GetMessageLoopProxyForThread( |
| 147 content::BrowserThread::FILE), | 146 content::BrowserThread::FILE), |
| 148 protocol_handlers, std::move(request_interceptors), | 147 protocol_handlers, std::move(request_interceptors), options())); |
| 149 nullptr /* net_log */, options())); | |
| 150 resource_context_->set_url_request_context_getter(url_request_context_getter); | 148 resource_context_->set_url_request_context_getter(url_request_context_getter); |
| 151 return url_request_context_getter.get(); | 149 return url_request_context_getter.get(); |
| 152 } | 150 } |
| 153 | 151 |
| 154 net::URLRequestContextGetter* | 152 net::URLRequestContextGetter* |
| 155 HeadlessBrowserContext::CreateRequestContextForStoragePartition( | 153 HeadlessBrowserContext::CreateRequestContextForStoragePartition( |
| 156 const base::FilePath& partition_path, | 154 const base::FilePath& partition_path, |
| 157 bool in_memory, | 155 bool in_memory, |
| 158 content::ProtocolHandlerMap* protocol_handlers, | 156 content::ProtocolHandlerMap* protocol_handlers, |
| 159 content::URLRequestInterceptorScopedVector request_interceptors) { | 157 content::URLRequestInterceptorScopedVector request_interceptors) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 171 bool in_memory) { | 169 bool in_memory) { |
| 172 return nullptr; | 170 return nullptr; |
| 173 } | 171 } |
| 174 | 172 |
| 175 void HeadlessBrowserContext::SetOptionsForTesting( | 173 void HeadlessBrowserContext::SetOptionsForTesting( |
| 176 HeadlessBrowser::Options* options) { | 174 HeadlessBrowser::Options* options) { |
| 177 options_ = options; | 175 options_ = options; |
| 178 } | 176 } |
| 179 | 177 |
| 180 } // namespace headless | 178 } // namespace headless |
| OLD | NEW |