input_context.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_INPUT_CONTEXT_H_
  5. #define COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_INPUT_CONTEXT_H_
  6. #include "base/containers/flat_map.h"
  7. #include "base/memory/scoped_refptr.h"
  8. #include "base/memory/weak_ptr.h"
  9. #include "components/segmentation_platform/public/trigger_context.h"
  10. #include "components/segmentation_platform/public/types/processed_value.h"
  11. namespace segmentation_platform {
  12. // Input provided for segment selection, based on the current state of the
  13. // browser.
  14. struct InputContext : base::RefCounted<InputContext> {
  15. public:
  16. InputContext();
  17. explicit InputContext(const TriggerContext& trigger_context);
  18. InputContext(InputContext&) = delete;
  19. InputContext& operator=(InputContext&) = delete;
  20. // A list of params that can be used as input either directly to the model, or
  21. // to SQL queries, or custom input delegates. The exact mechanism and
  22. // semantics is still under construction.
  23. base::flat_map<std::string, processing::ProcessedValue> metadata_args;
  24. private:
  25. friend class RefCounted<InputContext>;
  26. ~InputContext();
  27. };
  28. } // namespace segmentation_platform
  29. #endif // COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_INPUT_CONTEXT_H_