OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_DATABASE_DATABASE_CONNECTIONS_H_ |
| 6 #define WEBKIT_DATABASE_DATABASE_CONNECTIONS_H_ |
| 7 |
| 8 #include "base/string16.h" |
| 9 |
| 10 #include <map> |
| 11 |
| 12 namespace webkit_database { |
| 13 |
| 14 class DatabaseConnections { |
| 15 public: |
| 16 DatabaseConnections(); |
| 17 ~DatabaseConnections(); |
| 18 |
| 19 bool IsDatabaseOpened(const string16& origin_identifier, |
| 20 const string16& database_name); |
| 21 bool IsOriginUsed(const string16& origin_identifier); |
| 22 void AddConnection(const string16& origin_identifier, |
| 23 const string16& database_name); |
| 24 void RemoveConnection(const string16& origin_identifier, |
| 25 const string16& database_name); |
| 26 void RemoveAllConnections(); |
| 27 void RemoveConnections(const DatabaseConnections& connections); |
| 28 |
| 29 private: |
| 30 typedef std::map<string16, int> DBConnections; |
| 31 typedef std::map<string16, DBConnections> OriginConnections; |
| 32 OriginConnections connections_; |
| 33 |
| 34 void RemoveConnectionsHelper(const string16& origin_identifier, |
| 35 const string16& database_name, |
| 36 int num_connections); |
| 37 }; |
| 38 |
| 39 } // namespace webkit_database |
| 40 |
| 41 #endif // WEBKIT_DATABASE_DATABASE_CONNECTIONS_H_ |
OLD | NEW |