On Tue, Sep 30, 2008 at 4:18 PM, Marshall Greenblatt <[EMAIL PROTECTED]
> wrote:
> (Cross-listed to chromium-dev and v8-dev. Please CC me on any response.)
>
> Hi All,
>
> In the gears version of V8, we have the following method for retrieving a
> V8 context:
>
> v8::Local<v8::Context> GetV8Context();
>
> It was therefore hypothetically possible to create a Frame-independent
> NPScriptObject instance using code like the following:
>
> NPObject *GetGlobalScriptObject() {
> v8::Locker::AssertIsLocked();
> v8::HandleScope handle_scope;
> v8::Handle<v8::Context> context = GetV8Context();
> if (context.IsEmpty())
> return 0;
>
> v8::Context::Scope scope(context);
> v8::Handle<v8::Object> global = context->Global();
> return V8_NPN_CreateScriptObject(0, global);
> }
>
> However, this method does not work in the chromium version of V8 because
> the GetV8Context() implementation with no arguments has disappeared. Is
> there a new method for creating a Frame-independent NPScriptObject, or
> must all NPScriptObjects now be attached to a Frame?
>
After further examination it appears that gears provides it's own global
context implementation in gears/base/common/js_runner_cr.cc. So, this is
not specifically a difference in V8 versions. However, the underlying
question is still valid. Is there a method for creating a Frame-independent
NPScriptObject, or should all NPScriptObjects be attached to a Frame,
specifically in relation to the chromium project? Is creating our own
global V8 context considered a good, bad or indifferent approach?
>
>
> Thanks in advance for any feedback.
>
> Regards,
> Marshall
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Chromium-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/chromium-dev?hl=en
-~----------~----~----~----~------~----~------~--~---