| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/task_manager.h" | 5 #include "chrome/browser/task_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 830 |
| 831 void TaskManagerModel::OnJobDone(URLRequestJob* job, | 831 void TaskManagerModel::OnJobDone(URLRequestJob* job, |
| 832 const URLRequestStatus& status) { | 832 const URLRequestStatus& status) { |
| 833 } | 833 } |
| 834 | 834 |
| 835 void TaskManagerModel::OnJobRedirect(URLRequestJob* job, | 835 void TaskManagerModel::OnJobRedirect(URLRequestJob* job, |
| 836 const GURL& location, | 836 const GURL& location, |
| 837 int status_code) { | 837 int status_code) { |
| 838 } | 838 } |
| 839 | 839 |
| 840 void TaskManagerModel::OnBytesRead(URLRequestJob* job, int byte_count) { | 840 void TaskManagerModel::OnBytesRead(URLRequestJob* job, const char* buf, |
| 841 int byte_count) { |
| 841 int render_process_host_child_id = -1, routing_id = -1; | 842 int render_process_host_child_id = -1, routing_id = -1; |
| 842 ResourceDispatcherHost::RenderViewForRequest(job->request(), | 843 ResourceDispatcherHost::RenderViewForRequest(job->request(), |
| 843 &render_process_host_child_id, | 844 &render_process_host_child_id, |
| 844 &routing_id); | 845 &routing_id); |
| 845 // This happens in the IO thread, post it to the UI thread. | 846 // This happens in the IO thread, post it to the UI thread. |
| 846 int origin_child_id = | 847 int origin_child_id = |
| 847 chrome_browser_net::GetOriginProcessUniqueIDForRequest(job->request()); | 848 chrome_browser_net::GetOriginProcessUniqueIDForRequest(job->request()); |
| 848 ChromeThread::PostTask( | 849 ChromeThread::PostTask( |
| 849 ChromeThread::UI, FROM_HERE, | 850 ChromeThread::UI, FROM_HERE, |
| 850 NewRunnableMethod( | 851 NewRunnableMethod( |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 MetricsMap::const_iterator iter = metrics_map_.find(handle); | 974 MetricsMap::const_iterator iter = metrics_map_.find(handle); |
| 974 if (iter == metrics_map_.end()) | 975 if (iter == metrics_map_.end()) |
| 975 return false; | 976 return false; |
| 976 | 977 |
| 977 if (!iter->second->GetMemoryBytes(&usage->first, &usage->second)) | 978 if (!iter->second->GetMemoryBytes(&usage->first, &usage->second)) |
| 978 return false; | 979 return false; |
| 979 | 980 |
| 980 memory_usage_map_.insert(std::make_pair(handle, *usage)); | 981 memory_usage_map_.insert(std::make_pair(handle, *usage)); |
| 981 return true; | 982 return true; |
| 982 } | 983 } |
| OLD | NEW |