Skip to content

Conversation

@rigor789
Copy link
Member

@rigor789 rigor789 commented Mar 26, 2023

Re-enabling Inspector protocol handling in core inspector_modules.

Previously, most of these protocols had c++ Agents selectively calling into the core dispatchers registered with the __registerDomainDispatcher.

With this change, we now pass all protocol messages to the registered domain dispatcher as long as it has a matching method. ie. Network.enable will call the enable() method on the Network domain dispatcher.

Since the previous version selectively called these methods, Network.enable was only called from the domain dispatcher constructor, and never from the incoming protocol message (was handled in the c++ implementation instead). While that worked, it was limiting and required runtime changes whenever requiring a new protocol event handler...

Core also tends to throw errors like: One CSSDomainDebugger may be enabled at a time in the enable handlers - these don't make sense with this new setup, because these will get called every time a devtools frontend connects and sends the CSS.enable protocol message.

To handle this, we'll refactor core, however for backwards compatibility these errors are automatically caught on the c++/v8 side.

@cla-bot cla-bot bot added the cla: yes label Mar 26, 2023
@rigor789 rigor789 marked this pull request as draft March 26, 2023 13:51
@rigor789 rigor789 marked this pull request as ready for review March 29, 2023 18:24
@rigor789 rigor789 changed the base branch from dev to main April 19, 2023 13:48
@rigor789 rigor789 requested a review from edusperoni April 19, 2023 14:13
@NathanWalker NathanWalker merged commit c100f72 into main May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants