Chromium Code Reviews| 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, |