blob: ce9038444157af03e465b9c01b43ad26bc995f4f [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module previews.mojom;
import "mojo/public/mojom/base/time.mojom";
import "third_party/blink/public/mojom/optimization_guide/optimization_guide.mojom";
// LiteVideo hints passed by the browser to renderers. Send at most once
// per render frame from browser to renderer. The hints are provided to the
// renderer and aid in optimizing media data use.
struct LiteVideoHint {
// The number of kilobytes for media to be observed before starting to
// throttle requests.
int64 kilobytes_to_buffer_before_throttle;
// The network downlink bandwidth target in kilobytes per second used to
// calculate the throttling delay on media requests.
int64 target_downlink_bandwidth_kbps;
// The network downlink rtt target in milliseconds used to calculate the
// throttling delay on media requests.
mojo_base.mojom.TimeDelta target_downlink_rtt_latency;
// The maximum delay a throttle can introduce for a media request.
mojo_base.mojom.TimeDelta max_throttling_delay;
};
// Render process implemented interface that receives hints from the browser
// about how to load resources.
interface PreviewsResourceLoadingHintsReceiver {
// Sends the hints for reducing the data-costs of streaming
// media/videos from the browser to renderers.
SetLiteVideoHint(LiteVideoHint lite_video_hint);
// Sends the hints for Blink.
// TODO(https://crbug.com/1113980): Move this to its own mojo plumbing.
SetBlinkOptimizationGuideHints(blink.mojom.BlinkOptimizationGuideHints hints);
// Notifies the renderers that active media request throttles should be stopped
// and not allow any new throttles.
StopThrottlingMediaRequests();
};