| Index: sky/engine/bindings-dart/common/AbstractScriptValue.h
|
| diff --git a/sky/engine/public/web/WebLeakDetector.h b/sky/engine/bindings-dart/common/AbstractScriptValue.h
|
| similarity index 53%
|
| copy from sky/engine/public/web/WebLeakDetector.h
|
| copy to sky/engine/bindings-dart/common/AbstractScriptValue.h
|
| index 36d28d8cec056d0868bafb2dc8de6453f032699c..d9dd31e91c8b90120eb577daf027623fb8904eb4 100644
|
| --- a/sky/engine/public/web/WebLeakDetector.h
|
| +++ b/sky/engine/bindings-dart/common/AbstractScriptValue.h
|
| @@ -28,38 +28,53 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef SKY_ENGINE_PUBLIC_WEB_WEBLEAKDETECTOR_H_
|
| -#define SKY_ENGINE_PUBLIC_WEB_WEBLEAKDETECTOR_H_
|
| +#ifndef AbstractScriptValue_h
|
| +#define AbstractScriptValue_h
|
|
|
| -#include "sky/engine/public/platform/WebCommon.h"
|
| -#include "sky/engine/public/web/WebFrame.h"
|
| +#include "platform/heap/Handle.h"
|
| +#include "wtf/PassRefPtr.h"
|
| +#include "wtf/RefPtr.h"
|
| +#include "wtf/text/WTFString.h"
|
|
|
| namespace blink {
|
|
|
| -class WebLeakDetectorClient {
|
| +class AbstractScriptPromise;
|
| +class IDBKey;
|
| +class IDBKeyPath;
|
| +class IDBKeyRange;
|
| +class JSONValue;
|
| +class ScriptState;
|
| +
|
| +class AbstractScriptValue : public RefCounted<AbstractScriptValue> {
|
| + WTF_MAKE_NONCOPYABLE(AbstractScriptValue);
|
| public:
|
| - struct Result {
|
| - unsigned numberOfLiveAudioNodes;
|
| - unsigned numberOfLiveDocuments;
|
| - unsigned numberOfLiveNodes;
|
| - unsigned numberOfLiveRenderObjects;
|
| - unsigned numberOfLiveResources;
|
| - };
|
| + AbstractScriptValue() { }
|
| + virtual ~AbstractScriptValue() { }
|
|
|
| - virtual void onLeakDetectionComplete(const Result&) = 0;
|
| -};
|
| + virtual bool isV8() const { return false; };
|
| + virtual bool isDart() const { return false; };
|
| + virtual bool equals(AbstractScriptValue* other) const = 0;
|
|
|
| -class WebLeakDetector {
|
| -public:
|
| - virtual ~WebLeakDetector() { }
|
| + 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;
|
|
|
| - BLINK_EXPORT static WebLeakDetector* create(WebLeakDetectorClient*);
|
| + virtual PassRefPtr<AbstractScriptPromise> toPromise() const = 0;
|
| + virtual PassRefPtr<AbstractScriptPromise> toRejectedPromise() const = 0;
|
|
|
| - // Cleans up the DOM objects and counts them. |WebLeakDetectorClient::onLeakDetectionComplete()| is called when done.
|
| - // This is supposed to be used for detecting DOM-object leaks.
|
| - virtual void collectGarbageAndGetDOMCounts(WebLocalFrame*) = 0;
|
| + virtual IDBKey* createIDBKeyFromKeyPath(const IDBKeyPath&) = 0;
|
| + virtual bool canInjectIDBKey(const IDBKeyPath&) = 0;
|
| + virtual IDBKey* toIDBKey() = 0;
|
| + virtual IDBKeyRange* toIDBKeyRange() = 0;
|
| };
|
|
|
| } // namespace blink
|
|
|
| -#endif // SKY_ENGINE_PUBLIC_WEB_WEBLEAKDETECTOR_H_
|
| +#endif // AbstractScriptValue_h
|
|
|