⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181688 in webkit


Ignore:
Timestamp:
Mar 18, 2015, 12:26:27 AM (11 years ago)
Author:
Chris Dumez
Message:

[WK2] We should not even try the network cache for non-HTTP protocol requests
https://bugs.webkit.org/show_bug.cgi?id=142802
<rdar://problem/19632130>

Reviewed by Antti Koivisto.

We should not even try the network cache for non-HTTP protocol requests
and the network cache cannot handle those.

  • NetworkProcess/NetworkResourceLoader.cpp:

(WebKit::NetworkResourceLoader::start):

  • NetworkProcess/cache/NetworkCache.cpp:

(WebKit::NetworkCache::canRetrieve):
(WebKit::NetworkCache::Cache::retrieve):

  • NetworkProcess/cache/NetworkCache.h:
  • NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:

(WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r181686 r181688  
     12015-03-18  Chris Dumez  <cdumez@apple.com>
     2
     3        [WK2] We should not even try the network cache for non-HTTP protocol requests
     4        https://bugs.webkit.org/show_bug.cgi?id=142802
     5        <rdar://problem/19632130>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        We should not even try the network cache for non-HTTP protocol requests
     10        and the network cache cannot handle those.
     11
     12        * NetworkProcess/NetworkResourceLoader.cpp:
     13        (WebKit::NetworkResourceLoader::start):
     14        * NetworkProcess/cache/NetworkCache.cpp:
     15        (WebKit::NetworkCache::canRetrieve):
     16        (WebKit::NetworkCache::Cache::retrieve):
     17        * NetworkProcess/cache/NetworkCache.h:
     18        * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
     19        (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
     20
    1212015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
    222
  • trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

    r180148 r181688  
    136136
    137137#if ENABLE(NETWORK_CACHE)
    138     if (!NetworkCache::singleton().isEnabled() || sessionID().isEphemeral()) {
     138    if (!NetworkCache::singleton().isEnabled() || sessionID().isEphemeral() || !originalRequest().url().protocolIsInHTTPFamily()) {
    139139        startNetworkLoad();
    140140        return;
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp

    r181651 r181688  
    245245static RetrieveDecision canRetrieve(const WebCore::ResourceRequest& request)
    246246{
    247     if (!request.url().protocolIsInHTTPFamily())
    248         return RetrieveDecision::NoDueToProtocol;
    249247    // FIXME: Support HEAD and OPTIONS requests.
    250248    if (request.httpMethod() != "GET")
     
    262260{
    263261    ASSERT(isEnabled());
     262    ASSERT(originalRequest.url().protocolIsInHTTPFamily());
    264263
    265264    LOG(NetworkCache, "(NetworkProcess) retrieving %s priority %u", originalRequest.url().string().ascii().data(), originalRequest.priority());
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h

    r181364 r181688  
    6767enum class RetrieveDecision {
    6868    Yes,
    69     NoDueToProtocol,
    7069    NoDueToHTTPMethod,
    7170    NoDueToConditionalRequest,
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm

    r181140 r181688  
    191191{
    192192    switch (retrieveDecision) {
    193     case RetrieveDecision::NoDueToProtocol:
    194         return WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey();
    195193    case RetrieveDecision::NoDueToHTTPMethod:
    196194        return WebCore::DiagnosticLoggingKeys::unsupportedHTTPMethodKey();
Note: See TracChangeset for help on using the changeset viewer.