#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_downloader.h"
#include <memory>
#include <optional>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/thread_pool.h"
#include "net/base/net_errors.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "url/gurl.h"
namespace web_app {
void ScopedTempWebBundleFile::Create(
base::OnceCallback<void(ScopedTempWebBundleFile)> callback) { … }
ScopedTempWebBundleFile::ScopedTempWebBundleFile(
std::unique_ptr<base::ScopedTempFile> file)
: … { … }
ScopedTempWebBundleFile::~ScopedTempWebBundleFile() { … }
ScopedTempWebBundleFile& ScopedTempWebBundleFile::operator=(
ScopedTempWebBundleFile&&) = default;
ScopedTempWebBundleFile::ScopedTempWebBundleFile(ScopedTempWebBundleFile&&) =
default;
const base::FilePath& ScopedTempWebBundleFile::path() const { … }
std::unique_ptr<IsolatedWebAppDownloader>
IsolatedWebAppDownloader::CreateAndStartDownloading(
GURL url,
base::FilePath destination,
net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
IsolatedWebAppDownloader::DownloadCallback download_callback) { … }
IsolatedWebAppDownloader::IsolatedWebAppDownloader(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
: … { … }
IsolatedWebAppDownloader::~IsolatedWebAppDownloader() = default;
void IsolatedWebAppDownloader::DownloadSignedWebBundle(
GURL url,
base::FilePath destination,
net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation,
DownloadCallback download_callback) { … }
int32_t IsolatedWebAppDownloader::OnSignedWebBundleDownloaded(
base::FilePath destination,
base::FilePath actual_destination) { … }
}