OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef AbstractScriptPromise_h |
| 6 #define AbstractScriptPromise_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptFunction.h" |
| 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/PassOwnPtr.h" |
| 11 #include "wtf/PassRefPtr.h" |
| 12 #include <v8.h> |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class AbstractScriptPromise : public RefCounted<AbstractScriptPromise> { |
| 17 WTF_MAKE_NONCOPYABLE(AbstractScriptPromise); |
| 18 public: |
| 19 virtual ~AbstractScriptPromise() { } |
| 20 |
| 21 virtual PassRefPtr<AbstractScriptPromise> then(v8::Handle<v8::Function> onFu
lfilled, v8::Handle<v8::Function> onRejected = v8::Handle<v8::Function>()) = 0; |
| 22 |
| 23 virtual bool isV8ScriptPromise() const { return false; } |
| 24 virtual bool equals(PassRefPtr<AbstractScriptPromise>) const = 0; |
| 25 |
| 26 virtual bool isObject() const = 0; |
| 27 virtual bool isNull() const = 0; |
| 28 virtual bool isUndefinedOrNull() const = 0; |
| 29 virtual bool isEmpty() const = 0; |
| 30 virtual void clear() = 0; |
| 31 |
| 32 // FIXMEMULTIVM: Remove. |
| 33 virtual v8::Handle<v8::Value> v8Value() const = 0; |
| 34 virtual v8::Isolate* isolate() const = 0; |
| 35 |
| 36 protected: |
| 37 AbstractScriptPromise() { } |
| 38 }; |
| 39 |
| 40 } // namespace blink |
| 41 |
| 42 #endif // AbstractScriptPromise_h |
OLD | NEW |