Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(932)

Unified Diff: content/browser/profiler_controller_impl.cc

Issue 328823002: Don't fetch histograms from the same process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/profiler_controller_impl.cc
===================================================================
--- content/browser/profiler_controller_impl.cc (revision 276253)
+++ content/browser/profiler_controller_impl.cc (working copy)
@@ -5,7 +5,7 @@
#include "content/browser/profiler_controller_impl.h"
#include "base/bind.h"
-#include "base/command_line.h"
+#include "base/process/process_handle.h"
#include "base/tracked_objects.h"
#include "content/common/child_process_messages.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
@@ -13,7 +13,6 @@
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/profiler_subscriber.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/common/content_switches.h"
namespace content {
@@ -76,14 +75,14 @@
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) {
- // Skips requesting profiler data from the "GPU Process" if we are using in
- // process GPU. Those stats should be in the Browser-process's GPU thread.
- if (iter.GetData().process_type == PROCESS_TYPE_GPU &&
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) {
+ // 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 profiler data in that case.
+ if (base::GetProcId(iter.GetData().handle) == current_proc_id)
continue;
- }
++pending_processes;
if (!iter.Send(new ChildProcessMsg_GetChildProfilerData(sequence_number)))
« content/browser/gpu/gpu_process_host.cc ('K') | « content/browser/histogram_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698