optimization_hints_component_observer.h 1.0 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright 2017 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_OPTIMIZATION_GUIDE_CORE_OPTIMIZATION_HINTS_COMPONENT_OBSERVER_H_
  5. #define COMPONENTS_OPTIMIZATION_GUIDE_CORE_OPTIMIZATION_HINTS_COMPONENT_OBSERVER_H_
  6. namespace optimization_guide {
  7. struct HintsComponentInfo;
  8. // Interface for objects that wish to be notified of changes to the Optimization
  9. // Hints Component.
  10. //
  11. // All calls will be made on the UI thread.
  12. class OptimizationHintsComponentObserver {
  13. public:
  14. // Called when a new hints component is available for processing. While this
  15. // is called on the UI thread, it is recommended that processing of the new
  16. // component occur on a background thread.
  17. virtual void OnHintsComponentAvailable(const HintsComponentInfo& info) = 0;
  18. protected:
  19. virtual ~OptimizationHintsComponentObserver() = default;
  20. };
  21. } // namespace optimization_guide
  22. #endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_OPTIMIZATION_HINTS_COMPONENT_OBSERVER_H_