| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 scoped_refptr<HistoryBackend> history_backend_; | 164 scoped_refptr<HistoryBackend> history_backend_; |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 | 167 |
| 168 QueuedHistoryDBTask::QueuedHistoryDBTask( | 168 QueuedHistoryDBTask::QueuedHistoryDBTask( |
| 169 scoped_ptr<HistoryDBTask> task, | 169 scoped_ptr<HistoryDBTask> task, |
| 170 scoped_refptr<base::SingleThreadTaskRunner> origin_loop, | 170 scoped_refptr<base::SingleThreadTaskRunner> origin_loop, |
| 171 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled) | 171 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled) |
| 172 : task_(task.Pass()), origin_loop_(origin_loop), is_canceled_(is_canceled) { | 172 : task_(task.Pass()), origin_loop_(origin_loop), is_canceled_(is_canceled) { |
| 173 DCHECK(task_); | 173 DCHECK(task_); |
| 174 DCHECK(origin_loop_); | 174 DCHECK(origin_loop_.get()); |
| 175 DCHECK(!is_canceled_.is_null()); | 175 DCHECK(!is_canceled_.is_null()); |
| 176 } | 176 } |
| 177 | 177 |
| 178 QueuedHistoryDBTask::~QueuedHistoryDBTask() { | 178 QueuedHistoryDBTask::~QueuedHistoryDBTask() { |
| 179 // Ensure that |task_| is destroyed on its origin thread. | 179 // Ensure that |task_| is destroyed on its origin thread. |
| 180 origin_loop_->PostTask( | 180 origin_loop_->PostTask( |
| 181 FROM_HERE, | 181 FROM_HERE, |
| 182 base::Bind(&base::DeletePointer<HistoryDBTask>, | 182 base::Bind(&base::DeletePointer<HistoryDBTask>, |
| 183 base::Unretained(task_.release()))); | 183 base::Unretained(task_.release()))); |
| 184 } | 184 } |
| (...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2753 int rank = kPageVisitStatsMaxTopSites; | 2753 int rank = kPageVisitStatsMaxTopSites; |
| 2754 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); |
| 2755 if (it != most_visited_urls_map_.end()) | 2755 if (it != most_visited_urls_map_.end()) |
| 2756 rank = (*it).second; | 2756 rank = (*it).second; |
| 2757 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", | 2757 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", |
| 2758 rank, kPageVisitStatsMaxTopSites + 1); | 2758 rank, kPageVisitStatsMaxTopSites + 1); |
| 2759 } | 2759 } |
| 2760 #endif | 2760 #endif |
| 2761 | 2761 |
| 2762 } // namespace history | 2762 } // namespace history |
| OLD | NEW |