Commit 1e9b892b authored by Robbie McElrath's avatar Robbie McElrath Committed by Commit Bot

Reland "Don't include JNI headers in chrome android when they're not used."

This is a reland of 362070db

Original change's description:
> Don't include JNI headers in chrome android when they're not used.
> 
> This CL removes dependencies on JNI headers when they're not used and
> the Java implementation isn't included. This makes chrome_public_apk
> work with crrev.com/c/1743088.
> 
> Bug: 836335
> Change-Id: Iec02f4fec9cf93183949547960e191e675e62ebf
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1746641
> Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Changwan Ryu <changwan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#694921}

Bug: 836335
Change-Id: Id7307e38f44a0e07f9dc8cf6dbe350d5b76ba9ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1793943Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704819}
parent 507e1004
...@@ -386,6 +386,7 @@ source_set("webview_entry_point") { ...@@ -386,6 +386,7 @@ source_set("webview_entry_point") {
shared_library("libwebviewchromium") { shared_library("libwebviewchromium") {
deps = [ deps = [
":webview_entry_point", ":webview_entry_point",
"//components/about_ui:about_ui_android",
] ]
configs -= [ "//build/config/android:hide_all_but_jni_onload" ] configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ] configs += [ "//build/config/android:hide_all_but_jni" ]
......
...@@ -1420,6 +1420,7 @@ template("libmonochrome_apk_or_bundle_tmpl") { ...@@ -1420,6 +1420,7 @@ template("libmonochrome_apk_or_bundle_tmpl") {
] ]
deps = [ deps = [
"//android_webview:common", "//android_webview:common",
"//components/about_ui:about_ui_android",
"//components/crash/android:crashpad_main", "//components/crash/android:crashpad_main",
"//weblayer:weblayer_lib", "//weblayer:weblayer_lib",
] ]
...@@ -2468,7 +2469,6 @@ generate_jni("chrome_jni_headers") { ...@@ -2468,7 +2469,6 @@ generate_jni("chrome_jni_headers") {
"java/src/org/chromium/chrome/browser/complex_tasks/endpoint_fetcher/EndpointFetcher.java", "java/src/org/chromium/chrome/browser/complex_tasks/endpoint_fetcher/EndpointFetcher.java",
"java/src/org/chromium/chrome/browser/complex_tasks/endpoint_fetcher/EndpointResponse.java", "java/src/org/chromium/chrome/browser/complex_tasks/endpoint_fetcher/EndpointResponse.java",
"java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java", "java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java",
"java/src/org/chromium/chrome/browser/component_updater/VrAssetsComponentInstaller.java",
"java/src/org/chromium/chrome/browser/compositor/CompositorView.java", "java/src/org/chromium/chrome/browser/compositor/CompositorView.java",
"java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java", "java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java",
"java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java", "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java",
...@@ -2731,4 +2731,8 @@ generate_jni("chrome_jni_headers") { ...@@ -2731,4 +2731,8 @@ generate_jni("chrome_jni_headers") {
"feed/core/java/src/org/chromium/chrome/browser/feed/FeedSchedulerBridge.java", "feed/core/java/src/org/chromium/chrome/browser/feed/FeedSchedulerBridge.java",
] ]
} }
if (enable_vr) {
sources += [ "java/src/org/chromium/chrome/browser/component_updater/VrAssetsComponentInstaller.java" ]
}
} }
...@@ -13,8 +13,17 @@ static_library("about_ui") { ...@@ -13,8 +13,17 @@ static_library("about_ui") {
"//ui/base", "//ui/base",
"//ui/resources", "//ui/resources",
] ]
}
if (is_android) { if (is_android) {
deps += [ "//components/about_ui/android:about_ui_jni_headers" ] static_library("about_ui_android") {
sources = [
"credit_utils_android.cc",
]
deps = [
":about_ui",
"//base",
"//components/about_ui/android:about_ui_jni_headers",
]
} }
} }
...@@ -10,11 +10,6 @@ ...@@ -10,11 +10,6 @@
#include "components/grit/components_resources.h" #include "components/grit/components_resources.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#if defined(OS_ANDROID)
#include "base/files/file.h"
#include "components/about_ui/android/about_ui_jni_headers/CreditUtils_jni.h"
#endif
namespace about_ui { namespace about_ui {
std::string GetCredits(bool include_scripts) { std::string GetCredits(bool include_scripts) {
...@@ -30,12 +25,4 @@ std::string GetCredits(bool include_scripts) { ...@@ -30,12 +25,4 @@ std::string GetCredits(bool include_scripts) {
return response; return response;
} }
#if defined(OS_ANDROID)
static void JNI_CreditUtils_WriteCreditsHtml(JNIEnv* env, jint fd) {
std::string html_content = GetCredits(false);
base::File out_file(fd);
out_file.WriteAtCurrentPos(html_content.c_str(), html_content.size());
}
#endif
} // namespace about_ui } // namespace about_ui
// Copyright 2019 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.
#include "components/about_ui/credit_utils.h"
#include "base/files/file.h"
#include "components/about_ui/android/about_ui_jni_headers/CreditUtils_jni.h"
namespace about_ui {
static void JNI_CreditUtils_WriteCreditsHtml(JNIEnv* env, jint fd) {
std::string html_content = GetCredits(false);
base::File out_file(fd);
out_file.WriteAtCurrentPos(html_content.c_str(), html_content.size());
}
} // namespace about_ui
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