New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 596736 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

"Swapped out" layering violation from content/common to content/shell

Project Member Reported by brettw@chromium.org, Mar 22 2016

Issue description

These patches:

https://codereview.chromium.org/1715573002
https://codereview.chromium.org/1067373005

Introduced includes from content/common to content/shell for swapped_out_messages.cc

I am trying to make GN's header checker pass on content so we don't introduce layering violations, and that's blocked on this laying violation.

content/shell is a test harness browser while content/common is linked into every process in the browser. Including content_shell_messages here also brings in other parts of content shell like shell_test_configuration.h and leak_detection_result.h into content/common. We need to find a way to do this that's not a layering violation.

Perhaps content_shell needs it's own superclass of the swapped out messages filter.
 
Cc: nasko@chromium.org
AFAICT are 2 options that would work in the short-term:

1. Extra abstraction for this kind of filtering (this would have to be public API of //content)

   1.1. Suboption #1: add CanSendWhileSwappedOut method to content::BrowserClient interface

   1.2. Suboption #2: add AllowSendWhileSwappedOutForLayoutTests function

   - It would be sad if the swapped-out / layout tests mess forced us to add a new abstraction and exposing it via a public API.  I'd rather clean-up the mess, but maybe the new API is best for the short-term?

2. Send messages via an arbitrary local frame

   - No new public API this way, but this makes layout test IPC messaging model even messier.
   - Additionally, I heard concerns (from dcheng@?  from nasko@?) that a local frame might not always exist.


In the long-term we need to clean-up how layout tests do their IPC (so they don't need  to send stuff through a swapped-out RenderView).  Unfortunately, at this point we don't yet have a clear plan how to get there... :-/


Also - nasko@ can comment on the feasibility and timeline of removing swapped-out filtering altogether.  The last time I heard, there were security concerns around removing the filtering.


Let me chat with Nasko and I think we can go forward with option 1.1. above.
Cc: jochen@chromium.org

Comment 3 by jochen@chromium.org, Mar 22 2016

Owner: lukasza@chromium.org
Status: Assigned (was: Untriaged)
Option #3) revert the CL and skip the tests that stop passing.

I think we should do 1.1)
Status: Started (was: Assigned)
nasko@ pointed out that there already is ContentClient::CanSendWhileSwappedOut - let me try to use this one.

Comment 5 by nasko@chromium.org, Mar 22 2016

Just to clarify the removing of swapped out filtering. It is already gone from RenderFrame(Host). However, we cannot remove it from RenderView(Host) quite yet, as we need to ensure all IPCs are either Widget or Page, so we can reason about which can be received when. So for a little while longer, filtering will stay on RV(H).

Comment 6 by jam@chromium.org, Mar 22 2016

I just saw this bug. i had done a fix already earlier today in https://codereview.chromium.org/1821243002/
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6334088eca79889051fd0abb44033d80d5d24c7d

commit 6334088eca79889051fd0abb44033d80d5d24c7d
Author: brettw <brettw@chromium.org>
Date: Tue Mar 22 17:09:49 2016

Make most of content/common pass gn check

This fixes all but one bug in content/common. That bug is filed separately as:
BUG= 596736 

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

Cr-Commit-Position: refs/heads/master@{#382591}

[modify] https://crrev.com/6334088eca79889051fd0abb44033d80d5d24c7d/content/common/BUILD.gn
[modify] https://crrev.com/6334088eca79889051fd0abb44033d80d5d24c7d/content/content_common.gypi
[modify] https://crrev.com/6334088eca79889051fd0abb44033d80d5d24c7d/sandbox/linux/BUILD.gn

Project Member

Comment 8 by bugdroid1@chromium.org, Mar 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309

commit 80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309
Author: lukasza <lukasza@chromium.org>
Date: Tue Mar 22 23:13:19 2016

More strict restrictions for content -> content/shell dependencies.

This CL removes content -> content/shell layering violation around
swapped-out filtering, by moving the filtering code into
LayoutTestContentClient in the appropriate layer.

This CL also tweaks content/DEPS to restricts allowed dependencies, by
expanding a comment into an actual DEPS rule that only allows content/shell
dependency for browser tests.

Additionally, a DEPS exception in content/common/DEPS is not needed anymore
(per https://codereview.chromium.org/1777503003/diff/20001/content/common/DEPS#newcode70).

BUG= 357747 ,  596736 

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

Cr-Commit-Position: refs/heads/master@{#382725}

[modify] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/DEPS
[modify] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/common/DEPS
[modify] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/common/swapped_out_messages.cc
[modify] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/content_shell.gypi
[modify] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/shell/BUILD.gn
[modify] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/shell/app/shell_main_delegate.cc
[modify] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/shell/app/shell_main_delegate.h
[add] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/shell/common/layout_test/layout_test_content_client.cc
[add] https://crrev.com/80f7f60ce8e7c651c0d3d5957fbbb4ffe9972309/content/shell/common/layout_test/layout_test_content_client.h

Status: Fixed (was: Started)
Labels: Test-Layout

Sign in to add a comment