summaryrefslogtreecommitdiff
path: root/Source/WebCore/storage/Storage.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/storage/Storage.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/storage/Storage.h')
-rw-r--r--Source/WebCore/storage/Storage.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/Source/WebCore/storage/Storage.h b/Source/WebCore/storage/Storage.h
index 1e9fdab76..5df3ae9a8 100644
--- a/Source/WebCore/storage/Storage.h
+++ b/Source/WebCore/storage/Storage.h
@@ -23,39 +23,34 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Storage_h
-#define Storage_h
+#pragma once
#include "DOMWindowProperty.h"
+#include "ExceptionOr.h"
#include "ScriptWrappable.h"
-#include <wtf/Forward.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
namespace WebCore {
class Frame;
class StorageArea;
-typedef int ExceptionCode;
-
class Storage : public ScriptWrappable, public RefCounted<Storage>, public DOMWindowProperty {
public:
- static PassRefPtr<Storage> create(Frame*, PassRefPtr<StorageArea>);
+ static Ref<Storage> create(Frame*, RefPtr<StorageArea>&&);
~Storage();
- unsigned length(ExceptionCode&) const;
- String key(unsigned index, ExceptionCode&) const;
- String getItem(const String& key, ExceptionCode&) const;
- void setItem(const String& key, const String& value, ExceptionCode&);
- void removeItem(const String& key, ExceptionCode&);
- void clear(ExceptionCode&);
- bool contains(const String& key, ExceptionCode&) const;
+ ExceptionOr<unsigned> length() const;
+ ExceptionOr<String> key(unsigned index) const;
+ ExceptionOr<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;
StorageArea& area() const { return *m_storageArea; }
private:
- Storage(Frame*, PassRefPtr<StorageArea>);
+ Storage(Frame*, RefPtr<StorageArea>&&);
bool isDisabledByPrivateBrowsing() const;
@@ -63,5 +58,3 @@ private:
};
} // namespace WebCore
-
-#endif // Storage_h