chromium/third_party/blink/public/mojom/interest_group/ad_display_size.mojom

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

module blink.mojom;

import "url/mojom/url.mojom";

// The dimensions that an ad for an interest group can be. Note that an interest
// group can have more than one `InterestGroupSize` associated with it.
struct AdSize {
  //  This is stable because it is persisted to storage.
  [Stable, Extensible]
  enum LengthUnit {
    [Default] kInvalid,
    kPixels,
    kScreenWidth,
    kScreenHeight,
  };
  // Must be valid dimensions (ex. 100px, 50sw)
  double width;
  LengthUnit width_units;
  double height;
  LengthUnit height_units;
};

// Url with optional size specifications.
struct AdDescriptor {
  url.mojom.Url url;
  AdSize? size;
};