resource.update(requestWillBeSent);
// We depend on the fact that any redirects that we encounter will have
// a corresponding timeline agent event that will add it to the redirects
// map. We look for one here.
NetworkRequestWillBeSentEvent.Data data = requestWillBeSent.getData().cast();
Response redirectResponse = data.getRedirectResponse();
if (redirectResponse != null) {
// look for a redirect.
NetworkResource redirect = findAndRemoveRedirectCandidate(
requestWillBeSent.getRequestId(), redirectResponse.getUrl());
if (redirect != null) {
redirect.updateResponse(redirectResponse);
redirect.setResponseReceivedTime(requestWillBeSent.getTime());
redirect.setEndTime(requestWillBeSent.getTime());
redirectUpdated(redirect);