WebKit Bugzilla
Attachment 348649 Details for
Bug 189199
: Assertion hit in ~CompletionHandler() from ~WebFrame()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189199-20180831103904.patch (text/plain), 17.07 KB, created by
Chris Dumez
on 2018-08-31 10:39:05 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-08-31 10:39:05 PDT
Size:
17.07 KB
patch
obsolete
>Subversion Revision: 235556 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 28ba10590b42eaa58838491f51ac3fa9654778c2..0c4af7172205928898b0add223356fa99a066b1f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-31 Chris Dumez <cdumez@apple.com> >+ >+ Assertion hit in ~CompletionHandler() from ~WebFrame() >+ https://bugs.webkit.org/show_bug.cgi?id=189199 >+ <rdar://problem/42657233> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The issue was caused by WebFrame::m_willSubmitFormCompletionHandlers implicitly containing >+ CompletionHandlers (wrapped in WTF::Functions) and not calling them upon WebFrame >+ destruction. >+ >+ No new tests, covered by fast/frames/iframe-target.html. >+ >+ * loader/EmptyClients.cpp: >+ (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm): >+ * loader/EmptyFrameLoaderClient.h: >+ * loader/FrameLoaderClient.h: >+ > 2018-08-31 Aditya Keerthi <akeerthi@apple.com> > > [Datalist][iOS] Add suggestions UI for TextFieldInputTypes >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 27fa7cf7123ad8004a01c9fb09dd11c24ce035ba..5398b08f6af7c9de25a563f765b0aa0dda265527 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-31 Chris Dumez <cdumez@apple.com> >+ >+ Assertion hit in ~CompletionHandler() from ~WebFrame() >+ https://bugs.webkit.org/show_bug.cgi?id=189199 >+ <rdar://problem/42657233> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: >+ * WebProcess/WebPage/WebFrame.cpp: >+ (WebKit::WebFrame::~WebFrame): >+ (WebKit::WebFrame::setUpWillSubmitFormListener): >+ (WebKit::WebFrame::invalidatePolicyListener): >+ * WebProcess/WebPage/WebFrame.h: >+ > 2018-08-31 Aditya Keerthi <akeerthi@apple.com> > > [Datalist][iOS] Add suggestions UI for TextFieldInputTypes >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 685ecf2b90e4e5328b4d4631c62e341201068f7f..88e3290ae25f40527bc130a1fad588c471e21dc9 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2018-08-31 Chris Dumez <cdumez@apple.com> >+ >+ Assertion hit in ~CompletionHandler() from ~WebFrame() >+ https://bugs.webkit.org/show_bug.cgi?id=189199 >+ <rdar://problem/42657233> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebFrameLoaderClient.h: >+ * WebCoreSupport/WebFrameLoaderClient.mm: >+ (WebFrameLoaderClient::dispatchWillSubmitForm): >+ > 2018-08-31 Frederic Wang <fwang@igalia.com> > > Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index c2b9b1a824c7a57a4c69d03626486ab9434c7703..fb7deb3c8ae387660cccfdaaf896497dca44a2ea 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,15 @@ >+2018-08-31 Chris Dumez <cdumez@apple.com> >+ >+ Assertion hit in ~CompletionHandler() from ~WebFrame() >+ https://bugs.webkit.org/show_bug.cgi?id=189199 >+ <rdar://problem/42657233> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebFrameLoaderClient::dispatchWillSubmitForm): >+ * WebCoreSupport/WebFrameLoaderClient.h: >+ > 2018-08-31 Frederic Wang <fwang@igalia.com> > > Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement >diff --git a/Source/WebCore/loader/EmptyClients.cpp b/Source/WebCore/loader/EmptyClients.cpp >index cad4bd81d45d13ceac46ff5fe8ee9de47f4b5fc7..35e02702e07ca6117aa66f47b48d03d6305efa72 100644 >--- a/Source/WebCore/loader/EmptyClients.cpp >+++ b/Source/WebCore/loader/EmptyClients.cpp >@@ -458,8 +458,9 @@ void EmptyFrameLoaderClient::dispatchWillSendSubmitEvent(Ref<FormState>&&) > { > } > >-void EmptyFrameLoaderClient::dispatchWillSubmitForm(FormState&, WTF::Function<void(void)>&&) >+void EmptyFrameLoaderClient::dispatchWillSubmitForm(FormState&, CompletionHandler<void(void)>&& completionHandler) > { >+ completionHandler(); > } > > Ref<DocumentLoader> EmptyFrameLoaderClient::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) >diff --git a/Source/WebCore/loader/EmptyFrameLoaderClient.h b/Source/WebCore/loader/EmptyFrameLoaderClient.h >index 374ab8a373b5690f3013739e42bcd2c9dca8d03b..6f4808171af8a3bb574eda76287e78c586d477c2 100644 >--- a/Source/WebCore/loader/EmptyFrameLoaderClient.h >+++ b/Source/WebCore/loader/EmptyFrameLoaderClient.h >@@ -101,7 +101,7 @@ class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient { > void dispatchUnableToImplementPolicy(const ResourceError&) final { } > > void dispatchWillSendSubmitEvent(Ref<FormState>&&) final; >- void dispatchWillSubmitForm(FormState&, WTF::Function<void(void)>&&) final; >+ void dispatchWillSubmitForm(FormState&, CompletionHandler<void(void)>&&) final; > > void revertToProvisionalState(DocumentLoader*) final { } > void setMainDocumentError(DocumentLoader*, const ResourceError&) final { } >diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h >index 074e541f3bca5a1adffb51665154edaffe53c2be..5557542ff5009136859015459cd97af9d98ff776 100644 >--- a/Source/WebCore/loader/FrameLoaderClient.h >+++ b/Source/WebCore/loader/FrameLoaderClient.h >@@ -199,7 +199,7 @@ public: > virtual void dispatchUnableToImplementPolicy(const ResourceError&) = 0; > > virtual void dispatchWillSendSubmitEvent(Ref<FormState>&&) = 0; >- virtual void dispatchWillSubmitForm(FormState&, WTF::Function<void(void)>&&) = 0; >+ virtual void dispatchWillSubmitForm(FormState&, CompletionHandler<void(void)>&&) = 0; > > virtual void revertToProvisionalState(DocumentLoader*) = 0; > virtual void setMainDocumentError(DocumentLoader*, const ResourceError&) = 0; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index 1b94bbc70ad7a814349bc87f4815bc3b4f63c0c9..fe0219f33a656dd0ebb0e26c3bde07a224814a4d 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -940,11 +940,13 @@ void WebFrameLoaderClient::dispatchWillSendSubmitEvent(Ref<FormState>&& formStat > webPage->injectedBundleFormClient().willSendSubmitEvent(webPage, &form, m_frame, sourceFrame, formState->textFieldValues()); > } > >-void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, WTF::Function<void(void)>&& function) >+void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, CompletionHandler<void(void)>&& completionHandler) > { > WebPage* webPage = m_frame->page(); >- if (!webPage) >+ if (!webPage) { >+ completionHandler(); > return; >+ } > > auto& form = formState.form(); > >@@ -958,7 +960,7 @@ void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, WTF::Fun > RefPtr<API::Object> userData; > webPage->injectedBundleFormClient().willSubmitForm(webPage, &form, m_frame, sourceFrame, values, userData); > >- uint64_t listenerID = m_frame->setUpWillSubmitFormListener(WTFMove(function)); >+ uint64_t listenerID = m_frame->setUpWillSubmitFormListener(WTFMove(completionHandler)); > > webPage->send(Messages::WebPageProxy::WillSubmitForm(m_frame->frameID(), sourceFrame->frameID(), values, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))); > } >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >index 254568e427d14274de2405235f3a9da4d5062ea1..bc6b2dc9ccd75c833ff3ecaf94e3ee32f5de4ddc 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >@@ -131,7 +131,7 @@ private: > void dispatchUnableToImplementPolicy(const WebCore::ResourceError&) final; > > void dispatchWillSendSubmitEvent(Ref<WebCore::FormState>&&) final; >- void dispatchWillSubmitForm(WebCore::FormState&, WTF::Function<void(void)>&&) final; >+ void dispatchWillSubmitForm(WebCore::FormState&, CompletionHandler<void(void)>&&) final; > > void revertToProvisionalState(WebCore::DocumentLoader*) final; > void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&) final; >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >index f62d1dd9ec5609c98f354022831aa5596eb60543..05d5d7143bfb20c3fe422920551a5eac7aa9f206 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >@@ -163,6 +163,10 @@ WebFrame::~WebFrame() > { > ASSERT(!m_coreFrame); > >+ auto willSubmitFormCompletionHandlers = WTFMove(m_willSubmitFormCompletionHandlers); >+ for (auto& completionHandler : willSubmitFormCompletionHandlers.values()) >+ completionHandler(); >+ > #ifndef NDEBUG > webFrameCounter.decrement(); > #endif >@@ -219,7 +223,7 @@ uint64_t WebFrame::setUpPolicyListener(WebCore::FramePolicyFunction&& policyFunc > return m_policyListenerID; > } > >-uint64_t WebFrame::setUpWillSubmitFormListener(WTF::Function<void(void)>&& completionHandler) >+uint64_t WebFrame::setUpWillSubmitFormListener(CompletionHandler<void(void)>&& completionHandler) > { > uint64_t identifier = generateListenerID(); > invalidatePolicyListener(); >@@ -244,8 +248,8 @@ void WebFrame::invalidatePolicyListener() > if (auto function = std::exchange(m_policyFunction, nullptr)) > function(PolicyAction::Ignore); > m_policyFunctionForNavigationAction = ForNavigationAction::No; >- for (auto& function : m_willSubmitFormCompletionHandlers.values()) >- function(); >+ for (auto& completionHandler : m_willSubmitFormCompletionHandlers.values()) >+ completionHandler(); > m_willSubmitFormCompletionHandlers.clear(); > } > >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.h b/Source/WebKit/WebProcess/WebPage/WebFrame.h >index a73d22db72377523be8bbe089fa15778289bdf2b..144276afdfc8891f29d38c4b6464710b33a3b5e0 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.h >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.h >@@ -89,7 +89,7 @@ public: > void invalidatePolicyListener(); > void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, DownloadID, std::optional<WebsitePoliciesData>&&); > >- uint64_t setUpWillSubmitFormListener(WTF::Function<void(void)>&&); >+ uint64_t setUpWillSubmitFormListener(CompletionHandler<void(void)>&&); > void continueWillSubmitForm(uint64_t); > > void startDownload(const WebCore::ResourceRequest&, const String& suggestedName = { }); >@@ -183,7 +183,7 @@ private: > uint64_t m_policyListenerID { 0 }; > WebCore::FramePolicyFunction m_policyFunction; > ForNavigationAction m_policyFunctionForNavigationAction { ForNavigationAction::No }; >- HashMap<uint64_t, WTF::Function<void(void)>> m_willSubmitFormCompletionHandlers; >+ HashMap<uint64_t, CompletionHandler<void(void)>> m_willSubmitFormCompletionHandlers; > DownloadID m_policyDownloadID { 0 }; > > std::unique_ptr<WebFrameLoaderClient> m_frameLoaderClient; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >index 7d15c822149b81cd39bf98c1cfedbe18a81d1451..2ecfe24252a44c6ea2fbb5390e55fd9adea58a7d 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >@@ -134,7 +134,7 @@ private: > void dispatchUnableToImplementPolicy(const WebCore::ResourceError&) final; > > void dispatchWillSendSubmitEvent(Ref<WebCore::FormState>&&) final; >- void dispatchWillSubmitForm(WebCore::FormState&, WTF::Function<void(void)>&&) final; >+ void dispatchWillSubmitForm(WebCore::FormState&, CompletionHandler<void(void)>&&) final; > > void revertToProvisionalState(WebCore::DocumentLoader*) final; > void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&) final; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >index 86be6e4e3672b7d1be8e87e5645cd7bc06c5fe8f..90e6cfeacc10bc36f4a2fd4e080bbf915d6a1824 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >@@ -949,16 +949,16 @@ void WebFrameLoaderClient::dispatchWillSendSubmitEvent(Ref<WebCore::FormState>&& > CallFormDelegate(getWebView(m_webFrame.get()), @selector(willSendSubmitEventToForm:inFrame:withValues:), formElement, m_webFrame.get(), values); > } > >-void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, WTF::Function<void(void)>&& function) >+void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, CompletionHandler<void(void)>&& completionHandler) > { > id <WebFormDelegate> formDelegate = [getWebView(m_webFrame.get()) _formDelegate]; > if (!formDelegate) { >- function(); >+ completionHandler(); > return; > } > > NSDictionary *values = makeFormFieldValuesDictionary(formState); >- CallFormDelegate(getWebView(m_webFrame.get()), @selector(frame:sourceFrame:willSubmitForm:withValues:submissionListener:), m_webFrame.get(), kit(formState.sourceDocument().frame()), kit(&formState.form()), values, setUpPolicyListener([function = WTFMove(function)](PolicyAction) { function(); }, PolicyAction::Ignore).get()); >+ CallFormDelegate(getWebView(m_webFrame.get()), @selector(frame:sourceFrame:willSubmitForm:withValues:submissionListener:), m_webFrame.get(), kit(formState.sourceDocument().frame()), kit(&formState.form()), values, setUpPolicyListener([completionHandler = WTFMove(completionHandler)](PolicyAction) mutable { completionHandler(); }, PolicyAction::Ignore).get()); > } > > void WebFrameLoaderClient::revertToProvisionalState(DocumentLoader* loader) >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >index bed55c1edfd73f7282d41d933f5c03d50bbeee9d..07956571c510a585c5c0480d7fea1ca619fa8ea2 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -599,7 +599,7 @@ void WebFrameLoaderClient::dispatchWillSendSubmitEvent(Ref<WebCore::FormState>&& > { > } > >-void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, WTF::Function<void(void)>&& function) >+void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, CompletionHandler<void(void)>&& completionHandler) > { > WebView* webView = m_webFrame->webView(); > Frame* coreFrame = core(m_webFrame); >@@ -608,7 +608,7 @@ void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, WTF::Fun > COMPtr<IWebFormDelegate> formDelegate; > > if (FAILED(webView->formDelegate(&formDelegate))) { >- function(); >+ completionHandler(); > return; > } > >@@ -623,11 +623,11 @@ void WebFrameLoaderClient::dispatchWillSubmitForm(FormState& formState, WTF::Fun > COMPtr<IPropertyBag> formValuesPropertyBag(AdoptCOM, COMPropertyBag<String>::createInstance(formValuesMap)); > > COMPtr<WebFrame> sourceFrame(kit(formState.sourceDocument().frame())); >- if (SUCCEEDED(formDelegate->willSubmitForm(m_webFrame, sourceFrame.get(), formElement.get(), formValuesPropertyBag.get(), setUpPolicyListener([function = WTFMove(function)] (PolicyAction) { function(); }).get()))) >+ if (SUCCEEDED(formDelegate->willSubmitForm(m_webFrame, sourceFrame.get(), formElement.get(), formValuesPropertyBag.get(), setUpPolicyListener([completionHandler = WTFMove(completionHandler)] (PolicyAction) { completionHandler(); }).get()))) > return; > > // FIXME: Add a sane default implementation >- function(); >+ completionHandler(); > } > > void WebFrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError& error) >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >index 5b2105cc6e09cff64e6a08be9bb257a65a5bd0e7..a8faea3287bd6e30dd9437f1f32e5da41a80994b 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >@@ -108,7 +108,7 @@ public: > void dispatchUnableToImplementPolicy(const WebCore::ResourceError&) override; > > void dispatchWillSendSubmitEvent(Ref<WebCore::FormState>&&) override; >- void dispatchWillSubmitForm(WebCore::FormState&, WTF::Function<void(void)>&&) override; >+ void dispatchWillSubmitForm(WebCore::FormState&, CompletionHandler<void(void)>&&) override; > > void revertToProvisionalState(WebCore::DocumentLoader*) override; > bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length) override;
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 189199
:
348649
|
348652