Commit bc3511fe authored by sauski's avatar sauski Committed by Commit Bot

Access Context Auditing: Move feature flag guard in service factory

Adjusts the placement of the Access Context Auditing feature flag guard
in the service factory to prevent erroneous instantiation of the service.

Bug: 1083384
Change-Id: I93872191a59e6a48be06044ec71b0d403a3738d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2249960Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Commit-Queue: Theodore Olsauskas-Warren <sauski@google.com>
Cr-Commit-Position: refs/heads/master@{#779371}
parent 2439759c
......@@ -23,17 +23,17 @@ AccessContextAuditServiceFactory::GetInstance() {
AccessContextAuditService* AccessContextAuditServiceFactory::GetForProfile(
Profile* profile) {
if (profile->IsOffTheRecord() ||
!base::FeatureList::IsEnabled(
features::kClientStorageAccessContextAuditing))
return nullptr;
return static_cast<AccessContextAuditService*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
KeyedService* AccessContextAuditServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
if (context->IsOffTheRecord() ||
!base::FeatureList::IsEnabled(
features::kClientStorageAccessContextAuditing))
return nullptr;
std::unique_ptr<AccessContextAuditService> context_audit_service(
new AccessContextAuditService());
if (!context_audit_service->Init(
......
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