123456789101112131415161718192021222324252627282930 |
- // Copyright 2022 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #include "components/segmentation_platform/public/input_delegate.h"
- namespace segmentation_platform::processing {
- InputDelegate::InputDelegate() = default;
- InputDelegate::~InputDelegate() = default;
- InputDelegateHolder::InputDelegateHolder() = default;
- InputDelegateHolder::~InputDelegateHolder() = default;
- InputDelegate* InputDelegateHolder::GetDelegate(
- proto::CustomInput::FillPolicy policy) {
- auto it = input_delegates_.find(policy);
- if (it != input_delegates_.end()) {
- return it->second.get();
- }
- return nullptr;
- }
- void InputDelegateHolder::SetDelegate(proto::CustomInput::FillPolicy policy,
- std::unique_ptr<InputDelegate> delegate) {
- DCHECK(!input_delegates_.count(policy));
- input_delegates_[policy] = std::move(delegate);
- }
- } // namespace segmentation_platform::processing
|