This turns the AtomViewMsg_Offscreen message, which only called the global setter blink::WebView::SetUseExternalPopupMenus(false) to get Chrome to render popup menus in the renderer instead of externally on macOS, into a command-line renderer flag --offscreen which does the same thing, except at render thread startup time, which is where Chromium sets the flag: https://chromium.googlesource.com/chromium/src/+/refs/tags/75.0.3755.3/content/renderer/render_thread_impl.cc#728.
This was the last usage of RenderViewObserver in our codebase, so this PR also removes that class.
* Comparison using is when operands support __eq__
Comparison using 'is' when equivalence is not the same as identity
When you compare two values using the is or is not operator, it is the object identities of the two values that is tested rather than their equality. If the class of either of the values in the comparison redefines equality then the is operator may return False even though the objects compare as equal. Equality is defined by the __eq__ or, in Python2, __cmp__ method. To compare two objects for equality, use the == or != operator instead.
Recommendation
When you want to compare the value of two literals, use the comparison operator == or != in place of is or is not.
If the uniqueness property or performance are important then use an object that does not redefine equality.
* fix: Comparison using is when operands support __eq__
Comparison using 'is' when equivalence is not the same as identity
When you compare two values using the is or is not operator, it is the object identities of the two values that is tested rather than their equality. If the class of either of the values in the comparison redefines equality then the is operator may return False even though the objects compare as equal. Equality is defined by the __eq__ or, in Python2, __cmp__ method. To compare two objects for equality, use the == or != operator instead.
Recommendation
When you want to compare the value of two literals, use the comparison operator == or != in place of is or is not.
If the uniqueness property or performance are important then use an object that does not redefine equality.
Previously, we were creating the app logs folder at a predefined location during initial electron startup, which meant that it had to be manually removed and prevented clean app portability. This refactors that implementation such that it's now an opt-in feature and developers must call app.setAppLogsPath(path) with an optional custom path in order to set this directory.
* docs: explanation on using protocols with partitions
* linting fixes
* Update docs/api/protocol.md
Co-Authored-By: Kilian <kilian@kilianvalkhof.com>
* Update docs/api/protocol.md
Co-Authored-By: Kilian <kilian@kilianvalkhof.com>
* Update docs/api/protocol.md
Co-Authored-By: Kilian <kilian@kilianvalkhof.com>
* be more explicit about there being a default session.
* fix: make OSR work with viz compositor
* fix: update OSR patch
* fix: update patch again
* fix: update viz_osr.patch for macOS
* fix: gn check warnings
* chore: no need to change SoftwareOutputDeviceWinProxy
* chore: add check in case we missed something
* fix: consider scale factor when compare size
* fix: make GPU OSR work
* fix: autofill popups with OSR
* chore: use UNIX line ending for osr_video_consumer
* chore: code is already in defined(OS_MACOSX)
* fix: share same OSR implementation on macOS
This should also fix the crash when there is navigation on macOS.
* test: osr window should not crash after navigation
* fix: make osr work on Mac properly
* fix: software osr on windows
* fix: software osr on Linux
* fix: compilation error introduced with rebase
* fix: split local surface id allocation into two
* Update osr_host_display_client_mac.mm
* chore: update copyright year
* fix: update patch
* spec: clean up after a failed window count assertion
Previously when this assertion failed all tests that ran after the
failed assertion also failed. This ensure that the assertion fails for
the test that actually caused the issue but cleans up the left-over
windows so that future tests do not fail.
* fix: maintain a ref count for objects sent over remote
Previously there was a race condition where a GC could occur in the
renderer process between the main process sending a meta.id and the
renderer pulling the proxy out its weakmap to stop it being GC'ed.
This fixes that race condition by maintaining a "sent" ref count in the
object registry and a "received" ref count in the object cache on the
renderer side. The deref request now sends the number of refs the
renderer thinks it owns, if the number does not match the value in the
object registry it is assumed that there is an IPC message containing a
new reference in flight and this race condition was hit.
The browser side ref count is then reduced and we wait for the new deref
message. This guaruntees that an object will only be removed from the
registry if every reference we sent has been guarunteed to be unreffed.
By default the Chromedriver will send remote-debugging-port=0 to let the
browser choose a free port to listen on. The chosen port is written to
a known file in the user data dir that is passed to the app through the
CLI.
This PR does two things.
1. Correctly passes the USER_DATA_DIR to the remote debugging server so
it knows where to write the file
2. Adds support for --user-data-dir as we did not support that CLI
argument and Chromedriver relies on being able to tell the "browser"
where to write this file.
Fixes#17354
Closes#10515. Notes fundamental limitation in `navigator.mediaDevices.getUserMedia` for audio capture on some platforms so that users are aware of the ongoing issue and provides a potential workaround.
* refactor: use mojo for electron internal IPC
* add sender_id, drop MessageSync
* remove usages of AtomFrameMsg_Message
* iwyu
* first draft of renderer->browser direction
* refactor to reuse a single ipc interface
* implement TakeHeapSnapshot through mojo
* the rest of the owl^WtakeHeapSnapshot mojofication
* remove no-op overrides in AtomRendererClient
* delete renderer-side ElectronApiServiceImpl when its pipe is destroyed
* looks like we don't need to overlay the renderer manifest after all
* don't try to send 2 replies to a sync rpc
* undo changes to manifests.cc
* unify sandboxed + unsandboxed ipc events
* lint
* register ElectronBrowser mojo service on devtools WebContents
* fix takeHeapSnapshopt failure paths
* {electron_api => atom}::mojom
* add send_to_all to ElectronRenderer::Message
* keep interface alive until callback is called
* review comments
* use GetContext from RendererClientBase
* robustify a test that uses window.open
* MessageSync posts a task to put sync messages in the same queue as async ones
* add v8::MicrotasksScope and node::CallbackScope
* iwyu
* use weakptr to api::WebContents instead of Unretained
* make MessageSync an asynchronous message & use non-associated interface
* iwyu + comments
* remove unused WeakPtrFactory
* inline OnRendererMessage[Sync]
* cleanups & comments
* use helper methods instead of inline lambdas
* remove unneeded async in test
* add mojo to manifests deps
* add gn check for //electron/manifests and mojo
* don't register renderer side service until preload has been run
* update gn check targets list
* move interface registration back to RenderFrameCreated