| Index: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
|
| index f2a8be4e39a38c7f30aafb55075aec6c9dd5f064..a8ef6189e2196ee21dc12aa38420120d348559fc 100644
|
| --- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
|
| +++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
|
| @@ -57,10 +57,6 @@ namespace blink {
|
|
|
| static v8::Local<v8::Value> deserializeIDBValueData(v8::Isolate*,
|
| const IDBValue*);
|
| -static v8::Local<v8::Value> deserializeIDBValue(
|
| - v8::Isolate*,
|
| - v8::Local<v8::Object> creationContext,
|
| - const IDBValue*);
|
| static v8::Local<v8::Value> deserializeIDBValueArray(
|
| v8::Isolate*,
|
| v8::Local<v8::Object> creationContext,
|
| @@ -394,16 +390,21 @@ static v8::Local<v8::Value> deserializeIDBValueData(v8::Isolate* isolate,
|
| }
|
|
|
| // Deserialize the entire IDBValue (injecting key & keypath if present).
|
| -static v8::Local<v8::Value> deserializeIDBValue(
|
| - v8::Isolate* isolate,
|
| - v8::Local<v8::Object> creationContext,
|
| - const IDBValue* value) {
|
| +v8::Local<v8::Value> deserializeIDBValue(v8::Isolate* isolate,
|
| + v8::Local<v8::Object> creationContext,
|
| + const IDBValue* value) {
|
| ASSERT(isolate->InContext());
|
| if (!value || value->isNull())
|
| return v8::Null(isolate);
|
|
|
| v8::Local<v8::Value> v8Value = deserializeIDBValueData(isolate, value);
|
| - if (value->primaryKey()) {
|
| +
|
| + // De-serialization failures are currently handled by returning null. This is
|
| + // sub-optimal, as it can cause IndexedDB to return incorrect data. The check
|
| + // below is the minimal work needed to avoid a crash. A proper solution would
|
| + // require SerializedScriptValue to throw rather than returning null when it
|
| + // encounters errors.
|
| + if (value->primaryKey() && !v8Value->IsNull()) {
|
| v8::Local<v8::Value> key =
|
| ToV8(value->primaryKey(), creationContext, isolate);
|
| if (key.IsEmpty())
|
|
|