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/history/core/browser/thumbnail_database.h" | 5 #include "components/history/core/browser/thumbnail_database.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 final_size > 0) { | 525 final_size > 0) { |
526 int percentage = static_cast<int>(original_size * 100 / final_size); | 526 int percentage = static_cast<int>(original_size * 100 / final_size); |
527 UMA_HISTOGRAM_PERCENTAGE("History.FaviconsRecoveredPercentage", | 527 UMA_HISTOGRAM_PERCENTAGE("History.FaviconsRecoveredPercentage", |
528 std::max(100, percentage)); | 528 std::max(100, percentage)); |
529 } | 529 } |
530 | 530 |
531 // Using 10,000 because these cases mostly care about "none | 531 // Using 10,000 because these cases mostly care about "none |
532 // recovered" and "lots recovered". More than 10,000 rows recovered | 532 // recovered" and "lots recovered". More than 10,000 rows recovered |
533 // probably means there's something wrong with the profile. | 533 // probably means there's something wrong with the profile. |
534 UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsFavicons", | 534 UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsFavicons", |
535 favicons_rows_recovered); | 535 static_cast<int>(favicons_rows_recovered)); |
536 UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsFaviconBitmaps", | 536 UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsFaviconBitmaps", |
537 favicon_bitmaps_rows_recovered); | 537 static_cast<int>(favicon_bitmaps_rows_recovered)); |
538 UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsIconMapping", | 538 UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsIconMapping", |
539 icon_mapping_rows_recovered); | 539 static_cast<int>(icon_mapping_rows_recovered)); |
540 | 540 |
541 RecordRecoveryEvent(RECOVERY_EVENT_RECOVERED); | 541 RecordRecoveryEvent(RECOVERY_EVENT_RECOVERED); |
542 } | 542 } |
543 | 543 |
544 void DatabaseErrorCallback(sql::Connection* db, | 544 void DatabaseErrorCallback(sql::Connection* db, |
545 const base::FilePath& db_path, | 545 const base::FilePath& db_path, |
546 size_t startup_kb, | 546 size_t startup_kb, |
547 history::HistoryClient* history_client, | 547 history::HistoryClient* history_client, |
548 int extended_error, | 548 int extended_error, |
549 sql::Statement* stmt) { | 549 sql::Statement* stmt) { |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 meta_table_.SetVersionNumber(7); | 1313 meta_table_.SetVersionNumber(7); |
1314 meta_table_.SetCompatibleVersionNumber(std::min(7, kCompatibleVersionNumber)); | 1314 meta_table_.SetCompatibleVersionNumber(std::min(7, kCompatibleVersionNumber)); |
1315 return true; | 1315 return true; |
1316 } | 1316 } |
1317 | 1317 |
1318 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() { | 1318 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() { |
1319 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons"); | 1319 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons"); |
1320 } | 1320 } |
1321 | 1321 |
1322 } // namespace history | 1322 } // namespace history |
OLD | NEW |