Remove call to SecurityOrigin::canAccessDatabase from IDB constructor.
authormkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 19:58:47 +0000 (19:58 +0000)
committermkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 19:58:47 +0000 (19:58 +0000)
commitb681d9b8f54b87de3425d07c8e99ca7419059a49
treef7e4b67ff38bec1788dc8926eb817ad27b9ad3cf
parent2b22d04e611f60db8f8d3ae9489d37c4a2f3ca34
Remove call to SecurityOrigin::canAccessDatabase from IDB constructor.
https://bugs.webkit.org/show_bug.cgi?id=108477

Reviewed by Adam Barth.

Source/WebCore:

This change removes the 'SecurityOrigin::canAccessDatabase' check from
the constructor for the 'indexedDB' property on both DOMWindow and
WorkerContext. After the patch for http://wkbug.com/94171 this check
is redundant, as all the entry points to IDB are now gated on access
being granted.

As a side-effect, dropping the check in WorkerContextIndexedDatabase
allows us to stop holding a pointer to the ScriptExecutionContext we're
extending, which can only be a good thing.

The tests in storage/indexeddb should continue to pass.

* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):
    Drop the SecurityOrigin::canAccessDatabase check.
* Modules/indexeddb/WorkerContextIndexedDatabase.cpp:
(WebCore::WorkerContextIndexedDatabase::WorkerContextIndexedDatabase):
(WebCore::WorkerContextIndexedDatabase::from):
    Drop the ScriptExecutionContext parameter from the class's
    constructor and callsites.
(WebCore::WorkerContextIndexedDatabase::indexedDB):
    Drop the SecurityOrigin::canAccessDatabase check.
* Modules/indexeddb/WorkerContextIndexedDatabase.h:
(WorkerContextIndexedDatabase):
    Drop the stored pointer to ScriptExecutionContext, as we no longer
    need it in ::indexedDB.

LayoutTests:

* http/tests/security/no-indexeddb-from-sandbox-expected.txt:
* http/tests/security/no-indexeddb-from-sandbox.html:
    This test expected the 'webkitIndexedDB' property to be missing
    entirely inside a sandbox. The expectation has been updated to
    expect 'webkitIndexedDB.open()' to throw a SECURITY_ERR.
* platform/efl/TestExpectations:
* platform/mac-snowleopard/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
    This test was accidentally passing on a variety of platforms that
    don't yet implement IndexedDB. Now that failure is distinguishable
    we should skip it on a variety of platforms.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/security/no-indexeddb-from-sandbox-expected.txt
LayoutTests/http/tests/security/no-indexeddb-from-sandbox.html
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/mac-snowleopard/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h