Skip to content

Commit

Permalink
Avoid reinitializing IdentifiabilityStudySettings in single process
Browse files Browse the repository at this point in the history
Don't initialize the process-global IdentifiabilityStudySettings from
the renderer if in single-process mode. This makes it possible to run
debug chromium in single-process.

Bug: 1128395
Change-Id: I06b0fefd00d4bae48e090378526fbdafcfc8990c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551127
Reviewed-by: Asanka Herath <asanka@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829714}
  • Loading branch information
jmajnert authored and Commit Bot committed Nov 20, 2020
1 parent b01e68c commit 8307d05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ James Wei <james.wei@intel.com>
James Willcox <jwillcox@litl.com>
Jan Rucka <ruckajan10@gmail.com>
Jan Sauer <jan@jansauer.de>
Janusz Majnert <jmajnert@gmail.com>
Janwar Dinata <j.dinata@gmail.com>
Jared Shumway <jaredshumway94@gmail.com>
Jared Sohn <jared.sohn@gmail.com>
Expand Down
9 changes: 5 additions & 4 deletions chrome/renderer/chrome_content_renderer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,18 +440,19 @@ void ChromeContentRendererClient::RenderThreadStarted() {
WebString::FromASCII(scheme));
}

// This doesn't work in single-process mode.
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess)) {
// This doesn't work in single-process mode.
ThreadProfiler::SetMainThreadTaskRunner(
base::ThreadTaskRunnerHandle::Get());
mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector;
thread->BindHostReceiver(collector.InitWithNewPipeAndPassReceiver());
ThreadProfiler::SetCollectorForChildProcess(std::move(collector));
}

blink::IdentifiabilityStudySettings::SetGlobalProvider(
std::make_unique<PrivacyBudgetSettingsProvider>());
// This is superfluous in single-process mode and triggers a DCHECK
blink::IdentifiabilityStudySettings::SetGlobalProvider(
std::make_unique<PrivacyBudgetSettingsProvider>());
}
}

void ChromeContentRendererClient::ExposeInterfacesToBrowser(
Expand Down

0 comments on commit 8307d05

Please sign in to comment.