Changeset 42768 in webkit


Ignore:
Timestamp:
Apr 22, 2009 7:34:40 PM (15 years ago)
Author:
weinig@apple.com
Message:

2009-04-22 Sam Weinig <sam@webkit.org>

Reviewed by Anders Carlsson.

Autogenerate the XMLHttpRequest constructor getter/setter for the
WorkerContext and remove the now no longer needed JSWorkerContextBase.lut.h
file.

  • DerivedSources.make: Remove JSWorkerContextBase.lut.h
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • bindings/js/JSWorkerContextBase.cpp:
  • bindings/js/JSWorkerContextBase.h: Remove code to support hand written code for XMLHttpRequest constructor lookup and shadowing.
  • bindings/js/JSWorkerContextCustom.cpp: (WebCore::JSWorkerContext::customGetOwnPropertySlot): Remove JSC prefixes. (WebCore::JSWorkerContext::xmlHttpRequest): Added. Custom implementation of cached constructor lookup.
  • workers/WorkerContext.idl: Make the XMLHttpRequestConstructor accessor not V8 specific.
Location:
trunk/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r42766 r42768  
     12009-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
    1232009-04-22  Darin Adler  <darin@apple.com>
    224
  • trunk/WebCore/DerivedSources.make

    r42447 r42768  
    388388    \
    389389    JSRGBColor.lut.h \
    390     JSWorkerContextBase.lut.h \
    391390    \
    392391    JSJavaScriptCallFrame.h \
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r42738 r42768  
    43354335                E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E182568E0EF2B02D00933242 /* JSWorkerContext.h */; };
    43364336                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 */; };
    43384337                E1A302BC0DE8370300C52F2C /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A302BB0DE8370300C52F2C /* StringBuilder.h */; };
    43394338                E1A302C10DE8376900C52F2C /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A302C00DE8376900C52F2C /* StringBuilder.cpp */; };
     
    91479146                E182568E0EF2B02D00933242 /* JSWorkerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContext.h; sourceTree = "<group>"; };
    91489147                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>"; };
    91509148                E1A302BB0DE8370300C52F2C /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = "<group>"; };
    91519149                E1A302C00DE8376900C52F2C /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringBuilder.cpp; sourceTree = "<group>"; };
     
    1387313871                                E182568D0EF2B02D00933242 /* JSWorkerContext.cpp */,
    1387413872                                E182568E0EF2B02D00933242 /* JSWorkerContext.h */,
    13875                                 E18259E60EF3E34B00933242 /* JSWorkerContextBase.lut.h */,
    1387613873                                E1C362EE0EAF2AA9007410BC /* JSWorkerLocation.cpp */,
    1387713874                                E1C362ED0EAF2AA9007410BC /* JSWorkerLocation.h */,
     
    1608716084                                E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */,
    1608816085                                E1C36D350EB0A094007410BC /* JSWorkerContextBase.h in Headers */,
    16089                                 E18259E70EF3E34B00933242 /* JSWorkerContextBase.lut.h in Headers */,
    1609016086                                E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */,
    1609116087                                E1271A580EEECDE400F61213 /* JSWorkerNavigator.h in Headers */,
  • trunk/WebCore/bindings/js/JSWorkerContextBase.cpp

    r41879 r42768  
    11/*
    2  * Copyright (C) 2008 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
    33 * Copyright (C) 2009 Google Inc. All Rights Reserved.
    44 *
     
    3232#include "JSWorkerContextBase.h"
    3333
    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"
    4334#include "WorkerContext.h"
    44 #include "WorkerLocation.h"
    4535
    4636using namespace JSC;
    47 
    48 /*
    49 @begin JSWorkerContextBaseTable
    50 # -- Constructors --
    51   XMLHttpRequest                jsWorkerContextBaseXMLHttpRequest               DontDelete
    52 @end
    53 */
    54 
    55 static JSValuePtr jsWorkerContextBaseXMLHttpRequest(ExecState*, const Identifier&, const PropertySlot&);
    56 static void setJSWorkerContextBaseXMLHttpRequest(ExecState*, JSObject*, JSValuePtr);
    57 
    58 #include "JSWorkerContextBase.lut.h"
    5937
    6038namespace WebCore {
    6139
    6240ASSERT_CLASS_FITS_IN_CELL(JSWorkerContextBase);
     41
     42const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", 0, 0, 0 };
    6343
    6444JSWorkerContextBase::JSWorkerContextBase(PassRefPtr<JSC::Structure> structure, PassRefPtr<WorkerContext> impl)
     
    7757}
    7858
    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         else
    98             slot.setCustom(this, entry->propertyGetter());
    99         return true;
    100     }
    101 
    102     return Base::getOwnPropertySlot(exec, propertyName, slot);
    103 }
    104 
    10559} // namespace WebCore
    10660
    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 constructor
    117     static_cast<JSWorkerContextBase*>(thisObject)->putDirect(Identifier(exec, "XMLHttpRequest"), value);
    118 }
    119 
    12061#endif // ENABLE(WORKERS)
  • trunk/WebCore/bindings/js/JSWorkerContextBase.h

    r41344 r42768  
    11/*
    2  * Copyright (C) 2008 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4242        virtual ~JSWorkerContextBase();
    4343
    44         virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValuePtr, JSC::PutPropertySlot&);
    4544        virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
    4645        static const JSC::ClassInfo s_info;
     
    4847        WorkerContext* impl() const { return m_impl.get(); }
    4948        virtual ScriptExecutionContext* scriptExecutionContext() const;
    50 
    51         bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    5249
    5350    private:
  • trunk/WebCore/bindings/js/JSWorkerContextCustom.cpp

    r42286 r42768  
    3232#include "JSDOMBinding.h"
    3333#include "JSEventListener.h"
     34#include "JSXMLHttpRequestConstructor.h"
    3435#include "ScheduledAction.h"
    3536#include "WorkerContext.h"
     
    4041namespace WebCore {
    4142
    42 bool JSWorkerContext::customGetOwnPropertySlot(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertySlot& slot)
     43bool JSWorkerContext::customGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    4344{
    4445    // Look for overrides before looking at any of our own properties.
     
    7374{
    7475    putDirect(Identifier(exec, "self"), value);
     76}
     77
     78JSValuePtr JSWorkerContext::xmlHttpRequest(ExecState* exec) const
     79{
     80    return getDOMConstructor<JSXMLHttpRequestConstructor>(exec, this);
    7581}
    7682
  • trunk/WebCore/workers/WorkerContext.idl

    r42178 r42768  
    4949        attribute WorkerLocationConstructor WorkerLocation;
    5050
    51 #if defined(V8_BINDING)       
    52         attribute XMLHttpRequestConstructor XMLHttpRequest;
    53 #endif  // V8_BINDING
     51        attribute [JSCCustomGetter] XMLHttpRequestConstructor XMLHttpRequest;
    5452
    5553        // Timers
Note: See TracChangeset for help on using the changeset viewer.