Commit 39b89786 authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

Fix crash in FilterInterfacesImpl when the process is dead.

Several tests are crashing because FilterInterfacesImpl() is called when
starting a dedicated worker in a process that was never initialized or
is dead, and process->GetChildIdentity() has a DCHECK against that.
There is already an early return for a null process, so also check if
it's alive.

Bug: 1010866
Change-Id: I397e493456f1d61abfe3e247d7bc7d4c29cc6954
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1868769Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707355}
parent d9f160fd
......@@ -184,7 +184,7 @@ IN_PROC_BROWSER_TEST_F(NetworkErrorScreenTest, ConnectRequestCallback) {
}
// Test HideCallback is called after screen hides.
IN_PROC_BROWSER_TEST_F(NetworkErrorScreenTest, DISABLED_HideCallback) {
IN_PROC_BROWSER_TEST_F(NetworkErrorScreenTest, HideCallback) {
bool callback_called = false;
GetScreen()->SetHideCallback(
base::BindLambdaForTesting([&]() { callback_called = true; }));
......
......@@ -147,8 +147,7 @@ IN_PROC_BROWSER_TEST_F(FingerprintSetupTest, FingerprintEnrollLimit) {
WaitForScreenExit();
}
// TODO(https://crbug.com/1009916): Fix flakes and re-enable.
IN_PROC_BROWSER_TEST_F(FingerprintSetupTest, DISABLED_FingerprintDisabled) {
IN_PROC_BROWSER_TEST_F(FingerprintSetupTest, FingerprintDisabled) {
quick_unlock::EnabledForTesting(false);
fingerprint_setup_screen_->Show();
......
......@@ -161,9 +161,7 @@ IN_PROC_BROWSER_TEST_F(HIDDetectionScreenTest,
// Test that if there is no Bluetooth device connected on HID screen, the
// Bluetooth adapter should be disabled after advancing to the next screen.
// Flaky. https://crbug.com/1010866
IN_PROC_BROWSER_TEST_F(HIDDetectionScreenTest,
DISABLED_NoBluetoothDeviceConnected) {
IN_PROC_BROWSER_TEST_F(HIDDetectionScreenTest, NoBluetoothDeviceConnected) {
OobeScreenWaiter(HIDDetectionView::kScreenId).Wait();
EXPECT_TRUE(adapter()->IsPowered());
......
......@@ -372,9 +372,7 @@ IN_PROC_BROWSER_TEST_F(WelcomeScreenBrowserTest,
ASSERT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
}
// Flaky. http://crbug.com/1010676
IN_PROC_BROWSER_TEST_F(WelcomeScreenBrowserTest,
DISABLED_A11yDockedMagnifierDisabled) {
IN_PROC_BROWSER_TEST_F(WelcomeScreenBrowserTest, A11yDockedMagnifierDisabled) {
welcome_screen_->Show();
OobeScreenWaiter(WelcomeView::kScreenId).Wait();
test::OobeJS().ExpectHiddenPath({"connect", "dockedMagnifierOobeOption"});
......
......@@ -25,7 +25,7 @@ void FilterInterfacesImpl(
service_manager::mojom::InterfaceProviderRequest request,
service_manager::mojom::InterfaceProviderPtr provider) {
RenderProcessHost* process = RenderProcessHost::FromID(process_id);
if (!process)
if (!process || !process->IsInitializedAndNotDead())
return;
service_manager::Connector* connector =
......
......@@ -554,8 +554,8 @@ RenderFrameHostImpl* DedicatedWorkerHost::GetAncestorRenderFrameHost() {
}
namespace {
// A factory for creating DedicatedWorkerHosts. Its lifetime is managed by
// the renderer over mojo via a StrongBinding. This lives on the UI thread.
// A factory for creating DedicatedWorkerHosts. Its lifetime is managed by the
// renderer over mojo via SelfOwnedReceiver. It lives on the UI thread.
class DedicatedWorkerHostFactoryImpl final
: public blink::mojom::DedicatedWorkerHostFactory {
public:
......
......@@ -360,6 +360,7 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender,
// 4. Possibly more stpes, depending on the ChildThreadImpl subclass.
virtual void BindReceiver(mojo::GenericPendingReceiver receiver) = 0;
// Can only be called when IsInitializedAndNotDead() is true.
virtual const service_manager::Identity& GetChildIdentity() = 0;
// Extracts any persistent-memory-allocator used for renderer metrics.
......
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