Changeset 166434 in webkit
- Timestamp:
- Mar 28, 2014 3:46:27 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r166428 r166434 1 2014-03-28 Brian Burg <bburg@apple.com> 2 3 Web Replay: add page-level setting to bypass the MemoryCache 4 https://bugs.webkit.org/show_bug.cgi?id=130728 5 6 Reviewed by Timothy Hatcher. 7 8 Mac WebKit2 needs different expectations because of resource load timing characteristics 9 introduced by the interaction of Settings::usesMemoryCache and NetworkProcess. 10 11 * http/tests/cache/bypass-memory-cache-after-reload-expected.txt: Added. 12 * http/tests/cache/bypass-memory-cache-after-reload.html: Added. 13 * platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt: Added. 14 1 15 2014-03-28 Radu Stavila <stavila@adobe.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r166428 r166434 1 2014-03-28 Brian Burg <bburg@apple.com> 2 3 Web Replay: add page-level setting to bypass the MemoryCache 4 https://bugs.webkit.org/show_bug.cgi?id=130728 5 6 Reviewed by Timothy Hatcher. 7 8 When replaying a specific Page we don't want to store its cached resources in the 9 MemoryCache. This patch adds a page setting to prevent the page's resources from 10 being saved in the MemoryCache. 11 12 If Settings::usesMemoryCache() is false, page resources are given the special 13 SessionID bypassCacheSessionID(). The cached resource loader and memory cache 14 act as if the memory cache is disabled if the resource has this special session id. 15 16 Hook up ReplayController to override the memory cache setting during capture/replay. 17 18 Test: http/tests/cache/bypass-memory-cache-after-reload.html 19 20 * loader/cache/CachedResourceLoader.cpp: 21 (WebCore::CachedResourceLoader::requestResource): 22 (WebCore::CachedResourceLoader::revalidateResource): 23 * loader/cache/MemoryCache.cpp: 24 (WebCore::MemoryCache::add): 25 * page/Page.cpp: 26 (WebCore::Page::sessionID): 27 * page/SessionID.h: 28 (WebCore::SessionID::bypassCacheSessionID): 29 * page/Settings.cpp: 30 (WebCore::Settings::Settings): 31 * page/Settings.h: 32 (WebCore::Settings::setUsesMemoryCache): 33 (WebCore::Settings::usesMemoryCache): 34 * replay/ReplayController.cpp: 35 (WebCore::ReplayController::setForceDeterministicSettings): 36 * replay/ReplayController.h: 37 * testing/InternalSettings.cpp: 38 (WebCore::InternalSettings::Backup::Backup): 39 (WebCore::InternalSettings::Backup::restoreTo): 40 (WebCore::InternalSettings::setUsesMemoryCache): 41 * testing/InternalSettings.h: 42 * testing/InternalSettings.idl: 43 1 44 2014-03-28 Radu Stavila <stavila@adobe.com> 2 45 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r165427 r166434 485 485 486 486 ASSERT(resource->url() == url.string()); 487 m_documentResources.set(resource->url(), resource); 487 488 if (sessionID() != SessionID::bypassCacheSessionID()) 489 m_documentResources.set(resource->url(), resource); 490 488 491 return resource; 489 492 } … … 497 500 ASSERT(!resource->resourceToRevalidate()); 498 501 ASSERT(resource->sessionID() == sessionID()); 502 ASSERT(sessionID() != SessionID::bypassCacheSessionID()); 499 503 500 504 // Copy the URL out of the resource to be revalidated in case it gets deleted by the remove() call below. -
trunk/Source/WebCore/loader/cache/MemoryCache.cpp
r165607 r166434 111 111 return false; 112 112 113 if (resource->sessionID() == SessionID::bypassCacheSessionID()) 114 return false; 115 113 116 ASSERT(WTF::isMainThread()); 114 117 -
trunk/Source/WebCore/page/Page.cpp
r166323 r166434 1521 1521 return SessionID::legacyPrivateSessionID(); 1522 1522 1523 if (!settings().usesMemoryCache()) 1524 return SessionID::bypassCacheSessionID(); 1525 1523 1526 return SessionID::defaultSessionID(); 1524 1527 } -
trunk/Source/WebCore/page/SessionID.h
r164726 r166434 44 44 static SessionID defaultSessionID() { return SessionID(1); } 45 45 static SessionID legacyPrivateSessionID() { return SessionID(2); } 46 static SessionID bypassCacheSessionID() { return SessionID(3); } 46 47 private: 47 48 uint64_t m_sessionID; -
trunk/Source/WebCore/page/Settings.cpp
r165676 r166434 178 178 , m_needsAdobeFrameReloadingQuirk(false) 179 179 , m_usesPageCache(false) 180 , m_usesMemoryCache(true) 180 181 , m_fontRenderingMode(0) 181 182 , m_showTiledScrollingIndicator(false) -
trunk/Source/WebCore/page/Settings.h
r165676 r166434 182 182 void setUsesPageCache(bool); 183 183 bool usesPageCache() const { return m_usesPageCache; } 184 184 185 void setUsesMemoryCache(bool usesMemoryCache) { m_usesMemoryCache = usesMemoryCache; } 186 bool usesMemoryCache() const { return m_usesMemoryCache; } 187 185 188 void setFontRenderingMode(FontRenderingMode mode); 186 189 FontRenderingMode fontRenderingMode() const; … … 308 311 bool m_needsAdobeFrameReloadingQuirk : 1; 309 312 bool m_usesPageCache : 1; 313 bool m_usesMemoryCache : 1; 310 314 unsigned m_fontRenderingMode : 1; 311 315 bool m_showTiledScrollingIndicator : 1; -
trunk/Source/WebCore/replay/ReplayController.cpp
r166337 r166434 72 72 73 73 if (shouldForce) { 74 m_savedSettings.usesMemoryCache = m_page.settings().usesMemoryCache(); 74 75 m_savedSettings.usesPageCache = m_page.settings().usesPageCache(); 75 76 77 m_page.settings().setUsesMemoryCache(false); 76 78 m_page.settings().setUsesPageCache(false); 77 79 } else { 80 m_page.settings().setUsesMemoryCache(m_savedSettings.usesMemoryCache); 78 81 m_page.settings().setUsesPageCache(m_savedSettings.usesPageCache); 79 82 } -
trunk/Source/WebCore/replay/ReplayController.h
r166337 r166434 155 155 156 156 struct SavedSettings { 157 bool usesMemoryCache; 157 158 bool usesPageCache; 158 159 159 160 SavedSettings() 160 : usesPageCache(false) 161 : usesMemoryCache(true) 162 , usesPageCache(false) 161 163 { } 162 164 }; -
trunk/Source/WebCore/testing/InternalSettings.cpp
r164131 r166434 92 92 , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled()) 93 93 , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy()) 94 , m_usesMemoryCache(settings.usesMemoryCache()) 94 95 { 95 96 } … … 150 151 settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled); 151 152 settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy); 153 settings.setUsesMemoryCache(m_usesMemoryCache); 152 154 RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled); 153 155 } … … 494 496 } 495 497 496 } 498 void InternalSettings::setUsesMemoryCache(bool usesMemoryCache, ExceptionCode& ec) 499 { 500 InternalSettingsGuardForSettings(); 501 settings()->setUsesMemoryCache(usesMemoryCache); 502 } 503 504 } -
trunk/Source/WebCore/testing/InternalSettings.h
r164131 r166434 89 89 bool m_pluginReplacementEnabled; 90 90 bool m_shouldConvertPositionStyleOnCopy; 91 bool m_usesMemoryCache; 91 92 }; 92 93 … … 133 134 void setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode&); 134 135 void setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode&); 135 136 void setUsesMemoryCache(bool usesMemoryCache, ExceptionCode&); 136 137 137 138 private: -
trunk/Source/WebCore/testing/InternalSettings.idl
r164131 r166434 60 60 [RaisesException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground); 61 61 [RaisesException] void setShouldConvertPositionStyleOnCopy(boolean convert); 62 [RaisesException] void setUsesMemoryCache(boolean usesMemoryCache); 62 63 }; -
trunk/Source/WebKit2/ChangeLog
r166433 r166434 1 2014-03-28 Brian Burg <bburg@apple.com> 2 3 Web Replay: add page-level setting to bypass the MemoryCache 4 https://bugs.webkit.org/show_bug.cgi?id=130728 5 6 Reviewed by Timothy Hatcher. 7 8 * UIProcess/APISession.cpp: 9 (API::generateID): update the base ID for generating unique sessions. 10 1 11 2014-03-28 Cody Krieger <cjk@apple.com> 2 12 -
trunk/Source/WebKit2/UIProcess/APISession.cpp
r165794 r166434 35 35 ASSERT(RunLoop::isMain()); 36 36 37 static uint64_t uniqueSessionID = WebCore::SessionID:: legacyPrivateSessionID().sessionID();37 static uint64_t uniqueSessionID = WebCore::SessionID::bypassCacheSessionID().sessionID(); 38 38 ASSERT_UNUSED(isEphemeral, isEphemeral); 39 39 return ++uniqueSessionID;
Note: See TracChangeset
for help on using the changeset viewer.