DescriptionRemove unnecessary overrides and test
SuggestionsServiceFactory::GetForProfile() returns nullptr if
Profile::IsOffTheRecord() is true. So when another factory or
client code use the helper method to get the service, it gets
a nullptr.
The SuggestionsServiceFactory::GetBrowserContextToUse() test
happens only in the GetServiceForBrowserContext() call, and
thus does not happens when client code use this helper method.
The only situation where GetBrowserContextToUse() could be
called is if code directly call GetServiceForBrowserContext
or if ServiceIsCreatedWithBrowserContext() were overridden
to returns true.
Since none of those two conditions are true, then the method
is never called with an off-the-record Profile and the default
implementation inherited from BrowserContextKeyedServiceFactory
does the right thing (i.e. returns nullptr, which in turn cause
GetServiceForBrowserContext to return nullptr).
BUG=None
Committed: https://crrev.com/512e25f331e03b33c60d9e9ec6fcb9f42761985e
Cr-Commit-Position: refs/heads/master@{#305059}
Patch Set 1 #
Messages
Total messages: 7 (2 generated)
|