Source/WebCore: chromium WebFrameImpl - don't load javascript URLs against chrome...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2011 21:06:43 +0000 (21:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2011 21:06:43 +0000 (21:06 +0000)
commitc623bf0e49d73d4caa3d17b7061b513c7a8a817b
treebc015ad88e7bf467b15f7a2287ab08c8cae99964
parent273dc9d33152332d77d32c01231b2415f0ee3193
Source/WebCore: chromium WebFrameImpl - don't load javascript URLs against chrome internal
pages.  Adds a mechanism for registering sensitive schemes which should
not be subject to manipulation by javascript urls typed into a location bar
or, more importantly, their bookmarklet equivalents.
https://bugs.webkit.org/show_bug.cgi?id=66720

Patch by Tom Sepez <tsepez@chromium.org> on 2011-08-24
Reviewed by Adam Barth.

Test: Chromium WebKit API unit test in chromium specific directory.

* platform/SchemeRegistry.cpp:
(WebCore::notAllowingJavascriptURLsSchemes):
(WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs):
* platform/SchemeRegistry.h:

Source/WebKit/chromium: chromium WebFrameImpl - don't load javascript URLs against chrome internal pages.
https://bugs.webkit.org/show_bug.cgi?id=66720

Patch by Tom Sepez <tsepez@chromium.org> on 2011-08-24
Reviewed by Adam Barth.

* public/WebSecurityPolicy.h:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::loadJavaScriptURL):
* src/WebSecurityPolicy.cpp:
(WebKit::WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs):
* tests/WebFrameTest.cpp:
(WebKit::WebFrameTest::WebFrameTest):
(WebKit::WebFrameTest::registerMockedHttpURLLoad):
(WebKit::WebFrameTest::registerMockedChromeURLLoad):
(WebKit::WebFrameTest::serveRequests):
(WebKit::WebFrameTest::loadHttpFrame):
(WebKit::WebFrameTest::loadChromeFrame):
(WebKit::WebFrameTest::registerMockedURLLoad):
(WebKit::WebFrameTest::loadFrame):
(WebKit::TEST_F):
* tests/data/history.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/SchemeRegistry.cpp
Source/WebCore/platform/SchemeRegistry.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSecurityPolicy.h
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/chromium/src/WebSecurityPolicy.cpp
Source/WebKit/chromium/tests/WebFrameTest.cpp
Source/WebKit/chromium/tests/data/history.html [new file with mode: 0644]