Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2273)

Unified Diff: content/browser/storage_partition_impl.h

Issue 10909182: Make FileSystemContext respect StoragePartitions. filesystem:// urls will be properly isolated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch unittest fix from michael Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/storage_partition_impl.h
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h
index 9ab7fc3bffc6099d8519042f72e2a2f7e09d2c8c..c4f0bfb1d8fc52e362872137ab839b10292d8e99 100644
--- a/content/browser/storage_partition_impl.h
+++ b/content/browser/storage_partition_impl.h
@@ -21,10 +21,14 @@ class StoragePartitionImpl : public StoragePartition {
// TODO(ajwong): Break the direct dependency on |context|. We only
// need 3 pieces of info from it.
- static StoragePartitionImpl* Create(BrowserContext* context,
- const FilePath& partition_path);
+ static StoragePartitionImpl* Create(
+ BrowserContext* context,
+ const FilePath& partition_path);
// StoragePartition interface.
+ virtual FilePath GetPath() OVERRIDE;
+ virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE;
+ virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE;
virtual quota::QuotaManager* GetQuotaManager() OVERRIDE;
virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE;
virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE;
@@ -33,15 +37,35 @@ class StoragePartitionImpl : public StoragePartition {
virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE;
private:
- StoragePartitionImpl(const FilePath& partition_path,
- quota::QuotaManager* quota_manager,
- ChromeAppCacheService* appcache_service,
- fileapi::FileSystemContext* filesystem_context,
- webkit_database::DatabaseTracker* database_tracker,
- DOMStorageContextImpl* dom_storage_context,
- IndexedDBContextImpl* indexed_db_context);
+ friend class StoragePartitionImplMap;
+
+ StoragePartitionImpl(
+ const FilePath& partition_path,
+ quota::QuotaManager* quota_manager,
+ ChromeAppCacheService* appcache_service,
+ fileapi::FileSystemContext* filesystem_context,
+ webkit_database::DatabaseTracker* database_tracker,
+ DOMStorageContextImpl* dom_storage_context,
+ IndexedDBContextImpl* indexed_db_context);
+
+ // Used by StoragePartitionImplMap.
+ //
+ // TODO(ajwong): These should be taken in the constructor and in Create() but
+ // because the URLRequestContextGetter still lives in Profile with a tangle
+ // initialization, if we call try to retrieve the URLRequestContextGetter()
+ // before the default StoragePartition is created, we end up reentering the
+ // construction and double-initializing. For now, we retain the legacy
+ // behavior while allowing StoragePartitionImpl to expose these accessors by
+ // letting StoragePartitionImplMap call these two private settings at the
+ // appropriate time. These should move back into the constructor once
+ // URLRequestContextGetter's lifetime is sorted out.
+ void SetURLRequestContext(net::URLRequestContextGetter* url_request_context);
+ void SetMediaURLRequestContext(
+ net::URLRequestContextGetter* media_url_request_context);
FilePath partition_path_;
+ scoped_refptr<net::URLRequestContextGetter> url_request_context_;
+ scoped_refptr<net::URLRequestContextGetter> media_url_request_context_;
scoped_refptr<quota::QuotaManager> quota_manager_;
scoped_refptr<ChromeAppCacheService> appcache_service_;
scoped_refptr<fileapi::FileSystemContext> filesystem_context_;

Powered by Google App Engine
This is Rietveld 408576698