electron/lib/renderer
Samuel Attard 78411db4b5
fix: maintain a ref count for objects sent over remote (#17464)
* 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.
2019-04-16 16:08:11 -04:00
..
api fix: maintain a ref count for objects sent over remote (#17464) 2019-04-16 16:08:11 -04:00
extensions chore: remove unused catch bindings (#16121) 2019-02-21 09:26:07 +00:00
web-view feat: add <webview>.getWebContentsId() (#17407) 2019-03-26 10:57:27 +09:00
callbacks-registry.js chore: rename atomBinding to electronBinding (#17419) 2019-03-18 12:37:06 -07:00
chrome-api.ts fix: make devtools extensions load correctly (#17614) 2019-03-30 17:36:13 -07:00
content-scripts-injector.ts fix: ensure dots in content script patterns aren't used as wildcards (#17593) 2019-03-28 14:03:37 -07:00
init.ts refactor: use mojo for electron internal IPC (#17406) 2019-04-02 15:38:16 -07:00
inspector.ts refactor: make ELECTRON_INSPECTOR_CONTEXT_MENU handler async (#17411) 2019-03-19 10:37:43 -07:00
ipc-renderer-internal-utils.ts refactor: add ipcMainUtils.invokeInWebContents / ipcRendererUtils.handle helpers (#17313) 2019-03-13 12:03:17 -07:00
ipc-renderer-internal.ts refactor: use mojo for electron internal IPC (#17406) 2019-04-02 15:38:16 -07:00
security-warnings.ts feat: promisify executeJavaScript (#17312) 2019-03-14 12:08:54 -07:00
web-frame-init.ts feat: promisify executeJavaScript (#17312) 2019-03-14 12:08:54 -07:00
window-setup.ts refactor: expose ipcRendererInternal to the main world for window-setup using the content script world pattern (#17591) 2019-03-29 18:10:21 -07:00