chore: move gin::DeprecatedWrappable to gin_helper (#47958)
* chore: move gin::DeprecatedWrappable to gin_helper
This is in preparation for migrating to gin::Wrappable
based on cppgc #47922
The upstream class will be deleted soon via roller PR but
the cppgc migration should happen outside the roll, this
change retains the current functionality by copying the
implementation into //electron/shell/common/gin_helper.
The class can be deleted once the cppgc migration is complete.
* chore: fix lint:cpp
Co-authored-by: Robo <hop2deep@gmail.com>
* feat: Use DIR_ASSETS path to locate resource bundles
Co-authored-by: Will Anderson <andersonw@dropbox.com>
* Use DIR_ASSETS for calculating ASAR relative paths
Co-authored-by: Will Anderson <andersonw@dropbox.com>
* Add test to verify 'assets' matches parent dir of 'exe'
Co-authored-by: Will Anderson <andersonw@dropbox.com>
* Add Mac-specific test for assets path (but it is failing)
Co-authored-by: Will Anderson <andersonw@dropbox.com>
* test: Update app.getPath('assets') to expect an exception on Mac
Co-authored-by: Will Anderson <andersonw@dropbox.com>
* docs: Update docs for 'assets' path to indicate that it's only available on Windows + Linux
Co-authored-by: Will Anderson <andersonw@dropbox.com>
* fix: Don't define 'assets' mapping on macOS
Co-authored-by: Will Anderson <andersonw@dropbox.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Will Anderson <andersonw@dropbox.com>
* feat: webFrameMain.fromFrameToken
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
* refactor: return null instead of undefined
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
* docs: mention renderer webFrame property
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
* chore: undo null->undefined in wfm.fromId api this will be updated in another pr
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
chore: add TS smoke test for electron/utility
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* refactor: remove GetIsolate() calls from SetPrivate()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: remove excess GetIsolate() calls in PassValueToOtherContextInner()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: remove GetIsolate() calls from GetPrivate()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* local to ProxyFunctionWrapper()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: remove error_context->GetIsolate() call from PassValueToOtherContextInner()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: remove GetIsolate() call from ProxyFunctionWrapper()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass source and destination isolate as arg to CreateProxyForAPI()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
fix: crash on window.close with WebContentsView on blur
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
* refactor: add a v8::Isolate* arg to RendererClientBase::IsWebViewFrame()
Needed for creating gin dictionaries
refactor: add a v8::Isolate* arg to ShouldLoadPreload()
Needed for calling IsWebViewFrame()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to electron::util::CompileAndCall()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to OnCreatePreloadableV8Context()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to InvokeEmitProcessEvent()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to ServiceWorkerData's constructor
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to RendererClientBase::SetupMainWorldOverrides()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to RendererClientBase::WilLReleaseScriptContext()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* docs: update docs to avoid v8::Context::GetIsolate()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to ElectronSandboxedRendererClient::InitializeBindings()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: avoid v8::Context::GetIsolate() call in PromiseBase::SettleScope::~SettleScope()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in V8FunctionInvoker
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in RendererClientBase
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in ScriptExecutionCallback::Completed()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in ScriptExecutionCallback::CopyResultToCallingContextAndFinalize()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in electron::GetRenderFrame()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in gin_helper::internal::CallMethodWithArgs()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in OverrideGlobalPropertyFromIsolatedWorld()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in OverrideGlobalValueFromIsolatedWorld()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in ProxyFunctionWrapper()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: pass an isolate when calling GetCreationContextChecked() in PassValueToOtherContextInner()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fixup! refactor: pass an isolate when calling GetCreationContextChecked() in electron::GetRenderFrame()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to Constructible::GetConstructor()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add a v8::Isolate* arg to NodeBindings::Initialize()
This is needed for the GetConstructor() call
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: avoid v8::Context::GetIsolate() call in GetIpcObject() by taking it as an arg
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: avoid v8::Context::GetIsolate() call in ipc_native::EmitIPCEvent() by taking it as an arg
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: bump chromium in DEPS to 140.0.7309.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* 6762172: Replace MSG_ROUTING_NONE with IPC::mojom::kRoutingIdNone.
Refs https://chromium-review.googlesource.com/c/chromium/src/+/6762172
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* 6759543: [exit-time-destructors] Exclude target with warnings
Refs https://chromium-review.googlesource.com/c/chromium/src/+/6759543
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* 6765167: Split PreconnectManager into interface and implementation.
Refs https://chromium-review.googlesource.com/c/chromium/src/+/6765167
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* 6766775: [media] Clarify coded and visible size in FrameResources
Refs https://chromium-review.googlesource.com/c/chromium/src/+/6766775
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* 6760878: Move PreconnectRequest to //content/public
Refs https://chromium-review.googlesource.com/c/chromium/src/+/6760878
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* 6718973: Implement media playback trust check for the video PiP overlay window
Refs https://chromium-review.googlesource.com/c/chromium/src/+/6718973
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* chore: add missing include of <iterator> in ada
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* chore: update patches
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* chore: node gen-libc++-filenames.js
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* 6759633: [media] Use format from shared image in FrameResources
Refs https://chromium-review.googlesource.com/c/chromium/src/+/6759633
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* refactor: avoid redundant GetIsolate() calls in NodeBindings::CreateEnvironment()
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/6563615
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use v8::Isolate::GetCurrent() in Initialize() methods
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add v8::Isolate* arg to NodeBindings::CreateEnvironment()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fixup! refactor: use v8::Isolate::GetCurrent() in Initialize() methods
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: add v8::Isolate* arg to RendererClientBase::DidCreateScriptContext()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fixup! refactor: add v8::Isolate* arg to NodeBindings::CreateEnvironment()
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fixup! fixup! refactor: use v8::Isolate::GetCurrent() in Initialize() methods
refactor: prefer JavascriptEnvironment::GetIsolate() in the browser layer
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* test: cleanup RenderFrame lifespan tests
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* test: disable navigator.serial tests on arm64 mac
debug the hang
test: disable navigator.bluetooth on arm64 mac
Revert "test: disable navigator.bluetooth on arm64 mac"
This reverts commit 4b53a8485a5ff391832c7da93d859f1aa8722e70.
Revert "debug the hang"
This reverts commit 00338f0d49a7918224822087b4510fa9db0686c3.
Revert "test: disable navigator.serial tests on arm64 mac"
This reverts commit fb515ce447a9d42185e84b17b460e4fb6d1bf71d.
Reapply "test: disable navigator.serial tests on arm64 mac"
This reverts commit 0e5608108ffebbe8b8b27af9ea06aadae2ea85dd.
Reapply "test: disable navigator.bluetooth on arm64 mac"
This reverts commit f4c7d3fc0624a22421cba5d3d75df8c5d4367eea.
fixup
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* test: add waitUntil for flaky test
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>