Extend the multidex logic to only kick in for the main browser application.

For each Application instances that falls into the Multidex path,
there is a regression in startup time as it must bootstrap the
classloader to be able to access the additional sources.

During a normal run of Chrome on Android, there are three Application
instances created (Main Browser, Renderer, and GPU).

The renderer process is an isolated process, which was being skipped
with the existing check in this file.

The problem is with the GPU process.  We had the assumption that all
non-isolated processes would only be hit once by the Multidex startup
regression, but it turns out that any Application in a different
process is hit by the same slowdown.  This means that the first time
the page attempts to paint anything, you see a hang as the GPU process
is attempting to initialize.

This results in a bunch of tests (mainly on K builds on slow devices)
to start flaking as they timeout trying to load the first non
about:blank page.

This change extends the existing check for isolated process to also
skip initializing multi dex for anything running in a separate
process.  As a result, anything running in a different process will
need to ensure all code is included in the main dex or force the
additional dex files to be loaded (not as of yet needed), but we
no longer see the slow down on basic operations in Chrome.

BUG=560600

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

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


CrOS-Libchrome-Original-Commit: ae7c11660f7b39f2d5c4dc28baf404a45aa0fc2d
1 file changed
tree: 3bf1ba6b76f89528baa0e928715defb4238cf67d
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/