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

Side by Side Diff: content/browser/storage_partition_impl.h

Issue 12213066: Use base namespace for FilePath in content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_BROWSER_STORAGE_PARTITION_IMPL_H_ 5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_
6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ 6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "content/browser/appcache/chrome_appcache_service.h" 11 #include "content/browser/appcache/chrome_appcache_service.h"
12 #include "content/browser/dom_storage/dom_storage_context_impl.h" 12 #include "content/browser/dom_storage/dom_storage_context_impl.h"
13 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" 13 #include "content/browser/in_process_webkit/indexed_db_context_impl.h"
14 #include "content/public/browser/storage_partition.h" 14 #include "content/public/browser/storage_partition.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 class StoragePartitionImpl : public StoragePartition { 18 class StoragePartitionImpl : public StoragePartition {
19 public: 19 public:
20 virtual ~StoragePartitionImpl(); 20 virtual ~StoragePartitionImpl();
21 21
22 // StoragePartition interface. 22 // StoragePartition interface.
23 virtual FilePath GetPath() OVERRIDE; 23 virtual base::FilePath GetPath() OVERRIDE;
24 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; 24 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE;
25 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE; 25 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE;
26 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; 26 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE;
27 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; 27 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE;
28 virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE; 28 virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE;
29 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; 29 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE;
30 virtual DOMStorageContextImpl* GetDOMStorageContext() OVERRIDE; 30 virtual DOMStorageContextImpl* GetDOMStorageContext() OVERRIDE;
31 virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE; 31 virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE;
32 virtual void AsyncClearDataForOrigin( 32 virtual void AsyncClearDataForOrigin(
33 const GURL& storage_origin, 33 const GURL& storage_origin,
34 net::URLRequestContextGetter* request_context_getter) OVERRIDE; 34 net::URLRequestContextGetter* request_context_getter) OVERRIDE;
35 virtual void AsyncClearAllData() OVERRIDE; 35 virtual void AsyncClearAllData() OVERRIDE;
36 36
37 private: 37 private:
38 friend class StoragePartitionImplMap; 38 friend class StoragePartitionImplMap;
39 39
40 // The |partition_path| is the absolute path to the root of this 40 // The |partition_path| is the absolute path to the root of this
41 // StoragePartition's on-disk storage. 41 // StoragePartition's on-disk storage.
42 // 42 //
43 // If |in_memory| is true, the |partition_path| is (ab)used as a way of 43 // If |in_memory| is true, the |partition_path| is (ab)used as a way of
44 // distinguishing different in-memory partitions, but nothing is persisted 44 // distinguishing different in-memory partitions, but nothing is persisted
45 // on to disk. 45 // on to disk.
46 static StoragePartitionImpl* Create(BrowserContext* context, 46 static StoragePartitionImpl* Create(BrowserContext* context,
47 bool in_memory, 47 bool in_memory,
48 const FilePath& profile_path); 48 const base::FilePath& profile_path);
49 49
50 StoragePartitionImpl( 50 StoragePartitionImpl(
51 const FilePath& partition_path, 51 const base::FilePath& partition_path,
52 quota::QuotaManager* quota_manager, 52 quota::QuotaManager* quota_manager,
53 ChromeAppCacheService* appcache_service, 53 ChromeAppCacheService* appcache_service,
54 fileapi::FileSystemContext* filesystem_context, 54 fileapi::FileSystemContext* filesystem_context,
55 webkit_database::DatabaseTracker* database_tracker, 55 webkit_database::DatabaseTracker* database_tracker,
56 DOMStorageContextImpl* dom_storage_context, 56 DOMStorageContextImpl* dom_storage_context,
57 IndexedDBContextImpl* indexed_db_context); 57 IndexedDBContextImpl* indexed_db_context);
58 58
59 // Used by StoragePartitionImplMap. 59 // Used by StoragePartitionImplMap.
60 // 60 //
61 // TODO(ajwong): These should be taken in the constructor and in Create() but 61 // TODO(ajwong): These should be taken in the constructor and in Create() but
62 // because the URLRequestContextGetter still lives in Profile with a tangled 62 // because the URLRequestContextGetter still lives in Profile with a tangled
63 // initialization, if we try to retrieve the URLRequestContextGetter() 63 // initialization, if we try to retrieve the URLRequestContextGetter()
64 // before the default StoragePartition is created, we end up reentering the 64 // before the default StoragePartition is created, we end up reentering the
65 // construction and double-initializing. For now, we retain the legacy 65 // construction and double-initializing. For now, we retain the legacy
66 // behavior while allowing StoragePartitionImpl to expose these accessors by 66 // behavior while allowing StoragePartitionImpl to expose these accessors by
67 // letting StoragePartitionImplMap call these two private settings at the 67 // letting StoragePartitionImplMap call these two private settings at the
68 // appropriate time. These should move back into the constructor once 68 // appropriate time. These should move back into the constructor once
69 // URLRequestContextGetter's lifetime is sorted out. We should also move the 69 // URLRequestContextGetter's lifetime is sorted out. We should also move the
70 // PostCreateInitialization() out of StoragePartitionImplMap. 70 // PostCreateInitialization() out of StoragePartitionImplMap.
71 void SetURLRequestContext(net::URLRequestContextGetter* url_request_context); 71 void SetURLRequestContext(net::URLRequestContextGetter* url_request_context);
72 void SetMediaURLRequestContext( 72 void SetMediaURLRequestContext(
73 net::URLRequestContextGetter* media_url_request_context); 73 net::URLRequestContextGetter* media_url_request_context);
74 74
75 FilePath partition_path_; 75 base::FilePath partition_path_;
76 scoped_refptr<net::URLRequestContextGetter> url_request_context_; 76 scoped_refptr<net::URLRequestContextGetter> url_request_context_;
77 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; 77 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_;
78 scoped_refptr<quota::QuotaManager> quota_manager_; 78 scoped_refptr<quota::QuotaManager> quota_manager_;
79 scoped_refptr<ChromeAppCacheService> appcache_service_; 79 scoped_refptr<ChromeAppCacheService> appcache_service_;
80 scoped_refptr<fileapi::FileSystemContext> filesystem_context_; 80 scoped_refptr<fileapi::FileSystemContext> filesystem_context_;
81 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; 81 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_;
82 scoped_refptr<DOMStorageContextImpl> dom_storage_context_; 82 scoped_refptr<DOMStorageContextImpl> dom_storage_context_;
83 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; 83 scoped_refptr<IndexedDBContextImpl> indexed_db_context_;
84 84
85 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); 85 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl);
86 }; 86 };
87 87
88 } // namespace content 88 } // namespace content
89 89
90 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ 90 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/browser/storage_partition_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698