Changeset 53785 in webkit
- Timestamp:
- Jan 24, 2010 2:54:18 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53780 r53785 1 2010-01-24 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Object Serialization assumes deserialization will always occur in the context of a webpage 6 https://bugs.webkit.org/show_bug.cgi?id=34056 7 rdar://7573833 8 9 Added ClassInfo to JSDOMGlobalObject and make the window and worker class info 10 inherit from it. With this in place we're able to determine whether a given 11 global object is a DOMGlobalObject, and then use that information to avoid 12 attempting to deserialize types that require the presence of the DOM. 13 14 No test as all global objects in webkit inherit from JSDOMGlobalObject. 15 16 * bindings/js/JSDOMGlobalObject.cpp: 17 (WebCore::): 18 * bindings/js/JSDOMGlobalObject.h: 19 (WebCore::JSDOMGlobalObject::classInfo): 20 * bindings/js/JSDOMWindowBase.cpp: 21 (WebCore::): 22 * bindings/js/JSWorkerContextBase.cpp: 23 (WebCore::): 24 * bindings/js/SerializedScriptValue.cpp: 25 (WebCore::DeserializingTreeWalker::DeserializingTreeWalker): 26 (WebCore::DeserializingTreeWalker::convertIfTerminal): 27 1 28 2010-01-24 Eric Carlson <eric.carlson@apple.com> 2 29 -
trunk/WebCore/bindings/js/JSDOMGlobalObject.cpp
r53430 r53785 40 40 41 41 namespace WebCore { 42 43 const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", 0, 0, 0 }; 42 44 43 45 JSDOMGlobalObject::JSDOMGlobalObject(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject::JSDOMGlobalObjectData* data, JSObject* thisValue) -
trunk/WebCore/bindings/js/JSDOMGlobalObject.h
r53430 r53785 68 68 DOMWrapperWorld* world() { return d()->m_world.get(); } 69 69 70 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } 71 static const JSC::ClassInfo s_info; 72 70 73 protected: 71 74 struct JSDOMGlobalObjectData : public JSC::JSGlobalObject::JSGlobalObjectData { -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r53587 r53785 42 42 namespace WebCore { 43 43 44 const ClassInfo JSDOMWindowBase::s_info = { "Window", 0, 0, 0 };44 const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, 0 }; 45 45 46 46 JSDOMWindowBase::JSDOMWindowBaseData::JSDOMWindowBaseData(PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell) -
trunk/WebCore/bindings/js/JSWorkerContextBase.cpp
r51330 r53785 43 43 ASSERT_CLASS_FITS_IN_CELL(JSWorkerContextBase); 44 44 45 const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", 0, 0, 0 };45 const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", &JSDOMGlobalObject::s_info, 0, 0 }; 46 46 47 47 JSWorkerContextBase::JSWorkerContextBase(NonNullPassRefPtr<JSC::Structure> structure, PassRefPtr<WorkerContext> impl) -
trunk/WebCore/bindings/js/SerializedScriptValue.cpp
r53774 r53785 615 615 DeserializingTreeWalker(ExecState* exec, bool mustCopy) 616 616 : BaseWalker(exec) 617 , m_globalObject(exec->lexicalGlobalObject()) 618 , m_isDOMGlobalObject(m_globalObject->inherits(&JSDOMGlobalObject::s_info)) 617 619 , m_mustCopy(mustCopy) 618 620 { … … 695 697 return new (m_exec) DateInstance(m_exec, value.asDouble()); 696 698 case SerializedScriptValueData::FileType: 699 if (!m_isDOMGlobalObject) 700 return jsNull(); 697 701 return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject()), File::create(value.asString().crossThreadString())); 698 702 case SerializedScriptValueData::FileListType: { 703 if (!m_isDOMGlobalObject) 704 return jsNull(); 699 705 RefPtr<FileList> result = FileList::create(); 700 706 SerializedFileList* serializedFileList = value.asFileList(); … … 747 753 748 754 private: 755 JSGlobalObject* m_globalObject; 756 bool m_isDOMGlobalObject; 749 757 bool m_mustCopy; 750 758 };
Note: See TracChangeset
for help on using the changeset viewer.