Changeset 42768 in webkit
- Timestamp:
- Apr 22, 2009 7:34:40 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r42766 r42768 1 2009-04-22 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Autogenerate the XMLHttpRequest constructor getter/setter for the 6 WorkerContext and remove the now no longer needed JSWorkerContextBase.lut.h 7 file. 8 9 * DerivedSources.make: Remove JSWorkerContextBase.lut.h 10 * WebCore.xcodeproj/project.pbxproj: Ditto. 11 12 * bindings/js/JSWorkerContextBase.cpp: 13 * bindings/js/JSWorkerContextBase.h: Remove code to support hand written 14 code for XMLHttpRequest constructor lookup and shadowing. 15 16 * bindings/js/JSWorkerContextCustom.cpp: 17 (WebCore::JSWorkerContext::customGetOwnPropertySlot): Remove JSC prefixes. 18 (WebCore::JSWorkerContext::xmlHttpRequest): Added. Custom implementation of 19 cached constructor lookup. 20 * workers/WorkerContext.idl: Make the XMLHttpRequestConstructor accessor not 21 V8 specific. 22 1 23 2009-04-22 Darin Adler <darin@apple.com> 2 24 -
trunk/WebCore/DerivedSources.make
r42447 r42768 388 388 \ 389 389 JSRGBColor.lut.h \ 390 JSWorkerContextBase.lut.h \391 390 \ 392 391 JSJavaScriptCallFrame.h \ -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r42738 r42768 4335 4335 E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E182568E0EF2B02D00933242 /* JSWorkerContext.h */; }; 4336 4336 E18258AC0EF3CD7000933242 /* JSWorkerContextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18258AB0EF3CD7000933242 /* JSWorkerContextCustom.cpp */; }; 4337 E18259E70EF3E34B00933242 /* JSWorkerContextBase.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E18259E60EF3E34B00933242 /* JSWorkerContextBase.lut.h */; };4338 4337 E1A302BC0DE8370300C52F2C /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A302BB0DE8370300C52F2C /* StringBuilder.h */; }; 4339 4338 E1A302C10DE8376900C52F2C /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A302C00DE8376900C52F2C /* StringBuilder.cpp */; }; … … 9147 9146 E182568E0EF2B02D00933242 /* JSWorkerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContext.h; sourceTree = "<group>"; }; 9148 9147 E18258AB0EF3CD7000933242 /* JSWorkerContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContextCustom.cpp; sourceTree = "<group>"; }; 9149 E18259E60EF3E34B00933242 /* JSWorkerContextBase.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContextBase.lut.h; sourceTree = "<group>"; };9150 9148 E1A302BB0DE8370300C52F2C /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = "<group>"; }; 9151 9149 E1A302C00DE8376900C52F2C /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringBuilder.cpp; sourceTree = "<group>"; }; … … 13873 13871 E182568D0EF2B02D00933242 /* JSWorkerContext.cpp */, 13874 13872 E182568E0EF2B02D00933242 /* JSWorkerContext.h */, 13875 E18259E60EF3E34B00933242 /* JSWorkerContextBase.lut.h */,13876 13873 E1C362EE0EAF2AA9007410BC /* JSWorkerLocation.cpp */, 13877 13874 E1C362ED0EAF2AA9007410BC /* JSWorkerLocation.h */, … … 16087 16084 E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */, 16088 16085 E1C36D350EB0A094007410BC /* JSWorkerContextBase.h in Headers */, 16089 E18259E70EF3E34B00933242 /* JSWorkerContextBase.lut.h in Headers */,16090 16086 E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */, 16091 16087 E1271A580EEECDE400F61213 /* JSWorkerNavigator.h in Headers */, -
trunk/WebCore/bindings/js/JSWorkerContextBase.cpp
r41879 r42768 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. 4 4 * … … 32 32 #include "JSWorkerContextBase.h" 33 33 34 #include "Event.h"35 #include "JSDOMBinding.h"36 #include "JSEventListener.h"37 #include "JSMessageChannelConstructor.h"38 #include "JSMessageEvent.h"39 #include "JSMessagePort.h"40 #include "JSWorkerLocation.h"41 #include "JSWorkerNavigator.h"42 #include "JSXMLHttpRequestConstructor.h"43 34 #include "WorkerContext.h" 44 #include "WorkerLocation.h"45 35 46 36 using namespace JSC; 47 48 /*49 @begin JSWorkerContextBaseTable50 # -- Constructors --51 XMLHttpRequest jsWorkerContextBaseXMLHttpRequest DontDelete52 @end53 */54 55 static JSValuePtr jsWorkerContextBaseXMLHttpRequest(ExecState*, const Identifier&, const PropertySlot&);56 static void setJSWorkerContextBaseXMLHttpRequest(ExecState*, JSObject*, JSValuePtr);57 58 #include "JSWorkerContextBase.lut.h"59 37 60 38 namespace WebCore { 61 39 62 40 ASSERT_CLASS_FITS_IN_CELL(JSWorkerContextBase); 41 42 const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", 0, 0, 0 }; 63 43 64 44 JSWorkerContextBase::JSWorkerContextBase(PassRefPtr<JSC::Structure> structure, PassRefPtr<WorkerContext> impl) … … 77 57 } 78 58 79 static const HashTable* getJSWorkerContextBaseTable(ExecState* exec)80 {81 return getHashTableForGlobalData(exec->globalData(), &JSWorkerContextBaseTable);82 }83 84 const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", 0, 0, getJSWorkerContextBaseTable };85 86 void JSWorkerContextBase::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)87 {88 lookupPut<JSWorkerContextBase, Base>(exec, propertyName, value, getJSWorkerContextBaseTable(exec), this, slot);89 }90 91 bool JSWorkerContextBase::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)92 {93 const HashEntry* entry = getJSWorkerContextBaseTable(exec)->entry(exec, propertyName);94 if (entry) {95 if (entry->attributes() & Function)96 setUpStaticFunctionSlot(exec, entry, this, propertyName, slot);97 else98 slot.setCustom(this, entry->propertyGetter());99 return true;100 }101 102 return Base::getOwnPropertySlot(exec, propertyName, slot);103 }104 105 59 } // namespace WebCore 106 60 107 using namespace WebCore;108 109 JSValuePtr jsWorkerContextBaseXMLHttpRequest(ExecState* exec, const Identifier&, const PropertySlot& slot)110 {111 return getDOMConstructor<JSXMLHttpRequestConstructor>(exec, static_cast<JSWorkerContextBase*>(asObject(slot.slotBase())));112 }113 114 void setJSWorkerContextBaseXMLHttpRequest(ExecState* exec, JSObject* thisObject, JSValuePtr value)115 {116 // Shadowing a built-in constructor117 static_cast<JSWorkerContextBase*>(thisObject)->putDirect(Identifier(exec, "XMLHttpRequest"), value);118 }119 120 61 #endif // ENABLE(WORKERS) -
trunk/WebCore/bindings/js/JSWorkerContextBase.h
r41344 r42768 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 42 42 virtual ~JSWorkerContextBase(); 43 43 44 virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValuePtr, JSC::PutPropertySlot&);45 44 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } 46 45 static const JSC::ClassInfo s_info; … … 48 47 WorkerContext* impl() const { return m_impl.get(); } 49 48 virtual ScriptExecutionContext* scriptExecutionContext() const; 50 51 bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);52 49 53 50 private: -
trunk/WebCore/bindings/js/JSWorkerContextCustom.cpp
r42286 r42768 32 32 #include "JSDOMBinding.h" 33 33 #include "JSEventListener.h" 34 #include "JSXMLHttpRequestConstructor.h" 34 35 #include "ScheduledAction.h" 35 36 #include "WorkerContext.h" … … 40 41 namespace WebCore { 41 42 42 bool JSWorkerContext::customGetOwnPropertySlot( JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertySlot& slot)43 bool JSWorkerContext::customGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 43 44 { 44 45 // Look for overrides before looking at any of our own properties. … … 73 74 { 74 75 putDirect(Identifier(exec, "self"), value); 76 } 77 78 JSValuePtr JSWorkerContext::xmlHttpRequest(ExecState* exec) const 79 { 80 return getDOMConstructor<JSXMLHttpRequestConstructor>(exec, this); 75 81 } 76 82 -
trunk/WebCore/workers/WorkerContext.idl
r42178 r42768 49 49 attribute WorkerLocationConstructor WorkerLocation; 50 50 51 #if defined(V8_BINDING) 52 attribute XMLHttpRequestConstructor XMLHttpRequest; 53 #endif // V8_BINDING 51 attribute [JSCCustomGetter] XMLHttpRequestConstructor XMLHttpRequest; 54 52 55 53 // Timers
Note: See TracChangeset
for help on using the changeset viewer.