summaryrefslogtreecommitdiffstats
path: root/content/public/browser/browser_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/public/browser/browser_context.h')
-rw-r--r--content/public/browser/browser_context.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h
index cfe4d53..2acf400 100644
--- a/content/public/browser/browser_context.h
+++ b/content/public/browser/browser_context.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
#define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
+#include "base/callback_forward.h"
#include "base/hash_tables.h"
#include "base/supports_user_data.h"
#include "content/common/content_export.h"
@@ -40,21 +41,22 @@ class DownloadManagerDelegate;
class GeolocationPermissionContext;
class IndexedDBContext;
class ResourceContext;
+class SiteInstance;
class SpeechRecognitionPreferences;
+class StoragePartition;
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
public:
+ // Used in ForEachStoragePartition(). The first argument is the partition id.
+ // The second argument is the StoragePartition object for that partition id.
+ typedef base::Callback<void(const std::string&, StoragePartition*)>
+ StoragePartitionCallback;
+
static DownloadManager* GetDownloadManager(BrowserContext* browser_context);
static quota::QuotaManager* GetQuotaManager(BrowserContext* browser_context);
- static DOMStorageContext* GetDefaultDOMStorageContext(
- BrowserContext* browser_context);
- static DOMStorageContext* GetDOMStorageContext(
- BrowserContext* browser_context, int renderer_child_id);
- static content::DOMStorageContext* GetDOMStorageContextByPartitionId(
- BrowserContext* browser_context, const std::string& partition_id);
static IndexedDBContext* GetIndexedDBContext(BrowserContext* browser_context);
static webkit_database::DatabaseTracker* GetDatabaseTracker(
BrowserContext* browser_context);
@@ -63,6 +65,17 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
static fileapi::FileSystemContext* GetFileSystemContext(
BrowserContext* browser_context);
+ static content::StoragePartition* GetStoragePartition(
+ BrowserContext* browser_context, SiteInstance* site_instance);
+ static void ForEachStoragePartition(
+ BrowserContext* browser_context,
+ const StoragePartitionCallback& callback);
+
+ // DON'T USE THIS. GetDefaultStoragePartition() is going away.
+ // Use GetStoragePartition() instead. Ask ajwong@ if you have problems.
+ static content::StoragePartition* GetDefaultStoragePartition(
+ BrowserContext* browser_context);
+
// Ensures that the corresponding ResourceContext is initialized. Normally the
// BrowserContext initializs the corresponding getters when its objects are
// created, but if the embedder wants to pass the ResourceContext to another