WebKit Bugzilla
Attachment 339324 Details for
Bug 185073
: REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185073-20180502123023.patch (text/plain), 7.95 KB, created by
Chris Dumez
on 2018-05-02 12:30:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-02 12:30:24 PDT
Size:
7.95 KB
patch
obsolete
>Subversion Revision: 231251 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2472a2f144c28135f4c3cbbd2d0376c75cf31ff1..4bd7e1915d42c020beb94d2f1d540a756924d454 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,32 @@ >+2018-05-02 Chris Dumez <cdumez@apple.com> >+ >+ REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper >+ https://bugs.webkit.org/show_bug.cgi?id=185073 >+ <rdar://problem/39821223> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The following changes were made: >+ - Make sure SocketStream callbacks are always scheduled on the right runloop: >+ WebThreadRunLoop() on WebKitLegacy iOS, loaderRunLoop() on Windows and >+ main runloop otherwise. >+ - When the SocketStream callbacks are called, unconditionally call callOnMainThreadAndWait() >+ before calling methods on the SocketStream client. Previously, this code path >+ was specific to Windows but there is no reason to have platform-specific code here. >+ callOnMainThreadAndWait() calls the function right away if we're already on the main >+ thread, which will be the case on other platform than Windows. >+ >+ * platform/network/cf/SocketStreamHandleImplCFNet.cpp: >+ (WebCore::callbacksRunLoop): >+ (WebCore::callbacksRunLoopMode): >+ (WebCore::SocketStreamHandleImpl::scheduleStreams): >+ (WebCore::SocketStreamHandleImpl::pacExecutionCallback): >+ (WebCore::SocketStreamHandleImpl::executePACFileURL): >+ (WebCore::SocketStreamHandleImpl::removePACRunLoopSource): >+ (WebCore::SocketStreamHandleImpl::readStreamCallback): >+ (WebCore::SocketStreamHandleImpl::writeStreamCallback): >+ (WebCore::SocketStreamHandleImpl::platformClose): >+ > 2018-05-02 Carlos Alberto Lopez Perez <clopez@igalia.com> > > [GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022 >diff --git a/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp b/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp >index 33ca6cc3f272ced834aa3d7abf8ecd325580ebab..f783923662fa1abd7a3e243c7f2cf572d9286ac2 100644 >--- a/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp >@@ -53,6 +53,10 @@ > #include <WebKitSystemInterface/WebKitSystemInterface.h> > #endif > >+#if PLATFORM(IOS) >+#include "WebCoreThreadInternal.h" >+#endif >+ > #if PLATFORM(IOS) || PLATFORM(MAC) > extern "C" const CFStringRef kCFStreamPropertySourceApplication; > extern "C" const CFStringRef _kCFStreamSocketSetNoDelay; >@@ -71,6 +75,26 @@ WTF_DECLARE_CF_TYPE_TRAIT(CFHTTPMessage); > > namespace WebCore { > >+static inline CFRunLoopRef callbacksRunLoop() >+{ >+#if PLATFORM(WIN) >+ return loaderRunLoop(); >+#elif PLATFORM(IOS) >+ return WebThreadRunLoop(); >+#else >+ return CFRunLoopGetMain(); >+#endif >+} >+ >+static inline CFRunLoopMode callbacksRunLoopMode() >+{ >+#if PLATFORM(WIN) >+ return kCFRunLoopDefaultMode; >+#else >+ return kCFRunLoopCommonModes; >+#endif >+} >+ > SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, SourceApplicationAuditToken&& auditData) > : SocketStreamHandle(url, client) > , m_connectingSubstate(New) >@@ -119,14 +143,8 @@ void SocketStreamHandleImpl::scheduleStreams() > CFReadStreamSetClient(m_readStream.get(), static_cast<CFOptionFlags>(-1), readStreamCallback, &clientContext); > CFWriteStreamSetClient(m_writeStream.get(), static_cast<CFOptionFlags>(-1), writeStreamCallback, &clientContext); > >-#if PLATFORM(WIN) >- CFReadStreamScheduleWithRunLoop(m_readStream.get(), loaderRunLoop(), kCFRunLoopDefaultMode); >- CFWriteStreamScheduleWithRunLoop(m_writeStream.get(), loaderRunLoop(), kCFRunLoopDefaultMode); >-#else >- RELEASE_ASSERT(isMainThread()); >- CFReadStreamScheduleWithRunLoop(m_readStream.get(), CFRunLoopGetCurrent(), kCFRunLoopCommonModes); >- CFWriteStreamScheduleWithRunLoop(m_writeStream.get(), CFRunLoopGetCurrent(), kCFRunLoopCommonModes); >-#endif >+ CFReadStreamScheduleWithRunLoop(m_readStream.get(), callbacksRunLoop(), callbacksRunLoopMode()); >+ CFWriteStreamScheduleWithRunLoop(m_writeStream.get(), callbacksRunLoop(), callbacksRunLoopMode()); > > CFReadStreamOpen(m_readStream.get()); > CFWriteStreamOpen(m_writeStream.get()); >@@ -167,6 +185,7 @@ void SocketStreamHandleImpl::pacExecutionCallback(void* client, CFArrayRef proxy > { > SocketStreamHandleImpl* handle = static_cast<SocketStreamHandleImpl*>(client); > >+ RefPtr<SocketStreamHandle> protector(handle); > callOnMainThreadAndWait([&] { > ASSERT(handle->m_connectingSubstate == ExecutingPACFile); > // This time, the array won't have PAC as a first entry. >@@ -183,11 +202,7 @@ void SocketStreamHandleImpl::executePACFileURL(CFURLRef pacFileURL) > // CFNetwork returns an empty proxy array for WebSocket schemes, so use m_httpsURL. > CFStreamClientContext clientContext = { 0, this, retainSocketStreamHandle, releaseSocketStreamHandle, copyPACExecutionDescription }; > m_pacRunLoopSource = adoptCF(CFNetworkExecuteProxyAutoConfigurationURL(pacFileURL, m_httpsURL.get(), pacExecutionCallback, &clientContext)); >-#if PLATFORM(WIN) >- CFRunLoopAddSource(loaderRunLoop(), m_pacRunLoopSource.get(), kCFRunLoopDefaultMode); >-#else >- CFRunLoopAddSource(CFRunLoopGetCurrent(), m_pacRunLoopSource.get(), kCFRunLoopCommonModes); >-#endif >+ CFRunLoopAddSource(callbacksRunLoop(), m_pacRunLoopSource.get(), callbacksRunLoopMode()); > m_connectingSubstate = ExecutingPACFile; > } > >@@ -196,11 +211,7 @@ void SocketStreamHandleImpl::removePACRunLoopSource() > ASSERT(m_pacRunLoopSource); > > CFRunLoopSourceInvalidate(m_pacRunLoopSource.get()); >-#if PLATFORM(WIN) >- CFRunLoopRemoveSource(loaderRunLoop(), m_pacRunLoopSource.get(), kCFRunLoopDefaultMode); >-#else >- CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_pacRunLoopSource.get(), kCFRunLoopCommonModes); >-#endif >+ CFRunLoopRemoveSource(callbacksRunLoop(), m_pacRunLoopSource.get(), callbacksRunLoopMode()); > m_pacRunLoopSource = 0; > } > >@@ -463,16 +474,11 @@ void SocketStreamHandleImpl::readStreamCallback(CFReadStreamRef stream, CFStream > if (!handle->m_readStream) > return; > >-#if PLATFORM(WIN) > RefPtr<SocketStreamHandle> protector(handle); > callOnMainThreadAndWait([&] { > if (handle->m_readStream) > handle->readStreamCallback(type); > }); >-#else >- RELEASE_ASSERT(isMainThread()); >- handle->readStreamCallback(type); >-#endif > } > > void SocketStreamHandleImpl::writeStreamCallback(CFWriteStreamRef stream, CFStreamEventType type, void* clientCallBackInfo) >@@ -483,16 +489,11 @@ void SocketStreamHandleImpl::writeStreamCallback(CFWriteStreamRef stream, CFStre > if (!handle->m_writeStream) > return; > >-#if PLATFORM(WIN) > RefPtr<SocketStreamHandle> protector(handle); > callOnMainThreadAndWait([&] { > if (handle->m_writeStream) > handle->writeStreamCallback(type); > }); >-#else >- ASSERT(isMainThread()); >- handle->writeStreamCallback(type); >-#endif > } > > #if !PLATFORM(IOS) >@@ -727,13 +728,8 @@ void SocketStreamHandleImpl::platformClose() > return; > } > >-#if PLATFORM(WIN) >- CFReadStreamUnscheduleFromRunLoop(m_readStream.get(), loaderRunLoop(), kCFRunLoopDefaultMode); >- CFWriteStreamUnscheduleFromRunLoop(m_writeStream.get(), loaderRunLoop(), kCFRunLoopDefaultMode); >-#else >- CFReadStreamUnscheduleFromRunLoop(m_readStream.get(), CFRunLoopGetCurrent(), kCFRunLoopCommonModes); >- CFWriteStreamUnscheduleFromRunLoop(m_writeStream.get(), CFRunLoopGetCurrent(), kCFRunLoopCommonModes); >-#endif >+ CFReadStreamUnscheduleFromRunLoop(m_readStream.get(), callbacksRunLoop(), callbacksRunLoopMode()); >+ CFWriteStreamUnscheduleFromRunLoop(m_writeStream.get(), callbacksRunLoop(), callbacksRunLoopMode()); > > CFReadStreamClose(m_readStream.get()); > CFWriteStreamClose(m_writeStream.get());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185073
:
339315
|
339316
|
339324
|
339409