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 "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "content/browser/histogram_subscriber.h" | 10 #include "content/browser/histogram_subscriber.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 void HistogramController::GetHistogramDataFromChildProcesses( | 70 void HistogramController::GetHistogramDataFromChildProcesses( |
71 int sequence_number) { | 71 int sequence_number) { |
72 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 72 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
73 | 73 |
74 int pending_processes = 0; | 74 int pending_processes = 0; |
75 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { | 75 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { |
76 const ChildProcessData& data = iter.GetData(); | 76 const ChildProcessData& data = iter.GetData(); |
77 int type = data.process_type; | 77 int type = data.process_type; |
78 if (type != PROCESS_TYPE_PLUGIN && | 78 if (type != PROCESS_TYPE_GPU && |
79 type != PROCESS_TYPE_GPU && | |
80 type != PROCESS_TYPE_PPAPI_PLUGIN && | 79 type != PROCESS_TYPE_PPAPI_PLUGIN && |
81 type != PROCESS_TYPE_PPAPI_BROKER) { | 80 type != PROCESS_TYPE_PPAPI_BROKER) { |
82 continue; | 81 continue; |
83 } | 82 } |
84 | 83 |
85 // In some cases, there may be no child process of the given type (for | 84 // In some cases, there may be no child process of the given type (for |
86 // example, the GPU process may not exist and there may instead just be a | 85 // example, the GPU process may not exist and there may instead just be a |
87 // GPU thread in the browser process). If that's the case, then the process | 86 // GPU thread in the browser process). If that's the case, then the process |
88 // handle will be base::kNullProcessHandle and we shouldn't ask it for data. | 87 // handle will be base::kNullProcessHandle and we shouldn't ask it for data. |
89 if (data.handle == base::kNullProcessHandle) | 88 if (data.handle == base::kNullProcessHandle) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 120 |
122 BrowserThread::PostTask( | 121 BrowserThread::PostTask( |
123 BrowserThread::IO, | 122 BrowserThread::IO, |
124 FROM_HERE, | 123 FROM_HERE, |
125 base::Bind(&HistogramController::GetHistogramDataFromChildProcesses, | 124 base::Bind(&HistogramController::GetHistogramDataFromChildProcesses, |
126 base::Unretained(this), | 125 base::Unretained(this), |
127 sequence_number)); | 126 sequence_number)); |
128 } | 127 } |
129 | 128 |
130 } // namespace content | 129 } // namespace content |
OLD | NEW |