[Webkit-unassigned] [Bug 24152] Move the logic to do the unconfirmed message count and pending activity setting from WorkerMessagingProxy to Worker.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 27 09:07:53 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=24152





------- Comment #15 from jianli at chromium.org  2009-02-27 09:07 PDT -------
(In reply to comment #13)
> (From update of attachment 28016 [review])
> +    bool hasPendingActivity = !m_askedToTerminate &&
> (m_unconfirmedMessageCount || m_workerContextHadPendingActivity);
> +    return hasPendingActivity || ActiveDOMObject::hasPendingActivity();
> 
> This variable name is not helpful. I suggest workerContextHasPendingActivity.

Changed.
> 
> +        bool m_askedToTerminate;
> 
> Why duplicate this member variable in Worker when it's already available in the
> proxy?

Yes, it is already available in the proxy. However it is not exposed in
WorkerContextProxy which is the interface Worker knows about. So I have to
duplicate the logic.
> 
> -        m_unconfirmedMessageCount = taskCount;
> -        m_workerThreadHadPendingActivity = true; // Worker initialization
> means a pending activity.
> +        m_workerObject->reportPendingActivity(false, true); // Worker
> initialization means a pending activity.
> 
> This patch makes workers that failed to load leak. Previously,
> m_unconfirmedMessageCount was only set to non-zero after creating the thread,
> so messages posted to a worker that never spawned a thread didn't count as
> activity. Consider the following test:
> 
> var worker = new Worker("does-not-exist.js");
> worker.postMessage(...);
> worker = null;
> 
Good catch. I added the check for this.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list