chromium/third_party/blink/public/mojom/manifest/manifest_manager.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 blink.mojom;

import "third_party/blink/public/mojom/manifest/manifest.mojom";
import "url/mojom/url.mojom";

// Interface implemented in the renderer, associated with a specific frame,
// that is used by the browser process to request the manifest and manifest
// url from a document.
interface ManifestManager {
  // Requests the manifest URL and the Manifest of the frame's document. `url`
  // will be empty if the document specifies no manifest. `manifest` can be
  // empty if `result` is `kUnexpectedFailure`. Note that `manifest` may be the
  // 'default' manifest if none was specified by the document or if the one
  // specified by the document failed to load or parse.
  RequestManifest()
      => (ManifestRequestResult result, url.mojom.Url url, Manifest manifest);

  // Requests the manifest URL and the debug info for Manifest of the frame's
  // document. |url| will be empty if the document specifies no manifest.
  //
  // This method is temporary until all clients are migrated from
  // content/renderer into blink.
  RequestManifestDebugInfo() => (url.mojom.Url url,
                                 Manifest parsed_manifest,
                                 ManifestDebugInfo debug_info);

  // Parses the given |manifest_content| JSON string. |manifest_url| is the URL
  // that the manifest content was fetched from, and |document_url| is the URL
  // of a document which contained a link to the manifest. Returns a null
  // Manifest if parsing fails.
  ParseManifestFromString(url.mojom.Url document_url,
                          url.mojom.Url manifest_url,
                          string manifest_content)
      => (Manifest? parsed_manifest);
};