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 "chrome/browser/history/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 if (thumbnail_db_) { | 695 if (thumbnail_db_) { |
696 android_provider_backend_.reset( | 696 android_provider_backend_.reset( |
697 new AndroidProviderBackend(GetAndroidCacheFileName(), | 697 new AndroidProviderBackend(GetAndroidCacheFileName(), |
698 db_.get(), | 698 db_.get(), |
699 thumbnail_db_.get(), | 699 thumbnail_db_.get(), |
700 history_client_, | 700 history_client_, |
701 delegate_.get())); | 701 delegate_.get())); |
702 } | 702 } |
703 #endif | 703 #endif |
704 | 704 |
705 HISTOGRAM_TIMES("History.InitTime", | 705 LOCAL_HISTOGRAM_TIMES("History.InitTime", TimeTicks::Now() - beginning_time); |
706 TimeTicks::Now() - beginning_time); | |
707 } | 706 } |
708 | 707 |
709 void HistoryBackend::OnMemoryPressure( | 708 void HistoryBackend::OnMemoryPressure( |
710 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { | 709 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { |
711 bool trim_aggressively = memory_pressure_level == | 710 bool trim_aggressively = memory_pressure_level == |
712 base::MemoryPressureListener::MEMORY_PRESSURE_CRITICAL; | 711 base::MemoryPressureListener::MEMORY_PRESSURE_CRITICAL; |
713 if (db_) | 712 if (db_) |
714 db_->TrimMemory(trim_aggressively); | 713 db_->TrimMemory(trim_aggressively); |
715 if (thumbnail_db_) | 714 if (thumbnail_db_) |
716 thumbnail_db_->TrimMemory(trim_aggressively); | 715 thumbnail_db_->TrimMemory(trim_aggressively); |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 &bitmap_result.bitmap_data, | 1588 &bitmap_result.bitmap_data, |
1590 &bitmap_result.pixel_size)) { | 1589 &bitmap_result.pixel_size)) { |
1591 return; | 1590 return; |
1592 } | 1591 } |
1593 | 1592 |
1594 bitmap_result.expired = (Time::Now() - last_updated) > | 1593 bitmap_result.expired = (Time::Now() - last_updated) > |
1595 TimeDelta::FromDays(kFaviconRefetchDays); | 1594 TimeDelta::FromDays(kFaviconRefetchDays); |
1596 if (bitmap_result.is_valid()) | 1595 if (bitmap_result.is_valid()) |
1597 *favicon_bitmap_result = bitmap_result; | 1596 *favicon_bitmap_result = bitmap_result; |
1598 | 1597 |
1599 HISTOGRAM_TIMES("History.GetLargestFaviconForURL", | 1598 LOCAL_HISTOGRAM_TIMES("History.GetLargestFaviconForURL", |
1600 TimeTicks::Now() - beginning_time); | 1599 TimeTicks::Now() - beginning_time); |
1601 } | 1600 } |
1602 | 1601 |
1603 void HistoryBackend::GetFaviconsForURL( | 1602 void HistoryBackend::GetFaviconsForURL( |
1604 const GURL& page_url, | 1603 const GURL& page_url, |
1605 int icon_types, | 1604 int icon_types, |
1606 const std::vector<int>& desired_sizes, | 1605 const std::vector<int>& desired_sizes, |
1607 std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results) { | 1606 std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results) { |
1608 DCHECK(bitmap_results); | 1607 DCHECK(bitmap_results); |
1609 GetFaviconsFromDB(page_url, icon_types, desired_sizes, bitmap_results); | 1608 GetFaviconsFromDB(page_url, icon_types, desired_sizes, bitmap_results); |
1610 } | 1609 } |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 int rank = kPageVisitStatsMaxTopSites; | 2753 int rank = kPageVisitStatsMaxTopSites; |
2755 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); | 2754 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); |
2756 if (it != most_visited_urls_map_.end()) | 2755 if (it != most_visited_urls_map_.end()) |
2757 rank = (*it).second; | 2756 rank = (*it).second; |
2758 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", | 2757 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", |
2759 rank, kPageVisitStatsMaxTopSites + 1); | 2758 rank, kPageVisitStatsMaxTopSites + 1); |
2760 } | 2759 } |
2761 #endif | 2760 #endif |
2762 | 2761 |
2763 } // namespace history | 2762 } // namespace history |
OLD | NEW |