| Index: content/browser/histogram_controller.cc
|
| ===================================================================
|
| --- content/browser/histogram_controller.cc (revision 276253)
|
| +++ content/browser/histogram_controller.cc (working copy)
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/metrics/histogram.h"
|
| +#include "base/process/process_handle.h"
|
| #include "content/browser/histogram_subscriber.h"
|
| #include "content/common/child_process_messages.h"
|
| #include "content/public/browser/browser_child_process_host_iterator.h"
|
| @@ -70,9 +71,11 @@
|
| int sequence_number) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
|
|
| + const base::ProcessId current_proc_id = base::GetCurrentProcId();
|
| int pending_processes = 0;
|
| for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) {
|
| - int type = iter.GetData().process_type;
|
| + const ChildProcessData& data = iter.GetData();
|
| + int type = data.process_type;
|
| if (type != PROCESS_TYPE_PLUGIN &&
|
| type != PROCESS_TYPE_GPU &&
|
| type != PROCESS_TYPE_PPAPI_PLUGIN &&
|
| @@ -80,6 +83,12 @@
|
| continue;
|
| }
|
|
|
| + // In some cases, the child process may be the same as the current process -
|
| + // for example the GPU process may be the same as the browser process. Don't
|
| + // ask it for histogram data in that case.
|
| + if (base::GetProcId(data.handle) == current_proc_id)
|
| + continue;
|
| +
|
| ++pending_processes;
|
| if (!iter.Send(new ChildProcessMsg_GetChildHistogramData(sequence_number)))
|
| --pending_processes;
|
|
|