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 #include "content/browser/histogram_controller.h" | 5 #include "content/browser/histogram_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "content/browser/histogram_subscriber.h" | 9 #include "content/browser/histogram_subscriber.h" |
10 #include "content/common/child_process_messages.h" | 10 #include "content/common/child_process_messages.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 DCHECK_EQ(subscriber_, subscriber); | 64 DCHECK_EQ(subscriber_, subscriber); |
65 subscriber_ = NULL; | 65 subscriber_ = NULL; |
66 } | 66 } |
67 | 67 |
68 void HistogramController::GetHistogramDataFromChildProcesses( | 68 void HistogramController::GetHistogramDataFromChildProcesses( |
69 int sequence_number) { | 69 int sequence_number) { |
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
71 | 71 |
72 int pending_processes = 0; | 72 int pending_processes = 0; |
73 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { | 73 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { |
| 74 content::ProcessType type = iter.GetData().type; |
| 75 if (type != PROCESS_TYPE_PLUGIN && type != PROCESS_TYPE_GPU) |
| 76 continue; |
74 ++pending_processes; | 77 ++pending_processes; |
75 if (!iter.Send(new ChildProcessMsg_GetChildHistogramData(sequence_number))) | 78 if (!iter.Send(new ChildProcessMsg_GetChildHistogramData(sequence_number))) |
76 --pending_processes; | 79 --pending_processes; |
77 } | 80 } |
78 | 81 |
79 BrowserThread::PostTask( | 82 BrowserThread::PostTask( |
80 BrowserThread::UI, | 83 BrowserThread::UI, |
81 FROM_HERE, | 84 FROM_HERE, |
82 base::Bind( | 85 base::Bind( |
83 &HistogramController::OnPendingProcesses, | 86 &HistogramController::OnPendingProcesses, |
(...skipping 19 matching lines...) Expand all Loading... |
103 | 106 |
104 BrowserThread::PostTask( | 107 BrowserThread::PostTask( |
105 BrowserThread::IO, | 108 BrowserThread::IO, |
106 FROM_HERE, | 109 FROM_HERE, |
107 base::Bind(&HistogramController::GetHistogramDataFromChildProcesses, | 110 base::Bind(&HistogramController::GetHistogramDataFromChildProcesses, |
108 base::Unretained(this), | 111 base::Unretained(this), |
109 sequence_number)); | 112 sequence_number)); |
110 } | 113 } |
111 | 114 |
112 } // namespace content | 115 } // namespace content |
OLD | NEW |