Commit f29a4397 authored by sdefresne's avatar sdefresne Committed by Commit bot

Remove obsolete code

ChromeHistoryClient is no longer a HistoryServiceObserver, so remove
the cleanup code that dealt with that.

Fix error path when HistoryService::Init() fails in TestingProfile by:
- not calling SetTestingFactoryAndUse() with a null testing factory
- returning false when HistoryService::Init() fails.

BUG=373326

Review URL: https://codereview.chromium.org/894783002

Cr-Commit-Position: refs/heads/master@{#314385}
parent 7103545f
......@@ -569,21 +569,15 @@ bool TestingProfile::CreateHistoryService(bool delete_file, bool no_db) {
this, BuildHistoryService));
if (!history_service->Init(
no_db, history::HistoryDatabaseParamsForPath(this->GetPath()))) {
HistoryServiceFactory::GetInstance()->SetTestingFactoryAndUse(this, NULL);
HistoryServiceFactory::GetInstance()->SetTestingFactory(this, nullptr);
return false;
}
// Disable WebHistoryService by default, since it makes network requests.
WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, NULL);
WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, nullptr);
return true;
}
void TestingProfile::DestroyHistoryService() {
// TODO(sdefresne): remove this once ChromeHistoryClient is no longer an
// HistoryServiceObserver, http://crbug.com/373326
ChromeHistoryClient* history_client =
ChromeHistoryClientFactory::GetForProfileWithoutCreating(this);
if (history_client)
history_client->Shutdown();
HistoryService* history_service =
HistoryServiceFactory::GetForProfileWithoutCreating(this);
if (!history_service)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment