| 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/history_backend.h" | 5 #include "components/history/core/browser/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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 first_recorded_time_ = base::Time(); | 724 first_recorded_time_ = base::Time(); |
| 725 } | 725 } |
| 726 if (thumbnail_db_) { | 726 if (thumbnail_db_) { |
| 727 thumbnail_db_->CommitTransaction(); | 727 thumbnail_db_->CommitTransaction(); |
| 728 thumbnail_db_.reset(); | 728 thumbnail_db_.reset(); |
| 729 } | 729 } |
| 730 } | 730 } |
| 731 | 731 |
| 732 void HistoryBackend::RecordTopHostsMetrics(const GURL& url) { | 732 void HistoryBackend::RecordTopHostsMetrics(const GURL& url) { |
| 733 // Convert index from 0-based to 1-based. | 733 // Convert index from 0-based to 1-based. |
| 734 UMA_HISTOGRAM_ENUMERATION("History.TopHostsVisitsByRank", | 734 UMA_HISTOGRAM_EXACT_LINEAR("History.TopHostsVisitsByRank", |
| 735 HostRankIfAvailable(url) + 1, kMaxTopHosts + 2); | 735 HostRankIfAvailable(url) + 1, kMaxTopHosts + 2); |
| 736 } | 736 } |
| 737 | 737 |
| 738 std::pair<URLID, VisitID> HistoryBackend::AddPageVisit( | 738 std::pair<URLID, VisitID> HistoryBackend::AddPageVisit( |
| 739 const GURL& url, | 739 const GURL& url, |
| 740 Time time, | 740 Time time, |
| 741 VisitID referring_visit, | 741 VisitID referring_visit, |
| 742 ui::PageTransition transition, | 742 ui::PageTransition transition, |
| 743 VisitSource visit_source) { | 743 VisitSource visit_source) { |
| 744 // Top-level frame navigations are visible, everything else is hidden | 744 // Top-level frame navigations are visible, everything else is hidden |
| 745 bool new_hidden = !ui::PageTransitionIsMainFrame(transition); | 745 bool new_hidden = !ui::PageTransitionIsMainFrame(transition); |
| (...skipping 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 // transaction is currently open. | 2639 // transaction is currently open. |
| 2640 db_->CommitTransaction(); | 2640 db_->CommitTransaction(); |
| 2641 db_->Vacuum(); | 2641 db_->Vacuum(); |
| 2642 db_->BeginTransaction(); | 2642 db_->BeginTransaction(); |
| 2643 db_->GetStartDate(&first_recorded_time_); | 2643 db_->GetStartDate(&first_recorded_time_); |
| 2644 | 2644 |
| 2645 return true; | 2645 return true; |
| 2646 } | 2646 } |
| 2647 | 2647 |
| 2648 } // namespace history | 2648 } // namespace history |
| OLD | NEW |