Bug 142893 - [WK2] We should allow stale content when restoring a killed / crashed WebProcess
Summary: [WK2] We should allow stale content when restoring a killed / crashed WebProcess
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 142910 142911
Blocks: 142916
  Show dependency treegraph
 
Reported: 2015-03-19 20:03 PDT by Chris Dumez
Modified: 2015-03-30 10:00 PDT (History)
8 users (show)

See Also:


Attachments
Patch (14.19 KB, patch)
2015-03-19 21:06 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-03-19 20:03:40 PDT
We should allow stale content when restoring a killed / crashed WebProcess (similarly to a history navigation). This is actually what was intended as we call WebPage::goToBackForwardItem() in this case, which uses FrameLoadType::IndexedBackForward load type. However, this value is then ignored in FrameLoader::loadDifferentDocumentItem() because m_stateMachine.committedFirstRealDocumentLoad() return false in this case. This means we end up doing fresh loads from the network in this case.

We just need to take care of the fact that we should still load fresh content when restoring the session state (<rdar://problem/8131355>) as this is why FrameLoader::loadDifferentDocumentItem() was ignoring the IndexedBackForward load type in the first place.

Radar: <rdar://problem/19633737> / <rdar://problem/19869257>
Comment 1 Chris Dumez 2015-03-19 21:06:59 PDT
Created attachment 249080 [details]
Patch
Comment 2 Antti Koivisto 2015-03-19 21:59:57 PDT
Comment on attachment 249080 [details]
Patch

No way to test this?
Comment 3 WebKit Commit Bot 2015-03-19 22:46:16 PDT
Comment on attachment 249080 [details]
Patch

Clearing flags on attachment: 249080

Committed r181782: <http://trac.webkit.org/changeset/181782>
Comment 4 WebKit Commit Bot 2015-03-19 22:46:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 David Kilzer (:ddkilzer) 2015-03-20 03:57:22 PDT
This caused a TestWebKitAPI test (WebKit2.RestoreSessionStateContainingFormData) to ASSERT:

<https://build.webkit.org/builders/Apple%20Yosemite%20Debug%20WK2%20%28Tests%29/builds/2922>

ASSERTION FAILED: isBackForwardLoadType(m_loadType)
/Volumes/Data/slave/yosemite-debug/build/Source/WebCore/loader/FrameLoader.cpp(3257) : void WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad()
1   0x10f1e5270 WTFCrash
2   0x11112db3c WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad()
3   0x110e18db3 WebCore::DocumentLoader::notifyFinished(WebCore::CachedResource*)
4   0x110a59172 WebCore::CachedResource::checkNotify()
5   0x110a59321 WebCore::CachedResource::error(WebCore::CachedResource::Status)
6   0x112612479 WebCore::SubresourceLoader::didFail(WebCore::ResourceError const&)
7   0x1122e9b45 WebCore::ResourceLoader::didFail(WebCore::ResourceHandle*, WebCore::ResourceError const&)
8   0x1128c1ad3 -[WebCoreResourceHandleAsDelegate connection:didFailWithError:]
9   0x7fff9178f20d __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke
10  0x7fff9178f1b1 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]
11  0x7fff9178f356 -[NSURLConnectionInternal _withConnectionAndDelegate:]
12  0x7fff9177599b _NSURLConnectionDidFail(_CFURLConnection*, __CFError*, void const*)
13  0x7fff9172b51c invocation function for block in URLConnectionClient_Classic::_delegate_didFail(__CFError*, void () block_pointer)
14  0x7fff91729283 invocation function for block in URLConnectionClient_Classic::_withDelegateAsync(char const*, void (_CFURLConnection*, CFURLConnectionClientCurrent_VMax const*) block_pointer)
15  0x7fff9164b33c RunloopBlockContext::_invoke_block(void const*, void*)
16  0x7fff85fc6274 CFArrayApplyFunction
17  0x7fff9164b1fd RunloopBlockContext::perform()
18  0x7fff9164b09e MultiplexerSource::perform()
19  0x7fff9164aec0 MultiplexerSource::_perform(void*)
20  0x7fff85ffa681 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
21  0x7fff85fec80d __CFRunLoopDoSources0
22  0x7fff85febe3f __CFRunLoopRun
23  0x7fff85feb858 CFRunLoopRunSpecific
24  0x7fff88f1aaef RunCurrentEventLoopInMode
25  0x7fff88f1a86a ReceiveNextEventCommon
26  0x7fff88f1a6ab _BlockUntilNextEventMatchingListInModeWithFilter
27  0x7fff91aa6f81 _DPSNextEvent
28  0x7fff91aa6730 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
29  0x7fff91a9a593 -[NSApplication run]
30  0x7fff91a85a14 NSApplicationMain
31  0x7fff8ca27ef2 _xpc_objc_main
TIMEOUT WebKit2.RestoreSessionStateContainingFormData
Comment 6 WebKit Commit Bot 2015-03-20 08:06:17 PDT
Re-opened since this is blocked by bug 142910
Comment 7 Chris Dumez 2015-03-20 08:34:02 PDT
(In reply to comment #5)
> This caused a TestWebKitAPI test
> (WebKit2.RestoreSessionStateContainingFormData) to ASSERT:
> 
> <https://build.webkit.org/builders/
> Apple%20Yosemite%20Debug%20WK2%20%28Tests%29/builds/2922>
> 
> ASSERTION FAILED: isBackForwardLoadType(m_loadType)
> /Volumes/Data/slave/yosemite-debug/build/Source/WebCore/loader/FrameLoader.
> cpp(3257) : void
> WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad()
> 1   0x10f1e5270 WTFCrash
> 2   0x11112db3c
> WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad()
> 3   0x110e18db3
> WebCore::DocumentLoader::notifyFinished(WebCore::CachedResource*)
> 4   0x110a59172 WebCore::CachedResource::checkNotify()
> 5   0x110a59321
> WebCore::CachedResource::error(WebCore::CachedResource::Status)
> 6   0x112612479 WebCore::SubresourceLoader::didFail(WebCore::ResourceError
> const&)
> 7   0x1122e9b45 WebCore::ResourceLoader::didFail(WebCore::ResourceHandle*,
> WebCore::ResourceError const&)
> 8   0x1128c1ad3 -[WebCoreResourceHandleAsDelegate
> connection:didFailWithError:]
> 9   0x7fff9178f20d __65-[NSURLConnectionInternal
> _withConnectionAndDelegate:onlyActive:]_block_invoke
> 10  0x7fff9178f1b1 -[NSURLConnectionInternal
> _withConnectionAndDelegate:onlyActive:]
> 11  0x7fff9178f356 -[NSURLConnectionInternal _withConnectionAndDelegate:]
> 12  0x7fff9177599b _NSURLConnectionDidFail(_CFURLConnection*, __CFError*,
> void const*)
> 13  0x7fff9172b51c invocation function for block in
> URLConnectionClient_Classic::_delegate_didFail(__CFError*, void ()
> block_pointer)
> 14  0x7fff91729283 invocation function for block in
> URLConnectionClient_Classic::_withDelegateAsync(char const*, void
> (_CFURLConnection*, CFURLConnectionClientCurrent_VMax const*) block_pointer)
> 15  0x7fff9164b33c RunloopBlockContext::_invoke_block(void const*, void*)
> 16  0x7fff85fc6274 CFArrayApplyFunction
> 17  0x7fff9164b1fd RunloopBlockContext::perform()
> 18  0x7fff9164b09e MultiplexerSource::perform()
> 19  0x7fff9164aec0 MultiplexerSource::_perform(void*)
> 20  0x7fff85ffa681 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
> 21  0x7fff85fec80d __CFRunLoopDoSources0
> 22  0x7fff85febe3f __CFRunLoopRun
> 23  0x7fff85feb858 CFRunLoopRunSpecific
> 24  0x7fff88f1aaef RunCurrentEventLoopInMode
> 25  0x7fff88f1a86a ReceiveNextEventCommon
> 26  0x7fff88f1a6ab _BlockUntilNextEventMatchingListInModeWithFilter
> 27  0x7fff91aa6f81 _DPSNextEvent
> 28  0x7fff91aa6730 -[NSApplication
> nextEventMatchingMask:untilDate:inMode:dequeue:]
> 29  0x7fff91a9a593 -[NSApplication run]
> 30  0x7fff91a85a14 NSApplicationMain
> 31  0x7fff8ca27ef2 _xpc_objc_main
> TIMEOUT WebKit2.RestoreSessionStateContainingFormData

Ok, looking now.