summaryrefslogtreecommitdiff
path: root/chromium/chrome/renderer/BUILD.gn
blob: e3783b3a8c40fdc41078fb73c99e6ea17259f87c (plain)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# Copyright 2014 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("//build/config/features.gni")
import("//chrome/common/features.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//extensions/features/features.gni")
import("//media/media_options.gni")
import("//ppapi/features/features.gni")
import("//tools/grit/grit_rule.gni")

grit("resources") {
  source = "resources/renderer_resources.grd"
  defines = chrome_grit_defines
  use_qualified_include = true
  output_dir = "$root_gen_dir/chrome"
  output_name = "renderer_resources"
  outputs = [
    "grit/renderer_resources.h",
    "renderer_resources_100_percent.pak",
    "renderer_resources_200_percent.pak",
    "renderer_resources_300_percent.pak",
  ]
}

static_library("renderer") {
  sources = [
    "app_categorizer.cc",
    "app_categorizer.h",
    "benchmarking_extension.cc",
    "benchmarking_extension.h",
    "chrome_content_renderer_client.cc",
    "chrome_content_renderer_client.h",
    "chrome_render_frame_observer.cc",
    "chrome_render_frame_observer.h",
    "chrome_render_thread_observer.cc",
    "chrome_render_thread_observer.h",
    "chrome_render_view_observer.cc",
    "chrome_render_view_observer.h",
    "content_settings_observer.cc",
    "content_settings_observer.h",
    "custom_menu_commands.h",
    "instant_restricted_id_cache.h",
    "loadtimes_extension_bindings.cc",
    "loadtimes_extension_bindings.h",
    "media/chrome_key_systems.cc",
    "media/chrome_key_systems.h",
    "net/net_error_helper.cc",
    "net/net_error_helper.h",
    "net/net_error_page_controller.cc",
    "net/net_error_page_controller.h",
    "net_benchmarking_extension.cc",
    "net_benchmarking_extension.h",
    "page_load_metrics/metrics_render_frame_observer.cc",
    "page_load_metrics/metrics_render_frame_observer.h",
    "page_load_metrics/page_timing_metrics_sender.cc",
    "page_load_metrics/page_timing_metrics_sender.h",
    "page_load_metrics/renderer_page_track_decider.cc",
    "page_load_metrics/renderer_page_track_decider.h",
    "plugins/non_loadable_plugin_placeholder.cc",
    "plugins/non_loadable_plugin_placeholder.h",
    "plugins/plugin_uma.cc",
    "plugins/plugin_uma.h",
    "prerender/prerender_dispatcher.cc",
    "prerender/prerender_dispatcher.h",
    "prerender/prerender_extra_data.cc",
    "prerender/prerender_extra_data.h",
    "prerender/prerender_helper.cc",
    "prerender/prerender_helper.h",
    "prerender/prerenderer_client.cc",
    "prerender/prerenderer_client.h",
    "searchbox/search_bouncer.cc",
    "searchbox/search_bouncer.h",
    "searchbox/searchbox.cc",
    "searchbox/searchbox.h",
    "searchbox/searchbox_extension.cc",
    "searchbox/searchbox_extension.h",
    "security_filter_peer.cc",
    "security_filter_peer.h",
    "tts_dispatcher.cc",
    "tts_dispatcher.h",
    "web_apps.cc",
    "web_apps.h",
    "worker_content_settings_client_proxy.cc",
    "worker_content_settings_client_proxy.h",
  ]

  defines = []

  deps = [
    "//chrome:resources",
    "//chrome:strings",
    "//chrome/common",
    "//chrome/common:instant_mojom",
    "//chrome/common:mojo_bindings",
    "//chrome/common/net",
    "//components/autofill/content/renderer",
    "//components/cdm/renderer",
    "//components/contextual_search:renderer",
    "//components/data_reduction_proxy/core/common",
    "//components/dom_distiller/content/renderer",
    "//components/error_page/renderer",
    "//components/guest_view/renderer",
    "//components/network_hints/renderer",
    "//components/omnibox/common",
    "//components/password_manager/content/renderer",
    "//components/plugins/renderer",
    "//components/printing/renderer",
    "//components/rappor/public/interfaces",
    "//components/resources:components_resources",
    "//components/spellcheck:build_features",
    "//components/startup_metric_utils/common:interfaces",
    "//components/subresource_filter/content/renderer",
    "//components/task_scheduler_util/renderer",
    "//components/translate/content/renderer",
    "//components/translate/core/common",
    "//components/translate/core/language_detection",
    "//components/visitedlink/renderer",
    "//components/web_cache/renderer",
    "//content/app/resources",
    "//content/app/strings",
    "//content/public/common",
    "//content/public/renderer",
    "//extensions/features",
    "//media",
    "//media/capture",
    "//net",
    "//ppapi/features",
    "//printing/features",
    "//services/service_manager/public/cpp",
    "//skia",
    "//storage/common",
    "//third_party/WebKit/public:blink",
    "//third_party/WebKit/public:image_resources",
    "//third_party/WebKit/public:resources",
    "//third_party/icu",
    "//third_party/re2",
    "//third_party/widevine/cdm:headers",
    "//ui/surface",
    "//v8:v8",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  if (enable_nacl) {
    deps += [
      "//components/nacl/loader",
      "//components/nacl/renderer",
    ]
  }

  if (enable_plugins) {
    sources += [
      "pepper/chrome_renderer_pepper_host_factory.cc",
      "pepper/chrome_renderer_pepper_host_factory.h",
      "pepper/pepper_flash_drm_renderer_host.cc",
      "pepper/pepper_flash_drm_renderer_host.h",
      "pepper/pepper_flash_font_file_host.cc",
      "pepper/pepper_flash_font_file_host.h",
      "pepper/pepper_flash_fullscreen_host.cc",
      "pepper/pepper_flash_fullscreen_host.h",
      "pepper/pepper_flash_menu_host.cc",
      "pepper/pepper_flash_menu_host.h",
      "pepper/pepper_flash_renderer_host.cc",
      "pepper/pepper_flash_renderer_host.h",
      "pepper/pepper_helper.cc",
      "pepper/pepper_helper.h",
      "pepper/pepper_shared_memory_message_filter.cc",
      "pepper/pepper_shared_memory_message_filter.h",
      "pepper/pepper_uma_host.cc",
      "pepper/pepper_uma_host.h",
      "plugins/chrome_plugin_placeholder.cc",
      "plugins/chrome_plugin_placeholder.h",
      "plugins/plugin_preroller.cc",
      "plugins/plugin_preroller.h",
      "plugins/power_saver_info.cc",
      "plugins/power_saver_info.h",
    ]
    deps += [
      "//components/pdf/renderer",
      "//components/strings",
      "//ppapi/host",
      "//ppapi/proxy",
      "//ppapi/proxy:ipc",
      "//ppapi/shared_impl",
    ]
  }

  if (safe_browsing_mode != 0) {
    sources += [
      "safe_browsing/threat_dom_details.cc",
      "safe_browsing/threat_dom_details.h",
    ]
    deps += [ "//components/safe_browsing/common:common" ]
    if (safe_browsing_mode == 1) {
      sources += [
        "safe_browsing/feature_extractor_clock.cc",
        "safe_browsing/feature_extractor_clock.h",
        "safe_browsing/features.cc",
        "safe_browsing/features.h",
        "safe_browsing/murmurhash3_util.cc",
        "safe_browsing/murmurhash3_util.h",
        "safe_browsing/phishing_classifier.cc",
        "safe_browsing/phishing_classifier.h",
        "safe_browsing/phishing_classifier_delegate.cc",
        "safe_browsing/phishing_classifier_delegate.h",
        "safe_browsing/phishing_dom_feature_extractor.cc",
        "safe_browsing/phishing_dom_feature_extractor.h",
        "safe_browsing/phishing_term_feature_extractor.cc",
        "safe_browsing/phishing_term_feature_extractor.h",
        "safe_browsing/phishing_url_feature_extractor.cc",
        "safe_browsing/phishing_url_feature_extractor.h",
        "safe_browsing/scorer.cc",
        "safe_browsing/scorer.h",
      ]
      deps += [
        "//chrome/common/safe_browsing:proto",
        "//third_party/smhasher:murmurhash3",
      ]
    }
  }

  if (enable_extensions) {
    sources += [
      "extensions/app_bindings.cc",
      "extensions/app_bindings.h",
      "extensions/automation_internal_custom_bindings.cc",
      "extensions/automation_internal_custom_bindings.h",
      "extensions/chrome_extensions_dispatcher_delegate.cc",
      "extensions/chrome_extensions_dispatcher_delegate.h",
      "extensions/chrome_extensions_renderer_client.cc",
      "extensions/chrome_extensions_renderer_client.h",
      "extensions/chrome_v8_extension_handler.cc",
      "extensions/chrome_v8_extension_handler.h",
      "extensions/extension_localization_peer.cc",
      "extensions/extension_localization_peer.h",
      "extensions/media_galleries_custom_bindings.cc",
      "extensions/media_galleries_custom_bindings.h",
      "extensions/notifications_native_handler.cc",
      "extensions/notifications_native_handler.h",
      "extensions/page_capture_custom_bindings.cc",
      "extensions/page_capture_custom_bindings.h",
      "extensions/renderer_permissions_policy_delegate.cc",
      "extensions/renderer_permissions_policy_delegate.h",
      "extensions/resource_request_policy.cc",
      "extensions/resource_request_policy.h",
      "extensions/sync_file_system_custom_bindings.cc",
      "extensions/sync_file_system_custom_bindings.h",
      "extensions/webstore_bindings.cc",
      "extensions/webstore_bindings.h",
      "media/cast_ipc_dispatcher.cc",
      "media/cast_ipc_dispatcher.h",
      "media/cast_receiver_audio_valve.cc",
      "media/cast_receiver_audio_valve.h",
      "media/cast_receiver_session.cc",
      "media/cast_receiver_session.h",
      "media/cast_receiver_session_delegate.cc",
      "media/cast_receiver_session_delegate.h",
      "media/cast_rtp_stream.cc",
      "media/cast_rtp_stream.h",
      "media/cast_session.cc",
      "media/cast_session.h",
      "media/cast_session_delegate.cc",
      "media/cast_session_delegate.h",
      "media/cast_threads.cc",
      "media/cast_threads.h",
      "media/cast_transport_ipc.cc",
      "media/cast_transport_ipc.h",
      "media/cast_udp_transport.cc",
      "media/cast_udp_transport.h",
      "resources/extensions/app_custom_bindings.js",
      "resources/extensions/automation_custom_bindings.js",
      "resources/extensions/browser_action_custom_bindings.js",
      "resources/extensions/chrome_direct_setting.js",
      "resources/extensions/chrome_setting.js",
      "resources/extensions/content_setting.js",
      "resources/extensions/declarative_content_custom_bindings.js",
      "resources/extensions/enterprise_platform_keys_custom_bindings.js",
      "resources/extensions/feedback_private_custom_bindings.js",
      "resources/extensions/file_entry_binding_util.js",
      "resources/extensions/file_system_custom_bindings.js",
      "resources/extensions/gcm_custom_bindings.js",
      "resources/extensions/identity_custom_bindings.js",
      "resources/extensions/image_writer_private_custom_bindings.js",
      "resources/extensions/input.ime_custom_bindings.js",
      "resources/extensions/log_private_custom_bindings.js",
      "resources/extensions/notifications_custom_bindings.js",
      "resources/extensions/omnibox_custom_bindings.js",
      "resources/extensions/page_action_custom_bindings.js",
      "resources/extensions/page_capture_custom_bindings.js",
      "resources/extensions/system_indicator_custom_bindings.js",
      "resources/extensions/tts_custom_bindings.js",
      "resources/extensions/tts_engine_custom_bindings.js",
    ]
    deps += [
      # TODO(hclam): See crbug.com/298380 for details.
      # We should isolate the APIs needed by the renderer.
      "//chrome/common/extensions/api",
      "//extensions:extensions_resources",
      "//extensions/renderer",
      "//media/cast:net",
      "//media/cast:receiver",
      "//media/cast:sender",
    ]
    if (!enable_webrtc) {
      sources -= [
        "media/cast_receiver_session.cc",
        "media/cast_receiver_session.h",
        "media/cast_rtp_stream.cc",
        "media/cast_rtp_stream.h",
      ]
    }
  }
  if (enable_webrtc) {
    sources += [
      "media/chrome_webrtc_log_message_delegate.cc",
      "media/chrome_webrtc_log_message_delegate.h",
      "media/webrtc_logging_message_filter.cc",
      "media/webrtc_logging_message_filter.h",
    ]
  }
  if (enable_extensions && enable_webrtc) {
    sources += [
      "extensions/cast_streaming_native_handler.cc",
      "extensions/cast_streaming_native_handler.h",
    ]
  }
  if (enable_spellcheck) {
    deps += [ "//components/spellcheck/renderer:renderer" ]
  }
  if (enable_basic_printing || enable_print_preview) {
    deps += [ "//printing" ]
    sources += [
      "printing/chrome_print_web_view_helper_delegate.cc",
      "printing/chrome_print_web_view_helper_delegate.h",
    ]
    if (enable_print_preview) {
      sources += [
        "pepper/chrome_pdf_print_client.cc",
        "pepper/chrome_pdf_print_client.h",
      ]
    }
  }

  if (is_win) {
    deps += [ "//third_party/wtl" ]
  }

  if (is_chromeos) {
    deps += [ "//chrome/renderer/leak_detector:leak_detector" ]
    sources += [
      "extensions/file_browser_handler_custom_bindings.cc",
      "extensions/file_browser_handler_custom_bindings.h",
      "extensions/file_manager_private_custom_bindings.cc",
      "extensions/file_manager_private_custom_bindings.h",
      "extensions/platform_keys_natives.cc",
      "extensions/platform_keys_natives.h",
      "resources/extensions/certificate_provider_custom_bindings.js",
      "resources/extensions/file_browser_handler_custom_bindings.js",
      "resources/extensions/file_manager_private_custom_bindings.js",
      "resources/extensions/file_system_provider_custom_bindings.js",
    ]
  }
}

static_library("test_support") {
  testonly = true
  visibility = [ "//chrome/test:test_support" ]

  sources = [
    "chrome_mock_render_thread.cc",
    "chrome_mock_render_thread.h",
    "safe_browsing/mock_feature_extractor_clock.cc",
    "safe_browsing/mock_feature_extractor_clock.h",
    "safe_browsing/test_utils.cc",
    "safe_browsing/test_utils.h",
  ]

  deps = [
    ":renderer",
    "//chrome/common:instant_mojom",
    "//content/test:test_support",
    "//extensions/features",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (enable_print_preview) {
    deps += [ "//chrome/service" ]
  }

  if (enable_webrtc) {
    sources += [
      "media/mock_webrtc_logging_message_filter.cc",
      "media/mock_webrtc_logging_message_filter.h",
    ]
  }

  if (is_android) {
    sources -= [
      "safe_browsing/mock_feature_extractor_clock.cc",
      "safe_browsing/mock_feature_extractor_clock.h",
    ]
  }
}