Title: [208869] trunk/Source/WebCore
- Revision
- 208869
- Author
- cdu...@apple.com
- Date
- 2016-11-17 16:55:34 -0800 (Thu, 17 Nov 2016)
Log Message
Regression(r208672?): ASSERTION FAILED: isMainThread() in WebCore::Node::ref()
https://bugs.webkit.org/show_bug.cgi?id=164887
<rdar://problem/29319497>
Reviewed by Brady Eidson.
Restore pre-r208672 behavior where we do not ref the script execution context in the
background thread since this is unsafe. We use WTFMove(m_scriptExecutionContext)
instead of m_scriptExecutionContext.copyRef(). Before r208672, it was calling
m_scriptExecutionContext.releaseNonNull() because m_scriptExecutionContext was a
RefPtr instead of a Ref. Note that copyRef() causes 2 issues here:
1. It refs the scriptExecutionContext in a non-main thread which is unsafe and asserts.
2. The point of this postTask in the destructor is to make sure the scriptExecutionContext
gets destroyed in the main thread so we definitely want to *transfer* ownership of
m_scriptExecutionContext to the main thread, not ref it to pass it to the main thread.
No new tests, already covered by storage/websql/multiple-transactions-on-different-handles.html.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (208868 => 208869)
--- trunk/Source/WebCore/ChangeLog 2016-11-18 00:48:06 UTC (rev 208868)
+++ trunk/Source/WebCore/ChangeLog 2016-11-18 00:55:34 UTC (rev 208869)
@@ -1,3 +1,26 @@
+2016-11-17 Chris Dumez <cdu...@apple.com>
+
+ Regression(r208672?): ASSERTION FAILED: isMainThread() in WebCore::Node::ref()
+ https://bugs.webkit.org/show_bug.cgi?id=164887
+ <rdar://problem/29319497>
+
+ Reviewed by Brady Eidson.
+
+ Restore pre-r208672 behavior where we do not ref the script execution context in the
+ background thread since this is unsafe. We use WTFMove(m_scriptExecutionContext)
+ instead of m_scriptExecutionContext.copyRef(). Before r208672, it was calling
+ m_scriptExecutionContext.releaseNonNull() because m_scriptExecutionContext was a
+ RefPtr instead of a Ref. Note that copyRef() causes 2 issues here:
+ 1. It refs the scriptExecutionContext in a non-main thread which is unsafe and asserts.
+ 2. The point of this postTask in the destructor is to make sure the scriptExecutionContext
+ gets destroyed in the main thread so we definitely want to *transfer* ownership of
+ m_scriptExecutionContext to the main thread, not ref it to pass it to the main thread.
+
+ No new tests, already covered by storage/websql/multiple-transactions-on-different-handles.html.
+
+ * Modules/webdatabase/Database.cpp:
+ (WebCore::Database::~Database):
+
2016-11-17 Brady Eidson <beid...@apple.com>
Add _WKIconLoadingDelegate SPI.
Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (208868 => 208869)
--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2016-11-18 00:48:06 UTC (rev 208868)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2016-11-18 00:55:34 UTC (rev 208869)
@@ -229,7 +229,7 @@
{
// The reference to the ScriptExecutionContext needs to be cleared on the _javascript_ thread. If we're on that thread already, we can just let the RefPtr's destruction do the dereffing.
if (!m_scriptExecutionContext->isContextThread()) {
- auto passedContext = m_scriptExecutionContext.copyRef();
+ auto passedContext = WTFMove(m_scriptExecutionContext);
auto& contextRef = passedContext.get();
contextRef.postTask({ScriptExecutionContext::Task::CleanupTask, [passedContext = WTFMove(passedContext)] (ScriptExecutionContext& context) {
ASSERT_UNUSED(context, &context == passedContext.ptr());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes