refactor: make session::browser_context_ a const raw_ref (#42728)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
Charles Kerr 2024-07-02 16:53:36 -05:00 committed by GitHub
parent 0a8eae9019
commit cf5fb4505e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 14 deletions

View file

@ -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