| 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/top_sites_cache.h" | 5 #include "components/history/core/browser/top_sites_cache.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 | 9 |
| 10 namespace history { | 10 namespace history { |
| 11 | 11 |
| 12 TopSitesCache::CanonicalURLQuery::CanonicalURLQuery(const GURL& url) { | 12 TopSitesCache::CanonicalURLQuery::CanonicalURLQuery(const GURL& url) { |
| 13 most_visited_url_.redirects.push_back(url); | 13 most_visited_url_.redirects.push_back(url); |
| 14 entry_.first = &most_visited_url_; | 14 entry_.first = &most_visited_url_; |
| 15 entry_.second = 0u; | 15 entry_.second = 0u; |
| 16 } | 16 } |
| 17 | 17 |
| 18 TopSitesCache::CanonicalURLQuery::~CanonicalURLQuery() { | 18 TopSitesCache::CanonicalURLQuery::~CanonicalURLQuery() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 TopSitesCache::TopSitesCache() { | 21 TopSitesCache::TopSitesCache() : num_forced_urls_(0) { |
| 22 clear_query_ref_.ClearQuery(); | 22 clear_query_ref_.ClearQuery(); |
| 23 clear_query_ref_.ClearRef(); | 23 clear_query_ref_.ClearRef(); |
| 24 clear_path_query_ref_.ClearQuery(); | 24 clear_path_query_ref_.ClearQuery(); |
| 25 clear_path_query_ref_.ClearRef(); | 25 clear_path_query_ref_.ClearRef(); |
| 26 clear_path_query_ref_.ClearPath(); | 26 clear_path_query_ref_.ClearPath(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 TopSitesCache::~TopSitesCache() { | 29 TopSitesCache::~TopSitesCache() { |
| 30 } | 30 } |
| 31 | 31 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 return canonical_urls_.find(CanonicalURLQuery(url).entry()); | 173 return canonical_urls_.find(CanonicalURLQuery(url).entry()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 const GURL& TopSitesCache::GetURLFromIterator( | 176 const GURL& TopSitesCache::GetURLFromIterator( |
| 177 CanonicalURLs::const_iterator it) const { | 177 CanonicalURLs::const_iterator it) const { |
| 178 DCHECK(it != canonical_urls_.end()); | 178 DCHECK(it != canonical_urls_.end()); |
| 179 return it->first.first->redirects[it->first.second]; | 179 return it->first.first->redirects[it->first.second]; |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace history | 182 } // namespace history |
| OLD | NEW |