Share code between WebKit1 and WebKit2 StorageArea subclasses
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 May 2013 01:04:53 +0000 (01:04 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 May 2013 01:04:53 +0000 (01:04 +0000)
commite8e9f8ef0d09833520b262dbf285d7c17cb3cab5
treec6f63ee8686cfb5521e4bb0b90fe9603b7478a8e
parentf5b6ecd12d89bfaa983b489f7af6f2a8803aac46
Share code between WebKit1 and WebKit2 StorageArea subclasses
https://bugs.webkit.org/show_bug.cgi?id=116367

Reviewed by Andreas Kling.

Source/WebCore:

* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
Remove ec parameter.

* inspector/InspectorDOMStorageAgent.h:
Add forward declaration.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
Storage::StorageArea returns a reference now.

* storage/Storage.cpp:
(WebCore::Storage::length):
Check that the storage area can be accessed by the frame, and that it's not disabled by private browsing.
Then call down to the (now simplified) StorageArea::length().

(WebCore::Storage::isDisabledByPrivateBrowsing):
New helper function that's based on StorageAreaImpl::disabledByPrivateBrowsingInFrame, but reordered
to make it easier to follow.

* storage/Storage.h:
(WebCore::Storage::area):
Return a reference.

* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::storageType):
Add this new virtual member funciton that's needed by Storage::isDisabledByPrivateBrowsing.

(WebCore::StorageAreaImpl::length):
Remove unneeded code.

Source/WebKit2:

* WebProcess/Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::length):
Remove code that's now in Storage::length.

(WebKit::StorageAreaImpl::storageType):
Make this a virtual member function.

* WebProcess/Storage/StorageAreaImpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150313 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
Source/WebCore/inspector/InspectorDOMStorageAgent.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/storage/Storage.cpp
Source/WebCore/storage/Storage.h
Source/WebCore/storage/StorageArea.h
Source/WebCore/storage/StorageAreaImpl.cpp
Source/WebCore/storage/StorageAreaImpl.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Storage/StorageAreaImpl.cpp
Source/WebKit2/WebProcess/Storage/StorageAreaImpl.h
Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp