Changeset 163810 in webkit
- Timestamp:
- Feb 10, 2014, 1:37:00 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163807 r163810 1 2014-02-10 Alexey Proskuryakov <ap@apple.com> 2 3 Remove some unused functions from SerializedScriptValue 4 https://bugs.webkit.org/show_bug.cgi?id=128407 5 6 Reviewed by Oliver Hunt. 7 8 Removed functions that used Deprecated::ScriptValue 9 10 * Modules/indexeddb/IDBObjectStore.cpp: 11 (WebCore::IDBObjectStore::put): 12 * bindings/js/IDBBindingUtilities.cpp: 13 (WebCore::deserializeIDBValue): 14 (WebCore::deserializeIDBValueBuffer): 15 * bindings/js/SerializedScriptValue.cpp: 16 * bindings/js/SerializedScriptValue.h: 17 1 18 2014-02-10 Roger Fong <roger_fong@apple.com> 2 19 -
trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
r163732 r163810 133 133 if (m_deleted) { 134 134 ec = IDBDatabaseException::InvalidStateError; 135 return 0;136 } 137 if (!m_transaction->isActive()) { 138 ec = IDBDatabaseException::TransactionInactiveError; 139 return 0;135 return nullptr; 136 } 137 if (!m_transaction->isActive()) { 138 ec = IDBDatabaseException::TransactionInactiveError; 139 return nullptr; 140 140 } 141 141 if (m_transaction->isReadOnly()) { 142 142 ec = IDBDatabaseException::ReadOnlyError; 143 return 0; 144 } 145 146 // FIXME: Expose the JS engine exception state through ScriptState. 147 bool didThrow = false; 148 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(value, state, nullptr, nullptr, didThrow); 149 if (didThrow) { 150 // Setting an explicit ExceptionCode here would defer handling the already thrown exception. 151 return 0; 152 } 143 return nullptr; 144 } 145 146 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(state, value.jsValue(), nullptr, nullptr); 147 if (state->hadException()) 148 return nullptr; 153 149 154 150 if (serializedValue->blobURLs().size() > 0) { 155 151 // FIXME: Add Blob/File/FileList support 156 152 ec = IDBDatabaseException::DataCloneError; 157 return 0;153 return nullptr; 158 154 } 159 155 … … 167 163 if (putMode != IDBDatabaseBackend::CursorUpdate && usesInLineKeys && key) { 168 164 ec = IDBDatabaseException::DataError; 169 return 0;165 return nullptr; 170 166 } 171 167 if (!usesInLineKeys && !hasKeyGenerator && !key) { 172 168 ec = IDBDatabaseException::DataError; 173 return 0;169 return nullptr; 174 170 } 175 171 if (usesInLineKeys) { … … 177 173 if (keyPathKey && !keyPathKey->isValid()) { 178 174 ec = IDBDatabaseException::DataError; 179 return 0;175 return nullptr; 180 176 } 181 177 if (!hasKeyGenerator && !keyPathKey) { 182 178 ec = IDBDatabaseException::DataError; 183 return 0;179 return nullptr; 184 180 } 185 181 if (hasKeyGenerator && !keyPathKey) { 186 182 if (!canInjectIDBKeyIntoScriptValue(&requestState, value, keyPath)) { 187 183 ec = IDBDatabaseException::DataError; 188 return 0;184 return nullptr; 189 185 } 190 186 } … … 194 190 if (key && !key->isValid()) { 195 191 ec = IDBDatabaseException::DataError; 196 return 0;192 return nullptr; 197 193 } 198 194 -
trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp
r163662 r163810 300 300 ExecState* exec = requestState->exec(); 301 301 RefPtr<SerializedScriptValue> serializedValue = prpValue; 302 JSValue result; 302 303 if (serializedValue) 303 return SerializedScriptValue::deserialize(exec, serializedValue.get(), NonThrowing); 304 return Deprecated::ScriptValue(exec->vm(), jsNull()); 304 result = serializedValue->deserialize(exec, exec->lexicalGlobalObject(), 0); 305 else 306 result = jsNull(); 307 return Deprecated::ScriptValue(exec->vm(), result); 305 308 } 306 309 … … 325 328 } 326 329 330 JSValue result; 327 331 if (buffer.size()) { 328 332 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::createFromWireBytes(buffer); 329 return SerializedScriptValue::deserialize(exec, serializedValue.get(), NonThrowing); 330 } 331 332 return Deprecated::ScriptValue(exec->vm(), jsNull()); 333 result = serializedValue->deserialize(exec, exec->lexicalGlobalObject(), 0, NonThrowing); 334 } else 335 result = jsNull(); 336 337 return Deprecated::ScriptValue(exec->vm(), result); 333 338 } 334 339 -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r163732 r163810 2617 2617 } 2618 2618 2619 PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(const Deprecated::ScriptValue& value, JSC::ExecState* scriptState, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, bool& didThrow)2620 {2621 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(scriptState, value.jsValue(), messagePorts, arrayBuffers);2622 didThrow = scriptState->hadException();2623 return serializedValue.release();2624 }2625 2626 Deprecated::ScriptValue SerializedScriptValue::deserialize(JSC::ExecState* scriptState, SerializedScriptValue* value, SerializationErrorMode throwExceptions)2627 {2628 return Deprecated::ScriptValue(scriptState->vm(), value->deserialize(scriptState, scriptState->lexicalGlobalObject(), 0, throwExceptions));2629 }2630 2631 2619 void SerializedScriptValue::maybeThrowExceptionIfSerializationFailed(ExecState* exec, SerializationReturnCode code) 2632 2620 { -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.h
r163732 r163810 80 80 JSC::JSValue deserialize(JSC::ExecState*, JSC::JSGlobalObject*, MessagePortArray*, SerializationErrorMode = Throwing); 81 81 82 static PassRefPtr<SerializedScriptValue> create(const Deprecated::ScriptValue&, JSC::ExecState*, MessagePortArray*, ArrayBufferArray*, bool& didThrow);83 static Deprecated::ScriptValue deserialize(JSC::ExecState*, SerializedScriptValue*, SerializationErrorMode = Throwing);84 85 82 static uint32_t wireFormatVersion(); 86 83
Note:
See TracChangeset
for help on using the changeset viewer.