Changeset 216246 in webkit
- Timestamp:
- May 5, 2017, 9:14:49 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r216240 r216246 1 2017-05-04 Mark Lam <mark.lam@apple.com> 2 3 DRT's setAudioResultCallback() and IDBRequest::setResult() need to acquire the JSLock. 4 https://bugs.webkit.org/show_bug.cgi?id=171716 5 <rdar://problem/30878027> 6 7 Reviewed by Saam Barati. 8 9 No new tests. This issue was caught by existing tests. 10 11 IDBRequest::setResult() needs to acquire the JSLock before calling toJS() (which 12 does JS conversion and therefore, potentially JS allocations). 13 14 * Modules/indexeddb/IDBRequest.cpp: 15 (WebCore::IDBRequest::setResult): 16 (WebCore::IDBRequest::setResultToStructuredClone): 17 1 18 2017-05-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
r212207 r216246 1 1 /* 2 * Copyright (C) 2015 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2015-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 371 371 // FIXME: This conversion should be done lazily, when script needs the JSValues, so that global object 372 372 // of the IDBRequest wrapper can be used, rather than the lexicalGlobalObject. 373 m_result = Result { JSC::Strong<JSC::Unknown> { context->vm(), toJS<IDLIDBKeyData>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), keyData) } }; 373 VM& vm = context->vm(); 374 JSLockHolder lock(vm); 375 m_result = Result { JSC::Strong<JSC::Unknown> { vm, toJS<IDLIDBKeyData>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), keyData) } }; 374 376 } 375 377 … … 388 390 // FIXME: This conversion should be done lazily, when script needs the JSValues, so that global object 389 391 // of the IDBRequest wrapper can be used, rather than the lexicalGlobalObject. 390 Locker<JSLock> locker(context->vm().apiLock()); 391 m_result = Result { JSC::Strong<JSC::Unknown> { context->vm(), toJS<IDLSequence<IDLIDBKeyData>>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), keyDatas) } }; 392 VM& vm = context->vm(); 393 JSLockHolder lock(vm); 394 m_result = Result { JSC::Strong<JSC::Unknown> { vm, toJS<IDLSequence<IDLIDBKeyData>>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), keyDatas) } }; 392 395 } 393 396 … … 406 409 // FIXME: This conversion should be done lazily, when script needs the JSValues, so that global object 407 410 // of the IDBRequest wrapper can be used, rather than the lexicalGlobalObject. 408 Locker<JSLock> locker(context->vm().apiLock()); 409 m_result = Result { JSC::Strong<JSC::Unknown> { context->vm(), toJS<IDLSequence<IDLIDBValue>>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), values) } }; 411 VM& vm = context->vm(); 412 JSLockHolder lock(vm); 413 m_result = Result { JSC::Strong<JSC::Unknown> { vm, toJS<IDLSequence<IDLIDBValue>>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), values) } }; 410 414 } 411 415 … … 437 441 // FIXME: This conversion should be done lazily, when script needs the JSValues, so that global object 438 442 // of the IDBRequest wrapper can be used, rather than the lexicalGlobalObject. 439 m_result = Result { JSC::Strong<JSC::Unknown> { context->vm(), toJS<IDLIDBValue>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), value) } }; 443 VM& vm = context->vm(); 444 JSLockHolder lock(vm); 445 m_result = Result { JSC::Strong<JSC::Unknown> { vm, toJS<IDLIDBValue>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), value) } }; 440 446 } 441 447 -
trunk/Tools/ChangeLog
r216244 r216246 1 2017-05-04 Mark Lam <mark.lam@apple.com> 2 3 DRT's setAudioResultCallback() and IDBRequest::setResult() need to acquire the JSLock. 4 https://bugs.webkit.org/show_bug.cgi?id=171716 5 <rdar://problem/30878027> 6 7 Reviewed by Saam Barati. 8 9 setAudioResultCallback() needs to acquire the JSLock before calling toJS() (which 10 does JS conversion and therefore, potentially JS allocations) and accessing 11 methods of internal JS data structures (which may do JS invocation, etc). 12 13 * DumpRenderTree/TestRunner.cpp: 14 (setAudioResultCallback): 15 1 16 2017-05-05 Jonathan Bedard <jbedard@apple.com> 2 17 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r216219 r216246 348 348 349 349 // FIXME (123058): Use a JSC API to get buffer contents once such is exposed. 350 JSC::JSArrayBufferView* jsBufferView = JSC::jsDynamicCast<JSC::JSArrayBufferView*>(toJS(context)->vm(), toJS(toJS(context), arguments[0])); 350 JSC::VM& vm = toJS(context)->vm(); 351 JSC::JSLockHolder lock(vm); 352 353 JSC::JSArrayBufferView* jsBufferView = JSC::jsDynamicCast<JSC::JSArrayBufferView*>(vm, toJS(toJS(context), arguments[0])); 351 354 ASSERT(jsBufferView); 352 355 RefPtr<JSC::ArrayBufferView> bufferView = jsBufferView->unsharedImpl();
Note:
See TracChangeset
for help on using the changeset viewer.