OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/metrics/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 waiting_for_collect_final_metrics_step_ = true; | 245 waiting_for_collect_final_metrics_step_ = true; |
246 | 246 |
247 base::Closure callback = | 247 base::Closure callback = |
248 base::Bind(&ChromeMetricsServiceClient::OnMemoryDetailCollectionDone, | 248 base::Bind(&ChromeMetricsServiceClient::OnMemoryDetailCollectionDone, |
249 weak_ptr_factory_.GetWeakPtr()); | 249 weak_ptr_factory_.GetWeakPtr()); |
250 | 250 |
251 scoped_refptr<MetricsMemoryDetails> details( | 251 scoped_refptr<MetricsMemoryDetails> details( |
252 new MetricsMemoryDetails(callback, &memory_growth_tracker_)); | 252 new MetricsMemoryDetails(callback, &memory_growth_tracker_)); |
253 details->StartFetch(MemoryDetails::FROM_CHROME_ONLY); | 253 details->StartFetch(MemoryDetails::FROM_CHROME_ONLY); |
254 | 254 |
255 ScopedPtrMap<int, scoped_ptr<ProcessResourceUsage>> current_map; | 255 base::ScopedPtrMap<int, scoped_ptr<ProcessResourceUsage>> current_map; |
256 host_resource_usage_map_.swap(current_map); | 256 host_resource_usage_map_.swap(current_map); |
257 | 257 |
258 // Collect WebCore cache information to put into a histogram. | 258 // Collect WebCore cache information to put into a histogram. |
259 for (content::RenderProcessHost::iterator i( | 259 for (content::RenderProcessHost::iterator i( |
260 content::RenderProcessHost::AllHostsIterator()); | 260 content::RenderProcessHost::AllHostsIterator()); |
261 !i.IsAtEnd(); i.Advance()) { | 261 !i.IsAtEnd(); i.Advance()) { |
262 content::RenderProcessHost* host = i.GetCurrentValue(); | 262 content::RenderProcessHost* host = i.GetCurrentValue(); |
263 int host_id = host->GetID(); | 263 int host_id = host->GetID(); |
264 ProcessResourceUsage* resource_usage = nullptr; | 264 ProcessResourceUsage* resource_usage = nullptr; |
265 auto iter = current_map.find(host_id); | 265 auto iter = current_map.find(host_id); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 case content::NOTIFICATION_LOAD_START: | 601 case content::NOTIFICATION_LOAD_START: |
602 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: | 602 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: |
603 case content::NOTIFICATION_RENDER_WIDGET_HOST_HANG: | 603 case content::NOTIFICATION_RENDER_WIDGET_HOST_HANG: |
604 metrics_service_->OnApplicationNotIdle(); | 604 metrics_service_->OnApplicationNotIdle(); |
605 break; | 605 break; |
606 | 606 |
607 default: | 607 default: |
608 NOTREACHED(); | 608 NOTREACHED(); |
609 } | 609 } |
610 } | 610 } |
OLD | NEW |