| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  124   } |  124   } | 
|  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     ProtocolHandlerMap* protocol_handlers) { | 
|  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, |  | 
|  140     scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |  | 
|  141         chrome_protocol_handler, |  | 
|  142     scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |  | 
|  143         chrome_devtools_protocol_handler) { |  | 
|  144   DCHECK(!url_request_getter_); |  135   DCHECK(!url_request_getter_); | 
|  145   url_request_getter_ = new ShellURLRequestContextGetter( |  136   url_request_getter_ = new ShellURLRequestContextGetter( | 
|  146       ignore_certificate_errors_, |  137       ignore_certificate_errors_, | 
|  147       GetPath(), |  138       GetPath(), | 
|  148       BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), |  139       BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), | 
|  149       BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), |  140       BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE), | 
|  150       blob_protocol_handler.Pass(), |  141       protocol_handlers); | 
|  151       file_system_protocol_handler.Pass(), |  | 
|  152       developer_protocol_handler.Pass(), |  | 
|  153       chrome_protocol_handler.Pass(), |  | 
|  154       chrome_devtools_protocol_handler.Pass()); |  | 
|  155   resource_context_->set_url_request_context_getter(url_request_getter_.get()); |  142   resource_context_->set_url_request_context_getter(url_request_getter_.get()); | 
|  156   return url_request_getter_.get(); |  143   return url_request_getter_.get(); | 
|  157 } |  144 } | 
|  158  |  145  | 
|  159 net::URLRequestContextGetter* |  146 net::URLRequestContextGetter* | 
|  160     ShellBrowserContext::GetRequestContextForRenderProcess( |  147     ShellBrowserContext::GetRequestContextForRenderProcess( | 
|  161         int renderer_child_id)  { |  148         int renderer_child_id)  { | 
|  162   return GetRequestContext(); |  149   return GetRequestContext(); | 
|  163 } |  150 } | 
|  164  |  151  | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|  177     ShellBrowserContext::GetMediaRequestContextForStoragePartition( |  164     ShellBrowserContext::GetMediaRequestContextForStoragePartition( | 
|  178         const base::FilePath& partition_path, |  165         const base::FilePath& partition_path, | 
|  179         bool in_memory) { |  166         bool in_memory) { | 
|  180   return GetRequestContext(); |  167   return GetRequestContext(); | 
|  181 } |  168 } | 
|  182  |  169  | 
|  183 net::URLRequestContextGetter* |  170 net::URLRequestContextGetter* | 
|  184     ShellBrowserContext::CreateRequestContextForStoragePartition( |  171     ShellBrowserContext::CreateRequestContextForStoragePartition( | 
|  185         const base::FilePath& partition_path, |  172         const base::FilePath& partition_path, | 
|  186         bool in_memory, |  173         bool in_memory, | 
|  187         scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |  174         ProtocolHandlerMap* protocol_handlers) { | 
|  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, |  | 
|  193         scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |  | 
|  194             chrome_protocol_handler, |  | 
|  195         scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |  | 
|  196             chrome_devtools_protocol_handler) { |  | 
|  197   return NULL; |  175   return NULL; | 
|  198 } |  176 } | 
|  199  |  177  | 
|  200 ResourceContext* ShellBrowserContext::GetResourceContext()  { |  178 ResourceContext* ShellBrowserContext::GetResourceContext()  { | 
|  201   return resource_context_.get(); |  179   return resource_context_.get(); | 
|  202 } |  180 } | 
|  203  |  181  | 
|  204 GeolocationPermissionContext* |  182 GeolocationPermissionContext* | 
|  205     ShellBrowserContext::GetGeolocationPermissionContext()  { |  183     ShellBrowserContext::GetGeolocationPermissionContext()  { | 
|  206   return NULL; |  184   return NULL; | 
|  207 } |  185 } | 
|  208  |  186  | 
|  209 SpeechRecognitionPreferences* |  187 SpeechRecognitionPreferences* | 
|  210     ShellBrowserContext::GetSpeechRecognitionPreferences() { |  188     ShellBrowserContext::GetSpeechRecognitionPreferences() { | 
|  211   return NULL; |  189   return NULL; | 
|  212 } |  190 } | 
|  213  |  191  | 
|  214 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { |  192 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { | 
|  215   return NULL; |  193   return NULL; | 
|  216 } |  194 } | 
|  217  |  195  | 
|  218 }  // namespace content |  196 }  // namespace content | 
| OLD | NEW |