OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_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/lock.h" | |
11 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
12 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
13 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
14 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "base/synchronization/lock.h" |
15 #include "third_party/WebKit/WebKit/chromium/public/WebDatabaseObserver.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebDatabaseObserver.h" |
16 #include "webkit/database/database_connections.h" | 16 #include "webkit/database/database_connections.h" |
17 #include "webkit/database/database_tracker.h" | 17 #include "webkit/database/database_tracker.h" |
18 | 18 |
19 class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer, | 19 class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer, |
20 public WebKit::WebDatabaseObserver { | 20 public WebKit::WebDatabaseObserver { |
21 public: | 21 public: |
22 static SimpleDatabaseSystem* GetInstance(); | 22 static SimpleDatabaseSystem* GetInstance(); |
23 SimpleDatabaseSystem(); | 23 SimpleDatabaseSystem(); |
24 ~SimpleDatabaseSystem(); | 24 ~SimpleDatabaseSystem(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name); | 68 FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name); |
69 | 69 |
70 static SimpleDatabaseSystem* instance_; | 70 static SimpleDatabaseSystem* instance_; |
71 | 71 |
72 bool waiting_for_dbs_to_close_; | 72 bool waiting_for_dbs_to_close_; |
73 | 73 |
74 ScopedTempDir temp_dir_; | 74 ScopedTempDir temp_dir_; |
75 | 75 |
76 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; | 76 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
77 | 77 |
78 Lock file_names_lock_; | 78 base::Lock file_names_lock_; |
79 base::hash_map<string16, FilePath> file_names_; | 79 base::hash_map<string16, FilePath> file_names_; |
80 | 80 |
81 webkit_database::DatabaseConnections database_connections_; | 81 webkit_database::DatabaseConnections database_connections_; |
82 }; | 82 }; |
83 | 83 |
84 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_ | 84 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_ |
OLD | NEW |