| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 base::FilePath HeadlessBrowserContext::GetPath() const { | 88 base::FilePath HeadlessBrowserContext::GetPath() const { |
| 89 return path_; | 89 return path_; |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool HeadlessBrowserContext::IsOffTheRecord() const { | 92 bool HeadlessBrowserContext::IsOffTheRecord() const { |
| 93 return false; | 93 return false; |
| 94 } | 94 } |
| 95 | 95 |
| 96 net::URLRequestContextGetter* HeadlessBrowserContext::GetRequestContext() { | |
| 97 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | |
| 98 } | |
| 99 | |
| 100 net::URLRequestContextGetter* HeadlessBrowserContext::GetMediaRequestContext() { | 96 net::URLRequestContextGetter* HeadlessBrowserContext::GetMediaRequestContext() { |
| 101 return GetRequestContext(); | 97 return content::BrowserContext::GetDefaultStoragePartition(this)-> |
| 98 GetURLRequestContext(); |
| 102 } | 99 } |
| 103 | 100 |
| 104 net::URLRequestContextGetter* | 101 net::URLRequestContextGetter* |
| 105 HeadlessBrowserContext::GetMediaRequestContextForRenderProcess( | 102 HeadlessBrowserContext::GetMediaRequestContextForRenderProcess( |
| 106 int renderer_child_id) { | 103 int renderer_child_id) { |
| 107 return GetRequestContext(); | 104 return content::BrowserContext::GetDefaultStoragePartition(this)-> |
| 105 GetURLRequestContext(); |
| 108 } | 106 } |
| 109 | 107 |
| 110 net::URLRequestContextGetter* | 108 net::URLRequestContextGetter* |
| 111 HeadlessBrowserContext::GetMediaRequestContextForStoragePartition( | 109 HeadlessBrowserContext::GetMediaRequestContextForStoragePartition( |
| 112 const base::FilePath& partition_path, | 110 const base::FilePath& partition_path, |
| 113 bool in_memory) { | 111 bool in_memory) { |
| 114 return GetRequestContext(); | 112 return content::BrowserContext::GetDefaultStoragePartition(this)-> |
| 113 GetURLRequestContext(); |
| 115 } | 114 } |
| 116 | 115 |
| 117 content::ResourceContext* HeadlessBrowserContext::GetResourceContext() { | 116 content::ResourceContext* HeadlessBrowserContext::GetResourceContext() { |
| 118 return resource_context_.get(); | 117 return resource_context_.get(); |
| 119 } | 118 } |
| 120 | 119 |
| 121 content::DownloadManagerDelegate* | 120 content::DownloadManagerDelegate* |
| 122 HeadlessBrowserContext::GetDownloadManagerDelegate() { | 121 HeadlessBrowserContext::GetDownloadManagerDelegate() { |
| 123 return nullptr; | 122 return nullptr; |
| 124 } | 123 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 content::URLRequestInterceptorScopedVector request_interceptors) { | 175 content::URLRequestInterceptorScopedVector request_interceptors) { |
| 177 return nullptr; | 176 return nullptr; |
| 178 } | 177 } |
| 179 | 178 |
| 180 void HeadlessBrowserContext::SetOptionsForTesting( | 179 void HeadlessBrowserContext::SetOptionsForTesting( |
| 181 const HeadlessBrowser::Options& options) { | 180 const HeadlessBrowser::Options& options) { |
| 182 options_ = options; | 181 options_ = options; |
| 183 } | 182 } |
| 184 | 183 |
| 185 } // namespace headless | 184 } // namespace headless |
| OLD | NEW |