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" |
(...skipping 21 matching lines...) Expand all Loading... |
32 class SpeechRecognitionPreferences; | 32 class SpeechRecognitionPreferences; |
33 class StoragePartition; | 33 class StoragePartition; |
34 | 34 |
35 // This class holds the context needed for a browsing session. | 35 // This class holds the context needed for a browsing session. |
36 // It lives on the UI thread. All these methods must only be called on the UI | 36 // It lives on the UI thread. All these methods must only be called on the UI |
37 // thread. | 37 // thread. |
38 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { | 38 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
39 public: | 39 public: |
40 // Used in ForEachStoragePartition(). The first argument is the partition id. | 40 // Used in ForEachStoragePartition(). The first argument is the partition id. |
41 // The second argument is the StoragePartition object for that partition id. | 41 // The second argument is the StoragePartition object for that partition id. |
42 typedef base::Callback<void(const std::string&, StoragePartition*)> | 42 typedef base::Callback<void(StoragePartition*)> StoragePartitionCallback; |
43 StoragePartitionCallback; | |
44 | 43 |
45 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); | 44 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); |
46 | 45 |
47 static content::StoragePartition* GetStoragePartition( | 46 static content::StoragePartition* GetStoragePartition( |
48 BrowserContext* browser_context, SiteInstance* site_instance); | 47 BrowserContext* browser_context, SiteInstance* site_instance); |
49 static content::StoragePartition* GetStoragePartitionForSite( | 48 static content::StoragePartition* GetStoragePartitionForSite( |
50 BrowserContext* browser_context, const GURL& site); | 49 BrowserContext* browser_context, const GURL& site); |
51 static void ForEachStoragePartition( | 50 static void ForEachStoragePartition( |
52 BrowserContext* browser_context, | 51 BrowserContext* browser_context, |
53 const StoragePartitionCallback& callback); | 52 const StoragePartitionCallback& callback); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 struct hash<content::BrowserContext*> { | 140 struct hash<content::BrowserContext*> { |
142 std::size_t operator()(content::BrowserContext* const& p) const { | 141 std::size_t operator()(content::BrowserContext* const& p) const { |
143 return reinterpret_cast<std::size_t>(p); | 142 return reinterpret_cast<std::size_t>(p); |
144 } | 143 } |
145 }; | 144 }; |
146 | 145 |
147 } // namespace BASE_HASH_NAMESPACE | 146 } // namespace BASE_HASH_NAMESPACE |
148 #endif | 147 #endif |
149 | 148 |
150 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 149 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |