Hi, Marshall,
I'm not quite sure what you are trying to do; a frame-independent script
object is generally something we'd try not to do.  I admit, I'm not up to
speed with what Gears may have needed to do to support some of its
background workers, and maybe that is where you found this call.

Are you trying to run in the renderer process or the browser process?  Are
you writing a plugin?

Sorry for the vague questions, I'm not sure how to answer the questions
without more context.

Mike


On Tue, Sep 30, 2008 at 1:50 PM, Marshall Greenblatt <[EMAIL PROTECTED]
> wrote:

> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to