Changeset 136031 in webkit
- Timestamp:
- Nov 28, 2012 11:30:48 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r136030 r136031 1 2012-11-28 Nate Chapin <japhet@chromium.org> 2 3 Move empty loading to DocumentLoader, simplify FrameLoader::init() 4 https://bugs.webkit.org/show_bug.cgi?id=101512 5 6 Reviewed by Adam Barth. 7 8 Don't expect resource load callbacks for empty loads. 9 10 * http/tests/inspector/network/network-iframe-load-and-delete.html: 11 * http/tests/loading/redirect-methods-expected.txt: 12 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: 13 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: 14 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: 15 1 16 2012-11-28 Andrew Scherkus <scherkus@chromium.org> 2 17 -
trunk/LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html
r135192 r136031 44 44 function step2() 45 45 { 46 var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];46 var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2]; 47 47 InspectorTest.addResult(request1.url); 48 48 InspectorTest.addResult("resource.type: " + request1.type); … … 53 53 function step3() 54 54 { 55 var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];55 var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2]; 56 56 InspectorTest.addResult("resource.content after requesting content: " + request1.content); 57 57 -
trunk/LayoutTests/http/tests/loading/redirect-methods-expected.txt
r135192 r136031 6 6 <unknown> - didFinishLoading 7 7 frame "0" - didStartProvisionalLoadForFrame 8 about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)9 about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>10 8 frame "0" - didCommitLoadForFrame 11 9 frame "0" - didFinishDocumentLoadForFrame 12 10 frame "0" - didHandleOnloadEventsForFrame 13 11 frame "0" - didFinishLoadForFrame 14 about:blank - didFinishLoading15 12 frame "0" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 16 13 frame "0" - didStartProvisionalLoadForFrame … … 33 30 frame "0" - didFinishDocumentLoadForFrame 34 31 frame "1" - didStartProvisionalLoadForFrame 35 about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)36 about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>37 32 frame "1" - didCommitLoadForFrame 38 33 frame "1" - didFinishDocumentLoadForFrame 39 34 frame "1" - didHandleOnloadEventsForFrame 40 35 frame "1" - didFinishLoadForFrame 41 about:blank - didFinishLoading42 36 frame "1" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 43 37 frame "0" - didHandleOnloadEventsForFrame … … 63 57 frame "1" - didFinishDocumentLoadForFrame 64 58 frame "2" - didStartProvisionalLoadForFrame 65 about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)66 about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>67 59 frame "2" - didCommitLoadForFrame 68 60 frame "2" - didFinishDocumentLoadForFrame 69 61 frame "2" - didHandleOnloadEventsForFrame 70 62 frame "2" - didFinishLoadForFrame 71 about:blank - didFinishLoading72 63 frame "2" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 73 64 frame "1" - didHandleOnloadEventsForFrame … … 93 84 frame "2" - didFinishDocumentLoadForFrame 94 85 frame "3" - didStartProvisionalLoadForFrame 95 about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/loading/redirect-methods.html, http method GET> redirectResponse (null)96 about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>97 86 frame "3" - didCommitLoadForFrame 98 87 frame "3" - didFinishDocumentLoadForFrame 99 88 frame "3" - didHandleOnloadEventsForFrame 100 89 frame "3" - didFinishLoadForFrame 101 about:blank - didFinishLoading102 90 frame "3" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/redirect-methods-form.html 103 91 frame "2" - didHandleOnloadEventsForFrame -
trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt
r135192 r136031 4 4 http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html"> 5 5 CONSOLE MESSAGE: Refused to display 'http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html' in a frame because it set 'X-Frame-Options' to 'deny'. 6 about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag.html, http method GET> redirectResponse (null)7 about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>8 6 There should be no content in the iframe below 9 7 -
trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt
r135192 r136031 4 4 http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html"> 5 5 CONSOLE MESSAGE: Refused to display 'http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html' in a frame because it set 'X-Frame-Options' to 'deny'. 6 about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html, http method GET> redirectResponse (null)7 about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>8 6 There should be no content in the iframe below 9 7 -
trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt
r135192 r136031 4 4 http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html"> 5 5 CONSOLE MESSAGE: Refused to display 'http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html' in a frame because it set 'X-Frame-Options' to 'sameorigin'. 6 about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html, http method GET> redirectResponse (null)7 about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>8 6 There should be no content in the iframe below 9 7 -
trunk/Source/WebCore/ChangeLog
r136026 r136031 1 2012-11-28 Nate Chapin <japhet@chromium.org> 2 3 Move empty loading to DocumentLoader, simplify FrameLoader::init() 4 https://bugs.webkit.org/show_bug.cgi?id=101512 5 6 Reviewed by Adam Barth. 7 8 No new tests, though several outputs changed because we no longer send resource 9 load callbacks for empty loads. 10 11 * loader/DocumentLoader.cpp: 12 (WebCore::DocumentLoader::DocumentLoader): 13 (WebCore::DocumentLoader::~DocumentLoader): 14 (WebCore::DocumentLoader::finishedLoading): 15 (WebCore::DocumentLoader::commitData): 16 (WebCore::DocumentLoader::clearMainResourceLoader): 17 (WebCore::DocumentLoader::isLoadingInAPISense): 18 (WebCore::DocumentLoader::documentURL): 19 (WebCore::DocumentLoader::isLoadingMainResource): 20 (WebCore::DocumentLoader::maybeLoadEmpty): 21 (WebCore): 22 (WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource 23 loads directly here. 24 * loader/DocumentLoader.h: 25 (WebCore::DocumentLoader::serverRedirectSourceForHistory): 26 (DocumentLoader): 27 * loader/FrameLoader.cpp: 28 (WebCore::FrameLoader::FrameLoader): Initialize some variables whose values 29 were previously being reset in init(). Given that the FrameLoader is in 30 an inconsistent state before init() is called anyway, there doesn't seem 31 to be a disadvantage to just initializing them to their post-init() values. 32 (WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of 33 doing a bunch of direct calls to functions FrameLoader shouldn't know about. 34 * loader/FrameLoaderStateMachine.cpp: 35 (WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine): 36 * loader/FrameLoaderStateMachine.h: 37 * loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load. 38 (WebCore::MainResourceLoader::loadNow): This only returned true when an empty 39 load got deferred, which won't happen now. Return void and always treat 40 as returning false. 41 * loader/MainResourceLoader.h: 42 (MainResourceLoader): 43 1 44 2012-11-28 Antoine Quint <graouts@apple.com> 2 45 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r135192 r136031 50 50 #include "Page.h" 51 51 #include "ResourceBuffer.h" 52 #include "SchemeRegistry.h" 52 53 #include "Settings.h" 53 54 #include "TextResourceDecoder.h" … … 98 99 , m_gotFirstByte(false) 99 100 , m_isClientRedirect(false) 101 , m_loadingEmptyDocument(false) 100 102 , m_wasOnloadHandled(false) 101 103 , m_stopRecordingResponses(false) … … 115 117 DocumentLoader::~DocumentLoader() 116 118 { 117 ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this || ! frameLoader()->isLoading());119 ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this || !isLoading()); 118 120 if (m_iconLoadDecisionCallback) 119 121 m_iconLoadDecisionCallback->invalidate(); … … 286 288 { 287 289 commitIfReady(); 288 if (!frameLoader() || frameLoader()->stateMachine()->creatingInitialEmptyDocument())290 if (!frameLoader()) 289 291 return; 290 292 … … 301 303 return; 302 304 clearMainResourceLoader(); 303 frameLoader()->checkLoadComplete(); 305 if (!frameLoader()->stateMachine()->creatingInitialEmptyDocument()) 306 frameLoader()->checkLoadComplete(); 304 307 } 305 308 … … 328 331 m_writer.begin(documentURL(), false); 329 332 m_writer.setDocumentWasLoadedAsPartOfNavigation(); 333 334 if (frameLoader()->stateMachine()->creatingInitialEmptyDocument()) 335 return; 330 336 331 337 #if ENABLE(MHTML) … … 450 456 m_mainResourceLoader = 0; 451 457 } 458 m_loadingEmptyDocument = false; 452 459 453 460 if (this == frameLoader()->activeDocumentLoader()) … … 464 471 465 472 Document* doc = m_frame->document(); 466 if (( m_mainResourceLoader|| !m_frame->document()->loadEventFinished()) && isLoading())473 if ((isLoadingMainResource() || !m_frame->document()->loadEventFinished()) && isLoading()) 467 474 return true; 468 475 if (m_cachedResourceLoader->requestCount()) … … 770 777 if (url.isEmpty()) 771 778 url = responseURL(); 772 if (url.isEmpty())773 url = blankURL();774 779 return url; 775 780 } … … 831 836 bool DocumentLoader::isLoadingMainResource() const 832 837 { 833 return !!m_mainResourceLoader ;838 return !!m_mainResourceLoader || m_loadingEmptyDocument; 834 839 } 835 840 … … 842 847 { 843 848 return isLoadingMultipartContent() && frameLoader()->isReplacing(); 849 } 850 851 bool DocumentLoader::maybeLoadEmpty() 852 { 853 bool shouldLoadEmpty = !m_substituteData.isValid() && (m_request.url().isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(m_request.url().protocol())); 854 if (!shouldLoadEmpty && !frameLoader()->client()->representationExistsForURLScheme(m_request.url().protocol())) 855 return false; 856 857 m_loadingEmptyDocument = true; 858 if (m_request.url().isEmpty() && !frameLoader()->stateMachine()->creatingInitialEmptyDocument()) 859 m_request.setURL(blankURL()); 860 String mimeType = shouldLoadEmpty ? "text/html" : frameLoader()->client()->generatedMIMETypeForURLScheme(m_request.url().protocol()); 861 setResponse(ResourceResponse(m_request.url(), mimeType, 0, String(), String())); 862 finishedLoading(); 863 return true; 844 864 } 845 865 … … 849 869 timing()->markNavigationStart(); 850 870 ASSERT(!m_mainResourceLoader); 871 872 if (maybeLoadEmpty()) 873 return; 874 851 875 m_mainResourceLoader = MainResourceLoader::create(m_frame); 852 876 … … 855 879 frameLoader()->addExtraFieldsToMainResourceRequest(m_request); 856 880 m_mainResourceLoader->load(m_request, m_substituteData); 881 882 if (m_request.isNull()) { 883 m_mainResourceLoader = 0; 884 maybeLoadEmpty(); 885 } 857 886 } 858 887 -
trunk/Source/WebCore/loader/DocumentLoader.h
r135192 r136031 186 186 void setClientRedirectSourceForHistory(const String& clientRedirectSourceForHistory) { m_clientRedirectSourceForHistory = clientRedirectSourceForHistory; } 187 187 188 String serverRedirectSourceForHistory() const { return urlForHistory() == url() ? String() : urlForHistory().string(); } // null if no server redirect occurred.188 String serverRedirectSourceForHistory() const { return (urlForHistory() == url() || url() == blankURL()) ? String() : urlForHistory().string(); } // null if no server redirect occurred. 189 189 String serverRedirectDestinationForHistory() const { return url(); } 190 190 … … 266 266 #endif 267 267 268 bool maybeLoadEmpty(); 269 268 270 bool isMultipartReplacingLoad() const; 269 271 … … 308 310 bool m_gotFirstByte; 309 311 bool m_isClientRedirect; 312 bool m_loadingEmptyDocument; 310 313 311 314 // FIXME: Document::m_processingLoadEvent and DocumentLoader::m_wasOnloadHandled are roughly the same -
trunk/Source/WebCore/loader/FrameLoader.cpp
r135952 r136031 215 215 , m_icon(frame) 216 216 , m_mixedContentChecker(frame) 217 , m_state(FrameState CommittedPage)217 , m_state(FrameStateProvisional) 218 218 , m_loadType(FrameLoadTypeStandard) 219 219 , m_delegateIsHandlingProvisionalLoadError(false) … … 222 222 , m_inStopAllLoaders(false) 223 223 , m_isExecutingJavaScriptFormAction(false) 224 , m_didCallImplicitClose( false)224 , m_didCallImplicitClose(true) 225 225 , m_wasUnloadEventEmitted(false) 226 226 , m_pageDismissalEventBeingDispatched(NoDismissal) … … 255 255 { 256 256 // This somewhat odd set of steps gives the frame an initial empty document. 257 // It would be better if this could be done with even fewer steps.258 m_stateMachine.advanceTo(FrameLoaderStateMachine::CreatingInitialEmptyDocument);259 257 setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(KURL(ParsedURLString, emptyString())), SubstituteData()).get()); 260 258 setProvisionalDocumentLoader(m_policyDocumentLoader.get()); 261 setState(FrameStateProvisional); 262 m_provisionalDocumentLoader->setResponse(ResourceResponse(KURL(), "text/html", 0, String(), String())); 263 m_provisionalDocumentLoader->finishedLoading(); 264 ASSERT(!m_frame->document()); 265 m_documentLoader->writer()->begin(KURL(), false); 266 m_documentLoader->writer()->end(); 259 m_provisionalDocumentLoader->startLoadingMainResource(); 267 260 m_frame->document()->cancelParsing(); 268 261 m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocument); 269 m_didCallImplicitClose = true;270 262 271 263 m_networkingContext = m_client->createNetworkingContext(); -
trunk/Source/WebCore/loader/FrameLoaderStateMachine.cpp
r135192 r136031 36 36 37 37 FrameLoaderStateMachine::FrameLoaderStateMachine() 38 : m_state( Uninitialized)38 : m_state(CreatingInitialEmptyDocument) 39 39 { 40 40 } -
trunk/Source/WebCore/loader/FrameLoaderStateMachine.h
r135192 r136031 45 45 // Otherwise, the states only go down the list. 46 46 enum State { 47 Uninitialized,48 47 CreatingInitialEmptyDocument, 49 48 DisplayingInitialEmptyDocument, -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r135192 r136031 68 68 namespace WebCore { 69 69 70 static bool shouldLoadAsEmptyDocument(const KURL& url)71 {72 return url.isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(url.protocol());73 }74 75 70 MainResourceLoader::MainResourceLoader(Frame* frame) 76 71 : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForCrossOriginCredentials, SkipSecurityCheck)) … … 339 334 ResourceLoader::didReceiveResponse(r); 340 335 341 if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping()) { 342 if (m_substituteData.isValid()) { 343 if (m_substituteData.content()->size()) 344 didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true); 345 if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping()) 346 didFinishLoading(0); 347 } else if (shouldLoadAsEmptyDocument(url) || frameLoader()->client()->representationExistsForURLScheme(url.protocol())) 336 if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping() && m_substituteData.isValid()) { 337 if (m_substituteData.content()->size()) 338 didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true); 339 if (frameLoader() && !frameLoader()->activeDocumentLoader()->isStopping()) 348 340 didFinishLoading(0); 349 341 } … … 386 378 // See <rdar://problem/6304600> for more details. 387 379 #if !USE(CF) 388 ASSERT( shouldLoadAsEmptyDocument(r.url()) ||!defersLoading());380 ASSERT(!defersLoading()); 389 381 #endif 390 382 … … 501 493 // See <rdar://problem/6304600> for more details. 502 494 #if !USE(CF) 503 ASSERT( shouldLoadAsEmptyDocument(frameLoader()->activeDocumentLoader()->url()) ||!defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame.get()));495 ASSERT(!defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame.get())); 504 496 #endif 505 497 … … 562 554 } 563 555 564 void MainResourceLoader::handleEmptyLoad(const KURL& url, bool forURLScheme)565 {566 String mimeType;567 if (forURLScheme)568 mimeType = frameLoader()->client()->generatedMIMETypeForURLScheme(url.protocol());569 else570 mimeType = "text/html";571 572 ResourceResponse response(url, mimeType, 0, String(), String());573 didReceiveResponse(response);574 }575 576 556 void MainResourceLoader::handleSubstituteDataLoadNow(MainResourceLoaderTimer*) 577 557 { … … 610 590 } 611 591 612 bool MainResourceLoader::loadNow(ResourceRequest& r) 613 { 614 bool shouldLoadEmptyBeforeRedirect = shouldLoadAsEmptyDocument(r.url()); 615 592 void MainResourceLoader::loadNow(ResourceRequest& r) 593 { 616 594 ASSERT(!m_handle); 617 ASSERT(shouldLoadEmptyBeforeRedirect || !defersLoading()); 618 619 // Send this synthetic delegate callback since clients expect it, and 620 // we no longer send the callback from within NSURLConnection for 621 // initial requests. 622 willSendRequest(r, ResourceResponse()); 623 ASSERT(!deletionHasBegun()); 624 625 // <rdar://problem/4801066> 626 // willSendRequest() is liable to make the call to frameLoader() return NULL, so we need to check that here 627 if (!frameLoader()) 628 return false; 629 630 const KURL& url = r.url(); 631 bool shouldLoadEmpty = shouldLoadAsEmptyDocument(url) && !m_substituteData.isValid(); 632 633 if (shouldLoadEmptyBeforeRedirect && !shouldLoadEmpty && defersLoading()) 634 return true; 595 ASSERT(!defersLoading()); 635 596 636 597 #if USE(PLATFORM_STRATEGIES) … … 642 603 if (m_substituteData.isValid()) 643 604 handleSubstituteDataLoadSoon(r); 644 else if (shouldLoadEmpty || frameLoader()->client()->representationExistsForURLScheme(url.protocol()))645 handleEmptyLoad(url, !shouldLoadEmpty);646 605 else 647 606 m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), r, this, false, true); 648 607 649 return false;608 return; 650 609 } 651 610 … … 665 624 ResourceRequest request(r); 666 625 626 // Send this synthetic delegate callback since clients expect it, and 627 // we no longer send the callback from within NSURLConnection for 628 // initial requests. 629 willSendRequest(request, ResourceResponse()); 630 ASSERT(!deletionHasBegun()); 631 632 // <rdar://problem/4801066> 633 // willSendRequest() is liable to make the call to frameLoader() return null, so we need to check that here 634 if (!frameLoader() || request.isNull()) { 635 if (!reachedTerminalState()) 636 releaseResources(); 637 return; 638 } 639 667 640 documentLoader()->applicationCacheHost()->maybeLoadMainResource(request, m_substituteData); 668 641 669 bool defer = defersLoading(); 670 if (defer) { 671 bool shouldLoadEmpty = shouldLoadAsEmptyDocument(request.url()); 672 if (shouldLoadEmpty) 673 defer = false; 674 } 675 if (!defer) { 676 if (loadNow(request)) { 677 // Started as an empty document, but was redirected to something non-empty. 678 ASSERT(defersLoading()); 679 defer = true; 680 } 681 } 682 if (defer) 642 if (defersLoading()) 683 643 m_initialRequest = request; 644 else 645 loadNow(request); 684 646 } 685 647 -
trunk/Source/WebCore/loader/MainResourceLoader.h
r135192 r136031 82 82 virtual void didCancel(const ResourceError&) OVERRIDE; 83 83 84 boolloadNow(ResourceRequest&);84 void loadNow(ResourceRequest&); 85 85 86 void handleEmptyLoad(const KURL&, bool forURLScheme);87 86 void handleSubstituteDataLoadSoon(const ResourceRequest&); 88 87 void handleSubstituteDataLoadNow(MainResourceLoaderTimer*); -
trunk/Tools/ChangeLog
r136013 r136031 1 2012-11-28 Nate Chapin <japhet@chromium.org> 2 3 Move empty loading to DocumentLoader, simplify FrameLoader::init() 4 https://bugs.webkit.org/show_bug.cgi?id=101512 5 6 Reviewed by Adam Barth. 7 8 * DumpRenderTree/chromium/WebViewHost.cpp: 9 (WebViewHost::updateForCommittedLoad): This function doesn't play nicely with empty urls and incorrectly 10 interprets them as a non-empty load. This change is required for 11 http/tests/navigation/new-window-redirect-history.html to continue to pass in chromium. 12 * TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp: This test relies on a callback that no longer 13 is sent for about:blank loads. Hook into didFinishLoadForFrame() instead. 14 (TestWebKitAPI::didFinishLoadForFrame): 15 (TestWebKitAPI::TEST): 16 1 17 2012-11-28 Sadrul Habib Chowdhury <sadrul@chromium.org> 2 18 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r135872 r136031 1624 1624 // Code duplicated from RenderView::DidCommitLoadForFrame. 1625 1625 TestShellExtraData* extraData = static_cast<TestShellExtraData*>(frame->dataSource()->extraData()); 1626 bool nonBlankPageAfterReset = m_pageId == -1 && strcmp(frame->dataSource()->request().url().spec().data(), "about:blank"); 1626 const WebURL& url = frame->dataSource()->request().url(); 1627 bool nonBlankPageAfterReset = m_pageId == -1 && !url.isEmpty() && strcmp(url.spec().data(), "about:blank"); 1627 1628 1628 1629 if (isNewNavigation || nonBlankPageAfterReset) { -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp
r95188 r136031 32 32 static bool done; 33 33 34 static void d ecidePolicyForResponse(WKPageRef, WKFrameRef, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef, const void*)34 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) 35 35 { 36 EXPECT_WK_STREQ("text/html", Util::MIMETypeForWKURLResponse(response)); 37 38 WKFramePolicyListenerUse(listener); 36 WKRetainPtr<WKStringRef> mimeType = adoptWK(WKFrameCopyMIMEType(frame)); 37 EXPECT_WK_STREQ("text/html", mimeType); 39 38 done = true; 40 39 } … … 45 44 PlatformWebView webView(context.get()); 46 45 47 WKPagePolicyClient policyClient; 48 memset(&policyClient, 0, sizeof(policyClient)); 49 50 policyClient.decidePolicyForResponse = decidePolicyForResponse; 51 WKPageSetPagePolicyClient(webView.page(), &policyClient); 46 WKPageLoaderClient loaderClient; 47 memset(&loaderClient, 0 , sizeof(loaderClient)); 48 loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; 49 WKPageSetPageLoaderClient(webView.page(), &loaderClient); 52 50 53 51 WKPageLoadURL(webView.page(), adoptWK(WKURLCreateWithUTF8CString("about:blank")).get());
Note: See TracChangeset
for help on using the changeset viewer.