To kill V8Proxy, we can move runScript() from V8Proxy to ScriptSourceCode. - ScriptSourceCode::runScript() should be a static method. It should receive ScriptExecutionContext on which the script is evaluated. - After this patch is landed, I'll remove WorkerContextExecutionContext::runScript() and ScriptDebugServer::runScript().
Created attachment 159927 [details] Patch
Comment on attachment 159927 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=159927&action=review > Source/WebCore/bindings/v8/ScriptSourceCode.cpp:45 > +v8::Local<v8::Value> ScriptSourceCode::runScript(v8::Handle<v8::Script> script, ScriptExecutionContext* context) Hum... I think of ScriptSourceCode has being a model class for the code. This feels more like something that should go in a controller class, like ScriptController since we're instructing V8 to do something (i.e., execute script). Is this function called on multiple threads? If it's only the main thread, I'd put it on ScriptController and try to use m_frame->document() rather than passing in a ScriptExecutionContext* function. If this is something we call from worker threads as well, we might need to introduce a new header, something like V8Executive, that we use for actually executing code.
I'm going to give this some more thought after I make it through some other tasks for today.
Comment on attachment 159927 [details] Patch I like the idea, but I agree with dr. barth that this is the wrong place to put this.
Created attachment 160057 [details] Patch
Put runScript() in ScriptRunner.h.
Created attachment 160058 [details] Patch
Comment on attachment 160058 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=160058&action=review > Source/WebCore/bindings/v8/ScriptRunner.h:38 > + // Run an already compiled script. > + static v8::Local<v8::Value> runScript(v8::Handle<v8::Script>, ScriptExecutionContext*); runScript -> runCompiledScript and delete the comment?
Committed r126377: <http://trac.webkit.org/changeset/126377>
(In reply to comment #8) > > Source/WebCore/bindings/v8/ScriptRunner.h:38 > > + // Run an already compiled script. > > + static v8::Local<v8::Value> runScript(v8::Handle<v8::Script>, ScriptExecutionContext*); > > runScript -> runCompiledScript and delete the comment? Done. Thanks.