Changeset 229683 in webkit
- Timestamp:
- Mar 16, 2018 2:17:27 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229682 r229683 1 2018-03-16 Brent Fulgham <bfulgham@apple.com> 2 3 Set a trap to catch an infrequent form-related nullptr crash 4 https://bugs.webkit.org/show_bug.cgi?id=183704 5 <rdar://problem/37579354> 6 7 Reviewed by Ryosuke Niwa. 8 9 Make FormState a FrameDestructionObserver. We expect all relevant FormState objects to have been 10 cleaned up prior to the frame being destroyed. If we find such a case, we'd like to see the 11 stack trace to see what's going on. 12 13 * loader/FormState.cpp: 14 (WebCore::FormState::FormState): 15 (WebCore::FormState::willDetachPage): RELEASE_ASSERT_NOT_REACHED if we ever get here. 16 * loader/FormState.h: 17 1 18 2018-03-16 Joanmarie Diggs <jdiggs@igalia.com> 2 19 -
trunk/Source/WebCore/loader/FormState.cpp
r210845 r229683 36 36 37 37 inline FormState::FormState(HTMLFormElement& form, StringPairVector&& textFieldValues, Document& sourceDocument, FormSubmissionTrigger formSubmissionTrigger) 38 : m_form(form) 38 : FrameDestructionObserver(sourceDocument.frame()) 39 , m_form(form) 39 40 , m_textFieldValues(WTFMove(textFieldValues)) 40 41 , m_sourceDocument(sourceDocument) 41 42 , m_formSubmissionTrigger(formSubmissionTrigger) 42 43 { 44 RELEASE_ASSERT(sourceDocument.frame()); 43 45 } 44 46 … … 48 50 } 49 51 52 void FormState::willDetachPage() 53 { 54 // Beartrap for <rdar://problem/37579354> 55 RELEASE_ASSERT_NOT_REACHED(); 50 56 } 57 58 } -
trunk/Source/WebCore/loader/FormState.h
r210845 r229683 29 29 #pragma once 30 30 31 #include "FrameDestructionObserver.h" 31 32 #include <wtf/text/WTFString.h> 32 33 … … 40 41 using StringPairVector = Vector<std::pair<String, String>>; 41 42 42 class FormState : public RefCounted<FormState> {43 class FormState : public RefCounted<FormState>, public FrameDestructionObserver { 43 44 public: 44 45 static Ref<FormState> create(HTMLFormElement&, StringPairVector&& textFieldValues, Document&, FormSubmissionTrigger); … … 51 52 private: 52 53 FormState(HTMLFormElement&, StringPairVector&& textFieldValues, Document&, FormSubmissionTrigger); 54 void willDetachPage() override; 53 55 54 56 Ref<HTMLFormElement> m_form; -
trunk/Source/WebKit/ChangeLog
r229680 r229683 1 2018-03-16 Brent Fulgham <bfulgham@apple.com> 2 3 Set a trap to catch an infrequent form-related nullptr crash 4 https://bugs.webkit.org/show_bug.cgi?id=183704 5 <rdar://problem/37579354> 6 7 Reviewed by Ryosuke Niwa. 8 9 Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame. 10 11 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 12 (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): 13 1 14 2018-03-16 Jer Noble <jer.noble@apple.com> 2 15 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r229617 r229683 940 940 auto& form = formState.form(); 941 941 942 auto* sourceFrame = WebFrame::fromCoreFrame(*formState.sourceDocument().frame()); 942 auto* sourceCoreFrame = formState.sourceDocument().frame(); 943 RELEASE_ASSERT(sourceCoreFrame); 944 auto* sourceFrame = WebFrame::fromCoreFrame(*sourceCoreFrame); 943 945 ASSERT(sourceFrame); 944 946
Note: See TracChangeset
for help on using the changeset viewer.