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