OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 return v8NullWithCheck(isolate); | 48 return v8NullWithCheck(isolate); |
49 case IDBKeyPath::StringType: | 49 case IDBKeyPath::StringType: |
50 return v8String(value.string(), isolate); | 50 return v8String(value.string(), isolate); |
51 case IDBKeyPath::ArrayType: | 51 case IDBKeyPath::ArrayType: |
52 RefPtr<DOMStringList> keyPaths = DOMStringList::create(); | 52 RefPtr<DOMStringList> keyPaths = DOMStringList::create(); |
53 for (Vector<String>::const_iterator it = value.array().begin(); it != va
lue.array().end(); ++it) | 53 for (Vector<String>::const_iterator it = value.array().begin(); it != va
lue.array().end(); ++it) |
54 keyPaths->append(*it); | 54 keyPaths->append(*it); |
55 return toV8(keyPaths.release(), creationContext, isolate); | 55 return toV8(keyPaths.release(), creationContext, isolate); |
56 } | 56 } |
57 ASSERT_NOT_REACHED(); | 57 ASSERT_NOT_REACHED(); |
58 return v8::Undefined(); | 58 return v8::Undefined(isolate); |
59 } | 59 } |
60 | 60 |
61 v8::Handle<v8::Value> toV8(IDBAny* impl, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate) | 61 v8::Handle<v8::Value> toV8(IDBAny* impl, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate) |
62 { | 62 { |
63 if (!impl) | 63 if (!impl) |
64 return v8NullWithCheck(isolate); | 64 return v8NullWithCheck(isolate); |
65 | 65 |
66 switch (impl->type()) { | 66 switch (impl->type()) { |
67 case IDBAny::UndefinedType: | 67 case IDBAny::UndefinedType: |
68 return v8::Undefined(); | 68 return v8::Undefined(isolate); |
69 case IDBAny::NullType: | 69 case IDBAny::NullType: |
70 return v8NullWithCheck(isolate); | 70 return v8NullWithCheck(isolate); |
71 case IDBAny::DOMStringListType: | 71 case IDBAny::DOMStringListType: |
72 return toV8(impl->domStringList(), creationContext, isolate); | 72 return toV8(impl->domStringList(), creationContext, isolate); |
73 case IDBAny::IDBCursorType: | 73 case IDBAny::IDBCursorType: |
74 return toV8(impl->idbCursor(), creationContext, isolate); | 74 return toV8(impl->idbCursor(), creationContext, isolate); |
75 case IDBAny::IDBCursorWithValueType: | 75 case IDBAny::IDBCursorWithValueType: |
76 return toV8(impl->idbCursorWithValue(), creationContext, isolate); | 76 return toV8(impl->idbCursorWithValue(), creationContext, isolate); |
77 case IDBAny::IDBDatabaseType: | 77 case IDBAny::IDBDatabaseType: |
78 return toV8(impl->idbDatabase(), creationContext, isolate); | 78 return toV8(impl->idbDatabase(), creationContext, isolate); |
79 case IDBAny::IDBFactoryType: | 79 case IDBAny::IDBFactoryType: |
80 return toV8(impl->idbFactory(), creationContext, isolate); | 80 return toV8(impl->idbFactory(), creationContext, isolate); |
81 case IDBAny::IDBIndexType: | 81 case IDBAny::IDBIndexType: |
82 return toV8(impl->idbIndex(), creationContext, isolate); | 82 return toV8(impl->idbIndex(), creationContext, isolate); |
83 case IDBAny::IDBObjectStoreType: | 83 case IDBAny::IDBObjectStoreType: |
84 return toV8(impl->idbObjectStore(), creationContext, isolate); | 84 return toV8(impl->idbObjectStore(), creationContext, isolate); |
85 case IDBAny::IDBTransactionType: | 85 case IDBAny::IDBTransactionType: |
86 return toV8(impl->idbTransaction(), creationContext, isolate); | 86 return toV8(impl->idbTransaction(), creationContext, isolate); |
87 case IDBAny::ScriptValueType: | 87 case IDBAny::ScriptValueType: |
88 return impl->scriptValue().v8Value(); | 88 return impl->scriptValue().v8Value(); |
89 case IDBAny::StringType: | 89 case IDBAny::StringType: |
90 return v8String(impl->string(), isolate); | 90 return v8String(impl->string(), isolate); |
91 case IDBAny::IntegerType: | 91 case IDBAny::IntegerType: |
92 return v8::Number::New(isolate, impl->integer()); | 92 return v8::Number::New(isolate, impl->integer()); |
93 case IDBAny::KeyPathType: | 93 case IDBAny::KeyPathType: |
94 return toV8(impl->keyPath(), creationContext, isolate); | 94 return toV8(impl->keyPath(), creationContext, isolate); |
95 } | 95 } |
96 | 96 |
97 ASSERT_NOT_REACHED(); | 97 ASSERT_NOT_REACHED(); |
98 return v8::Undefined(); | 98 return v8::Undefined(isolate); |
99 } | 99 } |
100 | 100 |
101 } // namespace WebCore | 101 } // namespace WebCore |
OLD | NEW |