Index: Source/bindings/v8/V8FutureInit.h |
diff --git a/Source/bindings/v8/ScriptInstance.h b/Source/bindings/v8/V8FutureInit.h |
similarity index 63% |
copy from Source/bindings/v8/ScriptInstance.h |
copy to Source/bindings/v8/V8FutureInit.h |
index 25afc379e5cad65d4a822d50105274d9a5df9488..2f3999ef7911a409b6d820e3dda6d2aa63d5cec3 100644 |
--- a/Source/bindings/v8/ScriptInstance.h |
+++ b/Source/bindings/v8/V8FutureInit.h |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
+ * Copyright (C) 2013 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -14,7 +14,7 @@ |
* * Neither the name of Google Inc. nor the names of its |
* contributors may be used to endorse or promote products derived from |
* this software without specific prior written permission. |
- * |
+ * |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -28,32 +28,42 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef ScriptInstance_h |
-#define ScriptInstance_h |
+#ifndef V8FutureInit_h |
+#define V8FutureInit_h |
+#include "bindings/v8/ActiveDOMCallback.h" |
+#include "bindings/v8/DOMWrapperWorld.h" |
#include "bindings/v8/ScopedPersistent.h" |
-#include <v8.h> |
+#include "bindings/v8/ScriptValue.h" |
+#include "core/dom/Future.h" |
+#include "core/dom/FutureInit.h" |
+#include "core/dom/FutureResolver.h" |
+#include "core/dom/ScriptExecutionContext.h" |
+#include "core/platform/Logging.h" |
#include "wtf/PassRefPtr.h" |
-#include "wtf/RefCounted.h" |
#include "wtf/RefPtr.h" |
+#include <v8.h> |
+ |
namespace WebCore { |
-class V8ScriptInstance : public RefCounted<V8ScriptInstance> { |
+class V8FutureInit : public FutureInit, ActiveDOMCallback { |
public: |
- static PassRefPtr<V8ScriptInstance> create(v8::Handle<v8::Object> instance) { return adoptRef(new V8ScriptInstance(instance)); } |
+ static PassRefPtr<V8FutureInit> create(v8::Handle<v8::Function> callback, ScriptExecutionContext* context) |
+ { |
+ ASSERT(context); |
+ return adoptRef(new V8FutureInit(callback, context)); |
+ } |
- v8::Persistent<v8::Object> instance() { return m_instance.get(); } |
+ virtual ScriptValue call(PassRefPtr<FutureResolver>, PassRefPtr<Future>, ScriptExecutionContext*) OVERRIDE; |
private: |
- explicit V8ScriptInstance(v8::Handle<v8::Object>); |
+ V8FutureInit(v8::Handle<v8::Function>, ScriptExecutionContext*); |
- ScopedPersistent<v8::Object> m_instance; |
+ ScopedPersistent<v8::Function> m_callback; |
+ RefPtr<DOMWrapperWorld> m_world; |
}; |
-typedef RefPtr<V8ScriptInstance> ScriptInstance; |
-typedef PassRefPtr<V8ScriptInstance> PassScriptInstance; |
- |
-} // namespace WebCore |
+} |
-#endif // ScriptInstance_h |
+#endif // V8FutureInit_h |