| 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 17 matching lines...) Expand all Loading... |
| 28 namespace quota { | 28 namespace quota { |
| 29 class SpecialStoragePolicy; | 29 class SpecialStoragePolicy; |
| 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; | |
| 39 class IndexedDBContext; | 38 class IndexedDBContext; |
| 40 class PushMessagingService; | 39 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 { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 const GURL& origin) = 0; | 167 const GURL& origin) = 0; |
| 169 | 168 |
| 170 // Returns the resource context. | 169 // Returns the resource context. |
| 171 virtual ResourceContext* GetResourceContext() = 0; | 170 virtual ResourceContext* GetResourceContext() = 0; |
| 172 | 171 |
| 173 // Returns the DownloadManagerDelegate for this context. This will be called | 172 // Returns the DownloadManagerDelegate for this context. This will be called |
| 174 // once per context. The embedder owns the delegate and is responsible for | 173 // once per context. The embedder owns the delegate and is responsible for |
| 175 // ensuring that it outlives DownloadManager. It's valid to return NULL. | 174 // ensuring that it outlives DownloadManager. It's valid to return NULL. |
| 176 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; | 175 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; |
| 177 | 176 |
| 178 // Returns the geolocation permission context for this context. It's valid to | |
| 179 // return NULL, in which case geolocation requests will always be allowed. | |
| 180 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() = 0; | |
| 181 | |
| 182 // Returns the guest manager for this context. | 177 // Returns the guest manager for this context. |
| 183 virtual BrowserPluginGuestManager* GetGuestManager() = 0; | 178 virtual BrowserPluginGuestManager* GetGuestManager() = 0; |
| 184 | 179 |
| 185 // Returns a special storage policy implementation, or NULL. | 180 // Returns a special storage policy implementation, or NULL. |
| 186 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() = 0; | 181 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() = 0; |
| 187 | 182 |
| 188 // Returns a push messaging service. The embedder owns the service, and is | 183 // Returns a push messaging service. The embedder owns the service, and is |
| 189 // responsible for ensuring that it outlives RenderProcessHost. It's valid to | 184 // responsible for ensuring that it outlives RenderProcessHost. It's valid to |
| 190 // return NULL. | 185 // return NULL. |
| 191 virtual PushMessagingService* GetPushMessagingService() = 0; | 186 virtual PushMessagingService* GetPushMessagingService() = 0; |
| 192 }; | 187 }; |
| 193 | 188 |
| 194 } // namespace content | 189 } // namespace content |
| 195 | 190 |
| 196 #if defined(COMPILER_GCC) | 191 #if defined(COMPILER_GCC) |
| 197 namespace BASE_HASH_NAMESPACE { | 192 namespace BASE_HASH_NAMESPACE { |
| 198 | 193 |
| 199 template<> | 194 template<> |
| 200 struct hash<content::BrowserContext*> { | 195 struct hash<content::BrowserContext*> { |
| 201 std::size_t operator()(content::BrowserContext* const& p) const { | 196 std::size_t operator()(content::BrowserContext* const& p) const { |
| 202 return reinterpret_cast<std::size_t>(p); | 197 return reinterpret_cast<std::size_t>(p); |
| 203 } | 198 } |
| 204 }; | 199 }; |
| 205 | 200 |
| 206 } // namespace BASE_HASH_NAMESPACE | 201 } // namespace BASE_HASH_NAMESPACE |
| 207 #endif | 202 #endif |
| 208 | 203 |
| 209 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 204 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |