Chromium Code Reviews| 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 #ifndef CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ |
| 6 #define CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ | 6 #define CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/public/browser/browser_context.h" | 12 #include "content/public/browser/browser_context.h" |
| 13 #include "net/url_request/url_request_job_factory.h" | |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 class DownloadManagerDelegate; | 17 class DownloadManagerDelegate; |
| 17 class ResourceContext; | 18 class ResourceContext; |
| 18 class ShellDownloadManagerDelegate; | 19 class ShellDownloadManagerDelegate; |
| 20 class ShellResourceContext; | |
| 21 class ShellURLRequestContextGetter; | |
| 19 | 22 |
| 20 class ShellBrowserContext : public BrowserContext { | 23 class ShellBrowserContext : public BrowserContext { |
| 21 public: | 24 public: |
| 22 explicit ShellBrowserContext(bool off_the_record); | 25 explicit ShellBrowserContext(bool off_the_record); |
| 23 virtual ~ShellBrowserContext(); | 26 virtual ~ShellBrowserContext(); |
| 24 | 27 |
| 25 // BrowserContext implementation. | 28 // BrowserContext implementation. |
| 26 virtual FilePath GetPath() OVERRIDE; | 29 virtual FilePath GetPath() OVERRIDE; |
| 27 virtual bool IsOffTheRecord() const OVERRIDE; | 30 virtual bool IsOffTheRecord() const OVERRIDE; |
| 28 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE; | 31 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE; |
| 29 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 32 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
| 30 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 33 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
| 31 int renderer_child_id) OVERRIDE; | 34 int renderer_child_id) OVERRIDE; |
| 32 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; | 35 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; |
| 33 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 36 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
| 34 int renderer_child_id) OVERRIDE; | 37 int renderer_child_id) OVERRIDE; |
| 35 virtual net::URLRequestContextGetter* | 38 virtual net::URLRequestContextGetter* |
| 36 GetMediaRequestContextForStoragePartition( | 39 GetMediaRequestContextForStoragePartition( |
| 37 const FilePath& partition_path, | 40 const FilePath& partition_path, |
| 38 bool in_memory) OVERRIDE; | 41 bool in_memory) OVERRIDE; |
| 39 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | |
| 40 const FilePath& partition_path, | |
| 41 bool in_memory) OVERRIDE; | |
| 42 virtual ResourceContext* GetResourceContext() OVERRIDE; | 42 virtual ResourceContext* GetResourceContext() OVERRIDE; |
| 43 virtual GeolocationPermissionContext* | 43 virtual GeolocationPermissionContext* |
| 44 GetGeolocationPermissionContext() OVERRIDE; | 44 GetGeolocationPermissionContext() OVERRIDE; |
| 45 virtual SpeechRecognitionPreferences* | 45 virtual SpeechRecognitionPreferences* |
| 46 GetSpeechRecognitionPreferences() OVERRIDE; | 46 GetSpeechRecognitionPreferences() OVERRIDE; |
| 47 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 47 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
| 48 | 48 |
| 49 net::URLRequestContextGetter* CreateRequestContext( | |
|
awong
2012/12/13 23:53:08
virtual?
pauljensen
2012/12/14 16:16:20
Why? Remember this is no longer an implementation
awong
2012/12/14 16:44:24
Ah right. Sorry. Forgot that
| |
| 50 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 51 blob_protocol_handler, | |
| 52 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 53 file_system_protocol_handler, | |
| 54 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
| 55 developer_protocol_handler); | |
| 56 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | |
|
awong
2012/12/13 23:53:08
virtual?
| |
| 57 const FilePath& partition_path, | |
| 58 bool in_memory, | |
| 59 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 60 blob_protocol_handler, | |
| 61 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 62 file_system_protocol_handler, | |
| 63 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
| 64 developer_protocol_handler); | |
| 65 | |
| 49 private: | 66 private: |
| 50 // Performs initialization of the ShellBrowserContext while IO is still | 67 // Performs initialization of the ShellBrowserContext while IO is still |
| 51 // allowed on the current thread. | 68 // allowed on the current thread. |
| 52 void InitWhileIOAllowed(); | 69 void InitWhileIOAllowed(); |
| 53 | 70 |
| 54 bool off_the_record_; | 71 bool off_the_record_; |
| 55 bool ignore_certificate_errors_; | 72 bool ignore_certificate_errors_; |
| 56 FilePath path_; | 73 FilePath path_; |
| 57 scoped_ptr<ResourceContext> resource_context_; | 74 scoped_ptr<ShellResourceContext> resource_context_; |
| 58 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_; | 75 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_; |
| 59 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; | 76 scoped_refptr<ShellURLRequestContextGetter> url_request_getter_; |
| 60 | 77 |
| 61 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); | 78 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); |
| 62 }; | 79 }; |
| 63 | 80 |
| 64 } // namespace content | 81 } // namespace content |
| 65 | 82 |
| 66 #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ | 83 #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ |
| OLD | NEW |