WebKit Bugzilla
Attachment 357594 Details for
Bug 192804
: Some iOS app crash in FrameLoader::checkCompleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixed builds and incorporated Tim's comment
bug-192804-20181218120224.patch (text/plain), 4.04 KB, created by
Ryosuke Niwa
on 2018-12-18 12:02:25 PST
(
hide
)
Description:
Fixed builds and incorporated Tim's comment
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-12-18 12:02:25 PST
Size:
4.04 KB
patch
obsolete
>Subversion Revision: 239319 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6ff69a5dcced4968f02d3d4bbe01f91e5c902ac0..97389a5b7181988dc3c74054bcb5006da0cf0378 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2018-12-17 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Some iOS app crash in FrameLoader::checkCompleted >+ https://bugs.webkit.org/show_bug.cgi?id=192804 >+ <rdar://problem/44240573> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread >+ is trying to send a delegate message. Disable the release assertion while this is happening >+ so that iOS app would not crash. >+ >+ Unfortunately no new test as there is no way to easily test UIWebView in iOS, >+ and this requires a race between the web thread & the main thread. >+ >+ * dom/ScriptDisallowedScope.h: >+ (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed): >+ * platform/ios/wak/WebCoreThread.h: >+ * platform/ios/wak/WebCoreThread.mm: >+ (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope): >+ (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope): >+ (SendDelegateMessage): >+ > 2018-12-17 Eric Carlson <eric.carlson@apple.com> > > [MediaStream] A stream's first video frame should be rendered >diff --git a/Source/WebCore/dom/ScriptDisallowedScope.h b/Source/WebCore/dom/ScriptDisallowedScope.h >index 9b2b77f660054cc09092e1d939e5d2c929cbb986..a2b61b151175f458d71765aed95002f92de17fc2 100644 >--- a/Source/WebCore/dom/ScriptDisallowedScope.h >+++ b/Source/WebCore/dom/ScriptDisallowedScope.h >@@ -26,6 +26,10 @@ > #include "ContainerNode.h" > #include <wtf/MainThread.h> > >+#if PLATFORM(IOS_FAMILY) >+#include "WebCoreThread.h" >+#endif >+ > namespace WebCore { > > class ScriptDisallowedScope { >@@ -86,7 +90,11 @@ public: > static bool isScriptAllowed() > { > ASSERT(isMainThread()); >+#if PLATFORM(IOS_FAMILY) >+ return !s_count || webThreadDelegateMessageScopeCount; >+#else > return !s_count; >+#endif > } > }; > >diff --git a/Source/WebCore/platform/ios/wak/WebCoreThread.h b/Source/WebCore/platform/ios/wak/WebCoreThread.h >index e7d7bc6816688896c1abe9f10105fd5ba88de082..e115405a5c7b49f89129627c840fe4d80e21c864 100644 >--- a/Source/WebCore/platform/ios/wak/WebCoreThread.h >+++ b/Source/WebCore/platform/ios/wak/WebCoreThread.h >@@ -44,6 +44,7 @@ typedef struct { > } WebThreadContext; > > extern volatile bool webThreadShouldYield; >+extern volatile unsigned webThreadDelegateMessageScopeCount; > > #ifdef __OBJC__ > @class NSRunLoop; >diff --git a/Source/WebCore/platform/ios/wak/WebCoreThread.mm b/Source/WebCore/platform/ios/wak/WebCoreThread.mm >index df0c0b1c6e7ecdee2d3fb090fa9e6cd4b7b7c916..b7336c1973ae8753d3858370801b6bb521da25d8 100644 >--- a/Source/WebCore/platform/ios/wak/WebCoreThread.mm >+++ b/Source/WebCore/platform/ios/wak/WebCoreThread.mm >@@ -132,6 +132,8 @@ static void WebCoreObjCDeallocWithWebThreadLockImpl(id self, SEL _cmd); > > static NSMutableArray* sAsyncDelegates = nil; > >+WEBCORE_EXPORT volatile unsigned webThreadDelegateMessageScopeCount = 0; >+ > static inline void SendMessage(NSInvocation* invocation) > { > [invocation invoke]; >@@ -171,6 +173,16 @@ static void HandleDelegateSource(void*) > #endif > } > >+class WebThreadDelegateMessageScope { >+public: >+ WebThreadDelegateMessageScope() { ++webThreadDelegateMessageScopeCount; } >+ ~WebThreadDelegateMessageScope() >+ { >+ ASSERT(webThreadDelegateMessageScopeCount); >+ --webThreadDelegateMessageScopeCount; >+ } >+}; >+ > static void SendDelegateMessage(NSInvocation* invocation) > { > if (!WebThreadIsCurrent()) { >@@ -194,6 +206,7 @@ static void SendDelegateMessage(NSInvocation* invocation) > #endif > > { >+ WebThreadDelegateMessageScope delegateScope; > // Code block created to scope JSC::JSLock::DropAllLocks outside of WebThreadLock() > JSC::JSLock::DropAllLocks dropAllLocks(WebCore::commonVM()); > _WebThreadUnlock();
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 192804
:
357536
| 357594