| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/sql/transaction.h" | 5 #include "app/sql/transaction.h" |
| 6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" | 7 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" |
| 8 #include "chrome/browser/history/history_types.h" | 8 #include "chrome/browser/history/history_types.h" |
| 9 #include "chrome/browser/history/top_sites.h" | 9 #include "chrome/browser/history/top_sites.h" |
| 10 #include "chrome/browser/history/top_sites_database.h" | 10 #include "chrome/browser/history/top_sites_database.h" |
| 11 | 11 |
| 12 namespace history { | 12 namespace history { |
| 13 | 13 |
| 14 TopSitesDatabaseImpl::TopSitesDatabaseImpl() { | 14 TopSitesDatabaseImpl::TopSitesDatabaseImpl() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 TopSitesDatabaseImpl::~TopSitesDatabaseImpl() { |
| 18 } |
| 19 |
| 17 bool TopSitesDatabaseImpl::Init(const FilePath& db_name) { | 20 bool TopSitesDatabaseImpl::Init(const FilePath& db_name) { |
| 18 // Settings copied from ThumbnailDatabase. | 21 // Settings copied from ThumbnailDatabase. |
| 19 db_.set_error_delegate(GetErrorHandlerForThumbnailDb()); | 22 db_.set_error_delegate(GetErrorHandlerForThumbnailDb()); |
| 20 db_.set_page_size(4096); | 23 db_.set_page_size(4096); |
| 21 db_.set_cache_size(64); | 24 db_.set_cache_size(64); |
| 22 | 25 |
| 23 if (!db_.Open(db_name)) { | 26 if (!db_.Open(db_name)) { |
| 24 LOG(WARNING) << db_.GetErrorMessage(); | 27 LOG(WARNING) << db_.GetErrorMessage(); |
| 25 return false; | 28 return false; |
| 26 } | 29 } |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 "DELETE FROM thumbnails WHERE url = ?")); | 324 "DELETE FROM thumbnails WHERE url = ?")); |
| 322 if (!delete_statement) | 325 if (!delete_statement) |
| 323 return false; | 326 return false; |
| 324 delete_statement.BindString(0, url.url.spec()); | 327 delete_statement.BindString(0, url.url.spec()); |
| 325 delete_statement.Run(); | 328 delete_statement.Run(); |
| 326 | 329 |
| 327 return transaction.Commit(); | 330 return transaction.Commit(); |
| 328 } | 331 } |
| 329 | 332 |
| 330 } // namespace history | 333 } // namespace history |
| OLD | NEW |