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

Unified Diff: chrome/browser/history/android/android_history_provider_service.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, 6 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/history/android/android_history_provider_service.cc
===================================================================
--- chrome/browser/history/android/android_history_provider_service.cc (revision 143165)
+++ chrome/browser/history/android/android_history_provider_service.cc (working copy)
@@ -28,8 +28,8 @@
const QueryCallback& callback) {
QueryRequest* request = new QueryRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
sky 2012/06/21 17:14:31 I think you should leave all of these as they were
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::QueryHistoryAndBookmarks, NULL, request,
@@ -49,8 +49,8 @@
const UpdateCallback& callback) {
UpdateRequest* request = new UpdateRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::UpdateHistoryAndBookmarks, NULL, request, row,
@@ -69,8 +69,8 @@
const DeleteCallback& callback) {
DeleteRequest* request = new DeleteRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::DeleteHistoryAndBookmarks, NULL, request,
@@ -88,8 +88,8 @@
const InsertCallback& callback) {
InsertRequest* request = new InsertRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::InsertHistoryAndBookmark, NULL, request, values);
@@ -107,8 +107,8 @@
const DeleteCallback& callback) {
DeleteRequest* request = new DeleteRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::DeleteHistory, NULL, request, selection,
@@ -128,8 +128,8 @@
const MoveStatementCallback& callback) {
MoveStatementRequest* request = new MoveStatementRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::MoveStatement, NULL, request, statement,
@@ -142,8 +142,8 @@
void AndroidHistoryProviderService::CloseStatement(
history::AndroidStatement* statement) {
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->ScheduleAndForget(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::CloseStatement, statement);
@@ -159,8 +159,8 @@
const InsertCallback& callback) {
InsertRequest* request = new InsertRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::InsertSearchTerm, NULL, request, row);
@@ -179,8 +179,8 @@
const UpdateCallback& callback) {
UpdateRequest* request = new UpdateRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::UpdateSearchTerms, NULL, request, row, selection,
@@ -199,8 +199,8 @@
const DeleteCallback& callback) {
DeleteRequest* request = new DeleteRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::DeleteSearchTerms, NULL, request, selection,
@@ -221,8 +221,8 @@
const QueryCallback& callback) {
QueryRequest* request = new QueryRequest(callback);
AddRequest(request, consumer);
- HistoryService* hs =
- HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
+ HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
+ profile_, Profile::EXPLICIT_ACCESS);
if (hs) {
hs->Schedule(HistoryService::PRIORITY_NORMAL,
&HistoryBackend::QuerySearchTerms, NULL, request, projections,

Powered by Google App Engine
This is Rietveld 408576698