| 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_HISTORY_ARCHIVED_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "chrome/browser/history/url_database.h" | 10 #include "chrome/browser/history/url_database.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 bool Init(const FilePath& file_name); | 34 bool Init(const FilePath& file_name); |
| 35 | 35 |
| 36 // Transactions on the database. We support nested transactions and only | 36 // Transactions on the database. We support nested transactions and only |
| 37 // commit when the outermost one is committed (sqlite doesn't support true | 37 // commit when the outermost one is committed (sqlite doesn't support true |
| 38 // nested transactions). | 38 // nested transactions). |
| 39 void BeginTransaction(); | 39 void BeginTransaction(); |
| 40 void CommitTransaction(); | 40 void CommitTransaction(); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // Implemented for the specialized databases. | 43 // Implemented for the specialized databases. |
| 44 virtual sql::Connection& GetDB(); | 44 virtual sql::Connection& GetDB() OVERRIDE; |
| 45 | 45 |
| 46 // Makes sure the version is up-to-date, updating if necessary. If the | 46 // Makes sure the version is up-to-date, updating if necessary. If the |
| 47 // database is too old to migrate, the user will be notified. In this case, or | 47 // database is too old to migrate, the user will be notified. In this case, or |
| 48 // for other errors, false will be returned. True means it is up-to-date and | 48 // for other errors, false will be returned. True means it is up-to-date and |
| 49 // ready for use. | 49 // ready for use. |
| 50 // | 50 // |
| 51 // This assumes it is called from the init function inside a transaction. It | 51 // This assumes it is called from the init function inside a transaction. It |
| 52 // may commit the transaction and start a new one if migration requires it. | 52 // may commit the transaction and start a new one if migration requires it. |
| 53 sql::InitStatus EnsureCurrentVersion(); | 53 sql::InitStatus EnsureCurrentVersion(); |
| 54 | 54 |
| 55 // The database. | 55 // The database. |
| 56 sql::Connection db_; | 56 sql::Connection db_; |
| 57 sql::MetaTable meta_table_; | 57 sql::MetaTable meta_table_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(ArchivedDatabase); | 59 DISALLOW_COPY_AND_ASSIGN(ArchivedDatabase); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace history | 62 } // namespace history |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_ | 64 #endif // CHROME_BROWSER_HISTORY_ARCHIVED_DATABASE_H_ |
| OLD | NEW |