#include "chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest_fetcher.h"
#include "base/functional/callback.h"
#include "base/json/json_reader.h"
#include "base/types/expected.h"
#include "chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.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 {
namespace {
constexpr size_t kMaxUpdateManifestLength = …;
}
UpdateManifestFetcher::UpdateManifestFetcher(
GURL url,
net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
: … { … }
UpdateManifestFetcher::~UpdateManifestFetcher() = default;
void UpdateManifestFetcher::FetchUpdateManifest(FetchCallback fetch_callback) { … }
void UpdateManifestFetcher::DownloadUpdateManifest() { … }
void UpdateManifestFetcher::OnUpdateManifestDownloaded(
std::unique_ptr<std::string> update_manifest_content) { … }
void UpdateManifestFetcher::ParseUpdateManifest(
const std::string& update_manifest_content) { … }
void UpdateManifestFetcher::InitializeJsonParser() { … }
void UpdateManifestFetcher::OnUpdateManifestParsed(
std::optional<base::Value> result,
const std::optional<std::string>& error) { … }
}