| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc
eLoading | 5 // See http://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc
eLoading |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "chrome/browser/resource_dispatcher_host.h" | 9 #include "chrome/browser/resource_dispatcher_host.h" |
| 10 | 10 |
| (...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1916 PendingRequestList::iterator i = pending_requests_.find( | 1916 PendingRequestList::iterator i = pending_requests_.find( |
| 1917 GlobalRequestID(render_process_host_id, request_id)); | 1917 GlobalRequestID(render_process_host_id, request_id)); |
| 1918 if (i == pending_requests_.end()) { | 1918 if (i == pending_requests_.end()) { |
| 1919 NOTREACHED() << "Trying to remove a request that's not here"; | 1919 NOTREACHED() << "Trying to remove a request that's not here"; |
| 1920 return; | 1920 return; |
| 1921 } | 1921 } |
| 1922 RemovePendingRequest(i); | 1922 RemovePendingRequest(i); |
| 1923 } | 1923 } |
| 1924 | 1924 |
| 1925 void ResourceDispatcherHost::RemovePendingRequest( | 1925 void ResourceDispatcherHost::RemovePendingRequest( |
| 1926 PendingRequestList::iterator& iter) { | 1926 const PendingRequestList::iterator& iter) { |
| 1927 // Notify the login handler that this request object is going away. | 1927 // Notify the login handler that this request object is going away. |
| 1928 ExtraRequestInfo* info = ExtraInfoForRequest(iter->second); | 1928 ExtraRequestInfo* info = ExtraInfoForRequest(iter->second); |
| 1929 if (info && info->login_handler) | 1929 if (info && info->login_handler) |
| 1930 info->login_handler->OnRequestCancelled(); | 1930 info->login_handler->OnRequestCancelled(); |
| 1931 | 1931 |
| 1932 delete iter->second; | 1932 delete iter->second; |
| 1933 pending_requests_.erase(iter); | 1933 pending_requests_.erase(iter); |
| 1934 | 1934 |
| 1935 // If we have no more pending requests, then stop the load state monitor | 1935 // If we have no more pending requests, then stop the load state monitor |
| 1936 if (pending_requests_.empty()) | 1936 if (pending_requests_.empty()) |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2500 bool enough_new_progress = (amt_since_last > (size / kHalfPercentIncrements)); | 2500 bool enough_new_progress = (amt_since_last > (size / kHalfPercentIncrements)); |
| 2501 bool too_much_time_passed = time_since_last > kOneSecond; | 2501 bool too_much_time_passed = time_since_last > kOneSecond; |
| 2502 | 2502 |
| 2503 if (is_finished || enough_new_progress || too_much_time_passed) { | 2503 if (is_finished || enough_new_progress || too_much_time_passed) { |
| 2504 info->event_handler->OnUploadProgress(info->request_id, position, size); | 2504 info->event_handler->OnUploadProgress(info->request_id, position, size); |
| 2505 info->waiting_for_upload_progress_ack = true; | 2505 info->waiting_for_upload_progress_ack = true; |
| 2506 info->last_upload_ticks = TimeTicks::Now(); | 2506 info->last_upload_ticks = TimeTicks::Now(); |
| 2507 info->last_upload_position = position; | 2507 info->last_upload_position = position; |
| 2508 } | 2508 } |
| 2509 } | 2509 } |
| OLD | NEW |