Bug 85139 - MessagePort must set m_closed to be true at the end of MessagePort::close function
Summary: MessagePort must set m_closed to be true at the end of MessagePort::close fun...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-28 10:08 PDT by Li Yin
Modified: 2012-04-28 18:13 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.61 KB, patch)
2012-04-28 10:22 PDT, Li Yin
no flags Details | Formatted Diff | Diff
Patch (4.05 KB, patch)
2012-04-28 12:03 PDT, Li Yin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Li Yin 2012-04-28 10:08:32 PDT
In the function MessagePort::close, the "m_closed = true" must be executed at the end of function, not at the beginning.
Or, the m_entangledChannel->close() will not be executed.
And it resulted in the failure of MS bench mark messagechannel_close.htm.
You can try it from http://samples.msdn.microsoft.com/ietestcenter/WebWorkers/messagechannel_close.htm
Comment 1 Li Yin 2012-04-28 10:22:31 PDT
Created attachment 139363 [details]
Patch
Comment 2 Kentaro Hara 2012-04-28 11:15:38 PDT
Comment on attachment 139363 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=139363&action=review

The change looks reasonable. r- due to missing a test. I think this change is testable.

> Source/WebCore/ChangeLog:12
> +        No new tests. The test can be found from http://samples.msdn.microsoft.com/ietestcenter/WebWorkers/messagechannel_close.htm

Would you add the test to LayoutTests?
Comment 3 Li Yin 2012-04-28 12:03:17 PDT
Created attachment 139368 [details]
Patch
Comment 4 Li Yin 2012-04-28 12:07:42 PDT
(In reply to comment #2)
> (From update of attachment 139363 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=139363&action=review
> 
> The change looks reasonable. r- due to missing a test. I think this change is testable.
> 
> > Source/WebCore/ChangeLog:12
> > +        No new tests. The test can be found from http://samples.msdn.microsoft.com/ietestcenter/WebWorkers/messagechannel_close.htm
> 
> Would you add the test to LayoutTests?

Add the test case, please have a look, thanks.
Comment 5 Kentaro Hara 2012-04-28 12:12:51 PDT
Comment on attachment 139368 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=139368&action=review

> LayoutTests/fast/events/message-port-close.html:1
> +<body>

Nit: Shall we use a standard HTML format?

<!DOCTYPE html><html><head></head><body>...</body></html>

> LayoutTests/fast/events/message-port-close.html:4
> +<p>Test Closed MessagePort Whether Receive Message Or Not.</p>
> +<p>Should be a START message, followed with DONE.</p>
> +<pre id=log></pre>

It would be better to use js-test-pre.js and js-test-post.js. You can use a series of methods for tests (e.g. debug("..."), shouldBe("...") etc). Please look at other layout tests using them.
Comment 6 Li Yin 2012-04-28 12:18:31 PDT
(In reply to comment #5)
> (From update of attachment 139368 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=139368&action=review
> 
> > LayoutTests/fast/events/message-port-close.html:1
> > +<body>
> 
> Nit: Shall we use a standard HTML format?
> 
> <!DOCTYPE html><html><head></head><body>...</body></html>
> 
> > LayoutTests/fast/events/message-port-close.html:4
> > +<p>Test Closed MessagePort Whether Receive Message Or Not.</p>
> > +<p>Should be a START message, followed with DONE.</p>
> > +<pre id=log></pre>
> 
> It would be better to use js-test-pre.js and js-test-post.js. You can use a series of methods for tests (e.g. debug("..."), shouldBe("...") etc). Please look at other layout tests using them.

I am following the format of LayoutTests/fast/events/message-port-clone.html, it seems that all of MessagePort related test cases used this format.
Comment 7 Kentaro Hara 2012-04-28 13:26:55 PDT
Comment on attachment 139368 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=139368&action=review

>>> LayoutTests/fast/events/message-port-close.html:1
>>> +<body>
>> 
>> Nit: Shall we use a standard HTML format?
>> 
>> <!DOCTYPE html><html><head></head><body>...</body></html>
> 
> I am following the format of LayoutTests/fast/events/message-port-clone.html, it seems that all of MessagePort related test cases used this format.

Makes sense.
Comment 8 WebKit Review Bot 2012-04-28 18:13:21 PDT
Comment on attachment 139368 [details]
Patch

Clearing flags on attachment: 139368

Committed r115588: <http://trac.webkit.org/changeset/115588>
Comment 9 WebKit Review Bot 2012-04-28 18:13:26 PDT
All reviewed patches have been landed.  Closing bug.