Commit 9b4cb224 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

sql: Remove Recovery::FullRecoverySupported().

This always returns true, and the comments around it are misleading.

Bug: 807093
Change-Id: Ifb5c7e7e079a09e397123e82dc0659814f4c8a42
Reviewed-on: https://chromium-review.googlesource.com/898464Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarChris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534605}
parent d6d2c9a2
...@@ -963,15 +963,6 @@ TEST_F(ThumbnailDatabaseTest, Version8) { ...@@ -963,15 +963,6 @@ TEST_F(ThumbnailDatabaseTest, Version8) {
} }
TEST_F(ThumbnailDatabaseTest, Recovery) { TEST_F(ThumbnailDatabaseTest, Recovery) {
// This code tests the recovery module in concert with Chromium's
// custom recover virtual table. Under USE_SYSTEM_SQLITE, this is
// not available. This is detected dynamically because corrupt
// databases still need to be handled, perhaps by Raze(), and the
// recovery module is an obvious layer to abstract that to.
// TODO(shess): Handle that case for real!
if (!sql::Recovery::FullRecoverySupported())
return;
// Create an example database. // Create an example database.
{ {
EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v8.sql")); EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v8.sql"));
...@@ -1084,15 +1075,6 @@ TEST_F(ThumbnailDatabaseTest, Recovery) { ...@@ -1084,15 +1075,6 @@ TEST_F(ThumbnailDatabaseTest, Recovery) {
} }
TEST_F(ThumbnailDatabaseTest, Recovery7) { TEST_F(ThumbnailDatabaseTest, Recovery7) {
// This code tests the recovery module in concert with Chromium's
// custom recover virtual table. Under USE_SYSTEM_SQLITE, this is
// not available. This is detected dynamically because corrupt
// databases still need to be handled, perhaps by Raze(), and the
// recovery module is an obvious layer to abstract that to.
// TODO(shess): Handle that case for real!
if (!sql::Recovery::FullRecoverySupported())
return;
// Create an example database without loading into ThumbnailDatabase // Create an example database without loading into ThumbnailDatabase
// (which would upgrade it). // (which would upgrade it).
EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v7.sql")); EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v7.sql"));
...@@ -1188,10 +1170,6 @@ TEST_F(ThumbnailDatabaseTest, Recovery7) { ...@@ -1188,10 +1170,6 @@ TEST_F(ThumbnailDatabaseTest, Recovery7) {
} }
TEST_F(ThumbnailDatabaseTest, Recovery6) { TEST_F(ThumbnailDatabaseTest, Recovery6) {
// TODO(shess): See comment at top of Recovery test.
if (!sql::Recovery::FullRecoverySupported())
return;
// Create an example database without loading into ThumbnailDatabase // Create an example database without loading into ThumbnailDatabase
// (which would upgrade it). // (which would upgrade it).
EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v6.sql")); EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v6.sql"));
...@@ -1236,10 +1214,6 @@ TEST_F(ThumbnailDatabaseTest, Recovery6) { ...@@ -1236,10 +1214,6 @@ TEST_F(ThumbnailDatabaseTest, Recovery6) {
} }
TEST_F(ThumbnailDatabaseTest, Recovery5) { TEST_F(ThumbnailDatabaseTest, Recovery5) {
// TODO(shess): See comment at top of Recovery test.
if (!sql::Recovery::FullRecoverySupported())
return;
// Create an example database without loading into ThumbnailDatabase // Create an example database without loading into ThumbnailDatabase
// (which would upgrade it). // (which would upgrade it).
EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v5.sql")); EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "Favicons.v5.sql"));
......
...@@ -131,10 +131,6 @@ TEST_F(TopSitesDatabaseTest, Version3) { ...@@ -131,10 +131,6 @@ TEST_F(TopSitesDatabaseTest, Version3) {
// Version 1 is deprecated, the resulting schema should be current, // Version 1 is deprecated, the resulting schema should be current,
// with no data. // with no data.
TEST_F(TopSitesDatabaseTest, Recovery1) { TEST_F(TopSitesDatabaseTest, Recovery1) {
// Recovery module only supports some platforms at this time.
if (!sql::Recovery::FullRecoverySupported())
return;
// Create an example database. // Create an example database.
EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "TopSites.v1.sql")); EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "TopSites.v1.sql"));
...@@ -166,10 +162,6 @@ TEST_F(TopSitesDatabaseTest, Recovery1) { ...@@ -166,10 +162,6 @@ TEST_F(TopSitesDatabaseTest, Recovery1) {
} }
TEST_F(TopSitesDatabaseTest, Recovery2) { TEST_F(TopSitesDatabaseTest, Recovery2) {
// Recovery module only supports some platforms at this time.
if (!sql::Recovery::FullRecoverySupported())
return;
// Create an example database. // Create an example database.
EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "TopSites.v2.sql")); EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "TopSites.v2.sql"));
...@@ -201,10 +193,6 @@ TEST_F(TopSitesDatabaseTest, Recovery2) { ...@@ -201,10 +193,6 @@ TEST_F(TopSitesDatabaseTest, Recovery2) {
} }
TEST_F(TopSitesDatabaseTest, Recovery3) { TEST_F(TopSitesDatabaseTest, Recovery3) {
// Recovery module only supports some platforms at this time.
if (!sql::Recovery::FullRecoverySupported())
return;
// Create an example database. // Create an example database.
EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "TopSites.v3.sql")); EXPECT_TRUE(CreateDatabaseFromSQL(file_name_, "TopSites.v3.sql"));
......
...@@ -140,12 +140,6 @@ void RecordRecoveryEvent(RecoveryEventType recovery_event) { ...@@ -140,12 +140,6 @@ void RecordRecoveryEvent(RecoveryEventType recovery_event) {
} // namespace } // namespace
// static
bool Recovery::FullRecoverySupported() {
// TODO(shess): See comment in Init().
return true;
}
// static // static
std::unique_ptr<Recovery> Recovery::Begin(Connection* connection, std::unique_ptr<Recovery> Recovery::Begin(Connection* connection,
const base::FilePath& db_path) { const base::FilePath& db_path) {
......
...@@ -66,15 +66,6 @@ class SQL_EXPORT Recovery { ...@@ -66,15 +66,6 @@ class SQL_EXPORT Recovery {
public: public:
~Recovery(); ~Recovery();
// This module is intended to be used in concert with a virtual
// table module (see third_party/sqlite/src/src/recover.c). If the
// build defines USE_SYSTEM_SQLITE, this module will not be present.
// TODO(shess): I am still debating how to handle this - perhaps it
// will just imply Unrecoverable(). This is exposed to allow tests
// to adapt to the cases, please do not rely on it in production
// code.
static bool FullRecoverySupported();
// Begin the recovery process by opening a temporary database handle // Begin the recovery process by opening a temporary database handle
// and attach the existing database to it at "corrupt". To prevent // and attach the existing database to it at "corrupt". To prevent
// deadlock, all transactions on |connection| are rolled back. // deadlock, all transactions on |connection| are rolled back.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment