Reduce includes of windows.h Windows.h is included in a number of key header files which means that a majority of the translation units when building Chrome include Windows.h. This is slowing down builds. This change creates a new header - base/win/windows_types.h - which contains typedefs and defines of common Windows.h types - and uses this in place of windows.h in enough places to reduce the number of translation units that include windows.h in a build of the 'chrome' target (debug component non-jumbo) by 5219, from 19041 to 13822, giving measurable build-time speedups (~2.5-3.0%). Follow-up changes will apply the same techniques to more headers and drop the number much further. Perversely enough, this change also adds includes of windows.h in many places - places that always needed windows.h but were implicitly depending on it being included elsewhere. TBR=jochen@chromium.org,wfh@chromium.org,rockot@chromium.org,mef@chromium.org,raymes@chromium.org,joedow@chromium.org,rogerta@chromium.org,jsbell@chromium.org,dpranke@chromium.org,sky@chromium.org TBRing mechanical changes, reviewers: jochen@ : Please review changes to chrome/, components/, content/, third_party/WebKit/Source/platform wfh@ : Please review changes to courgette/, sandbox/win rockot@ : Please review changes to device/, ipc/, services/ mef@ : Please review changes to net/ raymes@ : Please review changes to ppapi/ joedow@ : Please review changes to remoting/ rogerta@ : Please review changes to rlz/ jsbell@: Please review changes to storage/ dpranke@ : Please review changes to tools/gn/ sky@ : Please review changes to ui/ Bug: 796644,798763 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I3958d0d7d813bed74d9b166e0358dbde5b5729af Reviewed-on: https://chromium-review.googlesource.com/846422 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: Misha Efimov <mef@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#526881} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: bfdc3fdc473922b0b99a0a0af37e8f8f97340173
diff --git a/tools/gn/filesystem_utils.cc b/tools/gn/filesystem_utils.cc index f97edf6..b1370e8 100644 --- a/tools/gn/filesystem_utils.cc +++ b/tools/gn/filesystem_utils.cc
@@ -15,6 +15,10 @@ #include "tools/gn/settings.h" #include "tools/gn/source_dir.h" +#if defined(OS_WIN) +#include <windows.h> +#endif + namespace { enum DotDisposition {