diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-18 14:34:04 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-10-04 11:15:27 +0000 |
commit | e6430e577f105ad8813c92e75c54660c4985026e (patch) | |
tree | 88115e5d1fb471fea807111924dcccbeadbf9e4f /chromium/components/cronet | |
parent | 53d399fe6415a96ea6986ec0d402a9c07da72453 (diff) | |
download | qtwebengine-chromium-e6430e577f105ad8813c92e75c54660c4985026e.tar.gz |
BASELINE: Update Chromium to 61.0.3163.99
Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/components/cronet')
-rw-r--r-- | chromium/components/cronet/android/BUILD.gn | 28 | ||||
-rw-r--r-- | chromium/components/cronet/ios/BUILD.gn | 244 | ||||
-rw-r--r-- | chromium/components/cronet/ios/cronet_consumer/BUILD.gn | 67 | ||||
-rw-r--r-- | chromium/components/cronet/ios/test/BUILD.gn | 3 |
4 files changed, 285 insertions, 57 deletions
diff --git a/chromium/components/cronet/android/BUILD.gn b/chromium/components/cronet/android/BUILD.gn index 811f6306288..4474e321496 100644 --- a/chromium/components/cronet/android/BUILD.gn +++ b/chromium/components/cronet/android/BUILD.gn @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//base/android/jni_generator/jni_exception_list.gni") import("//build/buildflag_header.gni") import("//build/config/android/config.gni") import("//build/config/android/rules.gni") @@ -25,6 +26,12 @@ generate_jni("cronet_jni_headers") { jni_package = "cronet" } +generate_jni_registration("cronet_jni_registration") { + target = ":cronet_sample_apk" + output = "$root_gen_dir/components/cronet/android/${target_name}.h" + exception_files = jni_exception_files +} + java_cpp_enum("effective_connection_type_java") { sources = [ "//net/nqe/effective_connection_type.h", @@ -165,6 +172,7 @@ template("cronet_static_tmpl") { deps = [ ":cronet_android_cert_proto", ":cronet_jni_headers", + ":cronet_jni_registration", ":cronet_version_header", "//base", "//base/third_party/dynamic_annotations", @@ -195,6 +203,8 @@ template("cronet_static_tmpl") { "//components/cronet/android/url_request_error.h", "//components/cronet/histogram_manager.cc", "//components/cronet/histogram_manager.h", + "//components/cronet/host_cache_persistence_manager.cc", + "//components/cronet/host_cache_persistence_manager.h", "//components/cronet/stale_host_resolver.cc", "//components/cronet/stale_host_resolver.h", "//components/cronet/url_request_context_config.cc", @@ -474,6 +484,7 @@ generate_jni("cronet_tests_jni_headers") { testonly = true sources = [ "test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java", + "test/javatests/src/org/chromium/net/ExperimentalOptionsTest.java", "test/src/org/chromium/net/CronetTestUtil.java", "test/src/org/chromium/net/MockCertVerifier.java", "test/src/org/chromium/net/MockUrlRequestJobFactory.java", @@ -499,6 +510,8 @@ shared_library("cronet_tests") { "test/cronet_test_util.h", "test/cronet_url_request_context_config_test.cc", "test/cronet_url_request_context_config_test.h", + "test/experimental_options_test.cc", + "test/experimental_options_test.h", "test/mock_cert_verifier.cc", "test/mock_cert_verifier.h", "test/mock_url_request_job_factory.cc", @@ -527,6 +540,9 @@ shared_library("cronet_tests") { ] include_dirs = [ _cronet_version_header_include_dir ] + + configs -= [ "//build/config/android:hide_all_but_jni_onload" ] + configs += [ "//build/config/android:hide_all_but_jni" ] } android_resources("cronet_test_apk_resources") { @@ -900,6 +916,7 @@ test("cronet_unittests") { sources = [ "//components/cronet/android/cert/cert_verifier_cache_serializer_unittest.cc", "//components/cronet/histogram_manager_unittest.cc", + "//components/cronet/host_cache_persistence_manager_unittest.cc", "//components/cronet/run_all_unittests.cc", "//components/cronet/stale_host_resolver_unittest.cc", "//components/cronet/url_request_context_config_unittest.cc", @@ -911,6 +928,7 @@ test("cronet_unittests") { "//base", "//base/test:test_support", "//components/metrics", + "//components/prefs:test_support", "//net", "//net:test_support", "//net/android:net_java", @@ -995,6 +1013,7 @@ action("extract_cronet_test_jars") { "$root_out_dir/lib.java/base/base_java_test_support.jar", "$root_out_dir/lib.java/components/cronet/android/cronet_javatests.jar", "$root_out_dir/lib.java/components/cronet/android/cronet_test_apk_java.jar", + "$root_out_dir/lib.java/net/android/embedded_test_server_aidl_java.jar", "$root_out_dir/lib.java/net/android/net_java.jar", "$root_out_dir/lib.java/net/android/net_java_test_support.jar", "$root_out_dir/lib.java/url/url_java.jar", @@ -1023,6 +1042,7 @@ action("extract_cronet_test_jars") { ":cronet_test_apk_java", "//base:base_java", "//base:base_java_test_support", + "//net/android:embedded_test_server_aidl_java", "//net/android:net_java", "//net/android:net_java_test_support", "//third_party/netty4:netty_all_java", @@ -1181,13 +1201,17 @@ jar_src("jar_cronet_impl_native_java_source") { action("generate_licenses") { _license_path = "$_package_dir/LICENSE" - script = "//components/cronet/tools/cronet_licenses.py" + script = "//tools/licenses.py" outputs = [ _license_path, ] args = [ - "license", + "license_file", rebase_path(_license_path, root_build_dir), + "--gn-target", + "//components/cronet/android:cronet", + "--gn-out-dir", + ".", ] } diff --git a/chromium/components/cronet/ios/BUILD.gn b/chromium/components/cronet/ios/BUILD.gn index 716fa0b47ef..3227d03ab13 100644 --- a/chromium/components/cronet/ios/BUILD.gn +++ b/chromium/components/cronet/ios/BUILD.gn @@ -32,34 +32,58 @@ process_version("cronet_version_header") { ] } -source_set("cronet_sources") { - deps = [ - ":cronet_version_header", - ":generate_accept_languages", - "//base:base", - "//components/grpc_support", - "//components/metrics:metrics", - "//components/metrics/proto:proto", - "//components/prefs:prefs", - "//ios/net:net", - "//ios/web:user_agent", - "//net", - "//url", - ] +config("cronet_include_config") { + include_dirs = [ "//components/grpc_support/include" ] +} - sources = [ - "../histogram_manager.cc", - "../histogram_manager.h", - "../stale_host_resolver.cc", - "../stale_host_resolver.h", - "../url_request_context_config.cc", - "../url_request_context_config.h", - "Cronet.h", - "Cronet.mm", - "cronet_c_for_grpc.h", - "cronet_environment.h", - "cronet_environment.mm", +config("cronet_static_config") { + libs = [ + "Cronet.framework", + "UIKit.Framework", + "CFNetwork.framework", + "MobileCoreServices.framework", + "Security.framework", + "SystemConfiguration.framework", + "resolv", ] + configs = [ ":cronet_include_config" ] +} + +_cronet_deps = [ + ":cronet_version_header", + ":generate_accept_languages", + "//base:base", + "//components/grpc_support", + "//components/metrics:metrics", + "//components/metrics/proto:proto", + "//components/prefs:prefs", + "//ios/net:net", + "//ios/web:user_agent", + "//ios/web/public/global_state", + "//net", + "//url", +] + +_cronet_sources = [ + "../histogram_manager.cc", + "../histogram_manager.h", + "../stale_host_resolver.cc", + "../stale_host_resolver.h", + "../url_request_context_config.cc", + "../url_request_context_config.h", + "Cronet.h", + "Cronet.mm", + "cronet_environment.h", + "cronet_environment.mm", +] + +_cronet_public_headers = [ "Cronet.h" ] +_cronet_public_headers += grpc_public_headers + +source_set("cronet_sources") { + deps = _cronet_deps + + sources = _cronet_sources include_dirs = [ "//components/grpc_support/include" ] @@ -85,17 +109,11 @@ ios_framework_bundle("cronet_framework") { libs = [ "UIKit.Framework" ] - include_dirs = [ "//components/grpc_support/include" ] - public_deps = [ "//components/grpc_support", ] - public_headers = [ - "Cronet.h", - "cronet_c_for_grpc.h", - ] - public_headers += grpc_public_headers + public_headers = _cronet_public_headers sources = [ "Cronet.h", @@ -103,6 +121,8 @@ ios_framework_bundle("cronet_framework") { configs -= [ "//build/config/compiler:default_symbols" ] configs += [ "//build/config/compiler:symbols" ] + + public_configs = [ ":cronet_include_config" ] } test("cronet_unittests") { @@ -137,26 +157,171 @@ action("generate_accept_languages") { ] } +# A static library which contains just _cronet_sources. +static_library("cronet_static") { + visibility = [ ":*" ] + deps = _cronet_deps + sources = _cronet_sources + public_configs = [ ":cronet_include_config" ] + public_deps = [ + "//components/grpc_support", + ] +} + +# A static library which contains all dependencies of :cronet_static. +static_library("cronet_deps_complete") { + visibility = [ ":*" ] + complete_static_lib = true + deps = [ + ":cronet_static", + ] +} + +# A static library which contains cronet and all dependendencies hidden inside. +action("cronet_static_complete") { + visibility = [ ":*" ] + script = "//components/cronet/tools/hide_symbols.py" + deps = [ + ":cronet_deps_complete", + ":cronet_static", + ] + outputs = [ + "$target_out_dir/$current_cpu/cronet_static_complete.a", + ] + args = [ + "--input_libs", + rebase_path("$target_out_dir/libcronet_static.a", root_build_dir), + "--deps_lib", + rebase_path("$target_out_dir/libcronet_deps_complete.a", root_build_dir), + "--output_obj", + rebase_path("$target_out_dir/$current_cpu/cronet_static_complete.o", + root_build_dir), + "--output_lib", + rebase_path("$target_out_dir/$current_cpu/cronet_static_complete.a", + root_build_dir), + "--current_cpu", + current_cpu, + ] + + if (!use_system_xcode) { + args += [ + "--developer_dir", + hermetic_xcode_path, + ] + } + + public_configs = [ ":cronet_static_config" ] +} + +# A fat static library which exports cronet public symbols and hides all dependendencies. +lipo_binary("libcronet") { + arch_binary_target = ":cronet_static_complete" + arch_binary_output = "cronet_static_complete.a" + output_name = "libcronet.a" + enable_stripping = false + enable_dsyms = false +} + +template("ios_static_framework") { + _target_name = target_name + _output_name = target_name + if (defined(invoker.output_name)) { + _output_name = invoker.output_name + } + _framework_name = target_name + if (defined(invoker.framework_name)) { + _framework_name = invoker.framework_name + } + + _bundle_target_name = _target_name + "_bundle" + _framework_headers_target = _target_name + "_framework_headers" + bundle_data(_framework_headers_target) { + visibility = [ ":$_bundle_target_name" ] + sources = invoker.public_headers + outputs = [ + "{{bundle_root_dir}}/Headers/{{source_file_part}}", + ] + } + + _framework_binary_target = _target_name + "_framework_binary" + _static_library_target = invoker.static_library_target + + bundle_data(_framework_binary_target) { + visibility = [ ":$_bundle_target_name" ] + sources = get_target_outputs(_static_library_target) + outputs = [ + "{{bundle_root_dir}}/$_framework_name", + ] + public_deps = [ + _static_library_target, + ] + } + + create_bundle(_bundle_target_name) { + product_type = "com.apple.product-type.framework" + bundle_root_dir = "$root_out_dir/Static/$_output_name" + bundle_executable_dir = bundle_root_dir + bundle_resources_dir = bundle_root_dir + bundle_plugins_dir = bundle_root_dir + deps = [ + ":$_framework_binary_target", + ":$_framework_headers_target", + ] + } + + action(_target_name) { + script = "//build/config/ios/dummy.py" + outputs = [ + "$root_out_dir/Static/$_output_name", + ] + deps = [ + ":$_bundle_target_name", + ] + public_configs = invoker.public_configs + } +} + +ios_static_framework("cronet_static_framework") { + output_name = "Cronet.framework" + framework_name = "Cronet" + public_headers = _cronet_public_headers + static_library_target = ":libcronet" + public_configs = [ ":cronet_static_config" ] +} + if (additional_toolchains == [] || current_toolchain == default_toolchain) { _package_dir = "$root_out_dir/cronet" action("generate_license") { _license_path = "$_package_dir/LICENSE" - script = "//components/cronet/tools/cronet_licenses.py" + script = "//tools/licenses.py" inputs = [ "//build/util/LASTCHANGE", - "//buildtools/$host_os/gn", ] outputs = [ _license_path, ] args = [ - "license", + "license_file", rebase_path(_license_path, root_build_dir), - "--gn", - "--gn-path", - rebase_path("//buildtools/$host_os/gn", root_build_dir), + "--gn-target", + "//components/cronet/ios:cronet_framework", + "--gn-out-dir", + ".", + ] + } + + copy("cronet_static_copy") { + sources = [ + "$root_out_dir/Static/Cronet.framework", + ] + outputs = [ + "$_package_dir/Static/Cronet.framework", + ] + + deps = [ + ":cronet_static_framework", ] } @@ -172,6 +337,7 @@ if (additional_toolchains == [] || current_toolchain == default_toolchain) { deps = [ ":cronet_framework", + ":cronet_static_copy", ] } diff --git a/chromium/components/cronet/ios/cronet_consumer/BUILD.gn b/chromium/components/cronet/ios/cronet_consumer/BUILD.gn index 966057c455d..ea1be9030a4 100644 --- a/chromium/components/cronet/ios/cronet_consumer/BUILD.gn +++ b/chromium/components/cronet/ios/cronet_consumer/BUILD.gn @@ -3,28 +3,63 @@ # found in the LICENSE file. import("//build/config/ios/rules.gni") +import("//ios/features.gni") -ios_app_bundle("cronet_consumer") { - info_plist = "cronet-consumer-Info.plist" +template("cronet_consumer_template") { + _target_name = target_name + ios_app_bundle(_target_name) { + info_plist = "cronet-consumer-Info.plist" + + deps = [ + "//base:base", + ] + + deps += invoker.deps + + sources = [ + "cronet_consumer_app_delegate.h", + "cronet_consumer_app_delegate.mm", + "cronet_consumer_view_controller.h", + "cronet_consumer_view_controller.m", + "main.mm", + ] + + forward_variables_from(invoker, + [ + "bundle_deps", + "cflags", + "ldflags", + ]) + + configs += [ "//build/config/compiler:enable_arc" ] + } +} + +cronet_consumer_template("cronet_consumer") { deps = [ - "//base:base", "//components/cronet/ios:cronet_framework+link", - - # All shared libraries must have the sanitizer deps to properly link in - # asan mode (this target will be empty in other cases). - "//build/config:exe_and_shlib_deps", ] + bundle_deps = [ "//components/cronet/ios:cronet_framework+bundle" ] +} - sources = [ - "cronet_consumer_app_delegate.h", - "cronet_consumer_app_delegate.mm", - "cronet_consumer_view_controller.h", - "cronet_consumer_view_controller.m", - "main.mm", - ] +# TODO(mef): Building "cronet_consumer_static" app with additional_target_cpus +# causes "cronet_static_framework" to build lipo_binary("libcronet") for +# duplicate architecture (e.g. arm64+arm64) and breaks the build. +if (!defined(additional_target_cpus)) { + cronet_consumer_template("cronet_consumer_static") { + deps = [ + "//components/cronet/ios:cronet_static_framework", + ] - bundle_deps = [ "//components/cronet/ios:cronet_framework+bundle" ] + cflags = [ + "-F", + "Static", + ] - configs += [ "//build/config/compiler:enable_arc" ] + ldflags = [ + "-F", + "Static", + ] + } } diff --git a/chromium/components/cronet/ios/test/BUILD.gn b/chromium/components/cronet/ios/test/BUILD.gn index fc515a566eb..5c90a1ce0ca 100644 --- a/chromium/components/cronet/ios/test/BUILD.gn +++ b/chromium/components/cronet/ios/test/BUILD.gn @@ -11,6 +11,8 @@ test("cronet_test") { "cronet_acceptlang_test.mm", "cronet_http_test.mm", "cronet_netlog_test.mm", + "cronet_pkp_test.mm", + "cronet_test_base.mm", "cronet_test_runner.mm", "get_stream_engine.mm", "start_cronet.h", @@ -32,4 +34,5 @@ test("cronet_test") { ] bundle_deps = [ "//components/cronet/ios:cronet_framework+bundle" ] + configs += [ "//build/config/compiler:enable_arc" ] } |