Changeset 141136 in webkit
- Timestamp:
- Jan 29, 2013, 12:06:19 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r141108 r141136 1 2013-01-29 Nate Chapin <japhet@chromium.org> 2 3 Enable reuse of cached main resources 4 https://bugs.webkit.org/show_bug.cgi?id=105667 5 6 Reviewed by Adam Barth. 7 8 * Source/autotools/symbols.filter: Expose MemoryCache::resourceForURL(). 9 1 10 2013-01-29 Laszlo Gombos <l.gombos@samsung.com> 2 11 -
trunk/LayoutTests/ChangeLog
r141133 r141136 1 2013-01-29 Nate Chapin <japhet@chromium.org> 2 3 Enable reuse of cached main resources 4 https://bugs.webkit.org/show_bug.cgi?id=105667. 5 6 Reviewed by Adam Barth. 7 8 * http/tests/cache/cached-main-resource-expected.txt: Added. 9 * http/tests/cache/cached-main-resource.html: Added. 10 * http/tests/cache/resources/cacheable-iframe.php: Added. 11 * http/tests/inspector/resource-har-pages-expected.txt: 12 * http/tests/loading/redirect-methods-expected.txt: 13 * http/tests/misc/favicon-loads-with-images-disabled-expected.txt: 14 * http/tests/misc/link-rel-icon-beforeload-expected.txt: 15 * platform/chromium/TestExpectations: 16 1 17 2013-01-29 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/LayoutTests/http/tests/inspector/resource-har-pages-expected.txt
r140105 r141136 1 1 Tests conversion of Inspector's resource representation into HAR format. 2 2 3 Page reloaded.4 3 { 5 4 0 : { … … 29 28 page: page_1 url: http://127.0.0.1:8000/inspector/resources/source1.js 30 29 page: page_1 url: http://127.0.0.1:8000/resources/redirect.php?url=/inspector/resources/har-pages-navigation-target.html 30 Page reloaded. 31 31 -
trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt
r140105 r141136 43 43 frame "1" - didCancelClientRedirectForFrame 44 44 frame "1" - didCommitLoadForFrame 45 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading 45 46 frame "1" - didFinishDocumentLoadForFrame 46 47 frame "1" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php 47 48 frame "1" - didHandleOnloadEventsForFrame 48 49 frame "1" - didFinishLoadForFrame 49 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading50 50 frame "1" - didStartProvisionalLoadForFrame 51 51 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) … … 70 70 frame "2" - didCancelClientRedirectForFrame 71 71 frame "2" - didCommitLoadForFrame 72 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading 72 73 frame "2" - didFinishDocumentLoadForFrame 73 74 frame "2" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php 74 75 frame "2" - didHandleOnloadEventsForFrame 75 76 frame "2" - didFinishLoadForFrame 76 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading77 77 frame "2" - didStartProvisionalLoadForFrame 78 78 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) … … 97 97 frame "3" - didCancelClientRedirectForFrame 98 98 frame "3" - didCommitLoadForFrame 99 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading 99 100 frame "3" - didFinishDocumentLoadForFrame 100 101 frame "3" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php 101 102 frame "3" - didHandleOnloadEventsForFrame 102 103 frame "3" - didFinishLoadForFrame 103 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading104 104 frame "3" - didStartProvisionalLoadForFrame 105 105 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) -
trunk/LayoutTests/http/tests/misc/favicon-loads-with-images-disabled-expected.txt
r140105 r141136 2 2 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) 3 3 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> 4 http://127.0.0.1:8000/misc/favicon-loads-with-images-disabled.html - didFinishLoading 4 5 Radar 6973106 and https://bugs.webkit.org/show_bug.cgi?id=27896 - Favicons still load when automatic image loading is disabled. 5 6 This test uses DRT's resource load delegate callback mode to see if the favicon is loaded even when image loading is off. -
trunk/LayoutTests/http/tests/misc/link-rel-icon-beforeload-expected.txt
r140105 r141136 2 2 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) 3 3 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> 4 http://127.0.0.1:8000/misc/link-rel-icon-beforeload.html - didFinishLoading 4 5 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) 5 6 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. -
trunk/LayoutTests/platform/chromium/TestExpectations
r141077 r141136 4334 4334 webkit.org/b/107899 fast/repaint/selection-clear.html [ ImageOnlyFailure ] 4335 4335 4336 webkit.org/b/107962 http/tests/misc/favicon-loads-with-images-disabled.html [ Failure ] 4337 webkit.org/b/107962 http/tests/loading/redirect-methods.html [ Failure ] 4338 webkit.org/b/107962 http/tests/cache/cached-main-resource.html [ Failure ] 4339 4336 4340 webkit.org/b/107893 [ MountainLion ] fast/exclusions/shape-inside/shape-inside-first-fit-001.html [ ImageOnlyFailure ] 4337 4341 -
trunk/Source/WebCore/ChangeLog
r141135 r141136 1 2013-01-29 Nate Chapin <japhet@chromium.org> 2 3 Enable reuse of cached main resources 4 https://bugs.webkit.org/show_bug.cgi?id=105667 5 6 Reviewed by Adam Barth. 7 8 Test: http/tests/cache/cached-main-resource.html 9 10 * WebCore.exp.in: 11 * dom/Document.cpp: 12 (WebCore::Document::hasManifest): Returns true if the <html> element has a non-empty manifest attribute. 13 (WebCore): 14 * dom/Document.h: 15 (Document): 16 * loader/FrameLoader.cpp: 17 (WebCore::FrameLoader::loadedResourceFromMemoryCache): Don't send delegate callbacks for cache hit here, since 18 MainResourceLoader will take care of it. 19 * loader/MainResourceLoader.cpp: 20 (WebCore::MainResourceLoader::MainResourceLoader): 21 (WebCore::MainResourceLoader::receivedError): 22 (WebCore::MainResourceLoader::willSendRequest): 23 (WebCore::MainResourceLoader::responseReceived): Don't try to cache loads from the application cache. 24 (WebCore::MainResourceLoader::didFinishLoading): Don't try to cache loads from the application cache. 25 (WebCore::MainResourceLoader::load): Ensure we create a resource load identifier for cache hits. Also, 26 ensure we correctly popualate fragment identifiers in the ResourceRequest reported to DocumentLoader. 27 (WebCore::MainResourceLoader::identifier): 28 * loader/MainResourceLoader.h: Rename m_substituteDataLoadIdentifier to m_identifierForLoadWithoutResourceLoader 29 to better describe when it is used. 30 * loader/cache/CachedRawResource.cpp: 31 (WebCore::CachedRawResource::didAddClient): Synthesize redirect notifications for cache hits if necessary. 32 (WebCore::CachedRawResource::willSendRequest): Note the redirects we received. 33 (WebCore::CachedRawResource::canReuse): Don't reuse a resource if the redirect chain included a "Cache-control: no-store". 34 * loader/cache/CachedRawResource.h: 35 (CachedRawResource): 36 (RedirectPair): 37 (WebCore::CachedRawResource::RedirectPair::RedirectPair): 38 * loader/cache/CachedResource.cpp: 39 (WebCore::CachedResource::addClientToSet): Don't return cached data for a main resource synchronously 40 * loader/cache/CachedResource.h: 41 (WebCore::CachedResource::canReuse): 42 (CachedResource): 43 * loader/cache/CachedResourceLoader.cpp: 44 (WebCore::CachedResourceLoader::requestResource): Leave cahce reuse of main resources off for chromium for now. 45 (WebCore::CachedResourceLoader::determineRevalidationPolicy): Permit cache reuse for main resources. 46 * testing/Internals.cpp: 47 (WebCore::Internals::isPreloaded): 48 (WebCore): 49 (WebCore::Internals::isLoadingFromMemoryCache): 50 * testing/Internals.h: 51 (Internals): 52 * testing/Internals.idl: 53 1 54 2013-01-29 Min Qin <qinmin@chromium.org> 2 55 -
trunk/Source/WebCore/WebCore.exp.in
r141012 r141136 146 146 __ZN7WebCore11MemoryCache13setCapacitiesEjjj 147 147 __ZN7WebCore11MemoryCache14evictResourcesEv 148 __ZN7WebCore11MemoryCache14resourceForURLERKNS_4KURLE 148 149 __ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE 149 150 __ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE -
trunk/Source/WebCore/dom/Document.cpp
r140784 r141136 814 814 } 815 815 816 bool Document::hasManifest() const 817 { 818 return documentElement() && documentElement()->hasTagName(htmlTag) && documentElement()->hasAttribute(manifestAttr); 819 } 820 816 821 void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) 817 822 { -
trunk/Source/WebCore/dom/Document.h
r140105 r141136 341 341 return m_documentElement.get(); 342 342 } 343 344 bool hasManifest() const; 343 345 344 346 virtual PassRefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&); -
trunk/Source/WebCore/loader/FrameLoader.cpp
r140748 r141136 2897 2897 return; 2898 2898 2899 // Main resource delegate messages are synthesized in MainResourceLoader, so we must not send them here. 2900 if (resource->type() == CachedResource::MainResource) 2901 return; 2902 2899 2903 if (!page->areMemoryCacheClientCallsEnabled()) { 2900 2904 InspectorInstrumentation::didLoadResourceFromMemoryCache(page, m_documentLoader.get(), resource); -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r140875 r141136 47 47 #include "HistoryItem.h" 48 48 #include "InspectorInstrumentation.h" 49 #include "MemoryCache.h" 49 50 #include "Page.h" 50 51 #include "ProgressTracker.h" … … 74 75 , m_waitingForContentPolicy(false) 75 76 , m_timeOfLastDataReceived(0.0) 76 , m_ substituteDataLoadIdentifier(0)77 , m_identifierForLoadWithoutResourceLoader(0) 77 78 { 78 79 } … … 94 95 RefPtr<Frame> protectFrame(m_documentLoader->frame()); 95 96 96 if (m_ substituteDataLoadIdentifier) {97 if (m_identifierForLoadWithoutResourceLoader) { 97 98 ASSERT(!loader()); 98 frameLoader()->client()->dispatchDidFailLoading(documentLoader(), m_ substituteDataLoadIdentifier, error);99 frameLoader()->client()->dispatchDidFailLoading(documentLoader(), m_identifierForLoadWithoutResourceLoader, error); 99 100 } 100 101 … … 274 275 documentLoader()->applicationCacheHost()->maybeLoadMainResourceForRedirect(newRequest, m_substituteData); 275 276 if (m_substituteData.isValid()) 276 m_ substituteDataLoadIdentifier = identifier();277 m_identifierForLoadWithoutResourceLoader = identifier(); 277 278 } 278 279 … … 380 381 { 381 382 ASSERT_UNUSED(resource, m_resource == resource); 382 if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForMainResponse(request(), r)) 383 bool willLoadFallback = documentLoader()->applicationCacheHost()->maybeLoadFallbackForMainResponse(request(), r); 384 385 // The memory cache doesn't understand the application cache or its caching rules. So if a main resource is served 386 // from the application cache, ensure we don't save the result for future use. 387 bool shouldRemoveResourceFromCache = willLoadFallback; 388 #if PLATFORM(CHROMIUM) 389 // chromium's ApplicationCacheHost implementation always returns true for maybeLoadFallbackForMainResponse(). However, all responses loaded 390 // from appcache will have a non-zero appCacheID(). 391 if (r.appCacheID()) 392 shouldRemoveResourceFromCache = true; 393 #endif 394 if (shouldRemoveResourceFromCache) 395 memoryCache()->remove(m_resource.get()); 396 397 if (willLoadFallback) 383 398 return; 384 399 … … 523 538 if (!loader()) { 524 539 frameLoader()->notifier()->dispatchDidFinishLoading(documentLoader(), identifier(), finishTime); 525 m_ substituteDataLoadIdentifier = 0;540 m_identifierForLoadWithoutResourceLoader = 0; 526 541 } 527 542 … … 542 557 documentLoader()->timing()->setResponseEnd(finishTime ? finishTime : (m_timeOfLastDataReceived ? m_timeOfLastDataReceived : monotonicallyIncreasingTime())); 543 558 documentLoader()->finishedLoading(); 559 560 // If the document specified an application cache manifest, it violates the author's intent if we store it in the memory cache 561 // and deny the appcache the chance to intercept it in the future, so remove from the memory cache. 562 if (Frame* frame = documentLoader()->frame()) { 563 if (m_resource && frame->document()->hasManifest()) 564 memoryCache()->remove(m_resource.get()); 565 } 544 566 545 567 dl->applicationCacheHost()->finishedLoadingMainResource(); … … 645 667 646 668 if (m_substituteData.isValid()) { 647 m_ substituteDataLoadIdentifier = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier();648 frameLoader()->notifier()->assignIdentifierToInitialRequest(m_ substituteDataLoadIdentifier, documentLoader(), request);649 frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_ substituteDataLoadIdentifier, request, ResourceResponse());669 m_identifierForLoadWithoutResourceLoader = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier(); 670 frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, documentLoader(), request); 671 frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_identifierForLoadWithoutResourceLoader, request, ResourceResponse()); 650 672 handleSubstituteDataLoadSoon(request); 651 673 return; … … 660 682 return; 661 683 } 684 if (!loader()) { 685 m_identifierForLoadWithoutResourceLoader = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier(); 686 frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, documentLoader(), request); 687 frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_identifierForLoadWithoutResourceLoader, request, ResourceResponse()); 688 } 662 689 m_resource->addClient(this); 663 690 664 // We need to wait until after requestMainResource() is called to setRequest(), because there are a bunch of headers set when 665 // the underlying ResourceLoader is created, and DocumentLoader::m_request needs to include those. However, the cache will 666 // strip the fragment identifier (which DocumentLoader::m_request should also include), so add that back in. 691 // A bunch of headers are set when the underlying ResourceLoader is created, and DocumentLoader::m_request needs to include those. 667 692 if (loader()) 668 693 request = loader()->originalRequest(); 694 // If there was a fragment identifier on initialRequest, the cache will have stripped it. DocumentLoader::m_request should include 695 // the fragment identifier, so add that back in. 696 if (equalIgnoringFragmentIdentifier(initialRequest.url(), request.url())) 697 request.setURL(initialRequest.url()); 669 698 documentLoader()->setRequest(request); 670 699 } … … 694 723 unsigned long MainResourceLoader::identifier() const 695 724 { 696 ASSERT(!m_ substituteDataLoadIdentifier || !loader() || !loader()->identifier());697 if (m_ substituteDataLoadIdentifier)698 return m_ substituteDataLoadIdentifier;725 ASSERT(!m_identifierForLoadWithoutResourceLoader || !loader() || !loader()->identifier()); 726 if (m_identifierForLoadWithoutResourceLoader) 727 return m_identifierForLoadWithoutResourceLoader; 699 728 if (ResourceLoader* resourceLoader = loader()) 700 729 return resourceLoader->identifier(); -
trunk/Source/WebCore/loader/MainResourceLoader.h
r140875 r141136 129 129 bool m_waitingForContentPolicy; 130 130 double m_timeOfLastDataReceived; 131 unsigned long m_ substituteDataLoadIdentifier;131 unsigned long m_identifierForLoadWithoutResourceLoader; 132 132 133 133 #if USE(CONTENT_FILTERING) -
trunk/Source/WebCore/loader/cache/CachedRawResource.cpp
r140105 r141136 81 81 void CachedRawResource::didAddClient(CachedResourceClient* c) 82 82 { 83 if ( m_response.isNull() ||!hasClient(c))83 if (!hasClient(c)) 84 84 return; 85 85 // The calls to the client can result in events running, potentially causing … … 88 88 CachedResourceHandle<CachedRawResource> protect(this); 89 89 CachedRawResourceClient* client = static_cast<CachedRawResourceClient*>(c); 90 client->responseReceived(this, m_response); 90 size_t redirectCount = m_redirectChain.size(); 91 for (size_t i = 0; i < redirectCount; i++) { 92 RedirectPair redirect = m_redirectChain[i]; 93 ResourceRequest request(redirect.m_request); 94 client->redirectReceived(this, request, redirect.m_redirectResponse); 95 if (!hasClient(c)) 96 return; 97 } 98 ASSERT(redirectCount == m_redirectChain.size()); 99 100 if (!m_response.isNull()) 101 client->responseReceived(this, m_response); 91 102 if (!hasClient(c)) 92 103 return; … … 111 122 while (CachedRawResourceClient* c = w.next()) 112 123 c->redirectReceived(this, request, response); 124 m_redirectChain.append(RedirectPair(request, response)); 113 125 } 114 126 CachedResource::willSendRequest(request, response); … … 195 207 return false; 196 208 } 209 210 for (size_t i = 0; i < m_redirectChain.size(); i++) { 211 if (m_redirectChain[i].m_redirectResponse.cacheControlContainsNoStore()) 212 return false; 213 } 214 197 215 return true; 198 216 } -
trunk/Source/WebCore/loader/cache/CachedRawResource.h
r140105 r141136 49 49 void clear(); 50 50 51 bool canReuse(const ResourceRequest&) const;51 virtual bool canReuse(const ResourceRequest&) const; 52 52 53 53 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; … … 68 68 69 69 unsigned long m_identifier; 70 71 struct RedirectPair { 72 public: 73 explicit RedirectPair(const ResourceRequest& request, const ResourceResponse& redirectResponse) 74 : m_request(request) 75 , m_redirectResponse(redirectResponse) 76 { 77 } 78 79 const ResourceRequest m_request; 80 const ResourceResponse m_redirectResponse; 81 }; 82 83 Vector<RedirectPair> m_redirectChain; 70 84 }; 71 85 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r140174 r141136 498 498 memoryCache()->addToLiveResourcesSize(this); 499 499 500 if ( m_type == RawResource&& !m_response.isNull() && !m_proxyResource) {501 // Certain resources (especially XHRs ) do crazy things if an asynchronous load returns500 if ((m_type == RawResource || m_type == MainResource) && !m_response.isNull() && !m_proxyResource) { 501 // Certain resources (especially XHRs and main resources) do crazy things if an asynchronous load returns 502 502 // synchronously (e.g., scripts may not have set all the state they need to handle the load). 503 503 // Therefore, rather than immediately sending callbacks on a cache hit like other CachedResources, -
trunk/Source/WebCore/loader/cache/CachedResource.h
r140722 r141136 259 259 virtual void reportMemoryUsage(MemoryObjectInfo*) const; 260 260 261 virtual bool canReuse(const ResourceRequest&) const { return true; } 262 261 263 protected: 262 264 virtual void checkNotify(); -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r140522 r141136 478 478 } 479 479 480 #if PLATFORM(CHROMIUM) 481 // FIXME: Temporarily leave main resource caching disabled for chromium, see https://bugs.webkit.org/show_bug.cgi?id=107962 482 // Ensure main resources aren't preloaded, and other main resource loads are removed from cache to prevent reuse. 483 if (type == CachedResource::MainResource) { 484 ASSERT(policy != Use); 485 ASSERT(policy != Revalidate); 486 memoryCache()->remove(resource.get()); 487 if (request.forPreload()) 488 return 0; 489 } 490 #endif 491 480 492 if (!request.resourceRequest().url().protocolIsData()) 481 493 m_validatedURLs.add(request.resourceRequest().url()); … … 504 516 memoryCache()->add(newResource.get()); 505 517 #if ENABLE(RESOURCE_TIMING) 506 InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingTime() }; 507 m_initiatorMap.add(newResource.get(), info); 518 if (resource->type() != CachedResource::MainResource) { 519 InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingTime() }; 520 m_initiatorMap.add(newResource.get(), info); 521 } 508 522 #else 509 523 UNUSED_PARAM(request); … … 523 537 resource->setOwningCachedResourceLoader(this); 524 538 #if ENABLE(RESOURCE_TIMING) 525 InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingTime() }; 526 m_initiatorMap.add(resource.get(), info); 539 if (type != CachedResource::MainResource) { 540 InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingTime() }; 541 m_initiatorMap.add(resource.get(), info); 542 } 527 543 #endif 528 544 return resource; … … 544 560 } 545 561 546 if (existingResource->type() == CachedResource::MainResource) 547 return Reload; 548 549 if (existingResource->type() == CachedResource::RawResource && !static_cast<CachedRawResource*>(existingResource)->canReuse(request)) 562 if (!existingResource->canReuse(request)) 550 563 return Reload; 551 564 -
trunk/Source/WebCore/testing/Internals.cpp
r140710 r141136 66 66 #include "Language.h" 67 67 #include "MallocStatistics.h" 68 #include "MemoryCache.h" 68 69 #include "MockPagePopupDriver.h" 69 70 #include "NodeRenderingContext.h" … … 290 291 Document* document = contextDocument(); 291 292 return document->cachedResourceLoader()->isPreloaded(url); 293 } 294 295 bool Internals::isLoadingFromMemoryCache(const String& url) 296 { 297 if (!contextDocument()) 298 return false; 299 CachedResource* resource = memoryCache()->resourceForURL(contextDocument()->completeURL(url)); 300 return resource && resource->status() == CachedResource::Cached; 292 301 } 293 302 -
trunk/Source/WebCore/testing/Internals.h
r140710 r141136 73 73 74 74 bool isPreloaded(const String& url); 75 bool isLoadingFromMemoryCache(const String& url); 75 76 76 77 size_t numberOfScopedHTMLStyleChildren(const Node*, ExceptionCode&) const; -
trunk/Source/WebCore/testing/Internals.idl
r140710 r141136 31 31 DOMString elementRenderTreeAsText(in Element element) raises(DOMException); 32 32 boolean isPreloaded(in DOMString url); 33 boolean isLoadingFromMemoryCache(in DOMString url); 33 34 34 35 unsigned long numberOfScopedHTMLStyleChildren(in Node scope) raises(DOMException); -
trunk/Source/WebKit/win/ChangeLog
r140930 r141136 1 2013-01-29 Nate Chapin <japhet@chromium.org> 2 3 Enable reuse of cached main resources 4 https://bugs.webkit.org/show_bug.cgi?id=105667 5 6 Reviewed by Adam Barth. 7 8 * WebKit.vcproj/WebKitExports.def.in: Expose some MemoryCache symbols for use in Internals. 9 1 10 2013-01-27 Zoltan Arvai <zarvai@inf.u-szeged.hu> 2 11 -
trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in
r140553 r141136 561 561 ?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z 562 562 ?childItemWithTarget@HistoryItem@WebCore@@QBEPAV12@ABVString@WTF@@@Z 563 ?completeURL@Document@WebCore@@QBE?AVKURL@2@ABVString@WTF@@@Z 563 564 ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z 564 565 ?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@ABVString@4@@Z … … 1389 1390 ?mainThreadScrollingReasonsAsText@Page@WebCore@@QAE?AVString@WTF@@XZ 1390 1391 ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z 1392 ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ 1391 1393 ?nextSibling@ComposedShadowTreeWalker@WebCore@@QAEXXZ 1392 1394 ?firstChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ … … 1408 1410 ?remove@String@WTF@@QAEXIH@Z 1409 1411 ?removedLastRef@Node@WebCore@@AAEXXZ 1412 ?resourceForURL@MemoryCache@WebCore@@QAEPAVCachedResource@2@ABVKURL@2@@Z 1410 1413 ?reverseFind@StringImpl@WTF@@QAEI_WI@Z 1411 1414 ?saveDocumentAndScrollState@HistoryController@WebCore@@QAEXXZ -
trunk/Source/autotools/symbols.filter
r140563 r141136 51 51 _ZN7WebCore10ClientRectC1ERKNS_7IntRectE; 52 52 _ZN7WebCore10ShadowRoot6createEPNS_7ElementERi; 53 _ZN7WebCore11memoryCacheEv; 53 54 _ZN7WebCore11EventTarget17toGeneratedStreamEv; 54 55 _ZN7WebCore11EventTarget8toStreamEv; 55 56 _ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELj0EEE; 56 57 _ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELm0EEE; 58 _ZN7WebCore11MemoryCache14resourceForURLERKNS_4KURLE; 57 59 _ZN7WebCore12TextIterator26rangeFromLocationAndLengthEPNS_13ContainerNodeEiib; 58 60 _ZN7WebCore12TextIterator29getLocationAndLengthFromRangeEPNS_7ElementEPKNS_5RangeERjS6_; … … 147 149 _ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE; 148 150 _ZNK7WebCore7Element6shadowEv; 151 _ZNK7WebCore8Document11completeURLERKN3WTF6StringE; 149 152 _ZNK7WebCore8Document4pageEv; 150 153 _ZNK7WebCore8Document8settingsEv;
Note:
See TracChangeset
for help on using the changeset viewer.