chromium/chrome/browser/media/media_engagement_score_details.mojom

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module media.mojom;

import "url/mojom/origin.mojom";

struct MediaEngagementScoreDetails {
  url.mojom.Origin origin;
  double total_score;

  // Details of the components which make up |score|.
  int32 visits;
  int32 media_playbacks;

  // Last media playback time in milliseconds since the epoch format.
  double last_media_playback_time;

  // Whether the score is considered to be high.
  bool is_high;
};

struct MediaEngagementConfig {
  // Origins with a number of visits less than this number will receive
  // a score of zero.
  int32 score_min_visits;

  // The upper and lower threshold of whether the total score is considered
  // to be high.
  double high_score_lower_threshold;
  double high_score_upper_threshold;

  // The state of different internal autoplay features and flags.
  bool feature_record_data;
  bool feature_bypass_autoplay;
  bool feature_preload_data;
  bool feature_https_only;
  bool feature_autoplay_disable_settings;
  bool pref_disable_unified_autoplay;
  bool has_custom_autoplay_policy;
  string autoplay_policy;

  // The current version of any preloaded component.
  string preload_version;
};

interface MediaEngagementScoreDetailsProvider {
  GetMediaEngagementScoreDetails() => (array<MediaEngagementScoreDetails> info);
  GetMediaEngagementConfig() => (MediaEngagementConfig config);
};