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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // This appears on the |upper| and |lower| attributes of IDBKeyRange. | 86 // This appears on the |upper| and |lower| attributes of IDBKeyRange. |
87 // Spec: http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange | 87 // Spec: http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange |
88 return V8Undefined(); | 88 return V8Undefined(); |
89 } | 89 } |
90 | 90 |
91 v8::Local<v8::Context> context = isolate->GetCurrentContext(); | 91 v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
92 | 92 |
93 switch (key->GetType()) { | 93 switch (key->GetType()) { |
94 case IDBKey::kInvalidType: | 94 case IDBKey::kInvalidType: |
95 case IDBKey::kTypeEnumMax: | 95 case IDBKey::kTypeEnumMax: |
96 ASSERT_NOT_REACHED(); | 96 NOTREACHED(); |
97 return V8Undefined(); | 97 return V8Undefined(); |
98 case IDBKey::kNumberType: | 98 case IDBKey::kNumberType: |
99 return v8::Number::New(isolate, key->Number()); | 99 return v8::Number::New(isolate, key->Number()); |
100 case IDBKey::kStringType: | 100 case IDBKey::kStringType: |
101 return V8String(isolate, key->GetString()); | 101 return V8String(isolate, key->GetString()); |
102 case IDBKey::kBinaryType: | 102 case IDBKey::kBinaryType: |
103 // https://w3c.github.io/IndexedDB/#convert-a-value-to-a-key | 103 // https://w3c.github.io/IndexedDB/#convert-a-value-to-a-key |
104 return ToV8(DOMArrayBuffer::Create(reinterpret_cast<const unsigned char*>( | 104 return ToV8(DOMArrayBuffer::Create(reinterpret_cast<const unsigned char*>( |
105 key->Binary()->Data()), | 105 key->Binary()->Data()), |
106 key->Binary()->size()), | 106 key->Binary()->size()), |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 if (expected_key && expected_key->IsEqual(value->PrimaryKey())) | 667 if (expected_key && expected_key->IsEqual(value->PrimaryKey())) |
668 return; | 668 return; |
669 | 669 |
670 bool injected = InjectV8KeyIntoV8Value( | 670 bool injected = InjectV8KeyIntoV8Value( |
671 isolate, key_value.V8Value(), script_value.V8Value(), value->KeyPath()); | 671 isolate, key_value.V8Value(), script_value.V8Value(), value->KeyPath()); |
672 DCHECK(injected); | 672 DCHECK(injected); |
673 } | 673 } |
674 #endif | 674 #endif |
675 | 675 |
676 } // namespace blink | 676 } // namespace blink |
OLD | NEW |