blob: 71b8180719d4d50b1ea18835f0ad4cf71eb99224 [file] [log] [blame]
# Copyright 2018 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.
import("//mojo/public/tools/bindings/mojom.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni") # For generate_jni().
}
config("components_download_implementation") {
defines = [ "COMPONENTS_DOWNLOAD_IMPLEMENTATION" ]
}
component("public") {
sources = [
"all_download_event_notifier.h",
"auto_resumption_handler.cc",
"auto_resumption_handler.h",
"base_file.h",
"download_content.h",
"download_create_info.h",
"download_danger_type.h",
"download_destination_observer.cc",
"download_destination_observer.h",
"download_features.cc",
"download_features.h",
"download_file.h",
"download_file_factory.h",
"download_file_impl.h",
"download_interrupt_reason_values.h",
"download_interrupt_reasons.h",
"download_interrupt_reasons_utils.h",
"download_item.h",
"download_item_factory.cc",
"download_item_factory.h",
"download_item_impl.h",
"download_item_impl_delegate.h",
"download_job.h",
"download_job_factory.h",
"download_path_reservation_tracker.h",
"download_request_handle_interface.h",
"download_response_handler.h",
"download_save_info.cc",
"download_save_info.h",
"download_source.h",
"download_start_observer.h",
"download_stats.h",
"download_task_runner.h",
"download_ukm_helper.h",
"download_url_loader_factory_getter.h",
"download_url_loader_factory_getter_impl.h",
"download_url_parameters.cc",
"download_url_parameters.h",
"download_utils.h",
"in_progress_download_manager.h",
"input_stream.cc",
"input_stream.h",
"parallel_download_configs.h",
"rate_estimator.h",
"resume_mode.h",
"simple_download_manager.h",
"simple_download_manager_coordinator.h",
"stream_handle_input_stream.h",
"url_download_handler_factory.h",
"url_download_request_handle.h",
]
configs += [ ":components_download_implementation" ]
public_deps = [
":interfaces",
"//components/download/network",
"//components/download/public/background_service:public",
"//services/network/public/cpp",
]
deps = [
"//base",
"//components/download/database",
"//components/download/internal/common:internal",
"//crypto",
"//net",
"//services/metrics/public/cpp:metrics_cpp",
"//services/network/public/cpp",
"//storage/browser",
"//ui/base",
]
allow_circular_includes_from = [
"//components/download/internal/common:internal",
"//components/download/database",
]
}
if (is_android) {
android_library("public_java") {
srcjar_deps = [ ":jni_enums" ]
deps = [
"//base:base_java",
"//third_party/android_deps:com_android_support_support_annotations_java",
]
}
java_cpp_enum("jni_enums") {
sources = [
"download_item.h",
"resume_mode.h",
]
}
}
mojom("interfaces") {
sources = [
"download_stream.mojom",
]
export_class_attribute = "COMPONENTS_DOWNLOAD_EXPORT"
export_define = "COMPONENTS_DOWNLOAD_IMPLEMENTATION=1"
export_header = "components/download/public/common/download_export.h"
}
source_set("test_support") {
testonly = true
sources = [
"mock_download_file.cc",
"mock_download_file.h",
"mock_download_item.cc",
"mock_download_item.h",
"mock_download_item_impl.cc",
"mock_download_item_impl.h",
"mock_input_stream.cc",
"mock_input_stream.h",
]
public_deps = [
":public",
"//base",
"//net",
"//testing/gmock",
"//url",
]
if (is_android) {
deps = [
"//components/download/internal/common:internal_java",
]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"auto_resumption_handler_unittest.cc",
]
deps = [
":public",
":test_support",
"//base/test:test_support",
"//components/download/public/task:test_support",
"//services/network:test_support",
"//testing/gmock",
"//testing/gtest",
]
}