Skip to content

Commit

Permalink
Mass refactoring: Change JNI #includes to use full paths (components/).
Browse files Browse the repository at this point in the history
Using relative paths was causing build failures. To create this change:
  * find out/Debug -name *_jni.h -delete
  * find . -name BUILD.gn -exec sed -i '/jni_package =/d' {} \;
  * ninja $ALL_JNI_HEADERS minus third_party, chromecast, cronet, libassistant
  * refactor_jni_includes.py  --out-dir out/Debug
  * fix DEPs files manually
  * split out components/ changes into this cl

See https://groups.google.com/a/chromium.org/forum/?#!topic/java/MEovGrAwbqI
for discussion on naming scheme.

Bug: 964169
Change-Id: I4f6fa72e33092dc5f9a2ad78a4d410c881e244e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1669082
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671473}
  • Loading branch information
m0hamed authored and Commit Bot committed Jun 22, 2019
1 parent b67de83 commit bd64131
Show file tree
Hide file tree
Showing 146 changed files with 99 additions and 155 deletions.
2 changes: 1 addition & 1 deletion components/about_ui/DEPS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_rules = [
"+components/about_ui/android/about_ui_jni_headers",
"+components/grit/components_resources.h",
"+jni",
"+third_party/brotli",
"+ui/base",
]
1 change: 0 additions & 1 deletion components/about_ui/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ generate_jni("about_ui_jni_headers") {
sources = [
"java/src/org/chromium/components/aboutui/CreditUtils.java",
]
jni_package = "components/about_ui"
}

android_library("aboutui_java") {
Expand Down
2 changes: 1 addition & 1 deletion components/about_ui/credit_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#if defined(OS_ANDROID)
#include "base/files/file.h"
#include "jni/CreditUtils_jni.h"
#include "components/about_ui/android/about_ui_jni_headers/CreditUtils_jni.h"
#endif

namespace about_ui {
Expand Down
2 changes: 1 addition & 1 deletion components/autofill/DEPS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include_rules = [
"+components/autofill/android/jni_headers",
"+components/prefs",
"+components/strings/grit/components_strings.h",
"+google_apis/gaia/gaia_urls.h",
"+jni",
"+net",
"+third_party/skia",
"+third_party/zlib/google",
Expand Down
1 change: 0 additions & 1 deletion components/autofill/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ generate_jni("jni_headers") {
"java/src/org/chromium/components/autofill/FormData.java",
"java/src/org/chromium/components/autofill/FormFieldData.java",
]
jni_package = "autofill"
}

static_library("provider") {
Expand Down
2 changes: 1 addition & 1 deletion components/autofill/android/autofill_provider_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "components/autofill/android/form_data_android.h"
#include "components/autofill/android/jni_headers/AutofillProvider_jni.h"
#include "components/autofill/core/browser/autofill_handler_proxy.h"
#include "components/autofill/core/common/autofill_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "jni/AutofillProvider_jni.h"
#include "ui/gfx/geometry/rect_f.h"

using base::android::AttachCurrentThread;
Expand Down
2 changes: 1 addition & 1 deletion components/autofill/android/form_data_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "base/android/jni_string.h"
#include "components/autofill/android/form_field_data_android.h"
#include "components/autofill/android/jni_headers/FormData_jni.h"
#include "components/autofill/core/browser/form_structure.h"
#include "jni/FormData_jni.h"

using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF16;
Expand Down
2 changes: 1 addition & 1 deletion components/autofill/android/form_field_data_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "components/autofill/android/jni_headers/FormFieldData_jni.h"
#include "components/autofill/core/common/autofill_util.h"
#include "jni/FormFieldData_jni.h"

using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF16;
Expand Down
2 changes: 1 addition & 1 deletion components/bookmarks/DEPS
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include_rules = [
"+components/bookmarks/common/android/bookmarks_jni_headers",
"+components/favicon_base",
"+components/keyed_service",
"+components/pref_registry",
"+components/prefs",
"+components/query_parser",
"+components/strings/grit/components_strings.h",
"+components/url_formatter",
"+jni",
"+net/base",
"+ui",
]
Expand Down
1 change: 0 additions & 1 deletion components/bookmarks/common/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ android_library("bookmarks_java") {
}

generate_jni("bookmarks_jni_headers") {
jni_package = "components/bookmarks"
sources = [
"java/src/org/chromium/components/bookmarks/BookmarkId.java",
]
Expand Down
2 changes: 1 addition & 1 deletion components/bookmarks/common/android/bookmark_id.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "components/bookmarks/common/android/bookmark_id.h"

#include "jni/BookmarkId_jni.h"
#include "components/bookmarks/common/android/bookmarks_jni_headers/BookmarkId_jni.h"

namespace bookmarks {
namespace android {
Expand Down
1 change: 0 additions & 1 deletion components/content_capture/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ generate_jni("jni_headers") {
"java/src/org/chromium/components/content_capture/ContentCaptureFeatures.java",
"java/src/org/chromium/components/content_capture/ContentCaptureReceiverManager.java",
]
jni_package = "content_capture"
}
2 changes: 1 addition & 1 deletion components/content_capture/android/DEPS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_rules = [
"+components/content_capture/android/jni_headers",
"+content/public/android",
"+content/public/browser",
"+jni",
"+third_party/re2",
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_array.h"
#include "base/no_destructor.h"
#include "jni/ContentCaptureController_jni.h"
#include "components/content_capture/android/jni_headers/ContentCaptureController_jni.h"
#include "third_party/re2/src/re2/re2.h"

using base::android::AppendJavaStringArrayToStringVector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/content_capture/android/jni_headers/ContentCaptureFeatures_jni.h"
#include "components/content_capture/common/content_capture_features.h"
#include "jni/ContentCaptureFeatures_jni.h"

static jboolean JNI_ContentCaptureFeatures_IsEnabled(JNIEnv* env) {
return content_capture::features::IsContentCaptureEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "components/content_capture/android/content_capture_controller.h"
#include "components/content_capture/android/jni_headers/ContentCaptureData_jni.h"
#include "components/content_capture/android/jni_headers/ContentCaptureReceiverManager_jni.h"
#include "content/public/browser/web_contents.h"
#include "jni/ContentCaptureData_jni.h"
#include "jni/ContentCaptureReceiverManager_jni.h"

using base::android::AttachCurrentThread;
using base::android::ConvertUTF16ToJavaString;
Expand Down
2 changes: 0 additions & 2 deletions components/crash/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ _jni_sources = [

generate_jni("jni_headers") {
sources = _jni_sources
jni_package = "crash"
}

java_cpp_enum("java_enums_srcjar") {
Expand Down Expand Up @@ -58,7 +57,6 @@ _java_handler_jni_sources =

generate_jni("java_handler_jni_headers") {
sources = _java_handler_jni_sources
jni_package = "crashpad"
}

android_library("handler_java") {
Expand Down
2 changes: 1 addition & 1 deletion components/crash/android/DEPS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_rules = [
"+jni",
"+components/crash/android/jni_headers",
"+third_party/crashpad",
]
2 changes: 1 addition & 1 deletion components/crash/android/crash_keys_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "components/crash/android/jni_headers/CrashKeys_jni.h"
#include "components/crash/core/common/crash_key.h"
#include "jni/CrashKeys_jni.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion components/crash/android/crashpad_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "jni/CrashpadMain_jni.h"
#include "components/crash/android/java_handler_jni_headers/CrashpadMain_jni.h"
#include "third_party/crashpad/crashpad/client/client_argv_handling.h"
#include "third_party/crashpad/crashpad/handler/handler_main.h"

Expand Down
2 changes: 1 addition & 1 deletion components/crash/content/app/DEPS
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include_rules = [
"+sandbox",

"+components/crash/android/jni_headers",
"+components/browser_watcher/stability_report_user_stream_data_source.h",
"+components/gwp_asan/crash_handler/crash_handler.h",
"+content/public/common/content_descriptors.h",
"+content/public/common/result_codes.h",
"+jni",
"+third_party/crashpad",
"+third_party/lss/linux_syscall_support.h",
]
2 changes: 1 addition & 1 deletion components/crash/content/app/crashpad_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "components/crash/android/jni_headers/PackagePaths_jni.h"
#include "components/crash/content/app/crash_reporter_client.h"
#include "content/public/common/content_descriptors.h"
#include "jni/PackagePaths_jni.h"
#include "sandbox/linux/services/syscall_wrappers.h"
#include "third_party/crashpad/crashpad/client/annotation.h"
#include "third_party/crashpad/crashpad/client/client_argv_handling.h"
Expand Down
2 changes: 1 addition & 1 deletion components/crash/content/browser/DEPS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include_rules = [
"+components/crash/android/jni_headers",
"+content/public/browser",
"+content/public/common",
"+content/public/test",
"+jni",
"+mojo/public/cpp/bindings",
"+third_party/blink/public/mojom/crash/crash_memory_metrics_reporter.mojom.h",
"+third_party/blink/public/common/oom_intervention"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "base/task/post_task.h"
#include "base/task/task_traits.h"
#include "base/threading/scoped_blocking_call.h"
#include "components/crash/android/jni_headers/ChildProcessCrashObserver_jni.h"
#include "components/crash/content/browser/crash_metrics_reporter_android.h"
#include "jni/ChildProcessCrashObserver_jni.h"

namespace crash_reporter {

Expand Down
2 changes: 0 additions & 2 deletions components/cronet/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ generate_jni("cronet_jni_headers") {
"java/src/org/chromium/net/impl/CronetUrlRequest.java",
"java/src/org/chromium/net/impl/CronetUrlRequestContext.java",
]
jni_package = "cronet"
}

generate_jni_registration("cronet_jni_registration") {
Expand Down Expand Up @@ -706,7 +705,6 @@ if (!is_component_build) {
"test/src/org/chromium/net/QuicTestServer.java",
"test/src/org/chromium/net/TestUploadDataStreamHandler.java",
]
jni_package = "cronet_tests"
}

shared_library("cronet_tests") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "components/cronet/android/cronet_jni_headers/CronetBidirectionalStream_jni.h"
#include "components/cronet/android/cronet_url_request_context_adapter.h"
#include "components/cronet/android/io_buffer_with_byte_buffer.h"
#include "components/cronet/android/url_request_error.h"
#include "components/cronet/metrics_util.h"
#include "jni/CronetBidirectionalStream_jni.h"
#include "net/base/http_user_agent_settings.h"
#include "net/base/net_errors.h"
#include "net/base/request_priority.h"
Expand Down
2 changes: 1 addition & 1 deletion components/cronet/android/cronet_library_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include "base/task/thread_pool/thread_pool.h"
#include "build/build_config.h"
#include "components/cronet/android/buildflags.h"
#include "components/cronet/android/cronet_jni_headers/CronetLibraryLoader_jni.h"
#include "components/cronet/cronet_global_state.h"
#include "components/cronet/version.h"
#include "jni/CronetLibraryLoader_jni.h"
#include "net/android/network_change_notifier_factory_android.h"
#include "net/base/network_change_notifier.h"
#include "net/proxy_resolution/proxy_config_service_android.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/cronet/android/cronet_jni_headers/CronetUploadDataStream_jni.h"
#include "components/cronet/android/cronet_url_request_adapter.h"
#include "components/cronet/android/io_buffer_with_byte_buffer.h"
#include "jni/CronetUploadDataStream_jni.h"

using base::android::JavaParamRef;

Expand Down
2 changes: 1 addition & 1 deletion components/cronet/android/cronet_url_request_adapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "components/cronet/android/cronet_jni_headers/CronetUrlRequest_jni.h"
#include "components/cronet/android/cronet_url_request_context_adapter.h"
#include "components/cronet/android/io_buffer_with_byte_buffer.h"
#include "components/cronet/android/url_request_error.h"
#include "components/cronet/metrics_util.h"
#include "jni/CronetUrlRequest_jni.h"
#include "net/base/load_flags.h"
#include "net/base/load_states.h"
#include "net/base/net_errors.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
#include "base/time/time.h"
#include "base/values.h"
#include "components/cronet/android/buildflags.h"
#include "components/cronet/android/cronet_jni_headers/CronetUrlRequestContext_jni.h"
#include "components/cronet/android/cronet_library_loader.h"
#include "components/cronet/cronet_prefs_manager.h"
#include "components/cronet/histogram_manager.h"
#include "components/cronet/host_cache_persistence_manager.h"
#include "components/cronet/url_request_context_config.h"
#include "jni/CronetUrlRequestContext_jni.h"
#include "net/base/load_flags.h"
#include "net/base/logging_network_change_observer.h"
#include "net/base/net_errors.h"
Expand Down
2 changes: 1 addition & 1 deletion components/cronet/android/test/cronet_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/cronet/android/cronet_tests_jni_headers/CronetTestUtil_jni.h"
#include "components/cronet/android/cronet_url_request_adapter.h"
#include "components/cronet/android/cronet_url_request_context_adapter.h"
#include "components/cronet/cronet_url_request.h"
#include "components/cronet/cronet_url_request_context.h"
#include "jni/CronetTestUtil_jni.h"
#include "net/socket/socket_test_util.h"
#include "net/url_request/url_request.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/logging.h"
#include "components/cronet/android/cronet_tests_jni_headers/CronetUrlRequestContextTest_jni.h"
#include "components/cronet/url_request_context_config.h"
#include "components/cronet/version.h"
#include "jni/CronetUrlRequestContextTest_jni.h"

using base::android::JavaParamRef;

Expand Down
2 changes: 1 addition & 1 deletion components/cronet/android/test/cronet_url_request_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "jni/CronetUrlRequestTest_jni.h"
#include "components/cronet/android/cronet_tests_jni_headers/CronetUrlRequestTest_jni.h"
#include "net/base/load_flags.h"

using base::android::JavaParamRef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "base/android/scoped_java_ref.h"
#include "base/bind.h"
#include "base/time/time.h"
#include "components/cronet/android/cronet_tests_jni_headers/ExperimentalOptionsTest_jni.h"
#include "components/cronet/android/test/cronet_test_util.h"
#include "jni/ExperimentalOptionsTest_jni.h"
#include "net/base/address_family.h"
#include "net/base/net_errors.h"
#include "net/dns/host_cache.h"
Expand Down
2 changes: 1 addition & 1 deletion components/cronet/android/test/mock_cert_verifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/test/test_support_android.h"
#include "components/cronet/android/cronet_tests_jni_headers/MockCertVerifier_jni.h"
#include "crypto/sha2.h"
#include "jni/MockCertVerifier_jni.h"
#include "net/base/net_errors.h"
#include "net/cert/asn1_util.h"
#include "net/cert/cert_verifier.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/bind.h"
#include "components/cronet/android/cronet_tests_jni_headers/MockUrlRequestJobFactory_jni.h"
#include "components/cronet/android/test/cronet_test_util.h"
#include "jni/MockUrlRequestJobFactory_jni.h"
#include "net/test/url_request/ssl_certificate_error_job.h"
#include "net/test/url_request/url_request_failed_job.h"
#include "net/test/url_request/url_request_hanging_read_job.h"
Expand Down
2 changes: 1 addition & 1 deletion components/cronet/android/test/native_test_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "base/android/jni_string.h"
#include "base/files/file_path.h"
#include "base/test/test_support_android.h"
#include "components/cronet/android/cronet_tests_jni_headers/NativeTestServer_jni.h"
#include "components/cronet/test/test_server.h"
#include "jni/NativeTestServer_jni.h"

using base::android::JavaParamRef;
using base::android::ScopedJavaLocalRef;
Expand Down
2 changes: 1 addition & 1 deletion components/cronet/android/test/quic_test_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "base/message_loop/message_loop.h"
#include "base/test/test_support_android.h"
#include "base/threading/thread.h"
#include "components/cronet/android/cronet_tests_jni_headers/QuicTestServer_jni.h"
#include "components/cronet/android/test/cronet_test_util.h"
#include "jni/QuicTestServer_jni.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/quic/crypto/proof_source_chromium.h"
Expand Down
Loading

0 comments on commit bd64131

Please sign in to comment.