Skip to content
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

Implement Network.loadNetworkResource etc in C++ #44845

Closed
wants to merge 1 commit into from

Commits on Jun 10, 2024

  1. Implement Network.loadNetworkResource etc in C++ (facebook#44845)

    Summary:
    Pull Request resolved: facebook#44845
    
    ## Design
     - `NetworkIO` is an object owned by the `HostAgent`, created by `HostTarget` where it is given a scoped executor.
     - `HostAgent` passes most handling of CDP `Network.loadNetworkResource` through `NetworkIO`.
     - `NetworkIO.loadNetworkResource` creates and holds a shared_ptr to a `Stream` representing a single resource load, and owning received headers and data. A reference is held in a map `streams_` until an error or it is closed with `IO.close`. `delegate.networkRequest` is called with the `stream`, which it retains for the lifetime of the request, and uses its methods to call back with headers, data and errors.
    
     - Callbacks for `IO.read` requests are held by the `Stream` until the incoming data is complete or enough data is available to fill the request (an implementation choice to optimise for fewest round trips). Any incoming data or error causes any pending requests to be rechecked.
    
    ## Unimplemented platforms
     - Platforms may optionally implement `HostTargetDelegate.networkRequest` (as of this diff, none do). If they don't we report a CDP "not implemented" error, similar to the status quo where it was unimplemented by the C++ agent.
    
    Differential Revision: D54309633
    robhogan authored and facebook-github-bot committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    a94bf55 View commit details
    Browse the repository at this point in the history