| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 static v8::Handle<v8::Value> deserializeIDBValueBuffer(SharedBuffer* buffer, v8:
:Isolate* isolate) | 352 static v8::Handle<v8::Value> deserializeIDBValueBuffer(SharedBuffer* buffer, v8:
:Isolate* isolate) |
| 353 { | 353 { |
| 354 ASSERT(isolate->InContext()); | 354 ASSERT(isolate->InContext()); |
| 355 if (!buffer) | 355 if (!buffer) |
| 356 return v8::Null(isolate); | 356 return v8::Null(isolate); |
| 357 | 357 |
| 358 // FIXME: The extra copy here can be eliminated by allowing SerializedScript
Value to take a raw const char* or const uint8_t*. | 358 // FIXME: The extra copy here can be eliminated by allowing SerializedScript
Value to take a raw const char* or const uint8_t*. |
| 359 Vector<uint8_t> value; | 359 Vector<uint8_t> value; |
| 360 value.append(buffer->data(), buffer->size()); | 360 value.append(buffer->data(), buffer->size()); |
| 361 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::creat
eFromWireBytes(value); | 361 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::creat
eFromWireBytes(value); |
| 362 return serializedValue->deserialize(isolate); | 362 return serializedValue->deserialize(isolate, 0, 0); |
| 363 } | 363 } |
| 364 | 364 |
| 365 bool injectV8KeyIntoV8Value(v8::Handle<v8::Value> key, v8::Handle<v8::Value> val
ue, const IDBKeyPath& keyPath, v8::Isolate* isolate) | 365 bool injectV8KeyIntoV8Value(v8::Handle<v8::Value> key, v8::Handle<v8::Value> val
ue, const IDBKeyPath& keyPath, v8::Isolate* isolate) |
| 366 { | 366 { |
| 367 IDB_TRACE("injectIDBV8KeyIntoV8Value"); | 367 IDB_TRACE("injectIDBV8KeyIntoV8Value"); |
| 368 ASSERT(isolate->InContext()); | 368 ASSERT(isolate->InContext()); |
| 369 | 369 |
| 370 ASSERT(keyPath.type() == IDBKeyPath::StringType); | 370 ASSERT(keyPath.type() == IDBKeyPath::StringType); |
| 371 Vector<String> keyPathElements; | 371 Vector<String> keyPathElements; |
| 372 IDBKeyPathParseError error; | 372 IDBKeyPathParseError error; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 const bool allowExperimentalTypes = true; | 455 const bool allowExperimentalTypes = true; |
| 456 RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(scriptVal
ue, keyPath, isolate, allowExperimentalTypes); | 456 RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(scriptVal
ue, keyPath, isolate, allowExperimentalTypes); |
| 457 ASSERT(!expectedKey || expectedKey->isEqual(key.get())); | 457 ASSERT(!expectedKey || expectedKey->isEqual(key.get())); |
| 458 | 458 |
| 459 bool injected = injectV8KeyIntoV8Value(keyValue.v8Value(), scriptValue.v8Val
ue(), keyPath, isolate); | 459 bool injected = injectV8KeyIntoV8Value(keyValue.v8Value(), scriptValue.v8Val
ue(), keyPath, isolate); |
| 460 ASSERT_UNUSED(injected, injected); | 460 ASSERT_UNUSED(injected, injected); |
| 461 } | 461 } |
| 462 #endif | 462 #endif |
| 463 | 463 |
| 464 } // namespace WebCore | 464 } // namespace WebCore |
| OLD | NEW |