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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
653 bitmap_count.Step() ? bitmap_count.ColumnInt(0) : 0); | 653 bitmap_count.Step() ? bitmap_count.ColumnInt(0) : 0); |
654 } | 654 } |
655 | 655 |
656 // Count "touch" icon URLs referenced by the DB. | 656 // Count "touch" icon URLs referenced by the DB. |
657 { | 657 { |
658 sql::Statement touch_icon_count( | 658 sql::Statement touch_icon_count( |
659 db_.GetCachedStatement( | 659 db_.GetCachedStatement( |
660 SQL_FROM_HERE, | 660 SQL_FROM_HERE, |
661 "SELECT COUNT(*) FROM favicons WHERE icon_type IN (?, ?)")); | 661 "SELECT COUNT(*) FROM favicons WHERE icon_type IN (?, ?)")); |
662 touch_icon_count.BindInt64(0, favicon_base::TOUCH_ICON); | 662 touch_icon_count.BindInt64(0, favicon_base::TOUCH_ICON); |
663 touch_icon_count.BindInt64(0, favicon_base::TOUCH_PRECOMPOSED_ICON); | 663 touch_icon_count.BindInt64(1, favicon_base::TOUCH_PRECOMPOSED_ICON); |
huangs
2015/05/04 05:17:30
This looks like an independent bug fix. I'd recomm
Roger McFarlane (Chromium)
2015/05/04 18:48:15
Moved to a separate CL.
This is a new histogram I
| |
664 UMA_HISTOGRAM_COUNTS_10000( | 664 UMA_HISTOGRAM_COUNTS_10000( |
665 "History.NumTouchIconsInDB", | 665 "History.NumTouchIconsInDB", |
666 touch_icon_count.Step() ? touch_icon_count.ColumnInt(0) : 0); | 666 touch_icon_count.Step() ? touch_icon_count.ColumnInt(0) : 0); |
667 } | 667 } |
668 | 668 |
669 // Count "large" bitmap resources cached in the DB. | 669 // Count "large" bitmap resources cached in the DB. |
670 { | 670 { |
671 sql::Statement large_bitmap_count( | 671 sql::Statement large_bitmap_count( |
672 db_.GetCachedStatement( | 672 db_.GetCachedStatement( |
673 SQL_FROM_HERE, | 673 SQL_FROM_HERE, |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1378 meta_table_.SetVersionNumber(8); | 1378 meta_table_.SetVersionNumber(8); |
1379 meta_table_.SetCompatibleVersionNumber(std::min(8, kCompatibleVersionNumber)); | 1379 meta_table_.SetCompatibleVersionNumber(std::min(8, kCompatibleVersionNumber)); |
1380 return true; | 1380 return true; |
1381 } | 1381 } |
1382 | 1382 |
1383 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() { | 1383 bool ThumbnailDatabase::IsFaviconDBStructureIncorrect() { |
1384 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons"); | 1384 return !db_.IsSQLValid("SELECT id, url, icon_type FROM favicons"); |
1385 } | 1385 } |
1386 | 1386 |
1387 } // namespace history | 1387 } // namespace history |
OLD | NEW |