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_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/supports_user_data.h" | 11 #include "base/supports_user_data.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "net/url_request/url_request_job_factory.h" | |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 class URLRequestContextGetter; | 16 class URLRequestContextGetter; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace quota { | 19 namespace quota { |
| 19 class SpecialStoragePolicy; | 20 class SpecialStoragePolicy; |
| 20 } | 21 } |
| 21 | 22 |
| 22 class FilePath; | 23 class FilePath; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 | 90 |
| 90 // Return whether this context is incognito. Default is false. | 91 // Return whether this context is incognito. Default is false. |
| 91 // This doesn't belong here; http://crbug.com/89628 | 92 // This doesn't belong here; http://crbug.com/89628 |
| 92 virtual bool IsOffTheRecord() const = 0; | 93 virtual bool IsOffTheRecord() const = 0; |
| 93 | 94 |
| 94 // Returns the request context information associated with this context. Call | 95 // Returns the request context information associated with this context. Call |
| 95 // this only on the UI thread, since it can send notifications that should | 96 // this only on the UI thread, since it can send notifications that should |
| 96 // happen on the UI thread. | 97 // happen on the UI thread. |
| 97 // TODO(creis): Remove this version in favor of the one below. | 98 // TODO(creis): Remove this version in favor of the one below. |
| 98 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 99 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
| 100 virtual net::URLRequestContextGetter* CreateRequestContext( | |
|
awong
2012/12/13 01:06:15
Can you add a commenting to the CreateXXX function
pauljensen
2012/12/13 17:58:44
Done.
| |
| 101 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 102 blob_protocol_handler, | |
| 103 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 104 file_system_protocol_handler, | |
| 105 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
| 106 developer_protocol_handler) = 0; | |
| 99 | 107 |
| 100 // Returns the request context appropriate for the given renderer. If the | 108 // Returns the request context appropriate for the given renderer. If the |
| 101 // renderer process doesn't have an associated installed app, or if the | 109 // renderer process doesn't have an associated installed app, or if the |
| 102 // installed app's is_storage_isolated() returns false, this is equivalent to | 110 // installed app's is_storage_isolated() returns false, this is equivalent to |
| 103 // calling GetRequestContext(). | 111 // calling GetRequestContext(). |
| 104 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 112 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
| 105 int renderer_child_id) = 0; | 113 int renderer_child_id) = 0; |
| 106 | 114 |
| 107 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | 115 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
|
awong
2012/12/13 01:06:15
Same comment as previoiusly.
pauljensen
2012/12/13 17:58:44
Done.
| |
| 108 const FilePath& partition_path, | 116 const FilePath& partition_path, |
| 109 bool in_memory) = 0; | 117 bool in_memory, |
| 118 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 119 blob_protocol_handler, | |
| 120 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 121 file_system_protocol_handler, | |
| 122 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
| 123 developer_protocol_handler) = 0; | |
| 110 | 124 |
| 111 // Returns the default request context for media resources associated with | 125 // Returns the default request context for media resources associated with |
| 112 // this context. | 126 // this context. |
| 113 // TODO(creis): Remove this version in favor of the one below. | 127 // TODO(creis): Remove this version in favor of the one below. |
| 114 virtual net::URLRequestContextGetter* GetMediaRequestContext() = 0; | 128 virtual net::URLRequestContextGetter* GetMediaRequestContext() = 0; |
| 115 | 129 |
| 116 // Returns the request context for media resources associated with this | 130 // Returns the request context for media resources associated with this |
| 117 // context and renderer process. | 131 // context and renderer process. |
| 118 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 132 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
| 119 int renderer_child_id) = 0; | 133 int renderer_child_id) = 0; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 struct hash<content::BrowserContext*> { | 166 struct hash<content::BrowserContext*> { |
| 153 std::size_t operator()(content::BrowserContext* const& p) const { | 167 std::size_t operator()(content::BrowserContext* const& p) const { |
| 154 return reinterpret_cast<std::size_t>(p); | 168 return reinterpret_cast<std::size_t>(p); |
| 155 } | 169 } |
| 156 }; | 170 }; |
| 157 | 171 |
| 158 } // namespace BASE_HASH_NAMESPACE | 172 } // namespace BASE_HASH_NAMESPACE |
| 159 #endif | 173 #endif |
| 160 | 174 |
| 161 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 175 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |