Changeset 56452 in webkit
- Timestamp:
- Mar 24, 2010 1:02:55 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r56451 r56452 1 2010-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 1 17 2010-03-24 Dmitry Titov <dimich@chromium.org> 2 18 -
trunk/WebCore/bindings/v8/V8DOMWindowShell.cpp
r56166 r56452 345 345 bool V8DOMWindowShell::installDOMWindow(v8::Handle<v8::Context> context, DOMWindow* window) 346 346 { 347 v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");348 if (implicitProtoString.IsEmpty())349 return false;350 351 347 // Create a new JS window object and use it as the prototype for the shadow global object. 352 348 v8::Handle<v8::Function> windowConstructor = V8DOMWrapper::getConstructor(&V8DOMWindow::info, getHiddenObjectPrototype(context)); … … 364 360 365 361 // Insert the window instance as the prototype of the shadow object. 366 v8::Handle<v8::Object> v8 Global = context->Global();367 V8DOMWrapper::setDOMWrapper(v8 ::Handle<v8::Object>::Cast(v8Global->GetPrototype()), &V8DOMWindow::info, window);368 v8 Global->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); 369 365 return true; 370 366 } -
trunk/WebCore/bindings/v8/V8DOMWrapper.cpp
r56166 r56452 135 135 // Hotmail fix, see comments above. 136 136 if (!objectPrototype.IsEmpty()) 137 value->Set (v8::String::New("__proto__"),objectPrototype);137 value->SetPrototype(objectPrototype); 138 138 return value; 139 139 } -
trunk/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
r56375 r56452 166 166 v8::Context::Scope scope(context); 167 167 168 // Allocate strings used during initialization.169 v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");170 171 168 // Create a new JS object and use it as the prototype for the shadow global object. 172 169 WrapperTypeInfo* contextType = &V8DedicatedWorkerContext::info; … … 190 187 191 188 // 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); 194 191 return true; 195 192 }
Note: See TracChangeset
for help on using the changeset viewer.