| 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 "content/browser/appcache/appcache_database.h" | 5 #include "content/browser/appcache/appcache_database.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 kOnlineWhiteListsTable, | 146 kOnlineWhiteListsTable, |
| 147 "(cache_id)", | 147 "(cache_id)", |
| 148 false }, | 148 false }, |
| 149 | 149 |
| 150 { "DeletableResponsesIdIndex", | 150 { "DeletableResponsesIdIndex", |
| 151 kDeletableResponseIdsTable, | 151 kDeletableResponseIdsTable, |
| 152 "(response_id)", | 152 "(response_id)", |
| 153 true }, | 153 true }, |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 const int kTableCount = ARRAYSIZE_UNSAFE(kTables); | 156 const int kTableCount = arraysize(kTables); |
| 157 const int kIndexCount = ARRAYSIZE_UNSAFE(kIndexes); | 157 const int kIndexCount = arraysize(kIndexes); |
| 158 | 158 |
| 159 bool CreateTable(sql::Connection* db, const TableInfo& info) { | 159 bool CreateTable(sql::Connection* db, const TableInfo& info) { |
| 160 std::string sql("CREATE TABLE "); | 160 std::string sql("CREATE TABLE "); |
| 161 sql += info.table_name; | 161 sql += info.table_name; |
| 162 sql += info.columns; | 162 sql += info.columns; |
| 163 return db->Execute(sql.c_str()); | 163 return db->Execute(sql.c_str()); |
| 164 } | 164 } |
| 165 | 165 |
| 166 bool CreateIndex(sql::Connection* db, const IndexInfo& info) { | 166 bool CreateIndex(sql::Connection* db, const IndexInfo& info) { |
| 167 std::string sql; | 167 std::string sql; |
| (...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 } | 1219 } |
| 1220 | 1220 |
| 1221 void AppCacheDatabase::OnDatabaseError(int err, sql::Statement* stmt) { | 1221 void AppCacheDatabase::OnDatabaseError(int err, sql::Statement* stmt) { |
| 1222 was_corruption_detected_ |= sql::IsErrorCatastrophic(err); | 1222 was_corruption_detected_ |= sql::IsErrorCatastrophic(err); |
| 1223 if (!db_->ShouldIgnoreSqliteError(err)) | 1223 if (!db_->ShouldIgnoreSqliteError(err)) |
| 1224 DLOG(ERROR) << db_->GetErrorMessage(); | 1224 DLOG(ERROR) << db_->GetErrorMessage(); |
| 1225 // TODO: Maybe use non-catostrophic errors to trigger a full integrity check? | 1225 // TODO: Maybe use non-catostrophic errors to trigger a full integrity check? |
| 1226 } | 1226 } |
| 1227 | 1227 |
| 1228 } // namespace content | 1228 } // namespace content |
| OLD | NEW |