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

Side by Side Diff: sky/engine/bindings-dart/core/dart/V8Converter.h

Issue 918273002: Remove bindings-dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef V8Converter_h
32 #define V8Converter_h
33
34 #include <dart_api.h>
35 #include <v8.h>
36
37 namespace blink {
38
39 class DartDOMData;
40 class DartToV8Map;
41 class V8ToDartMap;
42
43 class V8Converter {
44 public:
45 static v8::Handle<v8::Value> toV8(Dart_Handle value, Dart_Handle& exception) ;
46 static Dart_Handle toDart(v8::Handle<v8::Value> value, Dart_Handle& exceptio n);
47
48 static v8::Handle<v8::Value> toV8IfPrimitive(DartDOMData*, Dart_Handle value , Dart_Handle& exception);
49 static Dart_Handle toDartIfPrimitive(v8::Handle<v8::Value>);
50
51 static v8::Handle<v8::Value> toV8IfBrowserNative(DartDOMData*, Dart_Handle v alue, Dart_Handle& exception);
52 static Dart_Handle toDartIfBrowserNative(v8::Handle<v8::Object>, v8::Isolate *, Dart_Handle& exception);
53
54 static v8::Handle<v8::String> stringToV8(Dart_Handle);
55 static Dart_Handle stringToDart(v8::Handle<v8::Value>);
56
57 static v8::Handle<v8::Value> booleanToV8(Dart_Handle);
58
59 static v8::Handle<v8::Value> numberToV8(Dart_Handle);
60
61 static v8::Handle<v8::Value> listToV8(Dart_Handle);
62
63 static v8::Handle<v8::Value> dateToV8(Dart_Handle);
64 static Dart_Handle dateToDart(v8::Handle<v8::Value>);
65
66 static v8::Handle<v8::Value> nodeToV8(Dart_Handle, Dart_Handle& exception);
67 static Dart_Handle nodeToDart(v8::Handle<v8::Value>);
68
69 static v8::Handle<v8::Value> eventToV8(Dart_Handle, Dart_Handle& exception);
70 static Dart_Handle eventToDart(v8::Handle<v8::Value>);
71
72 static v8::Handle<v8::Value> windowToV8(Dart_Handle, Dart_Handle& exception) ;
73 static Dart_Handle windowToDart(v8::Handle<v8::Value>);
74
75 private:
76 static v8::Handle<v8::Value> toV8(Dart_Handle value, DartToV8Map&, Dart_Hand le& exception);
77 static Dart_Handle toDart(v8::Handle<v8::Value>, V8ToDartMap&, Dart_Handle& exception);
78 static v8::Handle<v8::Value> numberToV8(Dart_Handle, Dart_Handle& exception) ;
79 static v8::Handle<v8::Value> listToV8(Dart_Handle, DartToV8Map&, Dart_Handle & exception);
80 static Dart_Handle listToDart(v8::Handle<v8::Array>, V8ToDartMap&, Dart_Hand le& exception);
81 static v8::Handle<v8::Value> mapToV8(Dart_Handle, DartToV8Map&, Dart_Handle& exception);
82 static Dart_Handle mapToDart(v8::Handle<v8::Object>, V8ToDartMap&, Dart_Hand le& exception);
83 static v8::Handle<v8::Value> arrayBufferToV8(Dart_Handle, Dart_Handle& excep tion);
84 static Dart_Handle arrayBufferToDart(v8::Handle<v8::Object>, Dart_Handle& ex ception);
85 static v8::Handle<v8::Value> arrayBufferViewToV8(Dart_Handle, Dart_Handle& e xception);
86 static Dart_Handle arrayBufferViewToDart(v8::Handle<v8::Object>, Dart_Handle & exception);
87 static v8::Handle<v8::Value> dateToV8(Dart_Handle, Dart_Handle& exception);
88 static Dart_Handle blobToDart(v8::Handle<v8::Object>, Dart_Handle& exception );
89 static v8::Handle<v8::Value> blobToV8(Dart_Handle, Dart_Handle& exception);
90 static Dart_Handle imageDataToDart(v8::Handle<v8::Object>, Dart_Handle& exce ption);
91 static v8::Handle<v8::Value> imageDataToV8(Dart_Handle, Dart_Handle& excepti on);
92 static Dart_Handle idbKeyRangeToDart(v8::Handle<v8::Object>, Dart_Handle& ex ception);
93 static v8::Handle<v8::Value> idbKeyRangeToV8(Dart_Handle, Dart_Handle& excep tion);
94 static Dart_Handle idbDatabaseToDart(v8::Handle<v8::Object>, Dart_Handle& ex ception);
95 static Dart_Handle idbCursorToDart(v8::Handle<v8::Object>, Dart_Handle& exce ption);
96 static Dart_Handle idbCursorWithValueToDart(v8::Handle<v8::Object>, Dart_Han dle& exception);
97 static Dart_Handle idbFactoryToDart(v8::Handle<v8::Object>, Dart_Handle& exc eption);
98 static Dart_Handle domStringListToDart(v8::Handle<v8::Object>, Dart_Handle& exception);
99 static v8::Handle<v8::Value> domStringListToV8(Dart_Handle, Dart_Handle& exc eption);
100 };
101
102 }
103
104 #endif // V8Converter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698