| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 delegate_.get())); | 702 delegate_.get())); |
| 703 } | 703 } |
| 704 #endif | 704 #endif |
| 705 | 705 |
| 706 LOCAL_HISTOGRAM_TIMES("History.InitTime", TimeTicks::Now() - beginning_time); | 706 LOCAL_HISTOGRAM_TIMES("History.InitTime", TimeTicks::Now() - beginning_time); |
| 707 } | 707 } |
| 708 | 708 |
| 709 void HistoryBackend::OnMemoryPressure( | 709 void HistoryBackend::OnMemoryPressure( |
| 710 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { | 710 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { |
| 711 bool trim_aggressively = memory_pressure_level == | 711 bool trim_aggressively = memory_pressure_level == |
| 712 base::MemoryPressureListener::MEMORY_PRESSURE_CRITICAL; | 712 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL; |
| 713 if (db_) | 713 if (db_) |
| 714 db_->TrimMemory(trim_aggressively); | 714 db_->TrimMemory(trim_aggressively); |
| 715 if (thumbnail_db_) | 715 if (thumbnail_db_) |
| 716 thumbnail_db_->TrimMemory(trim_aggressively); | 716 thumbnail_db_->TrimMemory(trim_aggressively); |
| 717 } | 717 } |
| 718 | 718 |
| 719 void HistoryBackend::CloseAllDatabases() { | 719 void HistoryBackend::CloseAllDatabases() { |
| 720 if (db_) { | 720 if (db_) { |
| 721 // Commit the long-running transaction. | 721 // Commit the long-running transaction. |
| 722 db_->CommitTransaction(); | 722 db_->CommitTransaction(); |
| (...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2703 int rank = kPageVisitStatsMaxTopSites; | 2703 int rank = kPageVisitStatsMaxTopSites; |
| 2704 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); | 2704 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); |
| 2705 if (it != most_visited_urls_map_.end()) | 2705 if (it != most_visited_urls_map_.end()) |
| 2706 rank = (*it).second; | 2706 rank = (*it).second; |
| 2707 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", | 2707 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", |
| 2708 rank, kPageVisitStatsMaxTopSites + 1); | 2708 rank, kPageVisitStatsMaxTopSites + 1); |
| 2709 } | 2709 } |
| 2710 #endif | 2710 #endif |
| 2711 | 2711 |
| 2712 } // namespace history | 2712 } // namespace history |
| OLD | NEW |