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

Side by Side Diff: gin/converter.h

Issue 107113005: Gin: Consolidate all the Converter<Wrappable> subclasses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ok Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gin/function_template.h » ('j') | gin/wrappable.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "base/strings/string_piece.h" 11 #include "base/strings/string_piece.h"
12 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
13 13
14 namespace gin { 14 namespace gin {
15 15
16 template<typename T> 16 template<typename T, typename Enable = void>
17 struct Converter {}; 17 struct Converter {};
18 18
19 template<> 19 template<>
20 struct Converter<bool> { 20 struct Converter<bool> {
21 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, 21 static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
22 bool val); 22 bool val);
23 static bool FromV8(v8::Isolate* isolate, 23 static bool FromV8(v8::Isolate* isolate,
24 v8::Handle<v8::Value> val, 24 v8::Handle<v8::Value> val,
25 bool* out); 25 bool* out);
26 }; 26 };
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 bool ConvertFromV8(v8::Isolate* isolate, v8::Handle<v8::Value> input, 183 bool ConvertFromV8(v8::Isolate* isolate, v8::Handle<v8::Value> input,
184 T* result) { 184 T* result) {
185 return Converter<T>::FromV8(isolate, input, result); 185 return Converter<T>::FromV8(isolate, input, result);
186 } 186 }
187 187
188 std::string V8ToString(v8::Handle<v8::Value> value); 188 std::string V8ToString(v8::Handle<v8::Value> value);
189 189
190 } // namespace gin 190 } // namespace gin
191 191
192 #endif // GIN_CONVERTER_H_ 192 #endif // GIN_CONVERTER_H_
OLDNEW
« no previous file with comments | « no previous file | gin/function_template.h » ('j') | gin/wrappable.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698