LayoutTests/ChangeLog

 12009-08-19 Aaron Boodman <aa@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
 6 specify a more granular policy for cross-origin XHR access.
 7
 8 * http/tests/xmlhttprequest/origin-whitelisting-all-expected.txt: Added.
 9 * http/tests/xmlhttprequest/origin-whitelisting-all.html: Added.
 10 * http/tests/xmlhttprequest/origin-whitelisting-exact-match-expected.txt: Added.
 11 * http/tests/xmlhttprequest/origin-whitelisting-exact-match.html: Added.
 12 * http/tests/xmlhttprequest/origin-whitelisting-https-expected.txt: Added.
 13 * http/tests/xmlhttprequest/origin-whitelisting-https.html: Added.
 14 * http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-expected.txt: Added.
 15 * http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains-expected.txt: Added.
 16 * http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains.html: Added.
 17 * http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html: Added.
 18 * http/tests/xmlhttprequest/origin-whitelisting-subdomains-expected.txt: Added.
 19 * http/tests/xmlhttprequest/origin-whitelisting-subdomains.html: Added.
 20
1212009-08-18 Shinichiro Hamaji <hamaji@chromium.org>
222
323 Reviewed by Eric Seidel.

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-all-expected.txt

 1Tests the special case of whitelisting all origins.
 2
 3Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (sync)
 4PASS: PASS
 5Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (async)
 6PASS: PASS
 7Testing: http://127.0.0.1:8000/xmlhttprequest/resources/get.txt (sync)
 8PASS: PASS
 9Testing: http://127.0.0.1:8000/xmlhttprequest/resources/get.txt (async)
 10PASS: PASS
 11

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-all.html

 1<p>Tests the special case of whitelisting all origins.</p>
 2
 3<pre id="console"></pre>
 4<script>
 5layoutTestController.dumpAsText();
 6layoutTestController.waitUntilDone();
 7layoutTestController.whiteListAccessFromOrigin("http://127.0.0.1:8000", "http", "", true);
 8layoutTestController.whiteListAccessFromOrigin("http://localhost:8000", "http", "", true);
 9
 10function log(message)
 11{
 12 document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
 13}
 14
 15function testDomain()
 16{
 17 var url = "http://localhost:8000/xmlhttprequest/resources/get.txt";
 18 log("Testing: " + url + " (sync)");
 19 var req = new XMLHttpRequest();
 20 req.open("GET", url, false);
 21 try {
 22 req.send(null);
 23 log("PASS: " + req.responseText);
 24 } catch (e) {
 25 log("FAIL: " + e);
 26 }
 27
 28 log("Testing: " + url + " (async)");
 29 req = new XMLHttpRequest();
 30 req.open("GET", url, true);
 31 req.onload = function() {
 32 log("PASS: " + req.responseText);
 33 testIPAddress();
 34 };
 35 req.onerror = function() {
 36 log("FAIL: " + req.status);
 37 testIPAddress();
 38 };
 39 req.send(null);
 40}
 41
 42function testIPAddress()
 43{
 44 var iframe = document.createElement("iframe");
 45 document.body.appendChild(iframe);
 46 iframe.src = "http://localhost:8000/xmlhttprequest/resources/origin-whitelisting-ip-address-test.html";
 47 window.addEventListener("message", function(e) {
 48 if (e.data == "DONE")
 49 layoutTestController.notifyDone();
 50 else
 51 log(e.data);
 52 }, false);
 53}
 54
 55testDomain();
 56</script>

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-exact-match-expected.txt

 1Tests the behavior of whitelisting origins using exact matching.
 2
 3Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (sync)
 4PASS: PASS
 5Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (async)
 6PASS: PASS
 7

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-exact-match.html

 1<p>Tests the behavior of whitelisting origins using exact matching.</p>
 2
 3<pre id="console"></pre>
 4<script>
 5layoutTestController.dumpAsText();
 6layoutTestController.waitUntilDone();
 7layoutTestController.whiteListAccessFromOrigin("http://127.0.0.1:8000", "http", "localhost", false);
 8
 9function log(message)
 10{
 11 document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
 12}
 13
 14function test(url, expectSuccess)
 15{
 16 log("Testing: " + url + " (sync)");
 17 var req = new XMLHttpRequest();
 18 req.open("GET", url, false);
 19 try {
 20 req.send(null);
 21 log((expectSuccess ? "PASS: " : "FAIL: ") + req.responseText);
 22 } catch (e) {
 23 log((expectSuccess ? "FAIL: " : "PASS: ") + e);
 24 }
 25
 26 log("Testing: " + url + " (async)");
 27 req = new XMLHttpRequest();
 28 req.open("GET", url, true);
 29 req.onload = function() {
 30 log((expectSuccess ? "PASS: " : "FAIL: ") + req.responseText);
 31 nextTest();
 32 };
 33 req.onerror = function() {
 34 log((expectSuccess ? "FAIL: " : "PASS: ") + req.status);
 35 nextTest();
 36 };
 37 req.send(null);
 38}
 39
 40var tests = [
 41 ["http://localhost:8000/xmlhttprequest/resources/get.txt", true]
 42 // FIXME: Is it possible to setup the following tests?
 43 // ["http://localhost:8001/xmlhttprequest/resources/get.txt", false],
 44 // ["http://foo.localhost:8000/xmlhttprequest/resources/get.txt", false],
 45 // ["https://localhost:8000/xmlhttprequest/resources/get.txt", false]
 46];
 47
 48var currentTest = 0;
 49
 50function nextTest()
 51{
 52 if (currentTest < tests.length)
 53 test.apply(null, tests[currentTest++]);
 54 else
 55 layoutTestController.notifyDone();
 56}
 57
 58nextTest();
 59</script>

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-https-expected.txt

 1Tests that origin whitelisting for https does not match http URLs.
 2
 3Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (sync)
 4PASS: Error: NETWORK_ERR: XMLHttpRequest Exception 101
 5Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (async)
 6PASS: 0
 7

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-https.html

 1<p>Tests that origin whitelisting for https does not match http URLs.</p>
 2
 3<pre id="console"></pre>
 4<script>
 5layoutTestController.dumpAsText();
 6layoutTestController.waitUntilDone();
 7layoutTestController.whiteListAccessFromOrigin("http://127.0.0.1:8000", "https", "localhost", false);
 8
 9function log(message)
 10{
 11 document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
 12}
 13
 14function test(url, expectSuccess)
 15{
 16 log("Testing: " + url + " (sync)");
 17 var req = new XMLHttpRequest();
 18 req.open("GET", url, false);
 19 try {
 20 req.send(null);
 21 log((expectSuccess ? "PASS: " : "FAIL: ") + req.responseText);
 22 } catch (e) {
 23 log((expectSuccess ? "FAIL: " : "PASS: ") + e);
 24 }
 25
 26 log("Testing: " + url + " (async)");
 27 req = new XMLHttpRequest();
 28 req.open("GET", url, true);
 29 req.onload = function() {
 30 log((expectSuccess ? "PASS: " : "FAIL: ") + req.responseText);
 31 nextTest();
 32 };
 33 req.onerror = function() {
 34 log((expectSuccess ? "FAIL: " : "PASS: ") + req.status);
 35 nextTest();
 36 };
 37 req.send(null);
 38}
 39
 40var tests = [
 41 ["http://localhost:8000/xmlhttprequest/resources/get.txt", false]
 42 // FIXME: Is it possible to setup the following tests?
 43 // ["https://localhost:8000/xmlhttprequest/resources/get.txt", true]
 44];
 45
 46var currentTest = 0;
 47
 48function nextTest()
 49{
 50 if (currentTest < tests.length)
 51 test.apply(null, tests[currentTest++]);
 52 else
 53 layoutTestController.notifyDone();
 54}
 55
 56nextTest();
 57</script>

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-expected.txt

 1Tests origin whitelisting with IP addresses.
 2
 3Testing: http://127.0.0.1:8000/xmlhttprequest/resources/get.txt (sync)
 4PASS: PASS
 5Testing: http://127.0.0.1:8000/xmlhttprequest/resources/get.txt (async)
 6PASS: PASS
 7

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains-expected.txt

 1Specifying that an IP address should match subdomains doesn't make sense. This test verifies that it doesn't do anything.
 2
 3Testing: http://127.0.0.1:8000/xmlhttprequest/resources/get.txt (sync)
 4FAIL: Error: NETWORK_ERR: XMLHttpRequest Exception 101
 5Testing: http://127.0.0.1:8000/xmlhttprequest/resources/get.txt (async)
 6FAIL: 0
 7

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains.html

 1<p>Specifying that an IP address should match subdomains doesn't make sense. This test verifies that it doesn't do anything.</p>
 2<pre id="console"></pre>
 3<script>
 4layoutTestController.dumpAsText();
 5layoutTestController.waitUntilDone();
 6layoutTestController.whiteListAccessFromOrigin("http://localhost:8000", "http", "*.0.0.1", true);
 7
 8function log(message)
 9{
 10 document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
 11}
 12
 13var iframe = document.createElement("iframe");
 14document.body.appendChild(iframe);
 15iframe.src = "http://localhost:8000/xmlhttprequest/resources/origin-whitelisting-ip-address-test.html";
 16window.addEventListener("message", function(e) {
 17 if (e.data == "DONE")
 18 layoutTestController.notifyDone();
 19 else
 20 log(e.data);
 21}, false);
 22</script>

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html

 1<p>Tests origin whitelisting with IP addresses.</p>
 2<pre id="console"></pre>
 3<script>
 4layoutTestController.dumpAsText();
 5layoutTestController.waitUntilDone();
 6layoutTestController.whiteListAccessFromOrigin("http://localhost:8000", "http", "127.0.0.1", false);
 7
 8function log(message)
 9{
 10 document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
 11}
 12
 13var iframe = document.createElement("iframe");
 14document.body.appendChild(iframe);
 15iframe.src = "http://localhost:8000/xmlhttprequest/resources/origin-whitelisting-ip-address-test.html";
 16window.addEventListener("message", function(e) {
 17 if (e.data == "DONE")
 18 layoutTestController.notifyDone();
 19 else
 20 log(e.data);
 21}, false);
 22</script>

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-subdomains-expected.txt

 1Tests origin whitelisting subdomain behavior.
 2
 3Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (sync)
 4PASS: PASS
 5Testing: http://localhost:8000/xmlhttprequest/resources/get.txt (async)
 6PASS: PASS
 7

LayoutTests/http/tests/xmlhttprequest/origin-whitelisting-subdomains.html

 1<p>Tests origin whitelisting subdomain behavior.</p>
 2
 3<pre id="console"></pre>
 4<script>
 5layoutTestController.dumpAsText();
 6layoutTestController.waitUntilDone();
 7layoutTestController.whiteListAccessFromOrigin("http://127.0.0.1:8000", "http", "localhost", true);
 8
 9function log(message)
 10{
 11 document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
 12}
 13
 14function test(url, expectSuccess)
 15{
 16 log("Testing: " + url + " (sync)");
 17 var req = new XMLHttpRequest();
 18 req.open("GET", url, false);
 19 try {
 20 req.send(null);
 21 log((expectSuccess ? "PASS: " : "FAIL: ") + req.responseText);
 22 } catch (e) {
 23 log((expectSuccess ? "FAIL: " : "PASS: ") + e);
 24 }
 25
 26 log("Testing: " + url + " (async)");
 27 req = new XMLHttpRequest();
 28 req.open("GET", url, true);
 29 req.onload = function() {
 30 log((expectSuccess ? "PASS: " : "FAIL: ") + req.responseText);
 31 nextTest();
 32 };
 33 req.onerror = function() {
 34 log((expectSuccess ? "FAIL: " : "PASS: ") + req.status);
 35 nextTest();
 36 };
 37 req.send(null);
 38}
 39
 40var tests = [
 41 ["http://localhost:8000/xmlhttprequest/resources/get.txt", true]
 42 // FIXME: Is it possible to setup the following tests?
 43 // ["http://foo.localhost:8000/xmlhttprequest/resources/get.txt", true]
 44 // ["http://bar.foo.localhost:8000/xmlhttprequest/resources/get.txt", true]
 45 // ["http://foolocalhost:8000/xmlhttprequest/resources/get.txt", false]
 46];
 47
 48var currentTest = 0;
 49
 50function nextTest()
 51{
 52 if (currentTest < tests.length)
 53 test.apply(null, tests[currentTest++]);
 54 else
 55 layoutTestController.notifyDone();
 56}
 57
 58nextTest();
 59</script>

LayoutTests/platform/win/Skipped

@@media/video-played-collapse.html
640640# These two crash from the same regression.
641641media/unsupported-rtsp.html
642642media/video-source-error.html
 643
 644# Missing LayoutTestController implementation
 645http/tests/xmlhttprequest/origin-whitelisting-all.html
 646http/tests/xmlhttprequest/origin-whitelisting-exact-match.html
 647http/tests/xmlhttprequest/origin-whitelisting-https.html
 648http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html
 649http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains.html
 650http/tests/xmlhttprequest/origin-whitelisting-subdomains.html

WebCore/ChangeLog

 12009-08-19 Aaron Boodman <aa@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
 6 specify a more granular policy for cross-origin XHR access.
 7
 8 Tests: http/tests/xmlhttprequest/origin-whitelisting-all.html
 9 http/tests/xmlhttprequest/origin-whitelisting-exact-match.html
 10 http/tests/xmlhttprequest/origin-whitelisting-https.html
 11 http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains.html
 12 http/tests/xmlhttprequest/origin-whitelisting-ip-addresses.html
 13 http/tests/xmlhttprequest/origin-whitelisting-subdomains.html
 14
 15 * WebCore.base.exp: Export methods to manipulate origin access whitelists to enable
 16 testing via layout tests.
 17 * WebCore.xcodeproj/project.pbxproj: Add OriginAccessEntry.*
 18 (WebCore::originAccessMap): Implement origin access whitelists.
 19 (WebCore::SecurityOrigin::canRequest): Ditto.
 20 (WebCore::SecurityOrigin::whiteListAccessFromOrigin): Ditto.
 21 (WebCore::SecurityOrigin::resetOriginAccessWhiteLists): Ditto.
 22 * page/SecurityOrigin.h: Ditto.
 23 * page/OriginAccessEntry.h: Ditto.
 24 * page/OriginAccessEntry.cpp: Ditto.
 25
1262009-08-18 Kent Tamura <tkent@chromium.org>
227
328 Reviewed by Eric Seidel.

WebCore/WebCore.base.exp

@@__ZN7WebCore14ResourceLoader14cancelledErrorEv
313313__ZN7WebCore14ResourceLoader19setShouldBufferDataEb
314314__ZN7WebCore14SecurityOrigin24registerURLSchemeAsLocalERKNS_6StringE
315315__ZN7WebCore14SecurityOrigin6createERKNS_4KURLE
 316__ZN7WebCore14SecurityOrigin16createFromStringERKNS_6StringE
 317__ZN7WebCore14SecurityOrigin27resetOriginAccessWhiteListsEv
 318__ZN7WebCore14SecurityOrigin25whiteListAccessFromOriginERKS0_RKNS_6StringES5_b
316319__ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS_6StringESA_SA_RKNS_16ResourceResponseE
317320__ZN7WebCore15BackForwardList10removeItemEPNS_11HistoryItemE
318321__ZN7WebCore15BackForwardList10setEnabledEb

WebCore/WebCore.xcodeproj/project.pbxproj

2121/* End PBXAggregateTarget section */
2222
2323/* Begin PBXBuildFile section */
 24 001460AD103C8A2E000B20DB /* OriginAccessEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 001460AB103C8A2E000B20DB /* OriginAccessEntry.cpp */; };
 25 001460AE103C8A2E000B20DB /* OriginAccessEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 001460AC103C8A2E000B20DB /* OriginAccessEntry.h */; };
2426 06027CAD0B1CBFC000884B2D /* ContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
2527 06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06027CB20B1CC03D00884B2D /* ContextMenuItemMac.mm */; };
2628 062287840B4DB322000C34DF /* FocusDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 062287830B4DB322000C34DF /* FocusDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };

50055007/* End PBXCopyFilesBuildPhase section */
50065008
50075009/* Begin PBXFileReference section */
 5010 001460AB103C8A2E000B20DB /* OriginAccessEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OriginAccessEntry.cpp; sourceTree = "<group>"; };
 5011 001460AC103C8A2E000B20DB /* OriginAccessEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginAccessEntry.h; sourceTree = "<group>"; };
50085012 06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ContextMenuItem.h; sourceTree = "<group>"; };
50095013 06027CB20B1CC03D00884B2D /* ContextMenuItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenuItemMac.mm; sourceTree = "<group>"; };
50105014 062287830B4DB322000C34DF /* FocusDirection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FocusDirection.h; sourceTree = "<group>"; };

1067910683 A9C6E65D0D746694006442E9 /* Navigator.idl */,
1068010684 E12719C90EEEC21300F61213 /* NavigatorBase.cpp */,
1068110685 E12719C60EEEC16800F61213 /* NavigatorBase.h */,
 10686 001460AB103C8A2E000B20DB /* OriginAccessEntry.cpp */,
 10687 001460AC103C8A2E000B20DB /* OriginAccessEntry.h */,
1068210688 65FEA86809833ADE00BED4AB /* Page.cpp */,
1068310689 65A21467097A329100B9050A /* Page.h */,
1068410690 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */,

1731217318 416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */,
1731317319 B5C1123C102B6C4600096578 /* SQLTransactionCoordinator.h in Headers */,
1731417320 D8B6152F1032495100C8554A /* Cookie.h in Headers */,
 17321 001460AE103C8A2E000B20DB /* OriginAccessEntry.h in Headers */,
1731517322 );
1731617323 runOnlyForDeploymentPostprocessing = 0;
1731717324 };

1937819385 9392262D1032107B006E7D5D /* JSHTMLCanvasElementCustom.cpp in Sources */,
1937919386 9392262F10321084006E7D5D /* JSCSSRuleListCustom.cpp in Sources */,
1938019387 B5C1123B102B6C4600096578 /* SQLTransactionCoordinator.cpp in Sources */,
 19388 001460AD103C8A2E000B20DB /* OriginAccessEntry.cpp in Sources */,
1938119389 );
1938219390 runOnlyForDeploymentPostprocessing = 0;
1938319391 };

WebCore/page/OriginAccessEntry.cpp

 1/*
 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 *
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 14 * its contributors may be used to endorse or promote products derived
 15 * from this software without specific prior written permission.
 16 *
 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 27 */
 28
 29#include "config.h"
 30#include "OriginAccessEntry.h"
 31
 32#include "SecurityOrigin.h"
 33
 34namespace WebCore {
 35
 36OriginAccessEntry::OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting subdomainSetting) : m_protocol(protocol), m_host(host), m_allowSubdomains(subdomainSetting) {
 37 ASSERT(protocol == "http" || protocol == "https");
 38 ASSERT(subdomainSetting == AllowSubdomains || subdomainSetting == DisallowSubdomains);
 39
 40 // Assume that any host that ends with a digit is trying to be an IP address.
 41 UChar last = m_host[m_host.length() - 1];
 42 m_hostIsIPAddress = last >= '0' && last <= '9';
 43}
 44
 45bool OriginAccessEntry::matchesOrigin(const SecurityOrigin& origin)
 46{
 47 if (m_protocol != origin.protocol())
 48 return false;
 49
 50 // Special case: Include subdomains and empty host means "all hosts, including ip addresses".
 51 if (m_allowSubdomains == AllowSubdomains && m_host.isEmpty())
 52 return true;
 53
 54 // Exact match.
 55 if (m_host == origin.host())
 56 return true;
 57
 58 // Otherwise we can only match if we're matching subdomains.
 59 if (m_allowSubdomains == DisallowSubdomains)
 60 return false;
 61
 62 // Don't try to do subdomain matching on IP addresses.
 63 if (m_hostIsIPAddress)
 64 return false;
 65
 66 // Match subdomains.
 67 // FIXME: This hasn't actually been tested as I can't figure out a way to test it with the layout test system.
 68 if (origin.host().length() > m_host.length() && origin.host()[origin.host().length() - m_host.length() - 1] == '.' && origin.host().endsWith(m_host, false))
 69 return true;
 70
 71 return false;
 72}
 73
 74} // namespace WebCore

WebCore/page/OriginAccessEntry.h

 1/*
 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 *
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 14 * its contributors may be used to endorse or promote products derived
 15 * from this software without specific prior written permission.
 16 *
 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 27 */
 28
 29#ifndef CrossOriginAccess_h
 30#define CrossOriginAccess_h
 31
 32#include "CString.h"
 33
 34namespace WebCore {
 35
 36class SecurityOrigin;
 37
 38class OriginAccessEntry {
 39public:
 40 enum SubdomainSetting {
 41 AllowSubdomains,
 42 DisallowSubdomains
 43 };
 44
 45 OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting subdomainSetting);
 46 bool matchesOrigin(const SecurityOrigin& origin);
 47
 48private:
 49 String m_protocol;
 50 String m_host;
 51 SubdomainSetting m_allowSubdomains;
 52 bool m_hostIsIPAddress;
 53
 54};
 55
 56} // namespace WebCore
 57
 58#endif // CrossOriginAccess_h

WebCore/page/SecurityOrigin.cpp

3131
3232#include "CString.h"
3333#include "FrameLoader.h"
 34#include "OriginAccessEntry.h"
3435#include "KURL.h"
3536#include <wtf/StdLibExtras.h>
3637
3738namespace WebCore {
3839
 40typedef Vector<OriginAccessEntry> OriginAccessWhiteList;
 41typedef HashMap<String, OriginAccessWhiteList*> OriginAccessMap;
 42
 43static OriginAccessMap& originAccessMap()
 44{
 45 DEFINE_STATIC_LOCAL(OriginAccessMap, originAccessMap, ());
 46 return originAccessMap;
 47}
 48
3949static URLSchemesMap& localSchemes()
4050{
4151 DEFINE_STATIC_LOCAL(URLSchemesMap, localSchemes, ());

@@bool SecurityOrigin::canRequest(const KURL& url) const
198208
199209 // We call isSameSchemeHostPort here instead of canAccess because we want
200210 // to ignore document.domain effects.
201  return isSameSchemeHostPort(targetOrigin.get());
 211 if (isSameSchemeHostPort(targetOrigin.get()))
 212 return true;
 213
 214 if (OriginAccessWhiteList* list = originAccessMap().get(toString())) {
 215 for (size_t i = 0; i < list->size(); ++i) {
 216 if (list->at(i).matchesOrigin(*targetOrigin))
 217 return true;
 218 }
 219 }
 220
 221 return false;
202222}
203223
204224void SecurityOrigin::grantLoadLocalResources()

@@bool SecurityOrigin::shouldTreatURLSchemeAsNoAccess(const String& scheme)
414434 return noAccessSchemes().contains(scheme);
415435}
416436
 437// static
 438void SecurityOrigin::whiteListAccessFromOrigin(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains)
 439{
 440 ASSERT(isMainThread());
 441 ASSERT(!sourceOrigin.isEmpty());
 442
 443 String sourceString = sourceOrigin.toString();
 444 OriginAccessWhiteList* list = originAccessMap().get(sourceString);
 445 if (!list) {
 446 list = new OriginAccessWhiteList();
 447 originAccessMap().set(sourceString, list);
 448 }
 449 list->append(OriginAccessEntry(destinationProtocol, destinationDomains, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains));
 450}
 451
 452// static
 453void SecurityOrigin::resetOriginAccessWhiteLists()
 454{
 455 ASSERT(isMainThread());
 456 OriginAccessMap& map = originAccessMap();
 457 for (OriginAccessMap::iterator iter = map.begin(); iter != map.end(); ++iter) {
 458 OriginAccessWhiteList* list = iter->second;
 459 delete list;
 460 }
 461
 462 map.clear();
 463}
 464
417465} // namespace WebCore

WebCore/page/SecurityOrigin.h

@@namespace WebCore {
141141 static void registerURLSchemeAsNoAccess(const String&);
142142 static bool shouldTreatURLSchemeAsNoAccess(const String&);
143143
 144 static void whiteListAccessFromOrigin(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains);
 145 static void resetOriginAccessWhiteLists();
 146
144147 private:
145148 explicit SecurityOrigin(const KURL&);
146149 explicit SecurityOrigin(const SecurityOrigin*);

WebKit/gtk/ChangeLog

 12009-08-19 Aaron Boodman <aa@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
 6 specify a more granular policy for cross-origin XHR access.
 7
 8 * webkit/webkitprivate.cpp:
 9 (webkit_white_list_access_to_origin): Add API to manipulate origin access whitelists.
 10 (webkit_reset_origin_access_white_lists): Ditto.
 11 * webkit/webkitprivate.h: Ditto.
 12
1132009-08-15 Zan Dobersek <zandobersek@gmail.com>
214
315 Reviewed by Xan Lopez.

WebKit/gtk/webkit/webkitprivate.cpp

3737#include "ResourceHandleClient.h"
3838#include "ResourceHandleInternal.h"
3939#include <runtime/InitializeThreading.h>
 40#include "SecurityOrigin.h"
4041
4142#if ENABLE(DATABASE)
4243#include "DatabaseTracker.h"

@@void webkit_init()
178179 soup_session_add_feature(session, sniffer);
179180 g_object_unref(sniffer);
180181}
 182
 183void webkit_white_list_access_to_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains)
 184{
 185 SecurityOrigin::whiteListAccessToOrigin(SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
 186}
 187
 188void webkit_reset_origin_access_white_lists()
 189{
 190 SecurityOrigin::resetOriginAccessWhiteLists();
 191}

WebKit/gtk/webkit/webkitprivate.h

@@extern "C" {
250250
251251 WEBKIT_API void
252252 webkit_application_cache_set_maximum_size(unsigned long long size);
 253
 254 WEBKIT API void
 255 webkit_white_list_access_to_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains);
 256
 257 WEBKIT API void
 258 webkit_reset_origin_access_white_lists();
253259}
254260
255261#endif

WebKit/mac/ChangeLog

 12009-08-19 Aaron Boodman <aa@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
 6 specify a more granular policy for cross-origin XHR access.
 7
 8 * WebView/WebView.mm: Add SPI to manipulate origin access whitelists.
 9 (+[WebView _whiteListAccessFromOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]): Ditto.
 10 (+[WebView _resetOriginAccessWhiteLists]): Ditto.
 11 * WebView/WebViewPrivate.h: Ditto.
 12
1132009-08-17 Darin Adler <darin@apple.com>
214
315 Reviewed by Sam Weinig.

WebKit/mac/WebView/WebView.mm

@@static inline IMP getMethod(id o, SEL s)
20922092 return _private ? _private->insertionPasteboard : nil;
20932093}
20942094
 2095+ (void)_whiteListAccessFromOrigin:(NSString*)sourceOrigin destinationProtocol:(NSString*)destinationProtocol destinationHost:(NSString*)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains;
 2096{
 2097 SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
 2098}
 2099
 2100+(void)_resetOriginAccessWhiteLists
 2101{
 2102 SecurityOrigin::resetOriginAccessWhiteLists();
 2103}
20952104
20962105- (void)_updateActiveState
20972106{

WebKit/mac/WebView/WebViewPrivate.h

@@Could be worth adding to the API.
443443// Which pasteboard text is coming from in editing delegate methods such as shouldInsertNode.
444444- (NSPasteboard *)_insertionPasteboard;
445445
 446// Whitelists access from an origin (sourceOrigin) to a set of one or more origins described by the parameters:
 447// - destinationProtocol: The protocol to grant access to.
 448// - destinationHost: The host to grant access to.
 449// - allowDestinationSubdomains: If host is a domain, setting this to YES will whitelist host and all its subdomains, recursively.
 450+ (void)_whiteListAccessFromOrigin:(NSString*)sourceOrigin destinationProtocol:(NSString*)destinationProtocol destinationHost:(NSString*)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains;
 451
 452// Removes all white list entries created with _whiteListAccessFromOrigin.
 453+ (void)_resetOriginAccessWhiteLists;
 454
446455@end
447456
448457@interface WebView (WebViewPrintingPrivate)

WebKit/qt/Api/qwebsecurityorigin.cpp

@@QStringList QWebSecurityOrigin::localSchemes()
235235 return list;
236236}
237237
 238void QWebSecurityOrigin::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
 239{
 240 SecurityOrigin::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
 241}
 242
 243void QWebSecurityOrigin::resetOriginAccessWhiteLists()
 244{
 245 SecurityOrigin::resetOriginAccessWhiteLists();
 246}

WebKit/qt/Api/qwebsecurityorigin.h

@@public:
4040 static void addLocalScheme(const QString& scheme);
4141 static void removeLocalScheme(const QString& scheme);
4242 static QStringList localSchemes();
 43 static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
 44 static void clearOriginAccessWhiteLists();
4345
4446 ~QWebSecurityOrigin();
4547

WebKit/qt/ChangeLog

 12009-08-19 Aaron Boodman <aa@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
 6 specify a more granular policy for cross-origin XHR access.
 7
 8 * Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists.
 9 (QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto.
 10 (QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto.
 11 * Api/qwebsecurityorigin.h: Ditto.
 12
1132009-08-17 Darin Adler <darin@apple.com>
214
315 Try to fix Qt build again.

WebKitTools/ChangeLog

 12009-08-19 Aaron Boodman <aa@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
 6 specify a more granular policy for cross-origin XHR access.
 7
 8 * DumpRenderTree/LayoutTestController.cpp: Expose whiteListAccessFromOrigin() to layout tests.
 9 (whiteListAccessFromOriginCallback): Ditto.
 10 (LayoutTestController::staticFunctions): Ditto.
 11 * DumpRenderTree/LayoutTestController.h: Ditto.
 12 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Ditto.
 13 (LayoutTestController::whiteListAccessToOrigin): Ditto.
 14 * DumpRenderTree/mac/LayoutTestControllerMac.mm: Ditto.
 15 (LayoutTestController::whiteListAccessFromOrigin): Ditto.
 16 * DumpRenderTree/qt/jsobjects.cpp: Ditto.
 17 (LayoutTestController::whiteListAccessFromOrigin): Ditto.
 18 * DumpRenderTree/win/LayoutTestControllerWin.cpp: Stub out whiteListAccessFromOrigin().
 19 (LayoutTestController::whiteListAccessFromOrigin): Ditto.
 20 * DumpRenderTree/gtk/DumpRenderTree.cpp: Reset origin access lists before each test.
 21 (resetWebViewToConsistentStateBeforeTesting): Ditto.
 22 * DumpRenderTree/mac/DumpRenderTree.mm: Ditto.
 23 (resetWebViewToConsistentStateBeforeTesting): Ditto.
 24 * DumpRenderTree/qt/DumpRenderTree.cpp: Ditto.
 25 (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting): Ditto.
 26
 272009-08-18 Aaron Boodman <aa@chromium.org>
 28
 29 Reviewed by NOBODY (OOPS!).
 30
 31 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
 32 specify a more granular policy for cross-origin XHR access.
 33
 34 * DumpRenderTree/LayoutTestController.cpp: Add plumbing to be able to manipulate
 35 origin access whitelists from layout tests.
 36 (whiteListAccessToOriginCallback): Ditto.
 37 (resetOriginAccessWhiteListsCallback): Ditto.
 38 (LayoutTestController::staticFunctions): Ditto.
 39 * DumpRenderTree/LayoutTestController.h: Ditto.
 40 * DumpRenderTree/mac/LayoutTestControllerMac.mm: Ditto.
 41 (LayoutTestController::whiteListAccessToOrigin): Ditto.
 42 (LayoutTestController::resetOriginAccessWhiteLists): Ditto.
 43
1442009-08-17 Shinichiro Hamaji <hamaji@chromium.org>
245
346 Reviewed by Darin Adler.

WebKitTools/DumpRenderTree/LayoutTestController.cpp

@@static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRe
874874 return JSValueMakeUndefined(context);
875875}
876876
 877static JSValueRef whiteListAccessFromOriginCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 878{
 879 if (argumentCount != 4)
 880 return JSValueMakeUndefined(context);
 881
 882 JSRetainPtr<JSStringRef> sourceOrigin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
 883 ASSERT(!*exception);
 884 JSRetainPtr<JSStringRef> destinationProtocol(Adopt, JSValueToStringCopy(context, arguments[1], exception));
 885 ASSERT(!*exception);
 886 JSRetainPtr<JSStringRef> destinationHost(Adopt, JSValueToStringCopy(context, arguments[2], exception));
 887 ASSERT(!*exception);
 888 bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
 889
 890 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
 891 controller->whiteListAccessFromOrigin(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
 892 return JSValueMakeUndefined(context);
 893}
 894
877895// Static Values
878896
879897static JSValueRef getGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)

@@JSStaticFunction* LayoutTestController::staticFunctions()
10141032 { "waitForPolicyDelegate", waitForPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
10151033 { "waitUntilDone", waitUntilDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
10161034 { "windowCount", windowCountCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
 1035 { "whiteListAccessFromOrigin", whiteListAccessFromOriginCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
10171036 { 0, 0, 0 }
10181037 };
10191038

WebKitTools/DumpRenderTree/LayoutTestController.h

@@public:
178178 bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId);
179179 bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId);
180180 unsigned numberOfActiveAnimations() const;
181 
 181
 182 void whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
 183
182184private:
183185 bool m_dumpAsText;
184186 bool m_dumpAsPDF;

WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp

@@extern void webkit_web_settings_add_extra_plugin_directory(WebKitWebView* view,
6262extern gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame);
6363extern void webkit_web_frame_clear_main_frame_name(WebKitWebFrame* frame);
6464extern void webkit_web_view_set_group_name(WebKitWebView* view, const gchar* groupName);
 65extern void webkit_reset_origin_access_white_lists();
6566}
6667
6768volatile bool done;

@@static void resetWebViewToConsistentStateBeforeTesting()
280281
281282 WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
282283 g_object_set(G_OBJECT(inspector), "javascript-profiling-enabled", FALSE, NULL);
 284
 285 webkit_reset_origin_access_white_lists();
283286}
284287
285288void dump()

WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

@@bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name,
4848bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
4949unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
5050void webkit_application_cache_set_maximum_size(unsigned long long size);
 51void webkit_white_list_access_to_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains);
5152}
5253
5354LayoutTestController::~LayoutTestController()

@@void LayoutTestController::waitForPolicyDelegate()
163164 setWaitToDump(true);
164165}
165166
 167void LayoutTestController::whiteListAccessToOrigin(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
 168{
 169 gchar* sourceOriginGChar = JSStringCopyUTF8CString(sourceOrigin);
 170 gchar* protocolGChar = JSStringCopyUTF8CString(protocol);
 171 gchar* hostGChar = JSStringCopyUTF8CString(host);
 172 webkit_white_list_access_to_origin(sourceOriginGChar, protocolGChar, hostGChar, includeSubdomains);
 173}
 174
166175void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
167176{
168177 // FIXME: implement

WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm

@@static void resetWebViewToConsistentStateBeforeTesting()
10821082 [[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:NO];
10831083
10841084 [WebView _setUsesTestModeFocusRingColor:YES];
 1085 [WebView _resetOriginAccessWhiteLists];
10851086}
10861087
10871088static void runTest(const string& testPathOrURL)

WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm

@@void LayoutTestController::waitForPolicyDelegate()
437437 [policyDelegate setControllerToNotifyDone:this];
438438 [[mainFrame webView] setPolicyDelegate:policyDelegate];
439439}
 440
 441void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
 442{
 443 RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin));
 444 NSString *sourceOriginNS = (NSString *)sourceOriginCF.get();
 445 RetainPtr<CFStringRef> protocolCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationProtocol));
 446 NSString *destinationProtocolNS = (NSString *)protocolCF.get();
 447 RetainPtr<CFStringRef> hostCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationHost));
 448 NSString *destinationHostNS = (NSString *)hostCF.get();
 449 [WebView _whiteListAccessFromOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
 450}

WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp

@@void DumpRenderTree::resetToConsistentStateBeforeTesting()
218218 //WorkQueue::shared()->setFrozen(false);
219219
220220 m_controller->reset();
 221 QWebSecurityOrigin::resetOriginAccessWhiteLists();
221222}
222223
223224void DumpRenderTree::open(const QUrl& aurl)

WebKitTools/DumpRenderTree/qt/jsobjects.cpp

@@void LayoutTestController::clearAllDatabases()
337337 QWebDatabase::removeAllDatabases();
338338}
339339
 340void LayoutTestController::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
 341{
 342 SecurityOrigin::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
 343}
 344
340345EventSender::EventSender(QWebPage *parent)
341346 : QObject(parent)
342347{

WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp

@@unsigned LayoutTestController::numberOfActiveAnimations() const
797797
798798 return number;
799799}
 800
 801void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
 802{
 803 printf("LayoutTestController::whiteListAccessFromOrigin not implemented\n");
 804}