Changeset 235992 in webkit
- Timestamp:
- Sep 13, 2018, 3:32:33 PM (8 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r235988 r235992 1 2018-09-13 Keith Rollin <krollin@apple.com> 2 3 WebPageProxy::reportPageLoadResult can crash on some code paths 4 https://bugs.webkit.org/show_bug.cgi?id=189568 5 6 Reviewed by Chris Dumez. 7 8 WebPageProxy::reportPageLoadResult (which is called from 9 WebPageProxy::didFinishLoadForFrame) can sometimes crash when 10 accessing m_pageLoadStart (a std::optional) in its unloaded state. 11 Normally, m_pageLoadStart is initialized in 12 WebPageProxy::didStartProvisionalLoadForFrame, which one would expect 13 would be called before WebPageProxy::didFinishLoadForFrame. But that 14 turns out to not always be the case. It's not apparent under what 15 conditions didStartProvisionalLoadForFrame will not be called, but 16 it's happening in the wild, leading to crashes now that std::optional 17 asserts in release builds on bad accesses (see 18 https://bugs.webkit.org/show_bug.cgi?id=189568). 19 20 Fix this by checking m_pageLoadState on entry to reportPageLoadResult. 21 22 * UIProcess/WebPageProxy.cpp: 23 (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): 24 (WebKit::WebPageProxy::didFinishLoadForFrame): 25 (WebKit::WebPageProxy::didFailLoadForFrame): 26 (WebKit::WebPageProxy::reportPageLoadResult): 27 1 28 2018-09-13 Chris Dumez <cdumez@apple.com> 2 29 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r235988 r235992 889 889 m_isClosed = true; 890 890 891 if (m_pageLoadStart) 892 reportPageLoadResult(ResourceError { ResourceError::Type::Cancellation }); 891 reportPageLoadResult(ResourceError { ResourceError::Type::Cancellation }); 893 892 894 893 if (m_activePopupMenu) … … 3464 3463 3465 3464 if (frame->isMainFrame()) { 3466 if (m_pageLoadStart) 3467 reportPageLoadResult(ResourceError { ResourceError::Type::Cancellation }); 3465 reportPageLoadResult(ResourceError { ResourceError::Type::Cancellation }); 3468 3466 m_pageLoadStart = MonotonicTime::now(); 3469 3467 m_pageLoadState.didStartProvisionalLoad(transaction, url, unreachableURL); … … 7912 7910 }); 7913 7911 7914 ASSERT(m_pageLoadStart); 7912 if (!m_pageLoadStart) 7913 return; 7915 7914 7916 7915 auto pageLoadTime = MonotonicTime::now() - *m_pageLoadStart;
Note:
See TracChangeset
for help on using the changeset viewer.