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

Unified Diff: gin/converter.h

Issue 59153005: Begin implementing V8 bindings for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix skipped comment 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
« gin/arguments.cc ('K') | « gin/array_buffer.cc ('k') | gin/converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/converter.h
diff --git a/gin/converter.h b/gin/converter.h
index eb84be213d14e1a36ef5db44833a7dd1b6437ea9..551849bb07c6adf8aa1b1a9ed81741d3f33cd8e7 100644
--- a/gin/converter.h
+++ b/gin/converter.h
@@ -40,6 +40,24 @@ struct Converter<uint32_t> {
};
template<>
+struct Converter<int64_t> {
+ // Warning: JavaScript cannot represent 64 integers precisely.
+ static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
+ int64_t val);
+ static bool FromV8(v8::Handle<v8::Value> val,
+ int64_t* out);
+};
+
+template<>
+struct Converter<uint64_t> {
+ // Warning: JavaScript cannot represent 64 integers precisely.
+ static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
+ uint64_t val);
+ static bool FromV8(v8::Handle<v8::Value> val,
+ uint64_t* out);
+};
+
+template<>
struct Converter<double> {
static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
double val);
@@ -63,7 +81,8 @@ struct Converter<v8::Handle<v8::Function> > {
template<>
struct Converter<v8::Handle<v8::Object> > {
- static v8::Handle<v8::Value> ToV8(v8::Handle<v8::Object> val);
+ static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
+ v8::Handle<v8::Object> val);
static bool FromV8(v8::Handle<v8::Value> val,
v8::Handle<v8::Object>* out);
};
@@ -111,6 +130,9 @@ inline v8::Handle<v8::String> StringToV8(
return ConvertToV8(isolate, input).As<v8::String>();
}
+v8::Handle<v8::String> StringToSymbol(v8::Isolate* isolate,
+ const std::string& val);
+
template<typename T>
bool ConvertFromV8(v8::Handle<v8::Value> input, T* result) {
return Converter<T>::FromV8(input, result);
« gin/arguments.cc ('K') | « gin/array_buffer.cc ('k') | gin/converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698