mojo: Reduce includes of native struct and native enum headers
Most .mojom files don't use [Native] structs or enums, but the bindings
generator includes native_struct_serialization.h and native_enum.h in
all generated headers. Unfortunately native_struct_serialization.h is
expensive to include because it transitively includes a generated
mojom.h file.
Change the mojo bindings generator to only generate includes of for
native type headers when the underlying mojom file uses native structs
or enums.
Fix the include-what-you-use errors this reveals.
This results in 272,000 fewer transitive includes (out of 18M total)
in a Linux "all" build, a 1.4% reduction.
For IWYU fixes per mechanical change code review policy:
[email protected]
Bug: 922875
Test: compiles
Change-Id: If58d7002d944b8a131533750fa8a79514b6e9a09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1833069
Reviewed-by: James Cook <[email protected]>
Reviewed-by: Ken Rockot <[email protected]>
Commit-Queue: James Cook <[email protected]>
Cr-Commit-Position: refs/heads/master@{#702141}
diff --git a/components/heap_profiling/test_driver.h b/components/heap_profiling/test_driver.h
index ebf13638..0a66655 100644
--- a/components/heap_profiling/test_driver.h
+++ b/components/heap_profiling/test_driver.h
@@ -10,6 +10,7 @@
#include "base/allocator/partition_allocator/partition_alloc.h"
#include "base/macros.h"
#include "base/memory/ref_counted_memory.h"
+#include "base/process/process_handle.h"
#include "base/synchronization/waitable_event.h"
#include "components/services/heap_profiling/public/cpp/settings.h"
#include "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom.h"