Changeset 80036 in webkit


Ignore:
Timestamp:
Mar 1, 2011 1:57:14 PM (13 years ago)
Author:
Michael Nordman
Message:

2011-03-01 Michael Nordman <Michael Nordman>

Reviewed by Alexey Proskuryakov.

Tests for the correct relative priorities of network vs fallback namespaces in the appcache.
If a resource url is in an appcache's network namespace and fallback namespace, the network
namespace wins (with the exception of the special '*' network namespace which does not take
priority over the fallback namespace.
https://bugs.webkit.org/show_bug.cgi?id=49292

  • http/tests/appcache/online-fallback-layering-expected.txt: Added.
  • http/tests/appcache/online-fallback-layering.html: Added.
  • http/tests/appcache/resources/fallbacknamespace-fallback-resource.txt: Added.
  • http/tests/appcache/resources/fallbacknamespace-networknamespace-existing-resource.html: Added.
  • http/tests/appcache/resources/online-fallback-layering.manifest: Added.

2011-03-01 Michael Nordman <Michael Nordman>

Reviewed by Alexey Proskuryakov.

Alter the relative priorities of network vs fallback namespaces in the appcache.
If a resource url is in an appcache's network namespace and fallback namespace, the network
namespace wins (with the exception of the special '*' network namespace which does not take
priority over the fallback namespace.
https://bugs.webkit.org/show_bug.cgi?id=49292

Test: http/tests/appcache/online-fallback-layering.html

  • loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::isURLInOnlineWhitelist):
  • loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache): (WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
  • loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
Location:
trunk
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80032 r80036  
     12011-03-01  Michael Nordman  <michaeln@google.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Tests for the correct relative priorities of network vs fallback namespaces in the appcache.
     6        If a resource url is in an appcache's network namespace and fallback namespace, the network
     7        namespace wins (with the exception of the special '*' network namespace which does not take
     8        priority over the fallback namespace.
     9        https://bugs.webkit.org/show_bug.cgi?id=49292
     10
     11        * http/tests/appcache/online-fallback-layering-expected.txt: Added.
     12        * http/tests/appcache/online-fallback-layering.html: Added.
     13        * http/tests/appcache/resources/fallbacknamespace-fallback-resource.txt: Added.
     14        * http/tests/appcache/resources/fallbacknamespace-networknamespace-existing-resource.html: Added.
     15        * http/tests/appcache/resources/online-fallback-layering.manifest: Added.
     16
    1172011-03-01  Tony Gentilcore  <tonyg@chromium.org>
    218
  • trunk/Source/WebCore/ChangeLog

    r80034 r80036  
     12011-03-01  Michael Nordman  <michaeln@google.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Alter the relative priorities of network vs fallback namespaces in the appcache.
     6        If a resource url is in an appcache's network namespace and fallback namespace, the network
     7        namespace wins (with the exception of the special '*' network namespace which does not take
     8        priority over the fallback namespace.
     9        https://bugs.webkit.org/show_bug.cgi?id=49292
     10
     11        Test: http/tests/appcache/online-fallback-layering.html
     12
     13        * loader/appcache/ApplicationCache.cpp:
     14        (WebCore::ApplicationCache::isURLInOnlineWhitelist):
     15        * loader/appcache/ApplicationCacheHost.cpp:
     16        (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
     17        (WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
     18        * loader/appcache/ApplicationCacheStorage.cpp:
     19        (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
     20
    1212011-03-01  Patrick Gansterer  <paroga@webkit.org>
    222
  • trunk/Source/WebCore/loader/appcache/ApplicationCache.cpp

    r65478 r80036  
    149149bool ApplicationCache::isURLInOnlineWhitelist(const KURL& url)
    150150{
    151     if (m_allowAllNetworkRequests)
    152         return true;
    153 
    154151    size_t whitelistSize = m_onlineWhitelist.size();
    155152    for (size_t i = 0; i < whitelistSize; ++i) {
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp

    r70923 r80036  
    351351    // Resources that match fallback namespaces or online whitelist entries are fetched from the network,
    352352    // unless they are also cached.
    353     if (!resource && (cache->urlMatchesFallbackNamespace(request.url()) || cache->isURLInOnlineWhitelist(request.url())))
     353    if (!resource && (cache->allowsAllNetworkRequests() || cache->urlMatchesFallbackNamespace(request.url()) || cache->isURLInOnlineWhitelist(request.url())))
    354354        return false;
    355355
     
    374374
    375375    KURL fallbackURL;
     376    if (cache->isURLInOnlineWhitelist(request.url()))
     377        return false;
    376378    if (!cache->urlMatchesFallbackNamespace(request.url(), &fallbackURL))
    377379        return false;
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp

    r79368 r80036  
    268268        if (ApplicationCache* cache = group->newestCache()) {
    269269            KURL fallbackURL;
     270            if (cache->isURLInOnlineWhitelist(url))
     271                continue;
    270272            if (!cache->urlMatchesFallbackNamespace(url, &fallbackURL))
    271273                continue;
     
    301303
    302304        KURL fallbackURL;
     305        if (cache->isURLInOnlineWhitelist(url))
     306            continue;
    303307        if (!cache->urlMatchesFallbackNamespace(url, &fallbackURL))
    304308            continue;
Note: See TracChangeset for help on using the changeset viewer.