Closed
Bug 1432963
Opened 7 years ago
Closed 7 years ago
fix dom/workers exported headers to not be insane
Categories
(Core :: DOM: Workers, defect, P2)
Core
DOM: Workers
Tracking
()
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: bkelly, Assigned: baku)
References
Details
Attachments
(17 files)
Our dom/worker headers are currently a bit crazy. Lots of code needs to include WorkerPrivate.h. But WorkerPrivate.h uses a bunch of headers that are not referenced by their exported location:
Workers.h
WorkerHolder.h
Queue.h
We could fix these to be:
mozilla/dom/workers/Workers.h
mozilla/dom/workers/bindings/WorkerHolder.h
But Queue.h is not exported. Also, just to make things more confusing, WorkerPrivate.h is exported as:
mozilla/dom/WorkerPrivate.h
This is just kind of crazy and unworkable. So we have code all over the place that just adds dom/workers to their moz.build LOCAL_INCLUDES to work around it. That just leads to the problem getting worse.
We should at least make it possible to include WorkerPrivate.h from the export.
Andrea, any interest in working on this?
Flags: needinfo?(amarchesini)
Assignee | ||
Comment 1•7 years ago
|
||
Yeah, this was part of the Worker cleanup task. I'll take this. I'm keeping the NI flag.
Reporter | ||
Comment 2•7 years ago
|
||
It would also be nice to just use mozilla::dom:: namespace and not the extra workers:: namespace.
Updated•7 years ago
|
Assignee: nobody → amarchesini
Priority: -- → P2
Assignee | ||
Comment 3•7 years ago
|
||
Flags: needinfo?(amarchesini)
Attachment #8946741 -
Flags: review?(bugs)
Assignee | ||
Comment 4•7 years ago
|
||
Attachment #8946743 -
Flags: review?(bugs)
Assignee | ||
Comment 5•7 years ago
|
||
Attachment #8946745 -
Flags: review?(bugs)
Assignee | ||
Comment 6•7 years ago
|
||
Note that here I had to introduce a workers::WorkerPrivate. This is going to be removed in the following patches.
Assignee | ||
Updated•7 years ago
|
Attachment #8946746 -
Flags: review?(bugs)
Assignee | ||
Comment 7•7 years ago
|
||
Attachment #8946748 -
Flags: review?(bugs)
Assignee | ||
Comment 8•7 years ago
|
||
Attachment #8946749 -
Flags: review?(bugs)
Assignee | ||
Comment 9•7 years ago
|
||
Attachment #8946750 -
Flags: review?(bugs)
Assignee | ||
Comment 10•7 years ago
|
||
Attachment #8946751 -
Flags: review?(bugs)
Assignee | ||
Comment 11•7 years ago
|
||
Attachment #8946752 -
Flags: review?(bugs)
Assignee | ||
Comment 12•7 years ago
|
||
Attachment #8946753 -
Flags: review?(bugs)
Assignee | ||
Comment 13•7 years ago
|
||
Attachment #8946754 -
Flags: review?(bugs)
Assignee | ||
Comment 14•7 years ago
|
||
Attachment #8946755 -
Flags: review?(bugs)
Assignee | ||
Comment 15•7 years ago
|
||
Attachment #8946756 -
Flags: review?(bugs)
Assignee | ||
Updated•7 years ago
|
Attachment #8946755 -
Attachment description: part D - WorkerRunnable without namespace → part D - WorkerHolder without namespace
Assignee | ||
Updated•7 years ago
|
Attachment #8946756 -
Attachment description: part E - WorkerHolder without namespace → part E - WorkerPrivate without namespace
Assignee | ||
Comment 16•7 years ago
|
||
Attachment #8946762 -
Flags: review?(bugs)
Assignee | ||
Comment 17•7 years ago
|
||
Attachment #8946764 -
Flags: review?(bugs)
Assignee | ||
Comment 18•7 years ago
|
||
Attachment #8946765 -
Flags: review?(bugs)
Assignee | ||
Comment 19•7 years ago
|
||
Attachment #8946766 -
Flags: review?(bugs)
Assignee | ||
Comment 20•7 years ago
|
||
After these patches, here what we have:
In mozilla/dom/ we have these headers:
'SharedWorker.h',
'WorkerCommon.h',
'WorkerDebugger.h',
'WorkerDebuggerManager.h',
'WorkerHolder.h',
'WorkerHolderToken.h',
'WorkerLoadInfo.h',
'WorkerLocation.h',
'WorkerNavigator.h',
'WorkerPrivate.h',
'WorkerRunnable.h',
'WorkerScope.h',
with 'mozilla::dom::' namespace.
there are 3 private exposed headers in mozilla/dom/workerinternal/
'JSSettings.h',
'Queue.h',
'RuntimeService.h',
in 'mozilla::dom::workerinternals::' namespace
WorkerCommon exposes several static functions. Those are into a 'workers' namespace. Those functions are AssertIsOnMainThread() and so on.
No LIBS+=[ '/dom/workers' ] is required anymore.
Comment 21•7 years ago
|
||
Comment on attachment 8946741 [details] [diff] [review]
part 1 - no workers namespace for SharedWorker
Thank you. All the worker namespace stuff has been always really weird.
Attachment #8946741 -
Flags: review?(bugs) → review+
Comment 22•7 years ago
|
||
Comment on attachment 8946743 [details] [diff] [review]
part 2 - Get rid of WorkerCrossThreadDispatcher and WorkerTask
unused code. lovely.
Attachment #8946743 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8946745 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8946746 -
Flags: review?(bugs) → review+
Comment 23•7 years ago
|
||
Comment on attachment 8946748 [details] [diff] [review]
part 5 - WorkerEventTarget in a separate file
'WorkerLoadInfo.h' changes look unrelated. Which patch removes BEGIN_WORKERS_NAMESPACE from that file?
So far I have found it. Perhaps some latter patch. I may change r- to r+ if I find it.
Attachment #8946748 -
Flags: review?(bugs) → review-
Updated•7 years ago
|
Attachment #8946749 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8946750 -
Flags: review?(bugs) → review+
Comment 24•7 years ago
|
||
Comment on attachment 8946752 [details] [diff] [review]
part 9 - WorkerLoadInfo
Ahaa, here.
Attachment #8946752 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8946748 -
Flags: review- → review+
Updated•7 years ago
|
Attachment #8946751 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8946753 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8946754 -
Flags: review?(bugs) → review+
Comment 25•7 years ago
|
||
Comment on attachment 8946755 [details] [diff] [review]
part D - WorkerHolder without namespace
ok, this changes also NotificationEvent
Attachment #8946755 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8946756 -
Flags: review?(bugs) → review+
Comment 26•7 years ago
|
||
Comment on attachment 8946762 [details] [diff] [review]
part C - WorkerRunnable without namespace
I should have looked at these in order, but oh well.
Attachment #8946762 -
Flags: review?(bugs) → review+
Comment 27•7 years ago
|
||
Comment on attachment 8946764 [details] [diff] [review]
part F - static function in a workers namespace
Personally I really don't like functions in some namespace. Having a class and static methods just makes it easier to figure out where the implementation is etc.
But looks like this is just following the existing pattern in workers, so fine.
What is the change to layout/generic/WritingModes.h? Pleaes explain that, and r+
Attachment #8946764 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 28•7 years ago
|
||
> What is the change to layout/generic/WritingModes.h? Pleaes explain that,
> and r+
There is a conflict with 2 different Side implementation. I had to force the full namespace in order to avoid a conflict.
Comment 29•7 years ago
|
||
Comment on attachment 8946765 [details] [diff] [review]
part G - JSSettings in a workerinternals namespace
Moving CancelWorkersForWindow etc around in the file is a tad annoying. But perhaps the context in the patch just didn't quite reveal the reason.
Attachment #8946765 -
Flags: review?(bugs) → review+
Comment 30•7 years ago
|
||
Comment on attachment 8946766 [details] [diff] [review]
part H - no LIBS=[workers] in moz.build files
Make sure to push all the patches to try (building on all the platforms) before pushing to m-i ;)
Attachment #8946766 -
Flags: review?(bugs) → review+
Comment 31•7 years ago
|
||
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d7e5e7c4cf88
Fixing workers headers - part 1 - no workers namespace for SharedWorker, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/5c06802f7ce4
Fixing workers headers - part 2 - Get rid of WorkerCrossThreadDispatcher and WorkerTask, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/d3c3ec4cbe78
Fixing workers headers - part 3 - WorkerError and WorkerPrincipal without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/a8f2bea31ba9
Fixing workers headers - part 4 - WorkerThread without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/89714cb6e883
Fixing workers headers - part 5 - WorkerEventTarget in a separate file, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/2d8d6c014e67
Fixing workers headers - part 6 - Get rid of WorkerInlines.h, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/6978eec68f5f
Fixing workers headers - part 7 - WorkerDebugger without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a76ef9f9fd5
Fixing workers headers - part 8 - WorkerTargetHolder without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/b83b357dc475
Fixing workers headers - part 9 - WorkerLoadInfo without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/0f5abdabc30f
Fixing workers headers - part 10 - ScriptLoader into a workerinternals namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/69e7ac848a5d
Fixing workers headers - part 11 - MessageEventRunnable without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/765fff03aebd
Fixing workers headers - part 12 - WorkerRunnable without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/68a1d607cbc4
Fixing workers headers - part 13 - WorkerHolder without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/22ab83c80c5e
Fixing workers headers - part 14 - WorkerPrivate without workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a858acf697e
Fixing workers headers - part 15 - static function in a workers namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/f82c8af2c1ea
Fixing workers headers - part 16 - JSSettings in a workerinternals namespace, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/001c306fa281
Fixing workers headers - part 17 - no LIBS=[workers] in moz.build files, r=smaug
Comment 32•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d7e5e7c4cf88
https://hg.mozilla.org/mozilla-central/rev/5c06802f7ce4
https://hg.mozilla.org/mozilla-central/rev/d3c3ec4cbe78
https://hg.mozilla.org/mozilla-central/rev/a8f2bea31ba9
https://hg.mozilla.org/mozilla-central/rev/89714cb6e883
https://hg.mozilla.org/mozilla-central/rev/2d8d6c014e67
https://hg.mozilla.org/mozilla-central/rev/6978eec68f5f
https://hg.mozilla.org/mozilla-central/rev/7a76ef9f9fd5
https://hg.mozilla.org/mozilla-central/rev/b83b357dc475
https://hg.mozilla.org/mozilla-central/rev/0f5abdabc30f
https://hg.mozilla.org/mozilla-central/rev/69e7ac848a5d
https://hg.mozilla.org/mozilla-central/rev/765fff03aebd
https://hg.mozilla.org/mozilla-central/rev/68a1d607cbc4
https://hg.mozilla.org/mozilla-central/rev/22ab83c80c5e
https://hg.mozilla.org/mozilla-central/rev/7a858acf697e
https://hg.mozilla.org/mozilla-central/rev/f82c8af2c1ea
https://hg.mozilla.org/mozilla-central/rev/001c306fa281
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Reporter | ||
Comment 33•7 years ago
|
||
FYI, it looks like there are some lingering:
using namespace mozilla::dom::workers;
using namespace workers;
in the tree. Also maybe some forward declarations like this:
https://searchfox.org/mozilla-central/rev/eeb7190f9ad6f1a846cd6df09986325b3f2c3117/dom/canvas/ImageBitmap.h#42
Flags: needinfo?(amarchesini)
You need to log in
before you can comment on or make changes to this bug.
Description
•