Commit aef85588 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Add WebLayer split when chrome is in isolated split

This change pulls weblayer out of the base module and into the chrome
module. WebLayer supports being loaded from a "weblayer" split, so an
empty split is created which depends on the "chrome" split (which has
the weblayer implementation). WebLayer java was not added directly to
the "weblayer" split, because it would end up pulling a bunch of code
shared with chrome into the base module.

Bug: 1126301
Change-Id: I78aaec57a9b970bec964c36421d759bbbf7039eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463963Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817305}
parent e235a4e8
......@@ -2075,7 +2075,7 @@ android_library("base_monochrome_module_java") {
]
deps = [
":base_module_java",
"//android_webview:android_webview_java",
"//android_webview:android_webview_no_weblayer_java",
"//base:base_java",
"//chrome/browser/version:java",
"//components/version_info/android:version_constants_java",
......
......@@ -6,6 +6,13 @@ import("//build/config/android/config.gni")
import("//build/config/compiler/compiler.gni")
import("//device/vr/buildflags/buildflags.gni")
declare_args() {
# Whether //chrome code and resources are in a DFM for Monochrome and
# Trichrome bundles. This module will also include code and resources from all
# other DFMs.
enable_chrome_module = false
}
# If true, lld is used to partition feature code into separate libraries, which
# in turn are included in Dynamic Feature Modules.
use_native_partitions = is_android && is_clang && use_lld && !is_component_build
......@@ -8,13 +8,6 @@ import("//build/util/version.gni")
import("//chrome/android/modules/chrome_feature_module_tmpl.gni")
import("//components/module_installer/android/module_desc_java.gni")
declare_args() {
# Whether //chrome code and resources are in a DFM for Monochrome and
# Trichrome bundles. This module will also include code and resources from all
# other DFMs.
enable_chrome_module = false
}
# Instantiates a Chrome-specific app bundle.
#
# Supports most variables of chrome_feature_module and android_app_bundle, plus:
......@@ -51,22 +44,28 @@ template("chrome_bundle") {
_paks = []
_pak_deps = []
foreach(_module_desc, invoker.module_descs) {
_module_desc_target_name =
"${target_name}__${_module_desc.name}__module_desc_java"
module_desc_java(_module_desc_target_name) {
module_name = _module_desc.name
if (defined(_module_desc.pak_deps)) {
paks = _module_desc.paks
if (defined(_module_desc.supports_isolated_split) &&
_module_desc.supports_isolated_split) {
_module_descs += [ _module_desc ]
} else {
_module_desc_target_name =
"${target_name}__${_module_desc.name}__module_desc_java"
module_desc_java(_module_desc_target_name) {
module_name = _module_desc.name
if (defined(_module_desc.pak_deps)) {
paks = _module_desc.paks
}
if (defined(_module_desc.load_native_on_get_impl)) {
load_native_on_get_impl = _module_desc.load_native_on_get_impl
}
}
if (defined(_module_desc.load_native_on_get_impl)) {
load_native_on_get_impl = _module_desc.load_native_on_get_impl
_java_deps +=
_module_desc.java_deps + [ ":${_module_desc_target_name}" ]
if (defined(_module_desc.pak_deps)) {
_paks += _module_desc.paks
_pak_deps += _module_desc.pak_deps
}
}
_java_deps += _module_desc.java_deps + [ ":${_module_desc_target_name}" ]
if (defined(_module_desc.pak_deps)) {
_paks += _module_desc.paks
_pak_deps += _module_desc.pak_deps
}
}
chrome_module_desc = {
name = "chrome"
......
......@@ -16,6 +16,8 @@ import("//chrome/android/modules/image_editor/image_editor_module.gni")
import("//chrome/android/modules/stack_unwinder/stack_unwinder_module.gni")
import("//chrome/android/modules/test_dummy/test_dummy_module.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//weblayer/variables.gni")
import("//weblayer/weblayer_module.gni")
if (enable_vr) {
import("//chrome/android/features/vr/vr_module.gni")
......@@ -40,6 +42,8 @@ if (enable_arcore) {
# library files going into module if the module is executed in 64 bit.
# pak_deps: (Optional) Grit or repack targets of PAKs going into module.
# paks: (Optional) PAKs going into module.
# supports_isolated_split: (Optional) Whether this module can be in its own
# isolated split.
# Each new module needs to add a desc to one of the lists below.
# Modules shipped in Chrome Modern (Android L+).
......@@ -76,3 +80,9 @@ monochrome_module_descs += [ cablev2_authenticator_module_desc ]
# Modules shipped in Trichrome (Android Q+).
trichrome_module_descs = monochrome_module_descs
# Add this after we assign trichrome_module_descs, since WebLayer should only be
# part of Monochrome.
if (enable_chrome_module && webview_includes_weblayer) {
monochrome_module_descs += [ weblayer_module_desc ]
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2020 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="weblayer">
<uses-split android:name="chrome" />
<dist:module dist:onDemand="false">
<dist:fusing dist:include="true" />
</dist:module>
<application />
</manifest>
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
weblayer_module_desc = {
name = "weblayer"
android_manifest = "//weblayer/browser/java/AndroidManifest_monochrome.xml"
supports_isolated_split = true
}
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