chore: more iwyu (#43063)

* chore: iwyu shell/browser/electron_pdf_document_helper_client.h

* chore: iwyu shell/browser/hid/electron_hid_delegate.h

* chore: iwyu content/public/browser/web_contents.h

* chore: iwyu shell/browser/usb/electron_usb_delegate.h

* chore: iwyu shell/browser/browser_observer.h

* chore: iwyu shell/browser/bluetooth/electron_bluetooth_delegate.h

* chore: iwyu shell/browser/serial/electron_serial_delegate.h

* chore: iwyu shell/browser/api/frame_subscriber.h

* chore: iwyu mojo/public/cpp/bindings/

* chore: iwyu components/

* chore: iwyu extensions/

* chore: iwyu shell/common/gin_helper/

* chore: iwyu v8/

* chore: iwyu base/containers/linked_list.h

* chore: iwyu shell/browser/native_window.h

* chore: iwyu shell/browser/api/electron_api_base_window.h

* chore: iwyu shell/common/node_includes.h

* chore: iwyu gin/handle.h

* chore: iwyu base/functional/callback.h

* chore: iwyu ui/gfx/

* chore: iwyu content/public/browser/render_frame_host.h

* fix: mac

* fix: mac

* fix: win

* chore: iwyu base/files/file_path.h

* chore: iwyu base/unguessable_token.h

* chore: iwyu ui/display/screen.h

* chore: iwyu chrome/browser/predictors/preconnect_manager.h

* chore: iwyu base/observer_list_types.h

* chore: iwyu content/public/browser/web_contents.h

* chore: iwyu chrome/browser/devtools/devtools_eye_dropper.h

* chore: iwyu shell/browser/ui/inspectable_web_contents.h

* chore: iwyu content/public/browser/keyboard_event_processing_result.h

* chore: iwyu net/cookies/canonical_cookie.h

* chore: iwyu net/base/address_list.h

* chore: iwyu net/cert/x509_certificate.h

* chore: iwyu net/cookies/cookie_change_dispatcher.h

* chore: iwyu net/dns/public/host_resolver_results.h

* fix: mac

* Revert "chore: iwyu net/cert/x509_certificate.h"

This reverts commit 002896f71146e90f1e29e090a1d6eede48cee11e.
This commit is contained in:
Charles Kerr 2024-07-29 12:42:57 -05:00 committed by GitHub
parent 92496c1930
commit e70ce89235
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
187 changed files with 640 additions and 223 deletions

View file

@ -18,6 +18,7 @@
#include "ui/base/clipboard/file_info.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image.h"
namespace electron::api {

View file

@ -10,8 +10,11 @@
#include "shell/common/gin_converters/file_path_converter.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/gfx/image/image.h"
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace gfx {
class Image;
} // namespace gfx
namespace gin_helper {
class Arguments;

View file

@ -15,6 +15,7 @@
#include "base/strings/pattern.h"
#include "base/strings/utf_string_conversions.h"
#include "gin/arguments.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
#include "gin/per_isolate_data.h"
#include "net/base/data_url.h"
@ -25,6 +26,7 @@
#include "shell/common/gin_converters/gurl_converter.h"
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "shell/common/gin_helper/function_template_extensions.h"
#include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/node_includes.h"

View file

@ -11,9 +11,7 @@
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "gin/handle.h"
#include "gin/wrappable.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia_rep.h"
@ -26,20 +24,24 @@ class GURL;
namespace base {
class FilePath;
}
} // namespace base
namespace gfx {
class Rect;
class Size;
} // namespace gfx
namespace gin_helper {
class Dictionary;
}
namespace gin {
class Arguments;
}
template <typename T>
class Handle;
} // namespace gin
namespace gin_helper {
class Dictionary;
class ErrorThrower;
} // namespace gin_helper
namespace electron::api {

View file

@ -16,6 +16,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/task/bind_post_task.h"
#include "gin/arguments.h"
#include "gin/handle.h"
#include "shell/common/gin_converters/image_converter.h"
#include "shell/common/gin_helper/promise.h"
#include "ui/gfx/color_utils.h"

View file

@ -13,6 +13,7 @@
#include "shell/common/gin_helper/promise.h"
#include "shell/common/node_includes.h"
#include "shell/common/platform_util.h"
#include "v8/include/v8-microtask-queue.h"
#if BUILDFLAG(IS_WIN)
#include "base/win/scoped_com_initializer.h"

View file

@ -22,6 +22,7 @@
#include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe_producer.h"
#include "net/base/auth.h"
#include "net/base/load_flags.h"
#include "net/http/http_util.h"
#include "net/url_request/redirect_util.h"

View file

@ -15,7 +15,6 @@
#include "base/sequence_checker.h"
#include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "net/base/auth.h"
#include "services/network/public/cpp/simple_url_loader_stream_consumer.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom-forward.h"
@ -23,7 +22,7 @@
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "shell/browser/event_emitter_mixin.h"
#include "url/gurl.h"
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace gin {
class Arguments;
@ -31,6 +30,10 @@ template <typename T>
class Handle;
} // namespace gin
namespace net {
class AuthChallengeInfo;
} // namespace net
namespace network {
class SimpleURLLoader;
struct ResourceRequest;

View file

@ -10,7 +10,6 @@
#include "base/memory/scoped_refptr.h"
#include "base/process/process_metrics.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/node_bindings.h"
#include "uv.h" // NOLINT(build/include_directory)
@ -21,6 +20,8 @@ class FilePath;
namespace gin_helper {
class Arguments;
class Dictionary;
template <typename T>
class Promise;
} // namespace gin_helper
namespace memory_instrumentation {

View file

@ -6,7 +6,9 @@
#define ELECTRON_SHELL_COMMON_API_OBJECT_LIFE_MONITOR_H_
#include "base/memory/weak_ptr.h"
#include "v8/include/v8.h"
#include "v8/include/v8-object.h"
#include "v8/include/v8-persistent-handle.h"
#include "v8/include/v8-weak-callback-info.h"
namespace electron {

View file

@ -4,6 +4,7 @@
#include "shell/common/gin_converters/image_converter.h"
#include "gin/handle.h"
#include "shell/common/api/electron_api_native_image.h"
#include "shell/common/gin_converters/file_path_converter.h"
#include "ui/gfx/image/image_skia.h"

View file

@ -16,6 +16,7 @@
#include "base/values.h"
#include "gin/converter.h"
#include "gin/dictionary.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util.h"

View file

@ -13,6 +13,7 @@
#include "shell/common/gin_helper/function_template.h"
#include "shell/common/gin_helper/locker.h"
#include "shell/common/gin_helper/microtasks_scope.h"
#include "v8/include/v8-function.h"
// Implements safe conversions between JS functions and base::RepeatingCallback.
namespace gin_helper {

View file

@ -8,6 +8,7 @@
#include "gin/per_isolate_data.h"
#include "shell/common/gin_helper/event_emitter_template.h"
#include "shell/common/gin_helper/function_template_extensions.h"
#include "v8/include/v8-context.h"
namespace gin_helper {
template <typename T>

View file

@ -7,6 +7,7 @@
#include "base/no_destructor.h"
#include "gin/converter.h"
#include "shell/common/gin_helper/wrappable_base.h"
#include "v8/include/v8-function.h"
namespace gin_helper {

View file

@ -5,7 +5,7 @@
#ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_DESTROYABLE_H_
#define ELECTRON_SHELL_COMMON_GIN_HELPER_DESTROYABLE_H_
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace gin_helper {

View file

@ -8,7 +8,7 @@
#include <string_view>
#include "base/memory/raw_ptr.h"
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace gin_helper {

View file

@ -4,6 +4,7 @@
#include "shell/common/gin_helper/event.h"
#include "gin/dictionary.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
namespace gin_helper::internal {

View file

@ -5,10 +5,14 @@
#ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_EVENT_H_
#define ELECTRON_SHELL_COMMON_GIN_HELPER_EVENT_H_
#include "gin/handle.h"
#include "gin/wrappable.h"
#include "shell/common/gin_helper/constructible.h"
namespace gin {
template <typename T>
class Handle;
} // namespace gin
namespace v8 {
class Isolate;
template <typename T>

View file

@ -17,6 +17,9 @@
#include "shell/common/gin_helper/destroyable.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "shell/common/gin_helper/microtasks_scope.h"
#include "v8/include/v8-context.h"
#include "v8/include/v8-external.h"
#include "v8/include/v8-template.h"
// This file is forked from gin/function_template.h with 2 differences:
// 1. Support for additional types of arguments.

View file

@ -5,6 +5,7 @@
#include "shell/common/gin_helper/locker.h"
#include "shell/common/process_util.h"
#include "v8/include/v8-locker.h"
namespace gin_helper {

View file

@ -7,7 +7,10 @@
#include <memory>
#include "v8/include/v8.h"
namespace v8 {
class Isolate;
class Locker;
} // namespace v8
namespace gin_helper {

View file

@ -7,7 +7,8 @@
#include <memory>
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
#include "v8/include/v8-microtask-queue.h"
namespace gin_helper {

View file

@ -6,7 +6,11 @@
#define ELECTRON_SHELL_COMMON_GIN_HELPER_PERSISTENT_DICTIONARY_H_
#include "base/memory/raw_ptr.h"
#include "shell/common/gin_helper/dictionary.h"
#include "gin/converter.h"
#include "v8/include/v8-context.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-local-handle.h"
#include "v8/include/v8-object.h"
namespace gin_helper {

View file

@ -5,7 +5,10 @@
#ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_PINNABLE_H_
#define ELECTRON_SHELL_COMMON_GIN_HELPER_PINNABLE_H_
#include "v8/include/v8.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-local-handle.h"
#include "v8/include/v8-persistent-handle.h"
#include "v8/include/v8-value.h"
namespace gin_helper {

View file

@ -5,6 +5,7 @@
#include <string_view>
#include "shell/common/gin_helper/promise.h"
#include "v8/include/v8-context.h"
namespace gin_helper {

View file

@ -18,6 +18,7 @@
#include "shell/common/gin_helper/locker.h"
#include "shell/common/gin_helper/microtasks_scope.h"
#include "shell/common/process_util.h"
#include "v8/include/v8-context.h"
namespace gin_helper {

View file

@ -6,6 +6,7 @@
#include "base/logging.h"
#include "shell/common/gin_helper/dictionary.h"
#include "v8/include/v8-function.h"
namespace gin_helper {

View file

@ -6,7 +6,7 @@
#define ELECTRON_SHELL_COMMON_GIN_HELPER_WRAPPABLE_BASE_H_
#include "base/memory/raw_ptr.h"
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace gin {
class Arguments;

View file

@ -10,7 +10,7 @@
#include <vector>
#include "base/memory/raw_ptr.h"
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace electron {

View file

@ -35,6 +35,7 @@
#include "shell/common/gin_helper/event_emitter_caller.h"
#include "shell/common/gin_helper/microtasks_scope.h"
#include "shell/common/mac/main_application_bundle.h"
#include "shell/common/node_includes.h"
#include "shell/common/node_util.h"
#include "shell/common/world_ids.h"
#include "third_party/blink/public/web/web_local_frame.h"
@ -437,6 +438,20 @@ NodeBindings::~NodeBindings() {
stop_and_close_uv_loop(uv_loop_);
}
node::IsolateData* NodeBindings::isolate_data(
v8::Local<v8::Context> context) const {
if (context->GetNumberOfEmbedderDataFields() <=
kElectronContextEmbedderDataIndex) {
return nullptr;
}
auto* isolate_data = static_cast<node::IsolateData*>(
context->GetAlignedPointerFromEmbedderData(
kElectronContextEmbedderDataIndex));
CHECK(isolate_data);
CHECK(isolate_data->event_loop());
return isolate_data;
}
// static
uv_loop_t* NodeBindings::InitEventLoop(BrowserEnvironment browser_env,
uv_loop_t* worker_loop) {

View file

@ -17,14 +17,19 @@
#include "base/memory/weak_ptr.h"
#include "gin/public/context_holder.h"
#include "gin/public/gin_embedders.h"
#include "shell/common/node_includes.h"
#include "uv.h" // NOLINT(build/include_directory)
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace base {
class SingleThreadTaskRunner;
}
namespace node {
class Environment;
class IsolateData;
class MultiIsolatePlatform;
} // namespace node
namespace electron {
// A helper class to manage uv_handle_t types, e.g. uv_async_t.
@ -114,18 +119,7 @@ class NodeBindings {
// Notify embed thread to start polling after environment is loaded.
void StartPolling();
node::IsolateData* isolate_data(v8::Local<v8::Context> context) const {
if (context->GetNumberOfEmbedderDataFields() <=
kElectronContextEmbedderDataIndex) {
return nullptr;
}
auto* isolate_data = static_cast<node::IsolateData*>(
context->GetAlignedPointerFromEmbedderData(
kElectronContextEmbedderDataIndex));
CHECK(isolate_data);
CHECK(isolate_data->event_loop());
return isolate_data;
}
node::IsolateData* isolate_data(v8::Local<v8::Context> context) const;
// Gets/sets the environment to wrap uv loop.
void set_uv_env(node::Environment* env) { uv_env_ = env; }

View file

@ -7,7 +7,7 @@
#include <vector>
#include "v8/include/v8.h"
#include "v8/include/v8-forward.h"
namespace node {
class Environment;