| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "bindings/v8/IDBBindingUtilities.h" | 27 #include "bindings/v8/IDBBindingUtilities.h" |
| 28 | 28 |
| 29 #include "RuntimeEnabledFeatures.h" | 29 #include "RuntimeEnabledFeatures.h" |
| 30 #include "V8DOMStringList.h" | 30 #include "V8DOMStringList.h" |
| 31 #include "V8HiddenPropertyName.h" | |
| 32 #include "V8IDBCursor.h" | 31 #include "V8IDBCursor.h" |
| 33 #include "V8IDBCursorWithValue.h" | 32 #include "V8IDBCursorWithValue.h" |
| 34 #include "V8IDBDatabase.h" | 33 #include "V8IDBDatabase.h" |
| 35 #include "V8IDBIndex.h" | 34 #include "V8IDBIndex.h" |
| 36 #include "V8IDBKeyRange.h" | 35 #include "V8IDBKeyRange.h" |
| 37 #include "V8IDBObjectStore.h" | 36 #include "V8IDBObjectStore.h" |
| 38 #include "V8IDBRequest.h" | 37 #include "V8IDBRequest.h" |
| 39 #include "V8IDBTransaction.h" | 38 #include "V8IDBTransaction.h" |
| 40 #include "bindings/v8/DOMRequestState.h" | 39 #include "bindings/v8/DOMRequestState.h" |
| 41 #include "bindings/v8/SerializedScriptValue.h" | 40 #include "bindings/v8/SerializedScriptValue.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return v8::Undefined(isolate); | 116 return v8::Undefined(isolate); |
| 118 case IDBAny::NullType: | 117 case IDBAny::NullType: |
| 119 return v8::Null(isolate); | 118 return v8::Null(isolate); |
| 120 case IDBAny::DOMStringListType: | 119 case IDBAny::DOMStringListType: |
| 121 return toV8(impl->domStringList(), creationContext, isolate); | 120 return toV8(impl->domStringList(), creationContext, isolate); |
| 122 case IDBAny::IDBCursorType: { | 121 case IDBAny::IDBCursorType: { |
| 123 // Ensure request wrapper is kept alive at least as long as the cursor w
rapper, | 122 // Ensure request wrapper is kept alive at least as long as the cursor w
rapper, |
| 124 // so that event listeners are retained. | 123 // so that event listeners are retained. |
| 125 v8::Handle<v8::Value> cursor = toV8(impl->idbCursor(), creationContext,
isolate); | 124 v8::Handle<v8::Value> cursor = toV8(impl->idbCursor(), creationContext,
isolate); |
| 126 v8::Handle<v8::Value> request = toV8(impl->idbCursor()->request(), creat
ionContext, isolate); | 125 v8::Handle<v8::Value> request = toV8(impl->idbCursor()->request(), creat
ionContext, isolate); |
| 127 cursor->ToObject()->SetHiddenValue(V8HiddenPropertyName::idbCursorReques
t(isolate), request); | 126 setHiddenValue(isolate, cursor->ToObject(), "idbCursorRequest", request)
; |
| 128 return cursor; | 127 return cursor; |
| 129 } | 128 } |
| 130 case IDBAny::IDBCursorWithValueType: { | 129 case IDBAny::IDBCursorWithValueType: { |
| 131 // Ensure request wrapper is kept alive at least as long as the cursor w
rapper, | 130 // Ensure request wrapper is kept alive at least as long as the cursor w
rapper, |
| 132 // so that event listeners are retained. | 131 // so that event listeners are retained. |
| 133 v8::Handle<v8::Value> cursor = toV8(impl->idbCursorWithValue(), creation
Context, isolate); | 132 v8::Handle<v8::Value> cursor = toV8(impl->idbCursorWithValue(), creation
Context, isolate); |
| 134 v8::Handle<v8::Value> request = toV8(impl->idbCursorWithValue()->request
(), creationContext, isolate); | 133 v8::Handle<v8::Value> request = toV8(impl->idbCursorWithValue()->request
(), creationContext, isolate); |
| 135 cursor->ToObject()->SetHiddenValue(V8HiddenPropertyName::idbCursorReques
t(isolate), request); | 134 setHiddenValue(isolate, cursor->ToObject(), "idbCursorRequest", request)
; |
| 136 return cursor; | 135 return cursor; |
| 137 } | 136 } |
| 138 case IDBAny::IDBDatabaseType: | 137 case IDBAny::IDBDatabaseType: |
| 139 return toV8(impl->idbDatabase(), creationContext, isolate); | 138 return toV8(impl->idbDatabase(), creationContext, isolate); |
| 140 case IDBAny::IDBIndexType: | 139 case IDBAny::IDBIndexType: |
| 141 return toV8(impl->idbIndex(), creationContext, isolate); | 140 return toV8(impl->idbIndex(), creationContext, isolate); |
| 142 case IDBAny::IDBObjectStoreType: | 141 case IDBAny::IDBObjectStoreType: |
| 143 return toV8(impl->idbObjectStore(), creationContext, isolate); | 142 return toV8(impl->idbObjectStore(), creationContext, isolate); |
| 144 case IDBAny::IDBTransactionType: | 143 case IDBAny::IDBTransactionType: |
| 145 return toV8(impl->idbTransaction(), creationContext, isolate); | 144 return toV8(impl->idbTransaction(), creationContext, isolate); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 const bool allowExperimentalTypes = true; | 456 const bool allowExperimentalTypes = true; |
| 458 RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(scriptVal
ue, keyPath, isolate, allowExperimentalTypes); | 457 RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(scriptVal
ue, keyPath, isolate, allowExperimentalTypes); |
| 459 ASSERT(!expectedKey || expectedKey->isEqual(key.get())); | 458 ASSERT(!expectedKey || expectedKey->isEqual(key.get())); |
| 460 | 459 |
| 461 bool injected = injectV8KeyIntoV8Value(keyValue.v8Value(), scriptValue.v8Val
ue(), keyPath, isolate); | 460 bool injected = injectV8KeyIntoV8Value(keyValue.v8Value(), scriptValue.v8Val
ue(), keyPath, isolate); |
| 462 ASSERT_UNUSED(injected, injected); | 461 ASSERT_UNUSED(injected, injected); |
| 463 } | 462 } |
| 464 #endif | 463 #endif |
| 465 | 464 |
| 466 } // namespace WebCore | 465 } // namespace WebCore |
| OLD | NEW |