Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: components/history/core/browser/top_sites_cache.cc

Issue 1809603005: Create a --disable-top-sites flag for use by telemetry tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move flag check to factory Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/history/top_sites_factory.cc ('k') | components/ntp_tiles/most_visited_sites.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites_factory.cc ('k') | components/ntp_tiles/most_visited_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698