OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell_browser_context.h" | 5 #include "content/shell/browser/shell_browser_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 return download_manager_delegate_.get(); | 129 return download_manager_delegate_.get(); |
130 } | 130 } |
131 | 131 |
132 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { | 132 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { |
133 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 133 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
134 } | 134 } |
135 | 135 |
136 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( | 136 content::ShellURLRequestContextGetter* |
| 137 ShellBrowserContext::CreateURLRequestContextGetter( |
137 ProtocolHandlerMap* protocol_handlers, | 138 ProtocolHandlerMap* protocol_handlers, |
138 URLRequestInterceptorScopedVector request_interceptors) { | 139 URLRequestInterceptorScopedVector request_interceptors) { |
139 DCHECK(!url_request_getter_.get()); | 140 return new ShellURLRequestContextGetter( |
140 url_request_getter_ = new ShellURLRequestContextGetter( | |
141 ignore_certificate_errors_, | 141 ignore_certificate_errors_, |
142 GetPath(), | 142 GetPath(), |
143 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), | 143 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), |
144 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), | 144 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), |
145 protocol_handlers, | 145 protocol_handlers, |
146 request_interceptors.Pass(), | 146 request_interceptors.Pass(), |
147 net_log_); | 147 net_log_); |
| 148 } |
| 149 |
| 150 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( |
| 151 ProtocolHandlerMap* protocol_handlers, |
| 152 URLRequestInterceptorScopedVector request_interceptors) { |
| 153 DCHECK(!url_request_getter_.get()); |
| 154 url_request_getter_ = CreateURLRequestContextGetter( |
| 155 protocol_handlers, request_interceptors.Pass()); |
148 resource_context_->set_url_request_context_getter(url_request_getter_.get()); | 156 resource_context_->set_url_request_context_getter(url_request_getter_.get()); |
149 return url_request_getter_.get(); | 157 return url_request_getter_.get(); |
150 } | 158 } |
151 | 159 |
| 160 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( |
| 161 ProtocolHandlerMap* protocol_handlers, |
| 162 URLRequestInterceptorScopedVector request_interceptors, |
| 163 net::NetworkDelegate* network_delegate) { |
| 164 ShellURLRequestContextGetter* shell_request_context_getter = |
| 165 reinterpret_cast<ShellURLRequestContextGetter*>(CreateRequestContext( |
| 166 protocol_handlers, request_interceptors.Pass())); |
| 167 shell_request_context_getter->set_network_delegate(network_delegate); |
| 168 url_request_getter_ = shell_request_context_getter; |
| 169 return url_request_getter_.get(); |
| 170 } |
| 171 |
152 net::URLRequestContextGetter* | 172 net::URLRequestContextGetter* |
153 ShellBrowserContext::GetRequestContextForRenderProcess( | 173 ShellBrowserContext::GetRequestContextForRenderProcess( |
154 int renderer_child_id) { | 174 int renderer_child_id) { |
155 return GetRequestContext(); | 175 return GetRequestContext(); |
156 } | 176 } |
157 | 177 |
158 net::URLRequestContextGetter* | 178 net::URLRequestContextGetter* |
159 ShellBrowserContext::GetMediaRequestContext() { | 179 ShellBrowserContext::GetMediaRequestContext() { |
160 return GetRequestContext(); | 180 return GetRequestContext(); |
161 } | 181 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 216 |
197 PushMessagingService* ShellBrowserContext::GetPushMessagingService() { | 217 PushMessagingService* ShellBrowserContext::GetPushMessagingService() { |
198 return NULL; | 218 return NULL; |
199 } | 219 } |
200 | 220 |
201 SSLHostStateDelegate* ShellBrowserContext::GetSSLHostStateDelegate() { | 221 SSLHostStateDelegate* ShellBrowserContext::GetSSLHostStateDelegate() { |
202 return NULL; | 222 return NULL; |
203 } | 223 } |
204 | 224 |
205 } // namespace content | 225 } // namespace content |
OLD | NEW |