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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor.cc

Issue 10831103: Removing usage of profile_->GetHistory() from the codebase in order to remove that function. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/predictors/resource_prefetch_predictor.cc
===================================================================
--- chrome/browser/predictors/resource_prefetch_predictor.cc (revision 149452)
+++ chrome/browser/predictors/resource_prefetch_predictor.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/time.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_notifications.h"
+#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/in_memory_database.h"
#include "chrome/browser/history/url_database.h"
#include "chrome/browser/predictors/predictor_database.h"
@@ -127,8 +128,8 @@
// Request the in-memory database from the history to force it to load so it's
// available as soon as possible.
- HistoryService* history_service =
- profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ HistoryService* history_service = HistoryServiceFactory::GetForProfile(
+ profile_, Profile::EXPLICIT_ACCESS);
if (history_service)
history_service->InMemoryDatabase();
@@ -167,7 +168,9 @@
}
// Add notifications for history loading if it is not ready.
- if (!profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)) {
+ HistoryService* history_service = HistoryServiceFactory::GetForProfile(
+ profile_, Profile::EXPLICIT_ACCESS);
+ if (!history_service) {
notification_registrar_.Add(this, chrome::NOTIFICATION_HISTORY_LOADED,
content::Source<Profile>(profile_));
} else {
@@ -462,8 +465,8 @@
DCHECK_EQ(initialization_state_, INITIALIZING);
// Update the data with last visit info from in memory history db.
- HistoryService* history_service =
- profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ HistoryService* history_service = HistoryServiceFactory::GetForProfile(
+ profile_, Profile::EXPLICIT_ACCESS);
DCHECK(history_service);
history::URLDatabase* url_db = history_service->InMemoryDatabase();
if (url_db) {
@@ -506,8 +509,8 @@
if (url_table_cache_.find(url) != url_table_cache_.end())
return true;
- HistoryService* history_service =
- profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ HistoryService* history_service = HistoryServiceFactory::GetForProfile(
+ profile_, Profile::EXPLICIT_ACCESS);
DCHECK(history_service);
history::URLDatabase* url_db = history_service->InMemoryDatabase();
if (!url_db)

Powered by Google App Engine
This is Rietveld 408576698