Title: [198371] trunk/Source/WebCore
Revision
198371
Author
[email protected]
Date
2016-03-17 18:13:43 -0700 (Thu, 17 Mar 2016)

Log Message

Unreviewed, rolling out r198335.
https://bugs.webkit.org/show_bug.cgi?id=155617

This change caused existing LayoutTests to crash
intermittently (Requested by ryan|afk on #webkit).

Reverted changeset:

"DataURLDecoder::DecodingResultDispatcher may get deleted
outside main thread"
https://bugs.webkit.org/show_bug.cgi?id=155584
http://trac.webkit.org/changeset/198335

Patch by Commit Queue <[email protected]> on 2016-03-17

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (198370 => 198371)


--- trunk/Source/WebCore/ChangeLog	2016-03-18 01:12:47 UTC (rev 198370)
+++ trunk/Source/WebCore/ChangeLog	2016-03-18 01:13:43 UTC (rev 198371)
@@ -1,3 +1,18 @@
+2016-03-17  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r198335.
+        https://bugs.webkit.org/show_bug.cgi?id=155617
+
+        This change caused existing LayoutTests to crash
+        intermittently (Requested by ryan|afk on #webkit).
+
+        Reverted changeset:
+
+        "DataURLDecoder::DecodingResultDispatcher may get deleted
+        outside main thread"
+        https://bugs.webkit.org/show_bug.cgi?id=155584
+        http://trac.webkit.org/changeset/198335
+
 2016-03-17  Eric Carlson  <[email protected]>
 
         Improve some metadata tests

Modified: trunk/Source/WebCore/platform/network/DataURLDecoder.cpp (198370 => 198371)


--- trunk/Source/WebCore/platform/network/DataURLDecoder.cpp	2016-03-18 01:12:47 UTC (rev 198370)
+++ trunk/Source/WebCore/platform/network/DataURLDecoder.cpp	2016-03-18 01:13:43 UTC (rev 198371)
@@ -56,12 +56,11 @@
 
 #if HAVE(RUNLOOP_TIMER)
 
-class DecodingResultDispatcher {
-    WTF_MAKE_FAST_ALLOCATED;
+class DecodingResultDispatcher : public ThreadSafeRefCounted<DecodingResultDispatcher> {
 public:
     static void dispatch(std::unique_ptr<DecodeTask> decodeTask)
     {
-        auto* dispatcher = new DecodingResultDispatcher(WTFMove(decodeTask));
+        Ref<DecodingResultDispatcher> dispatcher = adoptRef(*new DecodingResultDispatcher(WTFMove(decodeTask)));
         dispatcher->startTimer();
     }
 
@@ -74,6 +73,8 @@
 
     void startTimer()
     {
+        // Keep alive until the timer has fired.
+        ref();
         m_timer.startOneShot(0);
         m_timer.schedule(m_decodeTask->scheduleContext.scheduledPairs);
     }
@@ -85,7 +86,7 @@
         else
             m_decodeTask->completionHandler({ });
 
-        delete this;
+        deref();
     }
 
     RunLoopTimer<DecodingResultDispatcher> m_timer;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to