--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
I think event listeners are not different from any other objects in terms of lifetime. If nothing has a reference to a certain function object, then that function object is discardable by GC. Event listeners are usually associated with DOM objects (e.g. addEventListener), then those event listenres should be kept alive as long as the associated DOM objects are reachable, I think.
I think event listeners are not different from any other objects in terms of lifetime. If nothing has a reference to a certain function object, then that function object is discardable by GC. Event listeners are usually associated with DOM objects (e.g. addEventListener), then those event listenres should be kept alive as long as the associated DOM objects are reachable, I think.Most DOM objects are in a DOM tree of a document, so DOM objects are alive as long as the document is alive. I don't think this situation is a leak.
Discarding a document and browsing context is spec'ed at HTML 7.3.4.https://html.spec.whatwg.org/multipage/browsers.html#garbage-collection-and-browsing-contextsIt's not when a window object gets detached, but when nothing has a strong reference to a document or window, then we can discard it. When discarding a document or browsing context, we eventually discard DOM objects and associated event listeners, too.Cheers,Yuki Shiino
2016-09-21 22:09 GMT+09:00 Kentaro Hara <har...@chromium.org>:
HiI noticed that the current lifetime management of event listeners is very complicated, broken and leaking. I have some ideas to make it simpler, more correct and not leaky, but before running into the details, let me ask one question:Per the spec, how long should an event listener be kept alive?The current implementation of the lifetime management of event listeners looks pretty arbitrary. Here are a couple of examples:- XHR's event listener is kept alive until XHR finishes dispatching all events.- Node's event listener (e.g., onclick listener) is kept alive until all wrappers in the DOM tree which the Node belongs to are collected by V8's GC.- BatteryManager's event listener is kept alive forever (unless developers explicitly remove the listener). This is because battery status events may happen in the DOM side anytime (=there is no clear timing when we can collect the event listener). This implementation is clearly wrong because it leaks the event listener, which keeps a strong reference to the entire window object. There are a couple of other DOM objects that have the same problem.I couldn't find any explicit description in the spec about how the lifetime of event listeners should be maintained, but my best guess is as follows:- An event listener should be kept alive until its associated window object is detached (=until the browsing context becomes inactive).- However, a user agent is allowed to collect the event listener earlier if it's not observable to the user-facing script.For example, XHR and Node collect event listeners before their associated window object is detached, but that is fine because the premature collection is not observable to the user-facing script. On the other hand, BatteryManager should release the event listener when its associated window object is detached. Otherwise, the event listener leaks (actually it is leaking).Am I understanding things correctly?--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsubsc...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
Why would wrapper tracing not solve this problem?
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
Why would wrapper tracing not solve this problem?
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
----Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
----Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzDEe-H%2BUOLTsGSXb-J5bQUGQPjfNVOrwjsoMvNS7e2VQ%40mail.gmail.com.
I think event listeners are not different from any other objects in terms of lifetime. If nothing has a reference to a certain function object, then that function object is discardable by GC. Event listeners are usually associated with DOM objects (e.g. addEventListener), then those event listenres should be kept alive as long as the associated DOM objects are reachable, I think.Most DOM objects are in a DOM tree of a document, so DOM objects are alive as long as the document is alive. I don't think this situation is a leak.Discarding a document and browsing context is spec'ed at HTML 7.3.4.https://html.spec.whatwg.org/multipage/browsers.html#garbage-collection-and-browsing-contextsIt's not when a window object gets detached, but when nothing has a strong reference to a document or window, then we can discard it. When discarding a document or browsing context, we eventually discard DOM objects and associated event listeners, too.
Cheers,Yuki Shiino
2016-09-21 22:09 GMT+09:00 Kentaro Hara <har...@chromium.org>:
HiI noticed that the current lifetime management of event listeners is very complicated, broken and leaking. I have some ideas to make it simpler, more correct and not leaky, but before running into the details, let me ask one question:Per the spec, how long should an event listener be kept alive?The current implementation of the lifetime management of event listeners looks pretty arbitrary. Here are a couple of examples:- XHR's event listener is kept alive until XHR finishes dispatching all events.- Node's event listener (e.g., onclick listener) is kept alive until all wrappers in the DOM tree which the Node belongs to are collected by V8's GC.- BatteryManager's event listener is kept alive forever (unless developers explicitly remove the listener). This is because battery status events may happen in the DOM side anytime (=there is no clear timing when we can collect the event listener). This implementation is clearly wrong because it leaks the event listener, which keeps a strong reference to the entire window object. There are a couple of other DOM objects that have the same problem.I couldn't find any explicit description in the spec about how the lifetime of event listeners should be maintained, but my best guess is as follows:- An event listener should be kept alive until its associated window object is detached (=until the browsing context becomes inactive).- However, a user agent is allowed to collect the event listener earlier if it's not observable to the user-facing script.For example, XHR and Node collect event listeners before their associated window object is detached, but that is fine because the premature collection is not observable to the user-facing script. On the other hand, BatteryManager should release the event listener when its associated window object is detached. Otherwise, the event listener leaks (actually it is leaking).Am I understanding things correctly?--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAN0uC_SigF7Gz9sPGY6Fxuz6hT93mSm49WbGDCjnzqyG7Y3Y4A%40mail.gmail.com.
Once we have traceWrappers enabled, the traced persistents aren't roots anymore. So the actual cycle is
context -> dom window -> battery manager -> v8 function -> context
which is fully tracable and shouldn't keep anything alive.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
----Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzDEe-H%2BUOLTsGSXb-J5bQUGQPjfNVOrwjsoMvNS7e2VQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
----Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzDEe-H%2BUOLTsGSXb-J5bQUGQPjfNVOrwjsoMvNS7e2VQ%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxLQXGCgtC12DBZVUg%3DD8eOHzsL0vSJ2wa5PW1thxRk3g%40mail.gmail.com.
I'm not suggesting to bind it to the lifetime of window, but (in this example) to the lifetime of the battery manager
If the battery manager dies before the window does, the listener should go away.
I think that's in line with what Domenic said about the regular lifetime of JS objects.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
----Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzDEe-H%2BUOLTsGSXb-J5bQUGQPjfNVOrwjsoMvNS7e2VQ%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxLQXGCgtC12DBZVUg%3DD8eOHzsL0vSJ2wa5PW1thxRk3g%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
----Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzDEe-H%2BUOLTsGSXb-J5bQUGQPjfNVOrwjsoMvNS7e2VQ%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxLQXGCgtC12DBZVUg%3DD8eOHzsL0vSJ2wa5PW1thxRk3g%40mail.gmail.com.
yeah, but that's an artifact of binding the lifetime to the wrapper, instead of using the underlying C++ object which survives the gc.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsubsc...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzQEDUfcCsREBuMQiG9QT6zbB8yy8VWFrzvF98kh-deZg%40mail.gmail.com.
----Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsubsc...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jx78hVVbR_MwNUWTmUSg80NqOuL3PS_wUNaJEHvw-u61g%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsubsc...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzDEe-H%2BUOLTsGSXb-J5bQUGQPjfNVOrwjsoMvNS7e2VQ%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsubsc...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxLQXGCgtC12DBZVUg%3DD8eOHzsL0vSJ2wa5PW1thxRk3g%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALjhuidJ8Smxm6x-_sRzysE3Fp2EaC%2By3hPw3pZkSUmU2traLA%40mail.gmail.com.To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsubsc...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
we "just" need to make sure that tracewrapper sees the following cycle:context (js) -> window (C++) -> battery manager (C++) -> v8 function (js) -> context (js)if the connection from window (C++) -> battery manager (C++) goes away, v8 function should get collected.During a normal navigation, the context -> window link is severed which should make oilpan collect the battery manager and v8 collect the function (and context)
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALjhuic1tPntCBKTdaXcTFCWp%2BwHZbLYm-q-_%2BcY0%3DZ2mstQFg%40mail.gmail.com.
On Thu, Sep 22, 2016 at 11:05 PM, Jochen Eisinger <joc...@chromium.org> wrote:we "just" need to make sure that tracewrapper sees the following cycle:context (js) -> window (C++) -> battery manager (C++) -> v8 function (js) -> context (js)if the connection from window (C++) -> battery manager (C++) goes away, v8 function should get collected.During a normal navigation, the context -> window link is severed which should make oilpan collect the battery manager and v8 collect the function (and context)Thanks, this makes a lot of more sense.I begin to think that the real problem is that there's no reference from window (JS) to BatteryManager (JS).
- If we don't have window (JS) => BatteryManager (JS), the wrapper returned by window.batteryManager may change over time. The expando on the wrapper may be lost. This is problematic (before worrying about the event listener). Hence, we need to have window (JS) => BatteryManager (JS).- If we have window (JS) => BatteryManager (JS), all the problem we're discussing on this thread will be gone, because the event listener will be kept alive by window (JS) => BatteryManager (JS) => event listener (JS).
The BatteryManager => v8::Function reference can cause the following cycle:BatteryManager ==> v8::Function ==> window ==(any arbitrary references)==> BatteryManagerRemember that traceWrapper is not helpful to break the cycle. traceWrapper is (just) a mechanism to represent reachability from one wrapper to another wrapper. However, what we need here is to represent reachability from a DOM object (=BatteryManager) to a V8 object (=v8::Function) in a way that doesn't create a cycle.One practical solution to this problem would be to explicitly remove the BatteryManager => v8::Function reference when the window object gets detached. This is why I was wondering if the event listener's lifetime is bound to the lifetime of its associated window object.
On Thu, Sep 22, 2016 at 3:31 PM Kentaro Hara <har...@chromium.org> wrote:On Thu, Sep 22, 2016 at 11:05 PM, Jochen Eisinger <joc...@chromium.org> wrote:we "just" need to make sure that tracewrapper sees the following cycle:context (js) -> window (C++) -> battery manager (C++) -> v8 function (js) -> context (js)if the connection from window (C++) -> battery manager (C++) goes away, v8 function should get collected.During a normal navigation, the context -> window link is severed which should make oilpan collect the battery manager and v8 collect the function (and context)Thanks, this makes a lot of more sense.I begin to think that the real problem is that there's no reference from window (JS) to BatteryManager (JS).I don't think that's the problem - we should not create such a reference unless the spec explicitly asks for such a reference.
- If we don't have window (JS) => BatteryManager (JS), the wrapper returned by window.batteryManager may change over time. The expando on the wrapper may be lost. This is problematic (before worrying about the event listener). Hence, we need to have window (JS) => BatteryManager (JS).- If we have window (JS) => BatteryManager (JS), all the problem we're discussing on this thread will be gone, because the event listener will be kept alive by window (JS) => BatteryManager (JS) => event listener (JS).this is, however, the wrong path to keep the event listener alive. It should be kept alive via the C++ BatteryManager, and this is what traceWrapper does.
On Thu, Sep 22, 2016 at 11:43 PM, Jochen Eisinger <joc...@chromium.org> wrote:On Thu, Sep 22, 2016 at 3:31 PM Kentaro Hara <har...@chromium.org> wrote:On Thu, Sep 22, 2016 at 11:05 PM, Jochen Eisinger <joc...@chromium.org> wrote:we "just" need to make sure that tracewrapper sees the following cycle:context (js) -> window (C++) -> battery manager (C++) -> v8 function (js) -> context (js)if the connection from window (C++) -> battery manager (C++) goes away, v8 function should get collected.During a normal navigation, the context -> window link is severed which should make oilpan collect the battery manager and v8 collect the function (and context)Thanks, this makes a lot of more sense.I begin to think that the real problem is that there's no reference from window (JS) to BatteryManager (JS).I don't think that's the problem - we should not create such a reference unless the spec explicitly asks for such a reference.In the spec, a wrapper and a C++ object are the same thing (there's no distinction between a wrapper and a C++ object). Also window.batteryManager is not speced to create a new object. It means that the spec requires to add the reference, right?
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALjhuifNqoaqF_MKmuCQYfa8SNRbOEb3sdCejnd0NVYtdyp_Wg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsubsc...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALjhuifNqoaqF_MKmuCQYfa8SNRbOEb3sdCejnd0NVYtdyp_Wg%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jwzCUX9aza5Xj79d8sD5-3Z_Nd1LEBK-e1qYwoWeGfFtA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jwzCUX9aza5Xj79d8sD5-3Z_Nd1LEBK-e1qYwoWeGfFtA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABihn6EpQTqLd4s_2agySVrfGCSqZ5VHkZjUThr8WSyoG9Ekow%40mail.gmail.com.
On Thu, Sep 22, 2016 at 3:53 PM Kentaro Hara <har...@chromium.org> wrote:
On Thu, Sep 22, 2016 at 11:43 PM, Jochen Eisinger <joc...@chromium.org> wrote:
On Thu, Sep 22, 2016 at 3:31 PM Kentaro Hara <har...@chromium.org> wrote:
...
I begin to think that the real problem is that there's no reference from window (JS) to BatteryManager (JS).
I don't think that's the problem - we should not create such a reference unless the spec explicitly asks for such a reference.
In the spec, a wrapper and a C++ object are the same thing (there's no distinction between a wrapper and a C++ object). Also window.batteryManager is not speced to create a new object. It means that the spec requires to add the reference, right?
https://heycam.github.io/webidl/#SameObject implies that only attributes annotated with [SameObject] are supposed to return the same object on repeated invocations.
Maybe SameObject only applies to things that otherwise might reasonably die, like the NodeList could as well be an temporary object and just the nodes in the list staying the same?
But in either case, I don't think that this implies that the wrapper always has to exist - just that once it does, out should stay the same
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAO9Q3iKUfzdnc0ALnFuTaddm2oEqHVqqmTiQMoki%2B0dDrDeWdg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALjhuidR6Seh4efFVM0Q2KsNpXjiuKXEPqM3C-E98ieUwiGEKg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAO9Q3iKUfzdnc0ALnFuTaddm2oEqHVqqmTiQMoki%2B0dDrDeWdg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALjhuidR6Seh4efFVM0Q2KsNpXjiuKXEPqM3C-E98ieUwiGEKg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAM0wra_V0kOX8x9P-7ZZ%2BrG0KSRCckGp2-na%2BgVs33xHxq0x_Q%40mail.gmail.com.To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.