refactor: allocate api::Session on cpp heap (#48141)
This commit is contained in:
parent
0917ed5f6f
commit
3ccb1bc0a8
32 changed files with 632 additions and 293 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "content/public/common/stop_find_action.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "shell/browser/api/electron_api_session.h"
|
||||
#include "shell/browser/api/save_page_handler.h"
|
||||
#include "shell/browser/background_throttling_source.h"
|
||||
#include "shell/browser/event_emitter_mixin.h"
|
||||
|
@ -47,6 +48,7 @@
|
|||
#include "shell/common/gin_helper/wrappable.h"
|
||||
#include "shell/common/web_contents_utility.mojom.h"
|
||||
#include "ui/base/models/image_model.h"
|
||||
#include "v8/include/cppgc/persistent.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
#include "extensions/common/mojom/view_type.mojom-forward.h"
|
||||
|
@ -479,7 +481,7 @@ class WebContents final : public ExclusiveAccessContext,
|
|||
void InitWithSessionAndOptions(
|
||||
v8::Isolate* isolate,
|
||||
std::unique_ptr<content::WebContents> web_contents,
|
||||
gin_helper::Handle<class Session> session,
|
||||
ElectronBrowserContext* browser_context,
|
||||
const gin_helper::Dictionary& options);
|
||||
|
||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||
|
@ -768,7 +770,7 @@ class WebContents final : public ExclusiveAccessContext,
|
|||
// Update the html fullscreen flag in both browser and renderer.
|
||||
void UpdateHtmlApiFullscreen(bool fullscreen);
|
||||
|
||||
v8::Global<v8::Value> session_;
|
||||
cppgc::Persistent<api::Session> session_;
|
||||
v8::Global<v8::Value> devtools_web_contents_;
|
||||
v8::Global<v8::Value> debugger_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue