Fix AudioPump to pause the stream when the network is congested.
[chromium-blink-merge.git] / gin / BUILD.gn
blob8f7e360b98ac3abce9e0830dcb11200cde612c75
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/module_args/v8.gni")
6 import("//testing/test.gni")
8 component("gin") {
9   sources = [
10     "arguments.cc",
11     "arguments.h",
12     "array_buffer.cc",
13     "array_buffer.h",
14     "context_holder.cc",
15     "converter.cc",
16     "converter.h",
17     "debug_impl.cc",
18     "debug_impl.h",
19     "dictionary.cc",
20     "dictionary.h",
21     "function_template.cc",
22     "function_template.h",
23     "gin_export.h",
24     "handle.h",
25     "interceptor.cc",
26     "interceptor.h",
27     "isolate_holder.cc",
28     "modules/console.cc",
29     "modules/console.h",
30     "modules/file_module_provider.cc",
31     "modules/file_module_provider.h",
32     "modules/module_registry.cc",
33     "modules/module_registry.h",
34     "modules/module_registry_observer.h",
35     "modules/module_runner_delegate.cc",
36     "modules/module_runner_delegate.h",
37     "modules/timer.cc",
38     "modules/timer.h",
39     "object_template_builder.cc",
40     "object_template_builder.h",
41     "per_context_data.cc",
42     "per_context_data.h",
43     "per_isolate_data.cc",
44     "per_isolate_data.h",
45     "public/context_holder.h",
46     "public/debug.h",
47     "public/gin_embedders.h",
48     "public/isolate_holder.h",
49     "public/v8_platform.h",
50     "public/wrapper_info.h",
51     "runner.cc",
52     "runner.h",
53     "run_microtasks_observer.cc",
54     "run_microtasks_observer.h",
55     "shell_runner.cc",
56     "shell_runner.h",
57     "try_catch.cc",
58     "try_catch.h",
59     "v8_platform.cc",
60     "wrappable.cc",
61     "wrappable.h",
62     "wrapper_info.cc",
63   ]
65   defines = [ "GIN_IMPLEMENTATION" ]
67   public_deps = [
68     "//base",
69     "//v8",
70   ]
71   deps = [
72     "//base/third_party/dynamic_annotations",
73   ]
74   if (v8_use_external_startup_data && is_win) {
75     deps += [
76       ":gin_v8_snapshot_fingerprint",
77       "//crypto:crypto",
78     ]
79     sources += [ "$target_gen_dir/v8_snapshot_fingerprint.cc" ]
80     defines += [ "V8_VERIFY_EXTERNAL_STARTUP_DATA" ]
81   }
84 if (v8_use_external_startup_data) {
85   action("gin_v8_snapshot_fingerprint") {
86     script = "//gin/fingerprint/fingerprint_v8_snapshot.py"
88     snapshot_file = "$root_build_dir/snapshot_blob.bin"
89     natives_file = "$root_build_dir/natives_blob.bin"
90     output_file = "$target_gen_dir/v8_snapshot_fingerprint.cc"
92     args = [
93       "--snapshot_file",
94       rebase_path(snapshot_file, root_build_dir),
95       "--natives_file",
96       rebase_path(natives_file, root_build_dir),
97       "--output_file",
98       rebase_path(output_file, root_build_dir),
99     ]
100     inputs = [
101       snapshot_file,
102       natives_file,
103     ]
104     outputs = [
105       output_file,
106     ]
107   }
110 executable("gin_shell") {
111   sources = [
112     "shell/gin_main.cc",
113   ]
115   deps = [
116     ":gin",
117     "//base",
118     "//base:i18n",
119     "//v8",
120   ]
123 source_set("gin_test") {
124   testonly = true
125   sources = [
126     "test/file.cc",
127     "test/file.h",
128     "test/file_runner.cc",
129     "test/file_runner.h",
130     "test/gc.cc",
131     "test/gc.h",
132     "test/gtest.cc",
133     "test/gtest.h",
134     "test/v8_test.cc",
135     "test/v8_test.h",
136   ]
138   public_deps = [
139     ":gin",
140     "//testing/gtest",
141   ]
142   deps = [
143     "//v8",
144   ]
147 test("gin_unittests") {
148   sources = [
149     "converter_unittest.cc",
150     "interceptor_unittest.cc",
151     "modules/module_registry_unittest.cc",
152     "modules/timer_unittest.cc",
153     "per_context_data_unittest.cc",
154     "shell_runner_unittest.cc",
155     "shell/gin_shell_unittest.cc",
156     "test/run_all_unittests.cc",
157     "test/run_js_tests.cc",
158     "wrappable_unittest.cc",
159   ]
161   deps = [
162     ":gin_test",
163     "//base/test:test_support",
164     "//v8",
165   ]