Bug 141644 - Assertion in disk cache code with redirect to a non-http resource
Summary: Assertion in disk cache code with redirect to a non-http resource
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-02-16 06:53 PST by Antti Koivisto
Modified: 2015-02-16 12:52 PST (History)
2 users (show)

See Also:


Attachments
patch (5.02 KB, patch)
2015-02-16 07:09 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2015-02-16 06:53:18 PST
ASSERTION FAILED: response.url().protocolIsInHTTPFamily()
/Users/antti/webkit/OpenSource/Source/WebCore/loader/cache/CacheValidation.cpp(106) : double WebCore::computeFreshnessLifetimeForHTTPFamily(const WebCore::ResourceResponse &, double)
1   0x107b7cad0 WTFCrash
2   0x1093b4751 WebCore::computeFreshnessLifetimeForHTTPFamily(WebCore::ResourceResponse const&, double)
3   0x10453d6a7 WebKit::NetworkResourceLoader::didFinishLoading(WebCore::ResourceHandle*, double)
4   0x10b1c6293 __76-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]_block_invoke
5   0x7fff92371323 _dispatch_call_block_and_release
6   0x7fff9236cc13 _dispatch_client_callout
Comment 1 Antti Koivisto 2015-02-16 06:54:44 PST
rdar://problem/19751042
Comment 2 Antti Koivisto 2015-02-16 07:09:06 PST
Created attachment 246650 [details]
patch
Comment 3 WebKit Commit Bot 2015-02-16 09:16:27 PST
Comment on attachment 246650 [details]
patch

Clearing flags on attachment: 246650

Committed r180148: <http://trac.webkit.org/changeset/180148>
Comment 4 WebKit Commit Bot 2015-02-16 09:16:30 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Alexey Proskuryakov 2015-02-16 09:22:43 PST
Comment on attachment 246650 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=246650&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:265
> +    if (!originalRequest.url().protocolIsInHTTPFamily() || !response.isHTTP()) {

This "in HTTP family" vs. "HTTP" naming is quite misleading.
Comment 6 Antti Koivisto 2015-02-16 10:57:33 PST
How so?
Comment 7 Alexey Proskuryakov 2015-02-16 11:48:15 PST
The reason for the lengthy "protocolIsInHTTPFamily" name is that it makes it clearer that it includes HTTPS.

"isHTTP" doesn't make that clear, and when in the same line with "protocolIsInHTTPFamily" in particular, it actively hints that it doesn't include https, which is untrue.
Comment 8 Antti Koivisto 2015-02-16 12:04:09 PST
URLs and responses are quite different types of objects though. To me it seems clear that an "HTTP response" covers HTTPS too (there is no NSHTTPSURLResponse either).
Comment 9 Alexey Proskuryakov 2015-02-16 12:35:07 PST
> URLs and responses are quite different types of objects though

What is the difference? Both are used for arbitrary URLs, there is no difference at all.

I see your reference to Foundation naming scheme, however it's not a fair comparison, those names are ancient, and they don't need to play well with naming in WebKit.
Comment 10 Antti Koivisto 2015-02-16 12:52:44 PST
In any case, patches are welcome if you have naming improvements.