aw_component_metrics_provider_delegate.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2021 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 ANDROID_WEBVIEW_BROWSER_METRICS_AW_COMPONENT_METRICS_PROVIDER_DELEGATE_H_
  5. #define ANDROID_WEBVIEW_BROWSER_METRICS_AW_COMPONENT_METRICS_PROVIDER_DELEGATE_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "components/metrics/component_metrics_provider.h"
  8. namespace component_updater {
  9. struct ComponentInfo;
  10. } // namespace component_updater
  11. namespace android_webview {
  12. class AwMetricsServiceClient;
  13. // WebView delegate to provide WebView's own list of loaded components to be
  14. // recorded in the system profile UMA log. Unlike chrome, WebView doesn't use
  15. // `component_updater::ComponentUpdateService` to load or keep track of
  16. // components.
  17. class AwComponentMetricsProviderDelegate
  18. : public metrics::ComponentMetricsProviderDelegate {
  19. public:
  20. explicit AwComponentMetricsProviderDelegate(AwMetricsServiceClient* client);
  21. ~AwComponentMetricsProviderDelegate() override = default;
  22. // ComponentsInfoProvider:
  23. std::vector<component_updater::ComponentInfo> GetComponents() override;
  24. private:
  25. raw_ptr<AwMetricsServiceClient> client_;
  26. };
  27. } // namespace android_webview
  28. #endif // ANDROID_WEBVIEW_BROWSER_METRICS_AW_COMPONENT_METRICS_PROVIDER_DELEGATE_H_