| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GIN_CONVERTER_H_ | 5 #ifndef GIN_CONVERTER_H_ |
| 6 #define GIN_CONVERTER_H_ | 6 #define GIN_CONVERTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 template<> | 82 template<> |
| 83 struct Converter<v8::Handle<v8::Object> > { | 83 struct Converter<v8::Handle<v8::Object> > { |
| 84 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | 84 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, |
| 85 v8::Handle<v8::Object> val); | 85 v8::Handle<v8::Object> val); |
| 86 static bool FromV8(v8::Handle<v8::Value> val, | 86 static bool FromV8(v8::Handle<v8::Value> val, |
| 87 v8::Handle<v8::Object>* out); | 87 v8::Handle<v8::Object>* out); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 template<> | 90 template<> |
| 91 struct Converter<v8::Handle<v8::ArrayBuffer> > { |
| 92 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, |
| 93 v8::Handle<v8::ArrayBuffer> val); |
| 94 static bool FromV8(v8::Handle<v8::Value> val, |
| 95 v8::Handle<v8::ArrayBuffer>* out); |
| 96 }; |
| 97 |
| 98 template<> |
| 91 struct Converter<v8::Handle<v8::External> > { | 99 struct Converter<v8::Handle<v8::External> > { |
| 92 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | 100 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, |
| 93 v8::Handle<v8::External> val); | 101 v8::Handle<v8::External> val); |
| 94 static bool FromV8(v8::Handle<v8::Value> val, | 102 static bool FromV8(v8::Handle<v8::Value> val, |
| 95 v8::Handle<v8::External>* out); | 103 v8::Handle<v8::External>* out); |
| 96 }; | 104 }; |
| 97 | 105 |
| 98 template<> | 106 template<> |
| 99 struct Converter<v8::Handle<v8::Value> > { | 107 struct Converter<v8::Handle<v8::Value> > { |
| 100 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | 108 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const std::string& val); | 158 const std::string& val); |
| 151 | 159 |
| 152 template<typename T> | 160 template<typename T> |
| 153 bool ConvertFromV8(v8::Handle<v8::Value> input, T* result) { | 161 bool ConvertFromV8(v8::Handle<v8::Value> input, T* result) { |
| 154 return Converter<T>::FromV8(input, result); | 162 return Converter<T>::FromV8(input, result); |
| 155 } | 163 } |
| 156 | 164 |
| 157 } // namespace gin | 165 } // namespace gin |
| 158 | 166 |
| 159 #endif // GIN_CONVERTER_H_ | 167 #endif // GIN_CONVERTER_H_ |
| OLD | NEW |