Skip to content
  • timothy@apple.com's avatar
    SecurityOrigin needs a way to remove individual OriginAccessEntries · d09168f4
    timothy@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=37449
    
    Reviewed by Dave Hyatt.
    
    WebCore:
    
    Test: http/tests/xmlhttprequest/origin-whitelisting-removal.html
    
    * WebCore.base.exp: Added SecurityOrigin::removeOriginAccessWhitelistEntry.
    * page/OriginAccessEntry.h:
    (WebCore::OriginAccessEntry::protocol): Added. Returns m_protocol.
    (WebCore::OriginAccessEntry::host): Added. Returns m_host.
    (WebCore::OriginAccessEntry::subdomainSettings): Added. Returns m_subdomainSettings.
    (WebCore::operator==): Added. Compares OriginAccessEntry.
    (WebCore::operator!=): Ditto.
    * page/SecurityOrigin.cpp:
    (WebCore::SecurityOrigin::addOriginAccessWhitelistEntry): Use the add method to prevent a
    second hash lookup.
    (WebCore::SecurityOrigin::removeOriginAccessWhitelistEntry): Added. Find a matching
    OriginAccessEntry and remove it.
    * page/SecurityOrigin.h: Added removeOriginAccessWhitelistEntry.
    
    WebKit/mac:
    
    * WebView/WebView.mm:
    (+[WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]):
    Call SecurityOrigin::removeOriginAccessWhitelistEntry.
    * WebView/WebViewPrivate.h: Added _removeOriginAccessWhitelistEntryWithSourceOrigin.
    
    WebKit/win:
    
    * Interfaces/IWebViewPrivate.idl:
    * WebView.cpp:
    (WebView::removeOriginAccessWhitelistEntry): Call SecurityOrigin::removeOriginAccessWhitelistEntry.
    * WebView.h: Added removeOriginAccessWhitelistEntry.
    
    WebKitTools:
    
    * DumpRenderTree/LayoutTestController.cpp:
    (removeOriginAccessWhitelistEntryCallback): Added. Call LayoutTestController::removeOriginAccessWhitelistEntry.
    (LayoutTestController::staticFunctions): Added removeOriginAccessWhitelistEntry.
    * DumpRenderTree/LayoutTestController.h:
    * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
    (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
    * DumpRenderTree/mac/LayoutTestControllerMac.mm:
    (LayoutTestController::removeOriginAccessWhitelistEntry): Added.
    * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
    (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
    * DumpRenderTree/win/LayoutTestControllerWin.cpp:
    (LayoutTestController::removeOriginAccessWhitelistEntry): Added.
    * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
    (LayoutTestController::whiteListAccessFromOrigin): FIXME to implement.
    (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
    
    LayoutTests:
    
    * http/tests/xmlhttprequest/origin-whitelisting-removal-expected.txt: Added.
    * http/tests/xmlhttprequest/origin-whitelisting-removal.html: Added.
    * platform/gtk/Skipped: Added origin-whitelisting-removal.html.
    * platform/qt/Skipped: Ditto.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d09168f4