Remove unnecessary exceptions from storage code
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jul 2017 18:05:09 +0000 (18:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jul 2017 18:05:09 +0000 (18:05 +0000)
commit112c62edc55b102dd9796caf2122f421b814c253
treecfab7db59087dcac36f00903b09a6ac3002dd646
parent288c22e3a5710cccdbc57ef981e69b068ec92567
Remove unnecessary exceptions from storage code
https://bugs.webkit.org/show_bug.cgi?id=174572

Patch by Sam Weinig <sam@webkit.org> on 2017-07-31
Reviewed by Chris Dumez.

Source/WebCore:

Remove checks for canAccessStorage() and the exceptions they would cause.
These were used for Storage in ephemeral sessions, but they are now supported.
Add checks for a null frame to functions that can mutate the storage, as the
frame is needed for that, and it retains our existing behavior for disconnected
frames. By removing these checks / exceptions, we can fully generate Storage.idl.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSStorageCustom.cpp: Removed.
Remove JSStorageCustom.cpp

* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
* storage/StorageArea.h:
Remove canAccessStorage.

* storage/Storage.cpp:
(WebCore::Storage::length):
(WebCore::Storage::key):
(WebCore::Storage::getItem):
(WebCore::Storage::setItem):
(WebCore::Storage::removeItem):
(WebCore::Storage::clear):
(WebCore::Storage::contains):
(WebCore::Storage::isSupportedPropertyName):
(WebCore::Storage::supportedPropertyNames):
* storage/Storage.h:
* storage/Storage.idl:
Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames
to allow the removal of the [CustomGetOwnPropertyNames].

Source/WebKit:

* WebProcess/Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::canAccessStorage): Deleted.
* WebProcess/Storage/StorageAreaImpl.h:
* WebProcess/Storage/StorageNamespaceImpl.cpp:
Remove canAccessStorage. It is no longer called.

Source/WebKitLegacy:

* Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::canAccessStorage): Deleted.
* Storage/StorageAreaImpl.h:
Remove canAccessStorage. It is no longer called.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSStorageCustom.cpp [deleted file]
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/storage/Storage.cpp
Source/WebCore/storage/Storage.h
Source/WebCore/storage/Storage.idl
Source/WebCore/storage/StorageArea.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.cpp
Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h
Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/Storage/StorageAreaImpl.cpp
Source/WebKitLegacy/Storage/StorageAreaImpl.h