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

Unified Diff: gin/converter.cc

Issue 62333018: Implement Asynchronous Module Definition API for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Aaron's comments Created 7 years, 1 month 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 | « gin/converter.h ('k') | gin/gin.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/converter.cc
diff --git a/gin/converter.cc b/gin/converter.cc
index 64f5954ce8d98e40781e7deeaf232ce29bb0ab75..5fda6732fa8f2353a8ec1ea882c439e10c6c1f38 100644
--- a/gin/converter.cc
+++ b/gin/converter.cc
@@ -7,6 +7,7 @@
#include "v8/include/v8.h"
using v8::Boolean;
+using v8::External;
using v8::Function;
using v8::Handle;
using v8::Integer;
@@ -124,6 +125,30 @@ bool Converter<Handle<Object> >::FromV8(Handle<Value> val,
return true;
}
+Handle<Value> Converter<Handle<External> >::ToV8(v8::Isolate* isolate,
+ Handle<External> val) {
+ return val.As<Value>();
+}
+
+bool Converter<Handle<External> >::FromV8(Handle<Value> val,
+ Handle<External>* out) {
+ if (!val->IsExternal())
+ return false;
+ *out = Handle<External>::Cast(val);
+ return true;
+}
+
+Handle<Value> Converter<Handle<Value> >::ToV8(v8::Isolate* isolate,
+ Handle<Value> val) {
+ return val;
+}
+
+bool Converter<Handle<Value> >::FromV8(Handle<Value> val,
+ Handle<Value>* out) {
+ *out = val;
+ return true;
+}
+
v8::Handle<v8::String> StringToSymbol(v8::Isolate* isolate,
const std::string& val) {
return String::NewFromUtf8(isolate,
« no previous file with comments | « gin/converter.h ('k') | gin/gin.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698