| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 static v8::Local<v8::Value> deserializeIDBValueArray(v8::Isolate*, v8::Local<v8:
:Object> creationContext, const Vector<RefPtr<IDBValue>>*); | 62 static v8::Local<v8::Value> deserializeIDBValueArray(v8::Isolate*, v8::Local<v8:
:Object> creationContext, const Vector<RefPtr<IDBValue>>*); |
| 63 | 63 |
| 64 v8::Local<v8::Value> toV8(const IDBKeyPath& value, v8::Local<v8::Object> creatio
nContext, v8::Isolate* isolate) | 64 v8::Local<v8::Value> toV8(const IDBKeyPath& value, v8::Local<v8::Object> creatio
nContext, v8::Isolate* isolate) |
| 65 { | 65 { |
| 66 switch (value.type()) { | 66 switch (value.type()) { |
| 67 case IDBKeyPath::NullType: | 67 case IDBKeyPath::NullType: |
| 68 return v8::Null(isolate); | 68 return v8::Null(isolate); |
| 69 case IDBKeyPath::StringType: | 69 case IDBKeyPath::StringType: |
| 70 return v8String(isolate, value.string()); | 70 return v8String(isolate, value.string()); |
| 71 case IDBKeyPath::ArrayType: | 71 case IDBKeyPath::ArrayType: |
| 72 RefPtrWillBeRawPtr<DOMStringList> keyPaths = DOMStringList::create(); | 72 return toV8(value.array(), creationContext, isolate); |
| 73 for (Vector<String>::const_iterator it = value.array().begin(); it != va
lue.array().end(); ++it) | |
| 74 keyPaths->append(*it); | |
| 75 return toV8(keyPaths.release(), creationContext, isolate); | |
| 76 } | 73 } |
| 77 ASSERT_NOT_REACHED(); | 74 ASSERT_NOT_REACHED(); |
| 78 return v8::Undefined(isolate); | 75 return v8::Undefined(isolate); |
| 79 } | 76 } |
| 80 | 77 |
| 81 v8::Local<v8::Value> toV8(const IDBKey* key, v8::Local<v8::Object> creationConte
xt, v8::Isolate* isolate) | 78 v8::Local<v8::Value> toV8(const IDBKey* key, v8::Local<v8::Object> creationConte
xt, v8::Isolate* isolate) |
| 82 { | 79 { |
| 83 if (!key) { | 80 if (!key) { |
| 84 // The IndexedDB spec requires that absent keys appear as attribute | 81 // The IndexedDB spec requires that absent keys appear as attribute |
| 85 // values as undefined, rather than the more typical (for DOM) null. | 82 // values as undefined, rather than the more typical (for DOM) null. |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 ASSERT(!exceptionState.hadException()); | 528 ASSERT(!exceptionState.hadException()); |
| 532 if (expectedKey && expectedKey->isEqual(value->primaryKey())) | 529 if (expectedKey && expectedKey->isEqual(value->primaryKey())) |
| 533 return; | 530 return; |
| 534 | 531 |
| 535 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa
lue.v8Value(), value->keyPath()); | 532 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa
lue.v8Value(), value->keyPath()); |
| 536 ASSERT_UNUSED(injected, injected); | 533 ASSERT_UNUSED(injected, injected); |
| 537 } | 534 } |
| 538 #endif | 535 #endif |
| 539 | 536 |
| 540 } // namespace blink | 537 } // namespace blink |
| OLD | NEW |