WebKit Bugzilla
Attachment 361994 Details for
Bug 194641
: Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes the bug
bug-194641-20190213214320.patch (text/plain), 3.37 KB, created by
Ryosuke Niwa
on 2019-02-13 21:43:21 PST
(
hide
)
Description:
Fixes the bug
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2019-02-13 21:43:21 PST
Size:
3.37 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 241496) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2019-02-13 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy >+ https://bugs.webkit.org/show_bug.cgi?id=194641 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixed the bug by adding a null check to WebFrame::parentFrame. >+ >+ * WebProcess/WebPage/WebFrame.cpp: >+ (WebKit::WebFrame::parentFrame const): >+ > 2019-02-13 Alan Coon <alancoon@apple.com> > > Apply patch. rdar://problem/40966400 >Index: Source/WebKit/WebProcess/WebPage/WebFrame.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebFrame.cpp (revision 241496) >+++ Source/WebKit/WebProcess/WebPage/WebFrame.cpp (working copy) >@@ -463,9 +463,13 @@ String WebFrame::innerText() const > WebFrame* WebFrame::parentFrame() const > { > if (!m_coreFrame || !m_coreFrame->ownerElement()) >- return 0; >+ return nullptr; >+ >+ auto* frame = m_coreFrame->ownerElement()->document().frame(); >+ if (!frame) >+ return nullptr; > >- return WebFrame::fromCoreFrame(*m_coreFrame->ownerElement()->document().frame()); >+ return WebFrame::fromCoreFrame(*frame); > } > > Ref<API::Array> WebFrame::childFrames() >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 241498) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-02-13 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy >+ https://bugs.webkit.org/show_bug.cgi?id=194641 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added a call to WKBundleFrameGetParentFrame to an existing test for didRemoveFrameFromHierarchy >+ so that the test would fail without this fix. >+ >+ * TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp: >+ (TestWebKitAPI::didRemoveFrameFromHierarchyCallback): >+ > 2019-02-13 Alan Coon <alancoon@apple.com> > > Cherry-pick r241288. rdar://problem/47992210 >Index: Tools/TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp (revision 241496) >+++ Tools/TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp (working copy) >@@ -30,6 +30,7 @@ > #include "InjectedBundleTest.h" > > #include "PlatformUtilities.h" >+#include <WebKit/WKBundleFrame.h> > #include <WebKit/WKBundlePage.h> > > namespace TestWebKitAPI { >@@ -45,10 +46,12 @@ static InjectedBundleTest::Register<DidR > > static unsigned didRemoveFrameFromHierarchyCount; > >-void didRemoveFrameFromHierarchyCallback(WKBundlePageRef page, WKBundleFrameRef, WKTypeRef*, const void*) >+void didRemoveFrameFromHierarchyCallback(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void*) > { > didRemoveFrameFromHierarchyCount++; > >+ RELEASE_ASSERT(!WKBundleFrameGetParentFrame(frame)); >+ > WKRetainPtr<WKStringRef> message(AdoptWK, WKStringCreateWithUTF8CString("DidRemoveFrameFromHierarchy")); > WKBundlePagePostMessage(page, message.get(), message.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 194641
: 361994