Closed
Bug 1482070
Opened 7 years ago
Closed 7 years ago
Move devtools/shared/webconsole/network-monitor next to its actor
Categories
(DevTools :: Netmonitor, enhancement, P2)
DevTools
Netmonitor
Tracking
(firefox63 fixed)
RESOLVED
FIXED
Firefox 63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(10 files)
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
Honza
:
review+
|
Details | Review |
devtools/shared/webconsole/network-monitor.js is only used from the actors and should rather be next to them rather than in shared folder:
https://searchfox.org/mozilla-central/search?q=network-monitor%22&case=false®exp=false&path=
Now the naming will be complex as everything is named network-something:
* devtools/server/actors/network-monitor.js
NetworkMonitorActor
* devtools/server/actors/network-event.js
NetworkEventActor
* devtools/shared/webconsole/network-monitor.js
StackTraceCollector, NetworkMonitor, ConsoleProgressListener
First thing would be to split network-monitor.js in three and move ConsoleProgressListener to actors/webconsole/listeners.js (we may split listeners.js if that helps).
Then, I think it would be helful to create a new folder: actors/network-monitor, and move StackTraceCollector in it, as well as NetworkMonitor. But we would have to rename it to make the distinction between NetworkMonitorActor and NetworkMonitor clearer. What about NetworkObserver, or NetworkListener, or... ?
Assignee | ||
Comment 1•7 years ago
|
||
honza, what do you think about this renaming plan?
Flags: needinfo?(odvarko)
Comment 2•7 years ago
|
||
This is nice clean-up, thanks for working on it!
(In reply to Alexandre Poirot [:ochameau] from comment #0)
> devtools/shared/webconsole/network-monitor.js is only used from the actors
> and should rather be next to them rather than in shared folder:
>
> https://searchfox.org/mozilla-central/search?q=network-
> monitor%22&case=false®exp=false&path=
>
> Now the naming will be complex as everything is named network-something:
> * devtools/server/actors/network-monitor.js
> NetworkMonitorActor
> * devtools/server/actors/network-event.js
> NetworkEventActor
> * devtools/shared/webconsole/network-monitor.js
> StackTraceCollector, NetworkMonitor, ConsoleProgressListener
>
> First thing would be to split network-monitor.js in three and move
> ConsoleProgressListener to actors/webconsole/listeners.js
All make total sense. We might split it into more files, see below.
> (we may split listeners.js if that helps).
I am usually in favor or splitting files (having one object/component per file), so I am saying yes. No need to have an extra dir for these new listener files of course.
> Then, I think it would be helpful to create a new folder:
> actors/network-monitor, and move StackTraceCollector in it, as well as
Yes, precisely
> NetworkMonitor. But we would have to rename it to make the distinction
> between NetworkMonitorActor and NetworkMonitor clearer. What about
> NetworkObserver, or NetworkListener, or... ?
So, I can image the following:
* ConsoleProgressListener -> actors/webconsole/console-progress-listener.js
* ConsoleServiceListener -> actors/webconsole/console-service-listener.js
* ConsoleAPIListener -> actors/webconsole/console-api-listener.js
* ConsoleReflowListener -> actors/webconsole/console-reflow-listener.js
* ContentProcessListener -> actors/webconsole/console-process-listener.js
* DocumentEventsListener -> actors/webconsole/document-events-listener.js
* StackTraceCollector -> server/actors/network-monitor/stack-trace-collector.js
* NetworkMonitorActor -> server/actors/network-monitor/network-monitor-actor.js
When splitting `devtools/shared/webconsole/network-monitor.js` we might also introduce:
* matchRequest() -> server/actors/network-monitor/utils.js
* ChannelEventSink -> server/actors/network-monitor/channel-event-sink.js
* NetworkResponseListener -> server/actors/network-monitor/network-response-listener.js
* NetworkMonitor -> NetworkObserver -> server/actors/network-monitor/network-observer.js
* I am picking 'observer' since the impl is based on `Services.obs.addObserver`
-
I think that file names usually follow the name of the object/component implemented inside.
So, this is why I am suggesting:
* NetworkMonitorActor -> server/actors/network-monitor/network-monitor-actor.js
... and *not* a shortcut like:
* NetworkMonitorActor -> server/actors/network-monitor/actor.js
Even if the dir and file name might look a bit repetitive.
Honza
Flags: needinfo?(odvarko)
Assignee | ||
Comment 4•7 years ago
|
||
I may have expected a slight change regarding perf, due to eventual lazy loading of some modules, but it looks like it doesn't change anything:
https://treeherder.mozilla.org/perf.html#/comparesubtest?originalProject=try&originalRevision=25b9514854630292e93fa5b8a6c412b77ecdcd6b&newProject=try&newRevision=06b411e497b19f34043c1b2b6ef3babff070a3a3&originalSignature=f79b6a4f1f8f53326d3056f6c8008c0ff4de0a94&newSignature=f79b6a4f1f8f53326d3056f6c8008c0ff4de0a94&framework=12
Green try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=06b411e497b19f34043c1b2b6ef3babff070a3a3&selectedJob=194494912
Assignee | ||
Comment 5•7 years ago
|
||
Assignee | ||
Comment 6•7 years ago
|
||
Depends On D3597
Assignee | ||
Comment 7•7 years ago
|
||
Depends On D3598
Assignee | ||
Comment 8•7 years ago
|
||
Depends On D3599
Assignee | ||
Comment 9•7 years ago
|
||
Depends On D3600
Assignee | ||
Comment 10•7 years ago
|
||
Depends On D3601
Assignee | ||
Comment 11•7 years ago
|
||
Depends On D3602
Assignee | ||
Comment 12•7 years ago
|
||
Depends On D3603
Assignee | ||
Comment 13•7 years ago
|
||
Depends On D3604
Assignee | ||
Comment 14•7 years ago
|
||
Depends On D3605
Assignee | ||
Comment 15•7 years ago
|
||
I changed two things compared to comment 2:
* I've let matchRequest in network-observer as I found it weird to have just this method in utils.js
* I've let NetworkMonitorActor in server/actors/network-monitor.js. All actors are following this pattern (except inspector.js). See highlighters, webconsole, emulation, object.
Comment 16•7 years ago
|
||
Comment on attachment 9001917 [details]
Bug 1482070 - Move ConsoleProgressListener to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001917 -
Flags: review+
Comment 17•7 years ago
|
||
Comment on attachment 9001918 [details]
Bug 1482070 - Move ConsoleServiceListener to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001918 -
Flags: review+
Comment 18•7 years ago
|
||
Comment on attachment 9001919 [details]
Bug 1482070 - Move ConsoleAPIListener to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001919 -
Flags: review+
Comment 19•7 years ago
|
||
Comment on attachment 9001920 [details]
Bug 1482070 - Move ConsoleReflowListener to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001920 -
Flags: review+
Comment 20•7 years ago
|
||
Comment on attachment 9001921 [details]
Bug 1482070 - Move ContentProcessListener to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001921 -
Flags: review+
Comment 21•7 years ago
|
||
Comment on attachment 9001922 [details]
Bug 1482070 - Move DocumentEventsListener to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001922 -
Flags: review+
Comment 22•7 years ago
|
||
Comment on attachment 9001924 [details]
Bug 1482070 - Move ChannelEventSink to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001924 -
Flags: review+
Comment 23•7 years ago
|
||
Comment on attachment 9001925 [details]
Bug 1482070 - Move StackTraceCollector to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001925 -
Flags: review+
Comment 24•7 years ago
|
||
Comment on attachment 9001926 [details]
Bug 1482070 - Rename NetworkMonitor to NetworkObserver and move it next to the NetworkMonitorActor. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001926 -
Flags: review+
Comment 25•7 years ago
|
||
Comment on attachment 9001927 [details]
Bug 1482070 - Move NetworkResponseListener to its own file. r=Honza
Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9001927 -
Flags: review+
Comment 26•7 years ago
|
||
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c6c757dc5f0b
Move ConsoleProgressListener to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/71e21bc8aa29
Move ConsoleServiceListener to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/985b16e17356
Move ConsoleAPIListener to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/e6cb4956e53f
Move ConsoleReflowListener to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b6d22251680
Move ContentProcessListener to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/f269b019428d
Move DocumentEventsListener to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/cc2fffaa4633
Move ChannelEventSink to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/e4b6ce31de8d
Move StackTraceCollector to its own file. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/6871a98b8b0b
Rename NetworkMonitor to NetworkObserver and move it next to the NetworkMonitorActor. r=Honza
https://hg.mozilla.org/integration/mozilla-inbound/rev/68bff34cbddd
Move NetworkResponseListener to its own file. r=Honza
Comment 27•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c6c757dc5f0b
https://hg.mozilla.org/mozilla-central/rev/71e21bc8aa29
https://hg.mozilla.org/mozilla-central/rev/985b16e17356
https://hg.mozilla.org/mozilla-central/rev/e6cb4956e53f
https://hg.mozilla.org/mozilla-central/rev/5b6d22251680
https://hg.mozilla.org/mozilla-central/rev/f269b019428d
https://hg.mozilla.org/mozilla-central/rev/cc2fffaa4633
https://hg.mozilla.org/mozilla-central/rev/e4b6ce31de8d
https://hg.mozilla.org/mozilla-central/rev/6871a98b8b0b
https://hg.mozilla.org/mozilla-central/rev/68bff34cbddd
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
You need to log in
before you can comment on or make changes to this bug.
Description
•