0

Enable gn check for //ppapi/thunk:*

This CL disentangles two codependent targets (//ppapi/thunk and
//ppapi/shared_impl) by creating a few helper targets. Fortunately, I
did not have to resort to a circular dependency.

Running `gn check` revealed a number of disallowed header inclusions. I
disentangled the header inclusions as necessary. In some places it was
possible to just delete troublesome includes because they were not being
used, or they only needed a forward declaration.

Before:
    //ppapi/shared_impl
        //ppapi/thunk

Now:
    //ppapi/shared_impl
        //ppapi/thunk
            //ppapi/shared_impl:common
                //ppapi/thunk:headers
            //ppapi/shared_impl:headers

Change-Id: I28a8ac7daca1371106dc675c66da930dfe3b15cf
Fixed: 1158997
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3065823
Reviewed-by: Erik Staab <estaab@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#908232}
This commit is contained in:
Dan McArdle
2021-08-04 00:07:49 +00:00
committed by Chromium LUCI CQ
parent 8e9ac23921
commit 91a0c5762f
7 changed files with 158 additions and 84 deletions

1
.gn

@ -66,7 +66,6 @@ no_check_targets = [
"//extensions:*", # 28 errors
"//headless:*", # 107 errors
"//ppapi/proxy:ipc_sources", # 13 errors
"//ppapi/thunk:*", # 1071 errors
"//remoting/host/security_key:*", # 10 errors
"//remoting/host/win:*", # 43 errors
"//sandbox/win:*", # 7 errors

@ -4,36 +4,135 @@
import("//build/config/nacl/config.gni")
component("shared_impl") {
output_name = "ppapi_shared"
# //ppapi/shared_impl and //ppapi/thunk go into the same library.
config("export_shared_impl_and_thunk") {
visibility = [
":*",
"//ppapi/thunk:*",
]
defines = [
"PPAPI_SHARED_IMPLEMENTATION",
"PPAPI_THUNK_IMPLEMENTATION",
]
}
source_set("headers") {
visibility = [
":*",
"//ppapi/thunk:*",
]
sources = [
"host_resource.h",
"ppapi_globals.h",
"proxy_lock.h",
"resource.h",
]
configs += [ ":export_shared_impl_and_thunk" ]
deps = [
"//base",
"//ppapi/c/",
]
}
# This contains the things that //ppapi/thunk needs.
source_set("common") {
visibility = [
":*",
"//ppapi/thunk:*",
]
sources = [
"array_var.cc",
"array_var.h",
"array_writer.cc",
"array_writer.h",
"callback_tracker.cc",
"callback_tracker.h",
"dictionary_var.cc",
"dictionary_var.h",
"file_ref_create_info.cc",
"file_ref_create_info.h",
"host_resource.cc",
"id_assignment.cc",
"id_assignment.h",
"ppapi_globals.cc",
"ppb_audio_config_shared.cc",
"ppb_audio_config_shared.h",
"ppb_device_ref_shared.cc",
"ppb_device_ref_shared.h",
"ppb_flash_font_file_shared.h",
"ppb_image_data_shared.cc",
"ppb_image_data_shared.h",
"ppb_message_loop_shared.cc",
"ppb_message_loop_shared.h",
"proxy_lock.cc",
"resource.cc",
"resource_tracker.cc",
"resource_tracker.h",
"resource_var.cc",
"resource_var.h",
"scoped_pp_var.cc",
"scoped_pp_var.h",
"tracked_callback.cc",
"tracked_callback.h",
"url_response_info_data.cc",
"url_response_info_data.h",
"var.cc",
"var.h",
"var_tracker.cc",
"var_tracker.h",
]
if (!is_nacl) {
sources += [
"ppb_url_util_shared.cc",
"ppb_url_util_shared.h",
"private/ppb_char_set_shared.cc",
"private/ppb_char_set_shared.h",
]
}
configs += [ ":export_shared_impl_and_thunk" ]
public_deps = [ ":headers" ]
deps = [
"//base",
"//base:i18n",
"//build:chromeos_buildflags",
"//ppapi/c:c",
"//ppapi/thunk:headers",
"//third_party/icu:icuuc",
]
if (!is_nacl) {
deps += [ "//skia" ]
}
if (!is_nacl_nonsfi) {
deps += [ "//url" ]
}
}
component("shared_impl") {
output_name = "ppapi_shared"
sources = [
"array_writer.cc",
"array_writer.h",
"file_growth.cc",
"file_growth.h",
"file_io_state_manager.cc",
"file_io_state_manager.h",
"file_path.cc",
"file_path.h",
"file_ref_create_info.cc",
"file_ref_create_info.h",
"file_ref_util.cc",
"file_ref_util.h",
"file_system_util.cc",
"file_system_util.h",
"file_type_conversion.cc",
"file_type_conversion.h",
"host_resource.cc",
"host_resource.h",
"id_assignment.cc",
"id_assignment.h",
"media_stream_audio_track_shared.cc",
"media_stream_audio_track_shared.h",
"media_stream_buffer.h",
@ -46,8 +145,6 @@ component("shared_impl") {
"platform_file.cc",
"platform_file.h",
"ppapi_constants.h",
"ppapi_globals.cc",
"ppapi_globals.h",
"ppapi_nacl_plugin_args.cc",
"ppapi_nacl_plugin_args.h",
"ppapi_permissions.cc",
@ -56,27 +153,18 @@ component("shared_impl") {
"ppapi_preferences.h",
"ppapi_switches.cc",
"ppapi_switches.h",
"ppb_audio_config_shared.cc",
"ppb_audio_config_shared.h",
"ppb_audio_shared.cc",
"ppb_audio_shared.h",
"ppb_crypto_shared.cc",
"ppb_device_ref_shared.cc",
"ppb_device_ref_shared.h",
"ppb_flash_font_file_shared.h",
"ppb_gamepad_shared.cc",
"ppb_gamepad_shared.h",
"ppb_graphics_3d_shared.cc",
"ppb_graphics_3d_shared.h",
"ppb_image_data_shared.cc",
"ppb_image_data_shared.h",
"ppb_input_event_shared.cc",
"ppb_input_event_shared.h",
"ppb_instance_shared.cc",
"ppb_instance_shared.h",
"ppb_memory_shared.cc",
"ppb_message_loop_shared.cc",
"ppb_message_loop_shared.h",
"ppb_opengles2_shared.cc",
"ppb_opengles2_shared.h",
"ppb_tcp_socket_shared.cc",
@ -89,34 +177,16 @@ component("shared_impl") {
"ppb_view_shared.h",
"ppp_instance_combined.cc",
"ppp_instance_combined.h",
"proxy_lock.cc",
"proxy_lock.h",
"resource.cc",
"resource.h",
"resource_tracker.cc",
"resource_tracker.h",
"resource_var.cc",
"resource_var.h",
"scoped_pp_resource.cc",
"scoped_pp_resource.h",
"scoped_pp_var.cc",
"scoped_pp_var.h",
"socket_option_data.cc",
"socket_option_data.h",
"thread_aware_callback.cc",
"thread_aware_callback.h",
"time_conversion.cc",
"time_conversion.h",
"tracked_callback.cc",
"tracked_callback.h",
"url_request_info_data.cc",
"url_request_info_data.h",
"url_response_info_data.cc",
"url_response_info_data.h",
"var.cc",
"var.h",
"var_tracker.cc",
"var_tracker.h",
"vpn_provider_util.cc",
"vpn_provider_util.h",
@ -130,12 +200,8 @@ component("shared_impl") {
if (!is_nacl) {
sources += [
"ppb_url_util_shared.cc",
"ppb_url_util_shared.h",
"ppb_video_decoder_shared.cc",
"ppb_video_decoder_shared.h",
"private/ppb_char_set_shared.cc",
"private/ppb_char_set_shared.h",
"private/ppb_x509_util_shared.cc",
"private/ppb_x509_util_shared.h",
]
@ -153,15 +219,13 @@ component("shared_impl") {
]
}
configs += [ "//build/config:precompiled_headers" ]
defines = [
"PPAPI_SHARED_IMPLEMENTATION",
# This target goes in the same library as thunk (in GYP they are the same).
"PPAPI_THUNK_IMPLEMENTATION",
configs += [
":export_shared_impl_and_thunk",
"//build/config:precompiled_headers",
]
public_deps = [
":common",
"//base",
"//ppapi/c",
"//ppapi/thunk",
@ -181,19 +245,13 @@ component("shared_impl") {
if (!is_nacl) {
deps += [
"//net",
"//skia",
"//ui/events:events_base",
"//ui/surface",
]
}
if (!is_nacl_nonsfi) {
deps += [
"//base:i18n",
"//base/third_party/dynamic_annotations",
"//third_party/icu:icuuc",
"//url",
]
deps += [ "//base/third_party/dynamic_annotations" ]
}
if (is_mac) {

@ -2,17 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("thunk") {
# In GYP this is the same target as shared_impl. In GN these are split apart
# for clarity but to get component builds correct, targets must only depend
# on these via the shared_impl component.
# TODO(brettw) separate these when GYP compat is no longer required.
visibility = [ "//ppapi/shared_impl" ]
source_set("headers") {
visibility = [
":thunk",
"//ppapi/shared_impl:common",
]
sources = [
"enter.cc",
"enter.h",
"interfaces_legacy.h",
"interfaces_postamble.h",
"interfaces_ppb_private.h",
"interfaces_ppb_private_flash.h",
@ -23,10 +19,33 @@ source_set("thunk") {
"interfaces_ppb_public_stable.h",
"interfaces_preamble.h",
"ppapi_thunk_export.h",
"ppb_audio_config_api.h",
"ppb_device_ref_api.h",
"ppb_instance_api.h",
"ppb_message_loop_api.h",
"resource_creation_api.h",
"thunk.h",
]
configs += [ "//ppapi/shared_impl:export_shared_impl_and_thunk" ]
deps = [
"//base",
"//gpu/command_buffer/common",
"//ppapi/c",
"//ppapi/shared_impl:headers",
]
}
source_set("thunk") {
visibility = [ "//ppapi/shared_impl" ]
sources = [
"enter.cc",
"interfaces_legacy.h",
"ppb_audio_api.h",
"ppb_audio_buffer_api.h",
"ppb_audio_buffer_thunk.cc",
"ppb_audio_config_api.h",
"ppb_audio_config_thunk.cc",
"ppb_audio_input_api.h",
"ppb_audio_output_api.h",
@ -40,7 +59,6 @@ source_set("thunk") {
"ppb_camera_device_private_thunk.cc",
"ppb_console_thunk.cc",
"ppb_cursor_control_thunk.cc",
"ppb_device_ref_api.h",
"ppb_device_ref_dev_thunk.cc",
"ppb_ext_crx_file_system_private_thunk.cc",
"ppb_file_chooser_api.h",
@ -71,7 +89,6 @@ source_set("thunk") {
"ppb_image_data_thunk.cc",
"ppb_input_event_api.h",
"ppb_input_event_thunk.cc",
"ppb_instance_api.h",
"ppb_instance_private_thunk.cc",
"ppb_instance_thunk.cc",
"ppb_isolated_file_system_private_api.h",
@ -80,7 +97,6 @@ source_set("thunk") {
"ppb_media_stream_audio_track_thunk.cc",
"ppb_media_stream_video_track_api.h",
"ppb_media_stream_video_track_thunk.cc",
"ppb_message_loop_api.h",
"ppb_messaging_thunk.cc",
"ppb_mouse_cursor_thunk.cc",
"ppb_mouse_lock_thunk.cc",
@ -132,8 +148,6 @@ source_set("thunk") {
"ppb_vpn_provider_thunk.cc",
"ppb_websocket_api.h",
"ppb_websocket_thunk.cc",
"resource_creation_api.h",
"thunk.h",
]
if (!is_nacl) {
@ -169,14 +183,17 @@ source_set("thunk") {
]
}
configs += [ "//build/config:precompiled_headers" ]
defines = [
# This target goes in the same library as shared_impl (in GYP they are the
# same).
"PPAPI_SHARED_IMPLEMENTATION",
"PPAPI_THUNK_IMPLEMENTATION",
configs += [
"//ppapi/shared_impl:export_shared_impl_and_thunk",
"//build/config:precompiled_headers",
]
public_deps = [ "//base" ]
deps = [
"//base",
"//gpu/command_buffer/common",
"//ppapi/c",
"//ppapi/shared_impl:common",
"//ppapi/shared_impl:headers",
]
public_deps = [ ":headers" ]
}

@ -10,6 +10,7 @@
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/resource_tracker.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "ppapi/thunk/resource_creation_api.h"

@ -14,14 +14,15 @@
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/resource_tracker.h"
#include "ppapi/shared_impl/singleton_resource_id.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "ppapi/thunk/resource_creation_api.h"
namespace ppapi {
class TrackedCallback;
namespace thunk {
// Enter* helper objects: These objects wrap a call from the C PPAPI into

@ -22,7 +22,6 @@
#include "ppapi/c/ppb_text_input_controller.h"
#include "ppapi/c/private/ppb_instance_private.h"
#include "ppapi/shared_impl/api_id.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/singleton_resource_id.h"
// Windows headers interfere with this file.

@ -25,7 +25,6 @@
#include "ppapi/c/ppb_websocket.h"
#include "ppapi/c/private/pp_private_font_charset.h"
#include "ppapi/shared_impl/api_id.h"
#include "ppapi/shared_impl/ppb_image_data_shared.h"
// Windows defines 'PostMessage', so we have to undef it.
#ifdef PostMessage