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_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // GetStoragePaths returns all paths owned by this database, in arbitrary | 94 // GetStoragePaths returns all paths owned by this database, in arbitrary |
95 // order. | 95 // order. |
96 std::vector<base::FilePath> GetStoragePaths(const GURL& origin_url) const; | 96 std::vector<base::FilePath> GetStoragePaths(const GURL& origin_url) const; |
97 | 97 |
98 base::FilePath data_path() const { return data_path_; } | 98 base::FilePath data_path() const { return data_path_; } |
99 bool IsInOriginSet(const GURL& origin_url) { | 99 bool IsInOriginSet(const GURL& origin_url) { |
100 std::set<GURL>* set = GetOriginSet(); | 100 std::set<GURL>* set = GetOriginSet(); |
101 return set->find(origin_url) != set->end(); | 101 return set->find(origin_url) != set->end(); |
102 } | 102 } |
103 size_t GetConnectionCount(const GURL& origin_url); | 103 size_t GetConnectionCount(const GURL& origin_url); |
| 104 int GetOriginBlobFileCount(const GURL& origin_url); |
104 | 105 |
105 // For unit tests allow to override the |data_path_|. | 106 // For unit tests allow to override the |data_path_|. |
106 void set_data_path_for_testing(const base::FilePath& data_path) { | 107 void set_data_path_for_testing(const base::FilePath& data_path) { |
107 data_path_ = data_path; | 108 data_path_ = data_path; |
108 } | 109 } |
109 | 110 |
110 bool is_incognito() const { return data_path_.empty(); } | 111 bool is_incognito() const { return data_path_.empty(); } |
111 | 112 |
112 protected: | 113 protected: |
113 ~IndexedDBContextImpl() override; | 114 ~IndexedDBContextImpl() override; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 scoped_ptr<std::set<GURL> > origin_set_; | 157 scoped_ptr<std::set<GURL> > origin_set_; |
157 OriginToSizeMap origin_size_map_; | 158 OriginToSizeMap origin_size_map_; |
158 OriginToSizeMap space_available_map_; | 159 OriginToSizeMap space_available_map_; |
159 | 160 |
160 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); | 161 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); |
161 }; | 162 }; |
162 | 163 |
163 } // namespace content | 164 } // namespace content |
164 | 165 |
165 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 166 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
OLD | NEW |