* @param typeMap the {@link FastStringMap}
*/
private static void setNetworkEventCallbacks(
final NetworkEventDispatcher proxy, JsIntegerMap<EventRecordDispatcher> typeMap) {
typeMap.put(EventRecordType.RESOURCE_SEND_REQUEST, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
proxy.onNetworkResourceStarted(data.<ResourceWillSendEvent>cast());
}
});
typeMap.put(EventRecordType.RESOURCE_RECEIVE_RESPONSE, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
proxy.onNetworkResourceResponse(data.<ResourceResponseEvent>cast());
}
});
typeMap.put(EventRecordType.RESOURCE_FINISH, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
ResourceFinishEvent finish = data.cast();
proxy.onNetworkResourceFinished(finish);
}
});
typeMap.put(EventRecordType.NETWORK_LOADING_FINISHED, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
ResourceFinishEvent finish = data.cast();
proxy.onNetworkResourceFinished(finish);
}
});
typeMap.put(EventRecordType.RESOURCE_UPDATED, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
proxy.onNetworkResourceUpdated(data.<ResourceUpdateEvent>cast());
}
});
typeMap.put(EventRecordType.NETWORK_DATA_RECEIVED, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
proxy.onNetworkDataReceived(data.<NetworkDataReceivedEvent>cast());
}
});
typeMap.put(EventRecordType.NETWORK_RESPONSE_RECEIVED, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
proxy.onNetworkResponseReceived(data.<NetworkResponseReceivedEvent>cast());
}
});
typeMap.put(EventRecordType.NETWORK_REQUEST_WILL_BE_SENT, new EventRecordDispatcher() {
public void onEventRecord(EventRecord data) {
proxy.onNetworkRequestWillBeSent(data.<NetworkRequestWillBeSentEvent>cast());
}
});
}