| 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_STORAGE_PARTITION_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ | 6 #define CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 | 12 |
| 13 namespace appcache { | 13 namespace appcache { |
| 14 class AppCacheService; | 14 class AppCacheService; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace fileapi { | 17 namespace fileapi { |
| 18 class FileSystemContext; | 18 class FileSystemContext; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace net { |
| 22 class URLRequestContextGetter; |
| 23 } |
| 24 |
| 21 namespace quota { | 25 namespace quota { |
| 22 class QuotaManager; | 26 class QuotaManager; |
| 23 } | 27 } |
| 24 | 28 |
| 25 namespace webkit_database { | 29 namespace webkit_database { |
| 26 class DatabaseTracker; | 30 class DatabaseTracker; |
| 27 } | 31 } |
| 28 | 32 |
| 29 namespace content { | 33 namespace content { |
| 30 | 34 |
| 31 class BrowserContext; | 35 class BrowserContext; |
| 32 class IndexedDBContext; | 36 class IndexedDBContext; |
| 33 class DOMStorageContext; | 37 class DOMStorageContext; |
| 34 | 38 |
| 35 // Defines what persistent state a child process can access. | 39 // Defines what persistent state a child process can access. |
| 36 // | 40 // |
| 37 // The StoragePartition defines the view each child process has of the | 41 // The StoragePartition defines the view each child process has of the |
| 38 // persistent state inside the BrowserContext. This is used to implement | 42 // persistent state inside the BrowserContext. This is used to implement |
| 39 // isolated storage where a renderer with isolated storage cannot see | 43 // isolated storage where a renderer with isolated storage cannot see |
| 40 // the cookies, localStorage, etc., that normal web renderers have access to. | 44 // the cookies, localStorage, etc., that normal web renderers have access to. |
| 41 class StoragePartition { | 45 class StoragePartition { |
| 42 public: | 46 public: |
| 43 virtual FilePath GetPath() = 0; | 47 virtual FilePath GetPath() = 0; |
| 48 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; |
| 49 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() = 0; |
| 44 virtual quota::QuotaManager* GetQuotaManager() = 0; | 50 virtual quota::QuotaManager* GetQuotaManager() = 0; |
| 45 virtual appcache::AppCacheService* GetAppCacheService() = 0; | 51 virtual appcache::AppCacheService* GetAppCacheService() = 0; |
| 46 virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; | 52 virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; |
| 47 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; | 53 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; |
| 48 virtual DOMStorageContext* GetDOMStorageContext() = 0; | 54 virtual DOMStorageContext* GetDOMStorageContext() = 0; |
| 49 virtual IndexedDBContext* GetIndexedDBContext() = 0; | 55 virtual IndexedDBContext* GetIndexedDBContext() = 0; |
| 50 | 56 |
| 51 // Returns the relative path from the profile's base directory, to the | 57 // Returns the relative path from the profile's base directory, to the |
| 52 // directory that holds all the state for storage contexts in |partition_id|. | 58 // directory that holds all the state for storage contexts in |partition_id|. |
| 53 // | 59 // |
| 54 // TODO(ajwong): Remove this function from the public API once | 60 // TODO(ajwong): Remove this function from the public API once |
| 55 // URLRequestContextGetter's creation is moved into StoragePartition. | 61 // URLRequestContextGetter's creation is moved into StoragePartition. |
| 56 static CONTENT_EXPORT FilePath GetPartitionPath( | 62 static CONTENT_EXPORT FilePath GetPartitionPath( |
| 57 const std::string& partition_id); | 63 const std::string& partition_id); |
| 58 | 64 |
| 59 protected: | 65 protected: |
| 60 virtual ~StoragePartition() {} | 66 virtual ~StoragePartition() {} |
| 61 }; | 67 }; |
| 62 | 68 |
| 63 } // namespace content | 69 } // namespace content |
| 64 | 70 |
| 65 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ | 71 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
| OLD | NEW |