| 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 #include "components/webdata/common/web_database.h" | 5 #include "components/webdata/common/web_database.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "sql/transaction.h" | 10 #include "sql/transaction.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 void WebDatabase::BeginTransaction() { | 60 void WebDatabase::BeginTransaction() { |
| 61 db_.BeginTransaction(); | 61 db_.BeginTransaction(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void WebDatabase::CommitTransaction() { | 64 void WebDatabase::CommitTransaction() { |
| 65 db_.CommitTransaction(); | 65 db_.CommitTransaction(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 std::string WebDatabase::GetDiagnosticInfo(int extended_error, |
| 69 sql::Statement* statement) { |
| 70 return db_.GetDiagnosticInfo(extended_error, statement); |
| 71 } |
| 72 |
| 68 sql::Connection* WebDatabase::GetSQLConnection() { | 73 sql::Connection* WebDatabase::GetSQLConnection() { |
| 69 return &db_; | 74 return &db_; |
| 70 } | 75 } |
| 71 | 76 |
| 72 sql::InitStatus WebDatabase::Init(const base::FilePath& db_name) { | 77 sql::InitStatus WebDatabase::Init(const base::FilePath& db_name) { |
| 73 db_.set_histogram_tag("Web"); | 78 db_.set_histogram_tag("Web"); |
| 74 | 79 |
| 75 // We don't store that much data in the tables so use a small page size. | 80 // We don't store that much data in the tables so use a small page size. |
| 76 // This provides a large benefit for empty tables (which is very likely with | 81 // This provides a large benefit for empty tables (which is very likely with |
| 77 // the tables we create). | 82 // the tables we create). |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 189 |
| 185 bool WebDatabase::MigrateToVersion58DropWebAppsAndIntents() { | 190 bool WebDatabase::MigrateToVersion58DropWebAppsAndIntents() { |
| 186 sql::Transaction transaction(&db_); | 191 sql::Transaction transaction(&db_); |
| 187 return transaction.Begin() && | 192 return transaction.Begin() && |
| 188 db_.Execute("DROP TABLE IF EXISTS web_apps") && | 193 db_.Execute("DROP TABLE IF EXISTS web_apps") && |
| 189 db_.Execute("DROP TABLE IF EXISTS web_app_icons") && | 194 db_.Execute("DROP TABLE IF EXISTS web_app_icons") && |
| 190 db_.Execute("DROP TABLE IF EXISTS web_intents") && | 195 db_.Execute("DROP TABLE IF EXISTS web_intents") && |
| 191 db_.Execute("DROP TABLE IF EXISTS web_intents_defaults") && | 196 db_.Execute("DROP TABLE IF EXISTS web_intents_defaults") && |
| 192 transaction.Commit(); | 197 transaction.Commit(); |
| 193 } | 198 } |
| OLD | NEW |