-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote: track listeners on browser side #3251
Conversation
@@ -3,6 +3,9 @@ path = require 'path' | |||
objectsRegistry = require './objects-registry.js' | |||
v8Util = process.atomBinding 'v8_util' | |||
|
|||
# weak refereence to callback with their registry ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First character of comment line should be capitalized.
The |
@zcbenz have made the changes. |
b483f71
to
cfb1769
Compare
Using |
@@ -70,6 +74,9 @@ unwrapArgs = (sender, args) -> | |||
returnValue = metaToValue meta.value | |||
-> returnValue | |||
when 'function' | |||
if rendererCallbacks.has(meta.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different WebContents can send callbacks with the same ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks!
a449435
to
f37e0c3
Compare
if not rendererCallbacks? | ||
# Weak reference to callbacks with their ID | ||
rendererCallbacks = new IDWeakMap() | ||
rendererRegistry[webContentsId] = rendererCallbacks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rendererCallbacks
should be destroyed when the render view of webContents is destroyed.
Can you reimplement |
826af98
to
d047f1f
Compare
d047f1f
to
2c59f45
Compare
Thanks. |
remote: track listeners on browser side
Fixes #3229