[DevUI DFM] Add helpers to load native resources in "dev_ui_resources.pak".
This CL adds helper functions to load DevUI DFM native resources.
* Add enum chrome::FILE_DEV_UI_RESOURCES_PACK to specify path for
"dev_ui_resources.pak" on Android.
* Add LoadAndroidDevUiPackFile().
* Adds another {file descriptor, memory mapped file regions} global
variable in resource_bundle_android.h. All these will be cleaned up
in the future.
* Add LoadDevUiResources() (in new file) as the main function to call
to load DevUI DFM resources (hidden behind DFMIFY_DEV_UI).
* There's no need for a function to return the file descriptor of
"dev_ui_resources.pak", because we do not intend to forward it to
child processes.
Bug: 927131
Change-Id: I0c4e42e33b959d0a022f1287748573ebaf79c685
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769218
Reviewed-by: Nico Weber <[email protected]>
Reviewed-by: Samuel Huang <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Commit-Queue: Samuel Huang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#691672}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 537e2f91..da255a9 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -35,6 +35,7 @@
# produces a conflict for the "grit" template so we have to only include one.
if (is_android) {
import("//build/config/android/rules.gni")
+ import("//chrome/android/features/dev_ui/dev_ui_module.gni")
} else {
import("//tools/grit/grit_rule.gni")
}
@@ -2380,6 +2381,8 @@
"android/devtools_manager_delegate_android.h",
"android/devtools_server.cc",
"android/devtools_server.h",
+ "android/dfm_resource_bundle_helper.cc",
+ "android/dfm_resource_bundle_helper.h",
"android/digital_asset_links/digital_asset_links_handler.cc",
"android/digital_asset_links/digital_asset_links_handler.h",
"android/document/document_web_contents_delegate.cc",
@@ -2884,6 +2887,7 @@
"translate/android/translate_bridge.cc",
]
public_deps += [
+ "//chrome/android/features/dev_ui:buildflags",
"//components/image_fetcher/core",
"//components/ntp_snippets",
]