OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ |
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class CONTENT_EXPORT IndexedDBContextImpl | 36 class CONTENT_EXPORT IndexedDBContextImpl |
37 : NON_EXPORTED_BASE(public content::IndexedDBContext) { | 37 : NON_EXPORTED_BASE(public content::IndexedDBContext) { |
38 public: | 38 public: |
39 // If |data_path| is empty, nothing will be saved to disk. | 39 // If |data_path| is empty, nothing will be saved to disk. |
40 IndexedDBContextImpl(const FilePath& data_path, | 40 IndexedDBContextImpl(const FilePath& data_path, |
41 quota::SpecialStoragePolicy* special_storage_policy, | 41 quota::SpecialStoragePolicy* special_storage_policy, |
42 quota::QuotaManagerProxy* quota_manager_proxy, | 42 quota::QuotaManagerProxy* quota_manager_proxy, |
43 base::MessageLoopProxy* webkit_thread_loop); | 43 base::MessageLoopProxy* webkit_thread_loop); |
44 | 44 |
45 virtual ~IndexedDBContextImpl(); | |
46 | |
47 WebKit::WebIDBFactory* GetIDBFactory(); | 45 WebKit::WebIDBFactory* GetIDBFactory(); |
48 | 46 |
49 // The indexed db directory. | 47 // The indexed db directory. |
50 static const FilePath::CharType kIndexedDBDirectory[]; | 48 static const FilePath::CharType kIndexedDBDirectory[]; |
51 | 49 |
52 // The indexed db file extension. | 50 // The indexed db file extension. |
53 static const FilePath::CharType kIndexedDBExtension[]; | 51 static const FilePath::CharType kIndexedDBExtension[]; |
54 | 52 |
55 void set_clear_local_state_on_exit(bool clear_local_state) { | 53 void set_clear_local_state_on_exit(bool clear_local_state) { |
56 clear_local_state_on_exit_ = clear_local_state; | 54 clear_local_state_on_exit_ = clear_local_state; |
(...skipping 21 matching lines...) Expand all Loading... |
78 | 76 |
79 quota::QuotaManagerProxy* quota_manager_proxy(); | 77 quota::QuotaManagerProxy* quota_manager_proxy(); |
80 | 78 |
81 FilePath data_path() const { return data_path_; } | 79 FilePath data_path() const { return data_path_; } |
82 | 80 |
83 // For unit tests allow to override the |data_path_|. | 81 // For unit tests allow to override the |data_path_|. |
84 void set_data_path_for_testing(const FilePath& data_path) { | 82 void set_data_path_for_testing(const FilePath& data_path) { |
85 data_path_ = data_path; | 83 data_path_ = data_path; |
86 } | 84 } |
87 | 85 |
| 86 protected: |
| 87 virtual ~IndexedDBContextImpl(); |
| 88 |
88 private: | 89 private: |
89 FRIEND_TEST_ALL_PREFIXES(IndexedDBTest, ClearLocalState); | 90 FRIEND_TEST_ALL_PREFIXES(IndexedDBTest, ClearLocalState); |
90 FRIEND_TEST_ALL_PREFIXES(IndexedDBTest, ClearSessionOnlyDatabases); | 91 FRIEND_TEST_ALL_PREFIXES(IndexedDBTest, ClearSessionOnlyDatabases); |
91 FRIEND_TEST_ALL_PREFIXES(IndexedDBTest, SaveSessionState); | 92 FRIEND_TEST_ALL_PREFIXES(IndexedDBTest, SaveSessionState); |
92 friend class IndexedDBQuotaClientTest; | 93 friend class IndexedDBQuotaClientTest; |
93 | 94 |
94 typedef std::map<GURL, int64> OriginToSizeMap; | 95 typedef std::map<GURL, int64> OriginToSizeMap; |
95 class IndexedDBGetUsageAndQuotaCallback; | 96 class IndexedDBGetUsageAndQuotaCallback; |
96 | 97 |
97 FilePath GetIndexedDBFilePath(const string16& origin_id) const; | 98 FilePath GetIndexedDBFilePath(const string16& origin_id) const; |
(...skipping 29 matching lines...) Expand all Loading... |
127 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | 128 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
128 scoped_ptr<std::set<GURL> > origin_set_; | 129 scoped_ptr<std::set<GURL> > origin_set_; |
129 OriginToSizeMap origin_size_map_; | 130 OriginToSizeMap origin_size_map_; |
130 OriginToSizeMap space_available_map_; | 131 OriginToSizeMap space_available_map_; |
131 std::map<GURL, unsigned int> connection_count_; | 132 std::map<GURL, unsigned int> connection_count_; |
132 | 133 |
133 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); | 134 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); |
134 }; | 135 }; |
135 | 136 |
136 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ | 137 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ |
OLD | NEW |