
With MPArch (Multiple Page Architecture), we are introducing the ability for a single WebContents to have multiple pages and therefore multiple main frames. Based on an audit of existing uses of IsInMainFrame, we expect most callers are only interested in the "primary" main frame. Accordingly, we perform a bulk rewrite of IsInMainFrame calls to IsInPrimaryMainFrame in order to preserve the existing semantics. The methodology is as follows: Run the following script: find extensions/ -type f \( -name "*.cc" -o -name "*.h" -o -name "*.mm" \) -a \! \( -name "*unittest.cc" -o -name "*browsertest.cc" \) -exec sed --in-place --file IsInMainFrame-rewrite-script {} \; where IsInMainFrame-rewrite-script contains: /[Ii]sInMainFrame(/ i\ \/\/ TODO(https:\/\/crbug.com\/1218946): Comment goes here. s/\([Ii]\)sInMainFrame(/\1sInPrimaryMainFrame(/g Patchset 1 contains the result of the purely mechanical part of this change. Patchset 2 reverts changes to navigation throttles which are not part of this rewrite. Patchset 3 reverts conversions that are noticeably incorrect. Bug: 1218946 Change-Id: I53fb7011a02b80f00bcef65396559ac20b0d075e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2995069 Reviewed-by: Lucas Gadani <lfg@chromium.org> Commit-Queue: Kevin McNee <mcnee@chromium.org> Cr-Commit-Position: refs/heads/master@{#902501}
This will become a reusable extensions module. It implements the core parts of Chrome's extension system, and can be used with any host of the content module.
Some extensions code that is not Chrome-specific still lives in //chrome/browser/extensions and will be moved here.
Technical Documentation: