| 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 COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_H_ | 5 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_H_ |
| 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_H_ | 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "components/webdata/common/web_database_table.h" | 11 #include "components/webdata/common/web_database_table.h" |
| 12 #include "components/webdata/common/webdata_export.h" | 12 #include "components/webdata/common/webdata_export.h" |
| 13 #include "sql/connection.h" | 13 #include "sql/connection.h" |
| 14 #include "sql/init_status.h" | 14 #include "sql/init_status.h" |
| 15 #include "sql/meta_table.h" | 15 #include "sql/meta_table.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class FilePath; | 18 class FilePath; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace content { | |
| 22 class NotificationService; | |
| 23 } | |
| 24 | |
| 25 // This class manages a SQLite database that stores various web page meta data. | 21 // This class manages a SQLite database that stores various web page meta data. |
| 26 class WEBDATA_EXPORT WebDatabase { | 22 class WEBDATA_EXPORT WebDatabase { |
| 27 public: | 23 public: |
| 28 enum State { | 24 enum State { |
| 29 COMMIT_NOT_NEEDED, | 25 COMMIT_NOT_NEEDED, |
| 30 COMMIT_NEEDED | 26 COMMIT_NEEDED |
| 31 }; | 27 }; |
| 32 // Exposed publicly so the keyword table can access it. | 28 // Exposed publicly so the keyword table can access it. |
| 33 static const int kCurrentVersionNumber; | 29 static const int kCurrentVersionNumber; |
| 34 | 30 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 64 sql::InitStatus MigrateOldVersionsAsNeeded(); | 60 sql::InitStatus MigrateOldVersionsAsNeeded(); |
| 65 | 61 |
| 66 sql::Connection db_; | 62 sql::Connection db_; |
| 67 sql::MetaTable meta_table_; | 63 sql::MetaTable meta_table_; |
| 68 | 64 |
| 69 // Map of all the different tables that have been added to this | 65 // Map of all the different tables that have been added to this |
| 70 // object. Non-owning. | 66 // object. Non-owning. |
| 71 typedef std::map<WebDatabaseTable::TypeKey, WebDatabaseTable*> TableMap; | 67 typedef std::map<WebDatabaseTable::TypeKey, WebDatabaseTable*> TableMap; |
| 72 TableMap tables_; | 68 TableMap tables_; |
| 73 | 69 |
| 74 scoped_ptr<content::NotificationService> notification_service_; | |
| 75 | |
| 76 DISALLOW_COPY_AND_ASSIGN(WebDatabase); | 70 DISALLOW_COPY_AND_ASSIGN(WebDatabase); |
| 77 }; | 71 }; |
| 78 | 72 |
| 79 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_H_ | 73 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_H_ |
| OLD | NEW |