Skip to content
  • beidson@apple.com's avatar
    WebKit Mac API should provide a delegate interface for global history. · b0b8ef70
    beidson@apple.com authored
    <rdar://problem/7042773> and https://webkit.org/b/29904
    
    Reviewed by John Sullivan.
    
    WebKit: 
    
    * WebKit.xcodeproj/project.pbxproj:
    
    WebKit/mac: 
    
    * WebView/WebHistoryDelegate.h: Added. New interface for WebKit clients to implement to manage 
      their own global history store.
    
    Object to store all of the bits of data relevant to a page visit:
    * WebView/WebNavigationData.h: Added.
    * WebView/WebNavigationData.mm: Added.
    (-[WebNavigationDataPrivate dealloc]):
    (-[WebNavigationData initWithURLString:title:originalRequest:response:hasSubstituteData:clientRedirectSource:]):
    (-[WebNavigationData url]):
    (-[WebNavigationData title]):
    (-[WebNavigationData originalRequest]):
    (-[WebNavigationData response]):
    (-[WebNavigationData hasSubstituteData]):
    (-[WebNavigationData clientRedirectSource]):
    (-[WebNavigationData dealloc]):
    
    * WebCoreSupport/WebFrameLoaderClient.mm:
    (WebFrameLoaderClient::updateGlobalHistory): If the delegate exists, don't use the built-in WebHistory.
      If the implementation for this method exists, call it.
    (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks): Ditto
    
    * WebView/WebDelegateImplementationCaching.h:
    * WebView/WebDelegateImplementationCaching.mm:
    (WebViewGetHistoryDelegateImplementations):
    (CallHistoryDelegate):
    
    * WebView/WebView.mm:
    (-[WebView _cacheHistoryDelegateImplementations]):
    (-[WebView setHistoryDelegate:]):
    (-[WebView historyDelegate]):
    * WebView/WebViewData.h:
    * WebView/WebViewPrivate.h:
    
    WebKitTools: 
    
    Adding the dumping of global history delegate callbacks.
    
    * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
    
    Automatically dump history delegate callbacks for tests with "globalhistory/" in their URL:
    * DumpRenderTree/mac/DumpRenderTree.mm:
    (createWebViewAndOffscreenWindow):
    (allocateGlobalControllers):
    (shouldLogFrameLoadDelegates):
    (shouldLogHistoryDelegates):
    (runTest):
    
    Dump history delegate callbacks:
    * DumpRenderTree/mac/HistoryDelegate.h: Added.
    * DumpRenderTree/mac/HistoryDelegate.mm: Added.
    (-[HistoryDelegate webView:didNavigateWithNavigationData:inFrame:]):
    (-[HistoryDelegate webView:didPerformClientRedirectFromURL:toURL:inFrame:]):
    (-[HistoryDelegate webView:didPerformServerRedirectFromURL:toURL:inFrame:]):
    
    LayoutTests: 
    
    * http/tests/globalhistory: Added.
    * http/tests/globalhistory/history-delegate-basic-302-redirect-expected.txt: Added.
    * http/tests/globalhistory/history-delegate-basic-302-redirect.html: Added.
    * http/tests/globalhistory/history-delegate-basic-refresh-redirect-expected.txt: Added.
    * http/tests/globalhistory/history-delegate-basic-refresh-redirect.html: Added.
    * http/tests/resources/notify-done.html: Added.
    * http/tests/resources/redirect.php: Augment to optionally do "Refresh:"-style redirects.
    
    Skip these new tests on all platforms that don't have history delegates (yet):
    * platform/gtk/Skipped:
    * platform/qt/Skipped:
    * platform/win/Skipped:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b0b8ef70