summaryrefslogtreecommitdiffstats
path: root/content/browser/chrome_blob_storage_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/chrome_blob_storage_context.h')
-rw-r--r--content/browser/chrome_blob_storage_context.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/content/browser/chrome_blob_storage_context.h b/content/browser/chrome_blob_storage_context.h
index e83271c..0b5c820 100644
--- a/content/browser/chrome_blob_storage_context.h
+++ b/content/browser/chrome_blob_storage_context.h
@@ -12,10 +12,16 @@
#include "content/common/content_export.h"
#include "content/public/browser/browser_thread.h"
+namespace content {
+class BrowserContext;
+}
+
namespace webkit_blob {
class BlobStorageController;
}
+struct ChromeBlobStorageContextDeleter;
+
// A context class that keeps track of BlobStorageController used by the chrome.
// There is an instance associated with each BrowserContext. There could be
// multiple URLRequestContexts in the same browser context that refers to the
@@ -25,9 +31,13 @@ class BlobStorageController;
// the IO thread (unless specifically called out in doc comments).
class CONTENT_EXPORT ChromeBlobStorageContext
: public base::RefCountedThreadSafe<
- ChromeBlobStorageContext, content::BrowserThread::DeleteOnIOThread> {
+ ChromeBlobStorageContext, ChromeBlobStorageContextDeleter> {
public:
+ static ChromeBlobStorageContext* GetFor(
+ content::BrowserContext* browser_context);
+
ChromeBlobStorageContext();
+ virtual ~ChromeBlobStorageContext();
void InitializeOnIOThread();
@@ -36,14 +46,17 @@ class CONTENT_EXPORT ChromeBlobStorageContext
}
private:
- friend class base::RefCountedThreadSafe<
- ChromeBlobStorageContext, content::BrowserThread::DeleteOnIOThread>;
- friend class content::BrowserThread;
- friend class base::DeleteHelper<ChromeBlobStorageContext>;
+ friend struct ChromeBlobStorageContextDeleter;
- virtual ~ChromeBlobStorageContext();
+ void DeleteOnCorrectThread() const;
scoped_ptr<webkit_blob::BlobStorageController> controller_;
};
+struct ChromeBlobStorageContextDeleter {
+ static void Destruct(const ChromeBlobStorageContext* context) {
+ context->DeleteOnCorrectThread();
+ }
+};
+
#endif // CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_