chore: move gin::Handle to gin_helper (#48016)

chore: move gin::Handle to gin_helper (#47959)

* chore: move gin::Handle to gin_helper

* chore: fix lint

Co-authored-by: Robo <hop2deep@gmail.com>
This commit is contained in:
Calvin 2025-08-10 13:46:37 -06:00 committed by GitHub
commit e3f358a45a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
95 changed files with 555 additions and 419 deletions

View file

@ -30,7 +30,6 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/stop_find_action.h"
#include "electron/buildflags/buildflags.h"
#include "gin/handle.h"
#include "printing/buildflags/buildflags.h"
#include "shell/browser/api/save_page_handler.h"
#include "shell/browser/background_throttling_source.h"
@ -43,6 +42,7 @@
#include "shell/common/api/api.mojom.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "shell/common/gin_helper/constructible.h"
#include "shell/common/gin_helper/handle.h"
#include "shell/common/gin_helper/pinnable.h"
#include "shell/common/gin_helper/wrappable.h"
#include "shell/common/web_contents_utility.mojom.h"
@ -135,13 +135,14 @@ class WebContents final : public ExclusiveAccessContext,
};
// Create a new WebContents and return the V8 wrapper of it.
static gin::Handle<WebContents> New(v8::Isolate* isolate,
const gin_helper::Dictionary& options);
static gin_helper::Handle<WebContents> New(
v8::Isolate* isolate,
const gin_helper::Dictionary& options);
// Create a new V8 wrapper for an existing |web_content|.
//
// The lifetime of |web_contents| will be managed by this class.
static gin::Handle<WebContents> CreateAndTake(
static gin_helper::Handle<WebContents> CreateAndTake(
v8::Isolate* isolate,
std::unique_ptr<content::WebContents> web_contents,
Type type);
@ -160,11 +161,11 @@ class WebContents final : public ExclusiveAccessContext,
//
// The lifetime of |web_contents| is NOT managed by this class, and the type
// of this wrapper is always REMOTE.
static gin::Handle<WebContents> FromOrCreate(
static gin_helper::Handle<WebContents> FromOrCreate(
v8::Isolate* isolate,
content::WebContents* web_contents);
static gin::Handle<WebContents> CreateFromWebPreferences(
static gin_helper::Handle<WebContents> CreateFromWebPreferences(
v8::Isolate* isolate,
const gin_helper::Dictionary& web_preferences);
@ -478,7 +479,7 @@ class WebContents final : public ExclusiveAccessContext,
void InitWithSessionAndOptions(
v8::Isolate* isolate,
std::unique_ptr<content::WebContents> web_contents,
gin::Handle<class Session> session,
gin_helper::Handle<class Session> session,
const gin_helper::Dictionary& options);
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)