[Webkit-unassigned] [Bug 99975] Remove ensureAuxiliaryContext

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 26 13:29:22 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=99975





--- Comment #10 from Joshua Bell <jsbell at chromium.org>  2012-10-26 13:30:32 PST ---
(From update of attachment 170081)
View in context: https://bugs.webkit.org/attachment.cgi?id=170081&action=review

>> Source/WebCore/bindings/v8/V8Binding.cpp:322
>> +            return frame->script()->mainWorldContext();
> 
> This seems wrong.  If we pass UseCurrentWorld but we're not in a V8 context, then we'll return the main world's context.  Perhaps this function should crash if we're not in a context?
> 
> The underlying problem is that the operation this function is trying to perform is impossible.  It's not possible to convert a ScriptExecutionContext to a v8::Context because there is a one-to-many relationship between ScriptExecutionContext and v8::Context.

I'm thinking: a variant of this patch except that instead of this toV8Context(ScriptExecutionContext, WorldToUse) there is a static function in IDBBindingUtilities that does a subset - given a ScriptExecutionContext, assume it's a Document or WorkerContext (which is true for IDB), which would be the equivalent of always calling this method with UseCurrentWorld. That moves the "risk" to IDB code.

And remove the fallback to mainWorldContext() - if there isn't a current context (i.e. this is executing outside a script stack), then return a temporary context via v8::Local<v8::Context>()

My confidence in the above is not high, though.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list