--
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/CABg10jw2nRTsiwcKTHdaZthdmWw7-hjefC-So%3D99_yNWpzdoZg%40mail.gmail.com.
TL;DR: Yes, it's correct.
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/CABg10jw2nRTsiwcKTHdaZthdmWw7-hjefC-So%3D99_yNWpzdoZg%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/CAN0uC_SRU9vkCHPEaKxbv8TqmjXGwGzDD5-Qb%2BZVe-CZyTd0uQ%40mail.gmail.com.
On Tue, Oct 18, 2016 at 7:49 AM, Yuki Shiino <yukis...@chromium.org> wrote:TL;DR: Yes, it's correct.Thanks, I'm happy to hear that :DOne more question. If it's correct to save m_scriptState on the DOM object, it means that the following CHECK must pass.class DOMObject {void someDOMOperation(ScriptState* scriptState) { // Imagine that DOMObject.someDOMOperation has [CallWith=ScriptState].CHECK(m_scriptState == scriptState); // This CHECK must pass....;}RefPtr<ScriptState> m_scriptState;};The CHECK is guaranteed to pass because 1) [CallWith=ScriptState] should pass in the relevant ScriptState of the wrapper and 2) the relevant ScriptState of the wrapper is equal to the ScriptState that has constructed the wrapper.Am I understanding correctly?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAN0uC_SRU9vkCHPEaKxbv8TqmjXGwGzDD5-Qb%2BZVe-CZyTd0uQ%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/CABg10jxaQPgs_SaQUVPttUSRCZJY28pAUrz2rwh1yJzu1MZyqw%40mail.gmail.com.
Cheers,Yuki Shiino
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxaQPgs_SaQUVPttUSRCZJY28pAUrz2rwh1yJzu1MZyqw%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/CAN0uC_Qg9iZXYYj1J0u%2BdxgdPJFy9Er001Q%3DArpgdwXjpGTcgA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAN0uC_Qg9iZXYYj1J0u%2BdxgdPJFy9Er001Q%3DArpgdwXjpGTcgA%40mail.gmail.com.
Off the top of my head, another option could be to convert a ScriptState to a corresponding ScriptState in that world. Or to always save a ScriptState of the main world if we do, because extensions are already allowed to access to the main world.
Anyway, I didn't think about extension-to-extension leak. It's a good point.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jyR6TBL-qoTF5ymcQ7eC_r%3DWX2W0vHT2K2bRumVR-3-pA%40mail.gmail.com.
Totally agreed.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jyR6TBL-qoTF5ymcQ7eC_r%3DWX2W0vHT2K2bRumVR-3-pA%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 view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxSHeJThxUbY%3D69k44n-F8hTMkY%3DAxu8HyvgUwyNqnSPw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxSHeJThxUbY%3D69k44n-F8hTMkY%3DAxu8HyvgUwyNqnSPw%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/CAPLXX-9UzSZRfnwfhL83KBrK56p0bfBg6x0xHkA6GonSB-W2HQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAPLXX-9UzSZRfnwfhL83KBrK56p0bfBg6x0xHkA6GonSB-W2HQ%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/CAO9Q3iJ6wjfY2mFGnmhSC_jQ8XLaXGa2duUPgWfeyU3939WbkQ%40mail.gmail.com.
Yes, we can store ScriptState in callbacks. While implementing callback bindings, there was a discussion when to pass ScriptState to callbacks and at that point we chose to pass it when we invoke callbacks. Storing ScriptState in callbacks seems the right fix. I'll prepare a CL. Thanks for your suggestion!
Does it make sense?
Totally agreed.
Cheers,Yuki Shiino
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/CABg10jw2nRTsiwcKTHdaZthdmWw7-hjefC-So%3D99_yNWpzdoZg%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_SRU9vkCHPEaKxbv8TqmjXGwGzDD5-Qb%2BZVe-CZyTd0uQ%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/CABg10jxaQPgs_SaQUVPttUSRCZJY28pAUrz2rwh1yJzu1MZyqw%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_Qg9iZXYYj1J0u%2BdxgdPJFy9Er001Q%3DArpgdwXjpGTcgA%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--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/CABg10jyR6TBL-qoTF5ymcQ7eC_r%3DWX2W0vHT2K2bRumVR-3-pA%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/CABg10jxSHeJThxUbY%3D69k44n-F8hTMkY%3DAxu8HyvgUwyNqnSPw%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/CAPLXX-9UzSZRfnwfhL83KBrK56p0bfBg6x0xHkA6GonSB-W2HQ%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/CAO9Q3iJ6wjfY2mFGnmhSC_jQ8XLaXGa2duUPgWfeyU3939WbkQ%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/CAPLXX-8VarUW7_Uyss%3DhcZL9%2Beh%2BZ_ytC29e%2BonccHc0j8GnRg%40mail.gmail.com.
On Wed, Oct 26, 2016 at 7:46 PM Kenichi Ishibashi <ba...@chromium.org> wrote:Yes, we can store ScriptState in callbacks. While implementing callback bindings, there was a discussion when to pass ScriptState to callbacks and at that point we chose to pass it when we invoke callbacks. Storing ScriptState in callbacks seems the right fix. I'll prepare a CL. Thanks for your suggestion!I might be talking about something else entirely, in which case please excuse me, but we recently fixed up the Web IDL spec in a related area. Per spec, callbacks store one realm (~ ScriptState) at conversion time, called their "callback context". They then use this at invocation time to "prepare to run a callback", but they also use the realm of the JavaScript function object itself, which can be different, to "prepare to run script".The input to the invoking algorithm indeed does not take a realm in the spec, so it does seem more correct to not pass a ScriptState at invoke time in Blink's code too.I hope this is helpful and at least somewhat related :)
Does it make sense?
Totally agreed.
Cheers,Yuki Shiino
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/CABg10jw2nRTsiwcKTHdaZthdmWw7-hjefC-So%3D99_yNWpzdoZg%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/CAN0uC_SRU9vkCHPEaKxbv8TqmjXGwGzDD5-Qb%2BZVe-CZyTd0uQ%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/CABg10jxaQPgs_SaQUVPttUSRCZJY28pAUrz2rwh1yJzu1MZyqw%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/CAN0uC_Qg9iZXYYj1J0u%2BdxgdPJFy9Er001Q%3DArpgdwXjpGTcgA%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--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/CABg10jyR6TBL-qoTF5ymcQ7eC_r%3DWX2W0vHT2K2bRumVR-3-pA%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/CABg10jxSHeJThxUbY%3D69k44n-F8hTMkY%3DAxu8HyvgUwyNqnSPw%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/CAPLXX-9UzSZRfnwfhL83KBrK56p0bfBg6x0xHkA6GonSB-W2HQ%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/CAO9Q3iJ6wjfY2mFGnmhSC_jQ8XLaXGa2duUPgWfeyU3939WbkQ%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.
Does it make sense?
Totally agreed.
Cheers,Yuki Shiino
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/CABg10jw2nRTsiwcKTHdaZthdmWw7-hjefC-So%3D99_yNWpzdoZg%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+unsubsc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAN0uC_SRU9vkCHPEaKxbv8TqmjXGwGzDD5-Qb%2BZVe-CZyTd0uQ%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/CABg10jxaQPgs_SaQUVPttUSRCZJY28pAUrz2rwh1yJzu1MZyqw%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+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/CAN0uC_Qg9iZXYYj1J0u%2BdxgdPJFy9Er001Q%3DArpgdwXjpGTcgA%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--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 view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jyR6TBL-qoTF5ymcQ7eC_r%3DWX2W0vHT2K2bRumVR-3-pA%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 view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxSHeJThxUbY%3D69k44n-F8hTMkY%3DAxu8HyvgUwyNqnSPw%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+unsubsc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAPLXX-9UzSZRfnwfhL83KBrK56p0bfBg6x0xHkA6GonSB-W2HQ%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+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/CAO9Q3iJ6wjfY2mFGnmhSC_jQ8XLaXGa2duUPgWfeyU3939WbkQ%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+unsubsc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAPLXX-8VarUW7_Uyss%3DhcZL9%2Beh%2BZ_ytC29e%2BonccHc0j8GnRg%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/CAPLXX--%2BWN-wbR%3DCyfnDf1jEbdzFFZ5EBVPf7NYO%2BAw1RVSiHA%40mail.gmail.com.
With the spec's model, each platform object is already associated with a realm, and there is no concept of "world". So, that's all.
With Blink's implementation, we're not directly associating a realm with a platform object, and we added a new concept of "world", so we cannot simply do the same thing that the spec says. So we won't be 100% correct for this point unless we refactor our codebase drastically. But we can be 95% correct and safe with the current model.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAPLXX--%2BWN-wbR%3DCyfnDf1jEbdzFFZ5EBVPf7NYO%2BAw1RVSiHA%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/CABg10jzs-ZQGCckm%3DsSs8LFBNKogz8pbhHuO5E0T%3Dd4v-Spnqg%40mail.gmail.com.
I'm thinking about a case of a callback function, and in this case, we're running the following code.V8CallbackFunction::call(ScriptWrappable* arg1, ScriptWrappable* arg2) {arg1_wrapper = toV8(scriptStateX, arg1);arg2_wrapper = toV8(scriptStateX, arg2);m_callback->Call(arg1_wrapper, arg2_wrapper);}I meant |arg1| and |arg2| as "platform objects", and they're not associated with any realm, and we're associating them with scriptStateX at the step of "converting IDL value to ECMAScript value".In other words, when converting ECMAScript value to IDL value, we're loosing the associated realm.
Cheers,Yuki Shiino
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jzs-ZQGCckm%3DsSs8LFBNKogz8pbhHuO5E0T%3Dd4v-Spnqg%40mail.gmail.com.
Well, anyway, callback functions can be invoked with pointers to ScriptWrappable as arguments, and we have to convert them to the wrapper objects. Regardless of whatever you called it, we're running the code in previous reply.Again, our code is like this.class DOMObj {CallbackFunction* m_callback;Member<ScriptWrappable> m_obj1;Member<ScriptWrappable> m_obj2;void foo() {m_callback->Call(m_obj1, m_obj2);}}DOMObj is holding pointers to ScriptWrappable, not v8::Object. Thus, we have to do toV8().
Thanks Domenic!Let me confirm if I'm understanding things correctly.Consider the following example:iframe1.window.someElement.innerHTML = "<div id=foo></div>";iframe2.window.document.body.appendChild(iframe1.window.someElement);var div = iframe2.window.document.getElemebtById("foo");The spec requires that div's realm should be iframe1 because the HTMLDivElement was created in iframe1. However, Blink currently sets div's realm to iframe2 because div's wrapper is created in iframe2.In other words, the spec requires to set a realm of a platform object when the platform object is created. However, Blink currently sets a realm of a wrapper when the wrapper is created. This is wrong.
Given the current architecture of V8 bindings, it's really hard to fix the behavior. However, in practice it wouldn't be that problematic to set a wrong realm on a wrapper as long as it doesn't leak JS objects between origins and worlds.
On Fri, Oct 28, 2016 at 10:10 AM Kentaro Hara <har...@chromium.org> wrote:Thanks Domenic!Let me confirm if I'm understanding things correctly.Consider the following example:iframe1.window.someElement.innerHTML = "<div id=foo></div>";iframe2.window.document.body.appendChild(iframe1.window.someElement);var div = iframe2.window.document.getElemebtById("foo");The spec requires that div's realm should be iframe1 because the HTMLDivElement was created in iframe1. However, Blink currently sets div's realm to iframe2 because div's wrapper is created in iframe2.In other words, the spec requires to set a realm of a platform object when the platform object is created. However, Blink currently sets a realm of a wrapper when the wrapper is created. This is wrong.The spec does require that. But as far as I can tell, Blink follows the spec: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4625. Maybe I am not testing the right thing though, and Blink sets the realm to that of frames[1], even though its .__proto__ and .constructor are still that of frames[0]? If so that's really confusing :(.
Given the current architecture of V8 bindings, it's really hard to fix the behavior. However, in practice it wouldn't be that problematic to set a wrong realm on a wrapper as long as it doesn't leak JS objects between origins and worlds.I'm not sure how problematic it is. The relevant realm is used for a variety of things. For example we are trying to spec that when you fire an event, you use the Event constructor from the relevant Realm of the target. Here are some tests we are working on: https://github.com/w3c/web-platform-tests/pull/4088/files. But as far as I can tell from these tests, Chrome uses the per-spec relevant Realm to determine which Event constructor to use, so now I'm just confused if Chrome follows the spec for relevant Realm, or if it doesn't.
It's probably true that it's not problematic from a security perspective unless it leaks between origins and worlds.
--
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/CAM0wra99LHaqTC83Goxt1XT8%3DshmSKkFAY4_wdtpkMuzqZ6UNA%40mail.gmail.com.