| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 433 |
| 434 ScriptValue deserializeScriptValue(ScriptState* scriptState, SerializedScriptVal
ue* serializedValue, const Vector<blink::WebBlobInfo>* blobInfo) | 434 ScriptValue deserializeScriptValue(ScriptState* scriptState, SerializedScriptVal
ue* serializedValue, const Vector<blink::WebBlobInfo>* blobInfo) |
| 435 { | 435 { |
| 436 v8::Isolate* isolate = scriptState->isolate(); | 436 v8::Isolate* isolate = scriptState->isolate(); |
| 437 v8::HandleScope handleScope(isolate); | 437 v8::HandleScope handleScope(isolate); |
| 438 if (serializedValue) | 438 if (serializedValue) |
| 439 return ScriptValue(scriptState, serializedValue->deserialize(isolate, 0,
blobInfo)); | 439 return ScriptValue(scriptState, serializedValue->deserialize(isolate, 0,
blobInfo)); |
| 440 return ScriptValue(scriptState, v8::Null(isolate)); | 440 return ScriptValue(scriptState, v8::Null(isolate)); |
| 441 } | 441 } |
| 442 | 442 |
| 443 #ifndef NDEBUG | 443 #if ENABLE(ASSERT) |
| 444 void assertPrimaryKeyValidOrInjectable(ScriptState* scriptState, PassRefPtr<Shar
edBuffer> buffer, const Vector<blink::WebBlobInfo>* blobInfo, IDBKey* key, const
IDBKeyPath& keyPath) | 444 void assertPrimaryKeyValidOrInjectable(ScriptState* scriptState, PassRefPtr<Shar
edBuffer> buffer, const Vector<blink::WebBlobInfo>* blobInfo, IDBKey* key, const
IDBKeyPath& keyPath) |
| 445 { | 445 { |
| 446 ScriptState::Scope scope(scriptState); | 446 ScriptState::Scope scope(scriptState); |
| 447 v8::Isolate* isolate = scriptState->isolate(); | 447 v8::Isolate* isolate = scriptState->isolate(); |
| 448 ScriptValue keyValue = idbKeyToScriptValue(scriptState, key); | 448 ScriptValue keyValue = idbKeyToScriptValue(scriptState, key); |
| 449 ScriptValue scriptValue(scriptState, deserializeIDBValueBuffer(isolate, buff
er.get(), blobInfo)); | 449 ScriptValue scriptValue(scriptState, deserializeIDBValueBuffer(isolate, buff
er.get(), blobInfo)); |
| 450 | 450 |
| 451 // This assertion is about already persisted data, so allow experimental typ
es. | 451 // This assertion is about already persisted data, so allow experimental typ
es. |
| 452 const bool allowExperimentalTypes = true; | 452 const bool allowExperimentalTypes = true; |
| 453 IDBKey* expectedKey = createIDBKeyFromScriptValueAndKeyPathInternal(isolate,
scriptValue, keyPath, allowExperimentalTypes); | 453 IDBKey* expectedKey = createIDBKeyFromScriptValueAndKeyPathInternal(isolate,
scriptValue, keyPath, allowExperimentalTypes); |
| 454 ASSERT(!expectedKey || expectedKey->isEqual(key)); | 454 ASSERT(!expectedKey || expectedKey->isEqual(key)); |
| 455 | 455 |
| 456 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa
lue.v8Value(), keyPath); | 456 bool injected = injectV8KeyIntoV8Value(isolate, keyValue.v8Value(), scriptVa
lue.v8Value(), keyPath); |
| 457 ASSERT_UNUSED(injected, injected); | 457 ASSERT_UNUSED(injected, injected); |
| 458 } | 458 } |
| 459 #endif | 459 #endif |
| 460 | 460 |
| 461 } // namespace WebCore | 461 } // namespace WebCore |
| OLD | NEW |