Index: Source/bindings/common/AbstractScriptValue.h |
diff --git a/Source/modules/quota/StorageQuotaClient.h b/Source/bindings/common/AbstractScriptValue.h |
similarity index 54% |
copy from Source/modules/quota/StorageQuotaClient.h |
copy to Source/bindings/common/AbstractScriptValue.h |
index a5ac3167d86e74939bc348f90e181cba9097e5eb..d9dd31e91c8b90120eb577daf027623fb8904eb4 100644 |
--- a/Source/modules/quota/StorageQuotaClient.h |
+++ b/Source/bindings/common/AbstractScriptValue.h |
@@ -28,40 +28,53 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef StorageQuotaClient_h |
-#define StorageQuotaClient_h |
+#ifndef AbstractScriptValue_h |
+#define AbstractScriptValue_h |
-#include "core/page/Page.h" |
-#include "modules/ModulesExport.h" |
-#include "platform/Supplementable.h" |
#include "platform/heap/Handle.h" |
-#include "public/platform/WebStorageQuotaType.h" |
-#include "wtf/Forward.h" |
+#include "wtf/PassRefPtr.h" |
+#include "wtf/RefPtr.h" |
+#include "wtf/text/WTFString.h" |
namespace blink { |
-class ExecutionContext; |
-class Page; |
-class ScriptPromise; |
+class AbstractScriptPromise; |
+class IDBKey; |
+class IDBKeyPath; |
+class IDBKeyRange; |
+class JSONValue; |
class ScriptState; |
-class StorageErrorCallback; |
-class StorageQuotaCallback; |
-class StorageQuotaClient : public WillBeHeapSupplement<Page> { |
- WTF_MAKE_NONCOPYABLE(StorageQuotaClient); |
+class AbstractScriptValue : public RefCounted<AbstractScriptValue> { |
+ WTF_MAKE_NONCOPYABLE(AbstractScriptValue); |
public: |
- StorageQuotaClient() { } |
- virtual ~StorageQuotaClient() { } |
+ AbstractScriptValue() { } |
+ virtual ~AbstractScriptValue() { } |
- virtual void requestQuota(ExecutionContext*, WebStorageQuotaType, unsigned long long newQuotaInBytes, StorageQuotaCallback*, StorageErrorCallback*) = 0; |
- virtual ScriptPromise requestPersistentQuota(ScriptState*, unsigned long long newQuotaInBytes) = 0; |
+ virtual bool isV8() const { return false; }; |
+ virtual bool isDart() const { return false; }; |
+ virtual bool equals(AbstractScriptValue* other) const = 0; |
- static const char* supplementName(); |
- static StorageQuotaClient* from(ExecutionContext*); |
-}; |
+ virtual ScriptState* scriptState() const = 0; |
+ virtual void clear() = 0; |
+ virtual bool isObject() const = 0; |
+ virtual bool isUndefined() const = 0; |
+ virtual bool isFunction() const = 0; |
+ virtual bool isNull() const = 0; |
+ virtual bool isEmpty() const = 0; |
+ |
+ virtual bool toString(String& result) const = 0; |
+ virtual PassRefPtr<JSONValue> toJSONValue(ScriptState* state) const = 0; |
-MODULES_EXPORT void provideStorageQuotaClientTo(Page&, PassOwnPtrWillBeRawPtr<StorageQuotaClient>); |
+ virtual PassRefPtr<AbstractScriptPromise> toPromise() const = 0; |
+ virtual PassRefPtr<AbstractScriptPromise> toRejectedPromise() const = 0; |
+ |
+ virtual IDBKey* createIDBKeyFromKeyPath(const IDBKeyPath&) = 0; |
+ virtual bool canInjectIDBKey(const IDBKeyPath&) = 0; |
+ virtual IDBKey* toIDBKey() = 0; |
+ virtual IDBKeyRange* toIDBKeyRange() = 0; |
+}; |
} // namespace blink |
-#endif // StorageQuotaClient_h |
+#endif // AbstractScriptValue_h |