Changeset 57991 in webkit
- Timestamp:
- Apr 21, 2010 10:21:36 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57990 r57991 1 2010-04-21 anton muhin <antonm@google.com> 2 3 Reviewed by Adam Barth. 4 5 [v8] Bail out if fetching of Object.prototype fails. 6 https://bugs.webkit.org/show_bug.cgi?id=37661 7 8 If for any reason we failed to fetch Object.prototype, context cannot 9 be properly initialized and we bail out. 10 11 * bindings/v8/V8DOMWindowShell.cpp: 12 (WebCore::V8DOMWindowShell::initContextIfNeeded): bail out if installHiddenObjectPrototype failed 13 (WebCore::V8DOMWindowShell::installHiddenObjectPrototype): bail out if failed to fetch Object.prototype 14 * bindings/v8/V8DOMWindowShell.h: return false if installHiddenObjectPrototype failed 15 1 16 2010-04-21 Timothy Hatcher <timothy@apple.com> 2 17 -
trunk/WebCore/bindings/v8/V8DOMWindowShell.cpp
r57715 r57991 287 287 } 288 288 289 installHiddenObjectPrototype(v8Context); 290 291 if (!installDOMWindow(v8Context, m_frame->domWindow())) 289 if (!installHiddenObjectPrototype(v8Context)) { 292 290 disposeContextHandles(); 291 return; 292 } 293 294 if (!installDOMWindow(v8Context, m_frame->domWindow())) { 295 disposeContextHandles(); 296 return; 297 } 293 298 294 299 updateDocument(); … … 504 509 } 505 510 506 voidV8DOMWindowShell::installHiddenObjectPrototype(v8::Handle<v8::Context> context)511 bool V8DOMWindowShell::installHiddenObjectPrototype(v8::Handle<v8::Context> context) 507 512 { 508 513 v8::Handle<v8::String> objectString = v8::String::New("Object"); … … 511 516 // Bail out if allocation failed. 512 517 if (objectString.IsEmpty() || prototypeString.IsEmpty() || hiddenObjectPrototypeString.IsEmpty()) 513 return ;518 return false; 514 519 515 520 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global()->Get(objectString)); 521 // Bail out if fetching failed. 522 if (object.IsEmpty()) 523 return false; 516 524 v8::Handle<v8::Value> objectPrototype = object->Get(prototypeString); 525 // Bail out if fetching failed. 526 if (objectPrototype.IsEmpty()) 527 return false; 517 528 518 529 context->Global()->SetHiddenValue(hiddenObjectPrototypeString, objectPrototype); 530 531 return true; 519 532 } 520 533 -
trunk/WebCore/bindings/v8/V8DOMWindowShell.h
r56716 r57991 75 75 static v8::Handle<v8::Value> getHiddenObjectPrototype(v8::Handle<v8::Context>); 76 76 // WARNING: Call |installHiddenObjectPrototype| only on fresh contexts! 77 static voidinstallHiddenObjectPrototype(v8::Handle<v8::Context>);77 static bool installHiddenObjectPrototype(v8::Handle<v8::Context>); 78 78 79 79 // To create JS Wrapper objects, we create a cache of a 'boiler plate'
Note: See TracChangeset
for help on using the changeset viewer.