blob: 493b446edf66c614d526bf0ed8c65911c322c175 [file] [log] [blame]
// Copyright 2020 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 subresource_redirect.mojom;
import "mojo/public/mojom/base/time.mojom";
// Image loading hints passed by the browser to renderers. Send at most once
// per page load from browser to renderer. The hints are provided to the
// renderer and aid in redirecting these public images to compressed versions.
struct CompressPublicImagesHints {
array<string> image_urls;
};
// This service is implemented in the browser process and is used by the
// renderer to notify the state of https image compression. This interface is
// associated with a frame.
interface SubresourceRedirectService {
// Notifies an image fetch from the compression server had failed. When
// Retry-After response header is present |retry_after| indicates the time
// after which subsequent image fetches should be initiated, otherwise
// |retry_after| is zero.
NotifyCompressedImageFetchFailed(mojo_base.mojom.TimeDelta retry_after);
};
// Render process implemented interface that receives hints from the browser
// about https image compression.
interface SubresourceRedirectHintsReceiver {
// Sends the public image URL hints from the browser to renderers.
SetCompressPublicImagesHints(CompressPublicImagesHints images_hints);
};