Skip to content

Commit

Permalink
[116][VQS] Update service to register on browser context start.
Browse files Browse the repository at this point in the history
This ensures the VQS opt target is registered as start up and included
in the opt guide model fetch to maximize model availability. Otherwise,
the VQS model likely won't get downloaded except for really long
sessions.

(cherry picked from commit fad6e21)

Bug: 1458294
Change-Id: I112a6ca2a050d8c6cd7356b3aff4eb4396c01366
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4649131
Quick-Run: Pierre St Juste <pstjuste@google.com>
Auto-Submit: Michael Crouse <mcrouse@chromium.org>
Reviewed-by: Ali Stanfield <stanfield@google.com>
Commit-Queue: Ali Stanfield <stanfield@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1163079}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4654287
Reviewed-by: Juan Mojica <juanmojica@google.com>
Cr-Commit-Position: refs/branch-heads/5845@{#273}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
mcrouse-chrome authored and Chromium LUCI CQ committed Jun 30, 2023
1 parent d5b7ead commit e008449
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@ KeyedService* VisualSearchSuggestionsServiceFactory::BuildServiceInstanceFor(
return nullptr;
}

bool VisualSearchSuggestionsServiceFactory::ServiceIsCreatedWithBrowserContext()
const {
return base::FeatureList::IsEnabled(
visual_search::features::kVisualSearchSuggestions);
}

bool VisualSearchSuggestionsServiceFactory::ServiceIsNULLWhileTesting() const {
return true;
}

} // namespace companion::visual_search
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ class VisualSearchSuggestionsServiceFactory
VisualSearchSuggestionsServiceFactory();

~VisualSearchSuggestionsServiceFactory() override = default;
// BrowserContextKeyedServiceFactory:

// BrowserContextKeyedServiceFactory:
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
bool ServiceIsCreatedWithBrowserContext() const override;
bool ServiceIsNULLWhileTesting() const override;
};

} // namespace companion::visual_search
Expand Down

0 comments on commit e008449

Please sign in to comment.