source: webkit/trunk/Source/WebCore/WebCorePrefix.h

Last change on this file was 278340, checked in by Darin Adler, 4 years ago

Remove <wtf/Optional.h>
https://bugs.webkit.org/show_bug.cgi?id=226437

Reviewed by Chris Dumez.

Source/JavaScriptCore:

  • <many files>: Remove include of <wtf/Optional.h>.
  • inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:

(CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes): Don't generate
an include of wtf/Optional.h; including WTFString.h takes care of this anyway.

  • inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:

(CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes): Ditto.

  • inspector/scripts/codegen/generate_cpp_protocol_types_header.py:

(CppProtocolTypesHeaderGenerator._generate_secondary_header_includes): Ditto.

  • inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:

(CppProtocolTypesImplementationGenerator.generate_output): Generate an include of <optional>
instead of <wtf/Optional.h>.

  • inspector/scripts/tests/expected/*: Regenerate.

Source/WebCore:

  • <many files>: Removed include of <wtf/Optional.h>.
  • platform/graphics/Font.h: Tweaked style a bit.
  • Modules/geolocation/GeolocationClient.h: Added include of <optional>.
  • Modules/mediastream/DoubleRange.h: Ditto.
  • Modules/mediastream/LongRange.h: Ditto.
  • Modules/webauthn/AuthenticationExtensionsClientOutputs.h: Ditto.
  • css/CSSToLengthConversionData.h: Ditto.
  • css/DOMMatrix2DInit.h: Ditto.
  • dom/AddEventListenerOptions.h: Ditto.
  • dom/DeviceMotionData.h: Ditto.
  • dom/DeviceOrientationData.h: Ditto.
  • dom/SuccessOr.h: Ditto.
  • html/DateTimeFieldsState.h: Ditto.
  • html/ImageBitmapOptions.h: Ditto.
  • html/canvas/PredefinedColorSpace.h: Ditto.
  • layout/LayoutPhase.h: Ditto.
  • layout/MarginTypes.h: Ditto.
  • loader/ResourceLoadNotifier.h: Ditto.
  • page/RuntimeEnabledFeatures.h: Ditto.
  • page/ScrollOptions.h: Ditto.
  • platform/MediaCapabilitiesInfo.h: Ditto.
  • platform/cocoa/SystemBattery.h: Ditto.
  • platform/graphics/DecodingOptions.h: Ditto.
  • platform/graphics/DestinationColorSpace.h: Ditto.
  • platform/graphics/DisplayRefreshMonitorClient.h: Ditto.
  • platform/graphics/FloatLine.h: Ditto.
  • platform/graphics/gpu/GPURequestAdapterOptions.h: Ditto.
  • platform/graphics/x11/PlatformDisplayX11.h: Ditto.
  • platform/ios/SelectionGeometry.h: Ditto.
  • platform/mac/NSScrollerImpDetails.h: Ditto.
  • platform/network/DNS.h: Ditto.
  • platform/text/EncodingTables.h: Ditto.
  • platform/text/TextCodecCJK.h: Ditto.
  • platform/text/TextCodecUTF16.h: Ditto.
  • platform/text/TextFlags.h: Ditto.

Source/WebCore/PAL:

  • pal/SessionID.h: Include <optional>.
  • pal/crypto/gcrypt/Utilities.h: Ditto.
  • pal/crypto/tasn1/Utilities.cpp: Removed include of <wtf/Optional.h>.

Source/WebDriver:

  • SessionHost.h: Removed include of <wtf/Optional.h>.

Source/WebKit:

  • <many files>: Removed include of <wtf/Optional.h>.

Source/WebKitLegacy/mac:

  • DOM/DOMRangeInternal.h: Added import of <optional>.
  • WebView/WebGeolocationPosition.mm: Removed import of <wtf/Optional.h>.
  • WebView/WebGeolocationPositionInternal.h: Added import of <optional>.

Source/WTF:

  • <many files>: Removed include of <wtf/Optional.h>.
  • WTF.xcodeproj/project.pbxproj: Removed Optional.h.
  • wtf/Markable.h: Added include of <optional>.
  • wtf/OptionSet.h: Ditto.
  • wtf/Optional.h: Emptied this file. On the Windows build system, we can't

seem to build successfully without an empty file here. The copied forwarding
header seems to linger even if we remove the original. Until we fix the
Windows build system, if we want to support incremental builds, we need
to keep this empty file around.

  • wtf/PrintStream.h: Added include of <optional>.
  • wtf/Seconds.h: Ditto.
  • wtf/StackTrace.h: Ditto.
  • wtf/StdLibExtras.h: Moved the valueOrCompute function here from Optional.h.

Re-sorted the "using" at the bottom of the file.

  • wtf/URLHelpers.h: Added include of <optional>.
  • wtf/Vector.h: Ditto.

Tools:

  • <many files>: Removed include of <wtf/Optional.h>.
  • Property svn:eol-style set to native
File size: 4.6 KB
Line 
1/*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2013 Apple Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
21/* This prefix file should contain only:
22 * 1) files to precompile for faster builds
23 * 2) in one case at least: OS-X-specific performance bug workarounds
24 * 3) the special trick to catch us using new or delete without including "config.h"
25 * The project should be able to build without this header, although we rarely test that.
26 */
27
28/* Things that need to be defined globally should go into "config.h". */
29
30#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H && defined(BUILDING_WITH_CMAKE)
31#include "cmakeconfig.h"
32#endif
33
34#include <wtf/Platform.h>
35
36#if defined(__APPLE__)
37#ifdef __cplusplus
38#define NULL __null
39#else
40#define NULL ((void *)0)
41#endif
42#endif
43
44#if !OS(WINDOWS)
45#include <pthread.h>
46#endif // !OS(WINDOWS)
47
48#include <sys/types.h>
49#include <fcntl.h>
50#if HAVE(REGEX_H)
51#include <regex.h>
52#endif
53
54#include <setjmp.h>
55
56#include <signal.h>
57#include <stdarg.h>
58#include <stddef.h>
59#include <stdio.h>
60#include <stdlib.h>
61#include <string.h>
62#include <time.h>
63#if defined(__APPLE__)
64#include <unistd.h>
65#endif
66
67#ifdef __cplusplus
68#include <algorithm>
69#include <cstddef>
70#include <new>
71#endif
72
73#if defined(__APPLE__)
74#include <sys/param.h>
75#endif
76#include <sys/stat.h>
77#if defined(__APPLE__)
78#include <sys/time.h>
79#include <sys/resource.h>
80#endif
81
82#if USE(CF)
83#include <CoreFoundation/CoreFoundation.h>
84#endif
85
86#if USE(CG)
87#include <CoreGraphics/CoreGraphics.h>
88#endif
89
90#if OS(WINDOWS)
91#ifndef CF_IMPLICIT_BRIDGING_ENABLED
92#define CF_IMPLICIT_BRIDGING_ENABLED
93#endif
94
95#ifndef CF_IMPLICIT_BRIDGING_DISABLED
96#define CF_IMPLICIT_BRIDGING_DISABLED
97#endif
98
99#if USE(CF)
100#include <CoreFoundation/CFBase.h>
101#endif
102
103#ifndef CF_ENUM
104#define CF_ENUM(_type, _name) _type _name; enum
105#endif
106#ifndef CF_OPTIONS
107#define CF_OPTIONS(_type, _name) _type _name; enum
108#endif
109#ifndef CF_ENUM_DEPRECATED
110#define CF_ENUM_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep)
111#endif
112#ifndef CF_ENUM_AVAILABLE
113#define CF_ENUM_AVAILABLE(_mac, _ios)
114#endif
115#endif
116
117#if PLATFORM(WIN_CAIRO)
118#include <windows.h>
119#else
120
121#if OS(WINDOWS)
122
123#if USE(CG)
124// FIXME <rdar://problem/8208868> Remove support for obsolete ColorSync API, CoreServices header in CoreGraphics
125// We can remove this once the new ColorSync APIs are available in an internal Safari SDK.
126#include <ColorSync/ColorSync.h>
127#ifdef __COLORSYNCDEPRECATED__
128#define COREGRAPHICS_INCLUDES_CORESERVICES_HEADER
129#define OBSOLETE_COLORSYNC_API
130#endif
131#endif
132
133#if USE(CFURLCONNECTION)
134#include <CFNetwork/CFNetwork.h>
135// On Windows, dispatch.h needs to be included before certain CFNetwork headers.
136#include <dispatch/dispatch.h>
137#endif
138
139#include <windows.h>
140#endif // OS(WINDOWS)
141
142#if PLATFORM(IOS_FAMILY)
143#include <MobileCoreServices/MobileCoreServices.h>
144#endif
145
146#if PLATFORM(MAC)
147#if !USE(APPLE_INTERNAL_SDK)
148/* SecTrustedApplication.h declares SecTrustedApplicationCreateFromPath(...) to
149 * be unavailable on macOS, so do not include that header. */
150#define _SECURITY_SECTRUSTEDAPPLICATION_H_
151#endif
152#include <CoreServices/CoreServices.h>
153#endif
154
155#endif
156
157#ifdef __OBJC__
158#if PLATFORM(IOS_FAMILY)
159#import <Foundation/Foundation.h>
160#else
161#if USE(APPKIT)
162#import <Cocoa/Cocoa.h>
163#endif
164#endif // PLATFORM(IOS_FAMILY)
165#endif
166
167#ifdef __cplusplus
168
169#if !PLATFORM(WIN)
170#import <wtf/FastMalloc.h>
171#import <wtf/HashMap.h>
172#import <wtf/StdLibExtras.h>
173#import <wtf/text/AtomString.h>
174#import <wtf/text/WTFString.h>
175#endif
176
177#define new ("if you use new/delete make sure to include config.h at the top of the file"())
178#define delete ("if you use new/delete make sure to include config.h at the top of the file"())
179#endif
180
181/* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
182 * to allow C++ code that expects exceptions to build. These definitions
183 * interfere with Objective-C++ uses of Objective-C exception handlers, which
184 * use |@try| and |@catch|. As a workaround, undefine these macros. */
185#ifdef __OBJC__
186#undef try
187#undef catch
188#endif
Note: See TracBrowser for help on using the repository browser.