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/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 class BlobHandle; | 34 class BlobHandle; |
35 class BrowserPluginGuestManager; | 35 class BrowserPluginGuestManager; |
36 class DownloadManager; | 36 class DownloadManager; |
37 class DownloadManagerDelegate; | 37 class DownloadManagerDelegate; |
38 class GeolocationPermissionContext; | 38 class GeolocationPermissionContext; |
39 class IndexedDBContext; | 39 class IndexedDBContext; |
| 40 class PushMessagingService; |
40 class ResourceContext; | 41 class ResourceContext; |
41 class SiteInstance; | 42 class SiteInstance; |
42 class StoragePartition; | 43 class StoragePartition; |
43 | 44 |
44 // This class holds the context needed for a browsing session. | 45 // This class holds the context needed for a browsing session. |
45 // It lives on the UI thread. All these methods must only be called on the UI | 46 // It lives on the UI thread. All these methods must only be called on the UI |
46 // thread. | 47 // thread. |
47 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { | 48 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
48 public: | 49 public: |
49 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); | 50 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 177 |
177 // Returns the geolocation permission context for this context. It's valid to | 178 // Returns the geolocation permission context for this context. It's valid to |
178 // return NULL, in which case geolocation requests will always be allowed. | 179 // return NULL, in which case geolocation requests will always be allowed. |
179 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() = 0; | 180 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() = 0; |
180 | 181 |
181 // Returns the guest manager for this context. | 182 // Returns the guest manager for this context. |
182 virtual BrowserPluginGuestManager* GetGuestManager() = 0; | 183 virtual BrowserPluginGuestManager* GetGuestManager() = 0; |
183 | 184 |
184 // Returns a special storage policy implementation, or NULL. | 185 // Returns a special storage policy implementation, or NULL. |
185 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() = 0; | 186 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() = 0; |
| 187 |
| 188 // Returns a push messaging service. The embedder owns the service, and is |
| 189 // responsible for ensuring that it outlives RenderProcessHost. It's valid to |
| 190 // return NULL. |
| 191 virtual PushMessagingService* GetPushMessagingService() = 0; |
186 }; | 192 }; |
187 | 193 |
188 } // namespace content | 194 } // namespace content |
189 | 195 |
190 #if defined(COMPILER_GCC) | 196 #if defined(COMPILER_GCC) |
191 namespace BASE_HASH_NAMESPACE { | 197 namespace BASE_HASH_NAMESPACE { |
192 | 198 |
193 template<> | 199 template<> |
194 struct hash<content::BrowserContext*> { | 200 struct hash<content::BrowserContext*> { |
195 std::size_t operator()(content::BrowserContext* const& p) const { | 201 std::size_t operator()(content::BrowserContext* const& p) const { |
196 return reinterpret_cast<std::size_t>(p); | 202 return reinterpret_cast<std::size_t>(p); |
197 } | 203 } |
198 }; | 204 }; |
199 | 205 |
200 } // namespace BASE_HASH_NAMESPACE | 206 } // namespace BASE_HASH_NAMESPACE |
201 #endif | 207 #endif |
202 | 208 |
203 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 209 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |