mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: make session::browser_context_ a const raw_ref (#42728)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
@@ -91,7 +91,9 @@ class Session : public gin::Wrappable<Session>,
|
||||
const base::FilePath& path,
|
||||
base::Value::Dict options = {});
|
||||
|
||||
ElectronBrowserContext* browser_context() const { return browser_context_; }
|
||||
ElectronBrowserContext* browser_context() const {
|
||||
return &browser_context_.get();
|
||||
}
|
||||
|
||||
// gin::Wrappable
|
||||
static gin::WrapperInfo kWrapperInfo;
|
||||
@@ -215,7 +217,7 @@ class Session : public gin::Wrappable<Session>,
|
||||
// The client id to enable the network throttler.
|
||||
base::UnguessableToken network_emulation_token_;
|
||||
|
||||
raw_ptr<ElectronBrowserContext> browser_context_;
|
||||
const raw_ref<ElectronBrowserContext> browser_context_;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
|
||||
Reference in New Issue
Block a user