Index: content/browser/loader/resource_dispatcher_host_impl.cc |
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
index 3849313958054add332c20ecf097b12344f45395..d7baea4ff7ee8d05b7225d16eaadb9631da94fdf 100644 |
--- a/content/browser/loader/resource_dispatcher_host_impl.cc |
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
@@ -231,8 +231,9 @@ net::Error CallbackAndReturn( |
return net_error; |
} |
-int BuildLoadFlagsForRequest(const ResourceHostMsg_Request& request_data, |
- int child_id, bool is_sync_load) { |
+int BuildLoadFlagsForRequest( |
+ const ResourceHostMsg_Request& request_data, int child_id, |
+ bool is_sync_load) { |
int load_flags = request_data.load_flags; |
// Although EV status is irrelevant to sub-frames and sub-resources, we have |
@@ -700,6 +701,10 @@ void ResourceDispatcherHostImpl::DidReceiveRedirect(ResourceLoader* loader, |
void ResourceDispatcherHostImpl::DidReceiveResponse(ResourceLoader* loader) { |
ResourceRequestInfoImpl* info = loader->GetRequestInfo(); |
+ // There should be an entry in the map created when we dispatched the |
+ // request. |
+ offline_map_[ProcessRouteIDs(info->GetChildID(), info->GetRouteID())]-> |
+ RequestCompleted(loader->request()->response_info()); |
int render_process_id, render_view_id; |
if (!info->GetAssociatedRenderView(&render_process_id, &render_view_id)) |
@@ -934,6 +939,12 @@ void ResourceDispatcherHostImpl::BeginRequest( |
int load_flags = |
BuildLoadFlagsForRequest(request_data, child_id, is_sync_load); |
+ ProcessRouteIDs id(child_id, route_id); |
+ if (!offline_map_[id]) |
+ offline_map_[id] = new OfflinePolicy(); |
+ load_flags |= offline_map_[id]->GetAdditionalLoadFlags( |
+ load_flags, request_data.resource_type); |
+ |
// Construct the request. |
scoped_ptr<net::URLRequest> new_request; |
net::URLRequest* request; |
@@ -1368,6 +1379,10 @@ void ResourceDispatcherHostImpl::CancelRequestsForRoute(int child_id, |
CancelBlockedRequestsForRoute(child_id, *iter); |
} |
} |
+ |
+ // Cleanup the offline state for the route. |
+ delete offline_map_[ProcessRouteIDs(child_id, route_id)]; |
+ offline_map_.erase(ProcessRouteIDs(child_id, route_id)); |
} |
// Cancels the request and removes it from the list. |