Unreviewed, rolling out r166434.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 30 Mar 2014 06:01:08 +0000 (06:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 30 Mar 2014 06:01:08 +0000 (06:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130938

Caused crashes and other failures on cache tests (Requested by
ap on #webkit).

Reverted changeset:

Source/WebCore:

"Web Replay: add page-level setting to bypass the MemoryCache"
https://bugs.webkit.org/show_bug.cgi?id=130728
http://trac.webkit.org/changeset/166434

Source/WebKit2:

"Web Replay: add page-level setting to bypass the MemoryCache"
https://bugs.webkit.org/show_bug.cgi?id=130728
http://trac.webkit.org/changeset/166434

LayoutTests:

"Web Replay: add page-level setting to bypass the MemoryCache"
https://bugs.webkit.org/show_bug.cgi?id=130728
http://trac.webkit.org/changeset/166434

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166459 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/bypass-memory-cache-after-reload-expected.txt [deleted file]
LayoutTests/http/tests/cache/bypass-memory-cache-after-reload.html [deleted file]
LayoutTests/platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/SessionID.h
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/replay/ReplayController.cpp
Source/WebCore/replay/ReplayController.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/APISession.cpp

index 1fedff9..76c0eab 100644 (file)
@@ -1,3 +1,17 @@
+2014-03-29  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r166434.
+        https://bugs.webkit.org/show_bug.cgi?id=130938
+
+        Caused crashes and other failures on cache tests (Requested by
+        ap on #webkit).
+
+        Reverted changeset:
+
+        "Web Replay: add page-level setting to bypass the MemoryCache"
+        https://bugs.webkit.org/show_bug.cgi?id=130728
+        http://trac.webkit.org/changeset/166434
+
 2014-03-29  David Kilzer  <ddkilzer@apple.com>
 
         Preserve selection end positions in directionOfSelection
diff --git a/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload-expected.txt b/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload-expected.txt
deleted file mode 100644 (file)
index 329100b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200>
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http status code 200>
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200>
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
-FINISHED LOADING
diff --git a/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload.html b/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload.html
deleted file mode 100644 (file)
index b9a42ce..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<body>
-<h1></h1>
-<script>
-// Test that a subresource fetched after onload, following a reload, is
-// not cached if we configure the page's settings to bypass the memory cache.
-if (!sessionStorage.lastRandom) {
-    if (window.testRunner && window.internals) {
-        internals.settings.setUsesMemoryCache(false);
-        testRunner.dumpResourceLoadCallbacks();
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-}
-
-function done(result)
-{
-    delete sessionStorage.lastRandom;
-
-    document.body.innerText = result;
-
-    if (window.testRunner)
-        testRunner.notifyDone();
-}
-
-function scriptLoaded()
-{
-    setTimeout(function()
-    {
-        if (!window.randomNumber)
-            done('FAIL: window.randomNumber not defined!');
-        else if (sessionStorage.lastRandom) {
-            // We don't want to compare the actual random numbers because
-            // the request may or may not be cached by the network stack.
-            done('FINISHED LOADING');
-        } else {
-            sessionStorage.lastRandom = randomNumber;
-            location.reload();
-        }
-    }, 0);
-}
-
-onload = function()
-{
-    setTimeout(function()
-    {
-        var s = document.createElement("script");
-        s.src = "resources/random-cached.cgi";
-        s.onload = scriptLoaded;
-        document.body.appendChild(s);
-    }, 0);
-};
-</script>
-</body>
diff --git a/LayoutTests/platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt b/LayoutTests/platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt
deleted file mode 100644 (file)
index ff9fa49..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
-http://127.0.0.1:8000/favicon.ico - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/favicon.ico, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/favicon.ico - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/favicon.ico, http status code 200>
-http://127.0.0.1:8000/favicon.ico - didFinishLoading
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200>
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http status code 200>
-http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET> redirectResponse (null)
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200>
-http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
-FINISHED LOADING
index 2443bf9..75b7ca5 100644 (file)
@@ -1,3 +1,17 @@
+2014-03-29  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r166434.
+        https://bugs.webkit.org/show_bug.cgi?id=130938
+
+        Caused crashes and other failures on cache tests (Requested by
+        ap on #webkit).
+
+        Reverted changeset:
+
+        "Web Replay: add page-level setting to bypass the MemoryCache"
+        https://bugs.webkit.org/show_bug.cgi?id=130728
+        http://trac.webkit.org/changeset/166434
+
 2014-03-29  David Kilzer  <ddkilzer@apple.com>
 
         Preserve selection end positions in directionOfSelection
index 0d75dc3..601f711 100644 (file)
@@ -484,10 +484,7 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::requestResource(Cache
         m_validatedURLs.add(request.resourceRequest().url());
 
     ASSERT(resource->url() == url.string());
-
-    if (sessionID() != SessionID::bypassCacheSessionID())
-        m_documentResources.set(resource->url(), resource);
-
+    m_documentResources.set(resource->url(), resource);
     return resource;
 }
 
@@ -499,7 +496,6 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::revalidateResource(co
     ASSERT(resource->canUseCacheValidator());
     ASSERT(!resource->resourceToRevalidate());
     ASSERT(resource->sessionID() == sessionID());
-    ASSERT(sessionID() != SessionID::bypassCacheSessionID());
 
     // Copy the URL out of the resource to be revalidated in case it gets deleted by the remove() call below.
     String url = resource->url();
index 378038f..a9a0553 100644 (file)
@@ -110,9 +110,6 @@ bool MemoryCache::add(CachedResource* resource)
     if (disabled())
         return false;
 
-    if (resource->sessionID() == SessionID::bypassCacheSessionID())
-        return false;
-
     ASSERT(WTF::isMainThread());
 
     CachedResourceMap& resources = getSessionMap(resource->sessionID());
index 98d96ef..f83cb14 100644 (file)
@@ -1520,9 +1520,6 @@ SessionID Page::sessionID() const
     if (settings().privateBrowsingEnabled())
         return SessionID::legacyPrivateSessionID();
 
-    if (!settings().usesMemoryCache())
-        return SessionID::bypassCacheSessionID();
-
     return SessionID::defaultSessionID();
 }
 
index c4deb1b..5efd74a 100644 (file)
@@ -43,7 +43,6 @@ public:
     static SessionID emptySessionID() { return SessionID(0); }
     static SessionID defaultSessionID() { return SessionID(1); }
     static SessionID legacyPrivateSessionID() { return SessionID(2); }
-    static SessionID bypassCacheSessionID() { return SessionID(3); }
 private:
     uint64_t m_sessionID;
 };
index e7f60e4..32b5a7f 100644 (file)
@@ -177,7 +177,6 @@ Settings::Settings(Page* page)
     , m_isScriptEnabled(false)
     , m_needsAdobeFrameReloadingQuirk(false)
     , m_usesPageCache(false)
-    , m_usesMemoryCache(true)
     , m_fontRenderingMode(0)
     , m_showTiledScrollingIndicator(false)
     , m_tiledBackingStoreEnabled(false)
index 458fa34..516f0dc 100644 (file)
@@ -181,10 +181,7 @@ public:
 
     void setUsesPageCache(bool);
     bool usesPageCache() const { return m_usesPageCache; }
-
-    void setUsesMemoryCache(bool usesMemoryCache) { m_usesMemoryCache = usesMemoryCache; }
-    bool usesMemoryCache() const { return m_usesMemoryCache; }
-
+        
     void setFontRenderingMode(FontRenderingMode mode);
     FontRenderingMode fontRenderingMode() const;
 
@@ -310,7 +307,6 @@ private:
     bool m_isScriptEnabled : 1;
     bool m_needsAdobeFrameReloadingQuirk : 1;
     bool m_usesPageCache : 1;
-    bool m_usesMemoryCache : 1;
     unsigned m_fontRenderingMode : 1;
     bool m_showTiledScrollingIndicator : 1;
     bool m_tiledBackingStoreEnabled : 1;
index 00c9c4d..edfc9eb 100644 (file)
@@ -71,13 +71,10 @@ void ReplayController::setForceDeterministicSettings(bool shouldForce)
     ASSERT(shouldForce ^ (m_sessionState == SessionState::Inactive));
 
     if (shouldForce) {
-        m_savedSettings.usesMemoryCache = m_page.settings().usesMemoryCache();
         m_savedSettings.usesPageCache = m_page.settings().usesPageCache();
 
-        m_page.settings().setUsesMemoryCache(false);
         m_page.settings().setUsesPageCache(false);
     } else {
-        m_page.settings().setUsesMemoryCache(m_savedSettings.usesMemoryCache);
         m_page.settings().setUsesPageCache(m_savedSettings.usesPageCache);
     }
 }
index aff0023..ef05771 100644 (file)
@@ -154,12 +154,10 @@ private:
     void setForceDeterministicSettings(bool);
 
     struct SavedSettings {
-        bool usesMemoryCache;
         bool usesPageCache;
 
         SavedSettings()
-            : usesMemoryCache(true)
-            , usesPageCache(false)
+            : usesPageCache(false)
         { }
     };
 
index 50ef5a5..31bd30c 100644 (file)
@@ -91,7 +91,6 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
     , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
     , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy())
-    , m_usesMemoryCache(settings.usesMemoryCache())
 {
 }
 
@@ -150,7 +149,6 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
     settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy);
-    settings.setUsesMemoryCache(m_usesMemoryCache);
     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
 }
 
@@ -495,10 +493,4 @@ void InternalSettings::setShouldConvertPositionStyleOnCopy(bool convert, Excepti
     settings()->setShouldConvertPositionStyleOnCopy(convert);
 }
 
-void InternalSettings::setUsesMemoryCache(bool usesMemoryCache, ExceptionCode& ec)
-{
-    InternalSettingsGuardForSettings();
-    settings()->setUsesMemoryCache(usesMemoryCache);
-}
-
 }
index ed89558..7307383 100644 (file)
@@ -88,7 +88,6 @@ public:
         bool m_autoscrollForDragAndDropEnabled;
         bool m_pluginReplacementEnabled;
         bool m_shouldConvertPositionStyleOnCopy;
-        bool m_usesMemoryCache;
     };
 
     static PassRefPtr<InternalSettings> create(Page* page)
@@ -133,7 +132,7 @@ public:
     void setPluginReplacementEnabled(bool);
     void setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode&);
     void setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode&);
-    void setUsesMemoryCache(bool usesMemoryCache, ExceptionCode&);
+
 
 private:
     explicit InternalSettings(Page*);
index 0f6b5e2..1dd6fa7 100644 (file)
@@ -59,5 +59,4 @@
     void setPluginReplacementEnabled(boolean enabled);
     [RaisesException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
     [RaisesException] void setShouldConvertPositionStyleOnCopy(boolean convert);
-    [RaisesException] void setUsesMemoryCache(boolean usesMemoryCache);
 };
index c15014d..c7e3ee5 100644 (file)
@@ -1,3 +1,17 @@
+2014-03-29  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r166434.
+        https://bugs.webkit.org/show_bug.cgi?id=130938
+
+        Caused crashes and other failures on cache tests (Requested by
+        ap on #webkit).
+
+        Reverted changeset:
+
+        "Web Replay: add page-level setting to bypass the MemoryCache"
+        https://bugs.webkit.org/show_bug.cgi?id=130728
+        http://trac.webkit.org/changeset/166434
+
 2014-03-28  Anders Carlsson  <andersca@apple.com>
 
         Uncaught NSExceptions should crash the web process
index d7a9251..55861b4 100644 (file)
@@ -34,7 +34,7 @@ static uint64_t generateID(bool isEphemeral)
 {
     ASSERT(RunLoop::isMain());
 
-    static uint64_t uniqueSessionID = WebCore::SessionID::bypassCacheSessionID().sessionID();
+    static uint64_t uniqueSessionID = WebCore::SessionID::legacyPrivateSessionID().sessionID();
     ASSERT_UNUSED(isEphemeral, isEphemeral);
     return ++uniqueSessionID;
 }