#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h"
#include <utility>
#include <vector>
#include "base/base64.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/functional/overloaded.h"
#include "base/strings/strcat.h"
#include "base/types/expected.h"
#include "chrome/browser/web_applications/isolated_web_apps/error/unusable_swbn_file_error.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_source.h"
#include "chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_reader.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/common/url_constants.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_id.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_integrity_block.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_signature_verifier.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/storage_partition_config.h"
#include "crypto/sha2.h"
namespace web_app {
namespace {
base::expected<IsolatedWebAppUrlInfo, std::string> MakeIsolatedWebAppUrlInfo(
base::expected<web_package::SignedWebBundleId, UnusableSwbnFileError>
bundle_id) { … }
void GetSignedWebBundleIdByPath(
const base::FilePath& path,
base::OnceCallback<void(base::expected<IsolatedWebAppUrlInfo, std::string>)>
url_info_ready_callback) { … }
}
base::expected<IsolatedWebAppUrlInfo, std::string>
IsolatedWebAppUrlInfo::Create(const GURL& url) { … }
IsolatedWebAppUrlInfo IsolatedWebAppUrlInfo::CreateFromSignedWebBundleId(
const web_package::SignedWebBundleId& web_bundle_id) { … }
void IsolatedWebAppUrlInfo::CreateFromIsolatedWebAppSource(
const IwaSource& source,
base::OnceCallback<void(base::expected<IsolatedWebAppUrlInfo, std::string>)>
callback) { … }
IsolatedWebAppUrlInfo::IsolatedWebAppUrlInfo(
const web_package::SignedWebBundleId& web_bundle_id)
: … { … }
const url::Origin& IsolatedWebAppUrlInfo::origin() const { … }
const webapps::AppId& IsolatedWebAppUrlInfo::app_id() const { … }
const web_package::SignedWebBundleId& IsolatedWebAppUrlInfo::web_bundle_id()
const { … }
content::StoragePartitionConfig IsolatedWebAppUrlInfo::storage_partition_config(
content::BrowserContext* browser_context) const { … }
content::StoragePartitionConfig
IsolatedWebAppUrlInfo::GetStoragePartitionConfigForControlledFrame(
content::BrowserContext* browser_context,
const std::string& partition_name,
bool in_memory) const { … }
bool IsolatedWebAppUrlInfo::operator==(
const IsolatedWebAppUrlInfo& other) const { … }
std::string IsolatedWebAppUrlInfo::partition_domain() const { … }
}