Changeset 270746 in webkit


Ignore:
Timestamp:
Dec 12, 2020 9:43:50 PM (3 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, reverting r270661.

Caused layout test failures and timeouts

Reverted changeset:

"Unreviewed, re-landing r270132."
https://bugs.webkit.org/show_bug.cgi?id=202874
https://trac.webkit.org/changeset/270661

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r270743 r270746  
     12020-12-12  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r270661.
     4
     5        Caused layout test failures and timeouts
     6
     7        Reverted changeset:
     8
     9        "Unreviewed, re-landing r270132."
     10        https://bugs.webkit.org/show_bug.cgi?id=202874
     11        https://trac.webkit.org/changeset/270661
     12
    1132020-12-12  Jiewen Tan  <jiewen_tan@apple.com>
    214
     
    49044916        Reviewed by Carlos Garcia Campos.
    49054917
    4906         As of https://bugs.webkit.org/show_bug.cgi?id=213063, Darwin platforms
    4907         use the RunLoop. Let's match them for consistency, and to delete some
     4918             use the RunLoop. Let's match them for consistency, and to delete some
    49084919        code.
    49094920
  • trunk/Source/WTF/wtf/RunLoop.h

    r270661 r270746  
    228228    Lock m_loopLock;
    229229#elif USE(COCOA_EVENT_LOOP)
    230     static void performWork(CFMachPortRef, void* msg, CFIndex size, void* info);
     230    static void performWork(void*);
    231231    RetainPtr<CFRunLoopRef> m_runLoop;
    232232    RetainPtr<CFRunLoopSourceRef> m_runLoopSource;
    233     RetainPtr<CFMachPortRef> m_port;
    234233#elif USE(GLIB_EVENT_LOOP)
    235234    void notify(Event, const char*);
  • trunk/Source/WTF/wtf/cf/RunLoopCF.cpp

    r270661 r270746  
    2929#include <CoreFoundation/CoreFoundation.h>
    3030#include <dispatch/dispatch.h>
    31 #include <mach/mach.h>
    3231#include <wtf/AutodrainedPool.h>
    3332#include <wtf/SchedulePair.h>
     
    4241}
    4342
    44 void RunLoop::performWork(CFMachPortRef, void*, CFIndex, void* info)
     43void RunLoop::performWork(void* context)
    4544{
    4645    AutodrainedPool pool;
    47     static_cast<RunLoop*>(info)->performWork();
     46    static_cast<RunLoop*>(context)->performWork();
    4847}
    4948
     
    5150    : m_runLoop(CFRunLoopGetCurrent())
    5251{
    53     CFMachPortContext context = { 0, this, nullptr, nullptr, nullptr };
    54     m_port = adoptCF(CFMachPortCreate(kCFAllocatorDefault, performWork, &context, nullptr));
    55     m_runLoopSource = adoptCF(CFMachPortCreateRunLoopSource(kCFAllocatorDefault, m_port.get(), 0));
     52    CFRunLoopSourceContext context = { 0, this, 0, 0, 0, 0, 0, 0, 0, performWork };
     53    m_runLoopSource = adoptCF(CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &context));
    5654    CFRunLoopAddSource(m_runLoop.get(), m_runLoopSource.get(), kCFRunLoopCommonModes);
    5755}
     
    5957RunLoop::~RunLoop()
    6058{
    61     CFMachPortInvalidate(m_port.get());
    6259    CFRunLoopSourceInvalidate(m_runLoopSource.get());
    6360}
     
    6562void RunLoop::wakeUp()
    6663{
    67     mach_msg_header_t header;
    68     header.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0);
    69     header.msgh_size = sizeof(mach_msg_header_t);
    70     header.msgh_remote_port = CFMachPortGetPort(m_port.get());
    71     header.msgh_local_port = MACH_PORT_NULL;
    72     header.msgh_id = 0;
    73     mach_msg_return_t result = mach_msg(&header, MACH_SEND_MSG | MACH_SEND_TIMEOUT, header.msgh_size, 0, MACH_PORT_NULL, 0, MACH_PORT_NULL);
    74     RELEASE_ASSERT(result == MACH_MSG_SUCCESS || result == MACH_SEND_TIMED_OUT);
    75     if (result == MACH_SEND_TIMED_OUT)
    76         mach_msg_destroy(&header);
     64    CFRunLoopSourceSignal(m_runLoopSource.get());
     65    CFRunLoopWakeUp(m_runLoop.get());
    7766}
    7867
  • trunk/Tools/ChangeLog

    r270743 r270746  
     12020-12-12  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r270661.
     4
     5        Caused layout test failures and timeouts
     6
     7        Reverted changeset:
     8
     9        "Unreviewed, re-landing r270132."
     10        https://bugs.webkit.org/show_bug.cgi?id=202874
     11        https://trac.webkit.org/changeset/270661
     12
    1132020-12-12  Jiewen Tan  <jiewen_tan@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/cocoa/UtilitiesCocoa.mm

    r270661 r270746  
    3939{
    4040    for (uint64_t i = 0; i < count; ++i)
    41         while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource) { }
     41        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
    4242}
    4343
Note: See TracChangeset for help on using the changeset viewer.