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

Issue 744033002: Remove unnecessary overrides and test (Closed)

Created:
6 years, 1 month ago by sdefresne
Modified:
6 years, 1 month ago
Reviewers:
Mathieu
CC:
chromium-reviews, skanuj+watch_chromium.org, melevin+watch_chromium.org, dhollowa+watch_chromium.org, dougw+watch_chromium.org, donnd+watch_chromium.org, jfweitz+watch_chromium.org, David Black, samarth+watch_chromium.org, kmadhusu+watch_chromium.org, Jered
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Remove 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+0 lines, -10 lines) Patch
M chrome/browser/search/suggestions/suggestions_service_factory.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/search/suggestions/suggestions_service_factory.cc View 2 chunks +0 lines, -8 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
sdefresne
This CL does not change functionality as BrowserContextKeyedServiceFactory::GetBrowserContextToUse returns nullptr by default when Profile::IsOffTheRecord is ...
6 years, 1 month ago (2014-11-20 14:19:59 UTC) #2
Mathieu
Makes sense, lgtm
6 years, 1 month ago (2014-11-20 17:19:12 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/744033002/1
6 years, 1 month ago (2014-11-20 17:23:38 UTC) #5
commit-bot: I haz the power
Committed patchset #1 (id:1)
6 years, 1 month ago (2014-11-20 19:18:45 UTC) #6
commit-bot: I haz the power
6 years, 1 month ago (2014-11-20 19:19:13 UTC) #7
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/512e25f331e03b33c60d9e9ec6fcb9f42761985e
Cr-Commit-Position: refs/heads/master@{#305059}

Powered by Google App Engine
This is Rietveld 408576698