refactor: make session::browser_context_ a const raw_ref (#42728)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
0a8eae9019
commit
cf5fb4505e
2 changed files with 15 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue