| Index: components/sync/user_events/user_event_service_impl.cc
|
| diff --git a/components/sync/user_events/user_event_service.cc b/components/sync/user_events/user_event_service_impl.cc
|
| similarity index 67%
|
| copy from components/sync/user_events/user_event_service.cc
|
| copy to components/sync/user_events/user_event_service_impl.cc
|
| index 7a7e0b8cc58de5981de20c4ac054e3ff14475d9c..b5162411b799f40fa367b71af14e99eb5cb4e058 100644
|
| --- a/components/sync/user_events/user_event_service.cc
|
| +++ b/components/sync/user_events/user_event_service_impl.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "components/sync/user_events/user_event_service.h"
|
| +#include "components/sync/user_events/user_event_service_impl.h"
|
|
|
| #include <utility>
|
|
|
| @@ -19,36 +19,39 @@ using sync_pb::UserEventSpecifics;
|
|
|
| namespace syncer {
|
|
|
| -UserEventService::UserEventService(SyncService* sync_service,
|
| - std::unique_ptr<UserEventSyncBridge> bridge)
|
| +UserEventServiceImpl::UserEventServiceImpl(
|
| + SyncService* sync_service,
|
| + std::unique_ptr<UserEventSyncBridge> bridge)
|
| : sync_service_(sync_service),
|
| bridge_(std::move(bridge)),
|
| session_id_(base::RandUint64()) {
|
| // TODO(skym): Subscribe to events about field trial membership changing.
|
| }
|
|
|
| -UserEventService::~UserEventService() {}
|
| +UserEventServiceImpl::~UserEventServiceImpl() {}
|
|
|
| -void UserEventService::Shutdown() {}
|
| +void UserEventServiceImpl::Shutdown() {}
|
|
|
| -void UserEventService::RecordUserEvent(
|
| +void UserEventServiceImpl::RecordUserEvent(
|
| std::unique_ptr<UserEventSpecifics> specifics) {
|
| - if (CanRecordEvent(*specifics)) {
|
| + if (ShouldRecordEvent(*specifics)) {
|
| DCHECK(!specifics->has_session_id());
|
| specifics->set_session_id(session_id_);
|
| bridge_->RecordUserEvent(std::move(specifics));
|
| }
|
| }
|
|
|
| -void UserEventService::RecordUserEvent(const UserEventSpecifics& specifics) {
|
| +void UserEventServiceImpl::RecordUserEvent(
|
| + const UserEventSpecifics& specifics) {
|
| RecordUserEvent(base::MakeUnique<UserEventSpecifics>(specifics));
|
| }
|
|
|
| -base::WeakPtr<ModelTypeSyncBridge> UserEventService::GetSyncBridge() {
|
| +base::WeakPtr<ModelTypeSyncBridge> UserEventServiceImpl::GetSyncBridge() {
|
| return bridge_->AsWeakPtr();
|
| }
|
|
|
| -bool UserEventService::CanRecordEvent(const UserEventSpecifics& specifics) {
|
| +bool UserEventServiceImpl::ShouldRecordEvent(
|
| + const UserEventSpecifics& specifics) {
|
| // We only record events if the user is syncing history and has not enabled
|
| // a custom passphrase. The type HISTORY_DELETE_DIRECTIVES is enabled in and
|
| // only in this exact scenario.
|
| @@ -57,8 +60,9 @@ bool UserEventService::CanRecordEvent(const UserEventSpecifics& specifics) {
|
| sync_service_->GetPreferredDataTypes().Has(HISTORY_DELETE_DIRECTIVES);
|
| }
|
|
|
| -void RegisterDependentFieldTrial(const std::string& trial_name,
|
| - UserEventSpecifics::EventCase event_case) {
|
| +void UserEventServiceImpl::RegisterDependentFieldTrial(
|
| + const std::string& trial_name,
|
| + UserEventSpecifics::EventCase event_case) {
|
| // TODO(skym): Implementation.
|
| }
|
|
|
|
|