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