Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: Source/bindings/common/ScriptValue.h

Issue 289083003: [dartium] Dart half of ScriptValue refactoring. (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1916
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/common/AbstractScriptValue.h ('k') | Source/bindings/dart/DartHandleProxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/common/ScriptValue.h
diff --git a/Source/bindings/common/ScriptValue.h b/Source/bindings/common/ScriptValue.h
index a4e178554cf333c6594a82f57b50ce2a524e1bad..eab1c26f9d3edebfc5fcb72893cdd9a211390ed9 100644
--- a/Source/bindings/common/ScriptValue.h
+++ b/Source/bindings/common/ScriptValue.h
@@ -34,6 +34,7 @@
#include "bindings/common/AbstractScriptValue.h"
#include "bindings/v8/SharedPersistent.h"
#include "bindings/v8/V8ScriptValue.h"
+#include "bindings/dart/DartScriptValue.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
@@ -90,10 +91,17 @@ public:
return static_cast<V8ScriptValue*>(m_implScriptValue.get())->isolate();
}
+ // FIXMEMULTIVM: Remove.
v8::Handle<v8::Value> v8Value() const
{
- ASSERT(m_implScriptValue->isV8());
- return static_cast<V8ScriptValue*>(m_implScriptValue.get())->v8Value();
+ if (m_implScriptValue->isV8()) {
+ return static_cast<V8ScriptValue*>(m_implScriptValue.get())->v8Value();
+ }
+ if (m_implScriptValue->isDart()) {
+ return static_cast<DartScriptValue*>(m_implScriptValue.get())->v8Value();
+ }
+ ASSERT_NOT_REACHED();
+ return v8::Handle<v8::Value>();
}
ScriptValue& operator=(const ScriptValue& value)
@@ -169,6 +177,11 @@ public:
PassRefPtr<JSONValue> toJSONValue(ScriptState* state) const;
+ AbstractScriptValue* scriptValue() const
+ {
+ return m_implScriptValue.get();
+ }
+
private:
RefPtr<AbstractScriptValue> m_implScriptValue;
};
« no previous file with comments | « Source/bindings/common/AbstractScriptValue.h ('k') | Source/bindings/dart/DartHandleProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698