chromium/third_party/blink/renderer/platform/network/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//third_party/blink/renderer/build/scripts/scripts.gni")
import("//third_party/blink/renderer/platform/platform.gni")
import("//third_party/blink/renderer/platform/platform_generated.gni")

make_names("http_names") {
  in_files = [ "http_names.json5" ]
  output_dir = "$blink_platform_output_dir/network"
}

group("make_generated") {
  visibility = [
    ":*",
    "//third_party/blink/public/mojom:mojom_platform_blink",
    "//third_party/blink/renderer/platform:*",
  ]

  public_deps = [ ":http_names" ]
}

blink_platform_sources("network") {
  sources = [
    "blink_schemeful_site.cc",
    "blink_schemeful_site.h",
    "content_security_policy_parsers.cc",
    "content_security_policy_parsers.h",
    "content_security_policy_response_headers.cc",
    "content_security_policy_response_headers.h",
    "encoded_form_data.cc",
    "encoded_form_data.h",
    "form_data_encoder.cc",
    "form_data_encoder.h",
    "header_field_tokenizer.cc",
    "header_field_tokenizer.h",
    "http_header_map.cc",
    "http_header_map.h",
    "http_header_set.h",
    "http_parsers.cc",
    "http_parsers.h",
    "http_request_headers_mojom_traits.cc",
    "http_request_headers_mojom_traits.h",
    "ip_address.h",
    "mime/content_type.cc",
    "mime/content_type.h",
    "mime/mime_type_from_url.cc",
    "mime/mime_type_from_url.h",
    "mime/mime_type_registry.cc",
    "mime/mime_type_registry.h",
    "network_state_notifier.cc",
    "network_state_notifier.h",
    "network_utils.cc",
    "network_utils.h",
    "parsed_content_disposition.cc",
    "parsed_content_disposition.h",
    "parsed_content_header_field_parameters.cc",
    "parsed_content_header_field_parameters.h",
    "parsed_content_type.cc",
    "parsed_content_type.h",
    "server_timing_header.cc",
    "server_timing_header.h",
    "wrapped_data_pipe_getter.h",
  ]

  sources += get_target_outputs(":http_names")

  deps = [
    "//media",
    "//services/metrics/public/cpp:ukm_builders",
    "//third_party/blink/renderer/platform:allow_discouraged_type",
    "//third_party/blink/renderer/platform/blob:blob",
    "//third_party/blink/renderer/platform/scheduler:scheduler",
  ]
}

source_set("unit_tests") {
  visibility = [ "//third_party/blink/renderer/platform:*" ]
  testonly = true

  sources = [
    "blink_schemeful_site_mojom_traits_test.cc",
    "blink_schemeful_site_test.cc",
    "content_security_policy_parsers_test.cc",
    "encoded_form_data_test.cc",
    "http_parsers_test.cc",
    "ip_address_test.cc",
    "mime/mime_type_registry_test.cc",
    "network_state_notifier_test.cc",
    "network_utils_test.cc",
    "parsed_content_disposition_test.cc",
    "parsed_content_header_field_parameters_test.cc",
    "parsed_content_type_test.cc",
  ]

  configs += [ "//third_party/blink/renderer/platform:blink_platform_config" ]

  deps = [
    "//mojo/public/cpp/test_support:test_utils",
    "//testing/gtest",
    "//third_party/blink/renderer/platform:test_support",
  ]
  public_deps = [ "//third_party/blink/renderer/platform:platform" ]
}

source_set("test_support") {
  visibility = [ "//third_party/blink/renderer/platform:test_support" ]
  testonly = true

  sources = [ "mime/mock_mime_registry.h" ]

  configs += [
    "//third_party/blink/renderer:non_test_config",
    "//third_party/blink/renderer/platform:blink_platform_config",
  ]

  public_deps = [
    "//net",
    "//third_party/blink/public:blink_headers",
    "//third_party/blink/renderer/platform/blob:generator",
  ]
}