Source/WebCore/bindings/v8/ScriptController.cpp
void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObject* object)
{
    v8::HandleScope handleScope;

    v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(frame);
    if (v8Context.IsEmpty())
        return;

    v8::Context::Scope scope(v8Context);

    v8::Handle<v8::Object> value = createV8ObjectForNPObject(object, 0);

    // Attach to the global object.
    v8::Handle<v8::Object> global = v8Context->Global();
    global->Set(v8String(key), value);
}
// Create a V8 object with an interceptor of NPObjectPropertyGetter.
Create a V8 object with an interceptor of NPObjectPropertyGetter.
Create a V8 object with an interceptor of NPObjectPropertyGetter .
void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObject* object)
{
    v8::HandleScope handleScope;
    v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(frame);
    if (v8Context.IsEmpty())
        return;
    v8::Context::Scope scope(v8Context);
    v8::Handle<v8::Object> value = createV8ObjectForNPObject(object, 0);
    v8::Handle<v8::Object> global = v8Context->Global();
    global->Set(v8String(key), value);
}
void ScriptController :: bindToWindowObject ( Frame * frame , const String & key , NPObject * object ) { v8 :: HandleScope handleScope ; v8 :: Handle < v8 :: Context > v8Context = V8Proxy :: mainWorldContext ( frame ) ; if ( v8Context . IsEmpty ( ) ) return ; v8 :: Context :: Scope scope ( v8Context ) ; v8 :: Handle < v8 :: Object > value = createV8ObjectForNPObject ( object , 0 ) ; v8 :: Handle < v8 :: Object > global = v8Context -> Global ( ) ; global -> Set ( v8String ( key ) , value ) ; }
Create a V8 object with an interceptor of NPObjectPropertyGetter.
Create a V8 object with an interceptor of NPObjectPropertyGetter .
// Attach to the global object.