chromium/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_response_reader.h

// 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.

#ifndef CHROME_BROWSER_WEB_APPLICATIONS_ISOLATED_WEB_APPS_ISOLATED_WEB_APP_RESPONSE_READER_H_
#define CHROME_BROWSER_WEB_APPLICATIONS_ISOLATED_WEB_APPS_ISOLATED_WEB_APP_RESPONSE_READER_H_

#include <memory>

#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/types/expected.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h"
#include "chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_reader.h"
#include "components/web_package/mojom/web_bundle_parser.mojom-forward.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_integrity_block.h"

namespace network {
struct ResourceRequest;
}

namespace web_app {

// The definition of the interface that is used to read responses for requests
// from Isolated Web Apps. Usually, the implementations of this interface
// should be constructed via the `IsolatedWebAppResponseReaderFactory`, which
// will take care of the necessary validation and verification steps.
class IsolatedWebAppResponseReader {};

// The implementation of the IWA response reader. It is constructed from
// a `SignedWebBundleReader` instance, which must have already
// read and validated integrity block and metadata.
class IsolatedWebAppResponseReaderImpl : public IsolatedWebAppResponseReader {};

}  // namespace web_app

#endif  // CHROME_BROWSER_WEB_APPLICATIONS_ISOLATED_WEB_APPS_ISOLATED_WEB_APP_RESPONSE_READER_H_