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 a1cb1f1c15e8c7a0499e157d2e19c6ae16234193..64f71f01b290098983c62aabd7d1a76251ef6eeb 100644 |
--- a/content/browser/loader/resource_dispatcher_host_impl.cc |
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
@@ -1004,10 +1004,12 @@ void ResourceDispatcherHostImpl::UpdateRequestForTransfer( |
GlobalRequestID new_request_id(child_id, request_id); |
// Clear out data that depends on |info| before updating it. |
- IncrementOutstandingRequestsMemory(-1, *info); |
- OustandingRequestsStats empty_stats = { 0, 0 }; |
- OustandingRequestsStats old_stats = GetOutstandingRequestsStats(*info); |
- UpdateOutstandingRequestsStats(*info, empty_stats); |
+ // We always need to move the memory stats to the new process. In contrast, |
+ // stats.num_requests is only sometimes tracked. |
+ OustandingRequestsStats stats = IncrementOutstandingRequestsMemory(-1, *info); |
+ bool should_update_count = stats.num_requests > 0; |
davidben
2014/10/13 17:40:04
Hrm. Is this the right criteria? OutstandingReques
Charlie Reis
2014/10/14 23:54:12
Oops-- you're totally right. Awkward that we don'
|
+ if (should_update_count) |
+ IncrementOutstandingRequestsCount(-1, *info); |
pending_loaders_.erase(old_request_id); |
// ResourceHandlers should always get state related to the request from the |
@@ -1020,8 +1022,9 @@ void ResourceDispatcherHostImpl::UpdateRequestForTransfer( |
// Update maps that used the old IDs, if necessary. Some transfers in tests |
// do not actually use a different ID, so not all maps need to be updated. |
pending_loaders_[new_request_id] = loader; |
- UpdateOutstandingRequestsStats(*info, old_stats); |
IncrementOutstandingRequestsMemory(1, *info); |
+ if (should_update_count) |
+ IncrementOutstandingRequestsCount(1, *info); |
if (old_routing_id != new_routing_id) { |
if (blocked_loaders_map_.find(old_routing_id) != |
blocked_loaders_map_.end()) { |