RESOLVED DUPLICATE of bug 103210 97071
[V8] Move WorkerContextExecutionProxy::initializeIfNeeded() to WorkerScriptController
https://bugs.webkit.org/show_bug.cgi?id=97071
Summary [V8] Move WorkerContextExecutionProxy::initializeIfNeeded() to WorkerScriptCo...
Kentaro Hara
Reported 2012-09-18 22:42:24 PDT
To kill WorkerContextExecutionProxy, we move WorkerContextExecutionProxy::initializeIfNeeded() to WorkerScriptController. This requires to move a couple of related methods and member variables at the same time. Although the patch is big, it's a bit difficult to split it into pieces.
Attachments
Patch (18.85 KB, patch)
2012-09-18 22:45 PDT, Kentaro Hara
no flags
Kentaro Hara
Comment 1 2012-09-18 22:45:33 PDT
Adam Barth
Comment 2 2012-09-19 11:37:54 PDT
Comment on attachment 164662 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164662&action=review > Source/WebCore/bindings/v8/WorkerScriptController.h:104 > + v8::Persistent<v8::Context> m_context; > + OwnPtr<V8PerContextData> m_perContextData; > + bool m_disableEvalPending; > + Vector<Event*> m_events; On the main thread, this sort of stuff is handled by the WindowShell. I worry slightly about WorkerScriptController becoming a giant object of doom.
Adam Barth
Comment 3 2012-09-19 11:38:43 PDT
Maybe we need a V8WorkerContext object to handle setting up and tearing down the v8::Context for the worker?
Kentaro Hara
Comment 4 2012-09-19 18:53:08 PDT
Comment on attachment 164662 [details] Patch Removing r? as I want to move initialization methods to V8Initializer.{h,cpp} first.
Kentaro Hara
Comment 5 2012-09-19 18:55:54 PDT
Comment on attachment 164662 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164662&action=review > Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp:-149 > - // Setup the security handlers and message listener. This only has > - // to be done once. > - static bool isV8Initialized = false; > - if (!isV8Initialized) > - v8::V8::AddMessageListener(&v8MessageHandler); BTW this code looks really strange: - Per the comment, 'isV8Initialized = true' should be added. - However, if I add 'isV8Initialized = true', fast/workers/worker-script-error.html and fast/workers/worker-close.html begin to fail. Will take a look in detail later.
Adam Barth
Comment 6 2012-09-20 10:43:58 PDT
Comment on attachment 164662 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164662&action=review >> Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp:-149 >> - v8::V8::AddMessageListener(&v8MessageHandler); > > BTW this code looks really strange: > > - Per the comment, 'isV8Initialized = true' should be added. > - However, if I add 'isV8Initialized = true', fast/workers/worker-script-error.html and fast/workers/worker-close.html begin to fail. > > Will take a look in detail later. I would assume we'd need to do it once per isolate rather than once across the entire process.
Kentaro Hara
Comment 7 2012-11-26 17:04:00 PST
*** This bug has been marked as a duplicate of bug 103210 ***
Note You need to log in before you can comment on or make changes to this bug.