forked from servo/servo
-
Notifications
You must be signed in to change notification settings - Fork 0
Devtools plans
Josh Matthews edited this page Jul 24, 2015
·
6 revisions
Devtools task:
- loops accepting connections, spawns a new task for each client
- home of actor registry - hashmap of actor IDs (strings like "tab1") to boxed Actor traits that can be cast to concrete actor types encapsulating immutable state
Devtools client task:
- loops reading the socket stream
- accepts and produces JSON wire protocol: https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport
- sends synchronous messages to script task to perform operations such as:
- evaluating JS in the current global, return result
- enumerating the properties on a JS object
Script task:
- polls devtools port for pending requests
- pins/unpins arbitrary JS values (including DOM object reflectors) as required (https://wiki.mozilla.org/Remote_Debugging_Protocol#Grips)
- Devtools->Script messages defined in a new
devtools_traits
crate that script/devtools depend upon - Constellation provides optional devtools receiver to each new script task
- Script task notifies devtools task of each new global created (need bidirectional communication)
- Constellation creates new actor for each global, removes actor when global disappears
- Report live CSS errors to remote console
- Report cached CSS errors to remote console
- Create new, exciting tools outside of the standard set - simple power monitor example
https://developer.mozilla.org/en-US/docs/Tools/Web_Console/remoting https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport https://wiki.mozilla.org/Remote_Debugging_Protocol
- http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/main.js?force=1 (base server stuff)
- http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/ (home of all actor implementations for server side)
- http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/webconsole.js?force=1 (the webconsole server actor implementation)
- http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/webconsole/client.js?force=1 (the webconsole client actor implementation)
- http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/script.js#1956 (grip creation)