Commit 202353cc authored by Quentin Fiard's avatar Quentin Fiard Committed by Commit Bot

Fix https://bugs.chromium.org/p/chromium/issues/detail?id=872922

I'll request a merge into M69 when this is in so we can restart experiments quickly.

Bug: 872922
Change-Id: Icb269a5f6499a5a58a2a51f3348b23e15f20c035
Reviewed-on: https://chromium-review.googlesource.com/1183912
Commit-Queue: Quentin Fiard <qfiard@google.com>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585347}
parent 2abbe360
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/google/google_search_domain_mixing_metrics_emitter.h" #include "chrome/browser/google/google_search_domain_mixing_metrics_emitter.h"
#include "base/logging.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "components/history/core/browser/domain_mixing_metrics.h" #include "components/history/core/browser/domain_mixing_metrics.h"
#include "components/history/core/browser/history_backend.h" #include "components/history/core/browser/history_backend.h"
...@@ -52,7 +53,9 @@ GoogleSearchDomainMixingMetricsEmitter::GoogleSearchDomainMixingMetricsEmitter( ...@@ -52,7 +53,9 @@ GoogleSearchDomainMixingMetricsEmitter::GoogleSearchDomainMixingMetricsEmitter(
: prefs_(prefs), : prefs_(prefs),
history_service_(history_service), history_service_(history_service),
ui_thread_task_runner_(content::BrowserThread::GetTaskRunnerForThread( ui_thread_task_runner_(content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI)) {} content::BrowserThread::UI)) {
DCHECK(history_service_);
}
GoogleSearchDomainMixingMetricsEmitter:: GoogleSearchDomainMixingMetricsEmitter::
~GoogleSearchDomainMixingMetricsEmitter() {} ~GoogleSearchDomainMixingMetricsEmitter() {}
......
...@@ -43,9 +43,12 @@ KeyedService* ...@@ -43,9 +43,12 @@ KeyedService*
GoogleSearchDomainMixingMetricsEmitterFactory::BuildServiceInstanceFor( GoogleSearchDomainMixingMetricsEmitterFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const { content::BrowserContext* context) const {
Profile* profile = Profile::FromBrowserContext(context); Profile* profile = Profile::FromBrowserContext(context);
auto* history_service = HistoryServiceFactory::GetInstance()->GetForProfile(
profile, ServiceAccessType::IMPLICIT_ACCESS);
if (history_service == nullptr)
return nullptr;
auto emitter = std::make_unique<GoogleSearchDomainMixingMetricsEmitter>( auto emitter = std::make_unique<GoogleSearchDomainMixingMetricsEmitter>(
profile->GetPrefs(), HistoryServiceFactory::GetInstance()->GetForProfile( profile->GetPrefs(), history_service);
profile, ServiceAccessType::IMPLICIT_ACCESS));
emitter->Start(); emitter->Start();
return emitter.release(); return emitter.release();
} }
......
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