feat: Allow usage of an absolute path for partitions used in a session (#37604)

* Allow an absolute path to be used for creating sessions

Allows an absolute path to be used for creating sessions
by adding the session.fromPath() API.

* Fixup! Clarify that an emptry string is not permitted as a parameter to fromPath()
This commit is contained in:
George Joseph 2023-03-20 14:34:49 +00:00 committed by GitHub
parent eb613ef3d4
commit e0c348a2f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 153 additions and 18 deletions

View file

@ -82,6 +82,12 @@ class Session : public gin::Wrappable<Session>,
const std::string& partition,
base::Value::Dict options = {});
// Gets the Session based on |path|.
static absl::optional<gin::Handle<Session>> FromPath(
v8::Isolate* isolate,
const base::FilePath& path,
base::Value::Dict options = {});
ElectronBrowserContext* browser_context() const { return browser_context_; }
// gin::Wrappable