Commit 4950a302 authored by primiano's avatar primiano Committed by Commit bot

[tracing] Fix single-process detection logic of ChildTraceMessageFilter

Currently the instantiation of ChildTraceMessageFilter in
child_thread_impl.cc is guarded by a check on
CommandLine.HasSwitch(kSingleProcess)
The rationale is that in single-process mode we don't want to have any
message filter as the browser-side tracing will cover all the threads.
However, the aforementioned check is not complete, as it does not
covers the case of tests using the InProcessUtilityThreadHelper [1].
In those tests, the kSingleProcess flag is not present, but the
renderer is in-process anyways.
Replacing the the HasSwitch check in with IsInBrowserProcess(),
which covers also the latter case.

[1] for instance extensions/browser/sandboxed_unpacker_unittest.cc

BUG=474973

Review URL: https://codereview.chromium.org/1069253003

Cr-Commit-Position: refs/heads/master@{#324276}
parent 5384f002
......@@ -77,10 +77,7 @@ void MemoryDumpManager::Initialize() {
void MemoryDumpManager::SetDelegate(MemoryDumpManagerDelegate* delegate) {
AutoLock lock(lock_);
// TODO(primiano): The DCHECK below is disabled just temporary (and it is
// strongly useful). It should be re-enabled soon as crbug.com/474973 is fixed
// (ETA: end of April 2015). Commenting out just to de-entangle CL deps.
// DCHECK(delegate_ == nullptr);
DCHECK_EQ(static_cast<MemoryDumpManagerDelegate*>(nullptr), delegate_);
delegate_ = delegate;
}
......
......@@ -401,8 +401,7 @@ void ChildThreadImpl::Init(const Options& options) {
channel_->AddFilter(bluetooth_message_filter_->GetFilter());
channel_->AddFilter(navigator_connect_dispatcher_->GetFilter());
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess)) {
if (!IsInBrowserProcess()) {
// In single process mode, browser-side tracing will cover the whole
// process including renderers.
channel_->AddFilter(new tracing::ChildTraceMessageFilter(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment