-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: single network monitor kept on Driver #15055
Conversation
@@ -50,6 +51,7 @@ declare module Gatherer { | |||
on(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void | |||
off(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void | |||
}; | |||
networkMonitor: NetworkMonitor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I should type just the public interface here, but then we get this error...
How can we resolve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we pull waitForFullyLoaded
(and whatever else...) into NetworkMonitor? expose as NetworkMonitor.waitForFullyLoaded(session, opts)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, waitForFullyLoaded
does other non-network stuff like CPU idle. I think it's fine this way personally.
9e05018
to
f81206c
Compare
f81206c
to
a60e6bf
Compare
Looks like you have to do the |
ref #14078
Moves
NetworkMonitor
toDriver
, so that the navigation runner and FPS gatherer can use the same instance.Without changing the lifecycle of the monitor: the navigation runner enables/disables it for
goToURL
only, and the FPS does the same ingetArtifact
(so after the monitor has been disabled in navigation mode - but for the first and only time in other modes). If a gatherer wanted to use the monitor in earlier gathering stages, we need to modify how the monitor is enabled. One option is to track a counter of enables/disables (like we do for protocol domains). Another is to just enable unconditionally inDriver.connect
, so it's on constantly for all modes and gatherers. The second commit in the PR tries this approach.