Changeset 56452 in webkit


Ignore:
Timestamp:
Mar 24, 2010 1:02:55 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-24 Anton Muhin <antonm@chromium.org>

Reviewed by Nate Chapin.

Use newly introduced SetPrototype method to deal with global objects.
https://bugs.webkit.org/show_bug.cgi?id=36497

No new tests, should be covered by the current test infrastructure.

  • bindings/v8/V8DOMWindowShell.cpp: (WebCore::V8DOMWindowShell::installDOMWindow):
  • bindings/v8/V8DOMWrapper.cpp: (WebCore::V8DOMWrapper::getConstructor):
  • bindings/v8/WorkerContextExecutionProxy.cpp: (WebCore::WorkerContextExecutionProxy::initContextIfNeeded):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56451 r56452  
     12010-03-24  Anton Muhin  <antonm@chromium.org>
     2
     3        Reviewed by Nate Chapin.
     4
     5        Use newly introduced SetPrototype method to deal with global objects.
     6        https://bugs.webkit.org/show_bug.cgi?id=36497
     7
     8        No new tests, should be covered by the current test infrastructure.
     9
     10        * bindings/v8/V8DOMWindowShell.cpp:
     11        (WebCore::V8DOMWindowShell::installDOMWindow):
     12        * bindings/v8/V8DOMWrapper.cpp:
     13        (WebCore::V8DOMWrapper::getConstructor):
     14        * bindings/v8/WorkerContextExecutionProxy.cpp:
     15        (WebCore::WorkerContextExecutionProxy::initContextIfNeeded):
     16
    1172010-03-24  Dmitry Titov  <dimich@chromium.org>
    218
  • trunk/WebCore/bindings/v8/V8DOMWindowShell.cpp

    r56166 r56452  
    345345bool V8DOMWindowShell::installDOMWindow(v8::Handle<v8::Context> context, DOMWindow* window)
    346346{
    347     v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");
    348     if (implicitProtoString.IsEmpty())
    349         return false;
    350 
    351347    // Create a new JS window object and use it as the prototype for the  shadow global object.
    352348    v8::Handle<v8::Function> windowConstructor = V8DOMWrapper::getConstructor(&V8DOMWindow::info, getHiddenObjectPrototype(context));
     
    364360
    365361    // Insert the window instance as the prototype of the shadow object.
    366     v8::Handle<v8::Object> v8Global = context->Global();
    367     V8DOMWrapper::setDOMWrapper(v8::Handle<v8::Object>::Cast(v8Global->GetPrototype()), &V8DOMWindow::info, window);
    368     v8Global->Set(implicitProtoString, jsWindow);
     362    v8::Handle<v8::Object> v8RealGlobal = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
     363    V8DOMWrapper::setDOMWrapper(v8RealGlobal, &V8DOMWindow::info, window);
     364    v8RealGlobal->SetPrototype(jsWindow);
    369365    return true;
    370366}
  • trunk/WebCore/bindings/v8/V8DOMWrapper.cpp

    r56166 r56452  
    135135    // Hotmail fix, see comments above.
    136136    if (!objectPrototype.IsEmpty())
    137         value->Set(v8::String::New("__proto__"), objectPrototype);
     137        value->SetPrototype(objectPrototype);
    138138    return value;
    139139}
  • trunk/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp

    r56375 r56452  
    166166    v8::Context::Scope scope(context);
    167167
    168     // Allocate strings used during initialization.
    169     v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");
    170 
    171168    // Create a new JS object and use it as the prototype for the shadow global object.
    172169    WrapperTypeInfo* contextType = &V8DedicatedWorkerContext::info;
     
    190187
    191188    // Insert the object instance as the prototype of the shadow object.
    192     v8::Handle<v8::Object> globalObject = m_context->Global();
    193     globalObject->Set(implicitProtoString, jsWorkerContext);
     189    v8::Handle<v8::Object> globalObject = v8::Handle<v8::Object>::Cast(m_context->Global()->GetPrototype());
     190    globalObject->SetPrototype(jsWorkerContext);
    194191    return true;
    195192}
Note: See TracChangeset for help on using the changeset viewer.