Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ |
| 6 #define CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ | 6 #define CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "app/sql/connection.h" | 9 #include "app/sql/connection.h" |
| 10 #include "app/sql/init_status.h" | 10 #include "app/sql/init_status.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 virtual AutofillTable* GetAutofillTable(); | 36 virtual AutofillTable* GetAutofillTable(); |
| 37 virtual KeywordTable* GetKeywordTable(); | 37 virtual KeywordTable* GetKeywordTable(); |
| 38 virtual LoginsTable* GetLoginsTable(); | 38 virtual LoginsTable* GetLoginsTable(); |
| 39 virtual TokenServiceTable* GetTokenServiceTable(); | 39 virtual TokenServiceTable* GetTokenServiceTable(); |
| 40 virtual WebAppsTable* GetWebAppsTable(); | 40 virtual WebAppsTable* GetWebAppsTable(); |
| 41 | 41 |
| 42 // Exposed for testing only. | 42 // Exposed for testing only. |
| 43 sql::Connection* GetSQLConnection(); | 43 sql::Connection* GetSQLConnection(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 // Change the version number and possibly the compatibility version of | |
|
dhollowa
2011/04/04 16:13:20
These would be better pulled into the .cc as utili
Bons
2011/04/05 11:05:13
Done.
| |
| 47 // |meta_table_|. | |
| 48 void ChangeVersion(int version_num, bool update_compatible_version_num); | |
| 49 | |
| 50 // Outputs the failed version number as a warning and always returns | |
| 51 // |sql::INIT_FAILURE|. | |
| 52 sql::InitStatus FailedMigrationTo(int version_num); | |
| 53 | |
| 46 // Used by |Init()| to migration database schema from older versions to | 54 // Used by |Init()| to migration database schema from older versions to |
| 47 // current version. | 55 // current version. |
| 48 sql::InitStatus MigrateOldVersionsAsNeeded(); | 56 sql::InitStatus MigrateOldVersionsAsNeeded(); |
| 49 | 57 |
| 50 sql::Connection db_; | 58 sql::Connection db_; |
| 51 sql::MetaTable meta_table_; | 59 sql::MetaTable meta_table_; |
| 52 | 60 |
| 53 scoped_ptr<AutofillTable> autofill_table_; | 61 scoped_ptr<AutofillTable> autofill_table_; |
| 54 scoped_ptr<KeywordTable> keyword_table_; | 62 scoped_ptr<KeywordTable> keyword_table_; |
| 55 scoped_ptr<LoginsTable> logins_table_; | 63 scoped_ptr<LoginsTable> logins_table_; |
| 56 scoped_ptr<TokenServiceTable> token_service_table_; | 64 scoped_ptr<TokenServiceTable> token_service_table_; |
| 57 scoped_ptr<WebAppsTable> web_apps_table_; | 65 scoped_ptr<WebAppsTable> web_apps_table_; |
| 58 | 66 |
| 59 scoped_ptr<NotificationService> notification_service_; | 67 scoped_ptr<NotificationService> notification_service_; |
| 60 | 68 |
| 61 DISALLOW_COPY_AND_ASSIGN(WebDatabase); | 69 DISALLOW_COPY_AND_ASSIGN(WebDatabase); |
| 62 }; | 70 }; |
| 63 | 71 |
| 64 #endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ | 72 #endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_H_ |
| OLD | NEW |