// Copyright 2024 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_STORAGE_LOCATION_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_ISOLATED_WEB_APPS_ISOLATED_WEB_APP_STORAGE_LOCATION_H_ #include <string> #include "base/files/file_path.h" #include "base/functional/callback_forward.h" #include "base/values.h" #include "third_party/abseil-cpp/absl/types/variant.h" #include "url/origin.h" namespace web_app { inline constexpr base::FilePath::CharType kIwaDirName[] = …); inline constexpr base::FilePath::CharType kMainSwbnFileName[] = …); // An IWA that is stored as a bundle that is managed and owned by the browser. // It is located in the profile directory. class IwaStorageOwnedBundle { … }; std::ostream& operator<<(std::ostream& os, IwaStorageOwnedBundle location); // An IWA that is stored as a bundle that is not owned by the browser. It must // never be touched (even when uninstalling) and is always located outside of // the profile directory. class IwaStorageUnownedBundle { … }; std::ostream& operator<<(std::ostream& os, IwaStorageUnownedBundle location); // An IWA whose source is a virtual bundle served through an HTTP proxy. // // The proxy origin must never be opaque. class IwaStorageProxy { … }; std::ostream& operator<<(std::ostream& os, IwaStorageProxy location); // Represents how the IWA is stored, and is persisted to the Web App database. // As such, this class should strive to remain a simple wrapper around the // storage representation in the database. Only code directly related to // install, update, and serving from a bundle/proxy should have to deal with // this. All other code should use the higher-level abstractions defined in // `isolated_web_app_source.h`. class IsolatedWebAppStorageLocation { … }; std::ostream& operator<<(std::ostream& os, IsolatedWebAppStorageLocation location); } // namespace web_app #endif // CHROME_BROWSER_WEB_APPLICATIONS_ISOLATED_WEB_APPS_ISOLATED_WEB_APP_STORAGE_LOCATION_H_