Title: [88529] trunk/Source/WebKit/chromium
Revision
88529
Author
[email protected]
Date
2011-06-10 00:35:55 -0700 (Fri, 10 Jun 2011)

Log Message

2011-06-09  Yury Semikhatsky  <[email protected]>

        Reviewed by Dmitry Titov.

        [Chromium] Worker object may be garbage collected even if it has message handlers
        https://bugs.webkit.org/show_bug.cgi?id=62292

        I'd like to convert the test case into a layout test but I don't see yet
        how to do this so that the test isn't too slow and reliable. The problem
        with test is that full-GC needs to be triggered right after
        WebWorkerClientImpl::confirmMessageFromWorkerObject is called and there
        is no way to hook WebWorkerClientImpl::confirmMessageFromWorkerObject from _javascript_.
        So no test for now.

        * src/WebWorkerClientImpl.cpp:
        (WebKit::WebWorkerClientImpl::confirmMessageFromWorkerObject):
        (WebKit::WebWorkerClientImpl::confirmMessageFromWorkerObjectTask): update worker context pending
        activity state every time a message is confirmed since the message may have created a new activity.
        * src/WebWorkerClientImpl.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (88528 => 88529)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-06-10 07:10:53 UTC (rev 88528)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-06-10 07:35:55 UTC (rev 88529)
@@ -1,3 +1,23 @@
+2011-06-09  Yury Semikhatsky  <[email protected]>
+
+        Reviewed by Dmitry Titov.
+
+        [Chromium] Worker object may be garbage collected even if it has message handlers
+        https://bugs.webkit.org/show_bug.cgi?id=62292
+
+        I'd like to convert the test case into a layout test but I don't see yet
+        how to do this so that the test isn't too slow and reliable. The problem
+        with test is that full-GC needs to be triggered right after
+        WebWorkerClientImpl::confirmMessageFromWorkerObject is called and there
+        is no way to hook WebWorkerClientImpl::confirmMessageFromWorkerObject from _javascript_.
+        So no test for now.
+
+        * src/WebWorkerClientImpl.cpp:
+        (WebKit::WebWorkerClientImpl::confirmMessageFromWorkerObject):
+        (WebKit::WebWorkerClientImpl::confirmMessageFromWorkerObjectTask): update worker context pending
+        activity state every time a message is confirmed since the message may have created a new activity.
+        * src/WebWorkerClientImpl.h:
+
 2011-06-09  James Kozianski  <[email protected]>
 
         Unreviewed, rolling out r88466.

Modified: trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp (88528 => 88529)


--- trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp	2011-06-10 07:10:53 UTC (rev 88528)
+++ trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp	2011-06-10 07:35:55 UTC (rev 88529)
@@ -318,7 +318,8 @@
     // accessed.  Otherwise there are race conditions with v8's garbage
     // collection.
     m_scriptExecutionContext->postTask(createCallbackTask(&confirmMessageFromWorkerObjectTask,
-                                                          AllowCrossThreadAccess(this)));
+                                                          AllowCrossThreadAccess(this),
+                                                          hasPendingActivity));
 }
 
 void WebWorkerClientImpl::reportPendingActivity(bool hasPendingActivity)
@@ -432,9 +433,11 @@
 }
 
 void WebWorkerClientImpl::confirmMessageFromWorkerObjectTask(ScriptExecutionContext* context,
-                                                             WebWorkerClientImpl* thisPtr)
+                                                             WebWorkerClientImpl* thisPtr,
+                                                             bool hasPendingActivity)
 {
     thisPtr->m_unconfirmedMessageCount--;
+    thisPtr->m_workerContextHadPendingActivity = hasPendingActivity;
 }
 
 void WebWorkerClientImpl::reportPendingActivityTask(ScriptExecutionContext* context,

Modified: trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.h (88528 => 88529)


--- trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.h	2011-06-10 07:10:53 UTC (rev 88528)
+++ trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.h	2011-06-10 07:35:55 UTC (rev 88529)
@@ -153,7 +153,8 @@
                                                      int lineNumber,
                                                      const WTF::String& sourceURL);
     static void confirmMessageFromWorkerObjectTask(WebCore::ScriptExecutionContext* context,
-                                                   WebWorkerClientImpl* thisPtr);
+                                                   WebWorkerClientImpl* thisPtr,
+                                                   bool hasPendingActivity);
     static void reportPendingActivityTask(WebCore::ScriptExecutionContext* context,
                                           WebWorkerClientImpl* thisPtr,
                                           bool hasPendingActivity);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to