Don't preload rarely seen large images
[chromium-blink-merge.git] / components / html_viewer / BUILD.gn
blobe89592d7d025025105eaa1b69936c8cc96c76487
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("//mojo/public/mojo_application.gni")
7 import("//testing/test.gni")
8 import("//tools/grit/grit_rule.gni")
9 import("//tools/grit/repack.gni")
11 # Repack this here.
12 repack("unified_blink_resources") {
13   sources = [
14     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
15     "$root_gen_dir/blink/public/resources/blink_resources.pak",
16   ]
17   output = "$target_gen_dir/unified_blink_resources.pak"
18   deps = [
19     "//third_party/WebKit/public:image_resources",
20     "//third_party/WebKit/public:resources",
21   ]
24 action("generate_blink_resource_map") {
25   script = "//components/html_viewer/generate_blink_resource_map.py"
26   args = [
27     "--pak-file",
28     rebase_path("$target_gen_dir/unified_blink_resources.pak"),
29     "--header",
30     rebase_path("$target_gen_dir/blink_resource_map.h"),
31     "--cpp",
32     rebase_path("$target_gen_dir/blink_resource_map.cc"),
33   ]
34   outputs = [
35     "$target_gen_dir/blink_resource_map.cc",
36     "$target_gen_dir/blink_resource_map.h",
37   ]
38   deps = [
39     ":unified_blink_resources",
40   ]
41   public_deps = [
42     "//third_party/WebKit/public:image_resources",
43     "//third_party/WebKit/public:resources",
44   ]
47 grit("html_viewer_resources_grit") {
48   source = "html_viewer_resources.grd"
49   outputs = [
50     "grit/html_viewer_resources.h",
51     "html_viewer_resources.pak",
52     "html_viewer_resources.rc",
53   ]
55 source_set("lib") {
56   sources = [
57     "$target_gen_dir/blink_resource_map.cc",
58     "$target_gen_dir/blink_resource_map.h",
59     "ax_provider_impl.cc",
60     "ax_provider_impl.h",
61     "blink_basic_type_converters.cc",
62     "blink_basic_type_converters.h",
63     "blink_input_events_type_converters.cc",
64     "blink_input_events_type_converters.h",
65     "blink_platform_impl.cc",
66     "blink_platform_impl.h",
67     "blink_resource_constants.h",
68     "blink_url_request_type_converters.cc",
69     "blink_url_request_type_converters.h",
70     "devtools_agent_impl.cc",
71     "devtools_agent_impl.h",
72     "discardable_memory_allocator.cc",
73     "discardable_memory_allocator.h",
74     "document_resource_waiter.cc",
75     "document_resource_waiter.h",
76     "frame.cc",
77     "frame.h",
78     "frame_tree_manager.cc",
79     "frame_tree_manager.h",
80     "frame_tree_manager_delegate.h",
81     "global_state.cc",
82     "global_state.h",
83     "html_document.cc",
84     "html_document.h",
85     "html_document_oopif.cc",
86     "html_document_oopif.h",
87     "media_factory.cc",
88     "media_factory.h",
89     "mock_web_blob_registry_impl.cc",
90     "mock_web_blob_registry_impl.h",
91     "test_html_viewer_impl.cc",
92     "test_html_viewer_impl.h",
93     "touch_handler.cc",
94     "touch_handler.h",
95     "web_clipboard_impl.cc",
96     "web_clipboard_impl.h",
97     "web_cookie_jar_impl.cc",
98     "web_cookie_jar_impl.h",
99     "web_layer_tree_view_impl.cc",
100     "web_layer_tree_view_impl.h",
101     "web_mime_registry_impl.cc",
102     "web_mime_registry_impl.h",
103     "web_notification_manager_impl.cc",
104     "web_notification_manager_impl.h",
105     "web_socket_handle_impl.cc",
106     "web_socket_handle_impl.h",
107     "web_storage_namespace_impl.cc",
108     "web_storage_namespace_impl.h",
109     "web_theme_engine_impl.cc",
110     "web_theme_engine_impl.h",
111     "web_url_loader_impl.cc",
112     "web_url_loader_impl.h",
113   ]
115   include_dirs = [ "third_party/WebKit" ]
117   deps = [
118     "//base",
119     "//base/third_party/dynamic_annotations",
120     "//cc",
121     "//cc/blink",
122     "//cc/surfaces",
123     "//components/clipboard/public/interfaces",
124     "//components/devtools_service/public/cpp",
125     "//components/devtools_service/public/interfaces",
126     "//components/html_viewer/public/interfaces",
127     "//components/message_port",
128     "//components/mime_util",
129     "//components/resource_provider/public/cpp",
130     "//components/resource_provider/public/interfaces",
131     "//components/scheduler:scheduler",
132     "//components/view_manager/gles2:lib",
133     "//components/view_manager/public/interfaces",
134     "//components/webcrypto",
135     "//gin",
136     "//mandoline/services/navigation/public/interfaces",
137     "//mandoline/tab/public/interfaces",
138     "//media",
139     "//media/blink",
140     "//media/mojo",
141     "//mojo/application/public/cpp",
142     "//mojo/cc",
143     "//mojo/converters/surfaces",
144     "//mojo/services/network/public/cpp",
145     "//mojo/services/network/public/interfaces",
146     "//net",
147     "//skia",
148     "//third_party/mojo_services/src/accessibility/public/interfaces",
149     "//ui/mojo/events:interfaces",
150     "//ui/events",
151     "//ui/events:gesture_detection",
152     "//ui/events/blink",
153     "//ui/events/gestures/blink",
154     "//ui/gfx",
155     "//ui/gfx/geometry",
156     "//ui/mojo/init",
157     "//ui/native_theme",
159     # TODO(sky): we shouldn't be using ui_test_pak.
160     "//ui/resources:ui_test_pak",
161     "//url",
162   ]
164   public_deps = [
165     "//components/view_manager/public/cpp",
166     "//third_party/WebKit/public:blink",
167     "//third_party/mojo/src/mojo/public/cpp/bindings",
168     ":generate_blink_resource_map",
169   ]
171   if (is_win) {
172     sources += [ "html_viewer_version.rc" ]
173   }
175   data_deps = [
176     "//components/clipboard",
177     "//components/view_manager",
178   ]
181 mojo_native_application("html_viewer") {
182   sources = [
183     "content_handler_impl.cc",
184     "content_handler_impl.h",
185     "html_document_application_delegate.cc",
186     "html_document_application_delegate.h",
187     "html_viewer.cc",
188     "html_viewer.h",
189     "html_viewer_main.cc",
190     "html_viewer_switches.cc",
191     "html_viewer_switches.h",
192   ]
193   deps = [
194     ":html_viewer_resources_grit",
195     ":lib",
196     "//mojo/common",
197     "//mojo/platform_handle",
198     "//third_party/icu:icudata",
199     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
200     "//ui/resources:ui_test_pak",
201   ]
202   data_deps = [ "//mojo/services/network:network" ]
203   resources = [
204     "$root_out_dir/icudtl.dat",
205     "$root_out_dir/ui_test.pak",
206     "$target_gen_dir/html_viewer_resources.pak",
207   ]
209   if (v8_use_external_startup_data) {
210     resources += [
211       "$root_build_dir/natives_blob.bin",
212       "$root_build_dir/snapshot_blob.bin",
213     ]
214     deps += [ "//gin" ]
215   }
218 test("html_viewer_unittests") {
219   sources = [
220     "ax_provider_impl_unittest.cc",
221     "discardable_memory_allocator_unittest.cc",
222     "run_all_unittests.cc",
223   ]
224   deps = [
225     ":lib",
226     "//base/test:test_support",
227     "//third_party/mojo/src/mojo/edk/system",
228   ]
231 mojo_native_application("apptests") {
232   output_name = "html_viewer_apptests"
233   testonly = true
235   sources = [
236     "ax_provider_apptest.cc",
237     "html_frame_apptest.cc",
238   ]
240   deps = [
241     "//base",
242     "//components/html_viewer/public/interfaces",
243     "//components/view_manager/public/cpp/tests:test_support",
244     "//mandoline/tab",
245     "//mandoline/tab/public/interfaces",
246     "//mojo/application/public/cpp:test_support",
247     "//net:test_support",
248     "//testing/gtest",
249     "//third_party/mojo_services/src/accessibility/public/interfaces",
250     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
251   ]
253   data_deps = [
254     ":html_viewer",
255     "//components/view_manager",
256   ]