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/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Returns the path of the directory where this context's data is stored. | 82 // Returns the path of the directory where this context's data is stored. |
83 virtual FilePath GetPath() = 0; | 83 virtual FilePath GetPath() = 0; |
84 | 84 |
85 // Return whether this context is incognito. Default is false. | 85 // Return whether this context is incognito. Default is false. |
86 // This doesn't belong here; http://crbug.com/89628 | 86 // This doesn't belong here; http://crbug.com/89628 |
87 virtual bool IsOffTheRecord() const = 0; | 87 virtual bool IsOffTheRecord() const = 0; |
88 | 88 |
89 // Returns the request context information associated with this context. Call | 89 // Returns the request context information associated with this context. Call |
90 // this only on the UI thread, since it can send notifications that should | 90 // this only on the UI thread, since it can send notifications that should |
91 // happen on the UI thread. | 91 // happen on the UI thread. |
| 92 // TODO(creis): Remove this version in favor of the one below. |
92 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 93 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
93 | 94 |
94 // Returns the request context appropriate for the given renderer. If the | 95 // Returns the request context appropriate for the given renderer. If the |
95 // renderer process doesn't have an associated installed app, or if the | 96 // renderer process doesn't have an associated installed app, or if the |
96 // installed app's is_storage_isolated() returns false, this is equivalent to | 97 // installed app's is_storage_isolated() returns false, this is equivalent to |
97 // calling GetRequestContext(). | 98 // calling GetRequestContext(). |
98 // TODO(creis): After isolated app storage is no longer an experimental | |
99 // feature, consider making this the default contract for GetRequestContext. | |
100 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 99 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
101 int renderer_child_id) = 0; | 100 int renderer_child_id) = 0; |
102 | 101 |
| 102 // Returns the default request context for media resources associated with |
| 103 // this context. |
| 104 // TODO(creis): Remove this version in favor of the one below. |
| 105 virtual net::URLRequestContextGetter* GetDefaultRequestContextForMedia() = 0; |
| 106 |
103 // Returns the request context for media resources associated with this | 107 // Returns the request context for media resources associated with this |
104 // context. | 108 // context and renderer process. |
105 virtual net::URLRequestContextGetter* GetRequestContextForMedia() = 0; | 109 virtual net::URLRequestContextGetter* GetRequestContextForMedia( |
| 110 int renderer_child_id) = 0; |
106 | 111 |
107 // Returns the resource context. | 112 // Returns the resource context. |
108 virtual ResourceContext* GetResourceContext() = 0; | 113 virtual ResourceContext* GetResourceContext() = 0; |
109 | 114 |
110 // Returns the DownloadManagerDelegate for this context. This will be called | 115 // Returns the DownloadManagerDelegate for this context. This will be called |
111 // once per context. The embedder owns the delegate and is responsible for | 116 // once per context. The embedder owns the delegate and is responsible for |
112 // ensuring that it outlives DownloadManager. It's valid to return NULL. | 117 // ensuring that it outlives DownloadManager. It's valid to return NULL. |
113 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; | 118 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; |
114 | 119 |
115 // Returns the geolocation permission context for this context. It's valid to | 120 // Returns the geolocation permission context for this context. It's valid to |
(...skipping 22 matching lines...) Expand all Loading... |
138 struct hash<content::BrowserContext*> { | 143 struct hash<content::BrowserContext*> { |
139 std::size_t operator()(content::BrowserContext* const& p) const { | 144 std::size_t operator()(content::BrowserContext* const& p) const { |
140 return reinterpret_cast<std::size_t>(p); | 145 return reinterpret_cast<std::size_t>(p); |
141 } | 146 } |
142 }; | 147 }; |
143 | 148 |
144 } // namespace BASE_HASH_NAMESPACE | 149 } // namespace BASE_HASH_NAMESPACE |
145 #endif | 150 #endif |
146 | 151 |
147 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 152 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |