Commit 47ffe9c3 authored by Martin Sramek's avatar Martin Sramek Committed by Commit Bot

Remove the early initialization of UserEventService.

This was added in M66 as it was needed by ConsentAuditor.

After an in-memory queue was added to UserEventService in
https://chromium-review.googlesource.com/c/chromium/src/+/980975, it can
handle events before the initialization of the persistent storage
is finished, thus obsoleting the early initialization.

Bug: 819296
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ieca1cf50cb02ebf9e9336c0be755eb89b5b1de16
Reviewed-on: https://chromium-review.googlesource.com/999052Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Martin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548745}
parent eab92780
......@@ -56,7 +56,6 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/signin_util.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/user_event_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
......@@ -1335,21 +1334,6 @@ void ProfileManager::DoFinalInitForServices(Profile* profile,
// Generates notifications from the above, if experiment is enabled.
ContentSuggestionsNotifierServiceFactory::GetForProfile(profile);
#endif
// TODO(crbug.com/709094, crbug.com/761485): UserEventServiceFactory
// initializes asynchronously, but it needs to be ready to receive user
// events in order for ConsentAuditor to record consents when the user
// signs in, which means that it needs to be initialized early enough in
// the Profile lifetime.
//
// This early initialization can be removed once the linked bugs are fixed
// and UserEventService is able to initialize synchronously.
//
// Note also that this code is technically not necessary, as UserEventService
// already happens to be initialized early in practice through other
// components that use it, but ConsentAuditor should not depend on that.
if (!go_off_the_record)
browser_sync::UserEventServiceFactory::GetForProfile(profile);
}
void ProfileManager::DoFinalInitLogging(Profile* profile) {
......
......@@ -40,7 +40,6 @@
#include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h"
#include "ios/chrome/browser/signin/signin_manager_factory.h"
#include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h"
#include "ios/chrome/browser/sync/ios_user_event_service_factory.h"
namespace {
......@@ -224,10 +223,6 @@ void ChromeBrowserStateManagerImpl::DoFinalInitForServices(
->SetupInvalidationsOnProfileLoad(invalidation_service);
ios::AccountReconcilorFactory::GetForBrowserState(browser_state);
DesktopPromotionSyncServiceFactory::GetForBrowserState(browser_state);
// TODO(crbug.com/709094), TODO(crbug.com/761485): Remove this following line
// when UserEventService will be initialized synchronously. Until then, the
// service has to be created as early as possible.
IOSUserEventServiceFactory::GetForBrowserState(browser_state);
}
void ChromeBrowserStateManagerImpl::AddBrowserStateToCache(
......
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