diff --git a/.circleci/config.yml b/.circleci/config.yml index 1eecbec20ef..b4d70777cd5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -231,6 +231,14 @@ step-gn-gen-default: &step-gn-gen-default cd src gn gen out/Default --args='import("'$GN_CONFIG'") cc_wrapper="'"$SCCACHE_PATH"'"'" $GN_EXTRA_ARGS" +step-gn-check: &step-gn-check + run: + name: GN check + command: | + cd src + gn check out/Default //electron:electron_lib + gn check out/Default //electron:electron_app + step-electron-build: &step-electron-build run: name: Electron build @@ -568,6 +576,15 @@ steps-checkout: &steps-checkout - depot_tools - src +steps-electron-gn-check: &steps-electron-gn-check + steps: + - attach_workspace: + at: . + - *step-depot-tools-add-to-path + - *step-setup-env-for-build + - *step-gn-gen-default + - *step-gn-check + steps-electron-build: &steps-electron-build steps: - attach_workspace: @@ -857,6 +874,13 @@ jobs: <<: *env-enable-sccache <<: *steps-electron-build + linux-x64-debug-gn-check: + <<: *machine-linux-medium + environment: + <<: *env-linux-medium + <<: *env-debug-build + <<: *steps-electron-gn-check + linux-x64-testing: <<: *machine-linux-2xlarge environment: @@ -865,6 +889,13 @@ jobs: <<: *env-enable-sccache <<: *steps-electron-build-for-tests + linux-x64-testing-gn-check: + <<: *machine-linux-medium + environment: + <<: *env-linux-medium + <<: *env-testing-build + <<: *steps-electron-gn-check + linux-x64-chromedriver: <<: *machine-linux-medium environment: @@ -1005,6 +1036,14 @@ jobs: <<: *env-enable-sccache <<: *steps-electron-build + linux-arm64-debug-gn-check: + <<: *machine-linux-medium + environment: + <<: *env-linux-medium + <<: *env-arm64 + <<: *env-debug-build + <<: *steps-electron-gn-check + linux-arm64-testing: <<: *machine-linux-2xlarge environment: @@ -1015,6 +1054,14 @@ jobs: TRIGGER_ARM_TEST: true <<: *steps-electron-build-for-tests + linux-arm64-testing-gn-check: + <<: *machine-linux-medium + environment: + <<: *env-linux-medium + <<: *env-arm64 + <<: *env-testing-build + <<: *steps-electron-gn-check + linux-arm64-chromedriver: <<: *machine-linux-medium environment: @@ -1062,6 +1109,20 @@ jobs: <<: *env-enable-sccache <<: *steps-electron-build-for-tests + osx-debug-gn-check: + <<: *machine-mac + environment: + <<: *env-machine-mac + <<: *env-debug-build + <<: *steps-electron-gn-check + + osx-testing-gn-check: + <<: *machine-mac + environment: + <<: *env-machine-mac + <<: *env-testing-build + <<: *steps-electron-gn-check + osx-chromedriver: <<: *machine-mac environment: @@ -1096,6 +1157,22 @@ jobs: <<: *env-enable-sccache <<: *steps-electron-build-for-tests + mas-debug-gn-check: + <<: *machine-mac + environment: + <<: *env-machine-mac + <<: *env-mas + <<: *env-debug-build + <<: *steps-electron-gn-check + + mas-testing-gn-check: + <<: *machine-mac + environment: + <<: *env-machine-mac + <<: *env-mas + <<: *env-testing-build + <<: *steps-electron-gn-check + mas-chromedriver: <<: *machine-mac environment: @@ -1353,9 +1430,15 @@ workflows: - linux-x64-debug: requires: - linux-checkout + - linux-x64-debug-gn-check: + requires: + - linux-checkout - linux-x64-testing: requires: - linux-checkout + - linux-x64-testing-gn-check: + requires: + - linux-checkout - linux-x64-testing-tests: requires: - linux-x64-testing @@ -1380,9 +1463,15 @@ workflows: - linux-arm64-debug: requires: - linux-checkout + - linux-arm64-debug-gn-check: + requires: + - linux-checkout - linux-arm64-testing: requires: - linux-checkout + - linux-arm64-testing-gn-check: + requires: + - linux-checkout build-mac: jobs: @@ -1391,6 +1480,13 @@ workflows: requires: - mac-checkout + - osx-debug-gn-check: + requires: + - mac-checkout + - osx-testing-gn-check: + requires: + - mac-checkout + - osx-testing-tests: requires: - osx-testing @@ -1399,6 +1495,13 @@ workflows: requires: - mac-checkout + - mas-debug-gn-check: + requires: + - mac-checkout + - mas-testing-gn-check: + requires: + - mac-checkout + - mas-testing-tests: requires: - mas-testing diff --git a/BUILD.gn b/BUILD.gn index 6bd3938a2cd..c4f0c3f62b9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -326,13 +326,13 @@ static_library("electron_lib") { deps = [ ":atom_js2c", + ":resources", "buildflags", "chromium_src:chrome", "manifests", "native_mate", - "//base", "//base:base_static", - "//base:i18n", + "//base/allocator:buildflags", "//chrome/app/resources:platform_locale_settings", "//components/certificate_transparency", "//components/net_log", @@ -341,10 +341,12 @@ static_library("electron_lib") { "//components/spellcheck/renderer", "//components/viz/host", "//components/viz/service", - "//content/public/app:both", "//content/public/browser", "//content/public/child", "//content/public/common:service_names", + "//content/public/renderer", + "//content/public/utility", + "//device/bluetooth", "//gin", "//media/capture/mojom:video_capture", "//media/mojo/interfaces", @@ -354,6 +356,7 @@ static_library("electron_lib") { "//ppapi/host", "//ppapi/proxy", "//ppapi/shared_impl", + "//printing/buildflags", "//services/audio/public/mojom:constants", "//services/device/public/mojom", "//services/proxy_resolver:lib", @@ -369,8 +372,17 @@ static_library("electron_lib") { "//third_party/widevine/cdm:headers", "//ui/events:dom_keycode_converter", "//ui/gl", + "//ui/native_theme", + "//ui/shell_dialogs", "//ui/views", "//v8", + "//v8:v8_libplatform", + ] + + public_deps = [ + "//base", + "//base:i18n", + "//content/public/app:both", ] include_dirs = [ @@ -435,6 +447,7 @@ static_library("electron_lib") { "atom/browser/fake_location_provider.cc", "atom/browser/fake_location_provider.h", ] + deps += [ "//services/device/public/cpp/geolocation" ] } if (is_mac) { @@ -485,9 +498,6 @@ static_library("electron_lib") { "//device/bluetooth", "//ui/events/devices/x11", "//ui/events/platform/x11", - "//ui/native_theme", - "//ui/views/controls/webview", - "//ui/wm", ] configs += [ ":gio_unix" ] defines += [ @@ -499,9 +509,20 @@ static_library("electron_lib") { } if (is_win) { libs += [ "dwmapi.lib" ] + deps += [ + "//third_party/breakpad:breakpad_handler", + "//third_party/breakpad:breakpad_sender", + "//ui/native_theme:native_theme_browser", + "//ui/wm/public", + ] + public_deps += [ "//sandbox/win:sandbox" ] } if (is_linux || is_win) { - deps += [ "//third_party/breakpad:client" ] + deps += [ + "//third_party/breakpad:client", + "//ui/views/controls/webview", + "//ui/wm", + ] include_dirs += [ "//third_party/breakpad" ] } @@ -866,6 +887,7 @@ if (is_mac) { ":electron_lib", ":packed_resources", "//content:sandbox_helper_win", + "//electron/buildflags", "//ui/strings", ] @@ -894,17 +916,7 @@ if (is_mac) { # TODO: we should be generating our .rc files more like how chrome does "atom/browser/resources/win/atom.ico", "atom/browser/resources/win/atom.rc", - "atom/browser/resources/win/resources.h", - ] - - deps += [ - "//third_party/breakpad:breakpad_handler", - "//third_party/breakpad:breakpad_sender", - "//ui/native_theme:native_theme_browser", - "//ui/shell_dialogs", - "//ui/views/controls/webview", - "//ui/wm", - "//ui/wm/public", + "atom/browser/resources/win/resource.h", ] libs = [ diff --git a/appveyor.yml b/appveyor.yml index d279c264746..b04dc0c3318 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -56,6 +56,8 @@ build_script: - cd src - ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn" - gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS%" + - gn check out/Default //electron:electron_lib + - gn check out/Default //electron:electron_app - ninja -C out/Default electron:electron_app - gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%" - ninja -C out/ffmpeg electron:electron_ffmpeg_zip diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 41bfa5f26ce..ad07393178c 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -34,8 +34,8 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/icon_manager.h" #include "chrome/common/chrome_paths.h" -#include "content/browser/gpu/compositor_util.h" -#include "content/browser/gpu/gpu_data_manager_impl.h" +#include "content/browser/gpu/compositor_util.h" // nogncheck +#include "content/browser/gpu/gpu_data_manager_impl.h" // nogncheck #include "content/public/browser/browser_accessibility_state.h" #include "content/public/browser/browser_child_process_host.h" #include "content/public/browser/child_process_data.h" diff --git a/atom/browser/api/atom_api_browser_window.cc b/atom/browser/api/atom_api_browser_window.cc index 7c7afe18e58..80e23ebf76a 100644 --- a/atom/browser/api/atom_api_browser_window.cc +++ b/atom/browser/api/atom_api_browser_window.cc @@ -17,8 +17,8 @@ #include "atom/common/native_mate_converters/value_converter.h" #include "atom/common/options_switches.h" #include "base/threading/thread_task_runner_handle.h" -#include "content/browser/renderer_host/render_widget_host_impl.h" -#include "content/browser/renderer_host/render_widget_host_owner_delegate.h" +#include "content/browser/renderer_host/render_widget_host_impl.h" // nogncheck +#include "content/browser/renderer_host/render_widget_host_owner_delegate.h" // nogncheck #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "gin/converter.h" diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 021c8e862b1..e5e38098594 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -49,7 +49,7 @@ #include "native_mate/object_template_builder.h" #include "net/base/load_flags.h" #include "net/disk_cache/disk_cache.h" -#include "net/dns/host_cache.h" +#include "net/dns/host_cache.h" // nogncheck #include "net/http/http_auth_handler_factory.h" #include "net/http/http_auth_preferences.h" #include "net/http/http_cache.h" diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 47c95ca5074..fd6eb0d6058 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -54,10 +54,10 @@ #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ssl/security_state_tab_helper.h" -#include "content/browser/frame_host/frame_tree_node.h" -#include "content/browser/frame_host/render_frame_host_manager.h" -#include "content/browser/renderer_host/render_widget_host_impl.h" -#include "content/browser/renderer_host/render_widget_host_view_base.h" +#include "content/browser/frame_host/frame_tree_node.h" // nogncheck +#include "content/browser/frame_host/render_frame_host_manager.h" // nogncheck +#include "content/browser/renderer_host/render_widget_host_impl.h" // nogncheck +#include "content/browser/renderer_host/render_widget_host_view_base.h" // nogncheck #include "content/common/widget_messages.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/download_request_utils.h" diff --git a/atom/browser/api/atom_api_web_contents_impl.cc b/atom/browser/api/atom_api_web_contents_impl.cc index ccb7086700b..30448ff2d5a 100644 --- a/atom/browser/api/atom_api_web_contents_impl.cc +++ b/atom/browser/api/atom_api_web_contents_impl.cc @@ -4,9 +4,9 @@ #include "atom/browser/api/atom_api_web_contents.h" -#include "content/browser/frame_host/frame_tree.h" -#include "content/browser/frame_host/frame_tree_node.h" -#include "content/browser/web_contents/web_contents_impl.h" +#include "content/browser/frame_host/frame_tree.h" // nogncheck +#include "content/browser/frame_host/frame_tree_node.h" // nogncheck +#include "content/browser/web_contents/web_contents_impl.h" // nogncheck #include "content/public/browser/guest_mode.h" #if BUILDFLAG(ENABLE_OSR) diff --git a/atom/browser/api/gpuinfo_manager.h b/atom/browser/api/gpuinfo_manager.h index 18749f6f562..6fcb08a1962 100644 --- a/atom/browser/api/gpuinfo_manager.h +++ b/atom/browser/api/gpuinfo_manager.h @@ -11,7 +11,7 @@ #include "atom/common/native_mate_converters/value_converter.h" #include "atom/common/promise_util.h" -#include "content/browser/gpu/gpu_data_manager_impl.h" +#include "content/browser/gpu/gpu_data_manager_impl.h" // nogncheck #include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/gpu_data_manager_observer.h" diff --git a/atom/browser/atom_blob_reader.cc b/atom/browser/atom_blob_reader.cc index 1796b81a632..cfb89bc8de1 100644 --- a/atom/browser/atom_blob_reader.cc +++ b/atom/browser/atom_blob_reader.cc @@ -7,7 +7,7 @@ #include #include "base/task/post_task.h" -#include "content/browser/blob_storage/chrome_blob_storage_context.h" +#include "content/browser/blob_storage/chrome_blob_storage_context.h" // nogncheck #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "net/base/io_buffer.h" diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index d8e805d4cdb..99c274ecd7b 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -36,7 +36,7 @@ #include "components/prefs/value_map_pref_store.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/proxy_config_pref_names.h" -#include "content/browser/blob_storage/chrome_blob_storage_context.h" +#include "content/browser/blob_storage/chrome_blob_storage_context.h" // nogncheck #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" #include "net/base/escape.h" diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index 112b5a179be..827bbc3b4c7 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -24,13 +24,12 @@ #include "base/threading/scoped_blocking_call.h" #include "base/threading/sequenced_task_runner_handle.h" #include "chrome/browser/ssl/security_state_tab_helper.h" -#include "chrome/browser/ui/color_chooser.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/security_state/content/content_utils.h" #include "components/security_state/core/security_state.h" -#include "content/browser/renderer_host/render_widget_host_view_base.h" +#include "content/browser/renderer_host/render_widget_host_view_base.h" // nogncheck #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/file_select_listener.h" @@ -42,6 +41,10 @@ #include "printing/buildflags/buildflags.h" #include "storage/browser/fileapi/isolated_context.h" +#if BUILDFLAG(ENABLE_COLOR_CHOOSER) +#include "chrome/browser/ui/color_chooser.h" +#endif + #if BUILDFLAG(ENABLE_OSR) #include "atom/browser/osr/osr_web_contents_view.h" #endif diff --git a/atom/browser/loader/layered_resource_handler.h b/atom/browser/loader/layered_resource_handler.h index ba1ad16e90d..78bb275050e 100644 --- a/atom/browser/loader/layered_resource_handler.h +++ b/atom/browser/loader/layered_resource_handler.h @@ -7,7 +7,7 @@ #include -#include "content/browser/loader/layered_resource_handler.h" +#include "content/browser/loader/layered_resource_handler.h" // nogncheck #include "services/network/public/cpp/resource_response.h" namespace atom { diff --git a/atom/browser/net/url_request_context_getter.cc b/atom/browser/net/url_request_context_getter.cc index 70d8c8b02a8..705f1f2b85d 100644 --- a/atom/browser/net/url_request_context_getter.cc +++ b/atom/browser/net/url_request_context_getter.cc @@ -35,7 +35,7 @@ #include "net/base/host_mapping_rules.h" #include "net/cert/multi_log_ct_verifier.h" #include "net/cookies/cookie_monster.h" -#include "net/dns/mapped_host_resolver.h" +#include "net/dns/mapped_host_resolver.h" // nogncheck #include "net/http/http_auth_handler_factory.h" #include "net/http/http_auth_preferences.h" #include "net/http/http_auth_scheme.h" diff --git a/atom/browser/ui/cocoa/atom_ns_window_delegate.h b/atom/browser/ui/cocoa/atom_ns_window_delegate.h index 32a37d06921..c38affd20bc 100644 --- a/atom/browser/ui/cocoa/atom_ns_window_delegate.h +++ b/atom/browser/ui/cocoa/atom_ns_window_delegate.h @@ -7,7 +7,7 @@ #include -#include "ui/views_bridge_mac/views_nswindow_delegate.h" +#include "ui/views_bridge_mac/views_nswindow_delegate.h" // nogncheck namespace atom { class NativeWindowMac; diff --git a/atom/browser/web_view_guest_delegate.cc b/atom/browser/web_view_guest_delegate.cc index 01cb63ba39c..d139e88e695 100644 --- a/atom/browser/web_view_guest_delegate.cc +++ b/atom/browser/web_view_guest_delegate.cc @@ -8,7 +8,7 @@ #include "atom/browser/api/atom_api_web_contents.h" #include "atom/common/native_mate_converters/gurl_converter.h" -#include "content/browser/web_contents/web_contents_impl.h" +#include "content/browser/web_contents/web_contents_impl.h" // nogncheck #include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" diff --git a/atom/renderer/renderer_client_base.cc b/atom/renderer/renderer_client_base.cc index d7682a21500..037a97b6e06 100644 --- a/atom/renderer/renderer_client_base.cc +++ b/atom/renderer/renderer_client_base.cc @@ -33,7 +33,7 @@ #include "third_party/blink/public/web/web_script_source.h" #include "third_party/blink/public/web/web_security_policy.h" #include "third_party/blink/public/web/web_view.h" -#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h" +#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h" // nogncheck #if defined(OS_MACOSX) #include "base/strings/sys_string_conversions.h" diff --git a/atom/renderer/renderer_client_base.h b/atom/renderer/renderer_client_base.h index 508ad391ca9..3ec129a79c3 100644 --- a/atom/renderer/renderer_client_base.h +++ b/atom/renderer/renderer_client_base.h @@ -15,7 +15,7 @@ #include "widevine_cdm_version.h" // NOLINT(build/include) #if defined(WIDEVINE_CDM_AVAILABLE) -#include "chrome/renderer/media/chrome_key_systems_provider.h" +#include "chrome/renderer/media/chrome_key_systems_provider.h" // nogncheck #endif namespace atom { diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index cf86fe19747..732a13b4357 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -49,14 +49,15 @@ static_library("chrome") { "//extensions/browser/app_window/size_constraints.h", ] public_deps = [ - "//content/public/browser", - ] - deps = [ "//chrome/common", - "//components/feature_engagement:buildflags", + "//chrome/common:version_header", "//components/keyed_service/content", "//components/proxy_config", "//components/security_state/content", + "//content/public/browser", + ] + deps = [ + "//components/feature_engagement:buildflags", ] if (is_linux) { @@ -85,6 +86,7 @@ static_library("chrome") { "//chrome/browser/platform_util.cc", "//chrome/browser/platform_util.h", "//chrome/browser/ui/browser_dialogs.h", + "//chrome/browser/ui/color_chooser.h", ] if (use_aura) { @@ -156,14 +158,16 @@ static_library("chrome") { "//chrome/browser/printing/printing_message_filter.cc", "//chrome/browser/printing/printing_message_filter.h", ] - deps += [ + public_deps += [ "//chrome/services/printing:lib", "//components/printing/browser", - "//components/printing/common", "//components/printing/renderer", - "//components/services/pdf_compositor", "//components/services/pdf_compositor/public/cpp:factory", "//components/services/pdf_compositor/public/interfaces", + ] + deps += [ + "//components/printing/common", + "//components/services/pdf_compositor", "//printing", ]