RESOLVED FIXED Bug 33016
[V8] Use script state of the current isolated world when creating ScriptCallStack
https://bugs.webkit.org/show_bug.cgi?id=33016
Summary [V8] Use script state of the current isolated world when creating ScriptCallS...
Yury Semikhatsky
Reported 2009-12-29 05:10:34 PST
Currently ScriptCallStack is created based on current Frame's main world context. This is wrong since current context maybe one from isolated world.
Attachments
patch (37.64 KB, patch)
2009-12-29 05:34 PST, Yury Semikhatsky
no flags
patch (6.01 KB, patch)
2009-12-29 05:39 PST, Yury Semikhatsky
dglazkov: review-
patch (6.23 KB, patch)
2009-12-29 11:42 PST, Yury Semikhatsky
no flags
patch (6.26 KB, patch)
2009-12-29 11:49 PST, Yury Semikhatsky
dglazkov: review+
Yury Semikhatsky
Comment 1 2009-12-29 05:34:58 PST
Yury Semikhatsky
Comment 2 2009-12-29 05:39:02 PST
WebKit Review Bot
Comment 3 2009-12-29 05:45:20 PST
style-queue ran check-webkit-style on attachment 45595 [details] without any errors.
Dimitri Glazkov (Google)
Comment 4 2009-12-29 09:04:01 PST
Comment on attachment 45595 [details] patch I like the premise of the patch. I don't like that we're adding extra methods to already humongous V8Proxy and V8IsolatedWorld. ScriptState is supposed to be a thin wrapper, and I certainly don't want us to carry it around in either of these instances. Can you rework it perhaps to just add static create methods to ScriptState, and put world-aware logic there?
Yury Semikhatsky
Comment 5 2009-12-29 09:21:14 PST
(In reply to comment #4) > (From update of attachment 45595 [details]) > I like the premise of the patch. I don't like that we're adding extra methods > to already humongous V8Proxy and V8IsolatedWorld. ScriptState is supposed to be > a thin wrapper, and I certainly don't want us to carry it around in either of > these instances. > > Can you rework it perhaps to just add static create methods to ScriptState, and > put world-aware logic there? ScriptState unlike other Script* objetcs is not a value type. I don't want to manage ScriptState life time and my point was to cache pointer to ScriptState on the objects that can be casted to ScriptState* This way the ScriptState instance would live as long as the original object stays alive. Otherwise if one needed to store a pointer to ScriptState from the call stack he would have to make a copy of the ScriptCallStack.state() since the original ScriptState object would be destroyed along with stack allocated ScriptCallStack object. I guess original ScriptState design assumes that clients should be able to keep pointer to ScriptState instance while original context exists. Please correct me if I'm wrong.
Yury Semikhatsky
Comment 6 2009-12-29 11:42:52 PST
Adam Barth
Comment 7 2009-12-29 11:44:00 PST
Does this change have an observable change in behavior? If so, we'll need a test.
WebKit Review Bot
Comment 8 2009-12-29 11:45:18 PST
Attachment 45617 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WebCore/bindings/v8/ScriptCallStack.cpp:36: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1
Yury Semikhatsky
Comment 9 2009-12-29 11:47:19 PST
(In reply to comment #7) > Does this change have an observable change in behavior? If so, we'll need a > test. With current implementation of InspectorController the change should not affect observable behavior.
Yury Semikhatsky
Comment 10 2009-12-29 11:49:53 PST
WebKit Review Bot
Comment 11 2009-12-29 11:50:55 PST
style-queue ran check-webkit-style on attachment 45618 [details] without any errors.
Dimitri Glazkov (Google)
Comment 12 2009-12-29 12:12:03 PST
Comment on attachment 45618 [details] patch r=me. Please file a bug regarding the new role of ScriptState.
Yury Semikhatsky
Comment 13 2009-12-30 03:35:09 PST
(In reply to comment #12) > Please file a bug regarding the new role of ScriptState. Done: https://bugs.webkit.org/show_bug.cgi?id=33047
Yury Semikhatsky
Comment 14 2009-12-30 04:40:49 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/bindings/v8/ScriptCallStack.cpp M WebCore/bindings/v8/ScriptCallStack.h M WebCore/bindings/v8/ScriptController.cpp M WebCore/bindings/v8/ScriptController.h M WebCore/bindings/v8/V8IsolatedWorld.cpp M WebCore/bindings/v8/V8IsolatedWorld.h Committed r52653
Note You need to log in before you can comment on or make changes to this bug.