Changeset 139694 in webkit
- Timestamp:
- Jan 14, 2013, 5:22:59 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/http/tests/inspector/resource-har-pages-expected.txt
r139683 r139694 1 1 Tests conversion of Inspector's resource representation into HAR format. 2 2 3 Page reloaded. 3 4 { 4 5 0 : { … … 28 29 page: page_1 url: http://127.0.0.1:8000/inspector/resources/source1.js 29 30 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
r139683 r139694 43 43 frame "1" - didCancelClientRedirectForFrame 44 44 frame "1" - didCommitLoadForFrame 45 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading46 45 frame "1" - didFinishDocumentLoadForFrame 47 46 frame "1" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php 48 47 frame "1" - didHandleOnloadEventsForFrame 49 48 frame "1" - didFinishLoadForFrame 49 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading 50 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 - didFinishLoading73 72 frame "2" - didFinishDocumentLoadForFrame 74 73 frame "2" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php 75 74 frame "2" - didHandleOnloadEventsForFrame 76 75 frame "2" - didFinishLoadForFrame 76 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading 77 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 - didFinishLoading100 99 frame "3" - didFinishDocumentLoadForFrame 101 100 frame "3" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-result.php 102 101 frame "3" - didHandleOnloadEventsForFrame 103 102 frame "3" - didFinishLoadForFrame 103 http://127.0.0.1:8000/loading/resources/redirect-methods-form.html - didFinishLoading 104 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
r139683 r139694 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 - didFinishLoading5 4 Radar 6973106 and https://bugs.webkit.org/show_bug.cgi?id=27896 - Favicons still load when automatic image loading is disabled. 6 5 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
r139683 r139694 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 - didFinishLoading5 4 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) 6 5 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/Source/WebCore/ChangeLog
r139693 r139694 1 2013-01-09 Levi Weintraub <leviw@chromium.org> 2 3 Rolling out r139683. It broke a bunch of webkit_unit_tests. 4 1 5 2013-01-14 Ojan Vafai <ojan@chromium.org> 2 6 -
trunk/Source/WebCore/WebCore.exp.in
r139683 r139694 146 146 __ZN7WebCore11MemoryCache13setCapacitiesEjjj 147 147 __ZN7WebCore11MemoryCache14evictResourcesEv 148 __ZN7WebCore11MemoryCache14resourceForURLERKNS_4KURLE149 148 __ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE 150 149 __ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE -
trunk/Source/WebCore/dom/Document.cpp
r139683 r139694 846 846 } 847 847 848 bool Document::hasManifest() const849 {850 return documentElement() && documentElement()->hasTagName(htmlTag) && documentElement()->hasAttribute(manifestAttr);851 }852 853 848 void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) 854 849 { -
trunk/Source/WebCore/dom/Document.h
r139683 r139694 341 341 return m_documentElement.get(); 342 342 } 343 344 bool hasManifest() const;345 343 346 344 virtual PassRefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&); -
trunk/Source/WebCore/loader/FrameLoader.cpp
r139683 r139694 2888 2888 return; 2889 2889 2890 // Main resource delegate messages are synthesized in MainResourceLoader, so we must not send them here.2891 if (resource->type() == CachedResource::MainResource)2892 return;2893 2894 2890 if (!page->areMemoryCacheClientCallsEnabled()) { 2895 2891 InspectorInstrumentation::didLoadResourceFromMemoryCache(page, m_documentLoader.get(), resource); -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r139683 r139694 47 47 #include "HistoryItem.h" 48 48 #include "InspectorInstrumentation.h" 49 #include "MemoryCache.h"50 49 #include "Page.h" 51 50 #include "ProgressTracker.h" … … 75 74 , m_waitingForContentPolicy(false) 76 75 , m_timeOfLastDataReceived(0.0) 77 , m_ identifierForLoadWithoutResourceLoader(0)76 , m_substituteDataLoadIdentifier(0) 78 77 #if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 79 78 , m_filter(0) … … 101 100 RefPtr<Frame> protectFrame(m_documentLoader->frame()); 102 101 103 if (m_ identifierForLoadWithoutResourceLoader) {102 if (m_substituteDataLoadIdentifier) { 104 103 ASSERT(!loader()); 105 frameLoader()->client()->dispatchDidFailLoading(documentLoader(), m_ identifierForLoadWithoutResourceLoader, error);104 frameLoader()->client()->dispatchDidFailLoading(documentLoader(), m_substituteDataLoadIdentifier, error); 106 105 } 107 106 … … 288 287 documentLoader()->applicationCacheHost()->maybeLoadMainResourceForRedirect(newRequest, m_substituteData); 289 288 if (m_substituteData.isValid()) 290 m_ identifierForLoadWithoutResourceLoader = identifier();289 m_substituteDataLoadIdentifier = identifier(); 291 290 } 292 291 … … 394 393 { 395 394 ASSERT_UNUSED(resource, m_resource == resource); 396 bool willLoadFallback = documentLoader()->applicationCacheHost()->maybeLoadFallbackForMainResponse(request(), r); 397 398 // The memory cache doesn't understand the application cache or its caching rules. So if a main resource is served 399 // from the application cache, ensure we don't save the result for future use. 400 bool shouldRemoveResourceFromCache = willLoadFallback; 401 #if PLATFORM(CHROMIUM) 402 // chromium's ApplicationCacheHost implementation always returns true for maybeLoadFallbackForMainResponse(). However, all responses loaded 403 // from appcache will have a non-zero appCacheID(). 404 if (r.appCacheID()) 405 shouldRemoveResourceFromCache = true; 406 #endif 407 if (shouldRemoveResourceFromCache) 408 memoryCache()->remove(m_resource.get()); 409 410 if (willLoadFallback) 395 if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForMainResponse(request(), r)) 411 396 return; 412 397 … … 556 541 if (!loader()) { 557 542 frameLoader()->notifier()->dispatchDidFinishLoading(documentLoader(), identifier(), finishTime); 558 m_ identifierForLoadWithoutResourceLoader = 0;543 m_substituteDataLoadIdentifier = 0; 559 544 } 560 545 … … 578 563 documentLoader()->finishedLoading(); 579 564 580 // If the document specified an application cache manifest, it violates the author's intent if we store it in the memory cache581 // and deny the appcache the chance to intercept it in the future, so remove from the memory cache.582 if (Frame* frame = documentLoader()->frame()) {583 if (m_resource && frame->document()->hasManifest())584 memoryCache()->remove(m_resource.get());585 }586 587 565 dl->applicationCacheHost()->finishedLoadingMainResource(); 588 566 } … … 694 672 695 673 if (m_substituteData.isValid()) { 696 m_ identifierForLoadWithoutResourceLoader = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier();697 frameLoader()->notifier()->assignIdentifierToInitialRequest(m_ identifierForLoadWithoutResourceLoader, documentLoader(), request);698 frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_ identifierForLoadWithoutResourceLoader, request, ResourceResponse());674 m_substituteDataLoadIdentifier = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier(); 675 frameLoader()->notifier()->assignIdentifierToInitialRequest(m_substituteDataLoadIdentifier, documentLoader(), request); 676 frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_substituteDataLoadIdentifier, request, ResourceResponse()); 699 677 handleSubstituteDataLoadSoon(request); 700 678 return; … … 709 687 return; 710 688 } 711 if (!loader()) {712 m_identifierForLoadWithoutResourceLoader = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier();713 frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, documentLoader(), request);714 frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_identifierForLoadWithoutResourceLoader, request, ResourceResponse());715 }716 689 m_resource->addClient(this); 717 690 718 // A bunch of headers are set when the underlying ResourceLoader is created, and DocumentLoader::m_request needs to include those. 691 // We need to wait until after requestMainResource() is called to setRequest(), because there are a bunch of headers set when 692 // the underlying ResourceLoader is created, and DocumentLoader::m_request needs to include those. However, the cache will 693 // strip the fragment identifier (which DocumentLoader::m_request should also include), so add that back in. 719 694 if (loader()) 720 695 request = loader()->originalRequest(); 721 // If there was a fragment identifier on initialRequest, the cache will have stripped it. DocumentLoader::m_request should include722 // the fragment identifier, so add that back in.723 if (equalIgnoringFragmentIdentifier(initialRequest.url(), request.url()))724 request.setURL(initialRequest.url());725 696 documentLoader()->setRequest(request); 726 697 } … … 750 721 unsigned long MainResourceLoader::identifier() const 751 722 { 752 ASSERT(!m_ identifierForLoadWithoutResourceLoader || !loader() || !loader()->identifier());753 if (m_ identifierForLoadWithoutResourceLoader)754 return m_ identifierForLoadWithoutResourceLoader;723 ASSERT(!m_substituteDataLoadIdentifier || !loader() || !loader()->identifier()); 724 if (m_substituteDataLoadIdentifier) 725 return m_substituteDataLoadIdentifier; 755 726 if (ResourceLoader* resourceLoader = loader()) 756 727 return resourceLoader->identifier(); -
trunk/Source/WebCore/loader/MainResourceLoader.h
r139683 r139694 129 129 bool m_waitingForContentPolicy; 130 130 double m_timeOfLastDataReceived; 131 unsigned long m_ identifierForLoadWithoutResourceLoader;131 unsigned long m_substituteDataLoadIdentifier; 132 132 133 133 #if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 -
trunk/Source/WebCore/loader/cache/CachedRawResource.cpp
r139683 r139694 81 81 void CachedRawResource::didAddClient(CachedResourceClient* c) 82 82 { 83 if ( !hasClient(c))83 if (m_response.isNull() || !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 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); 90 client->responseReceived(this, m_response); 102 91 if (!hasClient(c)) 103 92 return; … … 122 111 while (CachedRawResourceClient* c = w.next()) 123 112 c->redirectReceived(this, request, response); 124 m_redirectChain.append(RedirectPair(request, response));125 113 } 126 114 CachedResource::willSendRequest(request, response); … … 207 195 return false; 208 196 } 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 215 197 return true; 216 198 } -
trunk/Source/WebCore/loader/cache/CachedRawResource.h
r139683 r139694 49 49 void clear(); 50 50 51 virtualbool canReuse(const ResourceRequest&) const;51 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;84 70 }; 85 71 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r139683 r139694 498 498 memoryCache()->addToLiveResourcesSize(this); 499 499 500 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 returns500 if (m_type == RawResource && !m_response.isNull() && !m_proxyResource) { 501 // Certain resources (especially XHRs) 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
r139683 r139694 259 259 virtual void reportMemoryUsage(MemoryObjectInfo*) const; 260 260 261 virtual bool canReuse(const ResourceRequest&) const { return true; }262 263 261 protected: 264 262 virtual void checkNotify(); -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r139683 r139694 541 541 } 542 542 543 if (!existingResource->canReuse(request)) 543 if (existingResource->type() == CachedResource::MainResource) 544 return Reload; 545 546 if (existingResource->type() == CachedResource::RawResource && !static_cast<CachedRawResource*>(existingResource)->canReuse(request)) 544 547 return Reload; 545 548 -
trunk/Source/WebCore/testing/Internals.cpp
r139683 r139694 66 66 #include "Language.h" 67 67 #include "MallocStatistics.h" 68 #include "MemoryCache.h"69 68 #include "MockPagePopupDriver.h" 70 69 #include "NodeRenderingContext.h" … … 293 292 294 293 return document->cachedResourceLoader()->isPreloaded(url); 295 }296 297 bool Internals::isLoadingFromMemoryCache(const String& url)298 {299 if (!contextDocument())300 return false;301 CachedResource* resource = memoryCache()->resourceForURL(contextDocument()->completeURL(url));302 return resource && resource->status() == CachedResource::Cached;303 294 } 304 295 -
trunk/Source/WebCore/testing/Internals.h
r139683 r139694 73 73 74 74 bool isPreloaded(Document*, const String& url); 75 bool isLoadingFromMemoryCache(const String& url);76 75 77 76 size_t numberOfScopedHTMLStyleChildren(const Node*, ExceptionCode&) const; -
trunk/Source/WebCore/testing/Internals.idl
r139683 r139694 31 31 DOMString elementRenderTreeAsText(in Element element) raises(DOMException); 32 32 boolean isPreloaded(in Document document, in DOMString url); 33 boolean isLoadingFromMemoryCache(in DOMString url);34 33 35 34 unsigned long numberOfScopedHTMLStyleChildren(in Node scope) raises(DOMException); -
trunk/Source/WebKit/win/ChangeLog
r139683 r139694 1 2013-01-14 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 Antti Koivisto. 7 8 * WebKit.vcproj/WebKitExports.def.in: Expose some MemoryCache symbols for use in Internals. 1 2013-01-09 Levi Weintraub <leviw@chromium.org> 2 3 Rolling out r139683. It broke a bunch of webkit_unit_tests. 9 4 10 5 2013-01-09 Hajime Morrita <morrita@google.com> -
trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in
r139683 r139694 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@@@Z564 563 ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z 565 564 ?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@ABVString@4@@Z … … 1392 1391 ?mainThreadScrollingReasonsAsText@Page@WebCore@@QAE?AVString@WTF@@XZ 1393 1392 ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z 1394 ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ1395 1393 ?nextSibling@ComposedShadowTreeWalker@WebCore@@QAEXXZ 1396 1394 ?firstChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ … … 1412 1410 ?remove@String@WTF@@QAEXIH@Z 1413 1411 ?removedLastRef@Node@WebCore@@AAEXXZ 1414 ?resourceForURL@MemoryCache@WebCore@@QAEPAVCachedResource@2@ABVKURL@2@@Z1415 1412 ?reverseFind@StringImpl@WTF@@QAEI_WI@Z 1416 1413 ?saveDocumentAndScrollState@HistoryController@WebCore@@QAEXXZ -
trunk/Source/autotools/symbols.filter
r139683 r139694 51 51 _ZN7WebCore10ClientRectC1ERKNS_7IntRectE; 52 52 _ZN7WebCore10ShadowRoot6createEPNS_7ElementERi; 53 _ZN7WebCore11memoryCacheEv;54 53 _ZN7WebCore11EventTarget17toGeneratedStreamEv; 55 54 _ZN7WebCore11EventTarget8toStreamEv; 56 55 _ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELj0EEE; 57 56 _ZN7WebCore11HistoryItem16setDocumentStateERKN3WTF6VectorINS1_6StringELm0EEE; 58 _ZN7WebCore11MemoryCache14resourceForURLERKNS_4KURLE;59 57 _ZN7WebCore12TextIterator26rangeFromLocationAndLengthEPNS_13ContainerNodeEiib; 60 58 _ZN7WebCore12TextIterator29getLocationAndLengthFromRangeEPNS_7ElementEPKNS_5RangeERjS6_; … … 149 147 _ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE; 150 148 _ZNK7WebCore7Element6shadowEv; 151 _ZNK7WebCore8Document11completeURLERKN3WTF6StringE;152 149 _ZNK7WebCore8Document4pageEv; 153 150 _ZNK7WebCore8Document8settingsEv;
Note:
See TracChangeset
for help on using the changeset viewer.