OLD | NEW |
1 // Copyright (c) 2011 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_SUPPORT_SIMPLE_DATABASE_SYSTEM_H_ | 5 #ifndef WEBKIT_SUPPORT_SIMPLE_DATABASE_SYSTEM_H_ |
6 #define WEBKIT_SUPPORT_SIMPLE_DATABASE_SYSTEM_H_ | 6 #define WEBKIT_SUPPORT_SIMPLE_DATABASE_SYSTEM_H_ |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
(...skipping 26 matching lines...) Expand all Loading... |
38 virtual void databaseClosed(const WebKit::WebDatabase& database); | 38 virtual void databaseClosed(const WebKit::WebDatabase& database); |
39 | 39 |
40 // SQLite VFS related methods, these are called on webcore's | 40 // SQLite VFS related methods, these are called on webcore's |
41 // background database threads via the WebKitPlatformSupport impl. | 41 // background database threads via the WebKitPlatformSupport impl. |
42 base::PlatformFile OpenFile(const string16& vfs_file_name, int desired_flags); | 42 base::PlatformFile OpenFile(const string16& vfs_file_name, int desired_flags); |
43 int DeleteFile(const string16& vfs_file_name, bool sync_dir); | 43 int DeleteFile(const string16& vfs_file_name, bool sync_dir); |
44 uint32 GetFileAttributes(const string16& vfs_file_name); | 44 uint32 GetFileAttributes(const string16& vfs_file_name); |
45 int64 GetFileSize(const string16& vfs_file_name); | 45 int64 GetFileSize(const string16& vfs_file_name); |
46 int64 GetSpaceAvailable(const string16& origin_identifier); | 46 int64 GetSpaceAvailable(const string16& origin_identifier); |
47 | 47 |
48 // For use by LayoutTestController, called on the main thread. | 48 // For use by testRunner, called on the main thread. |
49 void ClearAllDatabases(); | 49 void ClearAllDatabases(); |
50 void SetDatabaseQuota(int64 quota); | 50 void SetDatabaseQuota(int64 quota); |
51 | 51 |
52 private: | 52 private: |
53 // Used by our WebDatabaseObserver impl, only called on the db_thread | 53 // Used by our WebDatabaseObserver impl, only called on the db_thread |
54 void DatabaseOpened(const string16& origin_identifier, | 54 void DatabaseOpened(const string16& origin_identifier, |
55 const string16& database_name, | 55 const string16& database_name, |
56 const string16& description, | 56 const string16& description, |
57 int64 estimated_size); | 57 int64 estimated_size); |
58 void DatabaseModified(const string16& origin_identifier, | 58 void DatabaseModified(const string16& origin_identifier, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; | 95 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
96 int64 quota_per_origin_; | 96 int64 quota_per_origin_; |
97 | 97 |
98 // Data members to support waiting for all connections to be closed. | 98 // Data members to support waiting for all connections to be closed. |
99 scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_; | 99 scoped_refptr<webkit_database::DatabaseConnectionsWrapper> open_connections_; |
100 | 100 |
101 static SimpleDatabaseSystem* instance_; | 101 static SimpleDatabaseSystem* instance_; |
102 }; | 102 }; |
103 | 103 |
104 #endif // WEBKIT_SUPPORT_SIMPLE_DATABASE_SYSTEM_H_ | 104 #endif // WEBKIT_SUPPORT_SIMPLE_DATABASE_SYSTEM_H_ |
OLD | NEW |