k...@chromium.org
unread,Oct 13, 2015, 2:11:44 AM10/13/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to joc...@chromium.org, baj...@chromium.org, z...@chromium.org, har...@chromium.org, ju...@chromium.org, asa...@chromium.org, benjhayd...@chromium.org, blink-...@chromium.org, chromium...@chromium.org, dari...@chromium.org, j...@chromium.org, piman...@chromium.org, sigb...@opera.se
Per offline conversation between haraken and me, the storing of
m_scriptState is
not necessary. Since bindBuffer and vertexAttribPointer -- the two methods
which
would need to lazily instantiate the JavaScript wrapper for
m_defaultVertexArrayObject -- are both always called from JavaScript, the
ScriptState passed to them is always legal to use to create this JS wrapper.
I'm reverting the state of this CL to Patch Set 3, and making a couple of
modifications per the code review below.
On 2015/10/13 02:02:04, haraken wrote:
> Just for the record: We don't need to enter the ScriptState before
calling these
> toV8()s because we're already in a correct ScriptState when the
> WebGLRenderingContextBase's constructor gets called (from JavaScript).
Actually, this code is called from a timer after the context is lost, so
this code as written is incorrect. It would have to enter m_scriptState.
On 2015/10/13 02:02:04, haraken wrote:
> It would be great if we could remove the null check. By replacing the
'nullptr'
> with 'm_scriptState', I guess we can guarantee that scriptState is
never null
> here.
There's no need to do this work if we're calling this function
internally. The only time it's necessary to update the references
between these wrappers is if the user has called bindFramebuffer from
JavaScript.
On 2015/10/13 02:02:04, haraken wrote:
> Ditto.
Same answer.
On 2015/10/13 02:02:04, haraken wrote:
> toV8 does ScriptState-dependent operations, so we must enter a correct
> ScriptState before calling toV8. I guess we need the following code:
> if (!scriptState->contextIsValid())
> return ScriptValue();
> ScriptState::Scope scope(scriptState);
> ...; // You can call toV8 here.
This function is always called from JavaScript, so the incoming
ScriptState is always valid.
On 2015/10/13 02:02:04, haraken wrote:
> I'm wondering why we can't use m_scriptState.
There's no need to update the references between the JavaScript wrappers
when this is called internally; we're temporarily modifying the bound
framebuffer and restoring its state before returning to JavaScript.
On 2015/10/13 02:02:04, haraken wrote:
> Ditto.
Same thing for the TEXTURE_2D binding on the active texture unit. We
don't want to modify the references between the context's objects when
doing some temporary internal modifications.
On 2015/10/13 02:02:04, haraken wrote:
> Actually preserveObjectWrapper doesn't need to take ScriptState (it is
doing
> nothing ScriptState-dependent). Passing an Isolate* would be enough.
Thanks for that hint. I'll change its signature.
On 2015/10/13 02:02:04, haraken wrote:
> Add a TODO: This logic should be moved to V8HiddenValue.
OK.
https://codereview.chromium.org/1387743002/