[Webkit-unassigned] [Bug 27785] [V8] Add a way to register V8 extensions for Isolated Worlds only
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jul 28 16:55:12 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=27785
--- Comment #5 from Matt Perry <mpcomplete at chromium.org> 2009-07-28 16:55:12 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > + v8::Persistent<v8::Context> createNewContext(v8::Handle<v8::Object>
> > > global, bool isolatedContext);
> > >
> > > Adding bools to this function doesn't really scale. Can we pass in the set of
> > > extensions somehow? You might want a helper function that grabs the proper set
> > > of extensions for normal and for isolated worlds.
> >
> > Doesn't scale how? Do you foresee many other parameters being added here?
>
> There seems to be room for expansion in the rest of the patch:
>
> + enum IsolatedContextTag { IsolatedContextOnly };
That was more of a way to use the type system to register an extension for a
different purpose.
> struct V8ExtensionInfo {
> String scheme;
> bool isolatedContextOnly;
> v8::Extension* extension;
> };
>
> What if we want to add extensions only for contexts created with certain
> permissions? etc.
True. I had another idea that would have addressed this use case. What about:
registerExtension(v8::Extension);
registerExtension(v8::Extension, int contextTypeBitfield);
evaluateInNewWorld(int contextType);
and then the consumer could group contexts as he pleases. For content scripts,
we would do:
registerExtension(foo, CONTENT_SCRIPT_CONTEXT);
registerExtension(bar, CONTENT_SCRIPT_CONTEXT | SOME_OTHER_TYPE);
registerExtension(baz, SOME_OTHER_TYPE);
...
evaluateInNewWorld(CONTENT_SCRIPT_CONTEXT); // would enable foo and bar
Thoughts?
--
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