Changeset 102797 in webkit


Ignore:
Timestamp:
Dec 14, 2011 10:36:45 AM (12 years ago)
Author:
andersca@apple.com
Message:

Add back the callOnMainThread overload that takes a WTF::Function
https://bugs.webkit.org/show_bug.cgi?id=74512

Reviewed by Darin Adler.

Source/JavaScriptCore:

Add back the overload; the changes to WebCore should hopefully keep Windows building.

  • wtf/MainThread.cpp:

(WTF::callFunctionObject):
(WTF::callOnMainThread):

  • wtf/MainThread.h:

Source/WebCore:

Explicitly qualify the Function enum flag, since MSVC2005 is too stupid to disambiguate
the Function class template and the enum flag.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertyDescriptor):

  • bindings/js/JSHistoryCustom.cpp:

(WebCore::JSHistory::getOwnPropertySlotDelegate):
(WebCore::JSHistory::getOwnPropertyDescriptorDelegate):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::JSLocation::getOwnPropertySlotDelegate):
(WebCore::JSLocation::getOwnPropertyDescriptorDelegate):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r102743 r102797  
     12011-12-14  Anders Carlsson  <andersca@apple.com>
     2
     3        Add back the callOnMainThread overload that takes a WTF::Function
     4        https://bugs.webkit.org/show_bug.cgi?id=74512
     5
     6        Reviewed by Darin Adler.
     7
     8        Add back the overload; the changes to WebCore should hopefully keep Windows building.
     9
     10        * wtf/MainThread.cpp:
     11        (WTF::callFunctionObject):
     12        (WTF::callOnMainThread):
     13        * wtf/MainThread.h:
     14
    1152011-12-13  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/JavaScriptCore/wtf/MainThread.cpp

    r102737 r102797  
    218218}
    219219
     220static void callFunctionObject(void* context)
     221{
     222    Function<void ()>* function = static_cast<Function<void ()>*>(context);
     223    (*function)();
     224    delete function;
     225}
     226
     227void callOnMainThread(const Function<void ()>& function)
     228{
     229    callOnMainThread(callFunctionObject, new Function<void ()>(function));
     230}
     231
    220232void setMainThreadCallbacksPaused(bool paused)
    221233{
  • trunk/Source/JavaScriptCore/wtf/MainThread.h

    r102737 r102797  
    4747void cancelCallOnMainThread(MainThreadFunction*, void* context);
    4848
     49template<typename> class Function;
     50void callOnMainThread(const Function<void ()>&);
     51   
    4952void setMainThreadCallbacksPaused(bool paused);
    5053
  • trunk/Source/WebCore/ChangeLog

    r102794 r102797  
     12011-12-14  Anders Carlsson  <andersca@apple.com>
     2
     3        Add back the callOnMainThread overload that takes a WTF::Function
     4        https://bugs.webkit.org/show_bug.cgi?id=74512
     5
     6        Reviewed by Darin Adler.
     7
     8        Explicitly qualify the Function enum flag, since MSVC2005 is too stupid to disambiguate
     9        the Function class template and the enum flag.
     10
     11        * bindings/js/JSDOMWindowCustom.cpp:
     12        (WebCore::JSDOMWindow::getOwnPropertySlot):
     13        (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
     14        * bindings/js/JSHistoryCustom.cpp:
     15        (WebCore::JSHistory::getOwnPropertySlotDelegate):
     16        (WebCore::JSHistory::getOwnPropertyDescriptorDelegate):
     17        * bindings/js/JSLocationCustom.cpp:
     18        (WebCore::JSLocation::getOwnPropertySlotDelegate):
     19        (WebCore::JSLocation::getOwnPropertyDescriptorDelegate):
     20
    1212011-12-14  Kenneth Russell  <kbr@google.com>
    222
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r102722 r102797  
    138138        // It ignores any custom properties that might be set on the DOMWindow (including a custom prototype).
    139139        entry = s_info.propHashTable(exec)->entry(exec, propertyName);
    140         if (entry && !(entry->attributes() & Function) && entry->propertyGetter() == jsDOMWindowClosed) {
     140        if (entry && !(entry->attributes() & JSC::Function) && entry->propertyGetter() == jsDOMWindowClosed) {
    141141            slot.setCustom(thisObject, entry->propertyGetter());
    142142            return true;
    143143        }
    144144        entry = JSDOMWindowPrototype::s_info.propHashTable(exec)->entry(exec, propertyName);
    145         if (entry && (entry->attributes() & Function) && entry->function() == jsDOMWindowPrototypeFunctionClose) {
     145        if (entry && (entry->attributes() & JSC::Function) && entry->function() == jsDOMWindowPrototypeFunctionClose) {
    146146            slot.setCustom(thisObject, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
    147147            return true;
     
    171171    entry = JSDOMWindowPrototype::s_info.propHashTable(exec)->entry(exec, propertyName);
    172172    if (entry) {
    173         if (entry->attributes() & Function) {
     173        if (entry->attributes() & JSC::Function) {
    174174            if (entry->function() == jsDOMWindowPrototypeFunctionBlur) {
    175175                if (!allowsAccess) {
     
    282282        // It ignores any custom properties that might be set on the DOMWindow (including a custom prototype).
    283283        entry = s_info.propHashTable(exec)->entry(exec, propertyName);
    284         if (entry && !(entry->attributes() & Function) && entry->propertyGetter() == jsDOMWindowClosed) {
     284        if (entry && !(entry->attributes() & JSC::Function) && entry->propertyGetter() == jsDOMWindowClosed) {
    285285            descriptor.setDescriptor(jsBoolean(true), ReadOnly | DontDelete | DontEnum);
    286286            return true;
    287287        }
    288288        entry = JSDOMWindowPrototype::s_info.propHashTable(exec)->entry(exec, propertyName);
    289         if (entry && (entry->attributes() & Function) && entry->function() == jsDOMWindowPrototypeFunctionClose) {
     289        if (entry && (entry->attributes() & JSC::Function) && entry->function() == jsDOMWindowPrototypeFunctionClose) {
    290290            PropertySlot slot;
    291291            slot.setCustom(thisObject, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
  • trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp

    r100006 r102797  
    6969    if (entry) {
    7070        // Allow access to back(), forward() and go() from any frame.
    71         if (entry->attributes() & Function) {
     71        if (entry->attributes() & JSC::Function) {
    7272            if (entry->function() == jsHistoryPrototypeFunctionBack) {
    7373                slot.setCustom(this, nonCachingStaticBackFunctionGetter);
     
    110110        PropertySlot slot;
    111111        // Allow access to back(), forward() and go() from any frame.
    112         if (entry->attributes() & Function) {
     112        if (entry->attributes() & JSC::Function) {
    113113            if (entry->function() == jsHistoryPrototypeFunctionBack) {
    114114                slot.setCustom(this, nonCachingStaticBackFunctionGetter);
  • trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp

    r100006 r102797  
    6565    // Check for the few functions that we allow, even when called cross-domain.
    6666    const HashEntry* entry = JSLocationPrototype::s_info.propHashTable(exec)->entry(exec, propertyName);
    67     if (entry && (entry->attributes() & Function)) {
     67    if (entry && (entry->attributes() & JSC::Function)) {
    6868        if (entry->function() == jsLocationPrototypeFunctionReplace) {
    6969            slot.setCustom(this, nonCachingStaticReplaceFunctionGetter);
     
    102102    const HashEntry* entry = JSLocationPrototype::s_info.propHashTable(exec)->entry(exec, propertyName);
    103103    PropertySlot slot;
    104     if (entry && (entry->attributes() & Function)) {
     104    if (entry && (entry->attributes() & JSC::Function)) {
    105105        if (entry->function() == jsLocationPrototypeFunctionReplace) {
    106106            slot.setCustom(this, nonCachingStaticReplaceFunctionGetter);
Note: See TracChangeset for help on using the changeset viewer.