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

Unified Diff: chrome/browser/download/download_history.cc

Issue 10605003: Fixing some more instances where I put in HistoryServiceFactory::GetForProfile which will force cre… (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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_history.cc
===================================================================
--- chrome/browser/download/download_history.cc (revision 147024)
+++ chrome/browser/download/download_history.cc (working copy)
@@ -25,8 +25,8 @@
void DownloadHistory::GetNextId(
const HistoryService::DownloadNextIdCallback& callback) {
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (!hs)
return;
@@ -35,8 +35,8 @@
void DownloadHistory::Load(
const HistoryService::DownloadQueryCallback& callback) {
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (!hs)
return;
@@ -51,9 +51,8 @@
const GURL& referrer_url,
const VisitedBeforeDoneCallback& callback) {
if (referrer_url.is_valid()) {
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_,
- Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
HistoryService::Handle handle =
hs->GetVisibleVisitCountToHost(referrer_url, &history_consumer_,
@@ -79,8 +78,8 @@
// handles, so we use a negative value. Eventually, they could overlap, but
// you'd have to do enough downloading that your ISP would likely stab you in
// the neck first. YMMV.
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (download_item->IsOtr() ||
download_crx_util::IsExtensionDownload(*download_item) ||
download_item->IsTemporary() || !hs) {
@@ -100,8 +99,8 @@
if (download_item->GetDbHandle() <= DownloadItem::kUninitializedHandle)
return;
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (!hs)
return;
hs->UpdateDownload(download_item->GetPersistentStoreInfo());
@@ -113,8 +112,8 @@
if (download_item->GetDbHandle() <= DownloadItem::kUninitializedHandle)
return;
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs)
hs->UpdateDownloadPath(new_path, download_item->GetDbHandle());
}
@@ -124,16 +123,16 @@
if (download_item->GetDbHandle() <= DownloadItem::kUninitializedHandle)
return;
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs)
hs->RemoveDownload(download_item->GetDbHandle());
}
void DownloadHistory::RemoveEntriesBetween(const base::Time remove_begin,
const base::Time remove_end) {
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs)
hs->RemoveDownloadsBetween(remove_begin, remove_end);
}
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698