Diff
Deleted: trunk/LayoutTests/http/tests/cache/cached-main-resource-expected.txt (139693 => 139694)
--- trunk/LayoutTests/http/tests/cache/cached-main-resource-expected.txt 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/LayoutTests/http/tests/cache/cached-main-resource-expected.txt 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,2 +0,0 @@
-PASS
-
Deleted: trunk/LayoutTests/http/tests/cache/cached-main-resource.html (139693 => 139694)
--- trunk/LayoutTests/http/tests/cache/cached-main-resource.html 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/LayoutTests/http/tests/cache/cached-main-resource.html 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,24 +0,0 @@
-<html>
-<body _onload_="setTimeout(removeAndReload, 0);">
-<div id="result"></div>
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
-function removeAndReload()
-{
- document.body.removeChild(document.getElementById("iframe"));
- var newIframe = document.createElement("iframe");
- newIframe.src = ""
- document.body.appendChild(newIframe);
- var fromCache = internals.isLoadingFromMemoryCache(newIframe.src);
- document.getElementById("result").appendChild(document.createTextNode(fromCache ? "PASS" : "FAIL"));
- if (window.testRunner)
- testRunner.notifyDone();
-}
-</script>
-<iframe id="iframe" src=""
-</body>
-</html>
Deleted: trunk/LayoutTests/http/tests/cache/resources/cacheable-iframe.php (139693 => 139694)
--- trunk/LayoutTests/http/tests/cache/resources/cacheable-iframe.php 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/LayoutTests/http/tests/cache/resources/cacheable-iframe.php 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,11 +0,0 @@
-<?php
-require_once '../../resources/portabilityLayer.php';
-
-$max_age = 12 * 31 * 24 * 60 * 60; //one year
-$expires = gmdate(DATE_RFC1123, time() + $max_age);
-
-header('Cache-Control: public, max-age=' . $max_age);
-header('Expires: ' . $expires);
-header('Content-Type: text/html');
-exit();
-?>
Modified: trunk/LayoutTests/http/tests/inspector/resource-har-pages-expected.txt (139693 => 139694)
--- trunk/LayoutTests/http/tests/inspector/resource-har-pages-expected.txt 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/LayoutTests/http/tests/inspector/resource-har-pages-expected.txt 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,5 +1,6 @@
Tests conversion of Inspector's resource representation into HAR format.
+Page reloaded.
{
0 : {
id : <string>
@@ -27,5 +28,4 @@
page: page_1 url: http://127.0.0.1:8000/inspector/resources/har-pages-navigation-target.html
page: page_1 url: http://127.0.0.1:8000/inspector/resources/source1.js
page: page_1 url: http://127.0.0.1:8000/resources/redirect.php?url=""
-Page reloaded.
Modified: trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt (139693 => 139694)
--- trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt 2013-01-15 01:22:59 UTC (rev 139694)
@@ -42,11 +42,11 @@
http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, http status code 200>
frame "1" - didCancelClientRedirectForFrame
frame "1" - didCommitLoadForFrame
-http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading
frame "1" - didFinishDocumentLoadForFrame
frame "1" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php
frame "1" - didHandleOnloadEventsForFrame
frame "1" - didFinishLoadForFrame
+http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading
frame "1" - didStartProvisionalLoadForFrame
http://127.0.0.1:8000/loading/resources/redirect-methods-result.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/redirect-methods-result.php, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method POST> redirectResponse (null)
http://127.0.0.1:8000/loading/resources/redirect-methods-result.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-result.php, http status code 302>
@@ -69,11 +69,11 @@
http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, http status code 200>
frame "2" - didCancelClientRedirectForFrame
frame "2" - didCommitLoadForFrame
-http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading
frame "2" - didFinishDocumentLoadForFrame
frame "2" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php
frame "2" - didHandleOnloadEventsForFrame
frame "2" - didFinishLoadForFrame
+http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading
frame "2" - didStartProvisionalLoadForFrame
http://127.0.0.1:8000/loading/resources/redirect-methods-result.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/redirect-methods-result.php, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method POST> redirectResponse (null)
http://127.0.0.1:8000/loading/resources/redirect-methods-result.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-result.php, http status code 303>
@@ -96,11 +96,11 @@
http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-form.html, http status code 200>
frame "3" - didCancelClientRedirectForFrame
frame "3" - didCommitLoadForFrame
-http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading
frame "3" - didFinishDocumentLoadForFrame
frame "3" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php
frame "3" - didHandleOnloadEventsForFrame
frame "3" - didFinishLoadForFrame
+http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading
frame "3" - didStartProvisionalLoadForFrame
http://127.0.0.1:8000/loading/resources/redirect-methods-result.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/redirect-methods-result.php, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method POST> redirectResponse (null)
http://127.0.0.1:8000/loading/resources/redirect-methods-result.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/redirect-methods-result.php?redirected=true, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method POST> redirectResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/redirect-methods-result.php, http status code 307>
Modified: trunk/LayoutTests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt (139693 => 139694)
--- trunk/LayoutTests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/LayoutTests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,7 +1,6 @@
<unknown> - didFinishLoading
http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html, main document URL http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html, http method GET> redirectResponse (null)
http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html, http status code 200>
-http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html - didFinishLoading
Radar 6973106 and https://bugs.webkit.org/show_bug.cgi?id=27896 - Favicons still load when automatic image loading is disabled.
This test uses DRT's resource load delegate callback mode to see if the favicon is loaded even when image loading is off.
Modified: trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt (139693 => 139694)
--- trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,6 +1,5 @@
<unknown> - didFinishLoading
http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, main document URL http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, http method GET> redirectResponse (null)
http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html, http status code 200>
-http://127.0.0.1:8000/misc/link-rel-icon-beforeload.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/misc/link-rel-icon-beforeload.html, http method GET> redirectResponse (null)
This test should not show a request for the favicon dont-load-this.ico, since the beforeload handler on the favicon link returns false. Therefore, if the resource request list below shows a request for dont-load-this.ico, then this test has failed.
Modified: trunk/Source/WebCore/ChangeLog (139693 => 139694)
--- trunk/Source/WebCore/ChangeLog 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/ChangeLog 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,3 +1,7 @@
+2013-01-09 Levi Weintraub <le...@chromium.org>
+
+ Rolling out r139683. It broke a bunch of webkit_unit_tests.
+
2013-01-14 Ojan Vafai <o...@chromium.org>
RenderListItem does not need to override computePreferredLogicalWidth
Modified: trunk/Source/WebCore/WebCore.exp.in (139693 => 139694)
--- trunk/Source/WebCore/WebCore.exp.in 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/WebCore.exp.in 2013-01-15 01:22:59 UTC (rev 139694)
@@ -145,7 +145,6 @@
__ZN7WebCore11MemoryCache13getStatisticsEv
__ZN7WebCore11MemoryCache13setCapacitiesEjjj
__ZN7WebCore11MemoryCache14evictResourcesEv
-__ZN7WebCore11MemoryCache14resourceForURLERKNS_4KURLE
__ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE
__ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE
__ZN7WebCore11URLWithDataEP6NSDataP5NSURL
Modified: trunk/Source/WebCore/dom/Document.cpp (139693 => 139694)
--- trunk/Source/WebCore/dom/Document.cpp 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/dom/Document.cpp 2013-01-15 01:22:59 UTC (rev 139694)
@@ -845,11 +845,6 @@
return m_implementation.get();
}
-bool Document::hasManifest() const
-{
- return documentElement() && documentElement()->hasTagName(htmlTag) && documentElement()->hasAttribute(manifestAttr);
-}
-
void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
Modified: trunk/Source/WebCore/dom/Document.h (139693 => 139694)
--- trunk/Source/WebCore/dom/Document.h 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/dom/Document.h 2013-01-15 01:22:59 UTC (rev 139694)
@@ -340,8 +340,6 @@
{
return m_documentElement.get();
}
-
- bool hasManifest() const;
virtual PassRefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&);
PassRefPtr<DocumentFragment> createDocumentFragment();
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (139693 => 139694)
--- trunk/Source/WebCore/loader/FrameLoader.cpp 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2013-01-15 01:22:59 UTC (rev 139694)
@@ -2887,10 +2887,6 @@
if (!resource->shouldSendResourceLoadCallbacks() || m_documentLoader->haveToldClientAboutLoad(resource->url()))
return;
- // Main resource delegate messages are synthesized in MainResourceLoader, so we must not send them here.
- if (resource->type() == CachedResource::MainResource)
- return;
-
if (!page->areMemoryCacheClientCallsEnabled()) {
InspectorInstrumentation::didLoadResourceFromMemoryCache(page, m_documentLoader.get(), resource);
m_documentLoader->recordMemoryCacheLoadForFutureClientNotification(resource->url());
Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (139693 => 139694)
--- trunk/Source/WebCore/loader/MainResourceLoader.cpp 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp 2013-01-15 01:22:59 UTC (rev 139694)
@@ -46,7 +46,6 @@
#include "HTMLFormElement.h"
#include "HistoryItem.h"
#include "InspectorInstrumentation.h"
-#include "MemoryCache.h"
#include "Page.h"
#include "ProgressTracker.h"
#include "ResourceBuffer.h"
@@ -74,7 +73,7 @@
, m_loadingMultipartContent(false)
, m_waitingForContentPolicy(false)
, m_timeOfLastDataReceived(0.0)
- , m_identifierForLoadWithoutResourceLoader(0)
+ , m_substituteDataLoadIdentifier(0)
#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
, m_filter(0)
#endif
@@ -100,9 +99,9 @@
RefPtr<MainResourceLoader> protect(this);
RefPtr<Frame> protectFrame(m_documentLoader->frame());
- if (m_identifierForLoadWithoutResourceLoader) {
+ if (m_substituteDataLoadIdentifier) {
ASSERT(!loader());
- frameLoader()->client()->dispatchDidFailLoading(documentLoader(), m_identifierForLoadWithoutResourceLoader, error);
+ frameLoader()->client()->dispatchDidFailLoading(documentLoader(), m_substituteDataLoadIdentifier, error);
}
// It is important that we call DocumentLoader::mainReceivedError before calling
@@ -287,7 +286,7 @@
ASSERT(!m_substituteData.isValid());
documentLoader()->applicationCacheHost()->maybeLoadMainResourceForRedirect(newRequest, m_substituteData);
if (m_substituteData.isValid())
- m_identifierForLoadWithoutResourceLoader = identifier();
+ m_substituteDataLoadIdentifier = identifier();
}
// FIXME: Ideally we'd stop the I/O until we hear back from the navigation policy delegate
@@ -393,21 +392,7 @@
void MainResourceLoader::responseReceived(CachedResource* resource, const ResourceResponse& r)
{
ASSERT_UNUSED(resource, m_resource == resource);
- bool willLoadFallback = documentLoader()->applicationCacheHost()->maybeLoadFallbackForMainResponse(request(), r);
-
- // The memory cache doesn't understand the application cache or its caching rules. So if a main resource is served
- // from the application cache, ensure we don't save the result for future use.
- bool shouldRemoveResourceFromCache = willLoadFallback;
-#if PLATFORM(CHROMIUM)
- // chromium's ApplicationCacheHost implementation always returns true for maybeLoadFallbackForMainResponse(). However, all responses loaded
- // from appcache will have a non-zero appCacheID().
- if (r.appCacheID())
- shouldRemoveResourceFromCache = true;
-#endif
- if (shouldRemoveResourceFromCache)
- memoryCache()->remove(m_resource.get());
-
- if (willLoadFallback)
+ if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForMainResponse(request(), r))
return;
DEFINE_STATIC_LOCAL(AtomicString, xFrameOptionHeader, ("x-frame-options", AtomicString::ConstructFromLiteral));
@@ -555,7 +540,7 @@
if (!loader()) {
frameLoader()->notifier()->dispatchDidFinishLoading(documentLoader(), identifier(), finishTime);
- m_identifierForLoadWithoutResourceLoader = 0;
+ m_substituteDataLoadIdentifier = 0;
}
#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
@@ -577,13 +562,6 @@
documentLoader()->timing()->setResponseEnd(finishTime ? finishTime : (m_timeOfLastDataReceived ? m_timeOfLastDataReceived : monotonicallyIncreasingTime()));
documentLoader()->finishedLoading();
- // If the document specified an application cache manifest, it violates the author's intent if we store it in the memory cache
- // and deny the appcache the chance to intercept it in the future, so remove from the memory cache.
- if (Frame* frame = documentLoader()->frame()) {
- if (m_resource && frame->document()->hasManifest())
- memoryCache()->remove(m_resource.get());
- }
-
dl->applicationCacheHost()->finishedLoadingMainResource();
}
@@ -693,9 +671,9 @@
documentLoader()->applicationCacheHost()->maybeLoadMainResource(request, m_substituteData);
if (m_substituteData.isValid()) {
- m_identifierForLoadWithoutResourceLoader = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier();
- frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, documentLoader(), request);
- frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_identifierForLoadWithoutResourceLoader, request, ResourceResponse());
+ m_substituteDataLoadIdentifier = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier();
+ frameLoader()->notifier()->assignIdentifierToInitialRequest(m_substituteDataLoadIdentifier, documentLoader(), request);
+ frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_substituteDataLoadIdentifier, request, ResourceResponse());
handleSubstituteDataLoadSoon(request);
return;
}
@@ -708,20 +686,13 @@
documentLoader()->setRequest(ResourceRequest());
return;
}
- if (!loader()) {
- m_identifierForLoadWithoutResourceLoader = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier();
- frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, documentLoader(), request);
- frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_identifierForLoadWithoutResourceLoader, request, ResourceResponse());
- }
m_resource->addClient(this);
- // A bunch of headers are set when the underlying ResourceLoader is created, and DocumentLoader::m_request needs to include those.
+ // We need to wait until after requestMainResource() is called to setRequest(), because there are a bunch of headers set when
+ // the underlying ResourceLoader is created, and DocumentLoader::m_request needs to include those. However, the cache will
+ // strip the fragment identifier (which DocumentLoader::m_request should also include), so add that back in.
if (loader())
request = loader()->originalRequest();
- // If there was a fragment identifier on initialRequest, the cache will have stripped it. DocumentLoader::m_request should include
- // the fragment identifier, so add that back in.
- if (equalIgnoringFragmentIdentifier(initialRequest.url(), request.url()))
- request.setURL(initialRequest.url());
documentLoader()->setRequest(request);
}
@@ -749,9 +720,9 @@
unsigned long MainResourceLoader::identifier() const
{
- ASSERT(!m_identifierForLoadWithoutResourceLoader || !loader() || !loader()->identifier());
- if (m_identifierForLoadWithoutResourceLoader)
- return m_identifierForLoadWithoutResourceLoader;
+ ASSERT(!m_substituteDataLoadIdentifier || !loader() || !loader()->identifier());
+ if (m_substituteDataLoadIdentifier)
+ return m_substituteDataLoadIdentifier;
if (ResourceLoader* resourceLoader = loader())
return resourceLoader->identifier();
return 0;
Modified: trunk/Source/WebCore/loader/MainResourceLoader.h (139693 => 139694)
--- trunk/Source/WebCore/loader/MainResourceLoader.h 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/MainResourceLoader.h 2013-01-15 01:22:59 UTC (rev 139694)
@@ -128,7 +128,7 @@
bool m_loadingMultipartContent;
bool m_waitingForContentPolicy;
double m_timeOfLastDataReceived;
- unsigned long m_identifierForLoadWithoutResourceLoader;
+ unsigned long m_substituteDataLoadIdentifier;
#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
WebFilterEvaluator *m_filter;
Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.cpp (139693 => 139694)
--- trunk/Source/WebCore/loader/cache/CachedRawResource.cpp 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.cpp 2013-01-15 01:22:59 UTC (rev 139694)
@@ -80,25 +80,14 @@
void CachedRawResource::didAddClient(CachedResourceClient* c)
{
- if (!hasClient(c))
+ if (m_response.isNull() || !hasClient(c))
return;
// The calls to the client can result in events running, potentially causing
// this resource to be evicted from the cache and all clients to be removed,
// so a protector is necessary.
CachedResourceHandle<CachedRawResource> protect(this);
CachedRawResourceClient* client = static_cast<CachedRawResourceClient*>(c);
- size_t redirectCount = m_redirectChain.size();
- for (size_t i = 0; i < redirectCount; i++) {
- RedirectPair redirect = m_redirectChain[i];
- ResourceRequest request(redirect.m_request);
- client->redirectReceived(this, request, redirect.m_redirectResponse);
- if (!hasClient(c))
- return;
- }
- ASSERT(redirectCount == m_redirectChain.size());
-
- if (!m_response.isNull())
- client->responseReceived(this, m_response);
+ client->responseReceived(this, m_response);
if (!hasClient(c))
return;
if (m_data)
@@ -121,7 +110,6 @@
CachedResourceClientWalker<CachedRawResourceClient> w(m_clients);
while (CachedRawResourceClient* c = w.next())
c->redirectReceived(this, request, response);
- m_redirectChain.append(RedirectPair(request, response));
}
CachedResource::willSendRequest(request, response);
}
@@ -206,12 +194,6 @@
if (!shouldIgnoreHeaderForCacheReuse(headerName) && i->value != newHeaders.get(headerName))
return false;
}
-
- for (size_t i = 0; i < m_redirectChain.size(); i++) {
- if (m_redirectChain[i].m_redirectResponse.cacheControlContainsNoStore())
- return false;
- }
-
return true;
}
Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.h (139693 => 139694)
--- trunk/Source/WebCore/loader/cache/CachedRawResource.h 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.h 2013-01-15 01:22:59 UTC (rev 139694)
@@ -48,7 +48,7 @@
SubresourceLoader* loader() const;
void clear();
- virtual bool canReuse(const ResourceRequest&) const;
+ bool canReuse(const ResourceRequest&) const;
virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
@@ -67,20 +67,6 @@
#endif
unsigned long m_identifier;
-
- struct RedirectPair {
- public:
- explicit RedirectPair(const ResourceRequest& request, const ResourceResponse& redirectResponse)
- : m_request(request)
- , m_redirectResponse(redirectResponse)
- {
- }
-
- const ResourceRequest m_request;
- const ResourceResponse m_redirectResponse;
- };
-
- Vector<RedirectPair> m_redirectChain;
};
Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (139693 => 139694)
--- trunk/Source/WebCore/loader/cache/CachedResource.cpp 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp 2013-01-15 01:22:59 UTC (rev 139694)
@@ -497,8 +497,8 @@
if (!hasClients() && inCache())
memoryCache()->addToLiveResourcesSize(this);
- if ((m_type == RawResource || m_type == MainResource) && !m_response.isNull() && !m_proxyResource) {
- // Certain resources (especially XHRs and main resources) do crazy things if an asynchronous load returns
+ if (m_type == RawResource && !m_response.isNull() && !m_proxyResource) {
+ // Certain resources (especially XHRs) do crazy things if an asynchronous load returns
// synchronously (e.g., scripts may not have set all the state they need to handle the load).
// Therefore, rather than immediately sending callbacks on a cache hit like other CachedResources,
// we schedule the callbacks and ensure we never finish synchronously.
Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (139693 => 139694)
--- trunk/Source/WebCore/loader/cache/CachedResource.h 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h 2013-01-15 01:22:59 UTC (rev 139694)
@@ -258,8 +258,6 @@
virtual void reportMemoryUsage(MemoryObjectInfo*) const;
- virtual bool canReuse(const ResourceRequest&) const { return true; }
-
protected:
virtual void checkNotify();
Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (139693 => 139694)
--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2013-01-15 01:22:59 UTC (rev 139694)
@@ -540,9 +540,12 @@
return Reload;
}
- if (!existingResource->canReuse(request))
+ if (existingResource->type() == CachedResource::MainResource)
return Reload;
+ if (existingResource->type() == CachedResource::RawResource && !static_cast<CachedRawResource*>(existingResource)->canReuse(request))
+ return Reload;
+
// Certain requests (e.g., XHRs) might have manually set headers that require revalidation.
// FIXME: In theory, this should be a Revalidate case. In practice, the MemoryCache revalidation path assumes a whole bunch
// of things about how revalidation works that manual headers violate, so punt to Reload instead.
Modified: trunk/Source/WebCore/testing/Internals.cpp (139693 => 139694)
--- trunk/Source/WebCore/testing/Internals.cpp 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/testing/Internals.cpp 2013-01-15 01:22:59 UTC (rev 139694)
@@ -65,7 +65,6 @@
#include "IntRect.h"
#include "Language.h"
#include "MallocStatistics.h"
-#include "MemoryCache.h"
#include "MockPagePopupDriver.h"
#include "NodeRenderingContext.h"
#include "Page.h"
@@ -294,14 +293,6 @@
return document->cachedResourceLoader()->isPreloaded(url);
}
-bool Internals::isLoadingFromMemoryCache(const String& url)
-{
- if (!contextDocument())
- return false;
- CachedResource* resource = memoryCache()->resourceForURL(contextDocument()->completeURL(url));
- return resource && resource->status() == CachedResource::Cached;
-}
-
PassRefPtr<Element> Internals::createContentElement(Document* document, ExceptionCode& ec)
{
if (!document) {
Modified: trunk/Source/WebCore/testing/Internals.h (139693 => 139694)
--- trunk/Source/WebCore/testing/Internals.h 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/testing/Internals.h 2013-01-15 01:22:59 UTC (rev 139694)
@@ -72,7 +72,6 @@
String address(Node*);
bool isPreloaded(Document*, const String& url);
- bool isLoadingFromMemoryCache(const String& url);
size_t numberOfScopedHTMLStyleChildren(const Node*, ExceptionCode&) const;
Modified: trunk/Source/WebCore/testing/Internals.idl (139693 => 139694)
--- trunk/Source/WebCore/testing/Internals.idl 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebCore/testing/Internals.idl 2013-01-15 01:22:59 UTC (rev 139694)
@@ -30,7 +30,6 @@
DOMString elementRenderTreeAsText(in Element element) raises(DOMException);
boolean isPreloaded(in Document document, in DOMString url);
- boolean isLoadingFromMemoryCache(in DOMString url);
unsigned long numberOfScopedHTMLStyleChildren(in Node scope) raises(DOMException);
Modified: trunk/Source/WebKit/win/ChangeLog (139693 => 139694)
--- trunk/Source/WebKit/win/ChangeLog 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebKit/win/ChangeLog 2013-01-15 01:22:59 UTC (rev 139694)
@@ -1,12 +1,7 @@
-2013-01-14 Nate Chapin <jap...@chromium.org>
+2013-01-09 Levi Weintraub <le...@chromium.org>
- Enable reuse of cached main resources
- https://bugs.webkit.org/show_bug.cgi?id=105667
+ Rolling out r139683. It broke a bunch of webkit_unit_tests.
- Reviewed by Antti Koivisto.
-
- * WebKit.vcproj/WebKitExports.def.in: Expose some MemoryCache symbols for use in Internals.
-
2013-01-09 Hajime Morrita <morr...@google.com>
[Shadow DOM] Distribution related code on ElementShadow should be minimized.
Modified: trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in (139693 => 139694)
--- trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in 2013-01-15 01:22:59 UTC (rev 139694)
@@ -560,7 +560,6 @@
?addSlowCase@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PAVStringImpl@2@@Z
?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z
?childItemWithTarget@HistoryItem@WebCore@@QBEPAV12@ABVString@WTF@@@Z
- ?completeURL@Document@WebCore@@QBE?AVKURL@2@ABVString@WTF@@@Z
?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z
?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@ABVString@4@@Z
?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@PAVExecState@JSC@@VJSValue@6@PAV?$Vector@V?$RefPtr@VMessagePort@WebCore@@@WTF@@$00@4@PAV?$Vector@V?$RefPtr@VArrayBuffer@WTF@@@WTF@@$00@4@W4SerializationErrorMode@2@@Z
@@ -1391,7 +1390,6 @@
?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
?mainThreadScrollingReasonsAsText@Page@WebCore@@QAE?AVString@WTF@@XZ
?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z
- ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ
?nextSibling@ComposedShadowTreeWalker@WebCore@@QAEXXZ
?firstChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ
?lastChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ
@@ -1411,7 +1409,6 @@
?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVContainerNode@2@HH_N@Z
?remove@String@WTF@@QAEXIH@Z
?removedLastRef@Node@WebCore@@AAEXXZ
- ?resourceForURL@MemoryCache@WebCore@@QAEPAVCachedResource@2@ABVKURL@2@@Z
?reverseFind@StringImpl@WTF@@QAEI_WI@Z
?saveDocumentAndScrollState@HistoryController@WebCore@@QAEXXZ
?scriptExecutionContext@JSDOMGlobalObject@WebCore@@QBEPAVScriptExecutionContext@2@XZ
Modified: trunk/Source/autotools/symbols.filter (139693 => 139694)
--- trunk/Source/autotools/symbols.filter 2013-01-15 01:19:14 UTC (rev 139693)
+++ trunk/Source/autotools/symbols.filter 2013-01-15 01:22:59 UTC (rev 139694)
@@ -50,12 +50,10 @@
_ZN7WebCore10ClientRectC1Ev;
_ZN7WebCore10ClientRectC1ERKNS_7IntRectE;
_ZN7WebCore10ShadowRoot6createEPNS_7ElementERi;
-_ZN7WebCore11memoryCacheEv;
_ZN7WebCore11EventTarget17toGeneratedStreamEv;
_ZN7WebCore11EventTarget8toStreamEv;
_ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELj0EEE;
_ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELm0EEE;
-_ZN7WebCore11MemoryCache14resourceForURLERKNS_4KURLE;
_ZN7WebCore12TextIterator26rangeFromLocationAndLengthEPNS_13ContainerNodeEiib;
_ZN7WebCore12TextIterator29getLocationAndLengthFromRangeEPNS_7ElementEPKNS_5RangeERjS6_;
_ZN7WebCore12TextIterator29getLocationAndLengthFromRangeEPNS_7ElementEPKNS_5RangeERmS6_;
@@ -148,7 +146,6 @@
_ZNK7WebCore5Frame8settingsEv;
_ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE;
_ZNK7WebCore7Element6shadowEv;
-_ZNK7WebCore8Document11completeURLERKN3WTF6StringE;
_ZNK7WebCore8Document4pageEv;
_ZNK7WebCore8Document8settingsEv;
_ZNK7WebCore8Document4viewEv;