File: BUILD.gn

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (161 lines) | stat: -rw-r--r-- 3,873 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//testing/test.gni")

visibility = [ ":*" ]

# Network service-based implementation of Open Screen platform.
# Incompatible with ":openscreen_platform_using_net_sockets".
source_set("openscreen_platform") {
  visibility += [ "*" ]
  public = [ "network_context.h" ]

  sources = [
    "network_context.cc",
    "network_context.h",
    "tls_client_connection.cc",
    "tls_client_connection.h",
    "tls_connection_factory.cc",
    "tls_connection_factory.h",
    "udp_socket.cc",
    "udp_socket.h",
  ]

  public_deps = [
    ":openscreen_platform_without_sockets",
    "//base",
    "//services/network/public/cpp",
    "//services/network/public/mojom",
  ]

  deps = [
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/system",
    "//net",
    "//services/network:network_service",
    "//third_party/openscreen/src/platform:api",
  ]

  friend = [ ":unittests" ]
}

# //net-based implementation of UdpSocket for use by targets that cannot use the
# Network service.
# Incompatible with `:openscreen_platform`.
source_set("openscreen_platform_using_net_sockets") {
  testonly = true
  visibility += [
    "//components/cast_streaming/test:test_sender_using_net_sockets",
    "//media/cast:media_vpx_quantizer_parser_fuzzer",
  ]
  if (is_android || is_ios) {
    # Allow broader visibility for platforms with unique generated targets.
    visibility += [ "//components/cast_streaming/browser:*" ]
  }

  assert_no_deps = [ "//services/network:network_service" ]

  public = []

  sources = [
    "net_udp_socket.cc",
    "net_udp_socket.h",
  ]

  public_deps = [ ":openscreen_platform_without_sockets" ]

  deps = [
    "//base",
    "//net",
    "//third_party/openscreen/src/platform:api",
  ]
}

# Implementation of //third_party/openscreen/src/platform:api with the exception
# of network sockets, which are provided by one of the other targets.
source_set("openscreen_platform_without_sockets") {
  # The private target below must directly depend on this target for reasons
  # described at its definition.
  visibility +=
      [ "//components/cast_streaming/test:test_sender_without_socket_deps" ]

  public = [
    "event_trace_logging_platform.h",
    "network_util.h",
    "task_runner.h",
  ]

  sources = [
    "event_trace_logging_platform.cc",
    "logging.cc",
    "network_util.cc",
    "task_runner.cc",
    "time.cc",
    "trace_logging_platform.cc",
  ]

  public_deps = [
    "//base",
    "//net",
    "//third_party/openscreen/src/platform:api",
  ]
}

if (!is_win && !is_ios) {
  source_set("message_port_tls_connection") {
    testonly = true

    public = []

    sources = [
      "message_port_tls_connection.cc",
      "message_port_tls_connection.h",
    ]

    deps = [
      "//base",
      "//components/cast/message_port",
      "//third_party/openscreen/src/platform:api",
    ]

    friend = [ ":unittests" ]
  }
}

source_set("unittests") {
  testonly = true
  visibility += [ "//components:components_unittests${exec_target_suffix}" ]
  if (is_android || is_ios) {
    # Allow broader visibility for platforms with unique generated targets.
    visibility += [ "//components:*" ]
  }

  public = []

  sources = [
    "tls_client_connection_unittest.cc",
    "tls_connection_factory_unittest.cc",
  ]

  deps = [
    ":openscreen_platform",
    "//base",
    "//base/test:test_support",
    "//net",
    "//services/network:test_support",
    "//services/network/public/mojom",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (!is_win && !is_ios) {
    sources += [ "message_port_tls_connection_unittest.cc" ]
    deps += [
      ":message_port_tls_connection",
      "//components/cast/message_port",
      "//third_party/openscreen/src/platform:api",
    ]
  }
}