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/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
13 namespace appcache { | |
14 class AppCacheService; | |
15 } | |
16 | |
17 namespace fileapi { | 13 namespace fileapi { |
18 class FileSystemContext; | 14 class FileSystemContext; |
19 } | 15 } |
20 | 16 |
21 namespace net { | 17 namespace net { |
22 class URLRequestContextGetter; | 18 class URLRequestContextGetter; |
23 } | 19 } |
24 | 20 |
25 namespace quota { | 21 namespace quota { |
26 class SpecialStoragePolicy; | 22 class SpecialStoragePolicy; |
27 } | 23 } |
28 | 24 |
29 namespace webkit_database { | |
30 class DatabaseTracker; | |
31 } | |
32 | |
33 class FilePath; | 25 class FilePath; |
34 | 26 |
35 namespace content { | 27 namespace content { |
36 | 28 |
37 class DOMStorageContext; | |
38 class DownloadManager; | 29 class DownloadManager; |
39 class DownloadManagerDelegate; | 30 class DownloadManagerDelegate; |
40 class GeolocationPermissionContext; | 31 class GeolocationPermissionContext; |
41 class IndexedDBContext; | 32 class IndexedDBContext; |
42 class ResourceContext; | 33 class ResourceContext; |
43 class SiteInstance; | 34 class SiteInstance; |
44 class SpeechRecognitionPreferences; | 35 class SpeechRecognitionPreferences; |
45 class StoragePartition; | 36 class StoragePartition; |
46 | 37 |
47 // This class holds the context needed for a browsing session. | 38 // This class holds the context needed for a browsing session. |
48 // It lives on the UI thread. All these methods must only be called on the UI | 39 // It lives on the UI thread. All these methods must only be called on the UI |
49 // thread. | 40 // thread. |
50 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { | 41 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
51 public: | 42 public: |
52 // Used in ForEachStoragePartition(). The first argument is the partition id. | 43 // Used in ForEachStoragePartition(). The first argument is the partition id. |
53 // The second argument is the StoragePartition object for that partition id. | 44 // The second argument is the StoragePartition object for that partition id. |
54 typedef base::Callback<void(const std::string&, StoragePartition*)> | 45 typedef base::Callback<void(const std::string&, StoragePartition*)> |
55 StoragePartitionCallback; | 46 StoragePartitionCallback; |
56 | 47 |
57 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); | 48 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); |
58 static IndexedDBContext* GetIndexedDBContext(BrowserContext* browser_context); | 49 static IndexedDBContext* GetIndexedDBContext(BrowserContext* browser_context); |
59 static appcache::AppCacheService* GetAppCacheService( | |
60 BrowserContext* browser_context); | |
61 static fileapi::FileSystemContext* GetFileSystemContext( | 50 static fileapi::FileSystemContext* GetFileSystemContext( |
62 BrowserContext* browser_context); | 51 BrowserContext* browser_context); |
63 | 52 |
64 static content::StoragePartition* GetStoragePartition( | 53 static content::StoragePartition* GetStoragePartition( |
65 BrowserContext* browser_context, SiteInstance* site_instance); | 54 BrowserContext* browser_context, SiteInstance* site_instance); |
66 static void ForEachStoragePartition( | 55 static void ForEachStoragePartition( |
67 BrowserContext* browser_context, | 56 BrowserContext* browser_context, |
68 const StoragePartitionCallback& callback); | 57 const StoragePartitionCallback& callback); |
69 | 58 |
70 // DON'T USE THIS. GetDefaultStoragePartition() is going away. | 59 // DON'T USE THIS. GetDefaultStoragePartition() is going away. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 struct hash<content::BrowserContext*> { | 141 struct hash<content::BrowserContext*> { |
153 std::size_t operator()(content::BrowserContext* const& p) const { | 142 std::size_t operator()(content::BrowserContext* const& p) const { |
154 return reinterpret_cast<std::size_t>(p); | 143 return reinterpret_cast<std::size_t>(p); |
155 } | 144 } |
156 }; | 145 }; |
157 | 146 |
158 } // namespace BASE_HASH_NAMESPACE | 147 } // namespace BASE_HASH_NAMESPACE |
159 #endif | 148 #endif |
160 | 149 |
161 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 150 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |