Search in sources :

Example 1 with PendingRequest

use of com.facebook.stetho.inspector.jsonrpc.PendingRequest in project stetho by facebook.

the class ChromeDevtoolsServer method handleRemoteResponse.

private void handleRemoteResponse(JsonRpcPeer peer, JSONObject responseNode) throws MismatchedResponseException {
    JsonRpcResponse response = mObjectMapper.convertValue(responseNode, JsonRpcResponse.class);
    PendingRequest pendingRequest = peer.getAndRemovePendingRequest(response.id);
    if (pendingRequest == null) {
        throw new MismatchedResponseException(response.id);
    }
    if (pendingRequest.callback != null) {
        pendingRequest.callback.onResponse(peer, response);
    }
}
Also used : JsonRpcResponse(com.facebook.stetho.inspector.jsonrpc.protocol.JsonRpcResponse) PendingRequest(com.facebook.stetho.inspector.jsonrpc.PendingRequest)

Aggregations

PendingRequest (com.facebook.stetho.inspector.jsonrpc.PendingRequest)1 JsonRpcResponse (com.facebook.stetho.inspector.jsonrpc.protocol.JsonRpcResponse)1