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

Side by Side Diff: chrome/browser/history/top_sites.cc

Issue 9958134: Adds some debugging code to verify the dictionaries are non-null at (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 "chrome/browser/history/top_sites.h" 5 #include "chrome/browser/history/top_sites.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 prefs::kNtpMostVisitedURLsBlacklist).Get(); 163 prefs::kNtpMostVisitedURLsBlacklist).Get();
164 DictionaryPrefUpdate(profile_->GetPrefs(), 164 DictionaryPrefUpdate(profile_->GetPrefs(),
165 prefs::kNtpMostVisitedPinnedURLs).Get(); 165 prefs::kNtpMostVisitedPinnedURLs).Get();
166 166
167 // Now the dictionaries are guaranteed to exist and we can cache pointers 167 // Now the dictionaries are guaranteed to exist and we can cache pointers
168 // to them. 168 // to them.
169 blacklist_ = 169 blacklist_ =
170 profile_->GetPrefs()->GetDictionary(prefs::kNtpMostVisitedURLsBlacklist); 170 profile_->GetPrefs()->GetDictionary(prefs::kNtpMostVisitedURLsBlacklist);
171 pinned_urls_ = 171 pinned_urls_ =
172 profile_->GetPrefs()->GetDictionary(prefs::kNtpMostVisitedPinnedURLs); 172 profile_->GetPrefs()->GetDictionary(prefs::kNtpMostVisitedPinnedURLs);
173 DCHECK(blacklist_ != NULL); 173 CHECK(blacklist_ != NULL);
174 DCHECK(pinned_urls_ != NULL); 174 CHECK(pinned_urls_ != NULL);
175 } 175 }
176 176
177 void TopSites::Init(const FilePath& db_name) { 177 void TopSites::Init(const FilePath& db_name) {
178 // Create the backend here, rather than in the constructor, so that 178 // Create the backend here, rather than in the constructor, so that
179 // unit tests that do not need the backend can run without a problem. 179 // unit tests that do not need the backend can run without a problem.
180 backend_ = new TopSitesBackend; 180 backend_ = new TopSitesBackend;
181 backend_->Init(db_name); 181 backend_->Init(db_name);
182 backend_->GetMostVisitedThumbnails( 182 backend_->GetMostVisitedThumbnails(
183 &top_sites_consumer_, 183 &top_sites_consumer_,
184 base::Bind(&TopSites::OnGotMostVisitedThumbnails, 184 base::Bind(&TopSites::OnGotMostVisitedThumbnails,
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 SetTopSites(pages); 1037 SetTopSites(pages);
1038 1038
1039 // Used only in testing. 1039 // Used only in testing.
1040 content::NotificationService::current()->Notify( 1040 content::NotificationService::current()->Notify(
1041 chrome::NOTIFICATION_TOP_SITES_UPDATED, 1041 chrome::NOTIFICATION_TOP_SITES_UPDATED,
1042 content::Source<TopSites>(this), 1042 content::Source<TopSites>(this),
1043 content::Details<CancelableRequestProvider::Handle>(&handle)); 1043 content::Details<CancelableRequestProvider::Handle>(&handle));
1044 } 1044 }
1045 1045
1046 } // namespace history 1046 } // namespace history
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698