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 NetworkRequestDelegate on iOS #44846

Closed
wants to merge 2 commits into from

Commits on Jun 9, 2024

  1. Implement Network.loadNetworkResource etc in C++

    Summary:
    ## 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 9, 2024
    Configuration menu
    Copy the full SHA
    0ddb8a0 View commit details
    Browse the repository at this point in the history
  2. Implement NetworkRequestDelegate on iOS

    Summary:
    Implement `jsinspector_modern:: NetworkRequestDelegate` for iOS (bridge and bridgeless) to satisfy CDP `Network.loadNetworkResource` (etc) requests.
    
    Changelog:
    [iOS][Added] Debugger: Implement CDP methods for loading network resources through the debug target.
    
    Differential Revision: D54496969
    robhogan authored and facebook-github-bot committed Jun 9, 2024
    Configuration menu
    Copy the full SHA
    7fcbc8e View commit details
    Browse the repository at this point in the history