WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
23776
Introduce 2 base classes to split WorkerMessaingProxy.
https://bugs.webkit.org/show_bug.cgi?id=23776
Summary
Introduce 2 base classes to split WorkerMessaingProxy.
Jian Li
Reported
2009-02-05 18:38:55 PST
In order to support running Worker in other process, i.e. Chrome's worker process, we need to split WorkerMessagingProxy into two pieces.
Attachments
Proposed Patch
(11.37 KB, patch)
2009-02-05 18:43 PST
,
Jian Li
no flags
Details
Formatted Diff
Diff
Proposed Patch
(11.04 KB, patch)
2009-02-06 13:18 PST
,
Jian Li
no flags
Details
Formatted Diff
Diff
Proposed Patch
(10.95 KB, patch)
2009-02-06 17:40 PST
,
Jian Li
ap
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Jian Li
Comment 1
2009-02-05 18:43:55 PST
Created
attachment 27374
[details]
Proposed Patch This patch only adds these two base classes. The next patch will change WorkerMessagingProxy to derive from these two base classes.
David Levin
Comment 2
2009-02-06 02:56:44 PST
ChangeLog: WorkerMessaingProxy sp // A proxy to talk to the worker context. I'm not sure that this comment adds much info. // Creator. This comment should be omitted. static WorkerContextProxyBase* create(const String& scriptURL, Worker* worker); The param "worker" doesn't add any info so it should be omited. Also I don't think this method is implemented yet, so it probably shouldn't be here. Lastly, it bring up lifetime issues. Is this class deleted by who ever creates it. I suspect the lifetime will be more like WorkerMessagingProxy and this class will need a method like "void workerObjectDestroyed();" (something to signal the class that the WorkerObject is done with it). The per method comments throughout seem to repeat the method name and should just be omitted. The vcproj file references .cpp files that aren't part of the patch. I think GNUMakefile.am needs to have the header files added to it.
David Levin
Comment 3
2009-02-06 10:14:34 PST
I was thinking about the Base suffix. I don't think it is needed here because the classes are intended to pure virtual so there will not be a WorkerContextProxy that adds non virtual methods. It is usually used when you want a class that is non-platform specific but files need to refer to the non base version. For example, you could have "class FooBase" in platform but files in WebCore/dom would refer to class Foo and #include "foo.h" but foo.h would be in a platform specific directory like platform/win/foo.h. Lastly, if implementation of these classes is going to be platform specific, then dom isn't the correct directory for them. You'd want WebCore/platform.
David Levin
Comment 4
2009-02-06 10:56:50 PST
Actually, I take back the comment about moving them to platform because there is a dom dependency. It is fine where it is, but it will need to be moved before implementing platform specific items.
Jian Li
Comment 5
2009-02-06 13:18:52 PST
Created
attachment 27413
[details]
Proposed Patch
David Levin
Comment 6
2009-02-06 13:24:09 PST
Comment on
attachment 27374
[details]
Proposed Patch Marking as obsolete due to new patch.
David Levin
Comment 7
2009-02-06 15:16:09 PST
These issues appear unaddressed: ChangeLog: WorkerMessaingProxy sp // A proxy to talk to the worker context. I'm not sure that this comment adds much info. // Creator. This comment should be omitted. static WorkerContextProxyBase* create(const String& scriptURL, Worker* worker); The param "worker" doesn't add any info so it should be omited. Also I don't think this method is implemented yet, so it probably shouldn't be here. Lastly, it bring up lifetime issues. Is this class deleted by who ever creates it. I suspect the lifetime will be more like WorkerMessagingProxy and this class will need a method like "void workerObjectDestroyed();" (something to signal the class that the WorkerObject is done with it). The per method comments throughout seem to repeat the method name and should just be omitted. I think GNUMakefile.am needs to have the header files added to it.
Jian Li
Comment 8
2009-02-06 17:40:45 PST
Created
attachment 27441
[details]
Proposed Patch I fixed all the problems excepted those as commented below. I still keep the comment for the whole class since it clarifies what the class is intended for. I do not add workerObjectDestroyed to WorkerConextProxy class since I think we can merge it into terminateWorkerContext.
David Levin
Comment 9
2009-02-07 23:03:51 PST
Comment on
attachment 27413
[details]
Proposed Patch New patch makes this one obsolete.
David Levin
Comment 10
2009-02-07 23:08:23 PST
Looks good to me. As suggested by dimich, after this check in, I think we'll need to move this and some other worker classes to a WebCore/workers dir (and then we'll have platform specific directories under that).
Alexey Proskuryakov
Comment 11
2009-02-09 01:57:20 PST
Comment on
attachment 27441
[details]
Proposed Patch
> +namespace WebCore { > + class String;
We usually add an empty line here. + virtual void postMessageToWorkerContext(const String& message) = 0; + virtual void postMessageToWorkerObject(const String& message) = 0; The argument name can be omitted in these functions. r=me
Alexey Proskuryakov
Comment 12
2009-02-09 02:02:54 PST
Committed revision 40780. When creating patches, please make sure that the current directory is WebKit root - that will make them easier to apply. To make directory scanning faster, you can pass a list to svn-create-patch, e.g.: svn-create-patch WebCore LayoutTests/ChangeLog LayoutTests/fast/workers
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug