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 WEBKIT_BROWSER_DATABASE_DATABASE_TRACKER_H_ | 5 #ifndef WEBKIT_BROWSER_DATABASE_DATABASE_TRACKER_H_ |
6 #define WEBKIT_BROWSER_DATABASE_DATABASE_TRACKER_H_ | 6 #define WEBKIT_BROWSER_DATABASE_DATABASE_TRACKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/platform_file.h" | 17 #include "base/platform_file.h" |
18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
21 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
22 #include "webkit/browser/webkit_storage_browser_export.h" | 22 #include "webkit/browser/webkit_storage_browser_export.h" |
23 #include "webkit/common/database/database_connections.h" | 23 #include "webkit/common/database/database_connections.h" |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class MessageLoopProxy; | 26 class MessageLoopProxy; |
27 } | 27 } |
28 | 28 |
| 29 namespace content { |
| 30 class DatabaseTracker_TestHelper_Test; |
| 31 } |
| 32 |
29 namespace sql { | 33 namespace sql { |
30 class Connection; | 34 class Connection; |
31 class MetaTable; | 35 class MetaTable; |
32 } | 36 } |
33 | 37 |
34 namespace quota { | 38 namespace quota { |
35 class QuotaManagerProxy; | 39 class QuotaManagerProxy; |
36 class SpecialStoragePolicy; | 40 class SpecialStoragePolicy; |
37 } | 41 } |
38 | 42 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 bool HasSavedIncognitoFileHandle(const base::string16& vfs_file_path) const; | 176 bool HasSavedIncognitoFileHandle(const base::string16& vfs_file_path) const; |
173 | 177 |
174 // Shutdown the database tracker, deleting database files if the tracker is | 178 // Shutdown the database tracker, deleting database files if the tracker is |
175 // used for an incognito profile. | 179 // used for an incognito profile. |
176 void Shutdown(); | 180 void Shutdown(); |
177 // Disables the exit-time deletion of session-only data. | 181 // Disables the exit-time deletion of session-only data. |
178 void SetForceKeepSessionState(); | 182 void SetForceKeepSessionState(); |
179 | 183 |
180 private: | 184 private: |
181 friend class base::RefCountedThreadSafe<DatabaseTracker>; | 185 friend class base::RefCountedThreadSafe<DatabaseTracker>; |
182 friend class MockDatabaseTracker; // for testing | 186 friend class content::DatabaseTracker_TestHelper_Test; |
| 187 friend class MockDatabaseTracker; // for testing |
183 | 188 |
184 typedef std::map<std::string, std::set<base::string16> > DatabaseSet; | 189 typedef std::map<std::string, std::set<base::string16> > DatabaseSet; |
185 typedef std::vector<std::pair<net::CompletionCallback, DatabaseSet> > | 190 typedef std::vector<std::pair<net::CompletionCallback, DatabaseSet> > |
186 PendingDeletionCallbacks; | 191 PendingDeletionCallbacks; |
187 typedef std::map<base::string16, base::PlatformFile> FileHandlesMap; | 192 typedef std::map<base::string16, base::PlatformFile> FileHandlesMap; |
188 typedef std::map<std::string, base::string16> OriginDirectoriesMap; | 193 typedef std::map<std::string, base::string16> OriginDirectoriesMap; |
189 | 194 |
190 class CachedOriginInfo : public OriginInfo { | 195 class CachedOriginInfo : public OriginInfo { |
191 public: | 196 public: |
192 CachedOriginInfo() : OriginInfo(std::string(), 0) {} | 197 CachedOriginInfo() : OriginInfo(std::string(), 0) {} |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // this map to assign directory names that do not reveal this information. | 310 // this map to assign directory names that do not reveal this information. |
306 OriginDirectoriesMap incognito_origin_directories_; | 311 OriginDirectoriesMap incognito_origin_directories_; |
307 int incognito_origin_directories_generator_; | 312 int incognito_origin_directories_generator_; |
308 | 313 |
309 FRIEND_TEST_ALL_PREFIXES(DatabaseTracker, TestHelper); | 314 FRIEND_TEST_ALL_PREFIXES(DatabaseTracker, TestHelper); |
310 }; | 315 }; |
311 | 316 |
312 } // namespace webkit_database | 317 } // namespace webkit_database |
313 | 318 |
314 #endif // WEBKIT_BROWSER_DATABASE_DATABASE_TRACKER_H_ | 319 #endif // WEBKIT_BROWSER_DATABASE_DATABASE_TRACKER_H_ |
OLD | NEW |