RESOLVED LATER24055
Replace WorkerMessagingProxy with two separate proxy classes.
https://bugs.webkit.org/show_bug.cgi?id=24055
Summary Replace WorkerMessagingProxy with two separate proxy classes.
Jian Li
Reported 2009-02-19 22:28:48 PST
This is the second part of the work in order to split WorkerMessagingProxy into two separate proxy classes. This includes all the necessary changes to plug into two new proxy classes introduced in the first part of the work.
Attachments
Proposed Patch (48.72 KB, patch)
2009-02-19 22:30 PST, Jian Li
no flags
Proposed Patch (52.41 KB, patch)
2009-02-20 16:00 PST, Jian Li
no flags
Jian Li
Comment 1 2009-02-19 22:30:46 PST
Created attachment 27823 [details] Proposed Patch
David Levin
Comment 2 2009-02-20 01:10:09 PST
Comment on attachment 27823 [details] Proposed Patch > Index: WebCore/ChangeLog > + * GNUmakefile.am: > + * WebCore.vcproj/WebCore.vcproj: > + * WebCore.xcodeproj/project.pbxproj: missing some makefiles here. > Index: WebCore/dom/Worker.cpp > +void Worker::reportPendingActivity(bool confirmMessage, bool hasPendingActivity) WebKit eng is trying to move away from bool's to enums. I think that would be great here b/c I've found places calling this to be unreadable. Is the initial state of Worker::hasPendingActivity the same as it was before? > Index: WebCore/dom/WorkerObjectProxy.h > +#include "ScriptExecutionContext.h" How is this used in this file? > Index: WebCore/loader/WorkerThreadableLoader.cpp > - if (thisPtr->m_messagingProxy.askedToTerminate()) > + if (thisPtr->isLoaderAlive()) > return; This doesn't look like it serves the same purpose. > +void WorkerThreadableLoader::MainThreadBridge::postTaskToLoader(PassRefPtr<ScriptExecutionContext::Task>) > +{ > + // FIXME: to be implemented. > + notImplemented(); > +} I would hope that we could find a way to keep this working in WebKit at least even if it isn't cross platform (with respect to Chromium) for now. also: m_workerContext needs to be deref'ed on the worker context thread in MainThreadBridge::destroy.
Jian Li
Comment 3 2009-02-20 16:00:06 PST
Created attachment 27843 [details] Proposed Patch
Jian Li
Comment 4 2009-02-20 16:01:36 PST
(In reply to comment #2) > (From update of attachment 27823 [details] [review]) > > Index: WebCore/ChangeLog > > + * GNUmakefile.am: > > + * WebCore.vcproj/WebCore.vcproj: > > + * WebCore.xcodeproj/project.pbxproj: > missing some makefiles here. > These makefiles seem not to have all worker related files added so far. > > > > Index: WebCore/dom/Worker.cpp > > > +void Worker::reportPendingActivity(bool confirmMessage, bool hasPendingActivity) > WebKit eng is trying to move away from bool's to enums. I think that would be > great here b/c I've found places calling this to be unreadable. > > Is the initial state of Worker::hasPendingActivity the same as it was before? > Yes. > > > > Index: WebCore/dom/WorkerObjectProxy.h > > > +#include "ScriptExecutionContext.h" > How is this used in this file? > Because we need it for enum like MessageDestination and MessageSource. > > > > Index: WebCore/loader/WorkerThreadableLoader.cpp > > > - if (thisPtr->m_messagingProxy.askedToTerminate()) > > + if (thisPtr->isLoaderAlive()) > > return; > This doesn't look like it serves the same purpose. > Fixed. > > > +void WorkerThreadableLoader::MainThreadBridge::postTaskToLoader(PassRefPtr<ScriptExecutionContext::Task>) > > +{ > > + // FIXME: to be implemented. > > + notImplemented(); > > +} > I would hope that we could find a way to keep this working in WebKit at least > even if it isn't cross platform (with respect to Chromium) for now. > Fixed. > > also: > m_workerContext needs to be deref'ed on the worker context thread in > MainThreadBridge::destroy. > > Fixed.
David Levin
Comment 5 2009-02-20 16:14:42 PST
This looks good to me. There may be a lifetime issue with m_workerContext in usage in the bridge code, but I'll examine that more later as I get up tests for xhr in workers. Also as mentioned before I think we can figure out a way to make lifetime easier to understand overall. > > +void Worker::reportPendingActivity(bool confirmMessage, bool hasPendingActivity) > WebKit eng is trying to move away from bool's to enums. I think that would be > great here b/c I've found places calling this to be unreadable. It would be good to do this at some point in the future.
Alexey Proskuryakov
Comment 6 2009-02-25 02:23:42 PST
Comment on attachment 27843 [details] Proposed Patch Clearing review flag to get this out of queue.
Note You need to log in before you can comment on or make changes to this bug.