| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES); | 1469 request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES); |
| 1470 | 1470 |
| 1471 if (!handler->OnResponseCompleted(info->GetRequestID(), request->status(), | 1471 if (!handler->OnResponseCompleted(info->GetRequestID(), request->status(), |
| 1472 std::string())) { | 1472 std::string())) { |
| 1473 // TODO(darin): The handler is not ready for us to kill the request. Oops! | 1473 // TODO(darin): The handler is not ready for us to kill the request. Oops! |
| 1474 NOTREACHED(); | 1474 NOTREACHED(); |
| 1475 } | 1475 } |
| 1476 | 1476 |
| 1477 IncrementOutstandingRequestsMemoryCost(-1 * info->memory_cost(), | 1477 IncrementOutstandingRequestsMemoryCost(-1 * info->memory_cost(), |
| 1478 info->GetChildID()); | 1478 info->GetChildID()); |
| 1479 |
| 1480 // A ResourceHandler must not outlive its associated URLRequest. |
| 1481 handler.reset(); |
| 1479 return; | 1482 return; |
| 1480 } | 1483 } |
| 1481 | 1484 |
| 1482 linked_ptr<ResourceLoader> loader( | 1485 linked_ptr<ResourceLoader> loader( |
| 1483 new ResourceLoader(request.Pass(), handler.Pass(), this)); | 1486 new ResourceLoader(request.Pass(), handler.Pass(), this)); |
| 1484 | 1487 |
| 1485 ProcessRouteIDs pair_id(info->GetChildID(), info->GetRouteID()); | 1488 ProcessRouteIDs pair_id(info->GetChildID(), info->GetRouteID()); |
| 1486 BlockedLoadersMap::const_iterator iter = blocked_loaders_map_.find(pair_id); | 1489 BlockedLoadersMap::const_iterator iter = blocked_loaders_map_.find(pair_id); |
| 1487 if (iter != blocked_loaders_map_.end()) { | 1490 if (iter != blocked_loaders_map_.end()) { |
| 1488 // The request should be blocked. | 1491 // The request should be blocked. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 | 1715 |
| 1713 return i->second.get(); | 1716 return i->second.get(); |
| 1714 } | 1717 } |
| 1715 | 1718 |
| 1716 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, | 1719 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, |
| 1717 int request_id) const { | 1720 int request_id) const { |
| 1718 return GetLoader(GlobalRequestID(child_id, request_id)); | 1721 return GetLoader(GlobalRequestID(child_id, request_id)); |
| 1719 } | 1722 } |
| 1720 | 1723 |
| 1721 } // namespace content | 1724 } // namespace content |
| OLD | NEW |