| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // values as undefined, rather than the more typical (for DOM) null. | 89 // values as undefined, rather than the more typical (for DOM) null. |
| 90 // This appears on the |upper| and |lower| attributes of IDBKeyRange. | 90 // This appears on the |upper| and |lower| attributes of IDBKeyRange. |
| 91 // Spec: http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange | 91 // Spec: http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange |
| 92 return v8Undefined(); | 92 return v8Undefined(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 v8::Local<v8::Context> context = isolate->GetCurrentContext(); | 95 v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
| 96 | 96 |
| 97 switch (key->getType()) { | 97 switch (key->getType()) { |
| 98 case IDBKey::InvalidType: | 98 case IDBKey::InvalidType: |
| 99 case IDBKey::MinType: | 99 case IDBKey::TypeEnumMax: |
| 100 ASSERT_NOT_REACHED(); | 100 ASSERT_NOT_REACHED(); |
| 101 return v8Undefined(); | 101 return v8Undefined(); |
| 102 case IDBKey::NumberType: | 102 case IDBKey::NumberType: |
| 103 return v8::Number::New(isolate, key->number()); | 103 return v8::Number::New(isolate, key->number()); |
| 104 case IDBKey::StringType: | 104 case IDBKey::StringType: |
| 105 return v8String(isolate, key->string()); | 105 return v8String(isolate, key->string()); |
| 106 case IDBKey::BinaryType: | 106 case IDBKey::BinaryType: |
| 107 // Experimental feature: binary keys | 107 // Experimental feature: binary keys |
| 108 // https://w3c.github.io/IndexedDB/#steps-to-convert-a-key-to-a-value | 108 // https://w3c.github.io/IndexedDB/#steps-to-convert-a-key-to-a-value |
| 109 return ToV8(DOMArrayBuffer::create(reinterpret_cast<const unsigned char*>( | 109 return ToV8(DOMArrayBuffer::create(reinterpret_cast<const unsigned char*>( |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 if (expectedKey && expectedKey->isEqual(value->primaryKey())) | 617 if (expectedKey && expectedKey->isEqual(value->primaryKey())) |
| 618 return; | 618 return; |
| 619 | 619 |
| 620 bool injected = injectV8KeyIntoV8Value( | 620 bool injected = injectV8KeyIntoV8Value( |
| 621 isolate, keyValue.v8Value(), scriptValue.v8Value(), value->keyPath()); | 621 isolate, keyValue.v8Value(), scriptValue.v8Value(), value->keyPath()); |
| 622 DCHECK(injected); | 622 DCHECK(injected); |
| 623 } | 623 } |
| 624 #endif | 624 #endif |
| 625 | 625 |
| 626 } // namespace blink | 626 } // namespace blink |
| OLD | NEW |