| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell_browser_context.h" | 5 #include "content/shell/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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 return download_manager_delegate_.get(); | 126 return download_manager_delegate_.get(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { | 129 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { |
| 130 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 130 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( | 133 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( |
| 134 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 134 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 135 blob_protocol_handler, | |
| 136 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 137 file_system_protocol_handler, | |
| 138 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 139 developer_protocol_handler, | 135 developer_protocol_handler, |
| 140 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 136 ProtocolHandlerMap* protocol_handlers) { |
| 141 chrome_protocol_handler, | |
| 142 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 143 chrome_devtools_protocol_handler) { | |
| 144 DCHECK(!url_request_getter_); | 137 DCHECK(!url_request_getter_); |
| 145 url_request_getter_ = new ShellURLRequestContextGetter( | 138 url_request_getter_ = new ShellURLRequestContextGetter( |
| 146 ignore_certificate_errors_, | 139 ignore_certificate_errors_, |
| 147 GetPath(), | 140 GetPath(), |
| 148 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), | 141 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), |
| 149 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), | 142 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), |
| 150 blob_protocol_handler.Pass(), | |
| 151 file_system_protocol_handler.Pass(), | |
| 152 developer_protocol_handler.Pass(), | 143 developer_protocol_handler.Pass(), |
| 153 chrome_protocol_handler.Pass(), | 144 protocol_handlers); |
| 154 chrome_devtools_protocol_handler.Pass()); | |
| 155 resource_context_->set_url_request_context_getter(url_request_getter_.get()); | 145 resource_context_->set_url_request_context_getter(url_request_getter_.get()); |
| 156 return url_request_getter_.get(); | 146 return url_request_getter_.get(); |
| 157 } | 147 } |
| 158 | 148 |
| 159 net::URLRequestContextGetter* | 149 net::URLRequestContextGetter* |
| 160 ShellBrowserContext::GetRequestContextForRenderProcess( | 150 ShellBrowserContext::GetRequestContextForRenderProcess( |
| 161 int renderer_child_id) { | 151 int renderer_child_id) { |
| 162 return GetRequestContext(); | 152 return GetRequestContext(); |
| 163 } | 153 } |
| 164 | 154 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 178 const base::FilePath& partition_path, | 168 const base::FilePath& partition_path, |
| 179 bool in_memory) { | 169 bool in_memory) { |
| 180 return GetRequestContext(); | 170 return GetRequestContext(); |
| 181 } | 171 } |
| 182 | 172 |
| 183 net::URLRequestContextGetter* | 173 net::URLRequestContextGetter* |
| 184 ShellBrowserContext::CreateRequestContextForStoragePartition( | 174 ShellBrowserContext::CreateRequestContextForStoragePartition( |
| 185 const base::FilePath& partition_path, | 175 const base::FilePath& partition_path, |
| 186 bool in_memory, | 176 bool in_memory, |
| 187 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 177 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 188 blob_protocol_handler, | |
| 189 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 190 file_system_protocol_handler, | |
| 191 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 192 developer_protocol_handler, | 178 developer_protocol_handler, |
| 193 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 179 ProtocolHandlerMap* protocol_handlers) { |
| 194 chrome_protocol_handler, | |
| 195 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 196 chrome_devtools_protocol_handler) { | |
| 197 return NULL; | 180 return NULL; |
| 198 } | 181 } |
| 199 | 182 |
| 200 ResourceContext* ShellBrowserContext::GetResourceContext() { | 183 ResourceContext* ShellBrowserContext::GetResourceContext() { |
| 201 return resource_context_.get(); | 184 return resource_context_.get(); |
| 202 } | 185 } |
| 203 | 186 |
| 204 GeolocationPermissionContext* | 187 GeolocationPermissionContext* |
| 205 ShellBrowserContext::GetGeolocationPermissionContext() { | 188 ShellBrowserContext::GetGeolocationPermissionContext() { |
| 206 return NULL; | 189 return NULL; |
| 207 } | 190 } |
| 208 | 191 |
| 209 SpeechRecognitionPreferences* | 192 SpeechRecognitionPreferences* |
| 210 ShellBrowserContext::GetSpeechRecognitionPreferences() { | 193 ShellBrowserContext::GetSpeechRecognitionPreferences() { |
| 211 return NULL; | 194 return NULL; |
| 212 } | 195 } |
| 213 | 196 |
| 214 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 197 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |
| 215 return NULL; | 198 return NULL; |
| 216 } | 199 } |
| 217 | 200 |
| 218 } // namespace content | 201 } // namespace content |
| OLD | NEW |