Commit 05311019 authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

Always remove previous connection filter in RenderProcessHostImpl before creating a new one.

Otherwise the previous one will outlive the RenderProcessHostImpl and
may trigger flaky crashes in some browser_tests.

BUG=835577
TEST=asan bots
R=rockot@chromium.org,piman@chromium.org
TBR=sky@chromium.org

Change-Id: Ie4c186866a7ada2dff523e3d9168f44b97503472
Reviewed-on: https://chromium-review.googlesource.com/1034017Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554876}
parent 82c8626c
......@@ -769,13 +769,6 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreForeignTab) {
}
IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreForeignSession) {
#if defined(ADDRESS_SANITIZER)
// TODO(lukasza): https://crbug.com/835578: Flaky UaF when running with
// site-per-process.
if (content::AreAllSitesIsolatedForTesting())
return;
#endif
Profile* profile = browser()->profile();
GURL url1("http://google.com");
......
......@@ -794,13 +794,6 @@ IN_PROC_BROWSER_TEST_F(TabRestoreTest, RestoreOnStartup) {
// same thing.
IN_PROC_BROWSER_TEST_F(TabRestoreTest,
RestoreFirstBrowserWhenSessionServiceEnabled) {
#if defined(ADDRESS_SANITIZER)
// TODO(lukasza): https://crbug.com/835577: Flaky UaF when running with
// site-per-process.
if (content::AreAllSitesIsolatedForTesting())
return;
#endif
// Do not exit from test when last browser is closed.
ScopedKeepAlive keep_alive(KeepAliveOrigin::SESSION_RESTORE,
KeepAliveRestartOption::DISABLED);
......
......@@ -2051,6 +2051,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
ServiceManagerConnection* service_manager_connection =
BrowserContext::GetServiceManagerConnectionFor(browser_context_);
if (connection_filter_id_ !=
ServiceManagerConnection::kInvalidConnectionFilterId) {
connection_filter_controller_->DisableFilter();
service_manager_connection->RemoveConnectionFilter(connection_filter_id_);
}
std::unique_ptr<ConnectionFilterImpl> connection_filter(
new ConnectionFilterImpl(child_connection_->child_identity(),
std::move(registry)));
......
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