Title: [220071] trunk/Source
Revision
220071
Author
[email protected]
Date
2017-07-31 11:05:09 -0700 (Mon, 31 Jul 2017)

Log Message

Remove unnecessary exceptions from storage code
https://bugs.webkit.org/show_bug.cgi?id=174572

Patch by Sam Weinig <[email protected]> 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.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (220070 => 220071)


--- trunk/Source/WebCore/CMakeLists.txt	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-07-31 18:05:09 UTC (rev 220071)
@@ -1222,7 +1222,6 @@
     bindings/js/JSReadableStreamPrivateConstructors.cpp
     bindings/js/JSReadableStreamSourceCustom.cpp
     bindings/js/JSSVGPathSegCustom.cpp
-    bindings/js/JSStorageCustom.cpp
     bindings/js/JSStyleSheetCustom.cpp
     bindings/js/JSSubtleCryptoCustom.cpp
     bindings/js/JSTextCustom.cpp

Modified: trunk/Source/WebCore/ChangeLog (220070 => 220071)


--- trunk/Source/WebCore/ChangeLog	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/ChangeLog	2017-07-31 18:05:09 UTC (rev 220071)
@@ -1,3 +1,44 @@
+2017-07-31  Sam Weinig  <[email protected]>
+
+        Remove unnecessary exceptions from storage code
+        https://bugs.webkit.org/show_bug.cgi?id=174572
+
+        Reviewed by Chris Dumez.
+
+        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].
+
 2017-07-31  Matt Lewis  <[email protected]>
 
         Unreviewed, rolling out r220060.

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (220070 => 220071)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-07-31 18:05:09 UTC (rev 220071)
@@ -2419,7 +2419,6 @@
 		51C81B890C4422F70019ECE3 /* FTPDirectoryParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */; };
 		51C81B8A0C4422F70019ECE3 /* FTPDirectoryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C81B880C4422F70019ECE3 /* FTPDirectoryParser.h */; };
 		51CBFC990D10E483002DBF51 /* CachedFramePlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CBFC980D10E483002DBF51 /* CachedFramePlatformData.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D0C5150DAA90B7003B3831 /* JSStorageCustom.cpp */; };
 		51D1248B1E73627F002B2820 /* NetworkStorageSessionCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D1248A1E73625C002B2820 /* NetworkStorageSessionCocoa.mm */; };
 		51D1248D1E7364AA002B2820 /* CookieCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D1248C1E736456002B2820 /* CookieCocoa.mm */; };
 		51D7236C1BB6174900478CA3 /* IDBResultData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7236A1BB60BFE00478CA3 /* IDBResultData.cpp */; };
@@ -10125,7 +10124,6 @@
 		51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FTPDirectoryParser.cpp; sourceTree = "<group>"; };
 		51C81B880C4422F70019ECE3 /* FTPDirectoryParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FTPDirectoryParser.h; sourceTree = "<group>"; };
 		51CBFC980D10E483002DBF51 /* CachedFramePlatformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFramePlatformData.h; sourceTree = "<group>"; };
-		51D0C5150DAA90B7003B3831 /* JSStorageCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStorageCustom.cpp; sourceTree = "<group>"; };
 		51D1248A1E73625C002B2820 /* NetworkStorageSessionCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkStorageSessionCocoa.mm; sourceTree = "<group>"; };
 		51D1248C1E736456002B2820 /* CookieCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieCocoa.mm; sourceTree = "<group>"; };
 		51D7196C181106DF0016DC51 /* DOMWindowIndexedDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowIndexedDatabase.cpp; sourceTree = "<group>"; };
@@ -23579,7 +23577,6 @@
 				C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */,
 				A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
 				418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
-				51D0C5150DAA90B7003B3831 /* JSStorageCustom.cpp */,
 				57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */,
 				E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */,
 				BC348BBD0DB7F531004ABAB9 /* JSXMLHttpRequestCustom.cpp */,
@@ -32182,7 +32179,6 @@
 				B59DD6A211902A52007E9684 /* JSSQLTransactionErrorCallback.cpp in Sources */,
 				A86629D409DA2B48009633A7 /* JSStaticRange.cpp in Sources */,
 				51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */,
-				51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */,
 				51E0BAEA0DA55D4A00A9E417 /* JSStorageEvent.cpp in Sources */,
 				0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */,
 				BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */,

Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (220070 => 220071)


--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -85,7 +85,6 @@
 #include "JSPopStateEventCustom.cpp"
 #include "JSReadableStreamPrivateConstructors.cpp"
 #include "JSSVGPathSegCustom.cpp"
-#include "JSStorageCustom.cpp"
 #include "JSStyleSheetCustom.cpp"
 #include "JSTextCustom.cpp"
 #include "JSTextTrackCueCustom.cpp"

Deleted: trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp (220070 => 220071)


--- trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "JSStorage.h"
-
-#include "JSDOMConvertStrings.h"
-#include "JSDOMExceptionHandling.h"
-#include <runtime/JSCInlines.h>
-#include <runtime/PropertyNameArray.h>
-#include <wtf/text/WTFString.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
-{
-    VM& vm = state->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    auto& thisObject = *jsCast<JSStorage*>(object);
-    auto lengthResult = thisObject.wrapped().length();
-    if (lengthResult.hasException()) {
-        propagateException(*state, scope, lengthResult.releaseException());
-        return;
-    }
-    unsigned length = lengthResult.releaseReturnValue();
-    for (unsigned i = 0; i < length; ++i) {
-        auto keyResult = thisObject.wrapped().key(i);
-        if (keyResult.hasException()) {
-            propagateException(*state, scope, lengthResult.releaseException());
-            return;
-        }
-        propertyNames.add(Identifier::fromString(state, keyResult.releaseReturnValue()));
-    }
-        
-    Base::getOwnPropertyNames(&thisObject, state, propertyNames, mode);
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (220070 => 220071)


--- trunk/Source/WebCore/loader/EmptyClients.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -549,7 +549,6 @@
         void removeItem(Frame*, const String&) final { }
         void clear(Frame*) final { }
         bool contains(const String&) final { return false; }
-        bool canAccessStorage(Frame*) final { return false; }
         StorageType storageType() const final { return StorageType::Local; }
         size_t memoryBytesUsedByCache() final { return 0; }
         SecurityOriginData securityOrigin() const final { return { }; }

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (220070 => 220071)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -864,11 +864,8 @@
     if (!document->securityOrigin().canAccessSessionStorage(document->topOrigin()))
         return Exception { SecurityError };
 
-    if (m_sessionStorage) {
-        if (!m_sessionStorage->area().canAccessStorage(m_frame))
-            return Exception { SecurityError };
+    if (m_sessionStorage)
         return m_sessionStorage.get();
-    }
 
     auto* page = document->page();
     if (!page)
@@ -875,9 +872,6 @@
         return nullptr;
 
     auto storageArea = page->sessionStorage()->storageArea(SecurityOriginData::fromSecurityOrigin(document->securityOrigin()));
-    if (!storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
-
     m_sessionStorage = Storage::create(m_frame, WTFMove(storageArea));
     return m_sessionStorage.get();
 }
@@ -898,11 +892,8 @@
     // FIXME: We should consider supporting access/modification to local storage
     // after calling window.close(). See <https://bugs.webkit.org/show_bug.cgi?id=135330>.
     if (!page || !page->isClosing()) {
-        if (m_localStorage) {
-            if (!m_localStorage->area().canAccessStorage(m_frame))
-                return Exception { SecurityError };
+        if (m_localStorage)
             return m_localStorage.get();
-        }
     }
 
     if (!page)
@@ -915,10 +906,6 @@
         return nullptr;
 
     auto storageArea = page->storageNamespaceProvider().localStorageArea(*document);
-
-    if (!storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
-
     m_localStorage = Storage::create(m_frame, WTFMove(storageArea));
     return m_localStorage.get();
 }

Modified: trunk/Source/WebCore/storage/Storage.cpp (220070 => 220071)


--- trunk/Source/WebCore/storage/Storage.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/storage/Storage.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -57,34 +57,25 @@
     m_storageArea->decrementAccessCount();
 }
 
-ExceptionOr<unsigned> Storage::length() const
+unsigned Storage::length() const
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
-
     return m_storageArea->length();
 }
 
-ExceptionOr<String> Storage::key(unsigned index) const
+String Storage::key(unsigned index) const
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
-
     return m_storageArea->key(index);
 }
 
-ExceptionOr<String> Storage::getItem(const String& key) const
+String Storage::getItem(const String& key) const
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
-
     return m_storageArea->item(key);
 }
 
 ExceptionOr<void> Storage::setItem(const String& key, const String& value)
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
+    if (!m_frame)
+        return Exception { InvalidAccessError };
 
     bool quotaException = false;
     m_storageArea->setItem(m_frame, key, value, quotaException);
@@ -95,8 +86,8 @@
 
 ExceptionOr<void> Storage::removeItem(const String& key)
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
+    if (!m_frame)
+        return Exception { InvalidAccessError };
 
     m_storageArea->removeItem(m_frame, key);
     return { };
@@ -104,27 +95,34 @@
 
 ExceptionOr<void> Storage::clear()
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
+    if (!m_frame)
+        return Exception { InvalidAccessError };
 
     m_storageArea->clear(m_frame);
     return { };
 }
 
-ExceptionOr<bool> Storage::contains(const String& key) const
+bool Storage::contains(const String& key) const
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return Exception { SecurityError };
-
     return m_storageArea->contains(key);
 }
 
 bool Storage::isSupportedPropertyName(const String& propertyName) const
 {
-    if (!m_storageArea->canAccessStorage(m_frame))
-        return false;
-
     return m_storageArea->contains(propertyName);
 }
 
+Vector<AtomicString> Storage::supportedPropertyNames() const
+{
+    unsigned length = m_storageArea->length();
+
+    Vector<AtomicString> result;
+    result.reserveInitialCapacity(length);
+
+    for (unsigned i = 0; i < length; ++i)
+        result.uncheckedAppend(m_storageArea->key(i));
+
+    return result;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/storage/Storage.h (220070 => 220071)


--- trunk/Source/WebCore/storage/Storage.h	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/storage/Storage.h	2017-07-31 18:05:09 UTC (rev 220071)
@@ -39,16 +39,17 @@
     static Ref<Storage> create(Frame*, RefPtr<StorageArea>&&);
     ~Storage();
 
-    ExceptionOr<unsigned> length() const;
-    ExceptionOr<String> key(unsigned index) const;
-    ExceptionOr<String> getItem(const String& key) const;
+    unsigned length() const;
+    String key(unsigned index) const;
+    String getItem(const String& key) const;
     ExceptionOr<void> setItem(const String& key, const String& value);
     ExceptionOr<void> removeItem(const String& key);
     ExceptionOr<void> clear();
-    ExceptionOr<bool> contains(const String& key) const;
+    bool contains(const String& key) const;
 
     // Bindings support functions.
     bool isSupportedPropertyName(const String&) const;
+    Vector<AtomicString> supportedPropertyNames() const;
 
     StorageArea& area() const { return *m_storageArea; }
 

Modified: trunk/Source/WebCore/storage/Storage.idl (220070 => 220071)


--- trunk/Source/WebCore/storage/Storage.idl	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/storage/Storage.idl	2017-07-31 18:05:09 UTC (rev 220071)
@@ -24,15 +24,13 @@
  */
 
 [
-    CustomGetOwnPropertyNames,
     GenerateIsReachable=ImplFrame,
     SkipVTableValidation,
 ] interface Storage {
-    [GetterMayThrowException] readonly attribute unsigned long length;
-    [MayThrowException] DOMString? key(unsigned long index);
-    [MayThrowException] getter DOMString? getItem(DOMString key);
+    readonly attribute unsigned long length;
+    DOMString? key(unsigned long index);
+    getter DOMString? getItem(DOMString key);
     [MayThrowException] setter void setItem(DOMString key, DOMString data);
     [MayThrowException] deleter void removeItem(DOMString key);
     [MayThrowException] void clear();
 };
-

Modified: trunk/Source/WebCore/storage/StorageArea.h (220070 => 220071)


--- trunk/Source/WebCore/storage/StorageArea.h	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebCore/storage/StorageArea.h	2017-07-31 18:05:09 UTC (rev 220071)
@@ -51,7 +51,6 @@
     virtual void clear(Frame* sourceFrame) = 0;
     virtual bool contains(const String& key) = 0;
 
-    virtual bool canAccessStorage(Frame*) = 0;
     virtual StorageType storageType() const = 0;
 
     virtual size_t memoryBytesUsedByCache() = 0;

Modified: trunk/Source/WebKit/ChangeLog (220070 => 220071)


--- trunk/Source/WebKit/ChangeLog	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebKit/ChangeLog	2017-07-31 18:05:09 UTC (rev 220071)
@@ -1,3 +1,16 @@
+2017-07-31  Sam Weinig  <[email protected]>
+
+        Remove unnecessary exceptions from storage code
+        https://bugs.webkit.org/show_bug.cgi?id=174572
+
+        Reviewed by Chris Dumez.
+
+        * WebProcess/Storage/StorageAreaImpl.cpp:
+        (WebKit::StorageAreaImpl::canAccessStorage): Deleted.
+        * WebProcess/Storage/StorageAreaImpl.h:
+        * WebProcess/Storage/StorageNamespaceImpl.cpp:
+        Remove canAccessStorage. It is no longer called.
+
 2017-07-30  Brady Eidson  <[email protected]>
 
         Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.

Modified: trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.cpp (220070 => 220071)


--- trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -96,11 +96,6 @@
     return m_storageAreaMap->contains(key);
 }
 
-bool StorageAreaImpl::canAccessStorage(Frame* frame)
-{
-    return frame && frame->page();
-}
-
 StorageType StorageAreaImpl::storageType() const
 {
     return m_storageAreaMap->storageType();

Modified: trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h (220070 => 220071)


--- trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h	2017-07-31 18:05:09 UTC (rev 220071)
@@ -56,7 +56,6 @@
     void removeItem(WebCore::Frame* sourceFrame, const String& key) override;
     void clear(WebCore::Frame* sourceFrame) override;
     bool contains(const String& key) override;
-    bool canAccessStorage(WebCore::Frame*) override;
     WebCore::StorageType storageType() const override;
     size_t memoryBytesUsedByCache() override;
     void incrementAccessCount() override;

Modified: trunk/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp (220070 => 220071)


--- trunk/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -163,11 +163,6 @@
         return m_storageMap->contains(key);
     }
 
-    bool canAccessStorage(Frame* frame)
-    {
-        return frame && frame->page();
-    }
-
     StorageType storageType() const
     {
         return StorageType::EphemeralLocal;

Modified: trunk/Source/WebKitLegacy/ChangeLog (220070 => 220071)


--- trunk/Source/WebKitLegacy/ChangeLog	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebKitLegacy/ChangeLog	2017-07-31 18:05:09 UTC (rev 220071)
@@ -1,3 +1,15 @@
+2017-07-31  Sam Weinig  <[email protected]>
+
+        Remove unnecessary exceptions from storage code
+        https://bugs.webkit.org/show_bug.cgi?id=174572
+
+        Reviewed by Chris Dumez.
+
+        * Storage/StorageAreaImpl.cpp:
+        (WebKit::StorageAreaImpl::canAccessStorage): Deleted.
+        * Storage/StorageAreaImpl.h:
+        Remove canAccessStorage. It is no longer called.
+
 2017-07-14  Filip Pizlo  <[email protected]>
 
         It should be easy to decide how WebKit yields

Modified: trunk/Source/WebKitLegacy/Storage/StorageAreaImpl.cpp (220070 => 220071)


--- trunk/Source/WebKitLegacy/Storage/StorageAreaImpl.cpp	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebKitLegacy/Storage/StorageAreaImpl.cpp	2017-07-31 18:05:09 UTC (rev 220071)
@@ -98,11 +98,6 @@
     ASSERT(!m_isShutdown);
 }
 
-bool StorageAreaImpl::canAccessStorage(Frame* frame)
-{
-    return frame && frame->page();
-}
-
 StorageType StorageAreaImpl::storageType() const
 {
     return m_storageType;

Modified: trunk/Source/WebKitLegacy/Storage/StorageAreaImpl.h (220070 => 220071)


--- trunk/Source/WebKitLegacy/Storage/StorageAreaImpl.h	2017-07-31 17:42:00 UTC (rev 220070)
+++ trunk/Source/WebKitLegacy/Storage/StorageAreaImpl.h	2017-07-31 18:05:09 UTC (rev 220071)
@@ -53,7 +53,6 @@
     void clear(WebCore::Frame* sourceFrame) override;
     bool contains(const String& key) override;
 
-    bool canAccessStorage(WebCore::Frame* sourceFrame) override;
     WebCore::StorageType storageType() const override;
 
     size_t memoryBytesUsedByCache() override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to