[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

aroben at apple.com aroben at apple.com
Thu Oct 29 20:41:45 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 262d7c6efbad69371226b7e07fdf9dbb13c2a192
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 8 14:09:56 2009 +0000

    Expose origin whitelisting in the WebKit API on Windows
    
    Fixes <http://webkit.org/b/30185>.
    
    Reviewed by Eric Seidel.
    
    WebKit/win:
    
    * Interfaces/IWebViewPrivate.idl: Added whiteListAccessFromOrigin and
    resetOriginAccessWhiteLists, to match the Mac SPI.
    
    * WebView.cpp:
    (WebView::whiteListAccessFromOrigin):
    (WebView::resetOriginAccessWhiteLists):
    * WebView.h:
    Added. These just call through to SecurityOrigin.
    
    WebKitTools:
    
    Implement DRT support for origin whitelisting
    
    * DumpRenderTree/win/DumpRenderTree.cpp:
    (resetWebViewToConsistentStateBeforeTesting): Reset any origin
    whitelist, to match Mac DRT.
    * DumpRenderTree/win/LayoutTestControllerWin.cpp:
    (LayoutTestController::whiteListAccessFromOrigin): Call through to
    IWebViewPrivate::whiteListAccessFromOrigin.
    
    LayoutTests:
    
    Start running origin whitelist tests on Windows
    
    * platform/win/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49299 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4586692..1a42c74 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-07  Adam Roben  <aroben at apple.com>
+
+        Start running origin whitelist tests on Windows
+
+        Fixes <http://webkit.org/b/30185>.
+
+        Reviewed by Eric Seidel.
+
+        * platform/win/Skipped:
+
 2009-10-08  Xan Lopez  <xlopez at igalia.com>
 
         Fix typo in skipped test.
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 031cb22..fd51a85 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -646,14 +646,6 @@ media/video-source-error.html
 # <http://webkit.org/b/28467>
 http/tests/loading/preload-img-test.html
 
-# Missing LayoutTestController implementation
-http/tests/xmlhttprequest/origin-whitelisting-all.html
-http/tests/xmlhttprequest/origin-whitelisting-exact-match.html
-http/tests/xmlhttprequest/origin-whitelisting-https.html
-http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html
-http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains.html
-http/tests/xmlhttprequest/origin-whitelisting-subdomains.html
-
 # No TextInputController
 fast/forms/input-maxlength-ime-completed.html
 fast/forms/input-maxlength-ime-preedit.html
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 146842c..98eab01 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-07  Adam Roben  <aroben at apple.com>
+
+        Expose origin whitelisting in the WebKit API on Windows
+
+        Fixes <http://webkit.org/b/30185>.
+
+        Reviewed by Eric Seidel.
+
+        * Interfaces/IWebViewPrivate.idl: Added whiteListAccessFromOrigin and
+        resetOriginAccessWhiteLists, to match the Mac SPI.
+
+        * WebView.cpp:
+        (WebView::whiteListAccessFromOrigin):
+        (WebView::resetOriginAccessWhiteLists):
+        * WebView.h:
+        Added. These just call through to SecurityOrigin.
+
 2009-10-07  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebKit/win/Interfaces/IWebViewPrivate.idl b/WebKit/win/Interfaces/IWebViewPrivate.idl
index 7d22adf..92a50f0 100644
--- a/WebKit/win/Interfaces/IWebViewPrivate.idl
+++ b/WebKit/win/Interfaces/IWebViewPrivate.idl
@@ -201,4 +201,13 @@ interface IWebViewPrivate : IUnknown
 
     // If rect is 0, the entire backing store will be invalidated.
     HRESULT invalidateBackingStore([in] const RECT* rect);
+
+    // Whitelists access from an origin (sourceOrigin) to a set of one or more origins described by the parameters:
+    // - destinationProtocol: The protocol to grant access to.
+    // - destinationHost: The host to grant access to.
+    // - allowDestinationSubdomains: If host is a domain, setting this to YES will whitelist host and all its subdomains, recursively.
+    HRESULT whiteListAccessFromOrigin([in] BSTR sourceOrigin, [in] BSTR destinationProtocol, [in] BSTR destinationHost, [in] BOOL allowDestinationSubdomains);
+
+    // Removes all white list entries created with whiteListAccessFromOrigin.
+    HRESULT resetOriginAccessWhiteLists();
 }
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index a3a8757..82e63f0 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -5557,6 +5557,18 @@ HRESULT WebView::invalidateBackingStore(const RECT* rect)
     return S_OK;
 }
 
+HRESULT WebView::whiteListAccessFromOrigin(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains)
+{
+    SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains);
+    return S_OK;
+}
+
+HRESULT WebView::resetOriginAccessWhiteLists()
+{
+    SecurityOrigin::resetOriginAccessWhiteLists();
+    return S_OK;
+}
+
 void WebView::downloadURL(const KURL& url)
 {
     // It's the delegate's job to ref the WebDownload to keep it alive - otherwise it will be
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index b81897c..8d66c16 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -759,6 +759,9 @@ public:
 
     virtual HRESULT STDMETHODCALLTYPE invalidateBackingStore(const RECT*);
 
+    virtual HRESULT STDMETHODCALLTYPE whiteListAccessFromOrigin(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains);
+    virtual HRESULT STDMETHODCALLTYPE resetOriginAccessWhiteLists();
+
     // WebView
     bool shouldUseEmbeddedView(const WebCore::String& mimeType) const;
 
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 869af8a..d8baaa7 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-07  Adam Roben  <aroben at apple.com>
+
+        Implement DRT support for origin whitelisting
+
+        Fixes <http://webkit.org/b/30185>.
+
+        Reviewed by Eric Seidel.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebViewToConsistentStateBeforeTesting): Reset any origin
+        whitelist, to match Mac DRT.
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::whiteListAccessFromOrigin): Call through to
+        IWebViewPrivate::whiteListAccessFromOrigin.
+
 2009-10-07  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index 4ff45a2..7e013a7 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -785,6 +785,7 @@ static void resetWebViewToConsistentStateBeforeTesting()
         SetFocus(viewWindow);
 
     webViewPrivate->clearMainFrameName();
+    webViewPrivate->resetOriginAccessWhiteLists();
 
     sharedUIDelegate->resetUndoManager();
 
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 83706d4..ede71dc 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -840,17 +840,21 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
     return number;
 }
 
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
-{
-    printf("LayoutTestController::whiteListAccessFromOrigin not implemented\n");
-}
-
 static _bstr_t bstrT(JSStringRef jsString)
 {
     // The false parameter tells the _bstr_t constructor to adopt the BSTR we pass it.
     return _bstr_t(JSStringCopyBSTR(jsString), false);
 }
 
+void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+    COMPtr<IWebViewPrivate> webView;
+    if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
+        return;
+
+    webView->whiteListAccessFromOrigin(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
+}
+
 void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
 {
     COMPtr<IWebViewPrivate> webView;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list