WebKit Bugzilla
Attachment 357445 Details for
Bug 192728
: wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192728-20181217095823.patch (text/plain), 3.04 MB, created by
Chris Dumez
on 2018-12-17 09:58:27 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-12-17 09:58:27 PST
Size:
3.04 MB
patch
obsolete
>Subversion Revision: 239268 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 818ab2e41ae37ecab67181ca15124e40337945ee..25c330abaf55b1c182d188fb8f125a86c669b3af 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,30 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * API/*: >+ * Scripts/*: >+ * assembler/*: >+ * b3/*: >+ * bytecode/*: >+ * bytecompiler/*: >+ * debugger/*: >+ * dfg/*: >+ * ftl/*: >+ * heap/*: >+ * inspector/*: >+ * jit/*: >+ * llint/*: >+ * parser/*: >+ * runtime/*: >+ * tools/*: >+ * wasm/*: >+ * yarr/*: >+ > 2018-12-15 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Unreviewed, suppress warnings in Linux >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index bef672d2984ea563930ae71bcc295089a42a799c..434c779d5bade00c237d70e6ddfb7b05537d6390 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,18 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update optional's move-constructor and move-assignment operator to disengage the value being moved from. >+ Rename to optional to Optional, make_optional() to makeOptional(), and move class from std to WTF namespace. >+ >+ Based on patch by David Kilzer. >+ >+ * wtf/*: >+ > 2018-12-17 Ms2ger <Ms2ger@igalia.com> > > [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index be9e4c1864e957c73c8faa9bf79c3cae18d572b9..70576f94ae0a89536f8641793822187cc4fddd8e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,32 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Modules/*: >+ * animation/*: >+ * bindings/*: >+ * crypto/*: >+ * css/*: >+ * dom/*: >+ * editing/*: >+ * fileapi/*: >+ * html/*: >+ * inspector/*: >+ * layout/*: >+ * loader/*: >+ * mathml/*: >+ * page/*: >+ * platform/*: >+ * plugins/*: >+ * rendering/*: >+ * testing/*: >+ * workers/*: >+ * xml/*: >+ > 2018-12-17 Simon Fraser <simon.fraser@apple.com> > > REGRESSION (r233268): Elements animated in from offscreen sometimes don't display >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index d975a1638e1e83e69455a52886e9664862e7083a..a798fac7ff2d382a6824998d6a3dfb4a0adb611c 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,13 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/*: >+ > 2018-12-15 Darin Adler <darin@apple.com> > > Use warning-ignoring macros more consistently and simply >diff --git a/Source/WebDriver/ChangeLog b/Source/WebDriver/ChangeLog >index e7d028618cc810c6e6a1a4da059b7ec3ed4160a0..ce882974343012a2debb57b69607dc9207f46dae 100644 >--- a/Source/WebDriver/ChangeLog >+++ b/Source/WebDriver/ChangeLog >@@ -1,3 +1,13 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * : >+ > 2018-11-29 Tomas Popela <tpopela@redhat.com> > > [WebDriver] Fix clang warnings in Session.cpp >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 56990622d5270a0313615b6b8d331004fe17cb94..804479ecf6f13673a3c10662d5ee39f6555c6b4e 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/*: >+ * Platform/*: >+ * Scripts/*: >+ * Shared/*: >+ * UIProcess/*: >+ * WebProcess/*: >+ > 2018-12-17 David Kilzer <ddkilzer@apple.com> > > clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 0916b4e4d56cfd0649d5ec2a59dc6b4bb31913ad..03be05e45c58402810b7c6bce65143b866ecf1a0 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DOM/*: >+ * Plugins/*: >+ * WebCoreSupport/*: >+ * WebView/*: >+ > 2018-12-15 Darin Adler <darin@apple.com> > > Use warning-ignoring macros more consistently and simply >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 40ac05381fb7d06946dbb44a0e1e461918b2c03f..0c3235cc52486f1baabad60268bb7018c416e55f 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Plugins/*: >+ * WebCoreSupport/*: >+ > 2018-12-12 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win][Clang][WebKitLegacy] warning: expected a qualified name after 'typename' of COMEnumVariant and COMPropertyBag >diff --git a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp >index 3006fca5d495a8b78f00db363bf0ac3f4c29e2fb..7350898973547c972e334c873813d566bc357979 100644 >--- a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp >+++ b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp >@@ -53,7 +53,7 @@ static JSObjectRef callAsConstructor(JSContextRef callerContext, JSObjectRef con > > const ClassInfo JSCCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCCallbackFunction) }; > >-JSCCallbackFunction* JSCCallbackFunction::create(VM& vm, JSGlobalObject* globalObject, const String& name, Type type, JSCClass* jscClass, GRefPtr<GClosure>&& closure, GType returnType, std::optional<Vector<GType>>&& parameters) >+JSCCallbackFunction* JSCCallbackFunction::create(VM& vm, JSGlobalObject* globalObject, const String& name, Type type, JSCClass* jscClass, GRefPtr<GClosure>&& closure, GType returnType, Optional<Vector<GType>>&& parameters) > { > Structure* structure = globalObject->glibCallbackFunctionStructure(); > JSCCallbackFunction* function = new (NotNull, allocateCell<JSCCallbackFunction>(vm.heap)) JSCCallbackFunction(vm, structure, type, jscClass, WTFMove(closure), returnType, WTFMove(parameters)); >@@ -61,7 +61,7 @@ JSCCallbackFunction* JSCCallbackFunction::create(VM& vm, JSGlobalObject* globalO > return function; > } > >-JSCCallbackFunction::JSCCallbackFunction(VM& vm, Structure* structure, Type type, JSCClass* jscClass, GRefPtr<GClosure>&& closure, GType returnType, std::optional<Vector<GType>>&& parameters) >+JSCCallbackFunction::JSCCallbackFunction(VM& vm, Structure* structure, Type type, JSCClass* jscClass, GRefPtr<GClosure>&& closure, GType returnType, Optional<Vector<GType>>&& parameters) > : InternalFunction(vm, structure, APICallbackFunction::call<JSCCallbackFunction>, type == Type::Constructor ? APICallbackFunction::construct<JSCCallbackFunction> : nullptr) > , m_functionCallback(callAsFunction) > , m_constructCallback(callAsConstructor) >diff --git a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h >index 17e3210227f115c440f5f275e9ab74eadbc540aa..04663fade495fc428379ad2300432c33bf1f870e 100644 >--- a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h >+++ b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h >@@ -52,7 +52,7 @@ public: > Constructor > }; > >- static JSCCallbackFunction* create(VM&, JSGlobalObject*, const String& name, Type, JSCClass*, GRefPtr<GClosure>&&, GType, std::optional<Vector<GType>>&&); >+ static JSCCallbackFunction* create(VM&, JSGlobalObject*, const String& name, Type, JSCClass*, GRefPtr<GClosure>&&, GType, Optional<Vector<GType>>&&); > static void destroy(JSCell*); > > static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >@@ -69,7 +69,7 @@ public: > private: > static IsoSubspace* subspaceForImpl(VM&); > >- JSCCallbackFunction(VM&, Structure*, Type, JSCClass*, GRefPtr<GClosure>&&, GType, std::optional<Vector<GType>>&&); >+ JSCCallbackFunction(VM&, Structure*, Type, JSCClass*, GRefPtr<GClosure>&&, GType, Optional<Vector<GType>>&&); > > JSObjectCallAsFunctionCallback functionCallback() { return m_functionCallback; } > JSObjectCallAsConstructorCallback constructCallback() { return m_constructCallback; } >@@ -80,7 +80,7 @@ private: > GRefPtr<JSCClass> m_class; > GRefPtr<GClosure> m_closure; > GType m_returnType; >- std::optional<Vector<GType>> m_parameters; >+ Optional<Vector<GType>> m_parameters; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/API/glib/JSCClass.cpp b/Source/JavaScriptCore/API/glib/JSCClass.cpp >index 652928e4a9b91424b4944ff6289bfdd360f4bb74..49c3feee27fc63dddbaa9d3fd73867b0bef7e817 100644 >--- a/Source/JavaScriptCore/API/glib/JSCClass.cpp >+++ b/Source/JavaScriptCore/API/glib/JSCClass.cpp >@@ -552,7 +552,7 @@ JSCClass* jsc_class_get_parent(JSCClass* jscClass) > return jscClass->priv->parentClass; > } > >-static GRefPtr<JSCValue> jscClassCreateConstructor(JSCClass* jscClass, const char* name, GCallback callback, gpointer userData, GDestroyNotify destroyNotify, GType returnType, std::optional<Vector<GType>>&& parameters) >+static GRefPtr<JSCValue> jscClassCreateConstructor(JSCClass* jscClass, const char* name, GCallback callback, gpointer userData, GDestroyNotify destroyNotify, GType returnType, Optional<Vector<GType>>&& parameters) > { > JSCClassPrivate* priv = jscClass->priv; > GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify)))); >@@ -689,10 +689,10 @@ JSCValue* jsc_class_add_constructor_variadic(JSCClass* jscClass, const char* nam > if (!name) > name = priv->name.data(); > >- return jscClassCreateConstructor(jscClass, name ? name : priv->name.data(), callback, userData, destroyNotify, returnType, std::nullopt).leakRef(); >+ return jscClassCreateConstructor(jscClass, name ? name : priv->name.data(), callback, userData, destroyNotify, returnType, WTF::nullopt).leakRef(); > } > >-static void jscClassAddMethod(JSCClass* jscClass, const char* name, GCallback callback, gpointer userData, GDestroyNotify destroyNotify, GType returnType, std::optional<Vector<GType>>&& parameters) >+static void jscClassAddMethod(JSCClass* jscClass, const char* name, GCallback callback, gpointer userData, GDestroyNotify destroyNotify, GType returnType, Optional<Vector<GType>>&& parameters) > { > JSCClassPrivate* priv = jscClass->priv; > GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify)))); >@@ -798,7 +798,7 @@ void jsc_class_add_method_variadic(JSCClass* jscClass, const char* name, GCallba > g_return_if_fail(callback); > g_return_if_fail(jscClass->priv->context); > >- jscClassAddMethod(jscClass, name, callback, userData, destroyNotify, returnType, std::nullopt); >+ jscClassAddMethod(jscClass, name, callback, userData, destroyNotify, returnType, WTF::nullopt); > } > > /** >diff --git a/Source/JavaScriptCore/API/glib/JSCValue.cpp b/Source/JavaScriptCore/API/glib/JSCValue.cpp >index 6e274f89f437b63c9592572342f970539caae19d..85ed0aaf17dce3fa4f66c61a9972c5f591b3e3b0 100644 >--- a/Source/JavaScriptCore/API/glib/JSCValue.cpp >+++ b/Source/JavaScriptCore/API/glib/JSCValue.cpp >@@ -1105,7 +1105,7 @@ void jsc_value_object_define_property_accessor(JSCValue* value, const char* prop > JSC_TYPE_VALUE, value, G_TYPE_STRING, propertyName, JSC_TYPE_VALUE, descriptor.get(), G_TYPE_NONE)); > } > >-static GRefPtr<JSCValue> jscValueFunctionCreate(JSCContext* context, const char* name, GCallback callback, gpointer userData, GDestroyNotify destroyNotify, GType returnType, std::optional<Vector<GType>>&& parameters) >+static GRefPtr<JSCValue> jscValueFunctionCreate(JSCContext* context, const char* name, GCallback callback, gpointer userData, GDestroyNotify destroyNotify, GType returnType, Optional<Vector<GType>>&& parameters) > { > GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify)))); > JSC::ExecState* exec = toJS(jscContextGetJSContext(context)); >@@ -1207,7 +1207,7 @@ JSCValue* jsc_value_new_function_variadic(JSCContext* context, const char* name, > g_return_val_if_fail(JSC_IS_CONTEXT(context), nullptr); > g_return_val_if_fail(callback, nullptr); > >- return jscValueFunctionCreate(context, name, callback, userData, destroyNotify, returnType, std::nullopt).leakRef(); >+ return jscValueFunctionCreate(context, name, callback, userData, destroyNotify, returnType, WTF::nullopt).leakRef(); > } > > /** >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result >index 26fe0e6e0aae3326ed1922276a6fb26a241d7ee4..fc1e99623ebdca2319b79669a49a7b0fcb65dc4c 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result >@@ -159,7 +159,7 @@ const char* s_builtinPromiseRejectPromiseCode = > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); } >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); } > JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result >index 4d7cd22dbfd0cb5a96fc74a0af6020ddc7905c2f..b5a94937ff27c920f8b0002af0691338c9b0cbcc 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result >@@ -158,7 +158,7 @@ const char* s_builtinPromiseFulfillPromiseCode = > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); } >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); } > JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result >index 7b776020537d06f0d77cd06be8d2b6a7bacfda68..247b97abdbe9a788c5317bb987cf00eda8cf1728 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result >@@ -281,7 +281,7 @@ const char* s_builtinPrototypeTestCode = > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); } >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); } > JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result >index b2b72cdbb89af041d4972d1f9b8d170a95f6b41b..b74db98c2e06575dfbba5d673893b9e3de507329 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result >@@ -282,7 +282,7 @@ const char* s_builtinPrototypeTestCode = > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); } >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); } > JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result >index 660daa25641c570b931602b412df4ce1a62ba322..eab9f74917c4209d4ff74edf02e452937596bd89 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result >@@ -213,7 +213,7 @@ const char* s_builtinConstructorOfCode = > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); } >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); } > JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result >index 6ff597f54e62f7d160b829f3adc8fd9ccd3a6d92..c05a2fc163df1c95eea102b16744d2f836dfb193 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result >@@ -212,7 +212,7 @@ const char* s_builtinConstructorFromCode = > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); } >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); } > JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result >index bb121175be8d8f296ceadd146e89d30cacf933dd..0571bd1e277ba6a6b09bc704db09f8306f2d91e2 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result >@@ -142,7 +142,7 @@ const char* s_internalClashingNamesIsReadableStreamLockedCode = > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); } >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); } > JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result >index b8bcfb847e015052ea669f312f5f35ffedcd86c8..3e2acdefe995473a2a817736d792612ac436fda0 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result >@@ -220,7 +220,7 @@ const char* s_anotherGuardedInternalBuiltinLetsFetchCode = > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \ >- return clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result >index d4d41bf0c3dc7155b14ccc14872f4a650b4db919..262447804e79bc04bb4dca021df090e1b8b625c5 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result >@@ -190,7 +190,7 @@ const char* s_arbitraryConditionalGuardIsReadableStreamLockedCode = > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \ >- return clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result >index 59254ce2ce09116f20d6c5a1b64d511f255d58d7..38f78de523872288e42d4f563e526a40d1279c4e 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result >@@ -190,7 +190,7 @@ const char* s_guardedBuiltinIsReadableStreamLockedCode = > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \ >- return clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result >index 65dd3e843105cc9bedd733416a11f57b71c98011..8f5d32020d5ec8f91e38798edc3dcd7395cd52c7 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result >@@ -222,7 +222,7 @@ const char* s_guardedInternalBuiltinIsReadableStreamLockedCode = > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \ >- return clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result >index 06c935ac814982a8917b146ac00161d83efdf4b7..e6ff62f709848a56666635db77f86ad78a5d8bf8 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result >@@ -184,7 +184,7 @@ const char* s_unguardedBuiltinIsReadableStreamLockedCode = > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \ >- return clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result >index b24bca3caa5cd008dc88c29675d4341a3801fbb6..e5639fdc0b216c5046047fa9585a32f3c7ca86a2 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result >@@ -275,7 +275,7 @@ const char* s_xmlCasingTestUrlCasingTestCode = > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ > {\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \ >- return clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >diff --git a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_templates.py b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_templates.py >index 907a6d717c910cb07299509c61df846a9c701efc..4c293cc297fbe019865c9b1c0415a22768e570b4 100644 >--- a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_templates.py >+++ b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_templates.py >@@ -85,7 +85,7 @@ ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ > {\\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > ${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >@@ -96,7 +96,7 @@ ${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\ > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ > {\\ >- return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \ >+ return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \ > } > ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >@@ -108,7 +108,7 @@ ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ > {\\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \\ >- return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \\ >+ return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \\ > } > ${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >@@ -120,7 +120,7 @@ ${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ > {\\ > JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \\ >- return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \\ >+ return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), WTF::nullopt, s_##codeName##Intrinsic); \\ > } > ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR) > #undef DEFINE_BUILTIN_GENERATOR >diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h b/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h >index d91921a11102ce7706dcf38f2dcfa2552d7dacbf..9b20665be2e1d9878467115208a933c35487f36a 100644 >--- a/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h >+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h >@@ -3835,7 +3835,7 @@ public: > return static_cast<RelationalCondition>(Assembler::invert(static_cast<Assembler::Condition>(cond))); > } > >- static std::optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond) >+ static Optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond) > { > switch (cond) { > case Equal: >@@ -3848,7 +3848,7 @@ public: > return PositiveOrZero; > break; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h >index ec52181a2c2df580b35ce309df397ff3d554ac4e..12434225acd9e4cb7ac93a4bafdd5613a884fcac 100644 >--- a/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h >+++ b/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h >@@ -3123,7 +3123,7 @@ public: > } > } > >- static std::optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond) >+ static Optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond) > { > switch (cond) { > case Equal: >@@ -3136,7 +3136,7 @@ public: > return PositiveOrZero; > break; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/JavaScriptCore/b3/B3CheckSpecial.cpp b/Source/JavaScriptCore/b3/B3CheckSpecial.cpp >index 7c5372ac5e271141993f78be1683e0931853c895..ce6446625ea4cbbe80cf1c32cce9a78253c8305f 100644 >--- a/Source/JavaScriptCore/b3/B3CheckSpecial.cpp >+++ b/Source/JavaScriptCore/b3/B3CheckSpecial.cpp >@@ -111,7 +111,7 @@ Inst CheckSpecial::hiddenBranch(const Inst& inst) const > void CheckSpecial::forEachArg(Inst& inst, const ScopedLambda<Inst::EachArgCallback>& callback) > { > using namespace Air; >- std::optional<Width> optionalDefArgWidth; >+ Optional<Width> optionalDefArgWidth; > Inst hidden = hiddenBranch(inst); > hidden.forEachArg( > [&] (Arg& arg, Arg::Role role, Bank bank, Width width) { >@@ -123,7 +123,7 @@ void CheckSpecial::forEachArg(Inst& inst, const ScopedLambda<Inst::EachArgCallba > callback(inst.args[1 + index], role, bank, width); > }); > >- std::optional<unsigned> firstRecoverableIndex; >+ Optional<unsigned> firstRecoverableIndex; > if (m_checkKind.opcode == BranchAdd32 || m_checkKind.opcode == BranchAdd64) > firstRecoverableIndex = 1; > forEachArgImpl(numB3Args(inst), m_numCheckArgs + 1, inst, m_stackmapRole, firstRecoverableIndex, callback, optionalDefArgWidth); >@@ -150,11 +150,11 @@ bool CheckSpecial::admitsExtendedOffsetAddr(Inst& inst, unsigned argIndex) > return admitsStack(inst, argIndex); > } > >-std::optional<unsigned> CheckSpecial::shouldTryAliasingDef(Inst& inst) >+Optional<unsigned> CheckSpecial::shouldTryAliasingDef(Inst& inst) > { >- if (std::optional<unsigned> branchDef = hiddenBranch(inst).shouldTryAliasingDef()) >+ if (Optional<unsigned> branchDef = hiddenBranch(inst).shouldTryAliasingDef()) > return *branchDef + 1; >- return std::nullopt; >+ return WTF::nullopt; > } > > CCallHelpers::Jump CheckSpecial::generate(Inst& inst, CCallHelpers& jit, GenerationContext& context) >diff --git a/Source/JavaScriptCore/b3/B3CheckSpecial.h b/Source/JavaScriptCore/b3/B3CheckSpecial.h >index b9183fae9c851819b03760d795c9c44a86445d8c..693e2ce6c657fff6744c2f1de62c310e7fa0c981 100644 >--- a/Source/JavaScriptCore/b3/B3CheckSpecial.h >+++ b/Source/JavaScriptCore/b3/B3CheckSpecial.h >@@ -124,7 +124,7 @@ protected: > bool isValid(Air::Inst&) final; > bool admitsStack(Air::Inst&, unsigned argIndex) final; > bool admitsExtendedOffsetAddr(Air::Inst&, unsigned) final; >- std::optional<unsigned> shouldTryAliasingDef(Air::Inst&) final; >+ Optional<unsigned> shouldTryAliasingDef(Air::Inst&) final; > > // NOTE: the generate method will generate the hidden branch and then register a LatePath that > // generates the stackmap. Super crazy dude! >diff --git a/Source/JavaScriptCore/b3/B3Common.cpp b/Source/JavaScriptCore/b3/B3Common.cpp >index 661020e66b09807944ec6d6fb88feada2b5574f1..07a5b0a8dcada61065370b86c9f7348d36e0f4ab 100644 >--- a/Source/JavaScriptCore/b3/B3Common.cpp >+++ b/Source/JavaScriptCore/b3/B3Common.cpp >@@ -65,12 +65,12 @@ bool shouldSaveIRBeforePhase() > return Options::verboseValidationFailure(); > } > >-std::optional<GPRReg> pinnedExtendedOffsetAddrRegister() >+Optional<GPRReg> pinnedExtendedOffsetAddrRegister() > { > #if CPU(ARM64) > return static_cast<GPRReg>(+MacroAssembler::dataTempRegister); > #elif CPU(X86_64) >- return std::nullopt; >+ return WTF::nullopt; > #else > #error Unhandled architecture. > #endif >diff --git a/Source/JavaScriptCore/b3/B3Common.h b/Source/JavaScriptCore/b3/B3Common.h >index d0d7dd38ac92d5fa36d51974471aa669d21bc17e..1198564314e5bedf8d312a30ea13622e05d181c2 100644 >--- a/Source/JavaScriptCore/b3/B3Common.h >+++ b/Source/JavaScriptCore/b3/B3Common.h >@@ -182,7 +182,7 @@ inline unsigned defaultOptLevel() > return Options::defaultB3OptLevel(); > } > >-std::optional<GPRReg> pinnedExtendedOffsetAddrRegister(); >+Optional<GPRReg> pinnedExtendedOffsetAddrRegister(); > > } } // namespace JSC::B3 > >diff --git a/Source/JavaScriptCore/b3/B3LowerToAir.cpp b/Source/JavaScriptCore/b3/B3LowerToAir.cpp >index 006527af68d345f5e80c84c40e78dfc540f7ee21..06834e0a0900e2a53f750d47e46e4fcd4e306a3d 100644 >--- a/Source/JavaScriptCore/b3/B3LowerToAir.cpp >+++ b/Source/JavaScriptCore/b3/B3LowerToAir.cpp >@@ -448,12 +448,12 @@ private: > } > > template<typename Int, typename = Value::IsLegalOffset<Int>> >- std::optional<unsigned> scaleForShl(Value* shl, Int offset, std::optional<Width> width = std::nullopt) >+ Optional<unsigned> scaleForShl(Value* shl, Int offset, Optional<Width> width = WTF::nullopt) > { > if (shl->opcode() != Shl) >- return std::nullopt; >+ return WTF::nullopt; > if (!shl->child(1)->hasInt32()) >- return std::nullopt; >+ return WTF::nullopt; > unsigned logScale = shl->child(1)->asInt32(); > if (shl->type() == Int32) > logScale &= 31; >@@ -463,10 +463,10 @@ private: > // to signed since that's what all of our APIs want. > int64_t bigScale = static_cast<uint64_t>(1) << static_cast<uint64_t>(logScale); > if (!isRepresentableAs<int32_t>(bigScale)) >- return std::nullopt; >+ return WTF::nullopt; > unsigned scale = static_cast<int32_t>(bigScale); > if (!Arg::isValidIndexForm(scale, offset, width)) >- return std::nullopt; >+ return WTF::nullopt; > return scale; > } > >@@ -492,7 +492,7 @@ private: > Value* right = address->child(1); > > auto tryIndex = [&] (Value* index, Value* base) -> Arg { >- std::optional<unsigned> scale = scaleForShl(index, offset, width); >+ Optional<unsigned> scale = scaleForShl(index, offset, width); > if (!scale) > return Arg(); > if (m_locked.contains(index->child(0)) || m_locked.contains(base)) >@@ -2088,7 +2088,7 @@ private: > } > > auto tryShl = [&] (Value* shl, Value* other) -> bool { >- std::optional<unsigned> scale = scaleForShl(shl, offset); >+ Optional<unsigned> scale = scaleForShl(shl, offset); > if (!scale) > return false; > if (!canBeInternal(shl)) >diff --git a/Source/JavaScriptCore/b3/B3Opcode.cpp b/Source/JavaScriptCore/b3/B3Opcode.cpp >index dc1024979341b3f6a155db78c20234926725f176..90937df08a60f8d3f89862fdb369e7dc0e01d7a8 100644 >--- a/Source/JavaScriptCore/b3/B3Opcode.cpp >+++ b/Source/JavaScriptCore/b3/B3Opcode.cpp >@@ -36,7 +36,7 @@ IGNORE_RETURN_TYPE_WARNINGS_BEGIN > > namespace JSC { namespace B3 { > >-std::optional<Opcode> invertedCompare(Opcode opcode, Type type) >+Optional<Opcode> invertedCompare(Opcode opcode, Type type) > { > switch (opcode) { > case Equal: >@@ -46,19 +46,19 @@ std::optional<Opcode> invertedCompare(Opcode opcode, Type type) > case LessThan: > if (isInt(type)) > return GreaterEqual; >- return std::nullopt; >+ return WTF::nullopt; > case GreaterThan: > if (isInt(type)) > return LessEqual; >- return std::nullopt; >+ return WTF::nullopt; > case LessEqual: > if (isInt(type)) > return GreaterThan; >- return std::nullopt; >+ return WTF::nullopt; > case GreaterEqual: > if (isInt(type)) > return LessThan; >- return std::nullopt; >+ return WTF::nullopt; > case Above: > return BelowEqual; > case Below: >@@ -68,7 +68,7 @@ std::optional<Opcode> invertedCompare(Opcode opcode, Type type) > case BelowEqual: > return Above; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/JavaScriptCore/b3/B3Opcode.h b/Source/JavaScriptCore/b3/B3Opcode.h >index 25f3af1557de09f7ea45544029a6c73bdcf8efe3..f109f598d6c096644f2a93b96e96e90a4e5d3c65 100644 >--- a/Source/JavaScriptCore/b3/B3Opcode.h >+++ b/Source/JavaScriptCore/b3/B3Opcode.h >@@ -374,7 +374,7 @@ inline bool isCheckMath(Opcode opcode) > } > } > >-std::optional<Opcode> invertedCompare(Opcode, Type); >+Optional<Opcode> invertedCompare(Opcode, Type); > > inline Opcode constPtrOpcode() > { >diff --git a/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp b/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp >index 516917bb15998b8dfea66917a3cd901cd7df80c4..daae2432c5b5bf44d8ec3f16f709e03c0cc57a23 100644 >--- a/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp >+++ b/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp >@@ -60,7 +60,7 @@ void PatchpointSpecial::forEachArg(Inst& inst, const ScopedLambda<Inst::EachArgC > callback(inst.args[argIndex++], role, inst.origin->resultBank(), inst.origin->resultWidth()); > } > >- forEachArgImpl(0, argIndex, inst, SameAsRep, std::nullopt, callback, std::nullopt); >+ forEachArgImpl(0, argIndex, inst, SameAsRep, WTF::nullopt, callback, WTF::nullopt); > argIndex += inst.origin->numChildren(); > > for (unsigned i = patchpoint->numGPScratchRegisters; i--;) >diff --git a/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp b/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp >index cfd1a1e42d4dd4a6af49e39316860686b712e2ba..e7c6b495b6bb11207c97994e77dac2ee7f68c03b 100644 >--- a/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp >+++ b/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp >@@ -75,8 +75,8 @@ RegisterSet StackmapSpecial::extraEarlyClobberedRegs(Inst& inst) > > void StackmapSpecial::forEachArgImpl( > unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs, >- Inst& inst, RoleMode roleMode, std::optional<unsigned> firstRecoverableIndex, >- const ScopedLambda<Inst::EachArgCallback>& callback, std::optional<Width> optionalDefArgWidth) >+ Inst& inst, RoleMode roleMode, Optional<unsigned> firstRecoverableIndex, >+ const ScopedLambda<Inst::EachArgCallback>& callback, Optional<Width> optionalDefArgWidth) > { > StackmapValue* value = inst.origin->as<StackmapValue>(); > ASSERT(value); >diff --git a/Source/JavaScriptCore/b3/B3StackmapSpecial.h b/Source/JavaScriptCore/b3/B3StackmapSpecial.h >index 6e8eac328df18b1c602f54b456f903bd9a537c0e..e09b936394c0df0ede344d1be2a78a6d8633ab97 100644 >--- a/Source/JavaScriptCore/b3/B3StackmapSpecial.h >+++ b/Source/JavaScriptCore/b3/B3StackmapSpecial.h >@@ -59,8 +59,8 @@ protected: > // subclasses that implement that. > void forEachArgImpl( > unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs, >- Air::Inst&, RoleMode, std::optional<unsigned> firstRecoverableIndex, >- const ScopedLambda<Air::Inst::EachArgCallback>&, std::optional<Width> optionalDefArgWidth); >+ Air::Inst&, RoleMode, Optional<unsigned> firstRecoverableIndex, >+ const ScopedLambda<Air::Inst::EachArgCallback>&, Optional<Width> optionalDefArgWidth); > > bool isValidImpl( > unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs, >diff --git a/Source/JavaScriptCore/b3/B3Value.cpp b/Source/JavaScriptCore/b3/B3Value.cpp >index e76afe579603e54ddad85b135b3246577bca17f2..9bea1b1137b36a7c6541072127d7ea51428ff5c6 100644 >--- a/Source/JavaScriptCore/b3/B3Value.cpp >+++ b/Source/JavaScriptCore/b3/B3Value.cpp >@@ -459,7 +459,7 @@ Value* Value::invertedCompare(Procedure& proc) const > { > if (!numChildren()) > return nullptr; >- if (std::optional<Opcode> invertedOpcode = B3::invertedCompare(opcode(), child(0)->type())) { >+ if (Optional<Opcode> invertedOpcode = B3::invertedCompare(opcode(), child(0)->type())) { > ASSERT(!kind().hasExtraBits()); > return proc.add<Value>(*invertedOpcode, type(), origin(), children()); > } >diff --git a/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp b/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp >index c282d5005d666cfdf9e17e4a956c1683ed450216..8f497650acbe7eb2b7f2c7e4ddfc777c8ec68453 100644 >--- a/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp >+++ b/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp >@@ -1673,7 +1673,7 @@ protected: > m_worklistMoves.startAddingLowPriorityMoves(); > for (BasicBlock* block : m_code) { > for (Inst& inst : *block) { >- if (std::optional<unsigned> defArgIndex = inst.shouldTryAliasingDef()) { >+ if (Optional<unsigned> defArgIndex = inst.shouldTryAliasingDef()) { > Arg op1 = inst.args[*defArgIndex - 2]; > Arg op2 = inst.args[*defArgIndex - 1]; > Arg dest = inst.args[*defArgIndex]; >diff --git a/Source/JavaScriptCore/b3/air/AirArg.h b/Source/JavaScriptCore/b3/air/AirArg.h >index 964548beded5474e052067ef1350f98c54a25b70..1f925c0c7124e9a60cafb782413b07608c951514 100644 >--- a/Source/JavaScriptCore/b3/air/AirArg.h >+++ b/Source/JavaScriptCore/b3/air/AirArg.h >@@ -586,7 +586,7 @@ public: > } > > // If you don't pass a Width, this optimistically assumes that you're using the right width. >- static bool isValidScale(unsigned scale, std::optional<Width> width = std::nullopt) >+ static bool isValidScale(unsigned scale, Optional<Width> width = WTF::nullopt) > { > switch (scale) { > case 1: >@@ -1181,7 +1181,7 @@ public: > } > > template<typename Int, typename = Value::IsLegalOffset<Int>> >- static bool isValidAddrForm(Int offset, std::optional<Width> width = std::nullopt) >+ static bool isValidAddrForm(Int offset, Optional<Width> width = WTF::nullopt) > { > if (isX86()) > return true; >@@ -1207,7 +1207,7 @@ public: > } > > template<typename Int, typename = Value::IsLegalOffset<Int>> >- static bool isValidIndexForm(unsigned scale, Int offset, std::optional<Width> width = std::nullopt) >+ static bool isValidIndexForm(unsigned scale, Int offset, Optional<Width> width = WTF::nullopt) > { > if (!isValidScale(scale, width)) > return false; >@@ -1221,7 +1221,7 @@ public: > // If you don't pass a width then this optimistically assumes that you're using the right width. But > // the width is relevant to validity, so passing a null width is only useful for assertions. Don't > // pass null widths when cascading through Args in the instruction selector! >- bool isValidForm(std::optional<Width> width = std::nullopt) const >+ bool isValidForm(Optional<Width> width = WTF::nullopt) const > { > switch (kind()) { > case Invalid: >diff --git a/Source/JavaScriptCore/b3/air/AirCode.cpp b/Source/JavaScriptCore/b3/air/AirCode.cpp >index 2bf11fb17ea33e976d79a4044d63b52ab3a2ce4d..2f55346f13af9f10ac19fad2873724e114fad693 100644 >--- a/Source/JavaScriptCore/b3/air/AirCode.cpp >+++ b/Source/JavaScriptCore/b3/air/AirCode.cpp >@@ -192,14 +192,14 @@ bool Code::isEntrypoint(BasicBlock* block) const > return false; > } > >-std::optional<unsigned> Code::entrypointIndex(BasicBlock* block) const >+Optional<unsigned> Code::entrypointIndex(BasicBlock* block) const > { > RELEASE_ASSERT(m_entrypoints.size()); > for (unsigned i = 0; i < m_entrypoints.size(); ++i) { > if (m_entrypoints[i].block() == block) > return i; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > void Code::setCalleeSaveRegisterAtOffsetList(RegisterAtOffsetList&& registerAtOffsetList, StackSlot* slot) >diff --git a/Source/JavaScriptCore/b3/air/AirCode.h b/Source/JavaScriptCore/b3/air/AirCode.h >index 2969cead5f30c3900fced7bea5f7ef1394c2e0eb..258c24ac2eb11855c78c8f5ccca5e590661363d2 100644 >--- a/Source/JavaScriptCore/b3/air/AirCode.h >+++ b/Source/JavaScriptCore/b3/air/AirCode.h >@@ -170,7 +170,7 @@ public: > const FrequentedBlock& entrypoint(unsigned index) const { return m_entrypoints[index]; } > bool isEntrypoint(BasicBlock*) const; > // Note: It is only valid to call this function after LowerEntrySwitch. >- std::optional<unsigned> entrypointIndex(BasicBlock*) const; >+ Optional<unsigned> entrypointIndex(BasicBlock*) const; > > // Note: We allow this to be called even before we set m_entrypoints just for convenience to users of this API. > // However, if you call this before setNumEntrypoints, setNumEntrypoints will overwrite this value. >diff --git a/Source/JavaScriptCore/b3/air/AirCustom.h b/Source/JavaScriptCore/b3/air/AirCustom.h >index 62abfc65257cb791ea9a336967473bf1263071c6..e98afea86762140521e5cfc85e5e7ecd551b3441 100644 >--- a/Source/JavaScriptCore/b3/air/AirCustom.h >+++ b/Source/JavaScriptCore/b3/air/AirCustom.h >@@ -88,7 +88,7 @@ struct PatchCustom { > return inst.args[0].special()->admitsExtendedOffsetAddr(inst, argIndex); > } > >- static std::optional<unsigned> shouldTryAliasingDef(Inst& inst) >+ static Optional<unsigned> shouldTryAliasingDef(Inst& inst) > { > return inst.args[0].special()->shouldTryAliasingDef(inst); > } >diff --git a/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp b/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp >index 60a8cc035ff129059105ed65ecf253326c8e5399..89a4563525512ba9d3e15f29acae1548af6867f5 100644 >--- a/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp >+++ b/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp >@@ -121,11 +121,11 @@ private: > else if (isSpillSlot(inst.args[1])) > func(SlotConst(inst.args[1].stackSlot(), inst.args[0].value())); > } else if (isSpillSlot(inst.args[0]) && inst.args[1].isReg()) { >- if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0])) >+ if (Optional<int64_t> constant = m_state.constantFor(inst.args[0])) > func(RegConst(inst.args[1].reg(), *constant)); > func(RegSlot(inst.args[1].reg(), inst.args[0].stackSlot(), RegSlot::AllBits)); > } else if (inst.args[0].isReg() && isSpillSlot(inst.args[1])) { >- if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0])) >+ if (Optional<int64_t> constant = m_state.constantFor(inst.args[0])) > func(SlotConst(inst.args[1].stackSlot(), *constant)); > func(RegSlot(inst.args[0].reg(), inst.args[1].stackSlot(), RegSlot::AllBits)); > } >@@ -138,11 +138,11 @@ private: > else if (isSpillSlot(inst.args[1])) > func(SlotConst(inst.args[1].stackSlot(), static_cast<uint32_t>(inst.args[0].value()))); > } else if (isSpillSlot(inst.args[0]) && inst.args[1].isReg()) { >- if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0])) >+ if (Optional<int64_t> constant = m_state.constantFor(inst.args[0])) > func(RegConst(inst.args[1].reg(), static_cast<uint32_t>(*constant))); > func(RegSlot(inst.args[1].reg(), inst.args[0].stackSlot(), RegSlot::ZExt32)); > } else if (inst.args[0].isReg() && isSpillSlot(inst.args[1])) { >- if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0])) >+ if (Optional<int64_t> constant = m_state.constantFor(inst.args[0])) > func(SlotConst(inst.args[1].stackSlot(), static_cast<int32_t>(*constant))); > func(RegSlot(inst.args[0].reg(), inst.args[1].stackSlot(), RegSlot::Match32)); > } >@@ -504,19 +504,19 @@ private: > return nullptr; > } > >- std::optional<int64_t> constantFor(const Arg& arg) >+ Optional<int64_t> constantFor(const Arg& arg) > { > if (arg.isReg()) { > if (const RegConst* alias = getRegConst(arg.reg())) > return alias->constant; >- return std::nullopt; >+ return WTF::nullopt; > } > if (arg.isStack()) { > if (const SlotConst* alias = getSlotConst(arg.stackSlot())) > return alias->constant; >- return std::nullopt; >+ return WTF::nullopt; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > void clobber(const Arg& arg) >diff --git a/Source/JavaScriptCore/b3/air/AirGenerate.cpp b/Source/JavaScriptCore/b3/air/AirGenerate.cpp >index d532ed5c561d91589f1c3f4023192f70ea0477e2..de0c8f867158f0761c16757a110eeb702e198b4f 100644 >--- a/Source/JavaScriptCore/b3/air/AirGenerate.cpp >+++ b/Source/JavaScriptCore/b3/air/AirGenerate.cpp >@@ -207,7 +207,7 @@ void generate(Code& code, CCallHelpers& jit) > if (disassembler) > disassembler->startBlock(block, jit); > >- if (std::optional<unsigned> entrypointIndex = code.entrypointIndex(block)) { >+ if (Optional<unsigned> entrypointIndex = code.entrypointIndex(block)) { > ASSERT(code.isEntrypoint(block)); > > if (disassembler) >diff --git a/Source/JavaScriptCore/b3/air/AirInst.h b/Source/JavaScriptCore/b3/air/AirInst.h >index f2c0f02b3ccd011c0ad297f78c38d7bfe0f41576..b572339e83043c8f036bfd04db8521cd375022b6 100644 >--- a/Source/JavaScriptCore/b3/air/AirInst.h >+++ b/Source/JavaScriptCore/b3/air/AirInst.h >@@ -199,7 +199,7 @@ struct Inst { > // For example, > // Add Tmp1, Tmp2, Tmp3 > // returns 2 if 0 and 1 benefit from aliasing to Tmp3. >- std::optional<unsigned> shouldTryAliasingDef(); >+ Optional<unsigned> shouldTryAliasingDef(); > > // This computes a hash for comparing this to JSAir's Inst. > unsigned jsHash() const; >diff --git a/Source/JavaScriptCore/b3/air/AirInstInlines.h b/Source/JavaScriptCore/b3/air/AirInstInlines.h >index 835b1054c1adf27c6f01b644ffe749c4b753fef6..af0d2039dd8658e30ae1f91f95c1ff16169ced55 100644 >--- a/Source/JavaScriptCore/b3/air/AirInstInlines.h >+++ b/Source/JavaScriptCore/b3/air/AirInstInlines.h >@@ -116,10 +116,10 @@ inline bool Inst::admitsExtendedOffsetAddr(Arg& arg) > return admitsExtendedOffsetAddr(&arg - &args[0]); > } > >-inline std::optional<unsigned> Inst::shouldTryAliasingDef() >+inline Optional<unsigned> Inst::shouldTryAliasingDef() > { > if (!isX86()) >- return std::nullopt; >+ return WTF::nullopt; > > switch (kind.opcode) { > case Add32: >@@ -147,7 +147,7 @@ inline std::optional<unsigned> Inst::shouldTryAliasingDef() > case MulFloat: > #if CPU(X86) || CPU(X86_64) > if (MacroAssembler::supportsAVX()) >- return std::nullopt; >+ return WTF::nullopt; > #endif > if (args.size() == 3) > return 2; >@@ -178,7 +178,7 @@ inline std::optional<unsigned> Inst::shouldTryAliasingDef() > default: > break; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > inline bool isShiftValid(const Inst& inst) >diff --git a/Source/JavaScriptCore/b3/air/AirSpecial.cpp b/Source/JavaScriptCore/b3/air/AirSpecial.cpp >index e825767b04d8ab3b9cec75af4e91980a8929057b..c0c01369a9aaa24ec66a6e12d9d9080c4ed76382 100644 >--- a/Source/JavaScriptCore/b3/air/AirSpecial.cpp >+++ b/Source/JavaScriptCore/b3/air/AirSpecial.cpp >@@ -50,9 +50,9 @@ CString Special::name() const > return out.toCString(); > } > >-std::optional<unsigned> Special::shouldTryAliasingDef(Inst&) >+Optional<unsigned> Special::shouldTryAliasingDef(Inst&) > { >- return std::nullopt; >+ return WTF::nullopt; > } > > bool Special::isTerminal(Inst&) >diff --git a/Source/JavaScriptCore/b3/air/AirSpecial.h b/Source/JavaScriptCore/b3/air/AirSpecial.h >index 504050d2b18bce87c0e4108287f3b2ebcd6eb16c..a659d03d5a22b7f9ecfbba195e5c6f5034fe16c1 100644 >--- a/Source/JavaScriptCore/b3/air/AirSpecial.h >+++ b/Source/JavaScriptCore/b3/air/AirSpecial.h >@@ -56,7 +56,7 @@ public: > virtual bool isValid(Inst&) = 0; > virtual bool admitsStack(Inst&, unsigned argIndex) = 0; > virtual bool admitsExtendedOffsetAddr(Inst&, unsigned argIndex) = 0; >- virtual std::optional<unsigned> shouldTryAliasingDef(Inst&); >+ virtual Optional<unsigned> shouldTryAliasingDef(Inst&); > > // This gets called on for each Inst that uses this Special. Note that there is no way to > // guarantee that a Special gets used from just one Inst, because Air might taildup late. So, >diff --git a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >index 0366f21845998397725b0f93b0633ded52dddbee..f2e81e97194dfb3f3eed62448b5d9cc926d4ca56 100644 >--- a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >+++ b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >@@ -163,7 +163,7 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createExecutable(VM& vm, const S > unsigned lineCount = 0; > unsigned endColumn = 0; > unsigned offsetOfLastNewline = 0; >- std::optional<unsigned> offsetOfSecondToLastNewline; >+ Optional<unsigned> offsetOfSecondToLastNewline; > for (unsigned i = 0; i < view.length(); ++i) { > if (characters[i] == '\n') { > if (lineCount) >diff --git a/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp b/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp >index 6b5e68e9f5e95eb6320cee8529a27d9efee945e7..d681d2d85239e74aaf9866e6b8f02b8326458b63 100644 >--- a/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp >+++ b/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp >@@ -130,7 +130,7 @@ private: > > if (m_storages.size() <= index) > m_storages.resize(index + 1); >- if (std::optional<Storage> storage = m_storages[index]) >+ if (Optional<Storage> storage = m_storages[index]) > return *storage; > > Identifier identifier = Identifier::fromUid(PrivateName()); >@@ -153,7 +153,7 @@ private: > UnlinkedCodeBlock* m_codeBlock; > InstructionStreamWriter& m_instructions; > BytecodeGraph m_graph; >- Vector<std::optional<Storage>> m_storages; >+ Vector<Optional<Storage>> m_storages; > Yields m_yields; > Strong<SymbolTable> m_generatorFrameSymbolTable; > int m_generatorFrameSymbolTableIndex; >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >index 0e80517f7b9f9963c30b9b127e460bb97ba3ebb5..7afda363172aab86f39cafa383ad87e6675c6272 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >@@ -3066,29 +3066,29 @@ void CodeBlock::setPCToCodeOriginMap(std::unique_ptr<PCToCodeOriginMap>&& map) > m_pcToCodeOriginMap = WTFMove(map); > } > >-std::optional<CodeOrigin> CodeBlock::findPC(void* pc) >+Optional<CodeOrigin> CodeBlock::findPC(void* pc) > { > if (m_pcToCodeOriginMap) { >- if (std::optional<CodeOrigin> codeOrigin = m_pcToCodeOriginMap->findPC(pc)) >+ if (Optional<CodeOrigin> codeOrigin = m_pcToCodeOriginMap->findPC(pc)) > return codeOrigin; > } > > for (auto iter = m_stubInfos.begin(); !!iter; ++iter) { > StructureStubInfo* stub = *iter; > if (stub->containsPC(pc)) >- return std::optional<CodeOrigin>(stub->codeOrigin); >+ return Optional<CodeOrigin>(stub->codeOrigin); > } > >- if (std::optional<CodeOrigin> codeOrigin = m_jitCode->findPC(this, pc)) >+ if (Optional<CodeOrigin> codeOrigin = m_jitCode->findPC(this, pc)) > return codeOrigin; > >- return std::nullopt; >+ return WTF::nullopt; > } > #endif // ENABLE(JIT) > >-std::optional<unsigned> CodeBlock::bytecodeOffsetFromCallSiteIndex(CallSiteIndex callSiteIndex) >+Optional<unsigned> CodeBlock::bytecodeOffsetFromCallSiteIndex(CallSiteIndex callSiteIndex) > { >- std::optional<unsigned> bytecodeOffset; >+ Optional<unsigned> bytecodeOffset; > JITCode::JITType jitType = this->jitType(); > if (jitType == JITCode::InterpreterThunk || jitType == JITCode::BaselineJIT) { > #if USE(JSVALUE64) >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h >index e7c66e25340f86d6a0aa9b408a8ca6d447daac2b..8d23bbcdeed0581f53b6c6986251eee63d7e6b88 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h >@@ -239,7 +239,7 @@ public: > void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, > int& startOffset, int& endOffset, unsigned& line, unsigned& column) const; > >- std::optional<unsigned> bytecodeOffsetFromCallSiteIndex(CallSiteIndex); >+ Optional<unsigned> bytecodeOffsetFromCallSiteIndex(CallSiteIndex); > > void getICStatusMap(const ConcurrentJSLocker&, ICStatusMap& result); > void getICStatusMap(ICStatusMap& result); >@@ -851,7 +851,7 @@ public: > > #if ENABLE(JIT) > void setPCToCodeOriginMap(std::unique_ptr<PCToCodeOriginMap>&&); >- std::optional<CodeOrigin> findPC(void* pc); >+ Optional<CodeOrigin> findPC(void* pc); > #endif > > bool hasTailCalls() const { return m_unlinkedCode->hasTailCalls(); } >diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp >index 6769ba03be6a9a223fcacc809c7c5cb9b66bfd46..718a8d83b7e2d36c6419e565ac1ea56e02eb18d9 100644 >--- a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp >+++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp >@@ -229,7 +229,7 @@ GetByIdStatus GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback( > std::unique_ptr<CallLinkStatus> callLinkStatus; > JSFunction* intrinsicFunction = nullptr; > FunctionPtr<OperationPtrTag> customAccessorGetter; >- std::optional<DOMAttributeAnnotation> domAttribute; >+ Optional<DOMAttributeAnnotation> domAttribute; > > switch (access.type()) { > case AccessCase::Load: >diff --git a/Source/JavaScriptCore/bytecode/GetByIdVariant.cpp b/Source/JavaScriptCore/bytecode/GetByIdVariant.cpp >index 8ae40e33cd955e137e3fdcc6ce54c020a007e11e..ee25e7fdb55883ce6010837a0f951841323cd55e 100644 >--- a/Source/JavaScriptCore/bytecode/GetByIdVariant.cpp >+++ b/Source/JavaScriptCore/bytecode/GetByIdVariant.cpp >@@ -38,7 +38,7 @@ GetByIdVariant::GetByIdVariant( > std::unique_ptr<CallLinkStatus> callLinkStatus, > JSFunction* intrinsicFunction, > FunctionPtr<OperationPtrTag> customAccessorGetter, >- std::optional<DOMAttributeAnnotation> domAttribute) >+ Optional<DOMAttributeAnnotation> domAttribute) > : m_structureSet(structureSet) > , m_conditionSet(conditionSet) > , m_offset(offset) >diff --git a/Source/JavaScriptCore/bytecode/GetByIdVariant.h b/Source/JavaScriptCore/bytecode/GetByIdVariant.h >index 02f107da4762ca304a74ad2e8cf591b026816dc5..bfa31128a5ce860e9e61d691088a7bdf8e500181 100644 >--- a/Source/JavaScriptCore/bytecode/GetByIdVariant.h >+++ b/Source/JavaScriptCore/bytecode/GetByIdVariant.h >@@ -47,7 +47,7 @@ public: > std::unique_ptr<CallLinkStatus> = nullptr, > JSFunction* = nullptr, > FunctionPtr<OperationPtrTag> customAccessorGetter = nullptr, >- std::optional<DOMAttributeAnnotation> = std::nullopt); >+ Optional<DOMAttributeAnnotation> = WTF::nullopt); > > ~GetByIdVariant(); > >@@ -67,7 +67,7 @@ public: > JSFunction* intrinsicFunction() const { return m_intrinsicFunction; } > Intrinsic intrinsic() const { return m_intrinsicFunction ? m_intrinsicFunction->intrinsic() : NoIntrinsic; } > FunctionPtr<OperationPtrTag> customAccessorGetter() const { return m_customAccessorGetter; } >- std::optional<DOMAttributeAnnotation> domAttribute() const { return m_domAttribute; } >+ Optional<DOMAttributeAnnotation> domAttribute() const { return m_domAttribute; } > > bool isPropertyUnset() const { return offset() == invalidOffset; } > >@@ -90,7 +90,7 @@ private: > std::unique_ptr<CallLinkStatus> m_callLinkStatus; > JSFunction* m_intrinsicFunction; > FunctionPtr<OperationPtrTag> m_customAccessorGetter; >- std::optional<DOMAttributeAnnotation> m_domAttribute; >+ Optional<DOMAttributeAnnotation> m_domAttribute; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp b/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp >index e7698f9bd3a522f6ee4659e6cb56f5405783f1ee..28194c7e93cc013794b8863164076e4e67a24079 100644 >--- a/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp >+++ b/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp >@@ -52,7 +52,7 @@ GetterSetterAccessCase::GetterSetterAccessCase(VM& vm, JSCell* owner, AccessType > std::unique_ptr<AccessCase> GetterSetterAccessCase::create( > VM& vm, JSCell* owner, AccessType type, PropertyOffset offset, Structure* structure, const ObjectPropertyConditionSet& conditionSet, > bool viaProxy, WatchpointSet* additionalSet, FunctionPtr<OperationPtrTag> customGetter, JSObject* customSlotBase, >- std::optional<DOMAttributeAnnotation> domAttribute, std::unique_ptr<PolyProtoAccessChain> prototypeAccessChain) >+ Optional<DOMAttributeAnnotation> domAttribute, std::unique_ptr<PolyProtoAccessChain> prototypeAccessChain) > { > switch (type) { > case Getter: >diff --git a/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h b/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h >index e9bd55ee5ce4848b5958686eef2e5f3bfe32957d..273ce3a3712fd21c7d9fb767321db34b15e947d4 100644 >--- a/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h >+++ b/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h >@@ -41,7 +41,7 @@ public: > // actually somewhat likely because of how we do buffering of new cases. > CallLinkInfo* callLinkInfo() const { return m_callLinkInfo.get(); } > JSObject* customSlotBase() const { return m_customSlotBase.get(); } >- std::optional<DOMAttributeAnnotation> domAttribute() const { return m_domAttribute; } >+ Optional<DOMAttributeAnnotation> domAttribute() const { return m_domAttribute; } > > bool hasAlternateBase() const override; > JSObject* alternateBase() const override; >@@ -51,7 +51,7 @@ public: > static std::unique_ptr<AccessCase> create( > VM&, JSCell* owner, AccessType, PropertyOffset, Structure*, > const ObjectPropertyConditionSet&, bool viaProxy, WatchpointSet* additionalSet, FunctionPtr<OperationPtrTag> customGetter, >- JSObject* customSlotBase, std::optional<DOMAttributeAnnotation>, std::unique_ptr<PolyProtoAccessChain>); >+ JSObject* customSlotBase, Optional<DOMAttributeAnnotation>, std::unique_ptr<PolyProtoAccessChain>); > > static std::unique_ptr<AccessCase> create(VM&, JSCell* owner, AccessType, Structure*, PropertyOffset, > const ObjectPropertyConditionSet&, std::unique_ptr<PolyProtoAccessChain>, >@@ -72,7 +72,7 @@ private: > WriteBarrier<JSObject> m_customSlotBase; > std::unique_ptr<CallLinkInfo> m_callLinkInfo; > FunctionPtr<OperationPtrTag> m_customAccessor; >- std::optional<DOMAttributeAnnotation> m_domAttribute; >+ Optional<DOMAttributeAnnotation> m_domAttribute; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp >index 71b13748dee01a5d8d9699c9f6f81ce5ba3f1a27..b114d39e90226a510b2458521d95c63f75033eeb 100644 >--- a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp >+++ b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp >@@ -133,7 +133,7 @@ void UnlinkedFunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visito > visitor.append(thisObject->m_unlinkedCodeBlockForConstruct); > } > >-FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& passedParentSource, std::optional<int> overrideLineNumber, Intrinsic intrinsic) >+FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& passedParentSource, Optional<int> overrideLineNumber, Intrinsic intrinsic) > { > const SourceCode& parentSource = !m_isBuiltinDefaultClassConstructor ? passedParentSource : BuiltinExecutables::defaultConstructorSourceCode(constructorKind()); > unsigned firstLine = parentSource.firstLine().oneBasedInt() + m_firstLineOffset; >@@ -174,7 +174,7 @@ FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& p > > UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode( > const Identifier& name, ExecState& exec, const SourceCode& source, >- JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition) >+ JSObject*& exception, int overrideLineNumber, Optional<int> functionConstructorParametersEndPosition) > { > ParserError error; > VM& vm = exec.vm(); >diff --git a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h >index 313d66609439d7bc00deb213164b29136cd62d16..526898c951d82175979881102f9dc7d615b01522 100644 >--- a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h >+++ b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h >@@ -107,9 +107,9 @@ public: > > static UnlinkedFunctionExecutable* fromGlobalCode( > const Identifier&, ExecState&, const SourceCode&, JSObject*& exception, >- int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition); >+ int overrideLineNumber, Optional<int> functionConstructorParametersEndPosition); > >- JS_EXPORT_PRIVATE FunctionExecutable* link(VM&, const SourceCode& parentSource, std::optional<int> overrideLineNumber = std::nullopt, Intrinsic = NoIntrinsic); >+ JS_EXPORT_PRIVATE FunctionExecutable* link(VM&, const SourceCode& parentSource, Optional<int> overrideLineNumber = WTF::nullopt, Intrinsic = NoIntrinsic); > > void clearCode(VM& vm) > { >diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >index 5f69aba5dc9ea65a6421ee4f226e2b192b166a2e..71eff15247eb8f976da169f43b17e984a6fcaf1b 100644 >--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >@@ -4099,7 +4099,7 @@ RegisterID* BytecodeGenerator::emitGetTemplateObject(RegisterID* dst, TaggedTemp > ASSERT(string->raw()); > rawStrings.append(string->raw()->impl()); > if (!string->cooked()) >- cookedStrings.append(std::nullopt); >+ cookedStrings.append(WTF::nullopt); > else > cookedStrings.append(string->cooked()->impl()); > } >diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h >index b39c14e26e3bfcc8d9721b6d447ab1c5555217ba..968eb09efa5263e94f53ed1703a0637f8a8decc2 100644 >--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h >+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h >@@ -564,7 +564,7 @@ namespace JSC { > RegisterID* emitNodeForProperty(RegisterID* dst, ExpressionNode* node) > { > if (node->isString()) { >- if (std::optional<uint32_t> index = parseIndex(static_cast<StringNode*>(node)->value())) >+ if (Optional<uint32_t> index = parseIndex(static_cast<StringNode*>(node)->value())) > return emitLoad(dst, jsNumber(index.value())); > } > return emitNode(dst, node); >@@ -1222,7 +1222,7 @@ namespace JSC { > Vector<LexicalScopeStackEntry> m_lexicalScopeStack; > > Vector<TDZMap> m_TDZStack; >- std::optional<size_t> m_varScopeLexicalScopeStackIndex; >+ Optional<size_t> m_varScopeLexicalScopeStackIndex; > void pushTDZVariables(const VariableEnvironment&, TDZCheckOptimization, TDZRequirement); > > ScopeNode* const m_scopeNode; >diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp >index 23a14b9673046c92f4488e64dad430f20f1571f6..4c09459aa0d26bed42bdb245c27e6600559a847f 100644 >--- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp >+++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp >@@ -694,7 +694,7 @@ void PropertyListNode::emitPutConstantProperty(BytecodeGenerator& generator, Reg > return; > } > if (const auto* identifier = node.name()) { >- std::optional<uint32_t> optionalIndex = parseIndex(*identifier); >+ Optional<uint32_t> optionalIndex = parseIndex(*identifier); > if (!optionalIndex) { > generator.emitDirectPutById(newObj, *identifier, value.get(), node.putType()); > return; >@@ -2089,7 +2089,7 @@ RegisterID* BinaryOpNode::emitBytecode(BytecodeGenerator& generator, RegisterID* > OpcodeID opcodeID = this->opcodeID(); > > if (opcodeID == op_less || opcodeID == op_lesseq || opcodeID == op_greater || opcodeID == op_greatereq) { >- auto isUInt32 = [&] (ExpressionNode* node) -> std::optional<UInt32Result> { >+ auto isUInt32 = [&] (ExpressionNode* node) -> Optional<UInt32Result> { > if (node->isBinaryOpNode() && static_cast<BinaryOpNode*>(node)->opcodeID() == op_urshift) > return UInt32Result::UInt32; > if (node->isNumber() && static_cast<NumberNode*>(node)->isIntegerNode()) { >@@ -2097,7 +2097,7 @@ RegisterID* BinaryOpNode::emitBytecode(BytecodeGenerator& generator, RegisterID* > if (value.isInt32() && value.asInt32() >= 0) > return UInt32Result::Constant; > } >- return std::nullopt; >+ return WTF::nullopt; > }; > auto leftResult = isUInt32(m_expr1); > auto rightResult = isUInt32(m_expr2); >@@ -4304,7 +4304,7 @@ void ObjectPatternNode::bindValue(BytecodeGenerator& generator, RegisterID* rhs) > RefPtr<RegisterID> temp = generator.newTemporary(); > RefPtr<RegisterID> propertyName; > if (!target.propertyExpression) { >- std::optional<uint32_t> optionalIndex = parseIndex(target.propertyName); >+ Optional<uint32_t> optionalIndex = parseIndex(target.propertyName); > if (!optionalIndex) > generator.emitGetById(temp.get(), rhs, target.propertyName); > else { >diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp >index c59071d187199db811601b0142fe37e8274dcda0..40c13728eaef9d9d96ed0fe0bec6ab3a0805e979 100644 >--- a/Source/JavaScriptCore/debugger/Debugger.cpp >+++ b/Source/JavaScriptCore/debugger/Debugger.cpp >@@ -364,7 +364,7 @@ void Debugger::resolveBreakpoint(Breakpoint& breakpoint, SourceProvider* sourceP > unsigned column = breakpoint.column ? breakpoint.column : Breakpoint::unspecifiedColumn; > > DebuggerParseData& parseData = debuggerParseData(breakpoint.sourceID, sourceProvider); >- std::optional<JSTextPosition> resolvedPosition = parseData.pausePositions.breakpointLocationForLineColumn((int)line, (int)column); >+ Optional<JSTextPosition> resolvedPosition = parseData.pausePositions.breakpointLocationForLineColumn((int)line, (int)column); > if (!resolvedPosition) > return; > >diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp >index a9f639c4f88af4c71ce1c93b6fab01809a1057bd..334d542c6e6c9fdae5fa6e6329ca09c45a4616c8 100644 >--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp >+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp >@@ -293,7 +293,7 @@ TextPosition DebuggerCallFrame::currentPosition(VM& vm) > > if (isTailDeleted()) { > CodeBlock* codeBlock = m_shadowChickenFrame.codeBlock; >- if (std::optional<unsigned> bytecodeOffset = codeBlock->bytecodeOffsetFromCallSiteIndex(m_shadowChickenFrame.callSiteIndex)) { >+ if (Optional<unsigned> bytecodeOffset = codeBlock->bytecodeOffsetFromCallSiteIndex(m_shadowChickenFrame.callSiteIndex)) { > return TextPosition(OrdinalNumber::fromOneBasedInt(codeBlock->lineNumberForBytecodeOffset(*bytecodeOffset)), > OrdinalNumber::fromOneBasedInt(codeBlock->columnNumberForBytecodeOffset(*bytecodeOffset))); > } >diff --git a/Source/JavaScriptCore/debugger/DebuggerParseData.cpp b/Source/JavaScriptCore/debugger/DebuggerParseData.cpp >index 48f939f10fdaca1c77574b1bd8860b8e71f07a98..e3307db3083a7c3fef5e9fb6321b6256e98a7174 100644 >--- a/Source/JavaScriptCore/debugger/DebuggerParseData.cpp >+++ b/Source/JavaScriptCore/debugger/DebuggerParseData.cpp >@@ -30,7 +30,7 @@ > > namespace JSC { > >-std::optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineColumn(int line, int column) >+Optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineColumn(int line, int column) > { > unsigned start = 0; > unsigned end = m_positions.size(); >@@ -54,7 +54,7 @@ std::optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineC > // We are guarenteed to have a Leave for an Entry so we don't need to bounds check. > while (true) { > if (pausePosition.type != DebuggerPausePositionType::Enter) >- return std::optional<JSTextPosition>(pausePosition.position); >+ return Optional<JSTextPosition>(pausePosition.position); > pausePosition = m_positions[middle++]; > } > } >@@ -67,7 +67,7 @@ std::optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineC > > // Past the end, no possible pause locations. > if (start >= m_positions.size()) >- return std::nullopt; >+ return WTF::nullopt; > > // If the next location is a function Entry we will need to decide if we should go into > // the function or go past the function. We decide to go into the function if the >@@ -87,7 +87,7 @@ std::optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineC > // Valid pause location. Use it. > DebuggerPausePosition& firstSlidePosition = m_positions[start]; > if (firstSlidePosition.type != DebuggerPausePositionType::Enter) >- return std::optional<JSTextPosition>(firstSlidePosition.position); >+ return Optional<JSTextPosition>(firstSlidePosition.position); > > // Determine if we should enter this function or skip past it. > // If entryStackSize is > 0 we are skipping functions. >@@ -113,11 +113,11 @@ std::optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineC > } > > // Found pause position. >- return std::optional<JSTextPosition>(slidePosition.position); >+ return Optional<JSTextPosition>(slidePosition.position); > } > > // No pause positions found. >- return std::nullopt; >+ return WTF::nullopt; > } > > void DebuggerPausePositions::sort() >diff --git a/Source/JavaScriptCore/debugger/DebuggerParseData.h b/Source/JavaScriptCore/debugger/DebuggerParseData.h >index ecc78d0d4bfdd23e614bb617e4f25e333e241193..06225155e145c388165d31488ace259da13cb09b 100644 >--- a/Source/JavaScriptCore/debugger/DebuggerParseData.h >+++ b/Source/JavaScriptCore/debugger/DebuggerParseData.h >@@ -60,7 +60,7 @@ public: > m_positions.append({ DebuggerPausePositionType::Leave, position }); > } > >- std::optional<JSTextPosition> breakpointLocationForLineColumn(int line, int column); >+ Optional<JSTextPosition> breakpointLocationForLineColumn(int line, int column); > > void sort(); > >diff --git a/Source/JavaScriptCore/debugger/ScriptProfilingScope.h b/Source/JavaScriptCore/debugger/ScriptProfilingScope.h >index c4bee4d1620a86e070a88b28de01c426b4ac2edf..c340a8b55f22390bc74c483664f75e4a6386c372 100644 >--- a/Source/JavaScriptCore/debugger/ScriptProfilingScope.h >+++ b/Source/JavaScriptCore/debugger/ScriptProfilingScope.h >@@ -83,7 +83,7 @@ private: > } > > JSGlobalObject* m_globalObject { nullptr }; >- std::optional<Seconds> m_startTime; >+ Optional<Seconds> m_startTime; > ProfilingReason m_reason; > }; > >diff --git a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h >index 5f5eccc330c22be8bd91e1b4cd7b759714a0dd67..2821fc7bb96535a44c84345bddd04099faf4a4e4 100644 >--- a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h >+++ b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h >@@ -553,7 +553,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi > > case DoubleRep: { > JSValue child = forNode(node->child1()).value(); >- if (std::optional<double> number = child.toNumberFromPrimitive()) { >+ if (Optional<double> number = child.toNumberFromPrimitive()) { > setConstant(node, jsDoubleNumber(*number)); > break; > } >@@ -678,7 +678,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi > > case ArithClz32: { > JSValue operand = forNode(node->child1()).value(); >- if (std::optional<double> number = operand.toNumberFromPrimitive()) { >+ if (Optional<double> number = operand.toNumberFromPrimitive()) { > switch (node->child1().useKind()) { > case Int32Use: > case KnownInt32Use: >@@ -706,7 +706,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi > case MakeRope: { > unsigned numberOfChildren = 0; > unsigned numberOfRemovedChildren = 0; >- std::optional<unsigned> nonEmptyIndex; >+ Optional<unsigned> nonEmptyIndex; > for (unsigned i = 0; i < AdjacencyList::Size; ++i) { > Edge& edge = node->children.child(i); > if (!edge) >@@ -1054,7 +1054,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi > JSValue child = forNode(node->child1()).value(); > switch (node->child1().useKind()) { > case Int32Use: >- if (std::optional<double> number = child.toNumberFromPrimitive()) { >+ if (Optional<double> number = child.toNumberFromPrimitive()) { > JSValue result = jsNumber(fabs(*number)); > if (result.isInt32()) { > setConstant(node, result); >@@ -1064,7 +1064,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi > setNonCellTypeForNode(node, SpecInt32Only); > break; > case DoubleRepUse: >- if (std::optional<double> number = child.toNumberFromPrimitive()) { >+ if (Optional<double> number = child.toNumberFromPrimitive()) { > setConstant(node, jsDoubleNumber(fabs(*number))); > break; > } >@@ -1107,7 +1107,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi > case ArithCeil: > case ArithTrunc: { > JSValue operand = forNode(node->child1()).value(); >- if (std::optional<double> number = operand.toNumberFromPrimitive()) { >+ if (Optional<double> number = operand.toNumberFromPrimitive()) { > if (node->child1().useKind() != DoubleRepUse) > didFoldClobberWorld(); > >@@ -1187,7 +1187,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi > > case MapHash: { > if (JSValue key = forNode(node->child1()).value()) { >- if (std::optional<uint32_t> hash = concurrentJSMapHash(key)) { >+ if (Optional<uint32_t> hash = concurrentJSMapHash(key)) { > // Although C++ code uses uint32_t for the hash, the closest type in DFG IR is Int32 > // and that's what MapHash returns. So, we have to cast to int32_t to avoid large > // unsigned values becoming doubles. This casting between signed and unsigned >@@ -4114,7 +4114,7 @@ template<typename AbstractStateType> > void AbstractInterpreter<AbstractStateType>::executeDoubleUnaryOpEffects(Node* node, double(*equivalentFunction)(double)) > { > JSValue child = forNode(node->child1()).value(); >- if (std::optional<double> number = child.toNumberFromPrimitive()) { >+ if (Optional<double> number = child.toNumberFromPrimitive()) { > if (node->child1().useKind() != DoubleRepUse) > didFoldClobberWorld(); > setConstant(node, jsDoubleNumber(equivalentFunction(*number))); >diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h >index e5b1e2ab62ef9ab5ea6a7b5dd4a81de76408d8df..74191d5bdc02ba0e2e7c9f2d8c231a4504f8d79a 100644 >--- a/Source/JavaScriptCore/dfg/DFGGraph.h >+++ b/Source/JavaScriptCore/dfg/DFGGraph.h >@@ -1096,7 +1096,7 @@ public: > bool m_hasDebuggerEnabled; > bool m_hasExceptionHandlers { false }; > bool m_isInSSAConversion { false }; >- std::optional<uint32_t> m_maxLocalsForCatchOSREntry; >+ Optional<uint32_t> m_maxLocalsForCatchOSREntry; > std::unique_ptr<FlowIndexing> m_indexingCache; > std::unique_ptr<FlowMap<AbstractValue>> m_abstractValuesCache; > Bag<EntrySwitchData> m_entrySwitchData; >diff --git a/Source/JavaScriptCore/dfg/DFGJITCode.cpp b/Source/JavaScriptCore/dfg/DFGJITCode.cpp >index 4798d8fb82a20bd4991ed7fc99541a7391ee3871..978013041abefc1f349be32076a2b47fcfe66878 100644 >--- a/Source/JavaScriptCore/dfg/DFGJITCode.cpp >+++ b/Source/JavaScriptCore/dfg/DFGJITCode.cpp >@@ -225,16 +225,16 @@ void JITCode::validateReferences(const TrackedReferences& trackedReferences) > minifiedDFG.validateReferences(trackedReferences); > } > >-std::optional<CodeOrigin> JITCode::findPC(CodeBlock*, void* pc) >+Optional<CodeOrigin> JITCode::findPC(CodeBlock*, void* pc) > { > for (OSRExit& exit : osrExit) { > if (ExecutableMemoryHandle* handle = exit.m_code.executableMemory()) { > if (handle->start().untaggedPtr() <= pc && pc < handle->end().untaggedPtr()) >- return std::optional<CodeOrigin>(exit.m_codeOriginForExitProfile); >+ return Optional<CodeOrigin>(exit.m_codeOriginForExitProfile); > } > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > void JITCode::finalizeOSREntrypoints() >diff --git a/Source/JavaScriptCore/dfg/DFGJITCode.h b/Source/JavaScriptCore/dfg/DFGJITCode.h >index 0e4a68d092a1c65e5de6f77dc7b95ebd3703f3ae..847a8356ad79304e06070e36d4162f72a7f8ed1c 100644 >--- a/Source/JavaScriptCore/dfg/DFGJITCode.h >+++ b/Source/JavaScriptCore/dfg/DFGJITCode.h >@@ -126,7 +126,7 @@ public: > > static ptrdiff_t commonDataOffset() { return OBJECT_OFFSETOF(JITCode, common); } > >- std::optional<CodeOrigin> findPC(CodeBlock*, void* pc) override; >+ Optional<CodeOrigin> findPC(CodeBlock*, void* pc) override; > > private: > friend class JITCompiler; // Allow JITCompiler to call setCodeRef(). >diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp >index b75fcdfb975d91eca2e38fdfc6ed05db0c7cbc3b..7fee4b329530ccff5c68a6bd0c6f40e272cfbbdd 100644 >--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp >@@ -142,7 +142,7 @@ ALWAYS_INLINE static void putByValInternal(ExecState* exec, VM& vm, EncodedJSVal > if (direct) { > RELEASE_ASSERT(baseValue.isObject()); > JSObject* baseObject = asObject(baseValue); >- if (std::optional<uint32_t> index = parseIndex(propertyName)) { >+ if (Optional<uint32_t> index = parseIndex(propertyName)) { > scope.release(); > baseObject->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); > return; >@@ -162,7 +162,7 @@ ALWAYS_INLINE static void putByValCellInternal(ExecState* exec, VM& vm, JSCell* > if (direct) { > RELEASE_ASSERT(base->isObject()); > JSObject* baseObject = asObject(base); >- if (std::optional<uint32_t> index = parseIndex(propertyName)) { >+ if (Optional<uint32_t> index = parseIndex(propertyName)) { > baseObject->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); > return; > } >@@ -1667,7 +1667,7 @@ char* JIT_OPERATION operationNewInt8ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt8Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt8Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewInt16ArrayWithSize( >@@ -1681,7 +1681,7 @@ char* JIT_OPERATION operationNewInt16ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt16Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt16Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewInt32ArrayWithSize( >@@ -1695,7 +1695,7 @@ char* JIT_OPERATION operationNewInt32ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt32Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt32Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewUint8ArrayWithSize( >@@ -1709,7 +1709,7 @@ char* JIT_OPERATION operationNewUint8ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewUint8ClampedArrayWithSize( >@@ -1723,7 +1723,7 @@ char* JIT_OPERATION operationNewUint8ClampedArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8ClampedArray>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8ClampedArray>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewUint16ArrayWithSize( >@@ -1737,7 +1737,7 @@ char* JIT_OPERATION operationNewUint16ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint16Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint16Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewUint32ArrayWithSize( >@@ -1751,7 +1751,7 @@ char* JIT_OPERATION operationNewUint32ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint32Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint32Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewFloat32ArrayWithSize( >@@ -1765,7 +1765,7 @@ char* JIT_OPERATION operationNewFloat32ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat32Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat32Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > char* JIT_OPERATION operationNewFloat64ArrayWithSize( >@@ -1779,7 +1779,7 @@ char* JIT_OPERATION operationNewFloat64ArrayWithOneArgument( > { > VM& vm = exec->vm(); > NativeCallFrameTracer tracer(&vm, exec); >- return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat64Array>(exec, structure, encodedValue, 0, std::nullopt)); >+ return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat64Array>(exec, structure, encodedValue, 0, WTF::nullopt)); > } > > JSCell* JIT_OPERATION operationCreateActivationDirect(ExecState* exec, Structure* structure, JSScope* scope, SymbolTable* table, EncodedJSValue initialValueEncoded) >diff --git a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h b/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h >index 4ca87074c1f8280ffeac7769394a40f52eaa8f00..73ca84828976cc9b598669dcfaa81f1d60b1ad85 100644 >--- a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h >+++ b/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h >@@ -51,7 +51,7 @@ public: > jit->m_outOfLineStreamIndex = m_streamIndex; > jit->m_origin = m_origin; > generateInternal(jit); >- jit->m_outOfLineStreamIndex = std::nullopt; >+ jit->m_outOfLineStreamIndex = WTF::nullopt; > if (!ASSERT_DISABLED) > jit->m_jit.abortWithReason(DFGSlowPathGeneratorFellThrough); > } >diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp >index fe3d6862e2f40ab7d74fbb6bb65baf8533459c47..8ebcfa90987ad1a867f6ae100cf12200350f4a1c 100644 >--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp >+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp >@@ -405,7 +405,7 @@ void SpeculativeJIT::runSlowPathGenerators(PCToCodeOriginMapBuilder& pcToCodeOri > m_outOfLineStreamIndex = slowPathLambda.streamIndex; > pcToCodeOriginMapBuilder.appendItem(m_jit.labelIgnoringWatchpoints(), currentNode->origin.semantic); > slowPathLambda.generator(); >- m_outOfLineStreamIndex = std::nullopt; >+ m_outOfLineStreamIndex = WTF::nullopt; > } > } > >@@ -3561,8 +3561,8 @@ void SpeculativeJIT::emitUntypedBitOp(Node* node) > return; > } > >- std::optional<JSValueOperand> left; >- std::optional<JSValueOperand> right; >+ Optional<JSValueOperand> left; >+ Optional<JSValueOperand> right; > > JSValueRegs leftRegs; > JSValueRegs rightRegs; >@@ -3743,8 +3743,8 @@ void SpeculativeJIT::emitUntypedRightShiftBitOp(Node* node) > return; > } > >- std::optional<JSValueOperand> left; >- std::optional<JSValueOperand> right; >+ Optional<JSValueOperand> left; >+ Optional<JSValueOperand> right; > > JSValueRegs leftRegs; > JSValueRegs rightRegs; >@@ -3966,8 +3966,8 @@ void SpeculativeJIT::compileMathIC(Node* node, JITBinaryMathIC<Generator>* mathI > Edge& leftChild = node->child1(); > Edge& rightChild = node->child2(); > >- std::optional<JSValueOperand> left; >- std::optional<JSValueOperand> right; >+ Optional<JSValueOperand> left; >+ Optional<JSValueOperand> right; > > JSValueRegs leftRegs; > JSValueRegs rightRegs; >@@ -3980,14 +3980,14 @@ void SpeculativeJIT::compileMathIC(Node* node, JITBinaryMathIC<Generator>* mathI > GPRReg scratchGPR = InvalidGPRReg; > FPRReg scratchFPR = InvalidFPRReg; > >- std::optional<FPRTemporary> fprScratch; >+ Optional<FPRTemporary> fprScratch; > if (needsScratchFPRReg) { > fprScratch.emplace(this); > scratchFPR = fprScratch->fpr(); > } > > #if USE(JSVALUE64) >- std::optional<GPRTemporary> gprScratch; >+ Optional<GPRTemporary> gprScratch; > if (needsScratchGPRReg) { > gprScratch.emplace(this); > scratchGPR = gprScratch->gpr(); >@@ -4696,7 +4696,7 @@ template <typename Generator, typename RepatchingFunction, typename NonRepatchin > void SpeculativeJIT::compileMathIC(Node* node, JITUnaryMathIC<Generator>* mathIC, bool needsScratchGPRReg, RepatchingFunction repatchingFunction, NonRepatchingFunction nonRepatchingFunction) > { > GPRReg scratchGPR = InvalidGPRReg; >- std::optional<GPRTemporary> gprScratch; >+ Optional<GPRTemporary> gprScratch; > if (needsScratchGPRReg) { > gprScratch.emplace(this); > scratchGPR = gprScratch->gpr(); >@@ -5021,8 +5021,8 @@ void SpeculativeJIT::compileValueDiv(Node* node) > return; > } > >- std::optional<JSValueOperand> left; >- std::optional<JSValueOperand> right; >+ Optional<JSValueOperand> left; >+ Optional<JSValueOperand> right; > > JSValueRegs leftRegs; > JSValueRegs rightRegs; >@@ -9314,7 +9314,7 @@ void SpeculativeJIT::compileCallDOMGetter(Node* node) > SpeculateCellOperand base(this, baseEdge); > regs.append(SnippetParams::Value(base.gpr(), m_state.forNode(baseEdge).value())); > >- std::optional<SpeculateCellOperand> globalObject; >+ Optional<SpeculateCellOperand> globalObject; > if (snippet->requireGlobalObject) { > Edge& globalObjectEdge = node->child2(); > globalObject.emplace(this, globalObjectEdge); >diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h >index 438b114c9de65035f049e8f3e5bf555ca8396350..80afc862882a3b9876e64cd677507368872248f2 100644 >--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h >+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h >@@ -1735,7 +1735,7 @@ public: > }; > Vector<SlowPathLambda> m_slowPathLambdas; > Vector<SilentRegisterSavePlan> m_plans; >- std::optional<unsigned> m_outOfLineStreamIndex; >+ Optional<unsigned> m_outOfLineStreamIndex; > }; > > >diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp >index 952f89158d4cc30bc768beef79c8db7b3dfdf659..bd605b6127f18084936dc83acbd4a736bf383b13 100644 >--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp >+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp >@@ -3827,8 +3827,8 @@ void SpeculativeJIT::compile(Node* node) > GPRTemporary structureID(this); > GPRTemporary result(this); > >- std::optional<SpeculateCellOperand> keyAsCell; >- std::optional<JSValueOperand> keyAsValue; >+ Optional<SpeculateCellOperand> keyAsCell; >+ Optional<JSValueOperand> keyAsValue; > JSValueRegs keyRegs; > if (node->child2().useKind() == UntypedUse) { > keyAsValue.emplace(this, node->child2()); >diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp >index 18ae7d81ba92ae1dbd4c852eb084f9778f66d0fb..45912c21c6deb3700b11cb82f07dd6d6d13065a2 100644 >--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp >+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp >@@ -1702,7 +1702,7 @@ void SpeculativeJIT::compileLogicalNot(Node* node) > > bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid(); > JSGlobalObject* globalObject = m_jit.graph().globalObjectFor(node->origin.semantic); >- std::optional<GPRTemporary> scratch; >+ Optional<GPRTemporary> scratch; > GPRReg scratchGPR = InvalidGPRReg; > if (shouldCheckMasqueradesAsUndefined) { > scratch.emplace(this); >@@ -1856,7 +1856,7 @@ void SpeculativeJIT::emitBranch(Node* node) > GPRTemporary result(this); > FPRTemporary fprValue(this); > FPRTemporary fprTemp(this); >- std::optional<GPRTemporary> scratch; >+ Optional<GPRTemporary> scratch; > > GPRReg scratchGPR = InvalidGPRReg; > bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid(); >@@ -2872,7 +2872,7 @@ void SpeculativeJIT::compile(Node* node) > // We are in generic mode! > JSValueOperand base(this, baseEdge); > JSValueOperand index(this, indexEdge); >- std::optional<JSValueOperand> args[2]; >+ Optional<JSValueOperand> args[2]; > baseGPR = base.gpr(); > indexGPR = index.gpr(); > for (unsigned i = numExtraArgs; i--;) { >@@ -3582,7 +3582,7 @@ void SpeculativeJIT::compile(Node* node) > GPRReg cellGPR = cell.gpr(); > > GPRReg tempGPR = InvalidGPRReg; >- std::optional<GPRTemporary> temp; >+ Optional<GPRTemporary> temp; > if (node->structureSet().size() > 1) { > temp.emplace(this); > tempGPR = temp->gpr(); >@@ -3955,7 +3955,7 @@ void SpeculativeJIT::compile(Node* node) > case StringUse: { > SpeculateCellOperand input(this, node->child1()); > GPRTemporary result(this); >- std::optional<GPRTemporary> temp; >+ Optional<GPRTemporary> temp; > > GPRReg tempGPR = InvalidGPRReg; > if (node->child1().useKind() == CellUse) { >@@ -4361,8 +4361,8 @@ void SpeculativeJIT::compile(Node* node) > GPRTemporary structureID(this); > GPRTemporary result(this); > >- std::optional<SpeculateCellOperand> keyAsCell; >- std::optional<JSValueOperand> keyAsValue; >+ Optional<SpeculateCellOperand> keyAsCell; >+ Optional<JSValueOperand> keyAsValue; > GPRReg keyGPR; > if (node->child2().useKind() == UntypedUse) { > keyAsValue.emplace(this, node->child2()); >@@ -4596,7 +4596,7 @@ void SpeculativeJIT::compile(Node* node) > GPRTemporary temp2(this); > GPRReg t2 = temp2.gpr(); > >- std::optional<SpeculateBooleanOperand> isLittleEndianOperand; >+ Optional<SpeculateBooleanOperand> isLittleEndianOperand; > if (node->child3()) > isLittleEndianOperand.emplace(this, node->child3()); > GPRReg isLittleEndianGPR = isLittleEndianOperand ? isLittleEndianOperand->gpr() : InvalidGPRReg; >@@ -4755,10 +4755,10 @@ void SpeculativeJIT::compile(Node* node) > SpeculateInt32Operand index(this, m_graph.varArgChild(node, 1)); > GPRReg indexGPR = index.gpr(); > >- std::optional<SpeculateStrictInt52Operand> int52Value; >- std::optional<SpeculateDoubleOperand> doubleValue; >- std::optional<SpeculateInt32Operand> int32Value; >- std::optional<FPRTemporary> fprTemporary; >+ Optional<SpeculateStrictInt52Operand> int52Value; >+ Optional<SpeculateDoubleOperand> doubleValue; >+ Optional<SpeculateInt32Operand> int32Value; >+ Optional<FPRTemporary> fprTemporary; > GPRReg valueGPR = InvalidGPRReg; > FPRReg valueFPR = InvalidFPRReg; > FPRReg tempFPR = InvalidFPRReg; >@@ -4794,7 +4794,7 @@ void SpeculativeJIT::compile(Node* node) > GPRTemporary temp3(this); > GPRReg t3 = temp3.gpr(); > >- std::optional<SpeculateBooleanOperand> isLittleEndianOperand; >+ Optional<SpeculateBooleanOperand> isLittleEndianOperand; > if (m_graph.varArgChild(node, 3)) > isLittleEndianOperand.emplace(this, m_graph.varArgChild(node, 3)); > GPRReg isLittleEndianGPR = isLittleEndianOperand ? isLittleEndianOperand->gpr() : InvalidGPRReg; >diff --git a/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp b/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp >index 90316057ecf789f8f4d2c180eee36a1fb960df27..4f2f1d0b85fb3f70c225e47a59c4f706511e7d41 100644 >--- a/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp >+++ b/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp >@@ -204,7 +204,7 @@ private: > if (m_node->isBinaryUseKind(DoubleRepUse) > && m_node->child2()->isNumberConstant()) { > >- if (std::optional<double> reciprocal = safeReciprocalForDivByConst(m_node->child2()->asNumber())) { >+ if (Optional<double> reciprocal = safeReciprocalForDivByConst(m_node->child2()->asNumber())) { > Node* reciprocalNode = m_insertionSet.insertConstant(m_nodeIndex, m_node->origin, jsDoubleNumber(*reciprocal), DoubleConstant); > m_node->setOp(ArithMul); > m_node->child2() = Edge(reciprocalNode, DoubleRepUse); >diff --git a/Source/JavaScriptCore/ftl/FTLJITCode.cpp b/Source/JavaScriptCore/ftl/FTLJITCode.cpp >index a2278a8cf76e43cc77c533ea8c9b7bf4ff8a30fc..db6e624809d728fda2c37011cbd824880c61e031 100644 >--- a/Source/JavaScriptCore/ftl/FTLJITCode.cpp >+++ b/Source/JavaScriptCore/ftl/FTLJITCode.cpp >@@ -151,23 +151,23 @@ RegisterSet JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBloc > return { }; > } > >-std::optional<CodeOrigin> JITCode::findPC(CodeBlock* codeBlock, void* pc) >+Optional<CodeOrigin> JITCode::findPC(CodeBlock* codeBlock, void* pc) > { > for (OSRExit& exit : osrExit) { > if (ExecutableMemoryHandle* handle = exit.m_code.executableMemory()) { > if (handle->start().untaggedPtr() <= pc && pc < handle->end().untaggedPtr()) >- return std::optional<CodeOrigin>(exit.m_codeOriginForExitProfile); >+ return Optional<CodeOrigin>(exit.m_codeOriginForExitProfile); > } > } > > for (std::unique_ptr<LazySlowPath>& lazySlowPath : lazySlowPaths) { > if (ExecutableMemoryHandle* handle = lazySlowPath->stub().executableMemory()) { > if (handle->start().untaggedPtr() <= pc && pc < handle->end().untaggedPtr()) >- return std::optional<CodeOrigin>(codeBlock->codeOrigin(lazySlowPath->callSiteIndex())); >+ return Optional<CodeOrigin>(codeBlock->codeOrigin(lazySlowPath->callSiteIndex())); > } > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > } } // namespace JSC::FTL >diff --git a/Source/JavaScriptCore/ftl/FTLJITCode.h b/Source/JavaScriptCore/ftl/FTLJITCode.h >index 98280053830504c7fbca848eeca3faebc90626ce..0180839bd8d963020e1b569aa12b0dea92f5f9f7 100644 >--- a/Source/JavaScriptCore/ftl/FTLJITCode.h >+++ b/Source/JavaScriptCore/ftl/FTLJITCode.h >@@ -60,7 +60,7 @@ public: > > RegisterSet liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBlock*, CallSiteIndex) override; > >- std::optional<CodeOrigin> findPC(CodeBlock*, void* pc) override; >+ Optional<CodeOrigin> findPC(CodeBlock*, void* pc) override; > > CodeRef<JSEntryPtrTag> b3Code() const { return m_b3Code; } > >diff --git a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp >index 185876b83716dbf352629eadfb6184658dd0f3e8..1a664c465e0e659386cd2a1a2c5a3bc29687c6bd 100644 >--- a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp >+++ b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp >@@ -13404,8 +13404,8 @@ private: > > LBasicBlock lastNext = m_out.insertNewBlocksBefore(fastCase); > >- std::optional<unsigned> staticVectorLength; >- std::optional<unsigned> staticVectorLengthFromPublicLength; >+ Optional<unsigned> staticVectorLength; >+ Optional<unsigned> staticVectorLengthFromPublicLength; > if (structure->hasIntPtr()) { > if (publicLength->hasInt32()) { > unsigned publicLengthConst = static_cast<unsigned>(publicLength->asInt32()); >diff --git a/Source/JavaScriptCore/heap/GCRequest.h b/Source/JavaScriptCore/heap/GCRequest.h >index 2e81c02aaf504f5a2e87f7f19f7c5997e98a4c1b..a8a5cd61f0644f1c47bfb1ecea16c0cdfd81d488 100644 >--- a/Source/JavaScriptCore/heap/GCRequest.h >+++ b/Source/JavaScriptCore/heap/GCRequest.h >@@ -41,7 +41,7 @@ struct GCRequest { > { > } > >- GCRequest(std::optional<CollectionScope> scope) >+ GCRequest(Optional<CollectionScope> scope) > : scope(scope) > { > } >@@ -50,7 +50,7 @@ struct GCRequest { > > void dump(PrintStream&) const; > >- std::optional<CollectionScope> scope; >+ Optional<CollectionScope> scope; > RefPtr<SharedTask<void()>> didFinishEndPhase; > }; > >diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp >index 6b0f319388648cd295b6f11c573ab73844219787..16c99230701aa1fec700efe13b173ee9ff3aac1a 100644 >--- a/Source/JavaScriptCore/heap/Heap.cpp >+++ b/Source/JavaScriptCore/heap/Heap.cpp >@@ -190,7 +190,7 @@ SimpleStats& timingStats(const char* name, CollectionScope scope) > > class TimingScope { > public: >- TimingScope(std::optional<CollectionScope> scope, const char* name) >+ TimingScope(Optional<CollectionScope> scope, const char* name) > : m_scope(scope) > , m_name(name) > { >@@ -203,7 +203,7 @@ public: > { > } > >- void setScope(std::optional<CollectionScope> scope) >+ void setScope(Optional<CollectionScope> scope) > { > m_scope = scope; > } >@@ -224,7 +224,7 @@ public: > } > } > private: >- std::optional<CollectionScope> m_scope; >+ Optional<CollectionScope> m_scope; > MonotonicTime m_before; > const char* m_name; > }; >@@ -2313,7 +2313,7 @@ void Heap::didFinishCollection() > > RELEASE_ASSERT(m_collectionScope); > m_lastCollectionScope = m_collectionScope; >- m_collectionScope = std::nullopt; >+ m_collectionScope = WTF::nullopt; > > for (auto* observer : m_observers) > observer->didGarbageCollect(scope); >@@ -2822,7 +2822,7 @@ void Heap::notifyIsSafeToCollect() > { > LockHolder locker(*m_threadLock); > if (m_requests.isEmpty()) { >- m_requests.append(std::nullopt); >+ m_requests.append(WTF::nullopt); > m_lastGrantedTicket++; > m_threadCondition->notifyOne(locker); > } >diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h >index c8aed4a36a588201f1527e5eaafa1453295c0019..db23004965f8a2acef87cc93ee56dc99071c1576 100644 >--- a/Source/JavaScriptCore/heap/Heap.h >+++ b/Source/JavaScriptCore/heap/Heap.h >@@ -153,7 +153,7 @@ public: > void removeObserver(HeapObserver* observer) { m_observers.removeFirst(observer); } > > MutatorState mutatorState() const { return m_mutatorState; } >- std::optional<CollectionScope> collectionScope() const { return m_collectionScope; } >+ Optional<CollectionScope> collectionScope() const { return m_collectionScope; } > bool hasHeapAccess() const; > bool worldIsStopped() const; > bool worldIsRunning() const { return !worldIsStopped(); } >@@ -177,8 +177,8 @@ public: > bool shouldCollectHeuristic(); > > // Queue up a collection. Returns immediately. This will not queue a collection if a collection >- // of equal or greater strength exists. Full collections are stronger than std::nullopt collections >- // and std::nullopt collections are stronger than Eden collections. std::nullopt means that the GC can >+ // of equal or greater strength exists. Full collections are stronger than WTF::nullopt collections >+ // and WTF::nullopt collections are stronger than Eden collections. WTF::nullopt means that the GC can > // choose Eden or Full. This implies that if you request a GC while that GC is ongoing, nothing > // will happen. > JS_EXPORT_PRIVATE void collectAsync(GCRequest = GCRequest()); >@@ -576,8 +576,8 @@ private: > size_t m_totalBytesVisitedThisCycle; > double m_incrementBalance { 0 }; > >- std::optional<CollectionScope> m_collectionScope; >- std::optional<CollectionScope> m_lastCollectionScope; >+ Optional<CollectionScope> m_collectionScope; >+ Optional<CollectionScope> m_lastCollectionScope; > MutatorState m_mutatorState { MutatorState::Running }; > StructureIDTable m_structureIDTable; > MarkedSpace m_objectSpace; >diff --git a/Source/JavaScriptCore/heap/HeapSnapshot.cpp b/Source/JavaScriptCore/heap/HeapSnapshot.cpp >index 34db12c3dbbc7270429351be0abdc93e6b628d1f..3df58e2ad39b022c28f06aca58fa82a8b1218300 100644 >--- a/Source/JavaScriptCore/heap/HeapSnapshot.cpp >+++ b/Source/JavaScriptCore/heap/HeapSnapshot.cpp >@@ -130,7 +130,7 @@ void HeapSnapshot::finalize() > #endif > } > >-std::optional<HeapSnapshotNode> HeapSnapshot::nodeForCell(JSCell* cell) >+Optional<HeapSnapshotNode> HeapSnapshot::nodeForCell(JSCell* cell) > { > ASSERT(m_finalized); > >@@ -142,7 +142,7 @@ std::optional<HeapSnapshotNode> HeapSnapshot::nodeForCell(JSCell* cell) > unsigned middle = start + ((end - start) / 2); > HeapSnapshotNode& node = m_nodes[middle]; > if (cell == node.cell) >- return std::optional<HeapSnapshotNode>(node); >+ return Optional<HeapSnapshotNode>(node); > if (cell < node.cell) > end = middle; > else >@@ -153,32 +153,32 @@ std::optional<HeapSnapshotNode> HeapSnapshot::nodeForCell(JSCell* cell) > if (m_previous) > return m_previous->nodeForCell(cell); > >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<HeapSnapshotNode> HeapSnapshot::nodeForObjectIdentifier(unsigned objectIdentifier) >+Optional<HeapSnapshotNode> HeapSnapshot::nodeForObjectIdentifier(unsigned objectIdentifier) > { > if (isEmpty()) { > if (m_previous) > return m_previous->nodeForObjectIdentifier(objectIdentifier); >- return std::nullopt; >+ return WTF::nullopt; > } > > if (objectIdentifier > m_lastObjectIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > if (objectIdentifier < m_firstObjectIdentifier) { > if (m_previous) > return m_previous->nodeForObjectIdentifier(objectIdentifier); >- return std::nullopt; >+ return WTF::nullopt; > } > > for (auto& node : m_nodes) { > if (node.identifier == objectIdentifier) >- return std::optional<HeapSnapshotNode>(node); >+ return Optional<HeapSnapshotNode>(node); > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace JSC >diff --git a/Source/JavaScriptCore/heap/HeapSnapshot.h b/Source/JavaScriptCore/heap/HeapSnapshot.h >index fdd3de3b50f088b3540c141537d930f3b4934a05..60d82845705d2be1c1a3b9546f416374a3889b60 100644 >--- a/Source/JavaScriptCore/heap/HeapSnapshot.h >+++ b/Source/JavaScriptCore/heap/HeapSnapshot.h >@@ -45,8 +45,8 @@ public: > void finalize(); > > bool isEmpty() const { return m_nodes.isEmpty(); } >- std::optional<HeapSnapshotNode> nodeForCell(JSCell*); >- std::optional<HeapSnapshotNode> nodeForObjectIdentifier(unsigned objectIdentifier); >+ Optional<HeapSnapshotNode> nodeForCell(JSCell*); >+ Optional<HeapSnapshotNode> nodeForObjectIdentifier(unsigned objectIdentifier); > > private: > friend class HeapSnapshotBuilder; >diff --git a/Source/JavaScriptCore/heap/MarkingConstraintSolver.cpp b/Source/JavaScriptCore/heap/MarkingConstraintSolver.cpp >index dca0a59262412c075a34be626a5f2ca2d35e295d..a7ff046e59f8446850d53697fc3ab5fc9d7539a6 100644 >--- a/Source/JavaScriptCore/heap/MarkingConstraintSolver.cpp >+++ b/Source/JavaScriptCore/heap/MarkingConstraintSolver.cpp >@@ -54,7 +54,7 @@ bool MarkingConstraintSolver::didVisitSomething() const > return false; > } > >-void MarkingConstraintSolver::execute(SchedulerPreference preference, ScopedLambda<std::optional<unsigned>()> pickNext) >+void MarkingConstraintSolver::execute(SchedulerPreference preference, ScopedLambda<Optional<unsigned>()> pickNext) > { > m_pickNextIsStillActive = true; > RELEASE_ASSERT(!m_numThreadsThatMayProduceWork); >@@ -89,10 +89,10 @@ void MarkingConstraintSolver::drain(BitVector& unexecuted) > auto end = unexecuted.end(); > if (iter == end) > return; >- auto pickNext = scopedLambda<std::optional<unsigned>()>( >- [&] () -> std::optional<unsigned> { >+ auto pickNext = scopedLambda<Optional<unsigned>()>( >+ [&] () -> Optional<unsigned> { > if (iter == end) >- return std::nullopt; >+ return WTF::nullopt; > return *iter++; > }); > execute(NextConstraintFirst, pickNext); >@@ -126,13 +126,13 @@ void MarkingConstraintSolver::converge(const Vector<MarkingConstraint*>& order) > return; > } > >- auto pickNext = scopedLambda<std::optional<unsigned>()>( >- [&] () -> std::optional<unsigned> { >+ auto pickNext = scopedLambda<Optional<unsigned>()>( >+ [&] () -> Optional<unsigned> { > if (didVisitSomething()) >- return std::nullopt; >+ return WTF::nullopt; > > if (index >= order.size()) >- return std::nullopt; >+ return WTF::nullopt; > > MarkingConstraint& constraint = *order[index++]; > return constraint.index(); >@@ -157,7 +157,7 @@ void MarkingConstraintSolver::addParallelTask(RefPtr<SharedTask<void(SlotVisitor > m_toExecuteInParallel.append(TaskWithConstraint(WTFMove(task), &constraint)); > } > >-void MarkingConstraintSolver::runExecutionThread(SlotVisitor& visitor, SchedulerPreference preference, ScopedLambda<std::optional<unsigned>()> pickNext) >+void MarkingConstraintSolver::runExecutionThread(SlotVisitor& visitor, SchedulerPreference preference, ScopedLambda<Optional<unsigned>()> pickNext) > { > for (;;) { > bool doParallelWorkMode; >@@ -183,7 +183,7 @@ void MarkingConstraintSolver::runExecutionThread(SlotVisitor& visitor, Scheduler > return false; > > for (;;) { >- std::optional<unsigned> pickResult = pickNext(); >+ Optional<unsigned> pickResult = pickNext(); > if (!pickResult) { > m_pickNextIsStillActive = false; > return false; >diff --git a/Source/JavaScriptCore/heap/MarkingConstraintSolver.h b/Source/JavaScriptCore/heap/MarkingConstraintSolver.h >index 08b38dbbee7309a653eff47730ad0dac5f0ebc1c..18907ad7d7cd0b949f00fdcebc84a854137277ab 100644 >--- a/Source/JavaScriptCore/heap/MarkingConstraintSolver.h >+++ b/Source/JavaScriptCore/heap/MarkingConstraintSolver.h >@@ -56,7 +56,7 @@ public: > NextConstraintFirst > }; > >- void execute(SchedulerPreference, ScopedLambda<std::optional<unsigned>()> pickNext); >+ void execute(SchedulerPreference, ScopedLambda<Optional<unsigned>()> pickNext); > > void drain(BitVector& unexecuted); > >@@ -68,7 +68,7 @@ public: > void addParallelTask(RefPtr<SharedTask<void(SlotVisitor&)>>, MarkingConstraint&); > > private: >- void runExecutionThread(SlotVisitor&, SchedulerPreference, ScopedLambda<std::optional<unsigned>()> pickNext); >+ void runExecutionThread(SlotVisitor&, SchedulerPreference, ScopedLambda<Optional<unsigned>()> pickNext); > > struct TaskWithConstraint { > TaskWithConstraint() { } >diff --git a/Source/JavaScriptCore/inspector/InjectedScript.cpp b/Source/JavaScriptCore/inspector/InjectedScript.cpp >index c03ffeb2e4484f75d9b8fc4cc33a6a00865a2b0e..0a5a6d7648141f4a916fd5d68a801771401713a4 100644 >--- a/Source/JavaScriptCore/inspector/InjectedScript.cpp >+++ b/Source/JavaScriptCore/inspector/InjectedScript.cpp >@@ -54,7 +54,7 @@ InjectedScript::~InjectedScript() > { > } > >-void InjectedScript::evaluate(ErrorString& errorString, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex) >+void InjectedScript::evaluate(ErrorString& errorString, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) > { > Deprecated::ScriptFunctionCall function(injectedScriptObject(), "evaluate"_s, inspectorEnvironment()->functionCallHandler()); > function.appendArgument(expression); >@@ -76,7 +76,7 @@ void InjectedScript::awaitPromise(const String& promiseObjectId, bool returnByVa > makeAsyncCall(function, WTFMove(callback)); > } > >-void InjectedScript::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown) >+void InjectedScript::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown) > { > Deprecated::ScriptFunctionCall function(injectedScriptObject(), "callFunctionOn"_s, inspectorEnvironment()->functionCallHandler()); > function.appendArgument(objectId); >@@ -85,12 +85,12 @@ void InjectedScript::callFunctionOn(ErrorString& errorString, const String& obje > function.appendArgument(returnByValue); > function.appendArgument(generatePreview); > >- std::optional<int> savedResultIndex; >+ Optional<int> savedResultIndex; > makeEvalCall(errorString, function, result, wasThrown, savedResultIndex); > ASSERT(!savedResultIndex); > } > >-void InjectedScript::evaluateOnCallFrame(ErrorString& errorString, JSC::JSValue callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex) >+void InjectedScript::evaluateOnCallFrame(ErrorString& errorString, JSC::JSValue callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) > { > Deprecated::ScriptFunctionCall function(injectedScriptObject(), "evaluateOnCallFrame"_s, inspectorEnvironment()->functionCallHandler()); > function.appendArgument(callFrames); >@@ -213,7 +213,7 @@ void InjectedScript::getCollectionEntries(ErrorString& errorString, const String > entries = BindingTraits<JSON::ArrayOf<Protocol::Runtime::CollectionEntry>>::runtimeCast(WTFMove(result)); > } > >-void InjectedScript::saveResult(ErrorString& errorString, const String& callArgumentJSON, std::optional<int>& savedResultIndex) >+void InjectedScript::saveResult(ErrorString& errorString, const String& callArgumentJSON, Optional<int>& savedResultIndex) > { > Deprecated::ScriptFunctionCall function(injectedScriptObject(), "saveResult"_s, inspectorEnvironment()->functionCallHandler()); > function.appendArgument(callArgumentJSON); >diff --git a/Source/JavaScriptCore/inspector/InjectedScript.h b/Source/JavaScriptCore/inspector/InjectedScript.h >index 4de9d745dce5b3dcf59bc1c53aeb6c3f8cc0a34f..f2ba84231d458b521ee842a3672eec0b2873e146 100644 >--- a/Source/JavaScriptCore/inspector/InjectedScript.h >+++ b/Source/JavaScriptCore/inspector/InjectedScript.h >@@ -51,10 +51,10 @@ public: > InjectedScript(Deprecated::ScriptObject, InspectorEnvironment*); > virtual ~InjectedScript(); > >- void evaluate(ErrorString&, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex); >+ void evaluate(ErrorString&, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex); > void awaitPromise(const String& promiseObjectId, bool returnByValue, bool generatePreview, bool saveResult, AsyncCallCallback&&); >- void evaluateOnCallFrame(ErrorString&, JSC::JSValue callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex); >- void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown); >+ void evaluateOnCallFrame(ErrorString&, JSC::JSValue callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex); >+ void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown); > void getFunctionDetails(ErrorString&, const String& functionId, RefPtr<Protocol::Debugger::FunctionDetails>& result); > void functionDetails(ErrorString&, JSC::JSValue, RefPtr<Protocol::Debugger::FunctionDetails>& result); > void getPreview(ErrorString&, const String& objectId, RefPtr<Protocol::Runtime::ObjectPreview>& result); >@@ -62,7 +62,7 @@ public: > void getDisplayableProperties(ErrorString&, const String& objectId, bool generatePreview, RefPtr<JSON::ArrayOf<Protocol::Runtime::PropertyDescriptor>>& result); > void getInternalProperties(ErrorString&, const String& objectId, bool generatePreview, RefPtr<JSON::ArrayOf<Protocol::Runtime::InternalPropertyDescriptor>>& result); > void getCollectionEntries(ErrorString&, const String& objectId, const String& objectGroup, int startIndex, int numberToFetch, RefPtr<JSON::ArrayOf<Protocol::Runtime::CollectionEntry>>& entries); >- void saveResult(ErrorString&, const String& callArgumentJSON, std::optional<int>& savedResultIndex); >+ void saveResult(ErrorString&, const String& callArgumentJSON, Optional<int>& savedResultIndex); > > Ref<JSON::ArrayOf<Protocol::Debugger::CallFrame>> wrapCallFrames(JSC::JSValue) const; > RefPtr<Protocol::Runtime::RemoteObject> wrapObject(JSC::JSValue, const String& groupName, bool generatePreview = false) const; >diff --git a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp >index 867e0b52d46becfeb6b6f63517bd27eb680db0ef..fd8bbcf06f00b1877dfa66075e2d5a2811161cba 100644 >--- a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp >+++ b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp >@@ -96,7 +96,7 @@ Ref<JSON::Value> InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& fu > return resultJSONValue.releaseNonNull(); > } > >-void InjectedScriptBase::makeEvalCall(ErrorString& errorString, Deprecated::ScriptFunctionCall& function, RefPtr<Protocol::Runtime::RemoteObject>& out_resultObject, std::optional<bool>& out_wasThrown, std::optional<int>& out_savedResultIndex) >+void InjectedScriptBase::makeEvalCall(ErrorString& errorString, Deprecated::ScriptFunctionCall& function, RefPtr<Protocol::Runtime::RemoteObject>& out_resultObject, Optional<bool>& out_wasThrown, Optional<int>& out_savedResultIndex) > { > checkCallResult(errorString, makeCall(function), out_resultObject, out_wasThrown, out_savedResultIndex); > } >@@ -141,7 +141,7 @@ void InjectedScriptBase::makeAsyncCall(Deprecated::ScriptFunctionCall& function, > } > } > >-void InjectedScriptBase::checkCallResult(ErrorString& errorString, RefPtr<JSON::Value> result, RefPtr<Protocol::Runtime::RemoteObject>& out_resultObject, std::optional<bool>& out_wasThrown, std::optional<int>& out_savedResultIndex) >+void InjectedScriptBase::checkCallResult(ErrorString& errorString, RefPtr<JSON::Value> result, RefPtr<Protocol::Runtime::RemoteObject>& out_resultObject, Optional<bool>& out_wasThrown, Optional<int>& out_savedResultIndex) > { > if (!result) { > errorString = "Internal error: result value is empty"_s; >@@ -186,8 +186,8 @@ void InjectedScriptBase::checkAsyncCallResult(RefPtr<JSON::Value> result, const > { > ErrorString errorString; > RefPtr<Protocol::Runtime::RemoteObject> resultObject; >- std::optional<bool> wasThrown; >- std::optional<int> savedResultIndex; >+ Optional<bool> wasThrown; >+ Optional<int> savedResultIndex; > > checkCallResult(errorString, result, resultObject, wasThrown, savedResultIndex); > >diff --git a/Source/JavaScriptCore/inspector/InjectedScriptBase.h b/Source/JavaScriptCore/inspector/InjectedScriptBase.h >index 447a4288f9977cf2cb20aefdefe2cb52b02c3a78..226e81bbde3fe88c4e0970d541c01dfefbadd854 100644 >--- a/Source/JavaScriptCore/inspector/InjectedScriptBase.h >+++ b/Source/JavaScriptCore/inspector/InjectedScriptBase.h >@@ -45,7 +45,7 @@ class ScriptFunctionCall; > namespace Inspector { > > typedef String ErrorString; >-typedef WTF::Function<void(ErrorString&, RefPtr<Protocol::Runtime::RemoteObject>&&, std::optional<bool>&, std::optional<int>&)> AsyncCallCallback; >+typedef WTF::Function<void(ErrorString&, RefPtr<Protocol::Runtime::RemoteObject>&&, Optional<bool>&, Optional<int>&)> AsyncCallCallback; > > class JS_EXPORT_PRIVATE InjectedScriptBase { > public: >@@ -66,11 +66,11 @@ protected: > const Deprecated::ScriptObject& injectedScriptObject() const; > JSC::JSValue callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&, bool& hadException) const; > Ref<JSON::Value> makeCall(Deprecated::ScriptFunctionCall&); >- void makeEvalCall(ErrorString&, Deprecated::ScriptFunctionCall&, RefPtr<Protocol::Runtime::RemoteObject>& resultObject, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex); >+ void makeEvalCall(ErrorString&, Deprecated::ScriptFunctionCall&, RefPtr<Protocol::Runtime::RemoteObject>& resultObject, Optional<bool>& wasThrown, Optional<int>& savedResultIndex); > void makeAsyncCall(Deprecated::ScriptFunctionCall&, AsyncCallCallback&&); > > private: >- void checkCallResult(ErrorString&, RefPtr<JSON::Value> result, RefPtr<Protocol::Runtime::RemoteObject>& resultObject, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex); >+ void checkCallResult(ErrorString&, RefPtr<JSON::Value> result, RefPtr<Protocol::Runtime::RemoteObject>& resultObject, Optional<bool>& wasThrown, Optional<int>& savedResultIndex); > void checkAsyncCallResult(RefPtr<JSON::Value> result, const AsyncCallCallback&); > > String m_name; >diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp >index 7dfb6ce70a57bcdedacecb6689b7b625fe741a53..038cb646d31706905deff8935040d63c0afd00f9 100644 >--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp >+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp >@@ -114,7 +114,7 @@ void BackendDispatcher::dispatch(const String& message) > { > // In case this is a re-entrant call from a nested run loop, we don't want to lose > // the outer request's id just because the inner request is bogus. >- SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, std::nullopt); >+ SetForScope<Optional<long>> scopedRequestId(m_currentRequestId, WTF::nullopt); > > RefPtr<JSON::Value> parsedMessage; > if (!JSON::Value::parseJSON(message, parsedMessage)) { >@@ -145,7 +145,7 @@ void BackendDispatcher::dispatch(const String& message) > > { > // We could be called re-entrantly from a nested run loop, so restore the previous id. >- SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, requestId); >+ SetForScope<Optional<long>> scopedRequestId(m_currentRequestId, requestId); > > RefPtr<JSON::Value> methodValue; > if (!messageObject->getValue("method"_s, methodValue)) { >@@ -251,7 +251,7 @@ void BackendDispatcher::sendPendingErrors() > m_frontendRouter->sendResponse(message->toJSONString()); > > m_protocolErrors.clear(); >- m_currentRequestId = std::nullopt; >+ m_currentRequestId = WTF::nullopt; > } > > void BackendDispatcher::reportProtocolError(CommonErrorCode errorCode, const String& errorMessage) >@@ -259,7 +259,7 @@ void BackendDispatcher::reportProtocolError(CommonErrorCode errorCode, const Str > reportProtocolError(m_currentRequestId, errorCode, errorMessage); > } > >-void BackendDispatcher::reportProtocolError(std::optional<long> relatedRequestId, CommonErrorCode errorCode, const String& errorMessage) >+void BackendDispatcher::reportProtocolError(Optional<long> relatedRequestId, CommonErrorCode errorCode, const String& errorMessage) > { > ASSERT_ARG(errorCode, errorCode >= 0); > >@@ -270,16 +270,6 @@ void BackendDispatcher::reportProtocolError(std::optional<long> relatedRequestId > m_protocolErrors.append(std::tuple<CommonErrorCode, String>(errorCode, errorMessage)); > } > >-#if PLATFORM(MAC) >-void BackendDispatcher::reportProtocolError(WTF::DeprecatedOptional<long> relatedRequestId, CommonErrorCode errorCode, const String& errorMessage) >-{ >- if (relatedRequestId) >- reportProtocolError(relatedRequestId.value(), errorCode, errorMessage); >- else >- reportProtocolError(std::nullopt, errorCode, errorMessage); >-} >-#endif >- > template<typename T> > T BackendDispatcher::getPropertyValue(JSON::Object* object, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(JSON::Value&, T&)> asMethod, const char* typeName) > { >diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h >index a34d1cef40bcf51d43be34e267eb6050a72b833f..95d9d81188e735e8f1b70cc0deee2682cb6714f0 100644 >--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h >+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h >@@ -29,7 +29,6 @@ > #include "InspectorFrontendRouter.h" > #include "InspectorProtocolTypes.h" > #include <functional> >-#include <wtf/DeprecatedOptional.h> > #include <wtf/Optional.h> > #include <wtf/RefCounted.h> > #include <wtf/text/WTFString.h> >@@ -93,7 +92,7 @@ public: > void sendPendingErrors(); > > void reportProtocolError(CommonErrorCode, const String& errorMessage); >- void reportProtocolError(std::optional<long> relatedRequestId, CommonErrorCode, const String& errorMessage); >+ void reportProtocolError(Optional<long> relatedRequestId, CommonErrorCode, const String& errorMessage); > > template<typename T> > WTF_INTERNAL >@@ -110,11 +109,6 @@ public: > private: > BackendDispatcher(Ref<FrontendRouter>&&); > >-#if PLATFORM(MAC) >- // This is necessary for some versions of Safari. Remove it when those versions of Safari are no longer supported. >- void reportProtocolError(WTF::DeprecatedOptional<long> relatedRequestId, CommonErrorCode, const String& errorMessage); >-#endif >- > Ref<FrontendRouter> m_frontendRouter; > HashMap<String, SupplementalBackendDispatcher*> m_dispatchers; > >@@ -125,7 +119,7 @@ private: > > // For synchronously handled requests, avoid plumbing requestId through every > // call that could potentially fail with a protocol error. >- std::optional<long> m_currentRequestId { std::nullopt }; >+ Optional<long> m_currentRequestId { WTF::nullopt }; > }; > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp >index f9910071742281e6b1dfe5df8a7b321996c4467b..ece5647c9c84596ccbcce9623ae5f6401f30cea0 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp >+++ b/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp >@@ -309,7 +309,7 @@ void InspectorDebuggerAgent::didDispatchAsyncCall() > auto& asyncStackTrace = it->value; > asyncStackTrace->didDispatchAsyncCall(); > >- m_currentAsyncCallIdentifier = std::nullopt; >+ m_currentAsyncCallIdentifier = WTF::nullopt; > > if (!asyncStackTrace->isPending()) > m_pendingAsyncCalls.remove(identifier); >@@ -827,7 +827,7 @@ void InspectorDebuggerAgent::setPauseOnAssertions(ErrorString&, bool enabled) > m_pauseOnAssertionFailures = enabled; > } > >-void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString& errorString, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex) >+void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString& errorString, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) > { > if (!m_currentCallStack) { > errorString = "Not paused"_s; >@@ -1155,7 +1155,7 @@ void InspectorDebuggerAgent::clearExceptionValue() > void InspectorDebuggerAgent::clearAsyncStackTraceData() > { > m_pendingAsyncCalls.clear(); >- m_currentAsyncCallIdentifier = std::nullopt; >+ m_currentAsyncCallIdentifier = WTF::nullopt; > > didClearAsyncStackTraceData(); > } >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h >index 2a58a8de4f436fa1d49b8992977dfd446a88825d..ca75073990c79dcc2bc182f6e328cedccfe704c5 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h >+++ b/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h >@@ -79,7 +79,7 @@ public: > void stepOut(ErrorString&) final; > void setPauseOnExceptions(ErrorString&, const String& pauseState) final; > void setPauseOnAssertions(ErrorString&, bool enabled) final; >- void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex) final; >+ void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) final; > void setOverlayMessage(ErrorString&, const String*) override; > > bool isPaused() const; >@@ -192,7 +192,7 @@ private: > ShouldDispatchResumed m_conditionToDispatchResumed { ShouldDispatchResumed::No }; > bool m_enablePauseWhenIdle { false }; > HashMap<AsyncCallIdentifier, RefPtr<AsyncStackTrace>> m_pendingAsyncCalls; >- std::optional<AsyncCallIdentifier> m_currentAsyncCallIdentifier { std::nullopt }; >+ Optional<AsyncCallIdentifier> m_currentAsyncCallIdentifier { WTF::nullopt }; > bool m_enabled { false }; > bool m_javaScriptPauseScheduled { false }; > bool m_hasExceptionValue { false }; >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp >index dd23fa07779050c786d96203d01f97bb80e6f432..b00bb9b7475c13ad9c7f2eab076e5628e2c02c91 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp >+++ b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp >@@ -143,30 +143,30 @@ void InspectorHeapAgent::stopTracking(ErrorString& errorString) > m_frontendDispatcher->trackingComplete(timestamp, snapshotData); > } > >-std::optional<HeapSnapshotNode> InspectorHeapAgent::nodeForHeapObjectIdentifier(ErrorString& errorString, unsigned heapObjectIdentifier) >+Optional<HeapSnapshotNode> InspectorHeapAgent::nodeForHeapObjectIdentifier(ErrorString& errorString, unsigned heapObjectIdentifier) > { > HeapProfiler* heapProfiler = m_environment.vm().heapProfiler(); > if (!heapProfiler) { > errorString = "No heap snapshot"_s; >- return std::nullopt; >+ return WTF::nullopt; > } > > HeapSnapshot* snapshot = heapProfiler->mostRecentSnapshot(); > if (!snapshot) { > errorString = "No heap snapshot"_s; >- return std::nullopt; >+ return WTF::nullopt; > } > >- const std::optional<HeapSnapshotNode> optionalNode = snapshot->nodeForObjectIdentifier(heapObjectIdentifier); >+ const Optional<HeapSnapshotNode> optionalNode = snapshot->nodeForObjectIdentifier(heapObjectIdentifier); > if (!optionalNode) { > errorString = "No object for identifier, it may have been collected"_s; >- return std::nullopt; >+ return WTF::nullopt; > } > > return optionalNode; > } > >-void InspectorHeapAgent::getPreview(ErrorString& errorString, int heapObjectId, std::optional<String>& resultString, RefPtr<Protocol::Debugger::FunctionDetails>& functionDetails, RefPtr<Protocol::Runtime::ObjectPreview>& objectPreview) >+void InspectorHeapAgent::getPreview(ErrorString& errorString, int heapObjectId, Optional<String>& resultString, RefPtr<Protocol::Debugger::FunctionDetails>& functionDetails, RefPtr<Protocol::Runtime::ObjectPreview>& objectPreview) > { > // Prevent the cell from getting collected as we look it up. > VM& vm = m_environment.vm(); >@@ -174,7 +174,7 @@ void InspectorHeapAgent::getPreview(ErrorString& errorString, int heapObjectId, > DeferGC deferGC(vm.heap); > > unsigned heapObjectIdentifier = static_cast<unsigned>(heapObjectId); >- const std::optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier); >+ const Optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier); > if (!optionalNode) > return; > >@@ -223,7 +223,7 @@ void InspectorHeapAgent::getRemoteObject(ErrorString& errorString, int heapObjec > DeferGC deferGC(vm.heap); > > unsigned heapObjectIdentifier = static_cast<unsigned>(heapObjectId); >- const std::optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier); >+ const Optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier); > if (!optionalNode) > return; > >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h >index de6dda93d3038b3034a36d41760af033a0ea6e24..743c3989e6afe2100de2576d48321a7f26d82dd4 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h >+++ b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h >@@ -59,7 +59,7 @@ public: > void snapshot(ErrorString&, double* timestamp, String* snapshotData) final; > void startTracking(ErrorString&) final; > void stopTracking(ErrorString&) final; >- void getPreview(ErrorString&, int heapObjectId, std::optional<String>& resultString, RefPtr<Protocol::Debugger::FunctionDetails>&, RefPtr<Protocol::Runtime::ObjectPreview>&) final; >+ void getPreview(ErrorString&, int heapObjectId, Optional<String>& resultString, RefPtr<Protocol::Debugger::FunctionDetails>&, RefPtr<Protocol::Runtime::ObjectPreview>&) final; > void getRemoteObject(ErrorString&, int heapObjectId, const String* optionalObjectGroup, RefPtr<Protocol::Runtime::RemoteObject>& result) final; > > // HeapObserver >@@ -72,7 +72,7 @@ protected: > virtual void dispatchGarbageCollectedEvent(Protocol::Heap::GarbageCollection::Type, Seconds startTime, Seconds endTime); > > private: >- std::optional<JSC::HeapSnapshotNode> nodeForHeapObjectIdentifier(ErrorString&, unsigned heapObjectIdentifier); >+ Optional<JSC::HeapSnapshotNode> nodeForHeapObjectIdentifier(ErrorString&, unsigned heapObjectIdentifier); > > InjectedScriptManager& m_injectedScriptManager; > std::unique_ptr<HeapFrontendDispatcher> m_frontendDispatcher; >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp >index 627975b71339c559369205ceed8a903320bebe61..d68bb41b7e3c1921b6c999a247e45ba97853fd68 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp >+++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp >@@ -83,7 +83,7 @@ static Ref<Protocol::Runtime::ErrorRange> buildErrorRangeObject(const JSTokenLoc > .release(); > } > >-void InspectorRuntimeAgent::parse(ErrorString&, const String& expression, Protocol::Runtime::SyntaxErrorType* result, std::optional<String>& message, RefPtr<Protocol::Runtime::ErrorRange>& range) >+void InspectorRuntimeAgent::parse(ErrorString&, const String& expression, Protocol::Runtime::SyntaxErrorType* result, Optional<String>& message, RefPtr<Protocol::Runtime::ErrorRange>& range) > { > JSLockHolder lock(m_vm); > >@@ -111,7 +111,7 @@ void InspectorRuntimeAgent::parse(ErrorString&, const String& expression, Protoc > } > } > >-void InspectorRuntimeAgent::evaluate(ErrorString& errorString, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex) >+void InspectorRuntimeAgent::evaluate(ErrorString& errorString, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) > { > InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId); > if (injectedScript.hasNoValue()) >@@ -139,7 +139,7 @@ void InspectorRuntimeAgent::awaitPromise(const String& promiseObjectId, const bo > return; > } > >- injectedScript.awaitPromise(promiseObjectId, asBool(returnByValue), asBool(generatePreview), asBool(saveResult), [callback = WTFMove(callback)] (ErrorString& errorString, RefPtr<Protocol::Runtime::RemoteObject>&& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex) { >+ injectedScript.awaitPromise(promiseObjectId, asBool(returnByValue), asBool(generatePreview), asBool(saveResult), [callback = WTFMove(callback)] (ErrorString& errorString, RefPtr<Protocol::Runtime::RemoteObject>&& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) { > if (!errorString.isEmpty()) > callback->sendFailure(errorString); > else >@@ -147,7 +147,7 @@ void InspectorRuntimeAgent::awaitPromise(const String& promiseObjectId, const bo > }); > } > >-void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown) >+void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown) > { > InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); > if (injectedScript.hasNoValue()) { >@@ -240,7 +240,7 @@ void InspectorRuntimeAgent::getCollectionEntries(ErrorString& errorString, const > injectedScript.getCollectionEntries(errorString, objectId, objectGroup ? *objectGroup : String(), start, fetch, entries); > } > >-void InspectorRuntimeAgent::saveResult(ErrorString& errorString, const JSON::Object& callArgument, const int* executionContextId, std::optional<int>& savedResultIndex) >+void InspectorRuntimeAgent::saveResult(ErrorString& errorString, const JSON::Object& callArgument, const int* executionContextId, Optional<int>& savedResultIndex) > { > InjectedScript injectedScript; > >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h >index ab6d7fc856bbf8f62250243cfd5c2e8231884b0c..b6e2ad08316e7fe389be6c75b9a1a3c5fe1e8ee5 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h >+++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h >@@ -57,16 +57,16 @@ public: > > void enable(ErrorString&) override { m_enabled = true; } > void disable(ErrorString&) override { m_enabled = false; } >- void parse(ErrorString&, const String& expression, Protocol::Runtime::SyntaxErrorType* result, std::optional<String>& message, RefPtr<Protocol::Runtime::ErrorRange>&) final; >- void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown, std::optional<int>& savedResultIndex) final; >+ void parse(ErrorString&, const String& expression, Protocol::Runtime::SyntaxErrorType* result, Optional<String>& message, RefPtr<Protocol::Runtime::ErrorRange>&) final; >+ void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) final; > void awaitPromise(const String& promiseObjectId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, Ref<AwaitPromiseCallback>&&) final; >- void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, std::optional<bool>& wasThrown) final; >+ void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown) final; > void releaseObject(ErrorString&, const ErrorString& objectId) final; > void getPreview(ErrorString&, const String& objectId, RefPtr<Protocol::Runtime::ObjectPreview>&) final; > void getProperties(ErrorString&, const String& objectId, const bool* ownProperties, const bool* generatePreview, RefPtr<JSON::ArrayOf<Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<JSON::ArrayOf<Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties) final; > void getDisplayableProperties(ErrorString&, const String& objectId, const bool* generatePreview, RefPtr<JSON::ArrayOf<Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<JSON::ArrayOf<Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties) final; > void getCollectionEntries(ErrorString&, const String& objectId, const String* objectGroup, const int* startIndex, const int* numberToFetch, RefPtr<JSON::ArrayOf<Protocol::Runtime::CollectionEntry>>& entries) final; >- void saveResult(ErrorString&, const JSON::Object& callArgument, const int* executionContextId, std::optional<int>& savedResultIndex) final; >+ void saveResult(ErrorString&, const JSON::Object& callArgument, const int* executionContextId, Optional<int>& savedResultIndex) final; > void releaseObjectGroup(ErrorString&, const String& objectGroup) final; > void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const JSON::Array& locations, RefPtr<JSON::ArrayOf<Protocol::Runtime::TypeDescription>>&) override; > void enableTypeProfiler(ErrorString&) override; >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h >index 854c9828ae3b890ec753ff3403fa08b4e684f3ab..8b0e14babb5dd0d0682ebc818c0e6e7f2567532d 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h >+++ b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h >@@ -65,7 +65,7 @@ public: > void close(); > void targetClosed(); > >- std::optional<unsigned> targetIdentifier() const; >+ Optional<unsigned> targetIdentifier() const; > #if PLATFORM(COCOA) > NSString *connectionIdentifier() const; > NSString *destination() const; >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp b/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp >index ce51b6eb0e637f5d554c510859bb376dcf582c01..3b10f29105ce426b7b6eca4388dfa7c662bf189d 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp >+++ b/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp >@@ -130,7 +130,7 @@ void RemoteInspector::updateClientCapabilities() > std::lock_guard<Lock> lock(m_mutex); > > if (!m_client) >- m_clientCapabilities = std::nullopt; >+ m_clientCapabilities = WTF::nullopt; > else { > RemoteInspector::Client::Capabilities updatedCapabilities = { > m_client->remoteAutomationAllowed(), >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteInspector.h b/Source/JavaScriptCore/inspector/remote/RemoteInspector.h >index 0eba5a68d8642624bf57fc4d8a16c02189c800e3..389e843fab6e39757bb940f95561923cae483eac 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteInspector.h >+++ b/Source/JavaScriptCore/inspector/remote/RemoteInspector.h >@@ -79,8 +79,8 @@ public: > Vector<std::pair<String, String>> certificates; > #endif > #if PLATFORM(COCOA) >- std::optional<bool> allowInsecureMediaCapture; >- std::optional<bool> suppressICECandidateFiltering; >+ Optional<bool> allowInsecureMediaCapture; >+ Optional<bool> suppressICECandidateFiltering; > #endif > }; > >@@ -103,7 +103,7 @@ public: > RemoteInspector::Client* client() const { return m_client; } > void setClient(RemoteInspector::Client*); > void clientCapabilitiesDidChange(); >- std::optional<RemoteInspector::Client::Capabilities> clientCapabilities() const { return m_clientCapabilities; } >+ Optional<RemoteInspector::Client::Capabilities> clientCapabilities() const { return m_clientCapabilities; } > > void setupFailed(unsigned targetIdentifier); > void setupCompleted(unsigned targetIdentifier); >@@ -206,7 +206,7 @@ private: > #endif > > RemoteInspector::Client* m_client { nullptr }; >- std::optional<RemoteInspector::Client::Capabilities> m_clientCapabilities; >+ Optional<RemoteInspector::Client::Capabilities> m_clientCapabilities; > > #if PLATFORM(COCOA) > dispatch_queue_t m_xpcQueue; >diff --git a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm >index 4a3426955ab0fad09437727fadf9f58fc682d15d..87215c33ae5923c15a5cd4de6f2c389fb22b1548 100644 >--- a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm >+++ b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm >@@ -120,9 +120,9 @@ RemoteConnectionToTarget::~RemoteConnectionToTarget() > teardownRunLoop(); > } > >-std::optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const >+Optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const > { >- return m_target ? std::optional<unsigned>(m_target->targetIdentifier()) : std::nullopt; >+ return m_target ? Optional<unsigned>(m_target->targetIdentifier()) : WTF::nullopt; > } > > NSString *RemoteConnectionToTarget::connectionIdentifier() const >diff --git a/Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp b/Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp >index 13e3930b3bfc201a896f81150d8cea10f060f709..3b5c681555a0bfff203f697e498522820ad9fe5d 100644 >--- a/Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp >+++ b/Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp >@@ -106,9 +106,9 @@ void RemoteConnectionToTarget::targetClosed() > m_target = nullptr; > } > >-std::optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const >+Optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const > { >- return m_target ? std::optional<unsigned>(m_target->targetIdentifier()) : std::nullopt; >+ return m_target ? Optional<unsigned>(m_target->targetIdentifier()) : WTF::nullopt; > } > > void RemoteConnectionToTarget::sendMessageToFrontend(const String& message) >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py b/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py >index 4e9870514d5754a41b69dc15a86beb1a8c6e81ae..226c0ca637b05bf9941878f8fc804c4983813530 100644 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py >@@ -211,7 +211,7 @@ class CppGenerator(Generator): > if isinstance(_type, PrimitiveType): > cpp_name = CppGenerator.cpp_name_for_primitive_type(_type) > if parameter.is_optional: >- return "std::optional<%s>&" % cpp_name >+ return "Optional<%s>&" % cpp_name > else: > return '%s*' % cpp_name > if isinstance(_type, EnumType): >@@ -237,7 +237,7 @@ class CppGenerator(Generator): > if isinstance(_type, PrimitiveType): > cpp_name = CppGenerator.cpp_name_for_primitive_type(_type) > if parameter.is_optional: >- return "std::optional<%s>&" % cpp_name >+ return "Optional<%s>&" % cpp_name > elif _type.qualified_name() in ['integer', 'number']: > return CppGenerator.cpp_name_for_primitive_type(_type) > elif _type.qualified_name() in ['string']: >@@ -269,7 +269,7 @@ class CppGenerator(Generator): > if _type.qualified_name() in ['any', 'object']: > return "RefPtr<%s>" % CppGenerator.cpp_name_for_primitive_type(_type) > elif parameter.is_optional and _type.qualified_name() not in ['boolean', 'string', 'integer']: >- return "std::optional<%s>" % cpp_name >+ return "Optional<%s>" % cpp_name > else: > return cpp_name > >@@ -281,12 +281,12 @@ class CppGenerator(Generator): > if isinstance(_type, AliasedType): > builder_type = CppGenerator.cpp_protocol_type_for_type(_type) > if parameter.is_optional: >- return "std::optional<%s>" % builder_type >+ return "Optional<%s>" % builder_type > return '%s' % builder_type > if isinstance(_type, PrimitiveType): > cpp_name = CppGenerator.cpp_name_for_primitive_type(_type) > if parameter.is_optional: >- return "std::optional<%s>" % cpp_name >+ return "Optional<%s>" % cpp_name > else: > return cpp_name > if isinstance(_type, EnumType): >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py >index 844aa7d32cc411d600c12b35c04e0d23d043cb98..871f6a58b45c77182b5eaa1376ad696ea614b93e 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py >@@ -382,11 +382,11 @@ class CppProtocolTypesHeaderGenerator(CppGenerator): > 'namespace %s {' % self.helpers_namespace(), > '', > 'template<typename ProtocolEnumType>', >- 'std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);', >+ 'Optional<ProtocolEnumType> parseEnumValueFromString(const String&);', > ])) > > def return_type_with_export_macro(cpp_protocol_type): >- enum_return_type = 'std::optional<%s>' % cpp_protocol_type >+ enum_return_type = 'Optional<%s>' % cpp_protocol_type > result_terms = [enum_return_type] > export_macro = self.model().framework.setting('export_macro', None) > if export_macro is not None: >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py >index 0800d05c3bf65c88013112537078eaff83ee26c7..863553c6e3e17966dbfe0db298af8f50b28f4418 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py >@@ -111,7 +111,7 @@ class CppProtocolTypesImplementationGenerator(CppGenerator): > body_lines = [] > body_lines.extend([ > 'template<>', >- 'std::optional<%s> parseEnumValueFromString<%s>(const String& protocolString)' % (cpp_protocol_type, cpp_protocol_type), >+ 'Optional<%s> parseEnumValueFromString<%s>(const String& protocolString)' % (cpp_protocol_type, cpp_protocol_type), > '{', > ' static const size_t constantValues[] = {', > ]) >@@ -126,7 +126,7 @@ class CppProtocolTypesImplementationGenerator(CppGenerator): > ' if (protocolString == enum_constant_values[constantValues[i]])', > ' return (%s)constantValues[i];' % cpp_protocol_type, > '', >- ' return std::nullopt;', >+ ' return WTF::nullopt;', > '}', > '', > ]) >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py >index 76907bac6d97bf5ebb545416885e41e7ecea9658..cc0ebdaeff64d8ab1dca8be98adefdfd91473e3b 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py >@@ -176,7 +176,7 @@ class ObjCBackendDispatcherImplementationGenerator(ObjCGenerator): > objc_in_param_name = 'o_%s' % in_param_name > objc_type = self.objc_type_for_param(domain, command.command_name, parameter, False) > if isinstance(parameter.type, EnumType): >- objc_type = 'std::optional<%s>' % objc_type >+ objc_type = 'Optional<%s>' % objc_type > param_expression = in_param_expression(in_param_name, parameter) > import_expression = self.objc_protocol_import_expression_for_parameter(param_expression, domain, command.command_name, parameter) > if not parameter.is_optional: >@@ -206,7 +206,7 @@ class ObjCBackendDispatcherImplementationGenerator(ObjCGenerator): > objc_in_param_expression = 'o_%s' % in_param_name > if not parameter.is_optional: > # FIXME: we don't handle optional enum values in commands here because it isn't used anywhere yet. >- # We'd need to change the delegate's signature to take std::optional for optional enum values. >+ # We'd need to change the delegate's signature to take Optional for optional enum values. > if isinstance(parameter.type, EnumType): > objc_in_param_expression = '%s.value()' % objc_in_param_expression > >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py >index ce12a3a1ba1461ca2db5cb24243c799d81b48fd3..2571f4b22a869d857448a2885521b9f2040c1986 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py >@@ -161,11 +161,11 @@ class ObjCProtocolTypeConversionsHeaderGenerator(ObjCGenerator): > def _generate_enum_from_protocol_string(self, objc_enum_name, enum_values): > lines = [] > lines.append('template<>') >- lines.append('inline std::optional<%s> fromProtocolString(const String& value)' % objc_enum_name) >+ lines.append('inline Optional<%s> fromProtocolString(const String& value)' % objc_enum_name) > lines.append('{') > for enum_value in enum_values: > lines.append(' if (value == "%s")' % enum_value) > lines.append(' return %s%s;' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_value))) >- lines.append(' return std::nullopt;') >+ lines.append(' return WTF::nullopt;') > lines.append('}') > return '\n'.join(lines) >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py >index 3d84bf04bf23579e934288bbd7818c3c4572ff13..a36d813eceeea114be94bf61d5f6a5532fdfe154 100644 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py >@@ -131,7 +131,7 @@ class ObjCProtocolTypeConversionsImplementationGenerator(ObjCGenerator): > lines.append('{') > if isinstance(resolved_type, EnumType): > lines.append(' THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);') >- lines.append(' std::optional<%(type)s> result = Inspector::fromProtocolString<%(type)s>(payload);' % {'type': self.objc_name_for_type(resolved_type)}) >+ lines.append(' Optional<%(type)s> result = Inspector::fromProtocolString<%(type)s>(payload);' % {'type': self.objc_name_for_type(resolved_type)}) > lines.append(' THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"%s");' % declaration.type.raw_name()) > lines.append(' *outValue = @(result.value());') > elif isinstance(resolved_type, (ArrayType, PrimitiveType)): >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py >index 9cd98d7cda7f73d501a907a2b6f5382f84f9600e..c870881abd80d2b6edaa8812598c836283a665b0 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py >@@ -143,7 +143,7 @@ class ObjCProtocolTypesImplementationGenerator(ObjCGenerator): > var_name = ObjCGenerator.identifier_to_objc_identifier(member_name) > conversion_expression = self.payload_to_objc_expression_for_member(declaration, member) > if isinstance(member.type, EnumType): >- lines.append(' std::optional<%s> %s = %s;' % (objc_type, var_name, conversion_expression)) >+ lines.append(' Optional<%s> %s = %s;' % (objc_type, var_name, conversion_expression)) > if not member.is_optional: > lines.append(' THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(%s, @"%s");' % (var_name, member_name)) > lines.append(' self.%s = %s.value();' % (var_name, var_name)) >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py b/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py >index 6fc2b1d3633d1f1ddeca39415f8f51c09baf8910..50c8f6fde7ce6898b082814997be57d73019b253 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py >@@ -55,7 +55,7 @@ namespace Inspector {""") > > TypeConversionsHeaderStandard = ( > """template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value);""") >+Optional<ObjCEnumType> fromProtocolString(const String& value);""") > > BackendDispatcherHeaderPrelude = ( > """${includes} >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result b/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result >index 0eb7d2f5d7862cb48ab53d9d6c7f1eb09a52ec49..af3f8de75b767c6fc429736e93f64b55e0228fe2 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result >@@ -1006,7 +1006,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1023,7 +1023,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1033,7 +1033,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result >index 9a4d9771f878e6684228f678c7181a72706af3b7..8cfae4918e7a33b5bdfb2262a1485cb3a552799a 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result >@@ -157,11 +157,11 @@ public: > Yellow = 5, > Black = 6, > }; // enum class PrintColor >- virtual void executeSQLSyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, RefPtr<JSON::ArrayOf<String>>& opt_out_columnNames, std::optional<String>& opt_out_notes, std::optional<double>& opt_out_timestamp, std::optional<JSON::Object>& opt_out_values, std::optional<JSON::Value>& opt_out_payload, std::optional<int>& opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0; >+ virtual void executeSQLSyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, RefPtr<JSON::ArrayOf<String>>& opt_out_columnNames, Optional<String>& opt_out_notes, Optional<double>& opt_out_timestamp, Optional<JSON::Object>& opt_out_values, Optional<JSON::Value>& opt_out_payload, Optional<int>& opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0; > class ExecuteSQLAsyncOptionalReturnValuesCallback : public BackendDispatcher::CallbackBase { > public: > ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&&, int id); >- void sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, std::optional<String>& notes, std::optional<double>& timestamp, std::optional<JSON::Object>& values, std::optional<JSON::Value>& payload, std::optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, std::optional<String>& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, std::optional<String>& printColor); >+ void sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, Optional<String>& notes, Optional<double>& timestamp, Optional<JSON::Object>& values, Optional<JSON::Value>& payload, Optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Optional<String>& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Optional<String>& printColor); > }; > virtual void executeSQLAsyncOptionalReturnValues(int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncOptionalReturnValuesCallback>&& callback) = 0; > virtual void executeSQLSync(ErrorString&, int in_databaseId, const String& in_query, RefPtr<JSON::ArrayOf<String>>& out_columnNames, String* out_notes, double* out_timestamp, JSON::Object* out_values, JSON::Value* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, RefPtr<Inspector::Protocol::Database::ColorList>& out_alternateColors, Inspector::Protocol::Database::PrimaryColors* out_screenColor, DatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0; >@@ -295,11 +295,11 @@ void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestI > ErrorString error; > Ref<JSON::Object> result = JSON::Object::create(); > RefPtr<JSON::ArrayOf<String>> out_columnNames; >- std::optional<String> out_notes; >- std::optional<double> out_timestamp; >- std::optional<JSON::Object> out_values; >- std::optional<JSON::Value> out_payload; >- std::optional<int> out_databaseId; >+ Optional<String> out_notes; >+ Optional<double> out_timestamp; >+ Optional<JSON::Object> out_values; >+ Optional<JSON::Value> out_payload; >+ Optional<int> out_databaseId; > RefPtr<Inspector::Protocol::Database::Error> out_sqlError; > Inspector::Protocol::Database::PrimaryColors out_screenColor; > RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors; >@@ -336,7 +336,7 @@ void DatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long requestI > > DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<BackendDispatcher>&& backendDispatcher, int id) : BackendDispatcher::CallbackBase(WTFMove(backendDispatcher), id) { } > >-void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, std::optional<String>& notes, std::optional<double>& timestamp, std::optional<JSON::Object>& values, std::optional<JSON::Value>& payload, std::optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, std::optional<String>& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, std::optional<String>& printColor) >+void DatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(RefPtr<JSON::ArrayOf<String>>&& columnNames, Optional<String>& notes, Optional<double>& timestamp, Optional<JSON::Object>& values, Optional<JSON::Value>& payload, Optional<int>& databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Optional<String>& screenColor, RefPtr<Inspector::Protocol::Database::ColorList>&& alternateColors, Optional<String>& printColor) > { > Ref<JSON::Object> jsonMessage = JSON::Object::create(); > if (columnNames) >@@ -709,11 +709,11 @@ public: > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'Database' Domain > template<> >-std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); > > } // namespace TestHelpers > >@@ -793,7 +793,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'Database' Domain > template<> >-std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Database::PrimaryColors::Red, >@@ -804,7 +804,7 @@ std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromSt > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Database::PrimaryColors)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1423,7 +1423,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1440,7 +1440,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1450,7 +1450,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1467,7 +1467,7 @@ inline String toProtocolString(TestProtocolDatabasePrimaryColors value) > } > > template<> >-inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) > { > if (value == "red") > return TestProtocolDatabasePrimaryColorsRed; >@@ -1475,7 +1475,7 @@ inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const > return TestProtocolDatabasePrimaryColorsGreen; > if (value == "blue") > return TestProtocolDatabasePrimaryColorsBlue; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor value) >@@ -1493,7 +1493,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteSQLSyncOptionalReturnV > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan; >@@ -1503,7 +1503,7 @@ inline std::optional<TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrint > return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor value) >@@ -1521,7 +1521,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteSQLAsyncOptionalReturn > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan; >@@ -1531,7 +1531,7 @@ inline std::optional<TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrin > return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteSQLSyncPrintColor value) >@@ -1549,7 +1549,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteSQLSyncPrintColor valu > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteSQLSyncPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteSQLSyncPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteSQLSyncPrintColorCyan; >@@ -1559,7 +1559,7 @@ inline std::optional<TestProtocolDatabaseExecuteSQLSyncPrintColor> fromProtocolS > return TestProtocolDatabaseExecuteSQLSyncPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteSQLSyncPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteSQLAsyncPrintColor value) >@@ -1577,7 +1577,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteSQLAsyncPrintColor val > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteSQLAsyncPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteSQLAsyncPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteSQLAsyncPrintColorCyan; >@@ -1587,7 +1587,7 @@ inline std::optional<TestProtocolDatabaseExecuteSQLAsyncPrintColor> fromProtocol > return TestProtocolDatabaseExecuteSQLAsyncPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteSQLAsyncPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >@@ -1653,7 +1653,7 @@ using namespace Inspector; > + (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); >+ Optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"PrimaryColors"); > *outValue = @(result.value()); > } >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result >index 3ebce2b82521df4cb480ce2ceab9906381eaac74..4277eca6fe364f2c2b955aad8d151498aa62e37c 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result >@@ -152,7 +152,7 @@ public: > Yellow = 5, > Black = 6, > }; // enum class PrintColor >- virtual void executeAllOptionalParameters(ErrorString&, const JSON::Array* opt_in_columnNames, const String* opt_in_notes, const double* opt_in_timestamp, const JSON::Object* opt_in_values, const JSON::Value* opt_in_payload, const int* opt_in_databaseId, const JSON::Object* opt_in_sqlError, const String* opt_in_screenColor, const JSON::Array* opt_in_alternateColors, const String* opt_in_printColor, RefPtr<JSON::ArrayOf<String>>& opt_out_columnNames, std::optional<String>& opt_out_notes, std::optional<double>& opt_out_timestamp, std::optional<JSON::Object>& opt_out_values, std::optional<JSON::Value>& opt_out_payload, std::optional<int>& opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0; >+ virtual void executeAllOptionalParameters(ErrorString&, const JSON::Array* opt_in_columnNames, const String* opt_in_notes, const double* opt_in_timestamp, const JSON::Object* opt_in_values, const JSON::Value* opt_in_payload, const int* opt_in_databaseId, const JSON::Object* opt_in_sqlError, const String* opt_in_screenColor, const JSON::Array* opt_in_alternateColors, const String* opt_in_printColor, RefPtr<JSON::ArrayOf<String>>& opt_out_columnNames, Optional<String>& opt_out_notes, Optional<double>& opt_out_timestamp, Optional<JSON::Object>& opt_out_values, Optional<JSON::Value>& opt_out_payload, Optional<int>& opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& opt_out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0; > virtual void executeNoOptionalParameters(ErrorString&, const JSON::Array& in_columnNames, const String& in_notes, double in_timestamp, const JSON::Object& in_values, JSON::Value in_payload, int in_databaseId, const JSON::Object& in_sqlError, const String& in_screenColor, const JSON::Array& in_alternateColors, const String& in_printColor, RefPtr<JSON::ArrayOf<String>>& out_columnNames, String* out_notes, double* out_timestamp, JSON::Object* out_values, JSON::Value* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, Inspector::Protocol::Database::PrimaryColors* out_screenColor, RefPtr<Inspector::Protocol::Database::ColorList>& out_alternateColors, DatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0; > protected: > virtual ~DatabaseBackendDispatcherHandler(); >@@ -260,7 +260,7 @@ void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, Ref > bool opt_in_notes_valueFound = false; > String opt_in_notes = m_backendDispatcher->getString(parameters.get(), "notes"_s, &opt_in_notes_valueFound); > bool opt_in_timestamp_valueFound = false; >- std::optional<double> opt_in_timestamp = m_backendDispatcher->getDouble(parameters.get(), "timestamp"_s, &opt_in_timestamp_valueFound); >+ Optional<double> opt_in_timestamp = m_backendDispatcher->getDouble(parameters.get(), "timestamp"_s, &opt_in_timestamp_valueFound); > bool opt_in_values_valueFound = false; > RefPtr<JSON::Object> opt_in_values = m_backendDispatcher->getObject(parameters.get(), "values"_s, &opt_in_values_valueFound); > bool opt_in_payload_valueFound = false; >@@ -290,11 +290,11 @@ void DatabaseBackendDispatcher::executeAllOptionalParameters(long requestId, Ref > ErrorString error; > Ref<JSON::Object> result = JSON::Object::create(); > RefPtr<JSON::ArrayOf<String>> out_columnNames; >- std::optional<String> out_notes; >- std::optional<double> out_timestamp; >- std::optional<JSON::Object> out_values; >- std::optional<JSON::Value> out_payload; >- std::optional<int> out_databaseId; >+ Optional<String> out_notes; >+ Optional<double> out_timestamp; >+ Optional<JSON::Object> out_values; >+ Optional<JSON::Value> out_payload; >+ Optional<int> out_databaseId; > RefPtr<Inspector::Protocol::Database::Error> out_sqlError; > Inspector::Protocol::Database::PrimaryColors out_screenColor; > RefPtr<Inspector::Protocol::Database::ColorList> out_alternateColors; >@@ -624,11 +624,11 @@ public: > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'Database' Domain > template<> >-std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); > > } // namespace TestHelpers > >@@ -708,7 +708,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'Database' Domain > template<> >-std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Database::PrimaryColors::Red, >@@ -719,7 +719,7 @@ std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromSt > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Database::PrimaryColors)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -884,13 +884,13 @@ void ObjCInspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long r > TestProtocolDatabaseError *o_in_sqlError; > if (in_sqlError) > o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithJSONObject:in_sqlError] autorelease]; >- std::optional<TestProtocolDatabasePrimaryColors> o_in_screenColor; >+ Optional<TestProtocolDatabasePrimaryColors> o_in_screenColor; > if (in_screenColor) > o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(*in_screenColor); > NSArray/*<NSString>*/ *o_in_alternateColors; > if (in_alternateColors) > o_in_alternateColors = toObjCStringArray(in_alternateColors); >- std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> o_in_printColor; >+ Optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> o_in_printColor; > if (in_printColor) > o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor>(*in_printColor); > >@@ -932,13 +932,13 @@ void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long re > RWIProtocolJSONObject *o_in_payload = [[[RWIProtocolJSONObject alloc] initWithJSONObject:&in_payload] autorelease]; > int o_in_databaseId = in_databaseId; > TestProtocolDatabaseError *o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithJSONObject:&in_sqlError] autorelease]; >- std::optional<TestProtocolDatabasePrimaryColors> o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(in_screenColor); >+ Optional<TestProtocolDatabasePrimaryColors> o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(in_screenColor); > if (!o_in_screenColor) { > backendDispatcher()->reportProtocolError(BackendDispatcher::InvalidParams, "Parameter 'screenColor' of method 'Database.executeNoOptionalParameters' cannot be processed"_s); > return; > } > NSArray/*<NSString>*/ *o_in_alternateColors = toObjCStringArray(&in_alternateColors); >- std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor>(in_printColor); >+ Optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor>(in_printColor); > if (!o_in_printColor) { > backendDispatcher()->reportProtocolError(BackendDispatcher::InvalidParams, "Parameter 'printColor' of method 'Database.executeNoOptionalParameters' cannot be processed"_s); > return; >@@ -1300,7 +1300,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1317,7 +1317,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1327,7 +1327,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1344,7 +1344,7 @@ inline String toProtocolString(TestProtocolDatabasePrimaryColors value) > } > > template<> >-inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) > { > if (value == "red") > return TestProtocolDatabasePrimaryColorsRed; >@@ -1352,7 +1352,7 @@ inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const > return TestProtocolDatabasePrimaryColorsGreen; > if (value == "blue") > return TestProtocolDatabasePrimaryColorsBlue; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor value) >@@ -1370,7 +1370,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersP > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan; >@@ -1380,7 +1380,7 @@ inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> > return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersPrintColor value) >@@ -1398,7 +1398,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteAllOptionalParametersP > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan; >@@ -1408,7 +1408,7 @@ inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> > return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor value) >@@ -1426,7 +1426,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPr > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan; >@@ -1436,7 +1436,7 @@ inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> > return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPrintColor value) >@@ -1454,7 +1454,7 @@ inline String toProtocolString(TestProtocolDatabaseExecuteNoOptionalParametersPr > } > > template<> >-inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) > { > if (value == "cyan") > return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan; >@@ -1464,7 +1464,7 @@ inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> > return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorYellow; > if (value == "black") > return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >@@ -1530,7 +1530,7 @@ using namespace Inspector; > + (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); >+ Optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"PrimaryColors"); > *outValue = @(result.value()); > } >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result >index bc579b4a5d6bc8a91af8fc4db2ce406d2eaab9c1..040c743bdb37e91fd139c8cffbce8c058090fe8d 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result >@@ -742,7 +742,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -759,7 +759,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -769,7 +769,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result >index f1ab2ef42f3ac125be7475e81d3a9a6112a52863..cb2fc5afd64926b42fd6d66887cf516448f7ca86 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result >@@ -996,7 +996,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1013,7 +1013,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1023,7 +1023,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result >index c663e65fc2bf3fcc99c2a7ce36c757037d572081..0629ece33ff6d2c63dd54de7e9516dd44e03a614 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result >@@ -1259,7 +1259,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1276,7 +1276,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1286,7 +1286,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result >index a00de438d90c05b6ccf6dd4efa864dadc2ac6a12..f22bf8a72d7397861ed22043924c249010e07cea 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result >@@ -472,11 +472,11 @@ enum class TypeDomainEnum { > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'TypeDomain' Domain > template<> >-std::optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String&); >+Optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String&); > > } // namespace TestHelpers > >@@ -558,7 +558,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'TypeDomain' Domain > template<> >-std::optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String& protocolString) >+Optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Shared, >@@ -570,7 +570,7 @@ std::optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFro > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::TypeDomain::TypeDomainEnum)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1052,7 +1052,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1069,7 +1069,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1079,7 +1079,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1098,7 +1098,7 @@ inline String toProtocolString(TestProtocolTypeDomainEnum value) > } > > template<> >-inline std::optional<TestProtocolTypeDomainEnum> fromProtocolString(const String& value) >+inline Optional<TestProtocolTypeDomainEnum> fromProtocolString(const String& value) > { > if (value == "shared") > return TestProtocolTypeDomainEnumShared; >@@ -1108,7 +1108,7 @@ inline std::optional<TestProtocolTypeDomainEnum> fromProtocolString(const String > return TestProtocolTypeDomainEnumGreen; > if (value == "blue") > return TestProtocolTypeDomainEnumBlue; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >@@ -1165,7 +1165,7 @@ using namespace Inspector; > + (void)_parseTypeDomainEnum:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolTypeDomainEnum> result = Inspector::fromProtocolString<TestProtocolTypeDomainEnum>(payload); >+ Optional<TestProtocolTypeDomainEnum> result = Inspector::fromProtocolString<TestProtocolTypeDomainEnum>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"TypeDomainEnum"); > *outValue = @(result.value()); > } >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result >index ebf6428104ca696925912b77cc89faf463c006c9..91a518b7655a61797319abc2b2bd01d36278587e 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result >@@ -992,7 +992,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1009,7 +1009,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1019,7 +1019,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result >index 050dbe240ce2d1962bfdad9f26ac9c4c158bdb1c..7e3fc81b5621c33ae9f5d8b93c0ae47701251cf5 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result >@@ -1033,7 +1033,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1050,7 +1050,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1060,7 +1060,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result >index 5d4f91cbace25d5ba3bf9d7221ecf032168463b7..17fd92583a672e06de79519336e532af18050634 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result >@@ -752,7 +752,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -769,7 +769,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -779,7 +779,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result >index f52537bfb1ab95db317b1673c74c3a52331f7de4..a1b500f1a6b6650d5404e2a1a14e0fec92449d09 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result >@@ -413,11 +413,11 @@ public: > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'Runtime' Domain > template<> >-std::optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String&); >+Optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String&); > > } // namespace TestHelpers > >@@ -481,7 +481,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'Runtime' Domain > template<> >-std::optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String& protocolString) >+Optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Runtime::KeyPath::Type::Null, >@@ -492,7 +492,7 @@ std::optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromStr > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Runtime::KeyPath::Type)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -889,7 +889,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -906,7 +906,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -916,7 +916,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -933,7 +933,7 @@ inline String toProtocolString(TestProtocolRuntimeKeyPathType value) > } > > template<> >-inline std::optional<TestProtocolRuntimeKeyPathType> fromProtocolString(const String& value) >+inline Optional<TestProtocolRuntimeKeyPathType> fromProtocolString(const String& value) > { > if (value == "null") > return TestProtocolRuntimeKeyPathTypeNull; >@@ -941,7 +941,7 @@ inline std::optional<TestProtocolRuntimeKeyPathType> fromProtocolString(const St > return TestProtocolRuntimeKeyPathTypeString; > if (value == "array") > return TestProtocolRuntimeKeyPathTypeArray; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >@@ -1055,7 +1055,7 @@ using namespace Inspector; > return nil; > > THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"type"], @"type"); >- std::optional<TestProtocolRuntimeKeyPathType> type = fromProtocolString<TestProtocolRuntimeKeyPathType>(payload[@"type"]); >+ Optional<TestProtocolRuntimeKeyPathType> type = fromProtocolString<TestProtocolRuntimeKeyPathType>(payload[@"type"]); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(type, @"type"); > self.type = type.value(); > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result >index 0ca420254899bb8a0e050e41f79170825f1afbdb..c61ce8041eee57571b65bd7fde9e7988fb0a5fd1 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result >@@ -747,7 +747,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -764,7 +764,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -774,7 +774,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result >index 87f9d4f17267a80002ee798d93666aeab69fbb19..307894dfe51424968774e60c14e6713784d3fccf 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result >@@ -364,11 +364,11 @@ enum class Reason { > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'Debugger' Domain > template<> >-std::optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String&); >+Optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String&); > > } // namespace TestHelpers > >@@ -444,7 +444,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'Debugger' Domain > template<> >-std::optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String& protocolString) >+Optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Debugger::Reason::Died, >@@ -455,7 +455,7 @@ std::optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<In > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Debugger::Reason)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -843,7 +843,7 @@ typedef NS_ENUM(NSInteger, TestProtocolDebuggerReason) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -860,7 +860,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -870,7 +870,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -887,7 +887,7 @@ inline String toProtocolString(TestProtocolDebuggerReason value) > } > > template<> >-inline std::optional<TestProtocolDebuggerReason> fromProtocolString(const String& value) >+inline Optional<TestProtocolDebuggerReason> fromProtocolString(const String& value) > { > if (value == "Died") > return TestProtocolDebuggerReasonDied; >@@ -895,7 +895,7 @@ inline std::optional<TestProtocolDebuggerReason> fromProtocolString(const String > return TestProtocolDebuggerReasonFainted; > if (value == "Hungry") > return TestProtocolDebuggerReasonHungry; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -971,7 +971,7 @@ using namespace Inspector; > + (void)_parseReason:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolDebuggerReason> result = Inspector::fromProtocolString<TestProtocolDebuggerReason>(payload); >+ Optional<TestProtocolDebuggerReason> result = Inspector::fromProtocolString<TestProtocolDebuggerReason>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"Reason"); > *outValue = @(result.value()); > } >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result >index f667dd24ebf08bc6c92eabf55e2a5e5e79bb76cc..8a6aab4ef1d4d129af28489ad1bfe081deb4d2fd 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result >@@ -361,13 +361,13 @@ enum class TwoLeggedAnimals { > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'Runtime' Domain > template<> >-std::optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String&); >+Optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String&); > template<> >-std::optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String&); >+Optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String&); > > } // namespace TestHelpers > >@@ -451,7 +451,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'Runtime' Domain > template<> >-std::optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String& protocolString) >+Optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Runtime::FarmAnimals::Pigs, >@@ -463,11 +463,11 @@ std::optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromStrin > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Runtime::FarmAnimals)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> >-std::optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String& protocolString) >+Optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Ducks, >@@ -479,7 +479,7 @@ std::optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFrom > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Runtime::TwoLeggedAnimals)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -875,7 +875,7 @@ typedef NS_ENUM(NSInteger, TestProtocolRuntimeTwoLeggedAnimals) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -892,7 +892,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -902,7 +902,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -921,7 +921,7 @@ inline String toProtocolString(TestProtocolRuntimeFarmAnimals value) > } > > template<> >-inline std::optional<TestProtocolRuntimeFarmAnimals> fromProtocolString(const String& value) >+inline Optional<TestProtocolRuntimeFarmAnimals> fromProtocolString(const String& value) > { > if (value == "Pigs") > return TestProtocolRuntimeFarmAnimalsPigs; >@@ -931,7 +931,7 @@ inline std::optional<TestProtocolRuntimeFarmAnimals> fromProtocolString(const St > return TestProtocolRuntimeFarmAnimalsCats; > if (value == "Hens") > return TestProtocolRuntimeFarmAnimalsHens; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolRuntimeTwoLeggedAnimals value) >@@ -949,7 +949,7 @@ inline String toProtocolString(TestProtocolRuntimeTwoLeggedAnimals value) > } > > template<> >-inline std::optional<TestProtocolRuntimeTwoLeggedAnimals> fromProtocolString(const String& value) >+inline Optional<TestProtocolRuntimeTwoLeggedAnimals> fromProtocolString(const String& value) > { > if (value == "Ducks") > return TestProtocolRuntimeTwoLeggedAnimalsDucks; >@@ -959,7 +959,7 @@ inline std::optional<TestProtocolRuntimeTwoLeggedAnimals> fromProtocolString(con > return TestProtocolRuntimeTwoLeggedAnimalsCrows; > if (value == "Flamingos") > return TestProtocolRuntimeTwoLeggedAnimalsFlamingos; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >@@ -1017,7 +1017,7 @@ using namespace Inspector; > + (void)_parseFarmAnimals:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolRuntimeFarmAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeFarmAnimals>(payload); >+ Optional<TestProtocolRuntimeFarmAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeFarmAnimals>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"FarmAnimals"); > *outValue = @(result.value()); > } >@@ -1025,7 +1025,7 @@ using namespace Inspector; > + (void)_parseTwoLeggedAnimals:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolRuntimeTwoLeggedAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeTwoLeggedAnimals>(payload); >+ Optional<TestProtocolRuntimeTwoLeggedAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeTwoLeggedAnimals>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"TwoLeggedAnimals"); > *outValue = @(result.value()); > } >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result >index ac7adc71d792e118a3a8099270df5302a60e9b63..43e6fa4c2e397c2b88edcf243995455d96184594 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result >@@ -878,19 +878,19 @@ public: > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'Database' Domain > template<> >-std::optional<Inspector::Protocol::Database::MouseButton> parseEnumValueFromString<Inspector::Protocol::Database::MouseButton>(const String&); >+Optional<Inspector::Protocol::Database::MouseButton> parseEnumValueFromString<Inspector::Protocol::Database::MouseButton>(const String&); > template<> >-std::optional<Inspector::Protocol::Database::OptionalParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::OptionalParameterBundle::Directionality>(const String&); >+Optional<Inspector::Protocol::Database::OptionalParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::OptionalParameterBundle::Directionality>(const String&); > template<> >-std::optional<Inspector::Protocol::Database::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::ParameterBundle::Directionality>(const String&); >+Optional<Inspector::Protocol::Database::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::ParameterBundle::Directionality>(const String&); > > // Enums in the 'Test' Domain > template<> >-std::optional<Inspector::Protocol::Test::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Test::ParameterBundle::Directionality>(const String&); >+Optional<Inspector::Protocol::Test::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Test::ParameterBundle::Directionality>(const String&); > > } // namespace TestHelpers > >@@ -969,7 +969,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'Database' Domain > template<> >-std::optional<Inspector::Protocol::Database::MouseButton> parseEnumValueFromString<Inspector::Protocol::Database::MouseButton>(const String& protocolString) >+Optional<Inspector::Protocol::Database::MouseButton> parseEnumValueFromString<Inspector::Protocol::Database::MouseButton>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Database::MouseButton::None, >@@ -981,11 +981,11 @@ std::optional<Inspector::Protocol::Database::MouseButton> parseEnumValueFromStri > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Database::MouseButton)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> >-std::optional<Inspector::Protocol::Database::OptionalParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::OptionalParameterBundle::Directionality>(const String& protocolString) >+Optional<Inspector::Protocol::Database::OptionalParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::OptionalParameterBundle::Directionality>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Database::OptionalParameterBundle::Directionality::LTR, >@@ -995,11 +995,11 @@ std::optional<Inspector::Protocol::Database::OptionalParameterBundle::Directiona > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Database::OptionalParameterBundle::Directionality)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> >-std::optional<Inspector::Protocol::Database::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::ParameterBundle::Directionality>(const String& protocolString) >+Optional<Inspector::Protocol::Database::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Database::ParameterBundle::Directionality>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Database::ParameterBundle::Directionality::LTR, >@@ -1009,13 +1009,13 @@ std::optional<Inspector::Protocol::Database::ParameterBundle::Directionality> pa > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Database::ParameterBundle::Directionality)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > > // Enums in the 'Test' Domain > template<> >-std::optional<Inspector::Protocol::Test::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Test::ParameterBundle::Directionality>(const String& protocolString) >+Optional<Inspector::Protocol::Test::ParameterBundle::Directionality> parseEnumValueFromString<Inspector::Protocol::Test::ParameterBundle::Directionality>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Test::ParameterBundle::Directionality::LTR, >@@ -1025,7 +1025,7 @@ std::optional<Inspector::Protocol::Test::ParameterBundle::Directionality> parseE > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Test::ParameterBundle::Directionality)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1506,7 +1506,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1523,7 +1523,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1533,7 +1533,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1552,7 +1552,7 @@ inline String toProtocolString(TestProtocolDatabaseMouseButton value) > } > > template<> >-inline std::optional<TestProtocolDatabaseMouseButton> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseMouseButton> fromProtocolString(const String& value) > { > if (value == "None") > return TestProtocolDatabaseMouseButtonNone; >@@ -1562,7 +1562,7 @@ inline std::optional<TestProtocolDatabaseMouseButton> fromProtocolString(const S > return TestProtocolDatabaseMouseButtonMiddle; > if (value == "Right") > return TestProtocolDatabaseMouseButtonRight; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseOptionalParameterBundleDirectionality value) >@@ -1576,13 +1576,13 @@ inline String toProtocolString(TestProtocolDatabaseOptionalParameterBundleDirect > } > > template<> >-inline std::optional<TestProtocolDatabaseOptionalParameterBundleDirectionality> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseOptionalParameterBundleDirectionality> fromProtocolString(const String& value) > { > if (value == "LTR") > return TestProtocolDatabaseOptionalParameterBundleDirectionalityLTR; > if (value == "RTL") > return TestProtocolDatabaseOptionalParameterBundleDirectionalityRTL; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolDatabaseParameterBundleDirectionality value) >@@ -1596,13 +1596,13 @@ inline String toProtocolString(TestProtocolDatabaseParameterBundleDirectionality > } > > template<> >-inline std::optional<TestProtocolDatabaseParameterBundleDirectionality> fromProtocolString(const String& value) >+inline Optional<TestProtocolDatabaseParameterBundleDirectionality> fromProtocolString(const String& value) > { > if (value == "LTR") > return TestProtocolDatabaseParameterBundleDirectionalityLTR; > if (value == "RTL") > return TestProtocolDatabaseParameterBundleDirectionalityRTL; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1617,13 +1617,13 @@ inline String toProtocolString(TestProtocolTestParameterBundleDirectionality val > } > > template<> >-inline std::optional<TestProtocolTestParameterBundleDirectionality> fromProtocolString(const String& value) >+inline Optional<TestProtocolTestParameterBundleDirectionality> fromProtocolString(const String& value) > { > if (value == "LTR") > return TestProtocolTestParameterBundleDirectionalityLTR; > if (value == "RTL") > return TestProtocolTestParameterBundleDirectionalityRTL; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >@@ -1703,7 +1703,7 @@ using namespace Inspector; > + (void)_parseMouseButton:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolDatabaseMouseButton> result = Inspector::fromProtocolString<TestProtocolDatabaseMouseButton>(payload); >+ Optional<TestProtocolDatabaseMouseButton> result = Inspector::fromProtocolString<TestProtocolDatabaseMouseButton>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"MouseButton"); > *outValue = @(result.value()); > } >@@ -1856,7 +1856,7 @@ using namespace Inspector; > > self.buttons = payload[@"buttons"]; > >- std::optional<TestProtocolDatabaseOptionalParameterBundleDirectionality> directionality = fromProtocolString<TestProtocolDatabaseOptionalParameterBundleDirectionality>(payload[@"directionality"]); >+ Optional<TestProtocolDatabaseOptionalParameterBundleDirectionality> directionality = fromProtocolString<TestProtocolDatabaseOptionalParameterBundleDirectionality>(payload[@"directionality"]); > if (directionality) > self.directionality = directionality.value(); > >@@ -1998,7 +1998,7 @@ using namespace Inspector; > self.buttons = payload[@"buttons"]; > > THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"directionality"], @"directionality"); >- std::optional<TestProtocolDatabaseParameterBundleDirectionality> directionality = fromProtocolString<TestProtocolDatabaseParameterBundleDirectionality>(payload[@"directionality"]); >+ Optional<TestProtocolDatabaseParameterBundleDirectionality> directionality = fromProtocolString<TestProtocolDatabaseParameterBundleDirectionality>(payload[@"directionality"]); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(directionality, @"directionality"); > self.directionality = directionality.value(); > >@@ -2291,7 +2291,7 @@ using namespace Inspector; > return nil; > > THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"directionality"], @"directionality"); >- std::optional<TestProtocolTestParameterBundleDirectionality> directionality = fromProtocolString<TestProtocolTestParameterBundleDirectionality>(payload[@"directionality"]); >+ Optional<TestProtocolTestParameterBundleDirectionality> directionality = fromProtocolString<TestProtocolTestParameterBundleDirectionality>(payload[@"directionality"]); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(directionality, @"directionality"); > self.directionality = directionality.value(); > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result >index 76f8842dcf9a64b8f20909223e1271d063129dff..34c4fcce2afc684f5882bfc605f04e5594508786 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result >@@ -575,13 +575,13 @@ static void assertValueHasExpectedType(JSON::Value*); > namespace TestHelpers { > > template<typename ProtocolEnumType> >-std::optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); > > // Enums in the 'Test' Domain > template<> >-std::optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String&); >+Optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String&); > template<> >-std::optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String&); >+Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String&); > > } // namespace TestHelpers > >@@ -665,7 +665,7 @@ String getEnumConstantValue(int code) { > > // Enums in the 'Test' Domain > template<> >-std::optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String& protocolString) >+Optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Test::UncastedAnimals::Pigs, >@@ -677,11 +677,11 @@ std::optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromStri > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Test::UncastedAnimals)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> >-std::optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String& protocolString) >+Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String& protocolString) > { > static const size_t constantValues[] = { > (size_t)Inspector::Protocol::Test::CastedAnimals::Ducks, >@@ -693,7 +693,7 @@ std::optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString > if (protocolString == enum_constant_values[constantValues[i]]) > return (Inspector::Protocol::Test::CastedAnimals)constantValues[i]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1227,7 +1227,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1244,7 +1244,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1254,7 +1254,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -1273,7 +1273,7 @@ inline String toProtocolString(TestProtocolTestUncastedAnimals value) > } > > template<> >-inline std::optional<TestProtocolTestUncastedAnimals> fromProtocolString(const String& value) >+inline Optional<TestProtocolTestUncastedAnimals> fromProtocolString(const String& value) > { > if (value == "Pigs") > return TestProtocolTestUncastedAnimalsPigs; >@@ -1283,7 +1283,7 @@ inline std::optional<TestProtocolTestUncastedAnimals> fromProtocolString(const S > return TestProtocolTestUncastedAnimalsCats; > if (value == "Hens") > return TestProtocolTestUncastedAnimalsHens; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline String toProtocolString(TestProtocolTestCastedAnimals value) >@@ -1301,7 +1301,7 @@ inline String toProtocolString(TestProtocolTestCastedAnimals value) > } > > template<> >-inline std::optional<TestProtocolTestCastedAnimals> fromProtocolString(const String& value) >+inline Optional<TestProtocolTestCastedAnimals> fromProtocolString(const String& value) > { > if (value == "Ducks") > return TestProtocolTestCastedAnimalsDucks; >@@ -1311,7 +1311,7 @@ inline std::optional<TestProtocolTestCastedAnimals> fromProtocolString(const Str > return TestProtocolTestCastedAnimalsCrows; > if (value == "Flamingos") > return TestProtocolTestCastedAnimalsFlamingos; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >@@ -1392,7 +1392,7 @@ using namespace Inspector; > + (void)_parseUncastedAnimals:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolTestUncastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestUncastedAnimals>(payload); >+ Optional<TestProtocolTestUncastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestUncastedAnimals>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"UncastedAnimals"); > *outValue = @(result.value()); > } >@@ -1400,7 +1400,7 @@ using namespace Inspector; > + (void)_parseCastedAnimals:(NSNumber **)outValue fromPayload:(id)payload > { > THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); >- std::optional<TestProtocolTestCastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestCastedAnimals>(payload); >+ Optional<TestProtocolTestCastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestCastedAnimals>(payload); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"CastedAnimals"); > *outValue = @(result.value()); > } >@@ -1477,7 +1477,7 @@ using namespace Inspector; > self.number = [payload[@"number"] integerValue]; > > THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"animals"], @"animals"); >- std::optional<TestProtocolTestCastedAnimals> animals = fromProtocolString<TestProtocolTestCastedAnimals>(payload[@"animals"]); >+ Optional<TestProtocolTestCastedAnimals> animals = fromProtocolString<TestProtocolTestCastedAnimals>(payload[@"animals"]); > THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(animals, @"animals"); > self.animals = animals.value(); > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result >index e5f5d1e49797abfe57899c287caeea2a08a40b09..104514af9d5d16d43e4ae3d49b715d7dcbbfffd5 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result >@@ -900,7 +900,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -917,7 +917,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -927,7 +927,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result b/Source/JavaScriptCore/inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result >index bc579b4a5d6bc8a91af8fc4db2ce406d2eaab9c1..040c743bdb37e91fd139c8cffbce8c058090fe8d 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result >@@ -742,7 +742,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) { > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -759,7 +759,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -769,7 +769,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result b/Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result >index 0eb7d2f5d7862cb48ab53d9d6c7f1eb09a52ec49..af3f8de75b767c6fc429736e93f64b55e0228fe2 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result >@@ -1006,7 +1006,7 @@ __attribute__((visibility ("default"))) > namespace Inspector { > > template<typename ObjCEnumType> >-std::optional<ObjCEnumType> fromProtocolString(const String& value); >+Optional<ObjCEnumType> fromProtocolString(const String& value); > > inline String toProtocolString(TestProtocolPlatform value) > { >@@ -1023,7 +1023,7 @@ inline String toProtocolString(TestProtocolPlatform value) > } > > template<> >-inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) >+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value) > { > if (value == "all") > return TestProtocolPlatformAll; >@@ -1033,7 +1033,7 @@ inline std::optional<TestProtocolPlatform> fromProtocolString(const String& valu > return TestProtocolPlatformIOS; > if (value == "macos") > return TestProtocolPlatformMacOS; >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/JavaScriptCore/jit/JITCode.h b/Source/JavaScriptCore/jit/JITCode.h >index 66c5845d0df9d00074ffd9bf904be284cb76e72d..e70647ffb57d2fbcacd0813afc0d1a8ddbcf2878 100644 >--- a/Source/JavaScriptCore/jit/JITCode.h >+++ b/Source/JavaScriptCore/jit/JITCode.h >@@ -195,7 +195,7 @@ public: > > #if ENABLE(JIT) > virtual RegisterSet liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBlock*, CallSiteIndex); >- virtual std::optional<CodeOrigin> findPC(CodeBlock*, void* pc) { UNUSED_PARAM(pc); return std::nullopt; } >+ virtual Optional<CodeOrigin> findPC(CodeBlock*, void* pc) { UNUSED_PARAM(pc); return WTF::nullopt; } > #endif > > private: >diff --git a/Source/JavaScriptCore/jit/JITDivGenerator.cpp b/Source/JavaScriptCore/jit/JITDivGenerator.cpp >index a5db7e1b26e234bd1dd21813b5eee2928f9b4292..be92d3f96e1bc88d613622c5ff5cba90b3f48152 100644 >--- a/Source/JavaScriptCore/jit/JITDivGenerator.cpp >+++ b/Source/JavaScriptCore/jit/JITDivGenerator.cpp >@@ -82,7 +82,7 @@ void JITDivGenerator::generateFastPath(CCallHelpers& jit) > loadOperand(jit, m_leftOperand, m_left, m_leftFPR); > > #if USE(JSVALUE64) >- std::optional<double> safeReciprocal; >+ Optional<double> safeReciprocal; > if (m_rightOperand.isConst()) { > double constant = m_rightOperand.asConstNumber(); > safeReciprocal = safeReciprocalForDivByConst(constant); >diff --git a/Source/JavaScriptCore/jit/JITOperations.cpp b/Source/JavaScriptCore/jit/JITOperations.cpp >index 7b91d8fd33cb27594aa18f151a4ada34b473fe4a..f35253e5e2c99940e22e4d8bb7a1d5de2d8cce63 100644 >--- a/Source/JavaScriptCore/jit/JITOperations.cpp >+++ b/Source/JavaScriptCore/jit/JITOperations.cpp >@@ -691,7 +691,7 @@ static void directPutByVal(CallFrame* callFrame, JSObject* baseObject, JSValue s > auto property = subscript.toPropertyKey(callFrame); > RETURN_IF_EXCEPTION(scope, void()); > >- if (std::optional<uint32_t> index = parseIndex(property)) { >+ if (Optional<uint32_t> index = parseIndex(property)) { > byValInfo->tookSlowPath = true; > scope.release(); > baseObject->putDirectIndex(callFrame, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); >diff --git a/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp b/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp >index 12a4d35dac194585d40832e338f0eb4bb2af8caf..7c4a0ed37cd4c163f6561942e70f6a50ac0a8a79 100644 >--- a/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp >+++ b/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp >@@ -246,11 +246,11 @@ double PCToCodeOriginMap::memorySize() > return size; > } > >-std::optional<CodeOrigin> PCToCodeOriginMap::findPC(void* pc) const >+Optional<CodeOrigin> PCToCodeOriginMap::findPC(void* pc) const > { > uintptr_t pcAsInt = bitwise_cast<uintptr_t>(pc); > if (!(m_pcRangeStart <= pcAsInt && pcAsInt <= m_pcRangeEnd)) >- return std::nullopt; >+ return WTF::nullopt; > > uintptr_t currentPC = 0; > CodeOrigin currentCodeOrigin(0, nullptr); >@@ -293,12 +293,12 @@ std::optional<CodeOrigin> PCToCodeOriginMap::findPC(void* pc) const > // We subtract 1 because we generate end points inclusively in this table, even though we are interested in ranges of the form: [previousPC, currentPC) > uintptr_t endOfRange = currentPC - 1; > if (startOfRange <= pcAsInt && pcAsInt <= endOfRange) >- return std::optional<CodeOrigin>(previousOrigin); // We return previousOrigin here because CodeOrigin's are mapped to the startValue of the range. >+ return Optional<CodeOrigin>(previousOrigin); // We return previousOrigin here because CodeOrigin's are mapped to the startValue of the range. > } > } > > RELEASE_ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace JSC >diff --git a/Source/JavaScriptCore/jit/PCToCodeOriginMap.h b/Source/JavaScriptCore/jit/PCToCodeOriginMap.h >index b3911b02b112e76b17e19f0e237ca2fbd46b03bc..a18ecc5a2635d6cb7e6fd2073d541c5b7b2aea32 100644 >--- a/Source/JavaScriptCore/jit/PCToCodeOriginMap.h >+++ b/Source/JavaScriptCore/jit/PCToCodeOriginMap.h >@@ -81,7 +81,7 @@ public: > PCToCodeOriginMap(PCToCodeOriginMapBuilder&&, LinkBuffer&); > ~PCToCodeOriginMap(); > >- std::optional<CodeOrigin> findPC(void* pc) const; >+ Optional<CodeOrigin> findPC(void* pc) const; > > double memorySize(); > >diff --git a/Source/JavaScriptCore/jit/Repatch.cpp b/Source/JavaScriptCore/jit/Repatch.cpp >index 7311a6d5633895d126ca14463c713ddca704a2b1..018f58a2585c83f05cd597fac0cd60672422bb8f 100644 >--- a/Source/JavaScriptCore/jit/Repatch.cpp >+++ b/Source/JavaScriptCore/jit/Repatch.cpp >@@ -332,7 +332,7 @@ static InlineCacheAction tryCacheGetByID(ExecState* exec, JSValue baseValue, con > if (slot.isCacheableGetter()) > getter = jsDynamicCast<JSFunction*>(vm, slot.getterSetter()->getter()); > >- std::optional<DOMAttributeAnnotation> domAttribute; >+ Optional<DOMAttributeAnnotation> domAttribute; > if (slot.isCacheableCustom() && slot.domAttribute()) > domAttribute = slot.domAttribute(); > >diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp >index ad5d03f8f40a7b22d9bce5622daf43ed776dc116..bbfb167c308673a6ca14e8c7fed284bb2b6e3fd6 100644 >--- a/Source/JavaScriptCore/jsc.cpp >+++ b/Source/JavaScriptCore/jsc.cpp >@@ -709,11 +709,11 @@ ModuleName::ModuleName(const String& moduleName) > queries = moduleName.splitAllowingEmptyEntries('/'); > } > >-static std::optional<DirectoryName> extractDirectoryName(const String& absolutePathToFile) >+static Optional<DirectoryName> extractDirectoryName(const String& absolutePathToFile) > { > size_t firstSeparatorPosition = absolutePathToFile.find(pathSeparator()); > if (firstSeparatorPosition == notFound) >- return std::nullopt; >+ return WTF::nullopt; > DirectoryName directoryName; > directoryName.rootName = absolutePathToFile.substring(0, firstSeparatorPosition + 1); // Include the separator. > size_t lastSeparatorPosition = absolutePathToFile.reverseFind(pathSeparator()); >@@ -728,7 +728,7 @@ static std::optional<DirectoryName> extractDirectoryName(const String& absoluteP > return directoryName; > } > >-static std::optional<DirectoryName> currentWorkingDirectory() >+static Optional<DirectoryName> currentWorkingDirectory() > { > #if OS(WINDOWS) > // https://msdn.microsoft.com/en-us/library/windows/desktop/aa364934.aspx >@@ -742,7 +742,7 @@ static std::optional<DirectoryName> currentWorkingDirectory() > // In the path utility functions inside the JSC shell, we does not handle the UNC and UNCW including the network host name. > DWORD bufferLength = ::GetCurrentDirectoryW(0, nullptr); > if (!bufferLength) >- return std::nullopt; >+ return WTF::nullopt; > // In Windows, wchar_t is the UTF-16LE. > // https://msdn.microsoft.com/en-us/library/dd374081.aspx > // https://msdn.microsoft.com/en-us/library/windows/desktop/ff381407.aspx >@@ -751,15 +751,15 @@ static std::optional<DirectoryName> currentWorkingDirectory() > String directoryString = wcharToString(buffer.data(), lengthNotIncludingNull); > // We don't support network path like \\host\share\<path name>. > if (directoryString.startsWith("\\\\")) >- return std::nullopt; >+ return WTF::nullopt; > #else > Vector<char> buffer(PATH_MAX); > if (!getcwd(buffer.data(), PATH_MAX)) >- return std::nullopt; >+ return WTF::nullopt; > String directoryString = String::fromUTF8(buffer.data()); > #endif > if (directoryString.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > if (directoryString[directoryString.length() - 1] == pathSeparator()) > return extractDirectoryName(directoryString); >@@ -2483,7 +2483,7 @@ static void runInteractive(GlobalObject* globalObject) > VM& vm = globalObject->vm(); > auto scope = DECLARE_CATCH_SCOPE(vm); > >- std::optional<DirectoryName> directoryName = currentWorkingDirectory(); >+ Optional<DirectoryName> directoryName = currentWorkingDirectory(); > if (!directoryName) > return; > SourceOrigin sourceOrigin(resolvePath(directoryName.value(), ModuleName("interpreter"))); >diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >index 7edd1786397362c2b306e2fa4398a06eb50f9e9b..e7a62a7daff0f62e4b1f38a2e86de3095feba88d 100644 >--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >@@ -1064,7 +1064,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_val_direct) > if (UNLIKELY(throwScope.exception())) > LLINT_END(); > >- if (std::optional<uint32_t> index = parseIndex(property)) >+ if (Optional<uint32_t> index = parseIndex(property)) > baseObject->putDirectIndex(exec, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); > else { > PutPropertySlot slot(baseObject, isStrictMode); >diff --git a/Source/JavaScriptCore/parser/Lexer.cpp b/Source/JavaScriptCore/parser/Lexer.cpp >index dacd7f25086c16d0a4d43a64a73e6deb86ad51f0..cb460d7c1c18c1bfdf492ce877cacac0122d9003 100644 >--- a/Source/JavaScriptCore/parser/Lexer.cpp >+++ b/Source/JavaScriptCore/parser/Lexer.cpp >@@ -1539,7 +1539,7 @@ ALWAYS_INLINE auto Lexer<T>::parseHex() -> NumberParseResult > } > > template <typename T> >-ALWAYS_INLINE auto Lexer<T>::parseBinary() -> std::optional<NumberParseResult> >+ALWAYS_INLINE auto Lexer<T>::parseBinary() -> Optional<NumberParseResult> > { > // Optimization: most binary values fit into 4 bytes. > uint32_t binaryValue = 0; >@@ -1571,13 +1571,13 @@ ALWAYS_INLINE auto Lexer<T>::parseBinary() -> std::optional<NumberParseResult> > return Variant<double, const Identifier*> { makeIdentifier(m_buffer8.data(), m_buffer8.size()) }; > > if (isASCIIDigit(m_current)) >- return std::nullopt; >+ return WTF::nullopt; > > return Variant<double, const Identifier*> { parseIntOverflow(m_buffer8.data(), m_buffer8.size(), 2) }; > } > > template <typename T> >-ALWAYS_INLINE auto Lexer<T>::parseOctal() -> std::optional<NumberParseResult> >+ALWAYS_INLINE auto Lexer<T>::parseOctal() -> Optional<NumberParseResult> > { > // Optimization: most octal values fit into 4 bytes. > uint32_t octalValue = 0; >@@ -1610,13 +1610,13 @@ ALWAYS_INLINE auto Lexer<T>::parseOctal() -> std::optional<NumberParseResult> > return Variant<double, const Identifier*> { makeIdentifier(m_buffer8.data(), m_buffer8.size()) }; > > if (isASCIIDigit(m_current)) >- return std::nullopt; >+ return WTF::nullopt; > > return Variant<double, const Identifier*> { parseIntOverflow(m_buffer8.data(), m_buffer8.size(), 8) }; > } > > template <typename T> >-ALWAYS_INLINE auto Lexer<T>::parseDecimal() -> std::optional<NumberParseResult> >+ALWAYS_INLINE auto Lexer<T>::parseDecimal() -> Optional<NumberParseResult> > { > // Optimization: most decimal values fit into 4 bytes. > uint32_t decimalValue = 0; >@@ -1652,7 +1652,7 @@ ALWAYS_INLINE auto Lexer<T>::parseDecimal() -> std::optional<NumberParseResult> > if (UNLIKELY(Options::useBigInt() && m_current == 'n')) > return Variant<double, const Identifier*> { makeIdentifier(m_buffer8.data(), m_buffer8.size()) }; > >- return std::nullopt; >+ return WTF::nullopt; > } > > template <typename T> >diff --git a/Source/JavaScriptCore/parser/Lexer.h b/Source/JavaScriptCore/parser/Lexer.h >index 32f1b0b2acb5eeffdf5b29836f0a8a966c97ae25..80189d02283a49ee76eab817dce39aac1b686e6b 100644 >--- a/Source/JavaScriptCore/parser/Lexer.h >+++ b/Source/JavaScriptCore/parser/Lexer.h >@@ -179,9 +179,9 @@ private: > > using NumberParseResult = Variant<double, const Identifier*>; > ALWAYS_INLINE NumberParseResult parseHex(); >- ALWAYS_INLINE std::optional<NumberParseResult> parseBinary(); >- ALWAYS_INLINE std::optional<NumberParseResult> parseOctal(); >- ALWAYS_INLINE std::optional<NumberParseResult> parseDecimal(); >+ ALWAYS_INLINE Optional<NumberParseResult> parseBinary(); >+ ALWAYS_INLINE Optional<NumberParseResult> parseOctal(); >+ ALWAYS_INLINE Optional<NumberParseResult> parseDecimal(); > ALWAYS_INLINE void parseNumberAfterDecimalPoint(); > ALWAYS_INLINE bool parseNumberAfterExponentIndicator(); > ALWAYS_INLINE bool parseMultilineComment(); >diff --git a/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp b/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp >index 4522b0d68b0302b7d1c9ce93ab97aa2454386177..55288eedf35cd78323273ba5aed1265e30f865e8 100644 >--- a/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp >+++ b/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp >@@ -82,7 +82,7 @@ void ModuleAnalyzer::exportVariable(ModuleProgramNode& moduleProgramNode, const > // Indirectly exported binding. > // import a from "mod" > // export { a } >- std::optional<JSModuleRecord::ImportEntry> optionalImportEntry = moduleRecord()->tryGetImportEntry(localName.get()); >+ Optional<JSModuleRecord::ImportEntry> optionalImportEntry = moduleRecord()->tryGetImportEntry(localName.get()); > ASSERT(optionalImportEntry); > const JSModuleRecord::ImportEntry& importEntry = *optionalImportEntry; > for (auto& exportName : moduleProgramNode.moduleScopeData().exportedBindings().get(localName.get())) >diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp >index 6832a58f42bf604052c11f9a24ffffa60fa7c2d4..2afe0b51499b49a6dcf7ef1738f0a30c61099ddd 100644 >--- a/Source/JavaScriptCore/parser/Parser.cpp >+++ b/Source/JavaScriptCore/parser/Parser.cpp >@@ -194,7 +194,7 @@ Parser<LexerType>::~Parser() > } > > template <typename LexerType> >-String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMode parseMode, ParsingContext parsingContext, std::optional<int> functionConstructorParametersEndPosition) >+String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMode parseMode, ParsingContext parsingContext, Optional<int> functionConstructorParametersEndPosition) > { > String parseError = String(); > >@@ -614,7 +614,7 @@ template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseAsyncGen > } > > template <typename LexerType> >-template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseSingleFunction(TreeBuilder& context, std::optional<int> functionConstructorParametersEndPosition) >+template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseSingleFunction(TreeBuilder& context, Optional<int> functionConstructorParametersEndPosition) > { > TreeSourceElements sourceElements = context.createSourceElements(); > TreeStatement statement = 0; >@@ -2297,7 +2297,7 @@ template <class TreeBuilder> typename TreeBuilder::FormalParameterList Parser<Le > } > > template <typename LexerType> >-template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionNameRequirements requirements, SourceParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& functionInfo, FunctionDefinitionType functionDefinitionType, std::optional<int> functionConstructorParametersEndPosition) >+template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionNameRequirements requirements, SourceParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& functionInfo, FunctionDefinitionType functionDefinitionType, Optional<int> functionConstructorParametersEndPosition) > { > RELEASE_ASSERT(isFunctionParseMode(mode)); > >@@ -2631,7 +2631,7 @@ static NO_RETURN_DUE_TO_CRASH FunctionMetadataNode* getMetadata(ParserFunctionIn > static FunctionMetadataNode* getMetadata(ParserFunctionInfo<ASTBuilder>& info) { return info.body; } > > template <typename LexerType> >-template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDeclaration(TreeBuilder& context, ExportType exportType, DeclarationDefaultContext declarationDefaultContext, std::optional<int> functionConstructorParametersEndPosition) >+template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDeclaration(TreeBuilder& context, ExportType exportType, DeclarationDefaultContext declarationDefaultContext, Optional<int> functionConstructorParametersEndPosition) > { > ASSERT(match(FUNCTION)); > JSTokenLocation location(tokenLocation()); >@@ -2689,7 +2689,7 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDecla > } > > template <typename LexerType> >-template <class TreeBuilder> TreeStatement Parser<LexerType>::parseAsyncFunctionDeclaration(TreeBuilder& context, ExportType exportType, DeclarationDefaultContext declarationDefaultContext, std::optional<int> functionConstructorParametersEndPosition) >+template <class TreeBuilder> TreeStatement Parser<LexerType>::parseAsyncFunctionDeclaration(TreeBuilder& context, ExportType exportType, DeclarationDefaultContext declarationDefaultContext, Optional<int> functionConstructorParametersEndPosition) > { > ASSERT(match(FUNCTION)); > JSTokenLocation location(tokenLocation()); >@@ -4659,7 +4659,7 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseArgument(Tre > } > > template <typename TreeBuilder, typename ParserType, typename = typename std::enable_if<std::is_same<TreeBuilder, ASTBuilder>::value>::type> >-static inline void recordCallOrApplyDepth(ParserType* parser, VM& vm, std::optional<typename ParserType::CallOrApplyDepthScope>& callOrApplyDepthScope, ExpressionNode* expression) >+static inline void recordCallOrApplyDepth(ParserType* parser, VM& vm, Optional<typename ParserType::CallOrApplyDepthScope>& callOrApplyDepthScope, ExpressionNode* expression) > { > if (expression->isDotAccessorNode()) { > DotAccessorNode* dot = static_cast<DotAccessorNode*>(expression); >@@ -4670,7 +4670,7 @@ static inline void recordCallOrApplyDepth(ParserType* parser, VM& vm, std::optio > } > > template <typename TreeBuilder, typename ParserType, typename = typename std::enable_if<std::is_same<TreeBuilder, SyntaxChecker>::value>::type> >-static inline void recordCallOrApplyDepth(ParserType*, VM&, std::optional<typename ParserType::CallOrApplyDepthScope>&, SyntaxChecker::Expression) >+static inline void recordCallOrApplyDepth(ParserType*, VM&, Optional<typename ParserType::CallOrApplyDepthScope>&, SyntaxChecker::Expression) > { > } > >@@ -4800,7 +4800,7 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres > } else { > size_t usedVariablesSize = currentScope()->currentUsedVariablesSize(); > JSTextPosition expressionEnd = lastTokenEndPosition(); >- std::optional<CallOrApplyDepthScope> callOrApplyDepthScope; >+ Optional<CallOrApplyDepthScope> callOrApplyDepthScope; > recordCallOrApplyDepth<TreeBuilder>(this, *m_vm, callOrApplyDepthScope, base); > > TreeArguments arguments = parseArguments(context); >diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h >index 6533ef9be86179eeb9a5c581adba7e06bf640892..3186729aa50ef32d06c58611bfa3193a88365d8d 100644 >--- a/Source/JavaScriptCore/parser/Parser.h >+++ b/Source/JavaScriptCore/parser/Parser.h >@@ -872,7 +872,7 @@ public: > ~Parser(); > > template <class ParsedNode> >- std::unique_ptr<ParsedNode> parse(ParserError&, const Identifier&, SourceParseMode, ParsingContext, std::optional<int> functionConstructorParametersEndPosition = std::nullopt); >+ std::unique_ptr<ParsedNode> parse(ParserError&, const Identifier&, SourceParseMode, ParsingContext, Optional<int> functionConstructorParametersEndPosition = WTF::nullopt); > > JSTextPosition positionBeforeLastNewline() const { return m_lexer->positionBeforeLastNewline(); } > JSTokenLocation locationBeforeLastToken() const { return m_lexer->lastTokenLocation(); } >@@ -1311,7 +1311,7 @@ private: > > Parser(); > >- String parseInner(const Identifier&, SourceParseMode, ParsingContext, std::optional<int> functionConstructorParametersEndPosition = std::nullopt); >+ String parseInner(const Identifier&, SourceParseMode, ParsingContext, Optional<int> functionConstructorParametersEndPosition = WTF::nullopt); > > void didFinishParsing(SourceElements*, DeclarationStacks::FunctionStack&&, VariableEnvironment&, UniquedStringImplPtrSet&&, CodeFeatures, int); > >@@ -1523,14 +1523,14 @@ private: > template <class TreeBuilder> TreeSourceElements parseGeneratorFunctionSourceElements(TreeBuilder&, const Identifier& name, SourceElementsMode); > template <class TreeBuilder> TreeSourceElements parseAsyncFunctionSourceElements(TreeBuilder&, SourceParseMode, bool isArrowFunctionBodyExpression, SourceElementsMode); > template <class TreeBuilder> TreeSourceElements parseAsyncGeneratorFunctionSourceElements(TreeBuilder&, SourceParseMode, bool isArrowFunctionBodyExpression, SourceElementsMode); >- template <class TreeBuilder> TreeSourceElements parseSingleFunction(TreeBuilder&, std::optional<int> functionConstructorParametersEndPosition); >+ template <class TreeBuilder> TreeSourceElements parseSingleFunction(TreeBuilder&, Optional<int> functionConstructorParametersEndPosition); > template <class TreeBuilder> TreeStatement parseStatementListItem(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength); > template <class TreeBuilder> TreeStatement parseStatement(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength = 0); > enum class ExportType { Exported, NotExported }; > template <class TreeBuilder> TreeStatement parseClassDeclaration(TreeBuilder&, ExportType = ExportType::NotExported, DeclarationDefaultContext = DeclarationDefaultContext::Standard); >- template <class TreeBuilder> TreeStatement parseFunctionDeclaration(TreeBuilder&, ExportType = ExportType::NotExported, DeclarationDefaultContext = DeclarationDefaultContext::Standard, std::optional<int> functionConstructorParametersEndPosition = std::nullopt); >+ template <class TreeBuilder> TreeStatement parseFunctionDeclaration(TreeBuilder&, ExportType = ExportType::NotExported, DeclarationDefaultContext = DeclarationDefaultContext::Standard, Optional<int> functionConstructorParametersEndPosition = WTF::nullopt); > template <class TreeBuilder> TreeStatement parseFunctionDeclarationStatement(TreeBuilder&, bool isAsync, bool parentAllowsFunctionDeclarationAsStatement); >- template <class TreeBuilder> TreeStatement parseAsyncFunctionDeclaration(TreeBuilder&, ExportType = ExportType::NotExported, DeclarationDefaultContext = DeclarationDefaultContext::Standard, std::optional<int> functionConstructorParametersEndPosition = std::nullopt); >+ template <class TreeBuilder> TreeStatement parseAsyncFunctionDeclaration(TreeBuilder&, ExportType = ExportType::NotExported, DeclarationDefaultContext = DeclarationDefaultContext::Standard, Optional<int> functionConstructorParametersEndPosition = WTF::nullopt); > template <class TreeBuilder> NEVER_INLINE bool maybeParseAsyncFunctionDeclarationStatement(TreeBuilder& context, TreeStatement& result, bool parentAllowsFunctionDeclarationAsStatement); > template <class TreeBuilder> TreeStatement parseVariableDeclaration(TreeBuilder&, DeclarationType, ExportType = ExportType::NotExported); > template <class TreeBuilder> TreeStatement parseDoWhileStatement(TreeBuilder&); >@@ -1599,7 +1599,7 @@ private: > template <class TreeBuilder> ALWAYS_INLINE TreeExpression createResolveAndUseVariable(TreeBuilder&, const Identifier*, bool isEval, const JSTextPosition&, const JSTokenLocation&); > > enum class FunctionDefinitionType { Expression, Declaration, Method }; >- template <class TreeBuilder> NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionNameRequirements, SourceParseMode, bool nameIsInContainingScope, ConstructorKind, SuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>&, FunctionDefinitionType, std::optional<int> functionConstructorParametersEndPosition = std::nullopt); >+ template <class TreeBuilder> NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionNameRequirements, SourceParseMode, bool nameIsInContainingScope, ConstructorKind, SuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>&, FunctionDefinitionType, Optional<int> functionConstructorParametersEndPosition = WTF::nullopt); > > ALWAYS_INLINE bool isArrowFunctionParameters(); > >@@ -1847,7 +1847,7 @@ private: > > template <typename LexerType> > template <class ParsedNode> >-std::unique_ptr<ParsedNode> Parser<LexerType>::parse(ParserError& error, const Identifier& calleeName, SourceParseMode parseMode, ParsingContext parsingContext, std::optional<int> functionConstructorParametersEndPosition) >+std::unique_ptr<ParsedNode> Parser<LexerType>::parse(ParserError& error, const Identifier& calleeName, SourceParseMode parseMode, ParsingContext parsingContext, Optional<int> functionConstructorParametersEndPosition) > { > int errLine; > String errMsg; >@@ -1986,7 +1986,7 @@ std::unique_ptr<ParsedNode> parse( > return result; > } > >-inline std::unique_ptr<ProgramNode> parseFunctionForFunctionConstructor(VM& vm, const SourceCode& source, ParserError& error, JSTextPosition* positionBeforeLastNewline, std::optional<int> functionConstructorParametersEndPosition) >+inline std::unique_ptr<ProgramNode> parseFunctionForFunctionConstructor(VM& vm, const SourceCode& source, ParserError& error, JSTextPosition* positionBeforeLastNewline, Optional<int> functionConstructorParametersEndPosition) > { > ASSERT(!source.provider()->source().isNull()); > >diff --git a/Source/JavaScriptCore/parser/SourceCodeKey.h b/Source/JavaScriptCore/parser/SourceCodeKey.h >index 655bc82a12646f4cb1835ddf64631a30e22fa1d0..2b03aa50287305032e1b2e4a0d0658699b5752b5 100644 >--- a/Source/JavaScriptCore/parser/SourceCodeKey.h >+++ b/Source/JavaScriptCore/parser/SourceCodeKey.h >@@ -78,7 +78,7 @@ public: > SourceCodeKey( > const UnlinkedSourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserStrictMode strictMode, > JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext, >- DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled, std::optional<int> functionConstructorParametersEndPosition) >+ DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled, Optional<int> functionConstructorParametersEndPosition) > : m_sourceCode(sourceCode) > , m_name(name) > , m_flags(codeType, strictMode, scriptMode, derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, typeProfilerEnabled, controlFlowProfilerEnabled) >diff --git a/Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp b/Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp >index a4ad12ccf4ee35fc14826afcb06f898e5873bc25..1ba8b7e0e866e5e33b066801d0f11d8bef70275f 100644 >--- a/Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp >+++ b/Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp >@@ -98,20 +98,20 @@ void AbstractModuleRecord::addExportEntry(const ExportEntry& entry) > ASSERT_UNUSED(isNewEntry, isNewEntry); // This is guaranteed by the parser. > } > >-auto AbstractModuleRecord::tryGetImportEntry(UniquedStringImpl* localName) -> std::optional<ImportEntry> >+auto AbstractModuleRecord::tryGetImportEntry(UniquedStringImpl* localName) -> Optional<ImportEntry> > { > const auto iterator = m_importEntries.find(localName); > if (iterator == m_importEntries.end()) >- return std::nullopt; >- return std::optional<ImportEntry>(iterator->value); >+ return WTF::nullopt; >+ return Optional<ImportEntry>(iterator->value); > } > >-auto AbstractModuleRecord::tryGetExportEntry(UniquedStringImpl* exportName) -> std::optional<ExportEntry> >+auto AbstractModuleRecord::tryGetExportEntry(UniquedStringImpl* exportName) -> Optional<ExportEntry> > { > const auto iterator = m_exportEntries.find(exportName); > if (iterator == m_exportEntries.end()) >- return std::nullopt; >- return std::optional<ExportEntry>(iterator->value); >+ return WTF::nullopt; >+ return Optional<ExportEntry>(iterator->value); > } > > auto AbstractModuleRecord::ExportEntry::createLocal(const Identifier& exportName, const Identifier& localName) -> ExportEntry >@@ -154,7 +154,7 @@ auto AbstractModuleRecord::resolveImport(ExecState* exec, const Identifier& loca > VM& vm = exec->vm(); > auto scope = DECLARE_THROW_SCOPE(vm); > >- std::optional<ImportEntry> optionalImportEntry = tryGetImportEntry(localName.impl()); >+ Optional<ImportEntry> optionalImportEntry = tryGetImportEntry(localName.impl()); > if (!optionalImportEntry) > return Resolution::notFound(); > >@@ -233,12 +233,12 @@ inline bool AbstractModuleRecord::ResolveQuery::Hash::equal(const ResolveQuery& > return lhs.moduleRecord == rhs.moduleRecord && lhs.exportName == rhs.exportName; > } > >-auto AbstractModuleRecord::tryGetCachedResolution(UniquedStringImpl* exportName) -> std::optional<Resolution> >+auto AbstractModuleRecord::tryGetCachedResolution(UniquedStringImpl* exportName) -> Optional<Resolution> > { > const auto iterator = m_resolutionCache.find(exportName); > if (iterator == m_resolutionCache.end()) >- return std::nullopt; >- return std::optional<Resolution>(iterator->value); >+ return WTF::nullopt; >+ return Optional<Resolution>(iterator->value); > } > > void AbstractModuleRecord::cacheResolution(UniquedStringImpl* exportName, const Resolution& resolution) >@@ -595,14 +595,14 @@ auto AbstractModuleRecord::resolveExportImpl(ExecState* exec, const ResolveQuery > > // 4. Once we follow star links, we should not retrieve the result from the cache and should not cache the result. > if (!foundStarLinks) { >- if (std::optional<Resolution> cachedResolution = moduleRecord->tryGetCachedResolution(query.exportName.get())) { >+ if (Optional<Resolution> cachedResolution = moduleRecord->tryGetCachedResolution(query.exportName.get())) { > if (!mergeToCurrentTop(*cachedResolution)) > return Resolution::ambiguous(); > continue; > } > } > >- const std::optional<ExportEntry> optionalExportEntry = moduleRecord->tryGetExportEntry(query.exportName.get()); >+ const Optional<ExportEntry> optionalExportEntry = moduleRecord->tryGetExportEntry(query.exportName.get()); > if (!optionalExportEntry) { > // If there is no matched exported binding in the current module, > // we need to look into the stars. >@@ -690,7 +690,7 @@ auto AbstractModuleRecord::resolveExportImpl(ExecState* exec, const ResolveQuery > auto AbstractModuleRecord::resolveExport(ExecState* exec, const Identifier& exportName) -> Resolution > { > // Look up the cached resolution first before entering the resolving loop, since the loop setup takes some cost. >- if (std::optional<Resolution> cachedResolution = tryGetCachedResolution(exportName.impl())) >+ if (Optional<Resolution> cachedResolution = tryGetCachedResolution(exportName.impl())) > return *cachedResolution; > return resolveExportImpl(exec, ResolveQuery(this, exportName.impl())); > } >diff --git a/Source/JavaScriptCore/runtime/AbstractModuleRecord.h b/Source/JavaScriptCore/runtime/AbstractModuleRecord.h >index 5bb5b16fd3e19aec325465d8bd170c8efe974dc0..adeeb590cf0018668227a9904799a8f9f94e92cf 100644 >--- a/Source/JavaScriptCore/runtime/AbstractModuleRecord.h >+++ b/Source/JavaScriptCore/runtime/AbstractModuleRecord.h >@@ -80,8 +80,8 @@ public: > void addImportEntry(const ImportEntry&); > void addExportEntry(const ExportEntry&); > >- std::optional<ImportEntry> tryGetImportEntry(UniquedStringImpl* localName); >- std::optional<ExportEntry> tryGetExportEntry(UniquedStringImpl* exportName); >+ Optional<ImportEntry> tryGetImportEntry(UniquedStringImpl* localName); >+ Optional<ExportEntry> tryGetExportEntry(UniquedStringImpl* exportName); > > const Identifier& moduleKey() const { return m_moduleKey; } > const OrderedIdentifierSet& requestedModules() const { return m_requestedModules; } >@@ -136,7 +136,7 @@ protected: > private: > struct ResolveQuery; > static Resolution resolveExportImpl(ExecState*, const ResolveQuery&); >- std::optional<Resolution> tryGetCachedResolution(UniquedStringImpl* exportName); >+ Optional<Resolution> tryGetCachedResolution(UniquedStringImpl* exportName); > void cacheResolution(UniquedStringImpl* exportName, const Resolution&); > > // The loader resolves the given module name to the module key. The module key is the unique value to represent this module. >diff --git a/Source/JavaScriptCore/runtime/CodeCache.cpp b/Source/JavaScriptCore/runtime/CodeCache.cpp >index faafb72b2a99b9cab8e795f01837bacefbc5fa5b..46017921a46efc641725d0a2352529035af5f3ad 100644 >--- a/Source/JavaScriptCore/runtime/CodeCache.cpp >+++ b/Source/JavaScriptCore/runtime/CodeCache.cpp >@@ -58,7 +58,7 @@ UnlinkedCodeBlockType* CodeCache::getUnlinkedGlobalCodeBlock(VM& vm, ExecutableT > derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, > vm.typeProfiler() ? TypeProfilerEnabled::Yes : TypeProfilerEnabled::No, > vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No, >- std::nullopt); >+ WTF::nullopt); > SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key); > if (cache && Options::useCodeCache()) { > UnlinkedCodeBlockType* unlinkedCodeBlock = jsCast<UnlinkedCodeBlockType*>(cache->cell.get()); >@@ -96,7 +96,7 @@ UnlinkedModuleProgramCodeBlock* CodeCache::getUnlinkedModuleProgramCodeBlock(VM& > return getUnlinkedGlobalCodeBlock<UnlinkedModuleProgramCodeBlock>(vm, executable, source, JSParserStrictMode::Strict, JSParserScriptMode::Module, debuggerMode, error, EvalContextType::None); > } > >-UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, std::optional<int> functionConstructorParametersEndPosition, ParserError& error) >+UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, Optional<int> functionConstructorParametersEndPosition, ParserError& error) > { > bool isArrowFunctionContext = false; > SourceCodeKey key( >diff --git a/Source/JavaScriptCore/runtime/CodeCache.h b/Source/JavaScriptCore/runtime/CodeCache.h >index 53e3fda51e2e37d7e0dd092c0fda9579fbac73d4..8a4419f96ca8fa4a629be0e9a7827cbaf68cff86 100644 >--- a/Source/JavaScriptCore/runtime/CodeCache.h >+++ b/Source/JavaScriptCore/runtime/CodeCache.h >@@ -194,7 +194,7 @@ public: > UnlinkedProgramCodeBlock* getUnlinkedProgramCodeBlock(VM&, ProgramExecutable*, const SourceCode&, JSParserStrictMode, DebuggerMode, ParserError&); > UnlinkedEvalCodeBlock* getUnlinkedEvalCodeBlock(VM&, IndirectEvalExecutable*, const SourceCode&, JSParserStrictMode, DebuggerMode, ParserError&, EvalContextType); > UnlinkedModuleProgramCodeBlock* getUnlinkedModuleProgramCodeBlock(VM&, ModuleProgramExecutable*, const SourceCode&, DebuggerMode, ParserError&); >- UnlinkedFunctionExecutable* getUnlinkedGlobalFunctionExecutable(VM&, const Identifier&, const SourceCode&, DebuggerMode, std::optional<int> functionConstructorParametersEndPosition, ParserError&); >+ UnlinkedFunctionExecutable* getUnlinkedGlobalFunctionExecutable(VM&, const Identifier&, const SourceCode&, DebuggerMode, Optional<int> functionConstructorParametersEndPosition, ParserError&); > > void clear() { m_sourceCode.clear(); } > >diff --git a/Source/JavaScriptCore/runtime/ConcurrentJSLock.h b/Source/JavaScriptCore/runtime/ConcurrentJSLock.h >index cf59bc8dd20a3b1101e80924eba77ff5a5bfde6b..4c7c10b0efe29a2aef9f93f1aa96aaf17932265d 100644 >--- a/Source/JavaScriptCore/runtime/ConcurrentJSLock.h >+++ b/Source/JavaScriptCore/runtime/ConcurrentJSLock.h >@@ -120,7 +120,7 @@ public: > ConcurrentJSLocker(NoLockingNecessaryTag) > : ConcurrentJSLockerBase(NoLockingNecessary) > #if ENABLE(CONCURRENT_JS) && !defined(NDEBUG) >- , m_disallowGC(std::nullopt) >+ , m_disallowGC(WTF::nullopt) > #endif > { > } >@@ -129,7 +129,7 @@ public: > > #if ENABLE(CONCURRENT_JS) && !defined(NDEBUG) > private: >- std::optional<DisallowGC> m_disallowGC; >+ Optional<DisallowGC> m_disallowGC; > #endif > }; > >diff --git a/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h b/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h >index d7e3b9133335725a74a336404d662971100d4559..2d9ced7cc2751933f054bfc6e8e1b1d102364626 100644 >--- a/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h >+++ b/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h >@@ -99,10 +99,10 @@ public: > return extractTriState(WritableShift) != MixedTriState; > } > >- std::optional<bool> writable() const >+ Optional<bool> writable() const > { > if (!hasWritable()) >- return std::nullopt; >+ return WTF::nullopt; > return extractTriState(WritableShift) == TrueTriState; > } > >@@ -111,10 +111,10 @@ public: > return extractTriState(ConfigurableShift) != MixedTriState; > } > >- std::optional<bool> configurable() const >+ Optional<bool> configurable() const > { > if (!hasConfigurable()) >- return std::nullopt; >+ return WTF::nullopt; > return extractTriState(ConfigurableShift) == TrueTriState; > } > >@@ -123,10 +123,10 @@ public: > return extractTriState(EnumerableShift) != MixedTriState; > } > >- std::optional<bool> enumerable() const >+ Optional<bool> enumerable() const > { > if (!hasEnumerable()) >- return std::nullopt; >+ return WTF::nullopt; > return extractTriState(EnumerableShift) == TrueTriState; > } > >diff --git a/Source/JavaScriptCore/runtime/ErrorConstructor.h b/Source/JavaScriptCore/runtime/ErrorConstructor.h >index 4eebf6849fab6f535f81bd0bd3a7735fce6a4320..857d31955cfe3719247a66d137f726b00110e07a 100644 >--- a/Source/JavaScriptCore/runtime/ErrorConstructor.h >+++ b/Source/JavaScriptCore/runtime/ErrorConstructor.h >@@ -51,7 +51,7 @@ public: > return Structure::create(vm, globalObject, prototype, TypeInfo(InternalFunctionType, StructureFlags), info()); > } > >- std::optional<unsigned> stackTraceLimit() const { return m_stackTraceLimit; } >+ Optional<unsigned> stackTraceLimit() const { return m_stackTraceLimit; } > > protected: > void finishCreation(VM&, ErrorPrototype*); >@@ -62,7 +62,7 @@ protected: > private: > ErrorConstructor(VM&, Structure*); > >- std::optional<unsigned> m_stackTraceLimit; >+ Optional<unsigned> m_stackTraceLimit; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/FunctionConstructor.cpp b/Source/JavaScriptCore/runtime/FunctionConstructor.cpp >index 7d3575fc37dbe6115641163cdee99a62d88efaba..168774964d2107e45e6c974abba32231acbf9ac5 100644 >--- a/Source/JavaScriptCore/runtime/FunctionConstructor.cpp >+++ b/Source/JavaScriptCore/runtime/FunctionConstructor.cpp >@@ -101,7 +101,7 @@ JSObject* constructFunctionSkippingEvalEnabledCheck( > // How we stringify functions is sometimes important for web compatibility. > // See https://bugs.webkit.org/show_bug.cgi?id=24350. > String program; >- std::optional<int> functionConstructorParametersEndPosition = std::nullopt; >+ Optional<int> functionConstructorParametersEndPosition = WTF::nullopt; > if (args.isEmpty()) > program = makeString(prefix, functionName.string(), "() {\n\n}"); > else if (args.size() == 1) { >diff --git a/Source/JavaScriptCore/runtime/FunctionExecutable.cpp b/Source/JavaScriptCore/runtime/FunctionExecutable.cpp >index eed3c216ca3bb7969fa6f88858dc695d66e5d114..79780db9fefa253694d986783b84d408cae795bb 100644 >--- a/Source/JavaScriptCore/runtime/FunctionExecutable.cpp >+++ b/Source/JavaScriptCore/runtime/FunctionExecutable.cpp >@@ -94,7 +94,7 @@ void FunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor) > > FunctionExecutable* FunctionExecutable::fromGlobalCode( > const Identifier& name, ExecState& exec, const SourceCode& source, >- JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition) >+ JSObject*& exception, int overrideLineNumber, Optional<int> functionConstructorParametersEndPosition) > { > UnlinkedFunctionExecutable* unlinkedExecutable = > UnlinkedFunctionExecutable::fromGlobalCode( >diff --git a/Source/JavaScriptCore/runtime/FunctionExecutable.h b/Source/JavaScriptCore/runtime/FunctionExecutable.h >index 6ba85a152c774e31c71c712e2b26b5ead30bf95e..1baaa8572162d81d8c7ad2efc4e926de0ea59727 100644 >--- a/Source/JavaScriptCore/runtime/FunctionExecutable.h >+++ b/Source/JavaScriptCore/runtime/FunctionExecutable.h >@@ -55,7 +55,7 @@ public: > } > static FunctionExecutable* fromGlobalCode( > const Identifier& name, ExecState&, const SourceCode&, >- JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition); >+ JSObject*& exception, int overrideLineNumber, Optional<int> functionConstructorParametersEndPosition); > > static void destroy(JSCell*); > >diff --git a/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h b/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h >index 40dbc6094343d97310d9fdc97d8f6bbb8397404f..2be41fe99726cebd9a88f8a429f5de01a3923cd2 100644 >--- a/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h >+++ b/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h >@@ -62,7 +62,7 @@ bool GenericArguments<Type>::getOwnPropertySlot(JSObject* object, ExecState* exe > } > } > >- if (std::optional<uint32_t> index = parseIndex(ident)) >+ if (Optional<uint32_t> index = parseIndex(ident)) > return GenericArguments<Type>::getOwnPropertySlotByIndex(thisObject, exec, *index, slot); > > return Base::getOwnPropertySlot(thisObject, exec, ident, slot); >@@ -132,7 +132,7 @@ bool GenericArguments<Type>::put(JSCell* cell, ExecState* exec, PropertyName ide > if (UNLIKELY(isThisValueAltered(slot, thisObject))) > return ordinarySetSlow(exec, thisObject, ident, value, slot.thisValue(), slot.isStrictMode()); > >- std::optional<uint32_t> index = parseIndex(ident); >+ Optional<uint32_t> index = parseIndex(ident); > if (index && thisObject->isMappedArgument(index.value())) { > thisObject->setIndexQuickly(vm, index.value(), value); > return true; >@@ -167,7 +167,7 @@ bool GenericArguments<Type>::deleteProperty(JSCell* cell, ExecState* exec, Prope > || ident == vm.propertyNames->iteratorSymbol)) > thisObject->overrideThings(vm); > >- if (std::optional<uint32_t> index = parseIndex(ident)) >+ if (Optional<uint32_t> index = parseIndex(ident)) > return GenericArguments<Type>::deletePropertyByIndex(thisObject, exec, *index); > > return Base::deleteProperty(thisObject, exec, ident); >@@ -208,7 +208,7 @@ bool GenericArguments<Type>::defineOwnProperty(JSObject* object, ExecState* exec > || ident == vm.propertyNames->iteratorSymbol) > thisObject->overrideThingsIfNecessary(vm); > else { >- std::optional<uint32_t> optionalIndex = parseIndex(ident); >+ Optional<uint32_t> optionalIndex = parseIndex(ident); > if (optionalIndex) { > uint32_t index = optionalIndex.value(); > if (!descriptor.isAccessorDescriptor() && thisObject->isMappedArgument(optionalIndex.value())) { >diff --git a/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h b/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h >index 0612eb73a374d9c0d42f1f616b9ba73e17567ca5..b0b719bf953bdd2c4861cd592df60122908869f9 100644 >--- a/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h >+++ b/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h >@@ -68,7 +68,7 @@ public: > return bitwise_cast<uint32_t>(structureID) + impl->hash(); > } > >- ALWAYS_INLINE std::optional<bool> get(Structure* structure, PropertyName propName) >+ ALWAYS_INLINE Optional<bool> get(Structure* structure, PropertyName propName) > { > UniquedStringImpl* impl = propName.uid(); > StructureID id = structure->id(); >@@ -76,7 +76,7 @@ public: > Entry& entry = bitwise_cast<Entry*>(this)[index]; > if (entry.structureID == id && entry.impl.get() == impl) > return entry.result; >- return std::nullopt; >+ return WTF::nullopt; > } > > ALWAYS_INLINE void tryAdd(VM& vm, PropertySlot& slot, JSObject* object, PropertyName propName, bool result) >diff --git a/Source/JavaScriptCore/runtime/HashMapImpl.h b/Source/JavaScriptCore/runtime/HashMapImpl.h >index 692a5f958e3311efd38dcd672d0b2bbe8111caa4..4e87c892f91dd62f6d634ee312302d2b32e4d64e 100644 >--- a/Source/JavaScriptCore/runtime/HashMapImpl.h >+++ b/Source/JavaScriptCore/runtime/HashMapImpl.h >@@ -284,16 +284,16 @@ ALWAYS_INLINE uint32_t jsMapHash(ExecState* exec, VM& vm, JSValue value) > return wangsInt64Hash(JSValue::encode(value)); > } > >-ALWAYS_INLINE std::optional<uint32_t> concurrentJSMapHash(JSValue key) >+ALWAYS_INLINE Optional<uint32_t> concurrentJSMapHash(JSValue key) > { > key = normalizeMapKey(key); > if (key.isString()) { > JSString* string = asString(key); > if (string->length() > 10 * 1024) >- return std::nullopt; >+ return WTF::nullopt; > const StringImpl* impl = string->tryGetValueImpl(); > if (!impl) >- return std::nullopt; >+ return WTF::nullopt; > return impl->concurrentHash(); > } > >diff --git a/Source/JavaScriptCore/runtime/Identifier.h b/Source/JavaScriptCore/runtime/Identifier.h >index 1a308ae4297c3c46a319fd687c41edb51ecb0dd5..54e84631d76def3215b29058ad0cf3cbd2bebb14 100644 >--- a/Source/JavaScriptCore/runtime/Identifier.h >+++ b/Source/JavaScriptCore/runtime/Identifier.h >@@ -37,46 +37,46 @@ ALWAYS_INLINE bool isIndex(uint32_t index) > } > > template <typename CharType> >-ALWAYS_INLINE std::optional<uint32_t> parseIndex(const CharType* characters, unsigned length) >+ALWAYS_INLINE Optional<uint32_t> parseIndex(const CharType* characters, unsigned length) > { > // An empty string is not a number. > if (!length) >- return std::nullopt; >+ return WTF::nullopt; > > // Get the first character, turning it into a digit. > uint32_t value = characters[0] - '0'; > if (value > 9) >- return std::nullopt; >+ return WTF::nullopt; > > // Check for leading zeros. If the first characher is 0, then the > // length of the string must be one - e.g. "042" is not equal to "42". > if (!value && length > 1) >- return std::nullopt; >+ return WTF::nullopt; > > while (--length) { > // Multiply value by 10, checking for overflow out of 32 bits. > if (value > 0xFFFFFFFFU / 10) >- return std::nullopt; >+ return WTF::nullopt; > value *= 10; > > // Get the next character, turning it into a digit. > uint32_t newValue = *(++characters) - '0'; > if (newValue > 9) >- return std::nullopt; >+ return WTF::nullopt; > > // Add in the old value, checking for overflow out of 32 bits. > newValue += value; > if (newValue < value) >- return std::nullopt; >+ return WTF::nullopt; > value = newValue; > } > > if (!isIndex(value)) >- return std::nullopt; >+ return WTF::nullopt; > return value; > } > >-ALWAYS_INLINE std::optional<uint32_t> parseIndex(StringImpl& impl) >+ALWAYS_INLINE Optional<uint32_t> parseIndex(StringImpl& impl) > { > if (impl.is8Bit()) > return parseIndex(impl.characters8(), impl.length()); >@@ -272,13 +272,13 @@ inline bool Identifier::equal(const StringImpl* r, const UChar* s, unsigned leng > return WTF::equal(r, s, length); > } > >-ALWAYS_INLINE std::optional<uint32_t> parseIndex(const Identifier& identifier) >+ALWAYS_INLINE Optional<uint32_t> parseIndex(const Identifier& identifier) > { > auto uid = identifier.impl(); > if (!uid) >- return std::nullopt; >+ return WTF::nullopt; > if (uid->isSymbol()) >- return std::nullopt; >+ return WTF::nullopt; > return parseIndex(*uid); > } > >diff --git a/Source/JavaScriptCore/runtime/IntlPluralRules.h b/Source/JavaScriptCore/runtime/IntlPluralRules.h >index 2d17ef0bbf73f0c58fb1a9818f2794ea47e33a23..68f54f906560726b6b07668f87e512e219d404be 100644 >--- a/Source/JavaScriptCore/runtime/IntlPluralRules.h >+++ b/Source/JavaScriptCore/runtime/IntlPluralRules.h >@@ -76,8 +76,8 @@ private: > unsigned m_minimumIntegerDigits { 1 }; > unsigned m_minimumFractionDigits { 0 }; > unsigned m_maximumFractionDigits { 3 }; >- std::optional<unsigned> m_minimumSignificantDigits; >- std::optional<unsigned> m_maximumSignificantDigits; >+ Optional<unsigned> m_minimumSignificantDigits; >+ Optional<unsigned> m_maximumSignificantDigits; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/JSArray.cpp b/Source/JavaScriptCore/runtime/JSArray.cpp >index f32af382e130134bfd0894d524d24a394d21663f..3d52961bf2fff9b3db69225b2194ba87b3745156 100644 >--- a/Source/JavaScriptCore/runtime/JSArray.cpp >+++ b/Source/JavaScriptCore/runtime/JSArray.cpp >@@ -241,7 +241,7 @@ bool JSArray::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName > > // 4. Else if P is an array index (15.4), then > // a. Let index be ToUint32(P). >- if (std::optional<uint32_t> optionalIndex = parseIndex(propertyName)) { >+ if (Optional<uint32_t> optionalIndex = parseIndex(propertyName)) { > // b. Reject if index >= oldLen and oldLenDesc.[[Writable]] is false. > uint32_t index = optionalIndex.value(); > // FIXME: Nothing prevents this from being called on a RuntimeArray, and the length function will always return 0 in that case. >diff --git a/Source/JavaScriptCore/runtime/JSBigInt.cpp b/Source/JavaScriptCore/runtime/JSBigInt.cpp >index afe3cfde0036c9e6b2551abdea0564228500df14..ca531636b781e869ea78f76d25b5e4aead416185 100644 >--- a/Source/JavaScriptCore/runtime/JSBigInt.cpp >+++ b/Source/JavaScriptCore/runtime/JSBigInt.cpp >@@ -188,7 +188,7 @@ JSValue JSBigInt::toPrimitive(ExecState*, PreferredPrimitiveType) const > return const_cast<JSBigInt*>(this); > } > >-std::optional<uint8_t> JSBigInt::singleDigitValueForString() >+Optional<uint8_t> JSBigInt::singleDigitValueForString() > { > if (isZero()) > return 0; >@@ -1961,16 +1961,16 @@ JSBigInt::ComparisonResult JSBigInt::compareToDouble(JSBigInt* x, double y) > return ComparisonResult::Equal; > } > >-std::optional<JSBigInt::Digit> JSBigInt::toShiftAmount(JSBigInt* x) >+Optional<JSBigInt::Digit> JSBigInt::toShiftAmount(JSBigInt* x) > { > if (x->length() > 1) >- return std::nullopt; >+ return WTF::nullopt; > > Digit value = x->digit(0); > static_assert(maxLengthBits < std::numeric_limits<Digit>::max(), "maxLengthBits needs to be less than digit"); > > if (value > maxLengthBits) >- return std::nullopt; >+ return WTF::nullopt; > > return value; > } >diff --git a/Source/JavaScriptCore/runtime/JSBigInt.h b/Source/JavaScriptCore/runtime/JSBigInt.h >index 8e14ca51230c554e2d4c1e829bd4d6c0a3a5365c..2b3bf9307d8dbbb1107533ed830347bcdd4a610b 100644 >--- a/Source/JavaScriptCore/runtime/JSBigInt.h >+++ b/Source/JavaScriptCore/runtime/JSBigInt.h >@@ -85,7 +85,7 @@ public: > static JSBigInt* parseInt(ExecState*, StringView, ErrorParseMode = ErrorParseMode::ThrowExceptions); > static JSBigInt* stringToBigInt(ExecState*, StringView); > >- std::optional<uint8_t> singleDigitValueForString(); >+ Optional<uint8_t> singleDigitValueForString(); > String toString(ExecState*, unsigned radix); > > enum class ComparisonMode { >@@ -225,7 +225,7 @@ private: > > static JSBigInt* rightShiftByMaximum(VM&, bool sign); > >- static std::optional<Digit> toShiftAmount(JSBigInt* x); >+ static Optional<Digit> toShiftAmount(JSBigInt* x); > > static size_t allocationSize(unsigned length); > static size_t offsetOfData(); >diff --git a/Source/JavaScriptCore/runtime/JSCJSValue.cpp b/Source/JavaScriptCore/runtime/JSCJSValue.cpp >index 13615793cc371f520080b5fd4bbc8f1f443c7dbd..d471e163f3ebea33dddccd223cc6df42445025b8 100644 >--- a/Source/JavaScriptCore/runtime/JSCJSValue.cpp >+++ b/Source/JavaScriptCore/runtime/JSCJSValue.cpp >@@ -76,10 +76,10 @@ double JSValue::toNumberSlowCase(ExecState* exec) const > return isUndefined() ? PNaN : 0; // null and false both convert to 0. > } > >-std::optional<double> JSValue::toNumberFromPrimitive() const >+Optional<double> JSValue::toNumberFromPrimitive() const > { > if (isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > if (isNumber()) > return asNumber(); > if (isBoolean()) >@@ -88,7 +88,7 @@ std::optional<double> JSValue::toNumberFromPrimitive() const > return PNaN; > if (isNull()) > return 0; >- return std::nullopt; >+ return WTF::nullopt; > } > > JSObject* JSValue::toObjectSlowCase(ExecState* exec, JSGlobalObject* globalObject) const >@@ -152,7 +152,7 @@ bool JSValue::putToPrimitive(ExecState* exec, PropertyName propertyName, JSValue > VM& vm = exec->vm(); > auto scope = DECLARE_THROW_SCOPE(vm); > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > RELEASE_AND_RETURN(scope, putToPrimitiveByIndex(exec, index.value(), value, slot.isStrictMode())); > > // Check if there are any setters or getters in the prototype chain >diff --git a/Source/JavaScriptCore/runtime/JSCJSValue.h b/Source/JavaScriptCore/runtime/JSCJSValue.h >index 90d8f9f9693031c73e3331f2f49f4c80fce20e35..5f4fd945b4fdd025f3f69f0dcd13dfe5c525865f 100644 >--- a/Source/JavaScriptCore/runtime/JSCJSValue.h >+++ b/Source/JavaScriptCore/runtime/JSCJSValue.h >@@ -262,7 +262,7 @@ public: > Variant<JSBigInt*, int32_t> toBigIntOrInt32(ExecState*) const; > > // toNumber conversion if it can be done without side effects. >- std::optional<double> toNumberFromPrimitive() const; >+ Optional<double> toNumberFromPrimitive() const; > > JSString* toString(ExecState*) const; // On exception, this returns the empty string. > JSString* toStringOrNull(ExecState*) const; // On exception, this returns null, to make exception checks faster. >diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h >index 864203576737c41af040ea1eb0c852b106657415..d256313fd4fc0d6061590b4485cdecafb3dc0478 100644 >--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h >+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h >@@ -189,7 +189,7 @@ public: > > static ElementType toAdaptorNativeFromValue(ExecState* exec, JSValue jsValue) { return toNativeFromValue<Adaptor>(exec, jsValue); } > >- static std::optional<ElementType> toAdaptorNativeFromValueWithoutCoercion(JSValue jsValue) { return toNativeFromValueWithoutCoercion<Adaptor>(jsValue); } >+ static Optional<ElementType> toAdaptorNativeFromValueWithoutCoercion(JSValue jsValue) { return toNativeFromValueWithoutCoercion<Adaptor>(jsValue); } > > void sort() > { >diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h >index 85a764affb1f0f493d9998f4cf9e67d4f8644abd..f0acc0377b1449d59d196b6353cc8ea8013d7f10 100644 >--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h >+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h >@@ -114,7 +114,7 @@ inline JSObject* constructGenericTypedArrayViewFromIterator(ExecState* exec, Str > } > > template<typename ViewClass> >-inline JSObject* constructGenericTypedArrayViewWithArguments(ExecState* exec, Structure* structure, EncodedJSValue firstArgument, unsigned offset, std::optional<unsigned> lengthOpt) >+inline JSObject* constructGenericTypedArrayViewWithArguments(ExecState* exec, Structure* structure, EncodedJSValue firstArgument, unsigned offset, Optional<unsigned> lengthOpt) > { > VM& vm = exec->vm(); > auto scope = DECLARE_THROW_SCOPE(vm); >@@ -223,7 +223,7 @@ EncodedJSValue JSC_HOST_CALL constructGenericTypedArrayView(ExecState* exec) > > JSValue firstValue = exec->uncheckedArgument(0); > unsigned offset = 0; >- std::optional<unsigned> length = std::nullopt; >+ Optional<unsigned> length = WTF::nullopt; > if (jsDynamicCast<JSArrayBuffer*>(vm, firstValue) && argCount > 1) { > offset = exec->uncheckedArgument(1).toIndex(exec, "byteOffset"); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); >diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h >index 2e56ce165b5964ca4dd04f57e47986b474de5c6d..f3c0d393884f2c1cde50f8e79723705e3e8e71bd 100644 >--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h >+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h >@@ -344,7 +344,7 @@ bool JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot( > { > JSGenericTypedArrayView* thisObject = jsCast<JSGenericTypedArrayView*>(object); > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) { >+ if (Optional<uint32_t> index = parseIndex(propertyName)) { > if (thisObject->isNeutered()) { > slot.setCustom(thisObject, static_cast<unsigned>(PropertyAttribute::None), throwNeuteredTypedArrayTypeError); > return true; >@@ -372,7 +372,7 @@ bool JSGenericTypedArrayView<Adaptor>::put( > // https://tc39.github.io/ecma262/#sec-integer-indexed-exotic-objects-set-p-v-receiver > // Ignore the receiver even if the receiver is altered to non base value. > // 9.4.5.5-2-b-i Return ? IntegerIndexedElementSet(O, numericIndex, V). >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return putByIndex(thisObject, exec, index.value(), value, slot.isStrictMode()); > > return Base::put(thisObject, exec, propertyName, value, slot); >@@ -387,7 +387,7 @@ bool JSGenericTypedArrayView<Adaptor>::defineOwnProperty( > auto scope = DECLARE_THROW_SCOPE(vm); > JSGenericTypedArrayView* thisObject = jsCast<JSGenericTypedArrayView*>(object); > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) { >+ if (Optional<uint32_t> index = parseIndex(propertyName)) { > auto throwTypeErrorIfNeeded = [&] (const char* errorMessage) -> bool { > if (shouldThrow) > throwTypeError(exec, scope, makeString(errorMessage, String::number(*index))); >diff --git a/Source/JavaScriptCore/runtime/JSLock.h b/Source/JavaScriptCore/runtime/JSLock.h >index c0b82e6914d835423b925a94f0b1b82c3455064c..5277f02c8e112c21f0baa0feb7d4eb0ba053fd6d 100644 >--- a/Source/JavaScriptCore/runtime/JSLock.h >+++ b/Source/JavaScriptCore/runtime/JSLock.h >@@ -92,11 +92,11 @@ public: > > VM* vm() { return m_vm; } > >- std::optional<RefPtr<Thread>> ownerThread() const >+ Optional<RefPtr<Thread>> ownerThread() const > { > if (m_hasOwnerThread) > return m_ownerThread; >- return std::nullopt; >+ return WTF::nullopt; > } > bool currentThreadIsHoldingLock() { return m_hasOwnerThread && m_ownerThread.get() == &Thread::current(); } > >diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp >index 20fcd4032ce6b38317c76c53879bcfd3b6b1688f..e803afcc63d1c37460c4d8ef318532eef7e567e8 100644 >--- a/Source/JavaScriptCore/runtime/JSObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSObject.cpp >@@ -1854,7 +1854,7 @@ bool JSObject::putDirectAccessor(ExecState* exec, PropertyName propertyName, Get > { > ASSERT(attributes & PropertyAttribute::Accessor); > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return putDirectIndex(exec, index.value(), accessor, attributes, PutDirectIndexLikePutDirect); > > return putDirectNonIndexAccessor(exec->vm(), propertyName, accessor, attributes); >@@ -1926,7 +1926,7 @@ bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName proper > JSObject* thisObject = jsCast<JSObject*>(cell); > VM& vm = exec->vm(); > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return thisObject->methodTable(vm)->deletePropertyByIndex(thisObject, exec, index.value()); > > unsigned attributes; >@@ -2168,7 +2168,7 @@ bool JSObject::getOwnStaticPropertySlot(VM& vm, PropertyName propertyName, Prope > return false; > } > >-auto JSObject::findPropertyHashEntry(VM& vm, PropertyName propertyName) const -> std::optional<PropertyHashEntry> >+auto JSObject::findPropertyHashEntry(VM& vm, PropertyName propertyName) const -> Optional<PropertyHashEntry> > { > for (const ClassInfo* info = classInfo(vm); info; info = info->parentClass) { > if (const HashTable* propHashTable = info->staticPropHashTable) { >@@ -2176,7 +2176,7 @@ auto JSObject::findPropertyHashEntry(VM& vm, PropertyName propertyName) const -> > return PropertyHashEntry { propHashTable, entry }; > } > } >- return std::nullopt; >+ return WTF::nullopt; > } > > bool JSObject::hasInstance(ExecState* exec, JSValue value, JSValue hasInstanceValue) >@@ -3475,7 +3475,7 @@ static bool putDescriptor(ExecState* exec, JSObject* target, PropertyName proper > > bool JSObject::putDirectMayBeIndex(ExecState* exec, PropertyName propertyName, JSValue value) > { >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return putDirectIndex(exec, index.value(), value); > return putDirect(exec->vm(), propertyName, value); > } >@@ -3641,7 +3641,7 @@ bool JSObject::defineOwnNonIndexProperty(ExecState* exec, PropertyName propertyN > bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const PropertyDescriptor& descriptor, bool throwException) > { > // If it's an array index, then use the indexed property storage. >- if (std::optional<uint32_t> index = parseIndex(propertyName)) { >+ if (Optional<uint32_t> index = parseIndex(propertyName)) { > // c. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing P, Desc, and false as arguments. > // d. Reject if succeeded is false. > // e. If index >= oldLen >diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h >index a634ae1350525091f5960fa46db13d5f19cc95a9..192db5eeea713e617b71219af7f749a20ea0481f 100644 >--- a/Source/JavaScriptCore/runtime/JSObject.h >+++ b/Source/JavaScriptCore/runtime/JSObject.h >@@ -1046,7 +1046,7 @@ private: > const HashTable* table; > const HashTableValue* value; > }; >- std::optional<PropertyHashEntry> findPropertyHashEntry(VM&, PropertyName) const; >+ Optional<PropertyHashEntry> findPropertyHashEntry(VM&, PropertyName) const; > > bool putByIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, bool shouldThrow); > bool putDirectIndexBeyondVectorLengthWithArrayStorage(ExecState*, unsigned propertyName, JSValue, unsigned attributes, PutDirectIndexMode, ArrayStorage*); >@@ -1399,7 +1399,7 @@ ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSObject* object, ExecState* exe > Structure* structure = object->structure(vm); > if (object->getOwnNonIndexPropertySlot(vm, structure, propertyName, slot)) > return true; >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return getOwnPropertySlotByIndex(object, exec, index.value(), slot); > return false; > } >@@ -1418,7 +1418,7 @@ ALWAYS_INLINE bool JSObject::getPropertySlot(ExecState* exec, PropertyName prope > // getOwnNonIndexPropertySlot), so we cannot safely call the overridden getOwnPropertySlot > // (lest we return a property from a prototype that is shadowed). Check now for an index, > // if so we need to start afresh from this object. >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return getPropertySlot(exec, index.value(), slot); > // Safe to continue searching from current position; call getNonIndexPropertySlot to avoid > // parsing the int again. >@@ -1440,7 +1440,7 @@ ALWAYS_INLINE bool JSObject::getPropertySlot(ExecState* exec, PropertyName prope > object = asObject(prototype); > } > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return getPropertySlot(exec, index.value(), slot); > return false; > } >@@ -1489,7 +1489,7 @@ inline bool JSObject::putOwnDataPropertyMayBeIndex(ExecState* exec, PropertyName > ASSERT(!structure(vm)->hasGetterSetterProperties()); > ASSERT(!structure(vm)->hasCustomGetterSetterProperties()); > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return putDirectIndex(exec, index.value(), value, 0, PutDirectIndexLikePutDirect); > > return putDirectInternal<PutModePut>(vm, propertyName, value, 0, slot); >diff --git a/Source/JavaScriptCore/runtime/JSObjectInlines.h b/Source/JavaScriptCore/runtime/JSObjectInlines.h >index 722228380d45f2b646b03c08222c6be7b3e12a3d..d302efebc077e4fbd030149c59a8f62ce98daa84 100644 >--- a/Source/JavaScriptCore/runtime/JSObjectInlines.h >+++ b/Source/JavaScriptCore/runtime/JSObjectInlines.h >@@ -232,7 +232,7 @@ ALWAYS_INLINE bool JSObject::putInlineForJSObject(JSCell* cell, ExecState* exec, > > // Try indexed put first. This is required for correctness, since loads on property names that appear like > // valid indices will never look in the named property storage. >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > RELEASE_AND_RETURN(scope, putByIndex(thisObject, exec, index.value(), value, slot.isStrictMode())); > > if (thisObject->canPerformFastPutInline(vm, propertyName)) { >diff --git a/Source/JavaScriptCore/runtime/JSRunLoopTimer.cpp b/Source/JavaScriptCore/runtime/JSRunLoopTimer.cpp >index a56e462d4bbdee012224ec5976bfbd02a5cc5a11..2a78af8d02792e9324d718135bf2e80f49ef3a7a 100644 >--- a/Source/JavaScriptCore/runtime/JSRunLoopTimer.cpp >+++ b/Source/JavaScriptCore/runtime/JSRunLoopTimer.cpp >@@ -255,7 +255,7 @@ void JSRunLoopTimer::Manager::cancelTimer(JSRunLoopTimer& timer) > #endif > } > >-std::optional<Seconds> JSRunLoopTimer::Manager::timeUntilFire(JSRunLoopTimer& timer) >+Optional<Seconds> JSRunLoopTimer::Manager::timeUntilFire(JSRunLoopTimer& timer) > { > auto locker = holdLock(m_lock); > auto iter = m_mapping.find(timer.m_apiLock); >@@ -269,7 +269,7 @@ std::optional<Seconds> JSRunLoopTimer::Manager::timeUntilFire(JSRunLoopTimer& ti > } > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > #if USE(CF) >@@ -316,7 +316,7 @@ JSRunLoopTimer::~JSRunLoopTimer() > { > } > >-std::optional<Seconds> JSRunLoopTimer::timeUntilFire() >+Optional<Seconds> JSRunLoopTimer::timeUntilFire() > { > return Manager::shared().timeUntilFire(*this); > } >diff --git a/Source/JavaScriptCore/runtime/JSRunLoopTimer.h b/Source/JavaScriptCore/runtime/JSRunLoopTimer.h >index 6651672739eb9dca8f1ffcdbe735beda5af17240..b9a2f43a8798aaa316c5d5f5ea3625fc00b174d8 100644 >--- a/Source/JavaScriptCore/runtime/JSRunLoopTimer.h >+++ b/Source/JavaScriptCore/runtime/JSRunLoopTimer.h >@@ -65,7 +65,7 @@ public: > void scheduleTimer(JSRunLoopTimer&, Seconds nextFireTime); > void cancelTimer(JSRunLoopTimer&); > >- std::optional<Seconds> timeUntilFire(JSRunLoopTimer&); >+ Optional<Seconds> timeUntilFire(JSRunLoopTimer&); > > #if USE(CF) > void didChangeRunLoop(VM&, CFRunLoopRef newRunLoop); >@@ -116,7 +116,7 @@ public: > JS_EXPORT_PRIVATE void addTimerSetNotification(TimerNotificationCallback); > JS_EXPORT_PRIVATE void removeTimerSetNotification(TimerNotificationCallback); > >- JS_EXPORT_PRIVATE std::optional<Seconds> timeUntilFire(); >+ JS_EXPORT_PRIVATE Optional<Seconds> timeUntilFire(); > > protected: > static const Seconds s_decade; >diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp >index 0303cbdfd790efdcde84adf877f100b6baa797d6..d95e25cd02c7d5d32fa312410e97e6c512941298 100644 >--- a/Source/JavaScriptCore/runtime/JSString.cpp >+++ b/Source/JavaScriptCore/runtime/JSString.cpp >@@ -444,7 +444,7 @@ bool JSString::getStringPropertyDescriptor(ExecState* exec, PropertyName propert > return true; > } > >- std::optional<uint32_t> index = parseIndex(propertyName); >+ Optional<uint32_t> index = parseIndex(propertyName); > if (index && index.value() < length()) { > descriptor.setDescriptor(getIndex(exec, index.value()), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); > return true; >diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h >index e0c04deb3821beae2431c6e1796534b3fd829f13..57d7f9040240f06f700fb88dd1233134c374f1af 100644 >--- a/Source/JavaScriptCore/runtime/JSString.h >+++ b/Source/JavaScriptCore/runtime/JSString.h >@@ -694,7 +694,7 @@ ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, PropertyName > return true; > } > >- std::optional<uint32_t> index = parseIndex(propertyName); >+ Optional<uint32_t> index = parseIndex(propertyName); > if (index && index.value() < length()) { > JSValue value = getIndex(exec, index.value()); > RETURN_IF_EXCEPTION(scope, false); >diff --git a/Source/JavaScriptCore/runtime/LiteralParser.cpp b/Source/JavaScriptCore/runtime/LiteralParser.cpp >index 20c8c9bb6aebc14d812558e565d4595e049452e9..84939b5e21745770a2cf5558424c77adde5c8f85 100644 >--- a/Source/JavaScriptCore/runtime/LiteralParser.cpp >+++ b/Source/JavaScriptCore/runtime/LiteralParser.cpp >@@ -935,7 +935,7 @@ JSValue LiteralParser<CharType>::parse(ParserState initialState) > PutPropertySlot slot(object, codeBlock ? codeBlock->isStrictMode() : false); > objectStack.last().put(m_exec, ident, lastValue, slot); > } else { >- if (std::optional<uint32_t> index = parseIndex(ident)) >+ if (Optional<uint32_t> index = parseIndex(ident)) > object->putDirectIndex(m_exec, index.value(), lastValue); > else > object->putDirect(vm, ident, lastValue); >diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h >index 46f155451d0651b8b1fccbd25f62db91029fe994..823964c2b8d7eb0b91ca0c289f7b69cfefdd34fe 100644 >--- a/Source/JavaScriptCore/runtime/MachineContext.h >+++ b/Source/JavaScriptCore/runtime/MachineContext.h >@@ -45,7 +45,7 @@ template<typename T = void*> T framePointer(const PlatformRegisters&); > template<typename T = void*> void setFramePointer(PlatformRegisters&, T); > inline MacroAssemblerCodePtr<PlatformRegistersLRPtrTag> linkRegister(const PlatformRegisters&); > inline void setLinkRegister(PlatformRegisters&, MacroAssemblerCodePtr<CFunctionPtrTag>); >-inline std::optional<MacroAssemblerCodePtr<PlatformRegistersPCPtrTag>> instructionPointer(const PlatformRegisters&); >+inline Optional<MacroAssemblerCodePtr<PlatformRegistersPCPtrTag>> instructionPointer(const PlatformRegisters&); > inline void setInstructionPointer(PlatformRegisters&, MacroAssemblerCodePtr<CFunctionPtrTag>); > > template<size_t N> void*& argumentPointer(PlatformRegisters&); >@@ -432,7 +432,7 @@ static inline void*& instructionPointerImpl(PlatformRegisters& regs) > } > #endif // !USE(PLATFORM_REGISTERS_WITH_PROFILE) > >-inline std::optional<MacroAssemblerCodePtr<PlatformRegistersPCPtrTag>> instructionPointer(const PlatformRegisters& regs) >+inline Optional<MacroAssemblerCodePtr<PlatformRegistersPCPtrTag>> instructionPointer(const PlatformRegisters& regs) > { > #if USE(PLATFORM_REGISTERS_WITH_PROFILE) > void* value = WTF_READ_PLATFORM_REGISTERS_PC_WITH_PROFILE(regs); >@@ -445,7 +445,7 @@ inline std::optional<MacroAssemblerCodePtr<PlatformRegistersPCPtrTag>> instructi > return MacroAssemblerCodePtr<PlatformRegistersPCPtrTag>(value); > if (isTaggedWith(value, PlatformRegistersPCPtrTag)) > return MacroAssemblerCodePtr<PlatformRegistersPCPtrTag>(value); >- return std::nullopt; >+ return WTF::nullopt; > } > > inline void setInstructionPointer(PlatformRegisters& regs, MacroAssemblerCodePtr<CFunctionPtrTag> value) >diff --git a/Source/JavaScriptCore/runtime/MathCommon.h b/Source/JavaScriptCore/runtime/MathCommon.h >index eda3fa59fb5a6dee614df62b6787f5b999d5847e..5a0aebe0780291ad1f69d84e354e1d083716f353 100644 >--- a/Source/JavaScriptCore/runtime/MathCommon.h >+++ b/Source/JavaScriptCore/runtime/MathCommon.h >@@ -156,15 +156,15 @@ inline uint32_t toUInt32(double number) > return toInt32(number); > } > >-inline std::optional<double> safeReciprocalForDivByConst(double constant) >+inline Optional<double> safeReciprocalForDivByConst(double constant) > { > // No "weird" numbers (NaN, Denormal, etc). > if (!constant || !std::isnormal(constant)) >- return std::nullopt; >+ return WTF::nullopt; > > int exponent; > if (std::frexp(constant, &exponent) != 0.5) >- return std::nullopt; >+ return WTF::nullopt; > > // Note that frexp() returns the value divided by two > // so we to offset this exponent by one. >@@ -173,7 +173,7 @@ inline std::optional<double> safeReciprocalForDivByConst(double constant) > // A double exponent is between -1022 and 1023. > // Nothing we can do to invert 1023. > if (exponent == 1023) >- return std::nullopt; >+ return WTF::nullopt; > > double reciprocal = std::ldexp(1, -exponent); > ASSERT(std::isnormal(reciprocal)); >diff --git a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp >index 275b56f7ccec7b4b1610d61da6233d0625f2d88e..1bd8930834fd680204d3bb86cee2cad0d0c59d46 100644 >--- a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp >+++ b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp >@@ -103,7 +103,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncHasOwnProperty(ExecState* exec) > > Structure* structure = thisObject->structure(vm); > HasOwnPropertyCache* hasOwnPropertyCache = vm.ensureHasOwnPropertyCache(); >- if (std::optional<bool> result = hasOwnPropertyCache->get(structure, propertyName)) { >+ if (Optional<bool> result = hasOwnPropertyCache->get(structure, propertyName)) { > ASSERT(*result == thisObject->hasOwnProperty(exec, propertyName)); > scope.assertNoException(); > return JSValue::encode(jsBoolean(*result)); >diff --git a/Source/JavaScriptCore/runtime/PropertyDescriptor.h b/Source/JavaScriptCore/runtime/PropertyDescriptor.h >index aeeae530427df423632c79ced0f6677c3c835982..d7b2bfbe03381921e1178f90df07dda98597e53e 100644 >--- a/Source/JavaScriptCore/runtime/PropertyDescriptor.h >+++ b/Source/JavaScriptCore/runtime/PropertyDescriptor.h >@@ -98,16 +98,16 @@ inline PropertyDescriptor toPropertyDescriptor(JSValue value, JSValue getter, JS > // We assume that validation is already done. > PropertyDescriptor desc; > >- if (std::optional<bool> enumerable = attributes.enumerable()) >+ if (Optional<bool> enumerable = attributes.enumerable()) > desc.setEnumerable(enumerable.value()); > >- if (std::optional<bool> configurable = attributes.configurable()) >+ if (Optional<bool> configurable = attributes.configurable()) > desc.setConfigurable(configurable.value()); > > if (attributes.hasValue()) > desc.setValue(value); > >- if (std::optional<bool> writable = attributes.writable()) >+ if (Optional<bool> writable = attributes.writable()) > desc.setWritable(writable.value()); > > if (attributes.hasGet()) >diff --git a/Source/JavaScriptCore/runtime/PropertyName.h b/Source/JavaScriptCore/runtime/PropertyName.h >index a4740ced3d2470ff6598bcc21b4d7ea07ec3d0c4..c035fa68a18d1be04c5cc8d29566f5337adc541e 100644 >--- a/Source/JavaScriptCore/runtime/PropertyName.h >+++ b/Source/JavaScriptCore/runtime/PropertyName.h >@@ -120,13 +120,13 @@ inline bool operator!=(PropertyName a, PropertyName b) > return a.uid() != b.uid(); > } > >-ALWAYS_INLINE std::optional<uint32_t> parseIndex(PropertyName propertyName) >+ALWAYS_INLINE Optional<uint32_t> parseIndex(PropertyName propertyName) > { > auto uid = propertyName.uid(); > if (!uid) >- return std::nullopt; >+ return WTF::nullopt; > if (uid->isSymbol()) >- return std::nullopt; >+ return WTF::nullopt; > return parseIndex(*uid); > } > >diff --git a/Source/JavaScriptCore/runtime/PropertySlot.h b/Source/JavaScriptCore/runtime/PropertySlot.h >index e0e690480e8c4541183bb679f8c7d1349e082995..e1969232fd612956b7e756a744cae14384b10167 100644 >--- a/Source/JavaScriptCore/runtime/PropertySlot.h >+++ b/Source/JavaScriptCore/runtime/PropertySlot.h >@@ -187,11 +187,11 @@ public: > return m_watchpointSet; > } > >- std::optional<DOMAttributeAnnotation> domAttribute() const >+ Optional<DOMAttributeAnnotation> domAttribute() const > { > if (m_additionalDataType == AdditionalDataType::DOMAttribute) > return m_additionalData.domAttribute; >- return std::nullopt; >+ return WTF::nullopt; > } > > struct ModuleNamespaceSlot { >@@ -199,11 +199,11 @@ public: > unsigned scopeOffset; > }; > >- std::optional<ModuleNamespaceSlot> moduleNamespaceSlot() const >+ Optional<ModuleNamespaceSlot> moduleNamespaceSlot() const > { > if (m_additionalDataType == AdditionalDataType::ModuleNamespace) > return m_additionalData.moduleNamespaceSlot; >- return std::nullopt; >+ return WTF::nullopt; > } > > void setValue(JSObject* slotBase, unsigned attributes, JSValue value) >diff --git a/Source/JavaScriptCore/runtime/SamplingProfiler.cpp b/Source/JavaScriptCore/runtime/SamplingProfiler.cpp >index 551fe34c4fdb354321eb179a004a9baffc386994..17a1b5931af286ca884328ed2dd59bec706ad25f 100644 >--- a/Source/JavaScriptCore/runtime/SamplingProfiler.cpp >+++ b/Source/JavaScriptCore/runtime/SamplingProfiler.cpp >@@ -605,7 +605,7 @@ void SamplingProfiler::processUnverifiedStackTraces() > } > } else { > #if ENABLE(JIT) >- if (std::optional<CodeOrigin> codeOrigin = topCodeBlock->findPC(unprocessedStackTrace.topPC)) { >+ if (Optional<CodeOrigin> codeOrigin = topCodeBlock->findPC(unprocessedStackTrace.topPC)) { > appendCodeOrigin(topCodeBlock, *codeOrigin); > storeCalleeIntoLastFrame(unprocessedStackTrace.frames[0].unverifiedCallee); > startIndex = 1; >@@ -1044,7 +1044,7 @@ void SamplingProfiler::reportTopBytecodes(PrintStream& out) > > StackFrame& frame = stackTrace.frames.first(); > String frameDescription = makeString(frame.displayName(m_vm), descriptionForLocation(frame.semanticLocation)); >- if (std::optional<std::pair<StackFrame::CodeLocation, CodeBlock*>> machineLocation = frame.machineLocation) { >+ if (Optional<std::pair<StackFrame::CodeLocation, CodeBlock*>> machineLocation = frame.machineLocation) { > frameDescription = makeString(frameDescription, " <-- ", > machineLocation->second->inferredName().data(), descriptionForLocation(machineLocation->first)); > } >diff --git a/Source/JavaScriptCore/runtime/SamplingProfiler.h b/Source/JavaScriptCore/runtime/SamplingProfiler.h >index 32a1b48a0b0be6591410d966c52c8a96821ea3f0..c79ae7595f266ad9d03352b1cb011a505bfd661d 100644 >--- a/Source/JavaScriptCore/runtime/SamplingProfiler.h >+++ b/Source/JavaScriptCore/runtime/SamplingProfiler.h >@@ -112,7 +112,7 @@ public: > }; > > CodeLocation semanticLocation; >- std::optional<std::pair<CodeLocation, CodeBlock*>> machineLocation; // This is non-null if we were inlined. It represents the machine frame we were inlined into. >+ Optional<std::pair<CodeLocation, CodeBlock*>> machineLocation; // This is non-null if we were inlined. It represents the machine frame we were inlined into. > > bool hasExpressionInfo() const { return semanticLocation.hasExpressionInfo(); } > unsigned lineNumber() const >diff --git a/Source/JavaScriptCore/runtime/StringObject.cpp b/Source/JavaScriptCore/runtime/StringObject.cpp >index 234ef89f54f0c9173ae60e5e8f43f410cd8be675..980c0725fe71c35b47e162f2e5c4ff2836e86ee7 100644 >--- a/Source/JavaScriptCore/runtime/StringObject.cpp >+++ b/Source/JavaScriptCore/runtime/StringObject.cpp >@@ -72,7 +72,7 @@ bool StringObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, > > if (propertyName == vm.propertyNames->length) > return typeError(exec, scope, slot.isStrictMode(), ReadonlyPropertyWriteError); >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > RELEASE_AND_RETURN(scope, putByIndex(cell, exec, index.value(), value, slot.isStrictMode())); > RELEASE_AND_RETURN(scope, JSObject::put(cell, exec, propertyName, value, slot)); > } >@@ -93,7 +93,7 @@ static bool isStringOwnProperty(ExecState* exec, StringObject* object, PropertyN > VM& vm = exec->vm(); > if (propertyName == vm.propertyNames->length) > return true; >- if (std::optional<uint32_t> index = parseIndex(propertyName)) { >+ if (Optional<uint32_t> index = parseIndex(propertyName)) { > if (object->internalValue()->canGetIndex(index.value())) > return true; > } >@@ -130,7 +130,7 @@ bool StringObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName pr > StringObject* thisObject = jsCast<StringObject*>(cell); > if (propertyName == vm.propertyNames->length) > return false; >- std::optional<uint32_t> index = parseIndex(propertyName); >+ Optional<uint32_t> index = parseIndex(propertyName); > if (index && thisObject->internalValue()->canGetIndex(index.value())) > return false; > return JSObject::deleteProperty(thisObject, exec, propertyName); >diff --git a/Source/JavaScriptCore/runtime/TemplateObjectDescriptor.h b/Source/JavaScriptCore/runtime/TemplateObjectDescriptor.h >index bbe92ed9d1e164bb61ec5538874f873c487622c3..1ef8e5adfaa05dce3439fc4dab7d466a4930786c 100644 >--- a/Source/JavaScriptCore/runtime/TemplateObjectDescriptor.h >+++ b/Source/JavaScriptCore/runtime/TemplateObjectDescriptor.h >@@ -37,7 +37,7 @@ class TemplateObjectDescriptorTable; > class TemplateObjectDescriptor : public RefCounted<TemplateObjectDescriptor> { > public: > typedef Vector<String, 4> StringVector; >- typedef Vector<std::optional<String>, 4> OptionalStringVector; >+ typedef Vector<Optional<String>, 4> OptionalStringVector; > > enum DeletedValueTag { DeletedValue }; > TemplateObjectDescriptor(DeletedValueTag); >diff --git a/Source/JavaScriptCore/runtime/ToNativeFromValue.h b/Source/JavaScriptCore/runtime/ToNativeFromValue.h >index fd618432777ceb995439f8f585a738da84c265e8..5e971cb08e9ca50cbe05c940242b4fd797abc0db 100644 >--- a/Source/JavaScriptCore/runtime/ToNativeFromValue.h >+++ b/Source/JavaScriptCore/runtime/ToNativeFromValue.h >@@ -48,10 +48,10 @@ typename Adaptor::Type toNativeFromValue(ExecState* exec, JSValue value) > } > > template<typename Adaptor> >-std::optional<typename Adaptor::Type> toNativeFromValueWithoutCoercion(JSValue value) >+Optional<typename Adaptor::Type> toNativeFromValueWithoutCoercion(JSValue value) > { > if (!value.isNumber()) >- return std::nullopt; >+ return WTF::nullopt; > if (value.isInt32()) > return Adaptor::toNativeFromInt32WithoutCoercion(value.asInt32()); > return Adaptor::toNativeFromDoubleWithoutCoercion(value.asDouble()); >diff --git a/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h b/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h >index 0af71f4c61fc242ca8a79107fcbb6fc56315abc3..06f4d9e4b7cecac45f9ede5c89f55f8ade12ac89 100644 >--- a/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h >+++ b/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h >@@ -79,26 +79,26 @@ struct IntegralTypedArrayAdaptor { > return OtherAdaptor::toNativeFromInt32(value); > } > >- static std::optional<Type> toNativeFromInt32WithoutCoercion(int32_t value) >+ static Optional<Type> toNativeFromInt32WithoutCoercion(int32_t value) > { > if ((value >= 0 && static_cast<uint32_t>(value) > static_cast<uint32_t>(maxValue)) || value < static_cast<int32_t>(minValue)) >- return std::nullopt; >+ return WTF::nullopt; > return static_cast<Type>(value); > } > >- static std::optional<Type> toNativeFromUint32WithoutCoercion(uint32_t value) >+ static Optional<Type> toNativeFromUint32WithoutCoercion(uint32_t value) > { > if (value > static_cast<uint32_t>(maxValue)) >- return std::nullopt; >+ return WTF::nullopt; > > return static_cast<Type>(value); > } > >- static std::optional<Type> toNativeFromDoubleWithoutCoercion(double value) >+ static Optional<Type> toNativeFromDoubleWithoutCoercion(double value) > { > Type integer = static_cast<Type>(value); > if (static_cast<double>(integer) != value) >- return std::nullopt; >+ return WTF::nullopt; > > if (value < 0) > return toNativeFromInt32WithoutCoercion(static_cast<int32_t>(value)); >@@ -149,12 +149,12 @@ struct FloatTypedArrayAdaptor { > return OtherAdaptor::toNativeFromDouble(value); > } > >- static std::optional<Type> toNativeFromInt32WithoutCoercion(int32_t value) >+ static Optional<Type> toNativeFromInt32WithoutCoercion(int32_t value) > { > return static_cast<Type>(value); > } > >- static std::optional<Type> toNativeFromDoubleWithoutCoercion(double value) >+ static Optional<Type> toNativeFromDoubleWithoutCoercion(double value) > { > if (std::isnan(value) || std::isinf(value)) > return static_cast<Type>(value); >@@ -162,10 +162,10 @@ struct FloatTypedArrayAdaptor { > Type valueResult = static_cast<Type>(value); > > if (static_cast<double>(valueResult) != value) >- return std::nullopt; >+ return WTF::nullopt; > > if (value < minValue || value > maxValue) >- return std::nullopt; >+ return WTF::nullopt; > > return valueResult; > } >@@ -255,19 +255,19 @@ struct Uint8ClampedAdaptor { > return OtherAdaptor::toNativeFromInt32(value); > } > >- static std::optional<Type> toNativeFromInt32WithoutCoercion(int32_t value) >+ static Optional<Type> toNativeFromInt32WithoutCoercion(int32_t value) > { > if (value > maxValue || value < minValue) >- return std::nullopt; >+ return WTF::nullopt; > > return static_cast<Type>(value); > } > >- static std::optional<Type> toNativeFromDoubleWithoutCoercion(double value) >+ static Optional<Type> toNativeFromDoubleWithoutCoercion(double value) > { > uint8_t integer = static_cast<uint8_t>(value); > if (static_cast<double>(integer) != value) >- return std::nullopt; >+ return WTF::nullopt; > > return integer; > } >diff --git a/Source/JavaScriptCore/runtime/VM.h b/Source/JavaScriptCore/runtime/VM.h >index 8ae7d966fea3bd9d9c22034bbb3550eb15fd25c7..f42c74df16195ef849b24f46c6d4961fa23ca842 100644 >--- a/Source/JavaScriptCore/runtime/VM.h >+++ b/Source/JavaScriptCore/runtime/VM.h >@@ -874,7 +874,7 @@ public: > template<typename Func> > void logEvent(CodeBlock*, const char* summary, const Func& func); > >- std::optional<RefPtr<Thread>> ownerThread() const { return m_apiLock->ownerThread(); } >+ Optional<RefPtr<Thread>> ownerThread() const { return m_apiLock->ownerThread(); } > > VMTraps& traps() { return m_traps; } > >diff --git a/Source/JavaScriptCore/runtime/VMTraps.cpp b/Source/JavaScriptCore/runtime/VMTraps.cpp >index 7ffc586091ccc1d538b986717079d1094e9d5d2c..e66866c1851b6ad670bc957fbd7014d1183eb414 100644 >--- a/Source/JavaScriptCore/runtime/VMTraps.cpp >+++ b/Source/JavaScriptCore/runtime/VMTraps.cpp >@@ -64,11 +64,11 @@ private: > { } > > public: >- static std::optional<SignalContext> tryCreate(PlatformRegisters& registers) >+ static Optional<SignalContext> tryCreate(PlatformRegisters& registers) > { > auto instructionPointer = MachineContext::instructionPointer(registers); > if (!instructionPointer) >- return std::nullopt; >+ return WTF::nullopt; > return SignalContext(registers, *instructionPointer); > } > >diff --git a/Source/JavaScriptCore/tools/JSDollarVM.cpp b/Source/JavaScriptCore/tools/JSDollarVM.cpp >index a6eb1c29846d96200eade0b2be0196388c554660..53c5c46fee0f47fabeadd859eed2d131ca31fd5e 100644 >--- a/Source/JavaScriptCore/tools/JSDollarVM.cpp >+++ b/Source/JavaScriptCore/tools/JSDollarVM.cpp >@@ -445,7 +445,7 @@ public: > return true; > } > >- std::optional<uint32_t> index = parseIndex(propertyName); >+ Optional<uint32_t> index = parseIndex(propertyName); > if (index && index.value() < thisObject->getLength()) { > slot.setValue(thisObject, PropertyAttribute::DontDelete | PropertyAttribute::DontEnum, jsNumber(thisObject->m_vector[index.value()])); > return true; >diff --git a/Source/JavaScriptCore/tools/SigillCrashAnalyzer.cpp b/Source/JavaScriptCore/tools/SigillCrashAnalyzer.cpp >index 4165ea4afd913ce2df18030dbff8862042353ec0..5a9d99a644c385e653c3cb953f1227e14e14011e 100644 >--- a/Source/JavaScriptCore/tools/SigillCrashAnalyzer.cpp >+++ b/Source/JavaScriptCore/tools/SigillCrashAnalyzer.cpp >@@ -87,11 +87,11 @@ private: > { } > > public: >- static std::optional<SignalContext> tryCreate(PlatformRegisters& registers) >+ static Optional<SignalContext> tryCreate(PlatformRegisters& registers) > { > auto instructionPointer = MachineContext::instructionPointer(registers); > if (!instructionPointer) >- return std::nullopt; >+ return WTF::nullopt; > return SignalContext(registers, *instructionPointer); > } > >diff --git a/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp b/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp >index 86c3a8f8298d834d3311fc5de55d192b30d04c61..73ec8bde1b1892386e30ebea516ee0275f3f3856 100644 >--- a/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp >+++ b/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp >@@ -227,7 +227,7 @@ public: > void dump(const Vector<ControlEntry>& controlStack, const ExpressionList* expressionStack); > void setParser(FunctionParser<B3IRGenerator>* parser) { m_parser = parser; }; > >- Value* constant(B3::Type, uint64_t bits, std::optional<Origin> = std::nullopt); >+ Value* constant(B3::Type, uint64_t bits, Optional<Origin> = WTF::nullopt); > void insertConstants(); > > private: >@@ -503,7 +503,7 @@ void B3IRGenerator::emitExceptionCheck(CCallHelpers& jit, ExceptionType type) > }); > } > >-Value* B3IRGenerator::constant(B3::Type type, uint64_t bits, std::optional<Origin> maybeOrigin) >+Value* B3IRGenerator::constant(B3::Type type, uint64_t bits, Optional<Origin> maybeOrigin) > { > auto result = m_constantPool.ensure(ValueKey(opcodeForConstant(type), type, static_cast<int64_t>(bits)), [&] { > Value* result = m_proc.addConstant(maybeOrigin ? *maybeOrigin : origin(), type, bits); >diff --git a/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp b/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp >index 22a65c3110cfc8cdb94cd105fb6d7c3e53e770a8..1351d4587b737108208a5512361dd2b555dfdb1e 100644 >--- a/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp >+++ b/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp >@@ -239,7 +239,7 @@ void BBQPlan::compileFunctions(CompilationEffort effort) > if (!hasWork()) > return; > >- std::optional<TraceScope> traceScope; >+ Optional<TraceScope> traceScope; > if (Options::useTracePoints()) > traceScope.emplace(WebAssemblyCompileStart, WebAssemblyCompileEnd); > ThreadCountHolder holder(*this); >diff --git a/Source/JavaScriptCore/wasm/WasmFormat.h b/Source/JavaScriptCore/wasm/WasmFormat.h >index 4632394db2ce3c258fedd76ea013eba5d175b733..fc69ee5c58a4fac31ac97b4e16ac604f2a14ae8d 100644 >--- a/Source/JavaScriptCore/wasm/WasmFormat.h >+++ b/Source/JavaScriptCore/wasm/WasmFormat.h >@@ -212,7 +212,7 @@ public: > ASSERT(!*this); > } > >- TableInformation(uint32_t initial, std::optional<uint32_t> maximum, bool isImport) >+ TableInformation(uint32_t initial, Optional<uint32_t> maximum, bool isImport) > : m_initial(initial) > , m_maximum(maximum) > , m_isImport(isImport) >@@ -224,11 +224,11 @@ public: > explicit operator bool() const { return m_isValid; } > bool isImport() const { return m_isImport; } > uint32_t initial() const { return m_initial; } >- std::optional<uint32_t> maximum() const { return m_maximum; } >+ Optional<uint32_t> maximum() const { return m_maximum; } > > private: > uint32_t m_initial; >- std::optional<uint32_t> m_maximum; >+ Optional<uint32_t> m_maximum; > bool m_isImport { false }; > bool m_isValid { false }; > }; >diff --git a/Source/JavaScriptCore/wasm/WasmModuleInformation.h b/Source/JavaScriptCore/wasm/WasmModuleInformation.h >index aa7bfc0c9476980300223e185c85cc95041f402c..ad5eb9526ac7ac3be437fc623df0bd7dc20807d2 100644 >--- a/Source/JavaScriptCore/wasm/WasmModuleInformation.h >+++ b/Source/JavaScriptCore/wasm/WasmModuleInformation.h >@@ -76,7 +76,7 @@ struct ModuleInformation : public ThreadSafeRefCounted<ModuleInformation> { > Vector<FunctionData> functions; > > Vector<Export> exports; >- std::optional<uint32_t> startFunctionIndexSpace; >+ Optional<uint32_t> startFunctionIndexSpace; > Vector<Segment::Ptr> data; > Vector<Element> elements; > TableInformation tableInformation; >diff --git a/Source/JavaScriptCore/wasm/WasmNameSection.h b/Source/JavaScriptCore/wasm/WasmNameSection.h >index fe63cf5547366fc1740c1f0c70ba81be7536a88e..bc2ebdfc110330468fb1681010975beda2e76d5f 100644 >--- a/Source/JavaScriptCore/wasm/WasmNameSection.h >+++ b/Source/JavaScriptCore/wasm/WasmNameSection.h >@@ -39,7 +39,7 @@ struct NameSection : public ThreadSafeRefCounted<NameSection> { > public: > NameSection() > { >- setHash(std::nullopt); >+ setHash(WTF::nullopt); > } > > static Ref<NameSection> create() >@@ -47,7 +47,7 @@ public: > return adoptRef(*new NameSection); > } > >- void setHash(const std::optional<CString> &hash) >+ void setHash(const Optional<CString> &hash) > { > moduleHash = Name(hash ? hash->length() : 3); > if (hash) { >diff --git a/Source/JavaScriptCore/wasm/WasmSectionParser.cpp b/Source/JavaScriptCore/wasm/WasmSectionParser.cpp >index ae8725d079cc3c9c88200470dc0bff7be7644fcb..a3c41f85b32232f514fd8e383c334f84c6d5d33f 100644 >--- a/Source/JavaScriptCore/wasm/WasmSectionParser.cpp >+++ b/Source/JavaScriptCore/wasm/WasmSectionParser.cpp >@@ -171,7 +171,7 @@ auto SectionParser::parseFunction() -> PartialResult > return { }; > } > >-auto SectionParser::parseResizableLimits(uint32_t& initial, std::optional<uint32_t>& maximum) -> PartialResult >+auto SectionParser::parseResizableLimits(uint32_t& initial, Optional<uint32_t>& maximum) -> PartialResult > { > ASSERT(!maximum); > >@@ -198,7 +198,7 @@ auto SectionParser::parseTableHelper(bool isImport) -> PartialResult > WASM_PARSER_FAIL_IF(type != Wasm::Anyfunc, "Table type should be anyfunc, got ", type); > > uint32_t initial; >- std::optional<uint32_t> maximum; >+ Optional<uint32_t> maximum; > PartialResult limits = parseResizableLimits(initial, maximum); > if (UNLIKELY(!limits)) > return makeUnexpected(WTFMove(limits.error())); >@@ -236,7 +236,7 @@ auto SectionParser::parseMemoryHelper(bool isImport) -> PartialResult > PageCount maximumPageCount; > { > uint32_t initial; >- std::optional<uint32_t> maximum; >+ Optional<uint32_t> maximum; > PartialResult limits = parseResizableLimits(initial, maximum); > if (UNLIKELY(!limits)) > return makeUnexpected(WTFMove(limits.error())); >diff --git a/Source/JavaScriptCore/wasm/WasmSectionParser.h b/Source/JavaScriptCore/wasm/WasmSectionParser.h >index 78d02836fc9f32bc2b78fbf90ad2c5da9f91283d..2c1318a3a643529ca042106f66319b6e3cd2fbb9 100644 >--- a/Source/JavaScriptCore/wasm/WasmSectionParser.h >+++ b/Source/JavaScriptCore/wasm/WasmSectionParser.h >@@ -62,7 +62,7 @@ private: > PartialResult WARN_UNUSED_RETURN parseGlobalType(Global&); > PartialResult WARN_UNUSED_RETURN parseMemoryHelper(bool isImport); > PartialResult WARN_UNUSED_RETURN parseTableHelper(bool isImport); >- PartialResult WARN_UNUSED_RETURN parseResizableLimits(uint32_t& initial, std::optional<uint32_t>& maximum); >+ PartialResult WARN_UNUSED_RETURN parseResizableLimits(uint32_t& initial, Optional<uint32_t>& maximum); > PartialResult WARN_UNUSED_RETURN parseInitExpr(uint8_t&, uint64_t&, Type& initExprType); > > size_t m_offsetInSource; >diff --git a/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp b/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp >index 9f372601d51332be25e07e0518235994eb4c0899..8c69c73b5e286cc1e482f93cb2a54598a725d3a5 100644 >--- a/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp >+++ b/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp >@@ -47,14 +47,14 @@ static constexpr bool verbose = false; > } \ > } while (0) > >-ALWAYS_INLINE std::optional<uint8_t> parseUInt7(const uint8_t* data, size_t& offset, size_t size) >+ALWAYS_INLINE Optional<uint8_t> parseUInt7(const uint8_t* data, size_t& offset, size_t size) > { > if (offset >= size) > return false; > uint8_t result = data[offset++]; > if (result < 0x80) > return result; >- return std::nullopt; >+ return WTF::nullopt; > } > > template <typename ...Args> >@@ -173,7 +173,7 @@ auto StreamingParser::parseSectionPayload(Vector<uint8_t>&& data) -> State > return State::SectionID; > } > >-auto StreamingParser::consume(const uint8_t* bytes, size_t bytesSize, size_t& offsetInBytes, size_t requiredSize) -> std::optional<Vector<uint8_t>> >+auto StreamingParser::consume(const uint8_t* bytes, size_t bytesSize, size_t& offsetInBytes, size_t requiredSize) -> Optional<Vector<uint8_t>> > { > if (m_remaining.size() == requiredSize) { > Vector<uint8_t> result = WTFMove(m_remaining); >@@ -195,7 +195,7 @@ auto StreamingParser::consume(const uint8_t* bytes, size_t bytesSize, size_t& of > if (totalDataSize < requiredSize) { > m_remaining.append(bytes + offsetInBytes, bytesRemainingSize); > offsetInBytes = bytesSize; >- return std::nullopt; >+ return WTF::nullopt; > } > > size_t usedSize = requiredSize - m_remaining.size(); >diff --git a/Source/JavaScriptCore/wasm/WasmStreamingParser.h b/Source/JavaScriptCore/wasm/WasmStreamingParser.h >index 1fbb6b22b3559af038b804f125a7efa5a9a5d818..8bd5e9781aa5be995e61f3f9743ec31301927fc5 100644 >--- a/Source/JavaScriptCore/wasm/WasmStreamingParser.h >+++ b/Source/JavaScriptCore/wasm/WasmStreamingParser.h >@@ -91,7 +91,7 @@ private: > State parseFunctionSize(uint32_t); > State parseFunctionPayload(Vector<uint8_t>&&); > >- std::optional<Vector<uint8_t>> consume(const uint8_t* bytes, size_t, size_t&, size_t); >+ Optional<Vector<uint8_t>> consume(const uint8_t* bytes, size_t, size_t&, size_t); > Expected<uint32_t, State> consumeVarUInt32(const uint8_t* bytes, size_t, size_t&, IsEndOfStream); > > template <typename ...Args> NEVER_INLINE State WARN_UNUSED_RETURN fail(Args...); >diff --git a/Source/JavaScriptCore/wasm/WasmTable.cpp b/Source/JavaScriptCore/wasm/WasmTable.cpp >index ebb632520faf3083df4c6f271001fd557145e8fd..e5c608cb1f028c8644399c59a07d23790d4e37a9 100644 >--- a/Source/JavaScriptCore/wasm/WasmTable.cpp >+++ b/Source/JavaScriptCore/wasm/WasmTable.cpp >@@ -47,7 +47,7 @@ void Table::setLength(uint32_t length) > ASSERT(m_mask == WTF::maskForSize(allocatedLength(length))); > } > >-RefPtr<Table> Table::tryCreate(uint32_t initial, std::optional<uint32_t> maximum) >+RefPtr<Table> Table::tryCreate(uint32_t initial, Optional<uint32_t> maximum) > { > if (!isValidLength(initial)) > return nullptr; >@@ -58,7 +58,7 @@ Table::~Table() > { > } > >-Table::Table(uint32_t initial, std::optional<uint32_t> maximum) >+Table::Table(uint32_t initial, Optional<uint32_t> maximum) > { > setLength(initial); > m_maximum = maximum; >@@ -76,7 +76,7 @@ Table::Table(uint32_t initial, std::optional<uint32_t> maximum) > } > } > >-std::optional<uint32_t> Table::grow(uint32_t delta) >+Optional<uint32_t> Table::grow(uint32_t delta) > { > if (delta == 0) > return length(); >@@ -86,12 +86,12 @@ std::optional<uint32_t> Table::grow(uint32_t delta) > newLengthChecked += delta; > uint32_t newLength; > if (newLengthChecked.safeGet(newLength) == CheckedState::DidOverflow) >- return std::nullopt; >+ return WTF::nullopt; > > if (maximum() && newLength > *maximum()) >- return std::nullopt; >+ return WTF::nullopt; > if (!isValidLength(newLength)) >- return std::nullopt; >+ return WTF::nullopt; > > auto checkedGrow = [&] (auto& container) { > if (newLengthChecked.unsafeGet() > allocatedLength(m_length)) { >@@ -109,9 +109,9 @@ std::optional<uint32_t> Table::grow(uint32_t delta) > }; > > if (!checkedGrow(m_importableFunctions)) >- return std::nullopt; >+ return WTF::nullopt; > if (!checkedGrow(m_instances)) >- return std::nullopt; >+ return WTF::nullopt; > > setLength(newLength); > >diff --git a/Source/JavaScriptCore/wasm/WasmTable.h b/Source/JavaScriptCore/wasm/WasmTable.h >index 2f5483c618fa458bce0ed850da5594a91e62b9e0..7e3004135cdc22642f5a98a57bc27924e849d97c 100644 >--- a/Source/JavaScriptCore/wasm/WasmTable.h >+++ b/Source/JavaScriptCore/wasm/WasmTable.h >@@ -40,13 +40,13 @@ class Instance; > > class Table : public ThreadSafeRefCounted<Table> { > public: >- static RefPtr<Table> tryCreate(uint32_t initial, std::optional<uint32_t> maximum); >+ static RefPtr<Table> tryCreate(uint32_t initial, Optional<uint32_t> maximum); > > JS_EXPORT_PRIVATE ~Table(); > >- std::optional<uint32_t> maximum() const { return m_maximum; } >+ Optional<uint32_t> maximum() const { return m_maximum; } > uint32_t length() const { return m_length; } >- std::optional<uint32_t> grow(uint32_t delta) WARN_UNUSED_RETURN; >+ Optional<uint32_t> grow(uint32_t delta) WARN_UNUSED_RETURN; > void clearFunction(uint32_t); > void setFunction(uint32_t, WasmToWasmImportableFunction, Instance*); > >@@ -60,7 +60,7 @@ public: > static bool isValidLength(uint32_t length) { return length < maxTableEntries; } > > private: >- Table(uint32_t initial, std::optional<uint32_t> maximum); >+ Table(uint32_t initial, Optional<uint32_t> maximum); > > void setLength(uint32_t); > >@@ -69,7 +69,7 @@ private: > MallocPtr<Instance*> m_instances; > uint32_t m_length; > uint32_t m_mask; >- std::optional<uint32_t> m_maximum; >+ Optional<uint32_t> m_maximum; > }; > > } } // namespace JSC::Wasm >diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h b/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h >index ad70a1fbb2bc5b7925af424bf5b905f9f999f42d..604119fd47cdd4c48074146240b0cfce4882296e 100644 >--- a/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h >+++ b/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h >@@ -49,7 +49,7 @@ public: > DECLARE_INFO; > > static bool isValidLength(uint32_t length) { return Wasm::Table::isValidLength(length); } >- std::optional<uint32_t> maximum() const { return m_table->maximum(); } >+ Optional<uint32_t> maximum() const { return m_table->maximum(); } > uint32_t length() const { return m_table->length(); } > uint32_t allocatedLength() const { return m_table->allocatedLength(length()); } > bool grow(uint32_t delta) WARN_UNUSED_RETURN; >diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >index 0f24369198e17256c2aaf0eb45954e924173961f..50b999b2b6ec6c455f47dde33afbabc4a3909ca5 100644 >--- a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >@@ -62,7 +62,7 @@ static EncodedJSValue JSC_HOST_CALL callWebAssemblyFunction(ExecState* exec) > // Make sure that the memory we think we are going to run with matches the one we expect. > ASSERT(wasmFunction->instance()->instance().codeBlock()->isSafeToRun(wasmFunction->instance()->memory()->memory().mode())); > >- std::optional<TraceScope> traceScope; >+ Optional<TraceScope> traceScope; > if (Options::useTracePoints()) > traceScope.emplace(WebAssemblyExecuteStart, WebAssemblyExecuteEnd); > >diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp >index ec3c49702b2fc285c107aebcdb83f4187d2ee320..c5708bcba4a58a0803f6429c2f7583c9db27257c 100644 >--- a/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp >+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp >@@ -269,8 +269,8 @@ void WebAssemblyModuleRecord::link(ExecState* exec, JSValue, JSObject* importObj > if (actualInitial < expectedInitial) > return exception(createJSWebAssemblyLinkError(exec, vm, importFailMessage(import, "Table import", "provided an 'initial' that is too small"))); > >- if (std::optional<uint32_t> expectedMaximum = moduleInformation.tableInformation.maximum()) { >- std::optional<uint32_t> actualMaximum = table->maximum(); >+ if (Optional<uint32_t> expectedMaximum = moduleInformation.tableInformation.maximum()) { >+ Optional<uint32_t> actualMaximum = table->maximum(); > if (!actualMaximum) > return exception(createJSWebAssemblyLinkError(exec, vm, importFailMessage(import, "Table import", "does not have a 'maximum' but the module requires that it does"))); > if (*actualMaximum > *expectedMaximum) >@@ -449,7 +449,7 @@ JSValue WebAssemblyModuleRecord::evaluate(ExecState* exec) > > const Vector<Wasm::Segment::Ptr>& data = moduleInformation.data; > >- std::optional<JSValue> exception; >+ Optional<JSValue> exception; > > auto forEachElement = [&] (auto fn) { > for (const Wasm::Element& element : moduleInformation.elements) { >diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp >index 5a69520850de0191ae273b47fb99b337c17e86b1..9746c49984b8ebf08427f568cefd93a698b60db2 100644 >--- a/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp >+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp >@@ -74,7 +74,7 @@ static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyTable(ExecState* exec) > uint32_t initial = toNonWrappingUint32(exec, initialSizeValue); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > >- std::optional<uint32_t> maximum; >+ Optional<uint32_t> maximum; > Identifier maximumIdent = Identifier::fromString(&vm, "maximum"); > bool hasProperty = memoryDescriptor->hasProperty(exec, maximumIdent); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >diff --git a/Source/JavaScriptCore/yarr/YarrJIT.cpp b/Source/JavaScriptCore/yarr/YarrJIT.cpp >index f4775879cd338b4e59d42f130c467265841efcb5..be71e4ce38560756bc36bb3b33927bb9507b65d1 100644 >--- a/Source/JavaScriptCore/yarr/YarrJIT.cpp >+++ b/Source/JavaScriptCore/yarr/YarrJIT.cpp >@@ -4140,7 +4140,7 @@ private: > > // Used to detect regular expression constructs that are not currently > // supported in the JIT; fall back to the interpreter when this is detected. >- std::optional<JITFailureReason> m_failureReason; >+ Optional<JITFailureReason> m_failureReason; > > bool m_decodeSurrogatePairs; > bool m_unicodeIgnoreCase; >diff --git a/Source/JavaScriptCore/yarr/YarrJIT.h b/Source/JavaScriptCore/yarr/YarrJIT.h >index e1f5ae0e820756ac82a62271e50a5da133c073e8..89091a8762fbb4eb480a2e9ab01274c101fd7bc3 100644 >--- a/Source/JavaScriptCore/yarr/YarrJIT.h >+++ b/Source/JavaScriptCore/yarr/YarrJIT.h >@@ -83,7 +83,7 @@ public: > YarrCodeBlock() = default; > > void setFallBackWithFailureReason(JITFailureReason failureReason) { m_failureReason = failureReason; } >- std::optional<JITFailureReason> failureReason() { return m_failureReason; } >+ Optional<JITFailureReason> failureReason() { return m_failureReason; } > > bool has8BitCode() { return m_ref8.size(); } > bool has16BitCode() { return m_ref16.size(); } >@@ -193,7 +193,7 @@ public: > m_ref16 = MacroAssemblerCodeRef<Yarr16BitPtrTag>(); > m_matchOnly8 = MacroAssemblerCodeRef<YarrMatchOnly8BitPtrTag>(); > m_matchOnly16 = MacroAssemblerCodeRef<YarrMatchOnly16BitPtrTag>(); >- m_failureReason = std::nullopt; >+ m_failureReason = WTF::nullopt; > } > > private: >@@ -204,7 +204,7 @@ private: > #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS) > bool m_usesPatternContextBuffer; > #endif >- std::optional<JITFailureReason> m_failureReason; >+ Optional<JITFailureReason> m_failureReason; > }; > > enum YarrJITCompileMode { >diff --git a/Source/JavaScriptCore/yarr/YarrParser.h b/Source/JavaScriptCore/yarr/YarrParser.h >index 8e0fd8374eac448ff3fa05cced3f9ca0b1f7eb9f..b0e96cd45983817cba92a67d5e0a8c1175891423 100644 >--- a/Source/JavaScriptCore/yarr/YarrParser.h >+++ b/Source/JavaScriptCore/yarr/YarrParser.h >@@ -1022,10 +1022,10 @@ private: > return n; > } > >- std::optional<String> tryConsumeGroupName() >+ Optional<String> tryConsumeGroupName() > { > if (atEndOfPattern()) >- return std::nullopt; >+ return WTF::nullopt; > > ParseState state = saveState(); > >@@ -1038,7 +1038,7 @@ private: > while (!atEndOfPattern()) { > ch = tryConsumeIdentifierCharacter(); > if (ch == '>') >- return std::optional<String>(identifierBuilder.toString()); >+ return Optional<String>(identifierBuilder.toString()); > > if (!isIdentifierPart(ch)) > break; >@@ -1049,14 +1049,14 @@ private: > > restoreState(state); > >- return std::nullopt; >+ return WTF::nullopt; > } > >- std::optional<BuiltInCharacterClassID> tryConsumeUnicodePropertyExpression() >+ Optional<BuiltInCharacterClassID> tryConsumeUnicodePropertyExpression() > { > if (atEndOfPattern() || !isUnicodePropertyValueExpressionChar(peek())) { > m_errorCode = ErrorCode::InvalidUnicodePropertyExpression; >- return std::nullopt; >+ return WTF::nullopt; > } > > StringBuilder expressionBuilder; >@@ -1072,7 +1072,7 @@ private: > consume(); > if (errors) { > m_errorCode = ErrorCode::InvalidUnicodePropertyExpression; >- return std::nullopt; >+ return WTF::nullopt; > } > > if (foundEquals) { >@@ -1103,7 +1103,7 @@ private: > } > > m_errorCode = ErrorCode::InvalidUnicodePropertyExpression; >- return std::nullopt; >+ return WTF::nullopt; > } > > Delegate& m_delegate; >@@ -1141,7 +1141,7 @@ private: > * void atomCharacterClassRange(UChar32 begin, UChar32 end) > * void atomCharacterClassBuiltIn(BuiltInCharacterClassID classID, bool invert) > * void atomCharacterClassEnd() >- * void atomParenthesesSubpatternBegin(bool capture = true, std::optional<String> groupName); >+ * void atomParenthesesSubpatternBegin(bool capture = true, Optional<String> groupName); > * void atomParentheticalAssertionBegin(bool invert = false); > * void atomParenthesesEnd(); > * void atomBackReference(unsigned subpatternId); >diff --git a/Source/JavaScriptCore/yarr/YarrPattern.cpp b/Source/JavaScriptCore/yarr/YarrPattern.cpp >index 482587c8810a9407b2d2e2502db9770d31122e18..733fb2c39316bbdab73ef86754ad0a87e0e9b483 100644 >--- a/Source/JavaScriptCore/yarr/YarrPattern.cpp >+++ b/Source/JavaScriptCore/yarr/YarrPattern.cpp >@@ -590,7 +590,7 @@ public: > m_pattern.m_userCharacterClasses.append(WTFMove(newCharacterClass)); > } > >- void atomParenthesesSubpatternBegin(bool capture = true, std::optional<String> optGroupName = std::nullopt) >+ void atomParenthesesSubpatternBegin(bool capture = true, Optional<String> optGroupName = WTF::nullopt) > { > unsigned subpatternId = m_pattern.m_numSubpatterns + 1; > if (capture) { >diff --git a/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp b/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp >index 358cc94d6b0d1cf3e555efc177621234cd3b0274..0e0f635a2f574328d51393128b3641e107d3d1dc 100644 >--- a/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp >+++ b/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp >@@ -44,7 +44,7 @@ public: > void atomCharacterClassRange(UChar, UChar) {} > void atomCharacterClassBuiltIn(BuiltInCharacterClassID, bool) {} > void atomCharacterClassEnd() {} >- void atomParenthesesSubpatternBegin(bool = true, std::optional<String> = std::nullopt) {} >+ void atomParenthesesSubpatternBegin(bool = true, Optional<String> = WTF::nullopt) {} > void atomParentheticalAssertionBegin(bool = false) {} > void atomParenthesesEnd() {} > void atomBackReference(unsigned) {} >diff --git a/Source/JavaScriptCore/yarr/YarrUnicodeProperties.cpp b/Source/JavaScriptCore/yarr/YarrUnicodeProperties.cpp >index c0792fa7c9c759e48ed503fe55f6b5f5e7911575..b50ba039781d4f23c0a42404e260de84ce7419d0 100644 >--- a/Source/JavaScriptCore/yarr/YarrUnicodeProperties.cpp >+++ b/Source/JavaScriptCore/yarr/YarrUnicodeProperties.cpp >@@ -72,7 +72,7 @@ struct HashTable { > > #include "UnicodePatternTables.h" > >-std::optional<BuiltInCharacterClassID> unicodeMatchPropertyValue(WTF::String unicodePropertyName, WTF::String unicodePropertyValue) >+Optional<BuiltInCharacterClassID> unicodeMatchPropertyValue(WTF::String unicodePropertyName, WTF::String unicodePropertyValue) > { > int propertyIndex = -1; > >@@ -84,12 +84,12 @@ std::optional<BuiltInCharacterClassID> unicodeMatchPropertyValue(WTF::String uni > propertyIndex = generalCategoryHashTable.entry(unicodePropertyValue); > > if (propertyIndex == -1) >- return std::nullopt; >+ return WTF::nullopt; > >- return std::optional<BuiltInCharacterClassID>(static_cast<BuiltInCharacterClassID>(static_cast<int>(BuiltInCharacterClassID::BaseUnicodePropertyID) + propertyIndex)); >+ return Optional<BuiltInCharacterClassID>(static_cast<BuiltInCharacterClassID>(static_cast<int>(BuiltInCharacterClassID::BaseUnicodePropertyID) + propertyIndex)); > } > >-std::optional<BuiltInCharacterClassID> unicodeMatchProperty(WTF::String unicodePropertyValue) >+Optional<BuiltInCharacterClassID> unicodeMatchProperty(WTF::String unicodePropertyValue) > { > int propertyIndex = -1; > >@@ -98,9 +98,9 @@ std::optional<BuiltInCharacterClassID> unicodeMatchProperty(WTF::String unicodeP > propertyIndex = generalCategoryHashTable.entry(unicodePropertyValue); > > if (propertyIndex == -1) >- return std::nullopt; >+ return WTF::nullopt; > >- return std::optional<BuiltInCharacterClassID>(static_cast<BuiltInCharacterClassID>(static_cast<int>(BuiltInCharacterClassID::BaseUnicodePropertyID) + propertyIndex)); >+ return Optional<BuiltInCharacterClassID>(static_cast<BuiltInCharacterClassID>(static_cast<int>(BuiltInCharacterClassID::BaseUnicodePropertyID) + propertyIndex)); > } > > std::unique_ptr<CharacterClass> createUnicodeCharacterClassFor(BuiltInCharacterClassID unicodeClassID) >diff --git a/Source/JavaScriptCore/yarr/YarrUnicodeProperties.h b/Source/JavaScriptCore/yarr/YarrUnicodeProperties.h >index 20f6739de3b7ddbdd0a5142cd1f65d630f29bc56..1923356795298394755fb3f42d7ed975c16442b9 100644 >--- a/Source/JavaScriptCore/yarr/YarrUnicodeProperties.h >+++ b/Source/JavaScriptCore/yarr/YarrUnicodeProperties.h >@@ -33,8 +33,8 @@ namespace JSC { namespace Yarr { > > struct CharacterClass; > >-JS_EXPORT_PRIVATE std::optional<BuiltInCharacterClassID> unicodeMatchPropertyValue(WTF::String, WTF::String); >-JS_EXPORT_PRIVATE std::optional<BuiltInCharacterClassID> unicodeMatchProperty(WTF::String); >+JS_EXPORT_PRIVATE Optional<BuiltInCharacterClassID> unicodeMatchPropertyValue(WTF::String, WTF::String); >+JS_EXPORT_PRIVATE Optional<BuiltInCharacterClassID> unicodeMatchProperty(WTF::String); > > std::unique_ptr<CharacterClass> createUnicodeCharacterClassFor(BuiltInCharacterClassID); > >diff --git a/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/base_export.h b/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/base_export.h >index 1af54853368785cff11ccb87b283cbb4b06f1c84..426047a9927f02d3d62572b67e4b53d33464a8c0 100644 >--- a/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/base_export.h >+++ b/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/base_export.h >@@ -10,4 +10,4 @@ > > #define ANGLEBASE_EXPORT > >-#endif // ANGLEBASE_BASE_EXPORT_H_ >\ No newline at end of file >+#endif // ANGLEBASE_BASE_EXPORT_H_ >diff --git a/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/sys_byteorder.h b/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/sys_byteorder.h >index 43d1777f26fadbadcc701786bef6ab58f8cec259..70d9c275e6c5f76d354c32818bf311b04ed5b9a4 100644 >--- a/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/sys_byteorder.h >+++ b/Source/ThirdParty/ANGLE/src/common/third_party/base/anglebase/sys_byteorder.h >@@ -46,4 +46,4 @@ inline uint64_t ByteSwap(uint64_t x) > > } // namespace angle > >-#endif // ANGLEBASE_SYS_BYTEORDER_H_ >\ No newline at end of file >+#endif // ANGLEBASE_SYS_BYTEORDER_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp b/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp >index ce9828f1f91a8671658b420a10a5801447b3efae..d4d0623e1eb9633e63a1df045960791d83215321 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp >@@ -218,4 +218,4 @@ void DeclareAndInitBuiltinsForInstancedMultiview(TIntermBlock *root, > } > } > >-} // namespace sh >\ No newline at end of file >+} // namespace sh >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h b/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h >index b4ab05fd0e77c375a1efaeb06f3c95ad3159409d..4b2aefe13d0ac7bb289f81b4ab3d88d79893ff87 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h >@@ -45,4 +45,4 @@ void DeclareAndInitBuiltinsForInstancedMultiview(TIntermBlock *root, > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_DECLAREANDINITBUILTINSFORINSTANCEDMULTIVIEW_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_DECLAREANDINITBUILTINSFORINSTANCEDMULTIVIEW_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/FindMain.h b/Source/ThirdParty/ANGLE/src/compiler/translator/FindMain.h >index bf2c45d871e60c6d4e02f8f68c2b2252ff13a953..94401b79a27f4a566c5bdfcdebdc32a82d3f4e43 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/FindMain.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/FindMain.h >@@ -20,4 +20,4 @@ TIntermBlock *FindMainBody(TIntermBlock *root); > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_FINDMAIN_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_FINDMAIN_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/FindSymbolNode.h b/Source/ThirdParty/ANGLE/src/compiler/translator/FindSymbolNode.h >index 08dfb9a22240caa6705b5a972c5d263facd50242..9be690ac97881e05f970523e15b97e94c4743bd9 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/FindSymbolNode.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/FindSymbolNode.h >@@ -24,4 +24,4 @@ const TIntermSymbol *FindSymbolNode(TIntermNode *root, > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_FIND_SYMBOL_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_FIND_SYMBOL_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/IntermNode_util.h b/Source/ThirdParty/ANGLE/src/compiler/translator/IntermNode_util.h >index 6f3b0674f03c03700ec5f168e49cce101e7190b8..734387e91ddb19f68a9f7a7ee991084ffcc56889 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/IntermNode_util.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/IntermNode_util.h >@@ -57,4 +57,4 @@ TIntermTyped *CreateBuiltInFunctionCallNode(const TString &name, > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_INTERMNODEUTIL_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_INTERMNODEUTIL_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/Operator.cpp b/Source/ThirdParty/ANGLE/src/compiler/translator/Operator.cpp >index 7a2156611aadf2c0ba842e77d11e5dfc04bb9e04..259cdc55c32ff2e85e1c54e68b67147e7ec0aca1 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/Operator.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/Operator.cpp >@@ -382,4 +382,4 @@ bool IsAssignment(TOperator op) > default: > return false; > } >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/OutputTree.h b/Source/ThirdParty/ANGLE/src/compiler/translator/OutputTree.h >index 9f11989cb1f21a1273ebeb587bce5f7d4b1af43f..cf915b32ba347467d2da99d6823975587b7c58db 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/OutputTree.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/OutputTree.h >@@ -19,4 +19,4 @@ void OutputTree(TIntermNode *root, TInfoSinkBase &out); > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_OUTPUTTREE_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_OUTPUTTREE_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/RemoveEmptySwitchStatements.h b/Source/ThirdParty/ANGLE/src/compiler/translator/RemoveEmptySwitchStatements.h >index 1018a50d822ba166da8695d1e08f27c4ab93b554..88bc10062247033bd74227b6d2bf771c28f630e2 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/RemoveEmptySwitchStatements.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/RemoveEmptySwitchStatements.h >@@ -15,4 +15,4 @@ class TIntermBlock; > void RemoveEmptySwitchStatements(TIntermBlock *root); > } > >-#endif // COMPILER_TRANSLATOR_REMOVEEMPTYSWITCHSTATEMENTS_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_REMOVEEMPTYSWITCHSTATEMENTS_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.cpp b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.cpp >index b602e0c92302c4661ecc046597e9fa71f2ca136a..2c78f3bc4d27788dd7983a9b47df30ab7df918b4 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.cpp >@@ -151,4 +151,4 @@ void RewriteTexelFetchOffset(TIntermNode *root, const TSymbolTable &symbolTable, > Traverser::Apply(root, symbolTable, shaderVersion); > } > >-} // namespace sh >\ No newline at end of file >+} // namespace sh >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.h b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.h >index 694d709f8e67ba96dfe13920c089ea24529a57b7..a739297c3cf55908bdb8ddb9f47c65b77b880e03 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteTexelFetchOffset.h >@@ -25,4 +25,4 @@ void RewriteTexelFetchOffset(TIntermNode *root, const TSymbolTable &symbolTable, > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_REWRITE_TEXELFETCHOFFSET_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_REWRITE_TEXELFETCHOFFSET_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp >index fe2ef948b4521e70c18eb866278f419b53d7cc9d..47e96ed2182268f1326560a0f3d51ecd90aa08b3 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp >@@ -109,4 +109,4 @@ void RewriteUnaryMinusOperatorInt(TIntermNode *root) > Traverser::Apply(root); > } > >-} // namespace sh >\ No newline at end of file >+} // namespace sh >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.h b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.h >index 50f0c442a733b01e05df9ffafa5553cb67642f5e..802ed5748f12324637b702630ab6ed7a26fd0f13 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/RewriteUnaryMinusOperatorInt.h >@@ -17,4 +17,4 @@ void RewriteUnaryMinusOperatorInt(TIntermNode *root); > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_REWRITEUNARYMINUSOPERATORINT_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_REWRITEUNARYMINUSOPERATORINT_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/RunAtTheEndOfShader.h b/Source/ThirdParty/ANGLE/src/compiler/translator/RunAtTheEndOfShader.h >index ed94c28daecc573cbcefa89580b383e2df2b6142..caaf61c40992abd54e239b7975dcd4773fefe95e 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/RunAtTheEndOfShader.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/RunAtTheEndOfShader.h >@@ -20,4 +20,4 @@ void RunAtTheEndOfShader(TIntermBlock *root, TIntermNode *codeToRun, TSymbolTabl > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_RUNATTHEENDOFSHADER_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_RUNATTHEENDOFSHADER_H_ >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.cpp b/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.cpp >index 9c36fcea789473c3065d3dc7ec52b63a05035210..57cef6c5fcb6f5b0358ca6c4cd33036313ddec96 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.cpp >@@ -171,4 +171,4 @@ bool ValidateVaryingLocations(TIntermBlock *root, TDiagnostics *diagnostics, GLe > return (diagnostics->numErrors() == numErrorsBefore); > } > >-} // namespace sh >\ No newline at end of file >+} // namespace sh >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.h b/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.h >index 1e53977c68f4d0005fc08048876d2c7a1868712b..32120fd89443c309a6d542e454805810d9fe1a5d 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/ValidateVaryingLocations.h >@@ -22,4 +22,4 @@ bool ValidateVaryingLocations(TIntermBlock *root, TDiagnostics *diagnostics, GLe > > } // namespace sh > >-#endif >\ No newline at end of file >+#endif >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp b/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp >index 1e79a609915bb222bb7341c0fef250c855b9f59a..582b74744061bc3bb9a7d39fb77fc3cd01aec292 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.cpp >@@ -281,4 +281,4 @@ void VectorizeVectorScalarArithmetic(TIntermBlock *root, TSymbolTable *symbolTab > } while (traverser.didReplaceScalarsWithVectors()); > } > >-} // namespace sh >\ No newline at end of file >+} // namespace sh >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.h b/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.h >index 69f092e039d88cc02dcdcf7c6b742473c826e564..75c7e8a43ef27c3cacd7e23e61178f90f5282b1a 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.h >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/VectorizeVectorScalarArithmetic.h >@@ -22,4 +22,4 @@ void VectorizeVectorScalarArithmetic(TIntermBlock *root, TSymbolTable *symbolTab > > } // namespace sh > >-#endif // COMPILER_TRANSLATOR_VECTORIZEVECTORSCALARARITHMETIC_H_ >\ No newline at end of file >+#endif // COMPILER_TRANSLATOR_VECTORIZEVECTORSCALARARITHMETIC_H_ >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.cpp >index 2a97ce939f3e2536739eebd69bd4c0aa63dd8c9a..6b6d24fd2a977cea5f7d5aedf50e2ce7fe06d7cd 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.cpp >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.cpp >@@ -226,4 +226,4 @@ bool HandleRangeAllocator::isUsed(GLuint handle) const > return current->second >= handle; > } > >-} // namespace gl >\ No newline at end of file >+} // namespace gl >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.h b/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.h >index 4d4b6f4f69a80876c8cd23fc880e45e29eebf129..1ae532f0bf8973f2fe753ba527a09f854db1b4a8 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.h >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator.h >@@ -57,4 +57,4 @@ class HandleRangeAllocator final : angle::NonCopyable > > } // namespace gl > >-#endif // LIBANGLE_HANDLERANGEALLOCATOR_H_ >\ No newline at end of file >+#endif // LIBANGLE_HANDLERANGEALLOCATOR_H_ >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator_unittest.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator_unittest.cpp >index 1d825f7106b38fc82ec407a9efa8a8b7c6c75da5..7110d6327e2b33aebadcbefd410b74d4a641295d 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator_unittest.cpp >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/HandleRangeAllocator_unittest.cpp >@@ -272,4 +272,4 @@ TEST_F(HandleRangeAllocatorTest, ZeroIdCases) > EXPECT_FALSE(allocator->isUsed(id1)); > } > >-} // namespace >\ No newline at end of file >+} // namespace >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Path.h b/Source/ThirdParty/ANGLE/src/libANGLE/Path.h >index b103c8460705e0db05726b53cd17baeace3fdb05..85f49c15622f42047b2df7faf4fd0df68ddc6719 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/Path.h >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/Path.h >@@ -68,4 +68,4 @@ class Path final : angle::NonCopyable > > } // namespace gl > >-#endif // LIBANGLE_PATH_H_ >\ No newline at end of file >+#endif // LIBANGLE_PATH_H_ >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/PathImpl.h b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/PathImpl.h >index 3607f69a2b80bd4c7591e963812953a3c331ceab..cb03ed6a3ba9d3ed86a868a90be281c383e7ed36 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/PathImpl.h >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/PathImpl.h >@@ -33,4 +33,4 @@ class PathImpl : angle::NonCopyable > > } // namespace rx > >-#endif // LIBANGLE_RENDERER_PATHIMPL_H_ >\ No newline at end of file >+#endif // LIBANGLE_RENDERER_PATHIMPL_H_ >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/driver_utils.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/driver_utils.cpp >index d97b8e7c22abb1743b55cc22b692c23bda8b5de1..85e0f4e6d11a4c2efe0fea3290fbb2f7a0bd7052 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/driver_utils.cpp >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/driver_utils.cpp >@@ -117,4 +117,4 @@ bool IsKabylake(uint32_t DeviceId) > return std::find(std::begin(Kabylake), std::end(Kabylake), DeviceId) != std::end(Kabylake); > } > >-} // namespace rx >\ No newline at end of file >+} // namespace rx >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp >index fb329781a589d858849aba2270f7151731dd32cf..835b62943e95450128c73a25efa09c7d5ba165e6 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp >@@ -237,4 +237,4 @@ void ClearMultiviewGL::initializeResources() > ASSERT(mFramebuffer != 0u); > } > >-} // namespace rx >\ No newline at end of file >+} // namespace rx >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.h b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.h >index cdbbfad1327dfd847c49bb19dce7130289048a43..ae08252f4279aeb3b4310fdbe2c5e44e2fd69376 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.h >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/ClearMultiviewGL.h >@@ -92,4 +92,4 @@ class ClearMultiviewGL : angle::NonCopyable > }; > } // namespace rx > >-#endif // LIBANGLE_RENDERER_GL_CLEARMULTIVIEWGL_H_ >\ No newline at end of file >+#endif // LIBANGLE_RENDERER_GL_CLEARMULTIVIEWGL_H_ >diff --git a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GLSLCompatibilityOutput_test.cpp b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GLSLCompatibilityOutput_test.cpp >index 8adec774a1d6bd7fd4204a47b2a54cfa7e10a1c4..ce8062de9d9735b4733bf0cdea4c6b6f7b8bcc7d 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GLSLCompatibilityOutput_test.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GLSLCompatibilityOutput_test.cpp >@@ -32,4 +32,4 @@ TEST_F(GLSLCompatibilityOutputTest, GLPositionWrittenTest) > "}"; > compile(shaderString); > EXPECT_TRUE(foundInCode("gl_Position")); >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GeometryShader_test.cpp b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GeometryShader_test.cpp >index ad8512cb1abccb07a18f6d29d53577a0d8fc0dfd..06bbdf9a0c1e6c57555c4d861c3a6bcc129edfcf 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GeometryShader_test.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/GeometryShader_test.cpp >@@ -1643,4 +1643,4 @@ TEST_F(GeometryShaderTest, MixedUseOESAndEXTExtension) > } > } > } >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/TypeTracking_test.cpp b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/TypeTracking_test.cpp >index b2913c6a5b317e82c5b93dd3eba5bfe7a8ff5fd0..284aac0852533df82b520340d9c038d056c8cfe7 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/TypeTracking_test.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/TypeTracking_test.cpp >@@ -642,4 +642,4 @@ TEST_F(TypeTrackingTest, BuiltInUsubBorrowPrecision) > compile(shaderString); > ASSERT_FALSE(foundErrorInIntermediateTree()); > ASSERT_TRUE(foundInIntermediateTree("usubBorrow (highp 2-component vector of uint)")); >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/WEBGL_multiview_test.cpp b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/WEBGL_multiview_test.cpp >index 0ec970ce2cdbf4b80a4f6140043c8aaa5159152e..f48d3538e1db21704fcff5c434e8a47702c8e0b4 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/compiler_tests/WEBGL_multiview_test.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/compiler_tests/WEBGL_multiview_test.cpp >@@ -760,4 +760,4 @@ TEST_F(WEBGLMultiviewVertexShaderOutputCodeTest, GlLayerIsSet) > EXPECT_LT(viewIDOVRAssignmentLoc, glLayerAssignmentLoc); > } > >-} // namespace >\ No newline at end of file >+} // namespace >diff --git a/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp b/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp >index 35401b70fb696b5c55831403c46a3666c35b1282..284ea48a9203fe1d20e40dba99921dd634d60a99 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp >@@ -379,4 +379,4 @@ TEST_P(EGLPresentPathD3D11, ClientBufferPresentPathCopy) > checkPixelsUsingD3D(false); > } > >-ANGLE_INSTANTIATE_TEST(EGLPresentPathD3D11, ES2_D3D11(), ES2_D3D11_FL9_3()); >\ No newline at end of file >+ANGLE_INSTANTIATE_TEST(EGLPresentPathD3D11, ES2_D3D11(), ES2_D3D11_FL9_3()); >diff --git a/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLSanityCheckTest.cpp b/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLSanityCheckTest.cpp >index 5c19eb8a5395fe0d59b1e7f5b851fbc51e5a8bcb..d631a20fcbc14ae419c169c7e7b56ddad8a40344 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLSanityCheckTest.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLSanityCheckTest.cpp >@@ -34,4 +34,4 @@ TEST(EGLSanityCheckTest, GetProcAddressNegativeTest) > { > auto check = eglGetProcAddress("WigglyWombats"); > EXPECT_EQ(nullptr, check); >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/ANGLE/src/tests/gl_tests/FramebufferMultiviewTest.cpp b/Source/ThirdParty/ANGLE/src/tests/gl_tests/FramebufferMultiviewTest.cpp >index 182a5aed1411d23b3376093478d7c70cbf3e9ee7..6f53543f90523ecca1517e23411970142d51bbfd 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/gl_tests/FramebufferMultiviewTest.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/gl_tests/FramebufferMultiviewTest.cpp >@@ -1348,4 +1348,4 @@ TEST_P(FramebufferMultiviewLayeredClearTest, ColorBufferClearAllLayersAttached) > > ANGLE_INSTANTIATE_TEST(FramebufferMultiviewTest, ES3_OPENGL()); > ANGLE_INSTANTIATE_TEST(FramebufferMultiviewSideBySideClearTest, ES3_OPENGL(), ES3_D3D11()); >-ANGLE_INSTANTIATE_TEST(FramebufferMultiviewLayeredClearTest, ES3_OPENGL(), ES3_D3D11()); >\ No newline at end of file >+ANGLE_INSTANTIATE_TEST(FramebufferMultiviewLayeredClearTest, ES3_OPENGL(), ES3_D3D11()); >diff --git a/Source/ThirdParty/ANGLE/src/tests/gl_tests/ObjectAllocationTest.cpp b/Source/ThirdParty/ANGLE/src/tests/gl_tests/ObjectAllocationTest.cpp >index b0e59f7fcfcbca2a6b4a9f4b707b9754a23f671e..e2536db88be8b23f0179588f1dd24a87a5d0c2f2 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/gl_tests/ObjectAllocationTest.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/gl_tests/ObjectAllocationTest.cpp >@@ -51,4 +51,4 @@ TEST_P(ObjectAllocationTest, BindFramebufferAfterGen) > > } // anonymous namespace > >-ANGLE_INSTANTIATE_TEST(ObjectAllocationTest, ES3_OPENGL(), ES3_D3D11()); >\ No newline at end of file >+ANGLE_INSTANTIATE_TEST(ObjectAllocationTest, ES3_OPENGL(), ES3_D3D11()); >diff --git a/Source/ThirdParty/ANGLE/src/tests/gl_tests/PathRenderingTest.cpp b/Source/ThirdParty/ANGLE/src/tests/gl_tests/PathRenderingTest.cpp >index 62f38b396dd4e0c8bfc39fa82f3d94252d98aec1..b11a64095a947b3fffe474b4093131941e4b7d5e 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/gl_tests/PathRenderingTest.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/gl_tests/PathRenderingTest.cpp >@@ -1981,4 +1981,4 @@ ANGLE_INSTANTIATE_TEST(CHROMIUMPathRenderingWithTexturingTest, > ES2_OPENGL(), > ES2_OPENGLES(), > ES3_OPENGL(), >- ES3_OPENGLES()); >\ No newline at end of file >+ ES3_OPENGLES()); >diff --git a/Source/ThirdParty/ANGLE/src/tests/preprocessor_tests/PreprocessorTest.cpp b/Source/ThirdParty/ANGLE/src/tests/preprocessor_tests/PreprocessorTest.cpp >index ccb21a55e2237c527b2f33a4e88d62f1f0f681af..713d8eb5310f6178c13274b783fdefc27db4b94f 100644 >--- a/Source/ThirdParty/ANGLE/src/tests/preprocessor_tests/PreprocessorTest.cpp >+++ b/Source/ThirdParty/ANGLE/src/tests/preprocessor_tests/PreprocessorTest.cpp >@@ -64,4 +64,4 @@ void SimplePreprocessorTest::lexSingleToken(size_t count, > pp::Preprocessor preprocessor(&mDiagnostics, &mDirectiveHandler, pp::PreprocessorSettings()); > ASSERT_TRUE(preprocessor.init(count, input, nullptr)); > preprocessor.lex(token); >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTPixmap.cpp b/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTPixmap.cpp >index fdc853ae599406a8c11a158216a0939cc130d0f2..0c628dc753d305867d7f80860d4f9f5790fd168c 100644 >--- a/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTPixmap.cpp >+++ b/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTPixmap.cpp >@@ -14,4 +14,4 @@ OSPixmap *CreateOSPixmap() > { > UNIMPLEMENTED(); > return nullptr; >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTWindow.cpp b/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTWindow.cpp >index 33f76a29fba7e3a4f8ee0c63aa6bbdfdb6b08f31..e2e7d7d29e06e9c84c3b00e1d86efedcdd3aab6a 100644 >--- a/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTWindow.cpp >+++ b/Source/ThirdParty/ANGLE/util/windows/winrt/WinRTWindow.cpp >@@ -281,4 +281,4 @@ void WinRTWindow::signalTestEvent() > OSWindow *CreateOSWindow() > { > return new WinRTWindow(); >-} >\ No newline at end of file >+} >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/abseil-cpp/CMake/CMakeLists.txt.in b/Source/ThirdParty/libwebrtc/Source/third_party/abseil-cpp/CMake/CMakeLists.txt.in >index d60a33e9ac6a6ddfe0ebd181b33743f95e67b5a5..4c67ef5e5e1b55624cd5b26a61037e770a22ea26 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/abseil-cpp/CMake/CMakeLists.txt.in >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/abseil-cpp/CMake/CMakeLists.txt.in >@@ -12,4 +12,4 @@ ExternalProject_Add(googletest > BUILD_COMMAND "" > INSTALL_COMMAND "" > TEST_COMMAND "" >-) >\ No newline at end of file >+) >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/gflags/src/test/config_for_unittests.h b/Source/ThirdParty/libwebrtc/Source/third_party/gflags/src/test/config_for_unittests.h >index 914571b36b99635acd8a2a2e0cec2b0aba549dab..056130942b53d12a77460d6fa0828accef8f171b 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/gflags/src/test/config_for_unittests.h >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/gflags/src/test/config_for_unittests.h >@@ -76,4 +76,4 @@ > # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) > #else > # define GFLAGS_DLL_DECLARE_FLAG >-#endif >\ No newline at end of file >+#endif >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/devtools/__init__.py b/Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/devtools/__init__.py >index c944e7cb0c08e3dd042c1e3ce04f820c01d366d5..15c796c7e5441414acd4f13341b6ce26cbd0a19c 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/devtools/__init__.py >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/devtools/__init__.py >@@ -1 +1 @@ >-# module >\ No newline at end of file >+# module >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/libvpx/third_party/libwebm/common/file_util.h b/Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/libvpx/third_party/libwebm/common/file_util.h >index 0e71eac11e465b650352a128b4d0576034f2b79c..ed89ef3f7c639041b096b6093d4276a32546b514 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/libvpx/third_party/libwebm/common/file_util.h >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/libvpx/third_party/libwebm/common/file_util.h >@@ -38,4 +38,4 @@ class TempFileDeleter { > > } // namespace libwebm > >-#endif // LIBWEBM_COMMON_FILE_UTIL_H_ >\ No newline at end of file >+#endif // LIBWEBM_COMMON_FILE_UTIL_H_ >diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj >index 8082cbdba815d2913dcc389b9ecf4c63736d996f..176e012713ed5f32be50fdab2d26d1eecd02199f 100644 >--- a/Source/WTF/WTF.xcodeproj/project.pbxproj >+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj >@@ -439,7 +439,6 @@ > A3E4DD921F3A803400DED0B4 /* TextStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextStream.h; sourceTree = "<group>"; }; > A5098AFF1C169E0700087797 /* SandboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxSPI.h; sourceTree = "<group>"; }; > A5098B011C16A4F900087797 /* SecuritySPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecuritySPI.h; sourceTree = "<group>"; }; >- A561F30F1DF2642100FF675D /* DeprecatedOptional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedOptional.h; sourceTree = "<group>"; }; > A5BA15F2182433A900A82E69 /* StringCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringCocoa.mm; sourceTree = "<group>"; }; > A5BA15F41824348000A82E69 /* StringImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringImplCocoa.mm; sourceTree = "<group>"; }; > A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtomicStringImplCF.cpp; sourceTree = "<group>"; }; >@@ -879,7 +878,6 @@ > A8A4727B151A825A004123FF /* DecimalNumber.cpp */, > A8A4727C151A825A004123FF /* DecimalNumber.h */, > 0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */, >- A561F30F1DF2642100FF675D /* DeprecatedOptional.h */, > A8A4727E151A825A004123FF /* Deque.h */, > A9A4727F151A825A004123FF /* DisallowCType.h */, > 0F4570421BE5B58F0062A629 /* Dominators.h */, >@@ -983,8 +981,6 @@ > A8A472CE151A825B004123FF /* MetaAllocator.h */, > A8A472CF151A825B004123FF /* MetaAllocatorHandle.h */, > FE7497ED209163060003565B /* MetaAllocatorPtr.h */, >- 5FAD3AE121B9636600BEE178 /* URLHelpers.cpp */, >- 5FAD3AE021B9636600BEE178 /* URLHelpers.h */, > 0F66B2821DC97BAB004A1D3F /* MonotonicTime.cpp */, > 0F66B2831DC97BAB004A1D3F /* MonotonicTime.h */, > FE8225301B2A1E5B00BA68FD /* NakedPtr.h */, >@@ -1136,6 +1132,8 @@ > 5CC0EE7121629F1800A1A842 /* URL.h */, > 5C1F0597216439940039302C /* URLHash.h */, > 5CC0EE772162A01000A1A842 /* URLHash.h */, >+ 5FAD3AE121B9636600BEE178 /* URLHelpers.cpp */, >+ 5FAD3AE021B9636600BEE178 /* URLHelpers.h */, > 5CC0EE7321629F1900A1A842 /* URLParser.cpp */, > 5CC0EE7221629F1900A1A842 /* URLParser.h */, > 7AFEC6B01EB22B5900DADE36 /* UUID.cpp */, >@@ -1507,7 +1505,6 @@ > 0F66B28C1DC97BAB004A1D3F /* MonotonicTime.cpp in Sources */, > 5CC0EE8A2162BC2200A1A842 /* NSURLExtras.mm in Sources */, > A8A473F4151A825B004123FF /* NumberOfCores.cpp in Sources */, >- 5FAD3AE221B9636600BEE178 /* URLHelpers.cpp in Sources */, > A8A473F7151A825B004123FF /* OSAllocatorPosix.cpp in Sources */, > A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */, > A8A47402151A825B004123FF /* PageBlock.cpp in Sources */, >@@ -1564,6 +1561,7 @@ > 5CC0EE7621629F1900A1A842 /* URL.cpp in Sources */, > 5C1F0595216437B30039302C /* URLCF.cpp in Sources */, > 5CC0EE892162BC2200A1A842 /* URLCocoa.mm in Sources */, >+ 5FAD3AE221B9636600BEE178 /* URLHelpers.cpp in Sources */, > 5CC0EE7521629F1900A1A842 /* URLParser.cpp in Sources */, > 1C181C8F1D307AB800F5FA16 /* UTextProvider.cpp in Sources */, > 1C181C911D307AB800F5FA16 /* UTextProviderLatin1.cpp in Sources */, >diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt >index 109c2727704985e169bbe21206722347ca803533..d97b4862b80c5cc4a4fb11f9c7a716c4af1aaa2a 100644 >--- a/Source/WTF/wtf/CMakeLists.txt >+++ b/Source/WTF/wtf/CMakeLists.txt >@@ -47,7 +47,6 @@ set(WTF_PUBLIC_HEADERS > DebugUtilities.h > DecimalNumber.h > DeferrableRefCounted.h >- DeprecatedOptional.h > Deque.h > DisallowCType.h > Dominators.h >diff --git a/Source/WTF/wtf/CPUTime.h b/Source/WTF/wtf/CPUTime.h >index 6ac3fe7d5db1ea35d31a5d1f3eb8c4a495a850df..e9987090e55e809be4043a04e9ac1b9fe39ae6b9 100644 >--- a/Source/WTF/wtf/CPUTime.h >+++ b/Source/WTF/wtf/CPUTime.h >@@ -38,7 +38,7 @@ struct CPUTime { > > WTF_EXPORT_PRIVATE double percentageCPUUsageSince(const CPUTime&) const; > >- WTF_EXPORT_PRIVATE static std::optional<CPUTime> get(); >+ WTF_EXPORT_PRIVATE static Optional<CPUTime> get(); > > // Returns the current CPU time of the current thread. > // Precision varies depending on platform but is usually as good or better >diff --git a/Source/WTF/wtf/CrossThreadCopier.h b/Source/WTF/wtf/CrossThreadCopier.h >index f4e4fd94fe2b4ab69fc3522382866aa99b9ff42e..633878ae938869db3b315471020897bca079f0c6 100644 >--- a/Source/WTF/wtf/CrossThreadCopier.h >+++ b/Source/WTF/wtf/CrossThreadCopier.h >@@ -144,13 +144,13 @@ template<typename K, typename V> struct CrossThreadCopierBase<false, false, Hash > } > }; > >-// Default specialization for std::optional of CrossThreadCopyable class. >-template<typename T> struct CrossThreadCopierBase<false, false, std::optional<T>> { >- typedef std::optional<T> Type; >+// Default specialization for Optional of CrossThreadCopyable class. >+template<typename T> struct CrossThreadCopierBase<false, false, Optional<T>> { >+ typedef Optional<T> Type; > static Type copy(const Type& source) > { > if (!source) >- return std::nullopt; >+ return WTF::nullopt; > return CrossThreadCopier<T>::copy(*source); > } > }; >diff --git a/Source/WTF/wtf/CrossThreadQueue.h b/Source/WTF/wtf/CrossThreadQueue.h >index ade4d902f41cffa2f717fb7df7aacfd02ad44d30..744cb102a0c542a3acf6fd85e9d595cae8249cd2 100644 >--- a/Source/WTF/wtf/CrossThreadQueue.h >+++ b/Source/WTF/wtf/CrossThreadQueue.h >@@ -44,7 +44,7 @@ public: > void append(DataType&&); > > DataType waitForMessage(); >- std::optional<DataType> tryGetMessage(); >+ Optional<DataType> tryGetMessage(); > > void kill(); > bool isKilled() const; >@@ -84,7 +84,7 @@ DataType CrossThreadQueue<DataType>::waitForMessage() > } > > template<typename DataType> >-std::optional<DataType> CrossThreadQueue<DataType>::tryGetMessage() >+Optional<DataType> CrossThreadQueue<DataType>::tryGetMessage() > { > LockHolder lock(m_lock); > >diff --git a/Source/WTF/wtf/DateMath.cpp b/Source/WTF/wtf/DateMath.cpp >index 8b8eed257d3d7c6d97bbc67ca6fcfc2890761ea3..af31a712c4d7b356b46334f88dab8926807cbeb6 100644 >--- a/Source/WTF/wtf/DateMath.cpp >+++ b/Source/WTF/wtf/DateMath.cpp >@@ -894,7 +894,7 @@ double parseDateFromNullTerminatedCharacters(const char* dateString, bool& haveT > if (day < 0) > return std::numeric_limits<double>::quiet_NaN(); > >- std::optional<int> year; >+ Optional<int> year; > if (day > 31) { > // ### where is the boundary and what happens below? > if (*dateString != '/') >@@ -977,7 +977,7 @@ double parseDateFromNullTerminatedCharacters(const char* dateString, bool& haveT > if (*newPosStr != ':') > return std::numeric_limits<double>::quiet_NaN(); > // There was no year; the number was the hour. >- year = std::nullopt; >+ year = WTF::nullopt; > } else { > // in the normal case (we parsed the year), advance to the next number > dateString = ++newPosStr; >diff --git a/Source/WTF/wtf/DeprecatedOptional.h b/Source/WTF/wtf/DeprecatedOptional.h >deleted file mode 100644 >index f5966e3d7931b4bdeec95e42ca4f47faccdfb479..0000000000000000000000000000000000000000 >--- a/Source/WTF/wtf/DeprecatedOptional.h >+++ /dev/null >@@ -1,51 +0,0 @@ >-/* >- * Copyright (C) 2014, 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-// This file contains a deprecated version of WTF::Optional which a released >-// version of Safari uses. Once Safari stops using this, we can remove this. >-// New code should use std::optional. >- >-#pragma once >- >-#include <type_traits> >- >-namespace WTF { >- >-template<typename T> >-class Optional { >-public: >- explicit operator bool() const { return m_isEngaged; } >- T& value() { return *asPtr(); } >- >-private: >- T* asPtr() { return reinterpret_cast<T*>(&m_value); } >- >- bool m_isEngaged; >- typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_value; >-}; >- >-template<typename T> using DeprecatedOptional = WTF::Optional<T>; >- >-} // namespace WTF >diff --git a/Source/WTF/wtf/HashTraits.h b/Source/WTF/wtf/HashTraits.h >index 3b7f30e1c588ed5300488c35bc7e8f65c4028085..89b91f44345fbf6c37a95f0908fa22772e437be6 100644 >--- a/Source/WTF/wtf/HashTraits.h >+++ b/Source/WTF/wtf/HashTraits.h >@@ -211,8 +211,8 @@ template<typename P> struct HashTraits<Ref<P>> : SimpleClassHashTraits<Ref<P>> { > static PeekType peek(const Ref<P>& value) { return const_cast<PeekType>(value.ptrAllowingHashTableEmptyValue()); } > static PeekType peek(P* value) { return value; } > >- typedef std::optional<Ref<P>> TakeType; >- static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? std::nullopt : std::optional<Ref<P>>(WTFMove(value)); } >+ typedef Optional<Ref<P>> TakeType; >+ static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? WTF::nullopt : Optional<Ref<P>>(WTFMove(value)); } > }; > > template<> struct HashTraits<String> : SimpleClassHashTraits<String> { >diff --git a/Source/WTF/wtf/Hasher.h b/Source/WTF/wtf/Hasher.h >index e3496e6d33bec652bfd0822247c0e3de9896c54e..a3fea4e0ad6d1a419ccc67688afc6a87c8956074 100644 >--- a/Source/WTF/wtf/Hasher.h >+++ b/Source/WTF/wtf/Hasher.h >@@ -140,7 +140,7 @@ template<typename T1, typename T2> void add(Hasher& hasher, const std::pair<T1, > add(hasher, pair.second); > } > >-template<typename T> void add(Hasher& hasher, const std::optional<T>& optional) >+template<typename T> void add(Hasher& hasher, const Optional<T>& optional) > { > add(hasher, optional.has_value()); > if (optional.has_value()) >diff --git a/Source/WTF/wtf/JSONValues.h b/Source/WTF/wtf/JSONValues.h >index 7f2c8e2ccd4fb85dea5348aab685cfd27319c915..55e899b9845bbd4fee15d7b0ed9899f411a49b08 100644 >--- a/Source/WTF/wtf/JSONValues.h >+++ b/Source/WTF/wtf/JSONValues.h >@@ -217,15 +217,15 @@ protected: > return value->asInteger(output); > } > >- template<class T> std::optional<T> getNumber(const String& name) const >+ template<class T> Optional<T> getNumber(const String& name) const > { > RefPtr<Value> value; > if (!getValue(name, value)) >- return std::nullopt; >+ return WTF::nullopt; > > T result; > if (!value->asDouble(result)) >- return std::nullopt; >+ return WTF::nullopt; > > return result; > } >diff --git a/Source/WTF/wtf/LoggerHelper.h b/Source/WTF/wtf/LoggerHelper.h >index 0aa8f4cbc221054dfa9e9716eb6605bda7082459..f04f26f456d4424e2a2175c8905123d33eaa466d 100644 >--- a/Source/WTF/wtf/LoggerHelper.h >+++ b/Source/WTF/wtf/LoggerHelper.h >@@ -52,7 +52,7 @@ public: > > #else > >-#define LOGIDENTIFIER (std::nullopt) >+#define LOGIDENTIFIER (WTF::nullopt) > > #define ALWAYS_LOG(...) ((void)0) > #define ERROR_LOG(...) ((void)0) >diff --git a/Source/WTF/wtf/MainThread.cpp b/Source/WTF/wtf/MainThread.cpp >index 7c22b727e9a2a336c58dac2768bbd34e1aa8dc59..78312015368523811638eae93462a1ee3b2d54f2 100644 >--- a/Source/WTF/wtf/MainThread.cpp >+++ b/Source/WTF/wtf/MainThread.cpp >@@ -157,7 +157,7 @@ void setMainThreadCallbacksPaused(bool paused) > scheduleDispatchFunctionsOnMainThread(); > } > >-static ThreadSpecific<std::optional<GCThreadType>, CanBeGCThread::True>* isGCThread; >+static ThreadSpecific<Optional<GCThreadType>, CanBeGCThread::True>* isGCThread; > > void initializeGCThreads() > { >@@ -165,7 +165,7 @@ void initializeGCThreads() > std::call_once( > flag, > [] { >- isGCThread = new ThreadSpecific<std::optional<GCThreadType>, CanBeGCThread::True>(); >+ isGCThread = new ThreadSpecific<Optional<GCThreadType>, CanBeGCThread::True>(); > }); > } > >@@ -188,12 +188,12 @@ bool isMainThreadOrGCThread() > return isMainThread(); > } > >-std::optional<GCThreadType> mayBeGCThread() >+Optional<GCThreadType> mayBeGCThread() > { > if (!isGCThread) >- return std::nullopt; >+ return WTF::nullopt; > if (!isGCThread->isSet()) >- return std::nullopt; >+ return WTF::nullopt; > return **isGCThread; > } > >diff --git a/Source/WTF/wtf/MainThread.h b/Source/WTF/wtf/MainThread.h >index b0f1f02b7ea54931515a3a3ca43caa4eea69784d..373b6cc64057ce63043cb63249e8a99d34082b73 100644 >--- a/Source/WTF/wtf/MainThread.h >+++ b/Source/WTF/wtf/MainThread.h >@@ -78,7 +78,7 @@ enum class GCThreadType { > void printInternal(PrintStream&, GCThreadType); > > WTF_EXPORT_PRIVATE void registerGCThread(GCThreadType); >-WTF_EXPORT_PRIVATE std::optional<GCThreadType> mayBeGCThread(); >+WTF_EXPORT_PRIVATE Optional<GCThreadType> mayBeGCThread(); > WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread(); > > // NOTE: these functions are internal to the callOnMainThread implementation. >diff --git a/Source/WTF/wtf/Markable.h b/Source/WTF/wtf/Markable.h >index aa8ebe1109f55bb6dd65091b8ab8c1a51b00b412..3f5ab860f0136c1a6100dc951e1a50b5e5be2de9 100644 >--- a/Source/WTF/wtf/Markable.h >+++ b/Source/WTF/wtf/Markable.h >@@ -75,12 +75,12 @@ struct IntegralMarkableTraits { > } > }; > >-// The goal of Markable is offering std::optional without sacrificing storage efficiency. >+// The goal of Markable is offering Optional without sacrificing storage efficiency. > // Markable takes Traits, which should have isEmptyValue and emptyValue functions. By using >-// one value of T as an empty value, we can remove bool flag in std::optional. This strategy is >+// one value of T as an empty value, we can remove bool flag in Optional. This strategy is > // similar to WTF::HashTable, which uses two values of T as an empty value and a deleted value. > // This class is intended to be used as a member of a class to compact the size of the class. >-// Otherwise, you should use std::optional. >+// Otherwise, you should use Optional. > template<typename T, typename Traits> > class Markable { > public: >@@ -88,7 +88,7 @@ public: > : m_value(Traits::emptyValue()) > { } > >- constexpr Markable(std::nullopt_t) >+ constexpr Markable(WTF::nullopt_t) > : Markable() > { } > >@@ -105,11 +105,11 @@ public: > : m_value(std::forward<Args>(args)...) > { } > >- constexpr Markable(const std::optional<T>& value) >+ constexpr Markable(const Optional<T>& value) > : m_value(bool(value) ? *value : Traits::emptyValue()) > { } > >- constexpr Markable(std::optional<T>&& value) >+ constexpr Markable(Optional<T>&& value) > : m_value(bool(value) ? WTFMove(*value) : Traits::emptyValue()) > { } > >@@ -127,18 +127,18 @@ public: > constexpr const T& operator*() const& { return m_value; } > constexpr T& operator*() & { return m_value; } > >- operator std::optional<T>() && >+ operator Optional<T>() && > { > if (bool(*this)) > return WTFMove(m_value); >- return std::nullopt; >+ return WTF::nullopt; > } > >- operator std::optional<T>() const& >+ operator Optional<T>() const& > { > if (bool(*this)) > return m_value; >- return std::nullopt; >+ return WTF::nullopt; > } > > private: >diff --git a/Source/WTF/wtf/MemoryPressureHandler.h b/Source/WTF/wtf/MemoryPressureHandler.h >index 0f8b0f51ae4228cd759d52e0b4857661d59afeec..6269280893cfd6e8a2614d563b027875ab4c6a54 100644 >--- a/Source/WTF/wtf/MemoryPressureHandler.h >+++ b/Source/WTF/wtf/MemoryPressureHandler.h >@@ -135,11 +135,11 @@ public: > size_t resident { 0 }; > size_t physical { 0 }; > }; >- std::optional<MemoryUsage> platformMemoryUsage(); >+ Optional<MemoryUsage> platformMemoryUsage(); > void logMemoryUsageChange(); > > const char* m_logString; >- std::optional<MemoryUsage> m_initialMemory; >+ Optional<MemoryUsage> m_initialMemory; > > WTF_EXPORT_PRIVATE static bool s_loggingEnabled; > }; >diff --git a/Source/WTF/wtf/MonotonicTime.h b/Source/WTF/wtf/MonotonicTime.h >index 8fd0662de70cced4b93b7dfeea7fd67f09f90788..13e72a8610b16dc5a525636a9348be4752eca3ba 100644 >--- a/Source/WTF/wtf/MonotonicTime.h >+++ b/Source/WTF/wtf/MonotonicTime.h >@@ -144,12 +144,12 @@ public: > } > > template<class Decoder> >- static std::optional<MonotonicTime> decode(Decoder& decoder) >+ static Optional<MonotonicTime> decode(Decoder& decoder) > { >- std::optional<double> time; >+ Optional<double> time; > decoder >> time; > if (!time) >- return std::nullopt; >+ return WTF::nullopt; > return MonotonicTime::fromRawSeconds(*time); > } > >diff --git a/Source/WTF/wtf/ObjectIdentifier.h b/Source/WTF/wtf/ObjectIdentifier.h >index 0a0687c244b185e5d87c85c00f0f674583a6d2ce..6615269979340828a1c0eb7cc4a00713f19cbfe7 100644 >--- a/Source/WTF/wtf/ObjectIdentifier.h >+++ b/Source/WTF/wtf/ObjectIdentifier.h >@@ -45,12 +45,12 @@ public: > ASSERT(isValidIdentifier(m_identifier)); > encoder << m_identifier; > } >- template<typename Decoder> static std::optional<ObjectIdentifier> decode(Decoder& decoder) >+ template<typename Decoder> static Optional<ObjectIdentifier> decode(Decoder& decoder) > { >- std::optional<uint64_t> identifier; >+ Optional<uint64_t> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > ASSERT(isValidIdentifier(*identifier)); > return ObjectIdentifier { *identifier }; > } >diff --git a/Source/WTF/wtf/Optional.h b/Source/WTF/wtf/Optional.h >index 1cb3aa8e710021967aeb1cf4f68bc4fda547d832..a260ac6ecc2e58a5f07cffe0a156a0c8f9400e45 100644 >--- a/Source/WTF/wtf/Optional.h >+++ b/Source/WTF/wtf/Optional.h >@@ -130,7 +130,7 @@ > #define __NOEXCEPT_(...) > #endif > >-namespace std { >+namespace WTF { > namespace detail_ { > > // NOTE: All our target compilers support is_trivially_destructible. >@@ -206,11 +206,11 @@ struct is_nothrow_move_assignable > > } // namespace detail_ > >-// 20.5.4, optional for object types >-template <class T> class optional; >+// 20.5.4, Optional for object types >+template <class T> class Optional; > >-// 20.5.5, optional for lvalue reference types >-template <class T> class optional<T&>; >+// 20.5.5, Optional for lvalue reference types >+template <class T> class Optional<T&>; > > namespace detail_ { > >@@ -308,64 +308,64 @@ union constexpr_storage_t > > > template <class T> >-struct optional_base >+struct Optional_base > { > bool init_; > storage_t<T> storage_; > >- constexpr optional_base() __NOEXCEPT : init_(false), storage_(trivial_init) {}; >+ constexpr Optional_base() __NOEXCEPT : init_(false), storage_(trivial_init) {}; > >- explicit constexpr optional_base(const T& v) : init_(true), storage_(v) {} >+ explicit constexpr Optional_base(const T& v) : init_(true), storage_(v) {} > >- explicit constexpr optional_base(T&& v) : init_(true), storage_(detail_::constexpr_move(v)) {} >+ explicit constexpr Optional_base(T&& v) : init_(true), storage_(detail_::constexpr_move(v)) {} > >- template <class... Args> explicit optional_base(in_place_t, Args&&... args) >+ template <class... Args> explicit Optional_base(std::in_place_t, Args&&... args) > : init_(true), storage_(detail_::constexpr_forward<Args>(args)...) {} > > template <class U, class... Args, TR2_OPTIONAL_REQUIRES(std::is_constructible<T, std::initializer_list<U>>)> >- explicit optional_base(in_place_t, std::initializer_list<U> il, Args&&... args) >+ explicit Optional_base(std::in_place_t, std::initializer_list<U> il, Args&&... args) > : init_(true), storage_(il, std::forward<Args>(args)...) {} > >- ~optional_base() { if (init_) storage_.value_.T::~T(); } >+ ~Optional_base() { if (init_) storage_.value_.T::~T(); } > }; > > > template <class T> >-struct constexpr_optional_base >+struct constexpr_Optional_base > { > bool init_; > constexpr_storage_t<T> storage_; > >- constexpr constexpr_optional_base() __NOEXCEPT : init_(false), storage_(trivial_init) {}; >+ constexpr constexpr_Optional_base() __NOEXCEPT : init_(false), storage_(trivial_init) {}; > >- explicit constexpr constexpr_optional_base(const T& v) : init_(true), storage_(v) {} >+ explicit constexpr constexpr_Optional_base(const T& v) : init_(true), storage_(v) {} > >- explicit constexpr constexpr_optional_base(T&& v) : init_(true), storage_(detail_::constexpr_move(v)) {} >+ explicit constexpr constexpr_Optional_base(T&& v) : init_(true), storage_(detail_::constexpr_move(v)) {} > >- template <class... Args> explicit constexpr constexpr_optional_base(in_place_t, Args&&... args) >+ template <class... Args> explicit constexpr constexpr_Optional_base(std::in_place_t, Args&&... args) > : init_(true), storage_(detail_::constexpr_forward<Args>(args)...) {} > > template <class U, class... Args, TR2_OPTIONAL_REQUIRES(std::is_constructible<T, std::initializer_list<U>>)> >- OPTIONAL_CONSTEXPR_INIT_LIST explicit constexpr_optional_base(in_place_t, std::initializer_list<U> il, Args&&... args) >+ OPTIONAL_CONSTEXPR_INIT_LIST explicit constexpr_Optional_base(std::in_place_t, std::initializer_list<U> il, Args&&... args) > : init_(true), storage_(il, std::forward<Args>(args)...) {} > >- ~constexpr_optional_base() = default; >+ ~constexpr_Optional_base() = default; > }; > > template <class T> > using OptionalBase = typename std::conditional< > std::is_trivially_destructible<T>::value, // if possible >- constexpr_optional_base<typename std::remove_const<T>::type>, // use base with trivial destructor >- optional_base<typename std::remove_const<T>::type> >+ constexpr_Optional_base<typename std::remove_const<T>::type>, // use base with trivial destructor >+ Optional_base<typename std::remove_const<T>::type> > >::type; > > > > template <class T> >-class optional : private OptionalBase<T> >+class Optional : private OptionalBase<T> > { > static_assert( !std::is_same<typename std::decay<T>::type, nullopt_t>::value, "bad T" ); >- static_assert( !std::is_same<typename std::decay<T>::type, in_place_t>::value, "bad T" ); >+ static_assert( !std::is_same<typename std::decay<T>::type, std::in_place_t>::value, "bad T" ); > > > constexpr bool initialized() const __NOEXCEPT { return OptionalBase<T>::init_; } >@@ -406,10 +406,10 @@ public: > typedef T value_type; > > // 20.5.5.1, constructors >- constexpr optional() __NOEXCEPT : OptionalBase<T>() {}; >- constexpr optional(nullopt_t) __NOEXCEPT : OptionalBase<T>() {}; >+ constexpr Optional() __NOEXCEPT : OptionalBase<T>() {}; >+ constexpr Optional(nullopt_t) __NOEXCEPT : OptionalBase<T>() {}; > >- optional(const optional& rhs) >+ Optional(const Optional& rhs) > : OptionalBase<T>() > { > if (rhs.initialized()) { >@@ -418,38 +418,39 @@ public: > } > } > >- optional(optional&& rhs) __NOEXCEPT_(detail_::is_nothrow_move_constructible<T>::value) >+ Optional(Optional&& rhs) __NOEXCEPT_(detail_::is_nothrow_move_constructible<T>::value) > : OptionalBase<T>() > { > if (rhs.initialized()) { > ::new (static_cast<void*>(dataptr())) T(std::move(*rhs)); > OptionalBase<T>::init_ = true; >+ rhs.clear(); > } > } > >- constexpr optional(const T& v) : OptionalBase<T>(v) {} >+ constexpr Optional(const T& v) : OptionalBase<T>(v) {} > >- constexpr optional(T&& v) : OptionalBase<T>(detail_::constexpr_move(v)) {} >+ constexpr Optional(T&& v) : OptionalBase<T>(detail_::constexpr_move(v)) {} > > template <class... Args> >- explicit constexpr optional(in_place_t, Args&&... args) >- : OptionalBase<T>(in_place_t{}, detail_::constexpr_forward<Args>(args)...) {} >+ explicit constexpr Optional(std::in_place_t, Args&&... args) >+ : OptionalBase<T>(std::in_place_t{}, detail_::constexpr_forward<Args>(args)...) {} > > template <class U, class... Args, TR2_OPTIONAL_REQUIRES(std::is_constructible<T, std::initializer_list<U>>)> >- OPTIONAL_CONSTEXPR_INIT_LIST explicit optional(in_place_t, std::initializer_list<U> il, Args&&... args) >- : OptionalBase<T>(in_place_t{}, il, detail_::constexpr_forward<Args>(args)...) {} >+ OPTIONAL_CONSTEXPR_INIT_LIST explicit Optional(std::in_place_t, std::initializer_list<U> il, Args&&... args) >+ : OptionalBase<T>(std::in_place_t{}, il, detail_::constexpr_forward<Args>(args)...) {} > > // 20.5.4.2, Destructor >- ~optional() = default; >+ ~Optional() = default; > > // 20.5.4.3, assignment >- optional& operator=(nullopt_t) __NOEXCEPT >+ Optional& operator=(nullopt_t) __NOEXCEPT > { > clear(); > return *this; > } > >- optional& operator=(const optional& rhs) >+ Optional& operator=(const Optional& rhs) > { > if (initialized() == true && rhs.initialized() == false) clear(); > else if (initialized() == false && rhs.initialized() == true) initialize(*rhs); >@@ -457,12 +458,12 @@ public: > return *this; > } > >- optional& operator=(optional&& rhs) >+ Optional& operator=(Optional&& rhs) > __NOEXCEPT_(detail_::is_nothrow_move_assignable<T>::value && detail_::is_nothrow_move_constructible<T>::value) > { > if (initialized() == true && rhs.initialized() == false) clear(); >- else if (initialized() == false && rhs.initialized() == true) initialize(std::move(*rhs)); >- else if (initialized() == true && rhs.initialized() == true) contained_val() = std::move(*rhs); >+ else if (initialized() == false && rhs.initialized() == true) { initialize(std::move(*rhs)); rhs.clear(); } >+ else if (initialized() == true && rhs.initialized() == true) { contained_val() = std::move(*rhs); rhs.clear(); } > return *this; > } > >@@ -471,7 +472,7 @@ public: > -> typename std::enable_if > < > std::is_same<typename std::decay<U>::type, T>::value, >- optional& >+ Optional& > >::type > { > if (initialized()) { contained_val() = std::forward<U>(v); } >@@ -495,7 +496,7 @@ public: > } > > // 20.5.4.4, Swap >- void swap(optional<T>& rhs) __NOEXCEPT_(detail_::is_nothrow_move_constructible<T>::value && __NOEXCEPT_(swap(std::declval<T&>(), std::declval<T&>()))) >+ void swap(Optional<T>& rhs) __NOEXCEPT_(detail_::is_nothrow_move_constructible<T>::value && __NOEXCEPT_(swap(std::declval<T&>(), std::declval<T&>()))) > { > if (initialized() == true && rhs.initialized() == false) { rhs.initialize(std::move(**this)); clear(); } > else if (initialized() == false && rhs.initialized() == true) { initialize(std::move(*rhs)); rhs.clear(); } >@@ -558,7 +559,7 @@ public: > template <class V> > OPTIONAL_MUTABLE_CONSTEXPR T value_or(V&& v) && > { >- return *this ? detail_::constexpr_move(const_cast<optional<T>&>(*this).contained_val()) : detail_::convert<T>(detail_::constexpr_forward<V>(v)); >+ return *this ? detail_::constexpr_move(const_cast<Optional<T>&>(*this).contained_val()) : detail_::convert<T>(detail_::constexpr_forward<V>(v)); > } > > # else >@@ -577,43 +578,43 @@ public: > > > template <class T> >-class optional<T&> >+class Optional<T&> > { > static_assert( !std::is_same<T, nullopt_t>::value, "bad T" ); >- static_assert( !std::is_same<T, in_place_t>::value, "bad T" ); >+ static_assert( !std::is_same<T, std::in_place_t>::value, "bad T" ); > T* ref; > > public: > > // 20.5.5.1, construction/destruction >- constexpr optional() __NOEXCEPT : ref(nullptr) {} >+ constexpr Optional() __NOEXCEPT : ref(nullptr) {} > >- constexpr optional(nullopt_t) __NOEXCEPT : ref(nullptr) {} >+ constexpr Optional(nullopt_t) __NOEXCEPT : ref(nullptr) {} > >- constexpr optional(T& v) __NOEXCEPT : ref(detail_::static_addressof(v)) {} >+ constexpr Optional(T& v) __NOEXCEPT : ref(detail_::static_addressof(v)) {} > >- optional(T&&) = delete; >+ Optional(T&&) = delete; > >- constexpr optional(const optional& rhs) __NOEXCEPT : ref(rhs.ref) {} >+ constexpr Optional(const Optional& rhs) __NOEXCEPT : ref(rhs.ref) {} > >- explicit constexpr optional(in_place_t, T& v) __NOEXCEPT : ref(detail_::static_addressof(v)) {} >+ explicit constexpr Optional(std::in_place_t, T& v) __NOEXCEPT : ref(detail_::static_addressof(v)) {} > >- explicit optional(in_place_t, T&&) = delete; >+ explicit Optional(std::in_place_t, T&&) = delete; > >- ~optional() = default; >+ ~Optional() = default; > > // 20.5.5.2, mutation >- optional& operator=(nullopt_t) __NOEXCEPT { >+ Optional& operator=(nullopt_t) __NOEXCEPT { > ref = nullptr; > return *this; > } > >- // optional& operator=(const optional& rhs) __NOEXCEPT { >+ // Optional& operator=(const Optional& rhs) __NOEXCEPT { > // ref = rhs.ref; > // return *this; > // } > >- // optional& operator=(optional&& rhs) __NOEXCEPT { >+ // Optional& operator=(Optional&& rhs) __NOEXCEPT { > // ref = rhs.ref; > // return *this; > // } >@@ -622,8 +623,8 @@ public: > auto operator=(U&& rhs) __NOEXCEPT > -> typename std::enable_if > < >- std::is_same<typename std::decay<U>::type, optional<T&>>::value, >- optional& >+ std::is_same<typename std::decay<U>::type, Optional<T&>>::value, >+ Optional& > >::type > { > ref = rhs.ref; >@@ -634,8 +635,8 @@ public: > auto operator=(U&& rhs) __NOEXCEPT > -> typename std::enable_if > < >- !std::is_same<typename std::decay<U>::type, optional<T&>>::value, >- optional& >+ !std::is_same<typename std::decay<U>::type, Optional<T&>>::value, >+ Optional& > >::type > = delete; > >@@ -646,7 +647,7 @@ public: > void emplace(T&&) = delete; > > >- void swap(optional<T&>& rhs) __NOEXCEPT >+ void swap(Optional<T&>& rhs) __NOEXCEPT > { > std::swap(ref, rhs.ref); > } >@@ -687,101 +688,101 @@ public: > > > template <class T> >-class optional<T&&> >+class Optional<T&&> > { >- static_assert( sizeof(T) == 0, "optional rvalue references disallowed" ); >+ static_assert( sizeof(T) == 0, "Optional rvalue references disallowed" ); > }; > > > // 20.5.8, Relational operators >-template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y) >+template <class T> constexpr bool operator==(const Optional<T>& x, const Optional<T>& y) > { > return bool(x) != bool(y) ? false : bool(x) == false ? true : *x == *y; > } > >-template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y) >+template <class T> constexpr bool operator!=(const Optional<T>& x, const Optional<T>& y) > { > return !(x == y); > } > >-template <class T> constexpr bool operator<(const optional<T>& x, const optional<T>& y) >+template <class T> constexpr bool operator<(const Optional<T>& x, const Optional<T>& y) > { > return (!y) ? false : (!x) ? true : *x < *y; > } > >-template <class T> constexpr bool operator>(const optional<T>& x, const optional<T>& y) >+template <class T> constexpr bool operator>(const Optional<T>& x, const Optional<T>& y) > { > return (y < x); > } > >-template <class T> constexpr bool operator<=(const optional<T>& x, const optional<T>& y) >+template <class T> constexpr bool operator<=(const Optional<T>& x, const Optional<T>& y) > { > return !(y < x); > } > >-template <class T> constexpr bool operator>=(const optional<T>& x, const optional<T>& y) >+template <class T> constexpr bool operator>=(const Optional<T>& x, const Optional<T>& y) > { > return !(x < y); > } > > > // 20.5.9, Comparison with nullopt >-template <class T> constexpr bool operator==(const optional<T>& x, nullopt_t) __NOEXCEPT >+template <class T> constexpr bool operator==(const Optional<T>& x, nullopt_t) __NOEXCEPT > { > return (!x); > } > >-template <class T> constexpr bool operator==(nullopt_t, const optional<T>& x) __NOEXCEPT >+template <class T> constexpr bool operator==(nullopt_t, const Optional<T>& x) __NOEXCEPT > { > return (!x); > } > >-template <class T> constexpr bool operator!=(const optional<T>& x, nullopt_t) __NOEXCEPT >+template <class T> constexpr bool operator!=(const Optional<T>& x, nullopt_t) __NOEXCEPT > { > return bool(x); > } > >-template <class T> constexpr bool operator!=(nullopt_t, const optional<T>& x) __NOEXCEPT >+template <class T> constexpr bool operator!=(nullopt_t, const Optional<T>& x) __NOEXCEPT > { > return bool(x); > } > >-template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) __NOEXCEPT >+template <class T> constexpr bool operator<(const Optional<T>&, nullopt_t) __NOEXCEPT > { > return false; > } > >-template <class T> constexpr bool operator<(nullopt_t, const optional<T>& x) __NOEXCEPT >+template <class T> constexpr bool operator<(nullopt_t, const Optional<T>& x) __NOEXCEPT > { > return bool(x); > } > >-template <class T> constexpr bool operator<=(const optional<T>& x, nullopt_t) __NOEXCEPT >+template <class T> constexpr bool operator<=(const Optional<T>& x, nullopt_t) __NOEXCEPT > { > return (!x); > } > >-template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) __NOEXCEPT >+template <class T> constexpr bool operator<=(nullopt_t, const Optional<T>&) __NOEXCEPT > { > return true; > } > >-template <class T> constexpr bool operator>(const optional<T>& x, nullopt_t) __NOEXCEPT >+template <class T> constexpr bool operator>(const Optional<T>& x, nullopt_t) __NOEXCEPT > { > return bool(x); > } > >-template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) __NOEXCEPT >+template <class T> constexpr bool operator>(nullopt_t, const Optional<T>&) __NOEXCEPT > { > return false; > } > >-template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) __NOEXCEPT >+template <class T> constexpr bool operator>=(const Optional<T>&, nullopt_t) __NOEXCEPT > { > return true; > } > >-template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) __NOEXCEPT >+template <class T> constexpr bool operator>=(nullopt_t, const Optional<T>& x) __NOEXCEPT > { > return (!x); > } >@@ -789,185 +790,185 @@ template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) __ > > > // 20.5.10, Comparison with T >-template <class T> constexpr bool operator==(const optional<T>& x, const T& v) >+template <class T> constexpr bool operator==(const Optional<T>& x, const T& v) > { > return bool(x) ? *x == v : false; > } > >-template <class T> constexpr bool operator==(const T& v, const optional<T>& x) >+template <class T> constexpr bool operator==(const T& v, const Optional<T>& x) > { > return bool(x) ? v == *x : false; > } > >-template <class T> constexpr bool operator!=(const optional<T>& x, const T& v) >+template <class T> constexpr bool operator!=(const Optional<T>& x, const T& v) > { > return bool(x) ? *x != v : true; > } > >-template <class T> constexpr bool operator!=(const T& v, const optional<T>& x) >+template <class T> constexpr bool operator!=(const T& v, const Optional<T>& x) > { > return bool(x) ? v != *x : true; > } > >-template <class T> constexpr bool operator<(const optional<T>& x, const T& v) >+template <class T> constexpr bool operator<(const Optional<T>& x, const T& v) > { > return bool(x) ? *x < v : true; > } > >-template <class T> constexpr bool operator>(const T& v, const optional<T>& x) >+template <class T> constexpr bool operator>(const T& v, const Optional<T>& x) > { > return bool(x) ? v > *x : true; > } > >-template <class T> constexpr bool operator>(const optional<T>& x, const T& v) >+template <class T> constexpr bool operator>(const Optional<T>& x, const T& v) > { > return bool(x) ? *x > v : false; > } > >-template <class T> constexpr bool operator<(const T& v, const optional<T>& x) >+template <class T> constexpr bool operator<(const T& v, const Optional<T>& x) > { > return bool(x) ? v < *x : false; > } > >-template <class T> constexpr bool operator>=(const optional<T>& x, const T& v) >+template <class T> constexpr bool operator>=(const Optional<T>& x, const T& v) > { > return bool(x) ? *x >= v : false; > } > >-template <class T> constexpr bool operator<=(const T& v, const optional<T>& x) >+template <class T> constexpr bool operator<=(const T& v, const Optional<T>& x) > { > return bool(x) ? v <= *x : false; > } > >-template <class T> constexpr bool operator<=(const optional<T>& x, const T& v) >+template <class T> constexpr bool operator<=(const Optional<T>& x, const T& v) > { > return bool(x) ? *x <= v : true; > } > >-template <class T> constexpr bool operator>=(const T& v, const optional<T>& x) >+template <class T> constexpr bool operator>=(const T& v, const Optional<T>& x) > { > return bool(x) ? v >= *x : true; > } > > >-// Comparison of optional<T&> with T >-template <class T> constexpr bool operator==(const optional<T&>& x, const T& v) >+// Comparison of Optional<T&> with T >+template <class T> constexpr bool operator==(const Optional<T&>& x, const T& v) > { > return bool(x) ? *x == v : false; > } > >-template <class T> constexpr bool operator==(const T& v, const optional<T&>& x) >+template <class T> constexpr bool operator==(const T& v, const Optional<T&>& x) > { > return bool(x) ? v == *x : false; > } > >-template <class T> constexpr bool operator!=(const optional<T&>& x, const T& v) >+template <class T> constexpr bool operator!=(const Optional<T&>& x, const T& v) > { > return bool(x) ? *x != v : true; > } > >-template <class T> constexpr bool operator!=(const T& v, const optional<T&>& x) >+template <class T> constexpr bool operator!=(const T& v, const Optional<T&>& x) > { > return bool(x) ? v != *x : true; > } > >-template <class T> constexpr bool operator<(const optional<T&>& x, const T& v) >+template <class T> constexpr bool operator<(const Optional<T&>& x, const T& v) > { > return bool(x) ? *x < v : true; > } > >-template <class T> constexpr bool operator>(const T& v, const optional<T&>& x) >+template <class T> constexpr bool operator>(const T& v, const Optional<T&>& x) > { > return bool(x) ? v > *x : true; > } > >-template <class T> constexpr bool operator>(const optional<T&>& x, const T& v) >+template <class T> constexpr bool operator>(const Optional<T&>& x, const T& v) > { > return bool(x) ? *x > v : false; > } > >-template <class T> constexpr bool operator<(const T& v, const optional<T&>& x) >+template <class T> constexpr bool operator<(const T& v, const Optional<T&>& x) > { > return bool(x) ? v < *x : false; > } > >-template <class T> constexpr bool operator>=(const optional<T&>& x, const T& v) >+template <class T> constexpr bool operator>=(const Optional<T&>& x, const T& v) > { > return bool(x) ? *x >= v : false; > } > >-template <class T> constexpr bool operator<=(const T& v, const optional<T&>& x) >+template <class T> constexpr bool operator<=(const T& v, const Optional<T&>& x) > { > return bool(x) ? v <= *x : false; > } > >-template <class T> constexpr bool operator<=(const optional<T&>& x, const T& v) >+template <class T> constexpr bool operator<=(const Optional<T&>& x, const T& v) > { > return bool(x) ? *x <= v : true; > } > >-template <class T> constexpr bool operator>=(const T& v, const optional<T&>& x) >+template <class T> constexpr bool operator>=(const T& v, const Optional<T&>& x) > { > return bool(x) ? v >= *x : true; > } > >-// Comparison of optional<T const&> with T >-template <class T> constexpr bool operator==(const optional<const T&>& x, const T& v) >+// Comparison of Optional<T const&> with T >+template <class T> constexpr bool operator==(const Optional<const T&>& x, const T& v) > { > return bool(x) ? *x == v : false; > } > >-template <class T> constexpr bool operator==(const T& v, const optional<const T&>& x) >+template <class T> constexpr bool operator==(const T& v, const Optional<const T&>& x) > { > return bool(x) ? v == *x : false; > } > >-template <class T> constexpr bool operator!=(const optional<const T&>& x, const T& v) >+template <class T> constexpr bool operator!=(const Optional<const T&>& x, const T& v) > { > return bool(x) ? *x != v : true; > } > >-template <class T> constexpr bool operator!=(const T& v, const optional<const T&>& x) >+template <class T> constexpr bool operator!=(const T& v, const Optional<const T&>& x) > { > return bool(x) ? v != *x : true; > } > >-template <class T> constexpr bool operator<(const optional<const T&>& x, const T& v) >+template <class T> constexpr bool operator<(const Optional<const T&>& x, const T& v) > { > return bool(x) ? *x < v : true; > } > >-template <class T> constexpr bool operator>(const T& v, const optional<const T&>& x) >+template <class T> constexpr bool operator>(const T& v, const Optional<const T&>& x) > { > return bool(x) ? v > *x : true; > } > >-template <class T> constexpr bool operator>(const optional<const T&>& x, const T& v) >+template <class T> constexpr bool operator>(const Optional<const T&>& x, const T& v) > { > return bool(x) ? *x > v : false; > } > >-template <class T> constexpr bool operator<(const T& v, const optional<const T&>& x) >+template <class T> constexpr bool operator<(const T& v, const Optional<const T&>& x) > { > return bool(x) ? v < *x : false; > } > >-template <class T> constexpr bool operator>=(const optional<const T&>& x, const T& v) >+template <class T> constexpr bool operator>=(const Optional<const T&>& x, const T& v) > { > return bool(x) ? *x >= v : false; > } > >-template <class T> constexpr bool operator<=(const T& v, const optional<const T&>& x) >+template <class T> constexpr bool operator<=(const T& v, const Optional<const T&>& x) > { > return bool(x) ? v <= *x : false; > } > >-template <class T> constexpr bool operator<=(const optional<const T&>& x, const T& v) >+template <class T> constexpr bool operator<=(const Optional<const T&>& x, const T& v) > { > return bool(x) ? *x <= v : true; > } > >-template <class T> constexpr bool operator>=(const T& v, const optional<const T&>& x) >+template <class T> constexpr bool operator>=(const T& v, const Optional<const T&>& x) > { > return bool(x) ? v >= *x : true; > } >@@ -975,33 +976,33 @@ template <class T> constexpr bool operator>=(const T& v, const optional<const T& > > // 20.5.12, Specialized algorithms > template <class T> >-void swap(optional<T>& x, optional<T>& y) __NOEXCEPT_(__NOEXCEPT_(x.swap(y))) >+void swap(Optional<T>& x, Optional<T>& y) __NOEXCEPT_(__NOEXCEPT_(x.swap(y))) > { > x.swap(y); > } > > > template <class T> >-constexpr optional<typename std::decay<T>::type> make_optional(T&& v) >+constexpr Optional<typename std::decay<T>::type> makeOptional(T&& v) > { >- return optional<typename std::decay<T>::type>(detail_::constexpr_forward<T>(v)); >+ return Optional<typename std::decay<T>::type>(detail_::constexpr_forward<T>(v)); > } > > template <class X> >-constexpr optional<X&> make_optional(std::reference_wrapper<X> v) >+constexpr Optional<X&> makeOptional(std::reference_wrapper<X> v) > { >- return optional<X&>(v.get()); >+ return Optional<X&>(v.get()); > } > >-} // namespace std >+} // namespace WTF > > namespace std > { > template <typename T> >- struct hash<std::optional<T>> >+ struct hash<WTF::Optional<T>> > { > typedef typename hash<T>::result_type result_type; >- typedef std::optional<T> argument_type; >+ typedef WTF::Optional<T> argument_type; > > constexpr result_type operator()(argument_type const& arg) const { > return arg ? std::hash<T>{}(*arg) : result_type{}; >@@ -1009,10 +1010,10 @@ namespace std > }; > > template <typename T> >- struct hash<std::optional<T&>> >+ struct hash<WTF::Optional<T&>> > { > typedef typename hash<T>::result_type result_type; >- typedef std::optional<T&> argument_type; >+ typedef WTF::Optional<T&> argument_type; > > constexpr result_type operator()(argument_type const& arg) const { > return arg ? std::hash<T>{}(*arg) : result_type{}; >@@ -1027,13 +1028,15 @@ namespace WTF { > // -- WebKit Additions -- > template <class OptionalType, class Callback> > ALWAYS_INLINE >-auto valueOrCompute(OptionalType optional, Callback callback) -> typename OptionalType::value_type >+auto valueOrCompute(OptionalType Optional, Callback callback) -> typename OptionalType::value_type > { >- if (optional) >- return *optional; >+ if (Optional) >+ return *Optional; > return callback(); > } > > } // namespace WTF > >+using WTF::Optional; >+using WTF::makeOptional; > using WTF::valueOrCompute; >diff --git a/Source/WTF/wtf/PrintStream.h b/Source/WTF/wtf/PrintStream.h >index 7a32efeaaf4cb27ade4ab6a4a3686d9c163f59b5..0249490ef05ac3baf0fb4ca10ee6a9f633400c2c 100644 >--- a/Source/WTF/wtf/PrintStream.h >+++ b/Source/WTF/wtf/PrintStream.h >@@ -326,7 +326,7 @@ FormatImpl<Types...> format(Types... values) > } > > template<typename T> >-void printInternal(PrintStream& out, const std::optional<T>& value) >+void printInternal(PrintStream& out, const Optional<T>& value) > { > if (value) > out.print(*value); >diff --git a/Source/WTF/wtf/Seconds.h b/Source/WTF/wtf/Seconds.h >index a98421687832928ca4e86d028db119ceebce761b..f78692a316af6ab35cf9dee4148ed3bc56a97715 100644 >--- a/Source/WTF/wtf/Seconds.h >+++ b/Source/WTF/wtf/Seconds.h >@@ -226,12 +226,12 @@ public: > } > > template<class Decoder> >- static std::optional<Seconds> decode(Decoder& decoder) >+ static Optional<Seconds> decode(Decoder& decoder) > { >- std::optional<double> seconds; >+ Optional<double> seconds; > decoder >> seconds; > if (!seconds) >- return std::nullopt; >+ return WTF::nullopt; > return Seconds(*seconds); > } > >diff --git a/Source/WTF/wtf/StackTrace.cpp b/Source/WTF/wtf/StackTrace.cpp >index c41dec00601dd0e34993d3f36cf738eb50bc8981..66f612944b5c282ed9b943dad9f5ae0f528b51b9 100644 >--- a/Source/WTF/wtf/StackTrace.cpp >+++ b/Source/WTF/wtf/StackTrace.cpp >@@ -86,7 +86,7 @@ std::unique_ptr<StackTrace> StackTrace::captureStackTrace(int maxFrames, int fra > return trace; > } > >-auto StackTrace::demangle(void* pc) -> std::optional<DemangleEntry> >+auto StackTrace::demangle(void* pc) -> Optional<DemangleEntry> > { > #if HAVE(DLADDR) > const char* mangledName = nullptr; >@@ -104,7 +104,7 @@ auto StackTrace::demangle(void* pc) -> std::optional<DemangleEntry> > #else > UNUSED_PARAM(pc); > #endif >- return std::nullopt; >+ return WTF::nullopt; > } > > void StackTrace::dump(PrintStream& out, const char* indentString) const >diff --git a/Source/WTF/wtf/StackTrace.h b/Source/WTF/wtf/StackTrace.h >index 432a7791b303c99b50f41beb8f1f769cfb1c0129..1ba251ed5f84f1160c7dcf00067c88e69d431f40 100644 >--- a/Source/WTF/wtf/StackTrace.h >+++ b/Source/WTF/wtf/StackTrace.h >@@ -69,7 +69,7 @@ public: > std::unique_ptr<const char[], SystemFree<const char[]>> m_demangledName; > }; > >- WTF_EXPORT_PRIVATE static std::optional<DemangleEntry> demangle(void*); >+ WTF_EXPORT_PRIVATE static Optional<DemangleEntry> demangle(void*); > > WTF_EXPORT_PRIVATE void dump(PrintStream&, const char* indentString = nullptr) const; > >diff --git a/Source/WTF/wtf/URL.cpp b/Source/WTF/wtf/URL.cpp >index 5ce17cd9de921d6c9a6216caf7e88d2b46c7f35b..64b4a0b1755e1b79dc2e45c3b518c9d262e1dba5 100644 >--- a/Source/WTF/wtf/URL.cpp >+++ b/Source/WTF/wtf/URL.cpp >@@ -136,10 +136,10 @@ StringView URL::host() const > return StringView(m_string).substring(start, m_hostEnd - start); > } > >-std::optional<uint16_t> URL::port() const >+Optional<uint16_t> URL::port() const > { > if (!m_portLength) >- return std::nullopt; >+ return WTF::nullopt; > > bool ok = false; > unsigned number; >@@ -148,7 +148,7 @@ std::optional<uint16_t> URL::port() const > else > number = charactersToUIntStrict(m_string.characters16() + m_hostEnd + 1, m_portLength - 1, &ok); > if (!ok || number > std::numeric_limits<uint16_t>::max()) >- return std::nullopt; >+ return WTF::nullopt; > return number; > } > >@@ -301,7 +301,7 @@ void clearDefaultPortForProtocolMapForTesting() > map->clear(); > } > >-std::optional<uint16_t> defaultPortForProtocol(StringView protocol) >+Optional<uint16_t> defaultPortForProtocol(StringView protocol) > { > if (auto* overrideMap = defaultPortForProtocolMapForTesting()) { > auto locker = holdLock(defaultPortForProtocolMapForTestingLock); >@@ -871,7 +871,7 @@ bool URL::protocolIsAbout() const > > bool portAllowed(const URL& url) > { >- std::optional<uint16_t> port = url.port(); >+ Optional<uint16_t> port = url.port(); > > // Since most URLs don't have a port, return early for the "no port" case. > if (!port) >diff --git a/Source/WTF/wtf/URL.h b/Source/WTF/wtf/URL.h >index 268867ec1728f536fba6ae1eebb5a4e927eccb3c..9427c3a8922f448b568a5788cda4bfb9ea978b8d 100644 >--- a/Source/WTF/wtf/URL.h >+++ b/Source/WTF/wtf/URL.h >@@ -96,7 +96,7 @@ public: > > StringView protocol() const; > StringView host() const; >- std::optional<uint16_t> port() const; >+ Optional<uint16_t> port() const; > String hostAndPort() const; > String protocolHostAndPort() const; > String user() const; >@@ -189,7 +189,7 @@ public: > > template <class Encoder> void encode(Encoder&) const; > template <class Decoder> static bool decode(Decoder&, URL&); >- template <class Decoder> static std::optional<URL> decode(Decoder&); >+ template <class Decoder> static Optional<URL> decode(Decoder&); > > private: > friend class URLParser; >@@ -242,11 +242,11 @@ bool URL::decode(Decoder& decoder, URL& url) > } > > template <class Decoder> >-std::optional<URL> URL::decode(Decoder& decoder) >+Optional<URL> URL::decode(Decoder& decoder) > { > String string; > if (!decoder.decode(string)) >- return std::nullopt; >+ return WTF::nullopt; > return URL(URL(), string); > } > >@@ -267,7 +267,7 @@ WTF_EXPORT_PRIVATE bool protocolIsJavaScript(const String& url); > WTF_EXPORT_PRIVATE bool protocolIsJavaScript(StringView url); > WTF_EXPORT_PRIVATE bool protocolIsInHTTPFamily(const String& url); > >-WTF_EXPORT_PRIVATE std::optional<uint16_t> defaultPortForProtocol(StringView protocol); >+WTF_EXPORT_PRIVATE Optional<uint16_t> defaultPortForProtocol(StringView protocol); > WTF_EXPORT_PRIVATE bool isDefaultPortForProtocol(uint16_t port, StringView protocol); > WTF_EXPORT_PRIVATE bool portAllowed(const URL&); // Blacklist ports that should never be used for Web resources. > >diff --git a/Source/WTF/wtf/URLParser.cpp b/Source/WTF/wtf/URLParser.cpp >index 509d4b81f98233ad4a99695b3e9da34cb1ce6c75..2b3e9cd7dcede17ff74bb9b4e4766e114f097a2d 100644 >--- a/Source/WTF/wtf/URLParser.cpp >+++ b/Source/WTF/wtf/URLParser.cpp >@@ -656,7 +656,7 @@ void URLParser::encodeNonUTF8Query(const Vector<UChar>& source, const URLTextEnc > } > } > >-std::optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme) >+Optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme) > { > static const uint16_t ftpPort = 21; > static const uint16_t gopherPort = 70; >@@ -667,19 +667,19 @@ std::optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme) > > auto length = scheme.length(); > if (!length) >- return std::nullopt; >+ return WTF::nullopt; > switch (scheme[0]) { > case 'w': > switch (length) { > case 2: > if (scheme[1] == 's') > return wsPort; >- return std::nullopt; >+ return WTF::nullopt; > case 3: > if (scheme[1] == 's' > && scheme[2] == 's') > return wssPort; >- return std::nullopt; >+ return WTF::nullopt; > default: > return false; > } >@@ -690,16 +690,16 @@ std::optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme) > && scheme[2] == 't' > && scheme[3] == 'p') > return httpPort; >- return std::nullopt; >+ return WTF::nullopt; > case 5: > if (scheme[1] == 't' > && scheme[2] == 't' > && scheme[3] == 'p' > && scheme[4] == 's') > return httpsPort; >- return std::nullopt; >+ return WTF::nullopt; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > case 'g': > if (length == 6 >@@ -709,15 +709,15 @@ std::optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme) > && scheme[4] == 'e' > && scheme[5] == 'r') > return gopherPort; >- return std::nullopt; >+ return WTF::nullopt; > case 'f': > if (length == 3 > && scheme[1] == 't' > && scheme[2] == 'p') > return ftpPort; >- return std::nullopt; >+ return WTF::nullopt; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -800,18 +800,18 @@ ALWAYS_INLINE static Scheme scheme(StringView scheme) > } > } > >-std::optional<String> URLParser::maybeCanonicalizeScheme(const String& scheme) >+Optional<String> URLParser::maybeCanonicalizeScheme(const String& scheme) > { > if (scheme.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > if (!isASCIIAlpha(scheme[0])) >- return std::nullopt; >+ return WTF::nullopt; > > for (size_t i = 1; i < scheme.length(); ++i) { > if (isASCIIAlphanumeric(scheme[i]) || scheme[i] == '+' || scheme[i] == '-' || scheme[i] == '.') > continue; >- return std::nullopt; >+ return WTF::nullopt; > } > > return scheme.convertToASCIILowercase(); >@@ -2130,9 +2130,9 @@ static size_t zeroSequenceLength(const std::array<uint16_t, 8>& address, size_t > return end - begin; > } > >-static std::optional<size_t> findLongestZeroSequence(const std::array<uint16_t, 8>& address) >+static Optional<size_t> findLongestZeroSequence(const std::array<uint16_t, 8>& address) > { >- std::optional<size_t> longest; >+ Optional<size_t> longest; > size_t longestLength = 0; > for (size_t i = 0; i < 8; i++) { > size_t length = zeroSequenceLength(address, i); >@@ -2342,27 +2342,27 @@ Expected<URLParser::IPv4Address, URLParser::IPv4ParsingError> URLParser::parseIP > } > > template<typename CharacterType> >-std::optional<uint32_t> URLParser::parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>& iterator) >+Optional<uint32_t> URLParser::parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>& iterator) > { > if (iterator.atEnd()) >- return std::nullopt; >+ return WTF::nullopt; > uint32_t piece = 0; > bool leadingZeros = false; > size_t digitCount = 0; > while (!iterator.atEnd()) { > if (!isASCIIDigit(*iterator)) >- return std::nullopt; >+ return WTF::nullopt; > ++digitCount; > if (!piece && *iterator == '0') { > if (leadingZeros) >- return std::nullopt; >+ return WTF::nullopt; > leadingZeros = true; > } > if (!piece && *iterator == '0') > leadingZeros = true; > piece = piece * 10 + *iterator - '0'; > if (piece > 255) >- return std::nullopt; >+ return WTF::nullopt; > advance<CharacterType, ReportSyntaxViolation::No>(iterator); > if (iterator.atEnd()) > break; >@@ -2370,51 +2370,51 @@ std::optional<uint32_t> URLParser::parseIPv4PieceInsideIPv6(CodePointIterator<Ch > break; > } > if (piece && leadingZeros) >- return std::nullopt; >+ return WTF::nullopt; > return piece; > } > > template<typename CharacterType> >-std::optional<URLParser::IPv4Address> URLParser::parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType> iterator) >+Optional<URLParser::IPv4Address> URLParser::parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType> iterator) > { > IPv4Address address = 0; > for (size_t i = 0; i < 4; ++i) { >- if (std::optional<uint32_t> piece = parseIPv4PieceInsideIPv6(iterator)) >+ if (Optional<uint32_t> piece = parseIPv4PieceInsideIPv6(iterator)) > address = (address << 8) + piece.value(); > else >- return std::nullopt; >+ return WTF::nullopt; > if (i < 3) { > if (iterator.atEnd()) >- return std::nullopt; >+ return WTF::nullopt; > if (*iterator != '.') >- return std::nullopt; >+ return WTF::nullopt; > advance<CharacterType, ReportSyntaxViolation::No>(iterator); > } else if (!iterator.atEnd()) >- return std::nullopt; >+ return WTF::nullopt; > } > ASSERT(iterator.atEnd()); > return address; > } > > template<typename CharacterType> >-std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator<CharacterType> c) >+Optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator<CharacterType> c) > { > ASSERT(*c == '['); > const auto hostBegin = c; > advance(c, hostBegin); > if (c.atEnd()) >- return std::nullopt; >+ return WTF::nullopt; > > IPv6Address address = {{0, 0, 0, 0, 0, 0, 0, 0}}; > size_t piecePointer = 0; >- std::optional<size_t> compressPointer; >+ Optional<size_t> compressPointer; > > if (*c == ':') { > advance(c, hostBegin); > if (c.atEnd()) >- return std::nullopt; >+ return WTF::nullopt; > if (*c != ':') >- return std::nullopt; >+ return WTF::nullopt; > advance(c, hostBegin); > ++piecePointer; > compressPointer = piecePointer; >@@ -2422,19 +2422,19 @@ std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator > > while (!c.atEnd()) { > if (piecePointer == 8) >- return std::nullopt; >+ return WTF::nullopt; > if (*c == ':') { > if (compressPointer) >- return std::nullopt; >+ return WTF::nullopt; > advance(c, hostBegin); > ++piecePointer; > compressPointer = piecePointer; > continue; > } > if (piecePointer == 6 || (compressPointer && piecePointer < 6)) { >- if (std::optional<IPv4Address> ipv4Address = parseIPv4AddressInsideIPv6(c)) { >+ if (Optional<IPv4Address> ipv4Address = parseIPv4AddressInsideIPv6(c)) { > if (compressPointer && piecePointer == 5) >- return std::nullopt; >+ return WTF::nullopt; > syntaxViolation(hostBegin); > address[piecePointer++] = ipv4Address.value() >> 16; > address[piecePointer++] = ipv4Address.value() & 0xFFFF; >@@ -2465,12 +2465,12 @@ std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator > if (c.atEnd()) > break; > if (piecePointer == 8 || *c != ':') >- return std::nullopt; >+ return WTF::nullopt; > advance(c, hostBegin); > } > > if (!c.atEnd()) >- return std::nullopt; >+ return WTF::nullopt; > > if (compressPointer) { > size_t swaps = piecePointer - compressPointer.value(); >@@ -2478,9 +2478,9 @@ std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator > while (swaps) > std::swap(address[piecePointer--], address[compressPointer.value() + swaps-- - 1]); > } else if (piecePointer != 8) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<size_t> possibleCompressPointer = findLongestZeroSequence(address); >+ Optional<size_t> possibleCompressPointer = findLongestZeroSequence(address); > if (possibleCompressPointer) > possibleCompressPointer.value()++; > if (UNLIKELY(compressPointer != possibleCompressPointer)) >@@ -2533,7 +2533,7 @@ URLParser::LCharBuffer URLParser::percentDecode(const LChar* input, size_t lengt > return output; > } > >-template<typename CharacterType> std::optional<URLParser::LCharBuffer> URLParser::domainToASCII(StringImpl& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) >+template<typename CharacterType> Optional<URLParser::LCharBuffer> URLParser::domainToASCII(StringImpl& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition) > { > LCharBuffer ascii; > if (domain.isAllASCII()) { >@@ -2575,7 +2575,7 @@ template<typename CharacterType> std::optional<URLParser::LCharBuffer> URLParser > syntaxViolation(iteratorForSyntaxViolationPosition); > return ascii; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > bool URLParser::hasForbiddenHostCodePoint(const URLParser::LCharBuffer& asciiDomain) >@@ -2784,11 +2784,11 @@ bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator) > return true; > } > >-std::optional<String> URLParser::formURLDecode(StringView input) >+Optional<String> URLParser::formURLDecode(StringView input) > { > auto utf8 = input.utf8(StrictConversion); > if (utf8.isNull()) >- return std::nullopt; >+ return WTF::nullopt; > auto percentDecoded = percentDecode(reinterpret_cast<const LChar*>(utf8.data()), utf8.length()); > return String::fromUTF8(percentDecoded.data(), percentDecoded.size()); > } >diff --git a/Source/WTF/wtf/URLParser.h b/Source/WTF/wtf/URLParser.h >index d05a61991d0ab451fecb2c7d539822dd623e494c..3e3741a54705dabae593bdc88a362e644531dcee 100644 >--- a/Source/WTF/wtf/URLParser.h >+++ b/Source/WTF/wtf/URLParser.h >@@ -45,12 +45,12 @@ public: > WTF_EXPORT_PRIVATE static String serialize(const URLEncodedForm&); > > WTF_EXPORT_PRIVATE static bool isSpecialScheme(const String& scheme); >- WTF_EXPORT_PRIVATE static std::optional<String> maybeCanonicalizeScheme(const String& scheme); >+ WTF_EXPORT_PRIVATE static Optional<String> maybeCanonicalizeScheme(const String& scheme); > > static const UIDNA& internationalDomainNameTranscoder(); > static bool isInUserInfoEncodeSet(UChar); > >- static std::optional<uint16_t> defaultPortForProtocol(StringView); >+ static Optional<uint16_t> defaultPortForProtocol(StringView); > > private: > URLParser(const String&, const URL& = { }, const URLTextEncoding* = nullptr); >@@ -98,10 +98,10 @@ private: > template<typename UnsignedIntegerType> void appendNumberToASCIIBuffer(UnsignedIntegerType); > template<bool(*isInCodeSet)(UChar32), typename CharacterType> void utf8PercentEncode(const CodePointIterator<CharacterType>&); > template<typename CharacterType> void utf8QueryEncode(const CodePointIterator<CharacterType>&); >- template<typename CharacterType> std::optional<LCharBuffer> domainToASCII(StringImpl&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); >+ template<typename CharacterType> Optional<LCharBuffer> domainToASCII(StringImpl&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); > template<typename CharacterType> LCharBuffer percentDecode(const LChar*, size_t, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition); > static LCharBuffer percentDecode(const LChar*, size_t); >- static std::optional<String> formURLDecode(StringView input); >+ static Optional<String> formURLDecode(StringView input); > static bool hasForbiddenHostCodePoint(const LCharBuffer&); > void percentEncodeByte(uint8_t); > void appendToASCIIBuffer(UChar32); >@@ -120,9 +120,9 @@ private: > template<typename CharacterTypeForSyntaxViolation, typename CharacterType> Expected<IPv4Address, IPv4ParsingError> parseIPv4Host(const CodePointIterator<CharacterTypeForSyntaxViolation>&, CodePointIterator<CharacterType>); > template<typename CharacterType> Expected<uint32_t, URLParser::IPv4PieceParsingError> parseIPv4Piece(CodePointIterator<CharacterType>&, bool& syntaxViolation); > using IPv6Address = std::array<uint16_t, 8>; >- template<typename CharacterType> std::optional<IPv6Address> parseIPv6Host(CodePointIterator<CharacterType>); >- template<typename CharacterType> std::optional<uint32_t> parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>&); >- template<typename CharacterType> std::optional<IPv4Address> parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType>); >+ template<typename CharacterType> Optional<IPv6Address> parseIPv6Host(CodePointIterator<CharacterType>); >+ template<typename CharacterType> Optional<uint32_t> parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>&); >+ template<typename CharacterType> Optional<IPv4Address> parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType>); > void serializeIPv6Piece(uint16_t piece); > void serializeIPv6(IPv6Address); > >diff --git a/Source/WTF/wtf/cocoa/CPUTimeCocoa.cpp b/Source/WTF/wtf/cocoa/CPUTimeCocoa.cpp >index e42c7e11f6f5da25e23183a029378436f777b5f1..9c416ff3afe5f0b5077fb4a18d8b319c7e14c828 100644 >--- a/Source/WTF/wtf/cocoa/CPUTimeCocoa.cpp >+++ b/Source/WTF/wtf/cocoa/CPUTimeCocoa.cpp >@@ -46,14 +46,14 @@ static int64_t timeValueToMicroseconds(const time_value_t& value) > return result; > } > >-std::optional<CPUTime> CPUTime::get() >+Optional<CPUTime> CPUTime::get() > { > // Account for current threads. > task_thread_times_info threadInfoData; > mach_msg_type_number_t threadInfoCount = TASK_THREAD_TIMES_INFO_COUNT; > kern_return_t result = task_info(mach_task_self(), TASK_THREAD_TIMES_INFO, reinterpret_cast<task_info_t>(&threadInfoData), &threadInfoCount); > if (result != KERN_SUCCESS) >- return std::nullopt; >+ return WTF::nullopt; > > int64_t userTime = timeValueToMicroseconds(threadInfoData.user_time); > int64_t systemTime = timeValueToMicroseconds(threadInfoData.system_time); >@@ -63,7 +63,7 @@ std::optional<CPUTime> CPUTime::get() > mach_msg_type_number_t taskInfoCount = TASK_BASIC_INFO_COUNT; > result = task_info(mach_task_self(), TASK_BASIC_INFO, reinterpret_cast<task_info_t>(&taskInfoData), &taskInfoCount); > if (result != KERN_SUCCESS) >- return std::nullopt; >+ return WTF::nullopt; > > userTime += timeValueToMicroseconds(taskInfoData.user_time); > systemTime += timeValueToMicroseconds(taskInfoData.system_time); >diff --git a/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm b/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm >index 9faa36b360875f2ee33459c4e6fa5d676cfe06af..75ea83fffd531a3298a261316e2ad75645d6afce 100644 >--- a/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm >+++ b/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm >@@ -197,13 +197,13 @@ void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchrono > #endif > } > >-std::optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() >+Optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() > { > task_vm_info_data_t vmInfo; > mach_msg_type_number_t count = TASK_VM_INFO_COUNT; > kern_return_t err = task_info(mach_task_self(), TASK_VM_INFO, (task_info_t) &vmInfo, &count); > if (err != KERN_SUCCESS) >- return std::nullopt; >+ return WTF::nullopt; > > return MemoryUsage {static_cast<size_t>(vmInfo.internal), static_cast<size_t>(vmInfo.phys_footprint)}; > } >diff --git a/Source/WTF/wtf/cocoa/NSURLExtras.mm b/Source/WTF/wtf/cocoa/NSURLExtras.mm >index c8f8957efaef2e213bafd38c8d1b18753dfdda67..0aca55db474c9d3556e44df5692fec7e4d3721f2 100644 >--- a/Source/WTF/wtf/cocoa/NSURLExtras.mm >+++ b/Source/WTF/wtf/cocoa/NSURLExtras.mm >@@ -108,7 +108,7 @@ static String decodePercentEscapes(const String& string) > > NSString *decodeHostName(NSString *string) > { >- std::optional<String> host = mapHostName(string, std::nullopt); >+ Optional<String> host = mapHostName(string, std::nullopt); > if (!host) > return nil; > return !*host ? string : (NSString *)*host; >@@ -116,7 +116,7 @@ NSString *decodeHostName(NSString *string) > > NSString *encodeHostName(NSString *string) > { >- std::optional<String> host = mapHostName(string, decodePercentEscapes); >+ Optional<String> host = mapHostName(string, decodePercentEscapes); > if (!host) > return nil; > return !*host ? string : (NSString *)*host; >diff --git a/Source/WTF/wtf/cocoa/SoftLinking.h b/Source/WTF/wtf/cocoa/SoftLinking.h >index 1afab5bf51f1d1900119da3ec6fae716af711900..c70889443cefd42f6d2803a787bb83f27865a156 100644 >--- a/Source/WTF/wtf/cocoa/SoftLinking.h >+++ b/Source/WTF/wtf/cocoa/SoftLinking.h >@@ -349,6 +349,8 @@ > static dispatch_once_t once; \ > dispatch_once(&once, ^{ \ > frameworkLibrary = dlopen("/System/Library/Frameworks/" #framework ".framework/" #framework, RTLD_NOW); \ >+ if (!frameworkLibrary && !isOptional) \ >+ WTFLogAlways("dlerror: %s", dlerror()); \ > if (!isOptional) \ > RELEASE_ASSERT_WITH_MESSAGE(frameworkLibrary, "%s", dlerror()); \ > }); \ >diff --git a/Source/WTF/wtf/fuchsia/CPUTimeFuchsia.cpp b/Source/WTF/wtf/fuchsia/CPUTimeFuchsia.cpp >index bff8d80e50660cff0f2ff67caf44426e19767575..b64d437f34407bc4c0445fe0ca316e1294231665 100644 >--- a/Source/WTF/wtf/fuchsia/CPUTimeFuchsia.cpp >+++ b/Source/WTF/wtf/fuchsia/CPUTimeFuchsia.cpp >@@ -35,7 +35,7 @@ static Seconds timeToSeconds(zx_time_t t) > return Seconds(t / static_cast<double>(ZX_SEC(1))); > } > >-std::optional<CPUTime> CPUTime::get() >+Optional<CPUTime> CPUTime::get() > { > // Fuchsia issue ZX-2318 tracks being able to get the monotonic and thread > // times atomically and being able to separate ZX_CLOCK_THREAD into user and >diff --git a/Source/WTF/wtf/generic/MemoryPressureHandlerGeneric.cpp b/Source/WTF/wtf/generic/MemoryPressureHandlerGeneric.cpp >index 4533873d9615a9ae4ca346256d70273dd3519126..e7f32b8e948e41275a38f67516cc57ef77c6f0e3 100644 >--- a/Source/WTF/wtf/generic/MemoryPressureHandlerGeneric.cpp >+++ b/Source/WTF/wtf/generic/MemoryPressureHandlerGeneric.cpp >@@ -48,9 +48,9 @@ void MemoryPressureHandler::respondToMemoryPressure(Critical, Synchronous) > { > } > >-std::optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() >+Optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() > { >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WTF >diff --git a/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp b/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp >index ae7823f4cdd5fd492364189b03c84543dcab2e08..11ce5a214127491ad14e450fce2a66f0bd236357 100644 >--- a/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp >+++ b/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp >@@ -131,7 +131,7 @@ void MemoryPressureHandler::platformReleaseMemory(Critical) > #endif > } > >-std::optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() >+Optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() > { > return MemoryUsage {processMemoryUsage(), memoryFootprint()}; > } >diff --git a/Source/WTF/wtf/persistence/PersistentCoders.h b/Source/WTF/wtf/persistence/PersistentCoders.h >index 1bd4d6f7cd41ba4ed52f28c084dd81afc7184f70..933034f9ec6d46f12692d453b1b8db98e7e94224 100644 >--- a/Source/WTF/wtf/persistence/PersistentCoders.h >+++ b/Source/WTF/wtf/persistence/PersistentCoders.h >@@ -61,8 +61,8 @@ template<typename T, typename U> struct Coder<std::pair<T, U>> { > } > }; > >-template<typename T> struct Coder<std::optional<T>> { >- static void encode(Encoder& encoder, const std::optional<T>& optional) >+template<typename T> struct Coder<Optional<T>> { >+ static void encode(Encoder& encoder, const Optional<T>& optional) > { > if (!optional) { > encoder << false; >@@ -73,14 +73,14 @@ template<typename T> struct Coder<std::optional<T>> { > encoder << optional.value(); > } > >- static bool decode(Decoder& decoder, std::optional<T>& optional) >+ static bool decode(Decoder& decoder, Optional<T>& optional) > { > bool isEngaged; > if (!decoder.decode(isEngaged)) > return false; > > if (!isEngaged) { >- optional = std::nullopt; >+ optional = WTF::nullopt; > return true; > } > >diff --git a/Source/WTF/wtf/text/NullTextBreakIterator.h b/Source/WTF/wtf/text/NullTextBreakIterator.h >index f8b1f3e54d313f8857fe69709e9d0af20013a740..42a69121145e65a18b685726b421fa6bfa489a3b 100644 >--- a/Source/WTF/wtf/text/NullTextBreakIterator.h >+++ b/Source/WTF/wtf/text/NullTextBreakIterator.h >@@ -30,13 +30,13 @@ public: > NullTextBreakIterator& operator=(const NullTextBreakIterator&) = delete; > NullTextBreakIterator& operator=(NullTextBreakIterator&&) = default; > >- std::optional<unsigned> preceding(unsigned) const >+ Optional<unsigned> preceding(unsigned) const > { > ASSERT_NOT_REACHED(); > return { }; > } > >- std::optional<unsigned> following(unsigned) const >+ Optional<unsigned> following(unsigned) const > { > ASSERT_NOT_REACHED(); > return { }; >diff --git a/Source/WTF/wtf/text/StringView.cpp b/Source/WTF/wtf/text/StringView.cpp >index 450b47a21619f3e9d47106d1a9cdb81971272696..f36b92f9636a6dcbdb3aac9b8cdae117701c1c5a 100644 >--- a/Source/WTF/wtf/text/StringView.cpp >+++ b/Source/WTF/wtf/text/StringView.cpp >@@ -129,7 +129,7 @@ auto StringView::SplitResult::Iterator::operator++() -> Iterator& > > class StringView::GraphemeClusters::Iterator::Impl { > public: >- Impl(const StringView& stringView, std::optional<NonSharedCharacterBreakIterator>&& iterator, unsigned index) >+ Impl(const StringView& stringView, Optional<NonSharedCharacterBreakIterator>&& iterator, unsigned index) > : m_stringView(stringView) > , m_iterator(WTFMove(iterator)) > , m_index(index) >@@ -170,13 +170,13 @@ public: > > private: > const StringView& m_stringView; >- std::optional<NonSharedCharacterBreakIterator> m_iterator; >+ Optional<NonSharedCharacterBreakIterator> m_iterator; > unsigned m_index; > unsigned m_indexEnd; > }; > > StringView::GraphemeClusters::Iterator::Iterator(const StringView& stringView, unsigned index) >- : m_impl(std::make_unique<Impl>(stringView, stringView.isNull() ? std::nullopt : std::optional<NonSharedCharacterBreakIterator>(NonSharedCharacterBreakIterator(stringView)), index)) >+ : m_impl(std::make_unique<Impl>(stringView, stringView.isNull() ? WTF::nullopt : Optional<NonSharedCharacterBreakIterator>(NonSharedCharacterBreakIterator(stringView)), index)) > { > } > >diff --git a/Source/WTF/wtf/text/StringView.h b/Source/WTF/wtf/text/StringView.h >index 7314e56d94108fba95200a7830e76b7604f7ad22..701c55bcb65370b5826c04dc7012bdbdcb079d20 100644 >--- a/Source/WTF/wtf/text/StringView.h >+++ b/Source/WTF/wtf/text/StringView.h >@@ -153,7 +153,7 @@ public: > int toInt() const; > int toInt(bool& isValid) const; > int toIntStrict(bool& isValid) const; >- std::optional<uint64_t> toUInt64Strict() const; >+ Optional<uint64_t> toUInt64Strict() const; > float toFloat(bool& isValid) const; > > static void invalidate(const StringImpl&); >@@ -529,11 +529,11 @@ inline int StringView::toIntStrict(bool& isValid) const > return charactersToIntStrict(characters16(), m_length, &isValid); > } > >-inline std::optional<uint64_t> StringView::toUInt64Strict() const >+inline Optional<uint64_t> StringView::toUInt64Strict() const > { > bool isValid; > uint64_t result = is8Bit() ? charactersToUInt64Strict(characters8(), m_length, &isValid) : charactersToUInt64Strict(characters16(), m_length, &isValid); >- return isValid ? std::make_optional(result) : std::nullopt; >+ return isValid ? makeOptional(result) : WTF::nullopt; > } > > inline String StringView::toStringWithoutCopying() const >@@ -743,7 +743,7 @@ public: > > private: > std::reference_wrapper<const StringView> m_stringView; >- std::optional<unsigned> m_nextCodePointOffset; >+ Optional<unsigned> m_nextCodePointOffset; > UChar32 m_codePoint; > }; > >@@ -808,7 +808,7 @@ inline auto StringView::CodePoints::Iterator::operator++() -> Iterator& > { > ASSERT(m_nextCodePointOffset); > if (m_nextCodePointOffset.value() == m_stringView.get().length()) { >- m_nextCodePointOffset = std::nullopt; >+ m_nextCodePointOffset = WTF::nullopt; > return *this; > } > if (m_stringView.get().is8Bit()) >diff --git a/Source/WTF/wtf/text/TextBreakIterator.h b/Source/WTF/wtf/text/TextBreakIterator.h >index e861057bde2e9866a349459137127cadaca3e641..902232fb1c333f183b3f159d5aae2df3bb3607a1 100644 >--- a/Source/WTF/wtf/text/TextBreakIterator.h >+++ b/Source/WTF/wtf/text/TextBreakIterator.h >@@ -56,14 +56,14 @@ public: > TextBreakIterator& operator=(const TextBreakIterator&) = delete; > TextBreakIterator& operator=(TextBreakIterator&&) = default; > >- std::optional<unsigned> preceding(unsigned location) const >+ Optional<unsigned> preceding(unsigned location) const > { > return switchOn(m_backing, [&](const auto& iterator) { > return iterator.preceding(location); > }); > } > >- std::optional<unsigned> following(unsigned location) const >+ Optional<unsigned> following(unsigned location) const > { > return switchOn(m_backing, [&](const auto& iterator) { > return iterator.following(location); >@@ -173,12 +173,12 @@ public: > CachedTextBreakIterator& operator=(const CachedTextBreakIterator&) = delete; > CachedTextBreakIterator& operator=(CachedTextBreakIterator&&) = default; > >- std::optional<unsigned> preceding(unsigned location) const >+ Optional<unsigned> preceding(unsigned location) const > { > return m_backing.preceding(location); > } > >- std::optional<unsigned> following(unsigned location) const >+ Optional<unsigned> following(unsigned location) const > { > return m_backing.following(location); > } >diff --git a/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h b/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h >index 27e50bce5075f9ddadc4fdb9b192f6e834065e66..d32aa4c5e3e620cf92c48d641d640b18aa661ff9 100644 >--- a/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h >+++ b/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h >@@ -56,7 +56,7 @@ public: > m_string = string.createCFStringWithoutCopying(); > } > >- std::optional<unsigned> preceding(unsigned location) const >+ Optional<unsigned> preceding(unsigned location) const > { > if (!location) > return { }; >@@ -67,7 +67,7 @@ public: > return range.location; > } > >- std::optional<unsigned> following(unsigned location) const >+ Optional<unsigned> following(unsigned location) const > { > if (location >= static_cast<unsigned long>(CFStringGetLength(m_string.get()))) > return { }; >diff --git a/Source/WTF/wtf/text/icu/TextBreakIteratorICU.h b/Source/WTF/wtf/text/icu/TextBreakIteratorICU.h >index 5127388032a98ed59b53c7dafcf7b731c72058e3..d37572308c7d71fb0f2b072001d560e0b0ce3fd8 100644 >--- a/Source/WTF/wtf/text/icu/TextBreakIteratorICU.h >+++ b/Source/WTF/wtf/text/icu/TextBreakIteratorICU.h >@@ -118,7 +118,7 @@ public: > ASSERT(U_SUCCESS(status)); > } > >- std::optional<unsigned> preceding(unsigned location) const >+ Optional<unsigned> preceding(unsigned location) const > { > auto result = ubrk_preceding(m_iterator, location); > if (result == UBRK_DONE) >@@ -126,7 +126,7 @@ public: > return result; > } > >- std::optional<unsigned> following(unsigned location) const >+ Optional<unsigned> following(unsigned location) const > { > auto result = ubrk_following(m_iterator, location); > if (result == UBRK_DONE) >diff --git a/Source/WTF/wtf/threads/Signals.h b/Source/WTF/wtf/threads/Signals.h >index d58fc68a84220ef11110c125672de4749a098520..f1ea596ba31a39c20a64631079159ecf23c2b88b 100644 >--- a/Source/WTF/wtf/threads/Signals.h >+++ b/Source/WTF/wtf/threads/Signals.h >@@ -49,12 +49,12 @@ enum class Signal { > Unknown = NumberOfSignals > }; > >-inline std::tuple<int, std::optional<int>> toSystemSignal(Signal signal) >+inline std::tuple<int, Optional<int>> toSystemSignal(Signal signal) > { > switch (signal) { > case Signal::BadAccess: return std::make_tuple(SIGSEGV, SIGBUS); >- case Signal::Ill: return std::make_tuple(SIGILL, std::nullopt); >- case Signal::Usr: return std::make_tuple(SIGILL, std::nullopt); >+ case Signal::Ill: return std::make_tuple(SIGILL, WTF::nullopt); >+ case Signal::Usr: return std::make_tuple(SIGILL, WTF::nullopt); > default: break; > } > RELEASE_ASSERT_NOT_REACHED(); >diff --git a/Source/WTF/wtf/unix/CPUTimeUnix.cpp b/Source/WTF/wtf/unix/CPUTimeUnix.cpp >index beeb3e810e9c341c45c5f230d114d4e41b649779..23b6ef2164e808282586665a2b059db16a52408e 100644 >--- a/Source/WTF/wtf/unix/CPUTimeUnix.cpp >+++ b/Source/WTF/wtf/unix/CPUTimeUnix.cpp >@@ -37,7 +37,7 @@ static Seconds timevalToSeconds(const struct timeval& value) > return Seconds(value.tv_sec) + Seconds::fromMicroseconds(value.tv_usec); > } > >-std::optional<CPUTime> CPUTime::get() >+Optional<CPUTime> CPUTime::get() > { > struct rusage resource { }; > int ret = getrusage(RUSAGE_SELF, &resource); >diff --git a/Source/WTF/wtf/win/CPUTimeWin.cpp b/Source/WTF/wtf/win/CPUTimeWin.cpp >index 9c687b66cfd32377f95d111e464a7ccab4f1daf8..f2e3f17b64e423703db5241d39a50cd98516e2df 100644 >--- a/Source/WTF/wtf/win/CPUTimeWin.cpp >+++ b/Source/WTF/wtf/win/CPUTimeWin.cpp >@@ -47,7 +47,7 @@ static Seconds fileTimeToSeconds(const FILETIME& fileTime) > return Seconds { durationIn100NS.QuadPart / hundredsOfNanosecondsPerSecond }; > } > >-std::optional<CPUTime> CPUTime::get() >+Optional<CPUTime> CPUTime::get() > { > // https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms683223(v=vs.85).aspx > FILETIME creationTime; >@@ -55,7 +55,7 @@ std::optional<CPUTime> CPUTime::get() > FILETIME kernelTime; > FILETIME userTime; > if (!::GetProcessTimes(::GetCurrentProcess(), &creationTime, &exitTime, &kernelTime, &userTime)) >- return std::nullopt; >+ return WTF::nullopt; > > return CPUTime { MonotonicTime::now(), fileTimeToSeconds(userTime), fileTimeToSeconds(kernelTime) }; > } >diff --git a/Source/WTF/wtf/win/MemoryPressureHandlerWin.cpp b/Source/WTF/wtf/win/MemoryPressureHandlerWin.cpp >index e6bebdc1ca202619ea4fd76429c9ce3fe50ac8b0..1aee486def997278fb8d00e2b1c21fa32d29ab46 100644 >--- a/Source/WTF/wtf/win/MemoryPressureHandlerWin.cpp >+++ b/Source/WTF/wtf/win/MemoryPressureHandlerWin.cpp >@@ -96,9 +96,9 @@ void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchrono > releaseMemory(critical, synchronous); > } > >-std::optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() >+Optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() > { >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WTF >diff --git a/Source/WebCore/Modules/applepay/ApplePayError.cpp b/Source/WebCore/Modules/applepay/ApplePayError.cpp >index 0b5bcf005a3655ebf249fc3812b19384314387cd..b7767c30ad87b766dcf8efaf634bdd14c36dfd8f 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayError.cpp >+++ b/Source/WebCore/Modules/applepay/ApplePayError.cpp >@@ -30,12 +30,12 @@ > > namespace WebCore { > >-Ref<ApplePayError> ApplePayError::create(Code code, std::optional<ContactField> contactField, const String& message) >+Ref<ApplePayError> ApplePayError::create(Code code, Optional<ContactField> contactField, const String& message) > { > return adoptRef(*new ApplePayError { code, contactField, message }); > } > >-ApplePayError::ApplePayError(Code code, std::optional<ContactField> contactField, const String& message) >+ApplePayError::ApplePayError(Code code, Optional<ContactField> contactField, const String& message) > : m_code { code } > , m_contactField { contactField } > , m_message { message } >diff --git a/Source/WebCore/Modules/applepay/ApplePayError.h b/Source/WebCore/Modules/applepay/ApplePayError.h >index e9defce3f3796f9610829ba97f156d5454764d68..331de12c45968e0eb40746f03d9ca8b1ebe50248 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayError.h >+++ b/Source/WebCore/Modules/applepay/ApplePayError.h >@@ -38,23 +38,23 @@ public: > using Code = PaymentError::Code; > using ContactField = PaymentError::ContactField; > >- static Ref<ApplePayError> create(Code, std::optional<ContactField>, const String& message); >+ static Ref<ApplePayError> create(Code, Optional<ContactField>, const String& message); > virtual ~ApplePayError(); > > Code code() const { return m_code; } > void setCode(Code code) { m_code = code; } > >- std::optional<ContactField> contactField() const { return m_contactField; } >- void setContactField(std::optional<ContactField> contactField) { m_contactField = contactField; } >+ Optional<ContactField> contactField() const { return m_contactField; } >+ void setContactField(Optional<ContactField> contactField) { m_contactField = contactField; } > > String message() const { return m_message; } > void setMessage(String&& message) { m_message = WTFMove(message); } > > private: >- ApplePayError(Code, std::optional<ContactField>, const String& message); >+ ApplePayError(Code, Optional<ContactField>, const String& message); > > Code m_code; >- std::optional<ContactField> m_contactField; >+ Optional<ContactField> m_contactField; > String m_message; > }; > >diff --git a/Source/WebCore/Modules/applepay/ApplePayPayment.h b/Source/WebCore/Modules/applepay/ApplePayPayment.h >index 31f4cef82c9e418e888dae41191655c406110ceb..5c5845780040b8a8ba2cc8b28fa65955c34b13fc 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayPayment.h >+++ b/Source/WebCore/Modules/applepay/ApplePayPayment.h >@@ -40,8 +40,8 @@ struct ApplePayPayment { > }; > > Token token; >- std::optional<ApplePayPaymentContact> billingContact; >- std::optional<ApplePayPaymentContact> shippingContact; >+ Optional<ApplePayPaymentContact> billingContact; >+ Optional<ApplePayPaymentContact> shippingContact; > }; > > } >diff --git a/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h b/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h >index dba99ff8e040349d942a43849285ce4c7e56735a..5e11a84dbb1b85449a3ad349fba0f6210feae953 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h >+++ b/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h >@@ -42,7 +42,7 @@ struct ApplePayPaymentContact { > String phoneticGivenName; > String phoneticFamilyName; > String localizedPhoneticName; >- std::optional<Vector<String>> addressLines; >+ Optional<Vector<String>> addressLines; > String subLocality; > String locality; > String postalCode; >diff --git a/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h b/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h >index 30958450f39e55b859cfaca2e70727a35616cabc..16f5c7e2141136f5fe4253e17580ddd79cfa8776 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h >+++ b/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h >@@ -39,8 +39,8 @@ struct ApplePayPaymentMethod { > > String displayName; > String network; >- std::optional<Type> type; >- std::optional<ApplePayPaymentPass> paymentPass; >+ Optional<Type> type; >+ Optional<ApplePayPaymentPass> paymentPass; > }; > > } >diff --git a/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h b/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h >index 4de95d70a5d9433309fdf83a867ff2b85d5a0c8b..e6fb6026b3da12904d2c879b4052afdb4a46b87f 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h >+++ b/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h >@@ -40,13 +40,13 @@ struct ApplePayPaymentRequest : ApplePayRequestBase { > > String currencyCode; > >- std::optional<Vector<ApplePayContactField>> requiredShippingContactFields; >+ Optional<Vector<ApplePayContactField>> requiredShippingContactFields; > > ShippingType shippingType { ShippingType::Shipping }; >- std::optional<Vector<ApplePayShippingMethod>> shippingMethods; >+ Optional<Vector<ApplePayShippingMethod>> shippingMethods; > > ApplePayLineItem total; >- std::optional<Vector<ApplePayLineItem>> lineItems; >+ Optional<Vector<ApplePayLineItem>> lineItems; > }; > > } >diff --git a/Source/WebCore/Modules/applepay/ApplePayRequestBase.h b/Source/WebCore/Modules/applepay/ApplePayRequestBase.h >index ea8dc7673c51d477b636214318954b61bc06dd18..2051189da97d2743db3b9d6ce911d0ec1ef0091f 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayRequestBase.h >+++ b/Source/WebCore/Modules/applepay/ApplePayRequestBase.h >@@ -40,10 +40,10 @@ struct ApplePayRequestBase { > Vector<String> supportedNetworks; > String countryCode; > >- std::optional<Vector<ApplePayContactField>> requiredBillingContactFields; >- std::optional<ApplePayPaymentContact> billingContact; >+ Optional<Vector<ApplePayContactField>> requiredBillingContactFields; >+ Optional<ApplePayPaymentContact> billingContact; > >- std::optional<ApplePayPaymentContact> shippingContact; >+ Optional<ApplePayPaymentContact> shippingContact; > > String applicationData; > Vector<String> supportedCountries; >diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.cpp b/Source/WebCore/Modules/applepay/ApplePaySession.cpp >index e1a36e40edf1d247800920e67079e6ae5f8ac95c..74f67ccfbb4ba0371ded4913690fb1969f5510df 100644 >--- a/Source/WebCore/Modules/applepay/ApplePaySession.cpp >+++ b/Source/WebCore/Modules/applepay/ApplePaySession.cpp >@@ -160,7 +160,7 @@ static ExceptionOr<ApplePaySessionPaymentRequest::LineItem> convertAndValidate(A > return WTFMove(result); > } > >-static ExceptionOr<Vector<ApplePaySessionPaymentRequest::LineItem>> convertAndValidate(std::optional<Vector<ApplePayLineItem>>&& lineItems) >+static ExceptionOr<Vector<ApplePaySessionPaymentRequest::LineItem>> convertAndValidate(Optional<Vector<ApplePayLineItem>>&& lineItems) > { > Vector<ApplePaySessionPaymentRequest::LineItem> result; > if (!lineItems) >@@ -284,7 +284,7 @@ static ExceptionOr<PaymentAuthorizationResult> convertAndValidate(ApplePayPaymen > > case ApplePaySession::STATUS_INVALID_BILLING_POSTAL_ADDRESS: > convertedResult.status = PaymentAuthorizationStatus::Failure; >- convertedResult.errors.append({ PaymentError::Code::BillingContactInvalid, { }, std::nullopt }); >+ convertedResult.errors.append({ PaymentError::Code::BillingContactInvalid, { }, WTF::nullopt }); > break; > > case ApplePaySession::STATUS_INVALID_SHIPPING_POSTAL_ADDRESS: >@@ -294,7 +294,7 @@ static ExceptionOr<PaymentAuthorizationResult> convertAndValidate(ApplePayPaymen > > case ApplePaySession::STATUS_INVALID_SHIPPING_CONTACT: > convertedResult.status = PaymentAuthorizationStatus::Failure; >- convertedResult.errors.append({ PaymentError::Code::ShippingContactInvalid, { }, std::nullopt }); >+ convertedResult.errors.append({ PaymentError::Code::ShippingContactInvalid, { }, WTF::nullopt }); > break; > > case ApplePaySession::STATUS_PIN_REQUIRED: >@@ -691,8 +691,8 @@ ExceptionOr<void> ApplePaySession::completeShippingContactSelection(unsigned sho > { > ApplePayShippingContactUpdate update; > >- std::optional<ApplePayError::Code> errorCode; >- std::optional<ApplePayError::ContactField> contactField; >+ Optional<ApplePayError::Code> errorCode; >+ Optional<ApplePayError::ContactField> contactField; > > switch (status) { > case ApplePaySession::STATUS_SUCCESS: >diff --git a/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.cpp b/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.cpp >index b7f7047881a838a182a1318f997b923cf7e43648..41561d1f63959c8a6b196079e24daf9dd4050322 100644 >--- a/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.cpp >+++ b/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.cpp >@@ -37,7 +37,7 @@ ApplePaySessionPaymentRequest::ApplePaySessionPaymentRequest() = default; > > ApplePaySessionPaymentRequest::~ApplePaySessionPaymentRequest() = default; > >-bool isFinalStateResult(const std::optional<PaymentAuthorizationResult>& result) >+bool isFinalStateResult(const Optional<PaymentAuthorizationResult>& result) > { > if (!result) > return true; >diff --git a/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h b/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h >index d6ad7f59241bf62e8703744ee4ce9b73158c50e0..40e30b363b71ab3b87d7e132a7a652558b062a6b 100644 >--- a/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h >+++ b/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h >@@ -190,7 +190,7 @@ struct PaymentError { > > Code code; > String message; >- std::optional<ContactField> contactField; >+ Optional<ContactField> contactField; > }; > > struct PaymentAuthorizationResult { >@@ -213,7 +213,7 @@ struct ShippingMethodUpdate { > ApplePaySessionPaymentRequest::TotalAndLineItems newTotalAndLineItems; > }; > >-WEBCORE_EXPORT bool isFinalStateResult(const std::optional<PaymentAuthorizationResult>&); >+WEBCORE_EXPORT bool isFinalStateResult(const Optional<PaymentAuthorizationResult>&); > > } > >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp b/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp >index e373357cc07fea59de97ec55d5c8893d063864d3..164bba73de5c4da13f88fff0cdb87d40dbe3d1ee 100644 >--- a/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp >@@ -83,28 +83,28 @@ void PaymentCoordinator::completeMerchantValidation(const PaymentMerchantSession > m_client.completeMerchantValidation(paymentMerchantSession); > } > >-void PaymentCoordinator::completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&& update) >+void PaymentCoordinator::completeShippingMethodSelection(Optional<ShippingMethodUpdate>&& update) > { > ASSERT(m_activeSession); > > m_client.completeShippingMethodSelection(WTFMove(update)); > } > >-void PaymentCoordinator::completeShippingContactSelection(std::optional<ShippingContactUpdate>&& update) >+void PaymentCoordinator::completeShippingContactSelection(Optional<ShippingContactUpdate>&& update) > { > ASSERT(m_activeSession); > > m_client.completeShippingContactSelection(WTFMove(update)); > } > >-void PaymentCoordinator::completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&& update) >+void PaymentCoordinator::completePaymentMethodSelection(Optional<PaymentMethodUpdate>&& update) > { > ASSERT(m_activeSession); > > m_client.completePaymentMethodSelection(WTFMove(update)); > } > >-void PaymentCoordinator::completePaymentSession(std::optional<PaymentAuthorizationResult>&& result) >+void PaymentCoordinator::completePaymentSession(Optional<PaymentAuthorizationResult>&& result) > { > ASSERT(m_activeSession); > >@@ -194,13 +194,13 @@ void PaymentCoordinator::didCancelPaymentSession() > m_activeSession = nullptr; > } > >-std::optional<String> PaymentCoordinator::validatedPaymentNetwork(unsigned version, const String& paymentNetwork) const >+Optional<String> PaymentCoordinator::validatedPaymentNetwork(unsigned version, const String& paymentNetwork) const > { > if (version < 2 && equalIgnoringASCIICase(paymentNetwork, "jcb")) >- return std::nullopt; >+ return WTF::nullopt; > > if (version < 3 && equalIgnoringASCIICase(paymentNetwork, "carteBancaire")) >- return std::nullopt; >+ return WTF::nullopt; > > return m_client.validatedPaymentNetwork(paymentNetwork); > } >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinator.h b/Source/WebCore/Modules/applepay/PaymentCoordinator.h >index 5bf71daa26368fc834b154022c9cc1769a14bc3e..f93c545513a9355670912584b1ea17bf2ecb9116 100644 >--- a/Source/WebCore/Modules/applepay/PaymentCoordinator.h >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinator.h >@@ -60,10 +60,10 @@ public: > > bool beginPaymentSession(PaymentSession&, const URL& originatingURL, const Vector<URL>& linkIconURLs, const ApplePaySessionPaymentRequest&); > void completeMerchantValidation(const PaymentMerchantSession&); >- void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&); >- void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&); >- void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&); >- void completePaymentSession(std::optional<PaymentAuthorizationResult>&&); >+ void completeShippingMethodSelection(Optional<ShippingMethodUpdate>&&); >+ void completeShippingContactSelection(Optional<ShippingContactUpdate>&&); >+ void completePaymentMethodSelection(Optional<PaymentMethodUpdate>&&); >+ void completePaymentSession(Optional<PaymentAuthorizationResult>&&); > void abortPaymentSession(); > void cancelPaymentSession(); > >@@ -74,7 +74,7 @@ public: > WEBCORE_EXPORT void didSelectShippingContact(const PaymentContact&); > WEBCORE_EXPORT void didCancelPaymentSession(); > >- std::optional<String> validatedPaymentNetwork(unsigned version, const String&) const; >+ Optional<String> validatedPaymentNetwork(unsigned version, const String&) const; > > private: > PaymentCoordinatorClient& m_client; >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >index 85e4e4b04468890f4ec3c804d5a24738e814446b..170a4f3d35c0c9f1c2271a6910791e6751c9cd05 100644 >--- a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >@@ -46,17 +46,17 @@ struct ShippingMethodUpdate; > class PaymentCoordinatorClient { > public: > virtual bool supportsVersion(unsigned version) = 0; >- virtual std::optional<String> validatedPaymentNetwork(const String&) = 0; >+ virtual Optional<String> validatedPaymentNetwork(const String&) = 0; > virtual bool canMakePayments() = 0; > virtual void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) = 0; > virtual void openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) = 0; > > virtual bool showPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const ApplePaySessionPaymentRequest&) = 0; > virtual void completeMerchantValidation(const PaymentMerchantSession&) = 0; >- virtual void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&) = 0; >- virtual void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&) = 0; >- virtual void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&) = 0; >- virtual void completePaymentSession(std::optional<PaymentAuthorizationResult>&&) = 0; >+ virtual void completeShippingMethodSelection(Optional<ShippingMethodUpdate>&&) = 0; >+ virtual void completeShippingContactSelection(Optional<ShippingContactUpdate>&&) = 0; >+ virtual void completePaymentMethodSelection(Optional<PaymentMethodUpdate>&&) = 0; >+ virtual void completePaymentSession(Optional<PaymentAuthorizationResult>&&) = 0; > virtual void abortPaymentSession() = 0; > virtual void cancelPaymentSession() = 0; > virtual void paymentCoordinatorDestroyed() = 0; >diff --git a/Source/WebCore/Modules/applepay/PaymentMerchantSession.h b/Source/WebCore/Modules/applepay/PaymentMerchantSession.h >index daa749549f53f5da3d366d5e60839a288063b3f5..0c4fa24709e2b7032ed48f423b801c1ab0f25180 100644 >--- a/Source/WebCore/Modules/applepay/PaymentMerchantSession.h >+++ b/Source/WebCore/Modules/applepay/PaymentMerchantSession.h >@@ -47,7 +47,7 @@ public: > { > } > >- static std::optional<PaymentMerchantSession> fromJS(JSC::ExecState&, JSC::JSValue, String& errorMessage); >+ static Optional<PaymentMerchantSession> fromJS(JSC::ExecState&, JSC::JSValue, String& errorMessage); > > PKPaymentMerchantSession *pkPaymentMerchantSession() const { return m_pkPaymentMerchantSession.get(); } > >diff --git a/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm b/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm >index fc36c8953149f4330bd951a6aec22b8efb2e0dc4..e6fc3b93b06d532585a63d8948f0591ea91d8b51 100644 >--- a/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm >+++ b/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm >@@ -33,16 +33,16 @@ > > namespace WebCore { > >-std::optional<PaymentMerchantSession> PaymentMerchantSession::fromJS(JSC::ExecState& state, JSC::JSValue value, String&) >+Optional<PaymentMerchantSession> PaymentMerchantSession::fromJS(JSC::ExecState& state, JSC::JSValue value, String&) > { > // FIXME: Don't round-trip using NSString. > auto jsonString = JSONStringify(&state, value, 0); > if (!jsonString) >- return std::nullopt; >+ return WTF::nullopt; > > auto dictionary = dynamic_objc_cast<NSDictionary>([NSJSONSerialization JSONObjectWithData:[(NSString *)jsonString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]); > if (!dictionary || ![dictionary isKindOfClass:[NSDictionary class]]) >- return std::nullopt; >+ return WTF::nullopt; > > auto pkPaymentMerchantSession = adoptNS([PAL::allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]); > >diff --git a/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm b/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm >index a5c599aff6cb9a90541647d5653b86053d2a481c..bd6c9ae026ce2b2c01e940de0d7aa763e7ec3184 100644 >--- a/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm >+++ b/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm >@@ -50,10 +50,10 @@ static ApplePayPaymentPass::ActivationState convert(PKPaymentPassActivationState > } > } > >-static std::optional<ApplePayPaymentPass> convert(PKPaymentPass *paymentPass) >+static Optional<ApplePayPaymentPass> convert(PKPaymentPass *paymentPass) > { > if (!paymentPass) >- return std::nullopt; >+ return WTF::nullopt; > > ApplePayPaymentPass result; > >@@ -70,7 +70,7 @@ static std::optional<ApplePayPaymentPass> convert(PKPaymentPass *paymentPass) > return result; > } > >-static std::optional<ApplePayPaymentMethod::Type> convert(PKPaymentMethodType paymentMethodType) >+static Optional<ApplePayPaymentMethod::Type> convert(PKPaymentMethodType paymentMethodType) > { > switch (paymentMethodType) { > case PKPaymentMethodTypeDebit: >@@ -82,7 +82,7 @@ static std::optional<ApplePayPaymentMethod::Type> convert(PKPaymentMethodType pa > case PKPaymentMethodTypeStore: > return ApplePayPaymentMethod::Type::Store; > case PKPaymentMethodTypeUnknown: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp b/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp >index e75c215ea155af984753a1e283497e86b0c4a22f..156d08602c44d93b55efc5feaa7e492c64098f1a 100644 >--- a/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp >+++ b/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp >@@ -316,7 +316,7 @@ ExceptionOr<ApplePaySessionPaymentRequest::TotalAndLineItems> ApplePayPaymentHan > return ApplePaySessionPaymentRequest::TotalAndLineItems { WTFMove(total), WTFMove(lineItems) }; > } > >-static inline void appendShippingContactInvalidError(String&& message, std::optional<PaymentError::ContactField> contactField, Vector<PaymentError>& errors) >+static inline void appendShippingContactInvalidError(String&& message, Optional<PaymentError::ContactField> contactField, Vector<PaymentError>& errors) > { > if (!message.isNull()) > errors.append({ PaymentError::Code::ShippingContactInvalid, WTFMove(message), WTFMove(contactField) }); >@@ -347,7 +347,7 @@ void ApplePayPaymentHandler::computeAddressErrors(String&& error, AddressErrors& > return; > > using ContactField = PaymentError::ContactField; >- appendShippingContactInvalidError(WTFMove(error), std::nullopt, errors); >+ appendShippingContactInvalidError(WTFMove(error), WTF::nullopt, errors); > appendShippingContactInvalidError(WTFMove(addressErrors.addressLine), ContactField::AddressLines, errors); > appendShippingContactInvalidError(WTFMove(addressErrors.city), ContactField::Locality, errors); > appendShippingContactInvalidError(WTFMove(addressErrors.country), ContactField::Country, errors); >@@ -485,11 +485,11 @@ ExceptionOr<void> ApplePayPaymentHandler::paymentMethodUpdated() > return { }; > } > >-void ApplePayPaymentHandler::complete(std::optional<PaymentComplete>&& result) >+void ApplePayPaymentHandler::complete(Optional<PaymentComplete>&& result) > { > if (!result) { >- ASSERT(isFinalStateResult(std::nullopt)); >- paymentCoordinator().completePaymentSession(std::nullopt); >+ ASSERT(isFinalStateResult(WTF::nullopt)); >+ paymentCoordinator().completePaymentSession(WTF::nullopt); > return; > } > >@@ -521,7 +521,7 @@ ExceptionOr<void> ApplePayPaymentHandler::retry(PaymentValidationErrors&& valida > > // Ensure there is always at least one error to avoid having a final result. > if (errors.isEmpty()) >- errors.append({ PaymentError::Code::Unknown, { }, std::nullopt }); >+ errors.append({ PaymentError::Code::Unknown, { }, WTF::nullopt }); > > PaymentAuthorizationResult authorizationResult { PaymentAuthorizationStatus::Failure, WTFMove(errors) }; > ASSERT(!isFinalStateResult(authorizationResult)); >diff --git a/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h b/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h >index 5f42ac6e0d71319d768ad0a9ada8efb22ec73b4d..8bbc7aafacb2ca1aae06c98b37fa7475905f19b5 100644 >--- a/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h >+++ b/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h >@@ -70,7 +70,7 @@ private: > void canMakePayment(WTF::Function<void(bool)>&& completionHandler) final; > ExceptionOr<void> detailsUpdated(PaymentRequest::UpdateReason, String&& error, AddressErrors&&, PayerErrorFields&&, JSC::JSObject* paymentMethodErrors) final; > ExceptionOr<void> merchantValidationCompleted(JSC::JSValue&&) final; >- void complete(std::optional<PaymentComplete>&&) final; >+ void complete(Optional<PaymentComplete>&&) final; > ExceptionOr<void> retry(PaymentValidationErrors&&) final; > > // PaymentSession >@@ -84,8 +84,8 @@ private: > > PaymentRequest::MethodIdentifier m_identifier; > Ref<PaymentRequest> m_paymentRequest; >- std::optional<ApplePayRequest> m_applePayRequest; >- std::optional<ApplePayPaymentMethodType> m_selectedPaymentMethodType; >+ Optional<ApplePayRequest> m_applePayRequest; >+ Optional<ApplePayPaymentMethodType> m_selectedPaymentMethodType; > bool m_isUpdating { false }; > }; > >diff --git a/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h b/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h >index b2f1b49f3eb3a3ee80a4fb329f69e8bf8e51a98a..41417a4e55a35d0c4c3c3c823626e7b7959017a9 100644 >--- a/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h >+++ b/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h >@@ -49,7 +49,7 @@ struct ApplicationManifest { > URL startURL; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ApplicationManifest> decode(Decoder&); >+ template<class Decoder> static Optional<ApplicationManifest> decode(Decoder&); > }; > > template<class Encoder> >@@ -59,22 +59,22 @@ void ApplicationManifest::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ApplicationManifest> ApplicationManifest::decode(Decoder& decoder) >+Optional<ApplicationManifest> ApplicationManifest::decode(Decoder& decoder) > { > ApplicationManifest result; > > if (!decoder.decode(result.name)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.shortName)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.description)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.scope)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decodeEnum(result.display)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.startURL)) >- return std::nullopt; >+ return WTF::nullopt; > > return result; > } >diff --git a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >index 48976d2a352e20de414a6bf98e566ee470475e06..3146be733e37d2a70450c672a799037925fe039c 100644 >--- a/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >+++ b/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp >@@ -98,7 +98,7 @@ void NavigatorBeacon::logError(const ResourceError& error) > document->addConsoleMessage(MessageSource::Network, MessageLevel::Error, makeString("Beacon API cannot load "_s, error.failingURL().string(), messageMiddle, description)); > } > >-ExceptionOr<bool> NavigatorBeacon::sendBeacon(Document& document, const String& url, std::optional<FetchBody::Init>&& body) >+ExceptionOr<bool> NavigatorBeacon::sendBeacon(Document& document, const String& url, Optional<FetchBody::Init>&& body) > { > URL parsedUrl = document.completeURL(url); > >@@ -153,7 +153,7 @@ ExceptionOr<bool> NavigatorBeacon::sendBeacon(Document& document, const String& > return true; > } > >-ExceptionOr<bool> NavigatorBeacon::sendBeacon(Navigator& navigator, Document& document, const String& url, std::optional<FetchBody::Init>&& body) >+ExceptionOr<bool> NavigatorBeacon::sendBeacon(Navigator& navigator, Document& document, const String& url, Optional<FetchBody::Init>&& body) > { > return NavigatorBeacon::from(navigator)->sendBeacon(document, url, WTFMove(body)); > } >diff --git a/Source/WebCore/Modules/beacon/NavigatorBeacon.h b/Source/WebCore/Modules/beacon/NavigatorBeacon.h >index 349f643489811f6625c8f15646b6f1b833a3412f..f66ebe81bb6cf54475a7fb08a93364bc005877ca 100644 >--- a/Source/WebCore/Modules/beacon/NavigatorBeacon.h >+++ b/Source/WebCore/Modules/beacon/NavigatorBeacon.h >@@ -43,10 +43,10 @@ class NavigatorBeacon final : public Supplement<Navigator>, private CachedRawRes > public: > explicit NavigatorBeacon(Navigator&); > ~NavigatorBeacon(); >- static ExceptionOr<bool> sendBeacon(Navigator&, Document&, const String& url, std::optional<FetchBody::Init>&&); >+ static ExceptionOr<bool> sendBeacon(Navigator&, Document&, const String& url, Optional<FetchBody::Init>&&); > > private: >- ExceptionOr<bool> sendBeacon(Document&, const String& url, std::optional<FetchBody::Init>&&); >+ ExceptionOr<bool> sendBeacon(Document&, const String& url, Optional<FetchBody::Init>&&); > > static NavigatorBeacon* from(Navigator&); > static const char* supplementName(); >diff --git a/Source/WebCore/Modules/cache/DOMCache.cpp b/Source/WebCore/Modules/cache/DOMCache.cpp >index 87310a6b68677cd9667da991375c3f1ecf61b4d8..953a1adb46da1ca40164d5b2f3a64a9fafc76ea6 100644 >--- a/Source/WebCore/Modules/cache/DOMCache.cpp >+++ b/Source/WebCore/Modules/cache/DOMCache.cpp >@@ -103,7 +103,7 @@ Vector<Ref<FetchResponse>> DOMCache::cloneResponses(const Vector<CacheStorageRec > }); > } > >-void DOMCache::matchAll(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, MatchAllPromise&& promise) >+void DOMCache::matchAll(Optional<RequestInfo>&& info, CacheQueryOptions&& options, MatchAllPromise&& promise) > { > if (UNLIKELY(!scriptExecutionContext())) > return; >@@ -119,7 +119,7 @@ void DOMCache::matchAll(std::optional<RequestInfo>&& info, CacheQueryOptions&& o > } > > if (!request) { >- retrieveRecords(URL { }, [this, promise = WTFMove(promise)](std::optional<Exception>&& exception) mutable { >+ retrieveRecords(URL { }, [this, promise = WTFMove(promise)](Optional<Exception>&& exception) mutable { > if (exception) { > promise.reject(WTFMove(exception.value())); > return; >@@ -393,7 +393,7 @@ static inline Ref<FetchRequest> copyRequestRef(const CacheStorageRecord& record) > return record.request.copyRef(); > } > >-void DOMCache::keys(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, KeysPromise&& promise) >+void DOMCache::keys(Optional<RequestInfo>&& info, CacheQueryOptions&& options, KeysPromise&& promise) > { > if (UNLIKELY(!scriptExecutionContext())) > return; >@@ -409,7 +409,7 @@ void DOMCache::keys(std::optional<RequestInfo>&& info, CacheQueryOptions&& optio > } > > if (!request) { >- retrieveRecords(URL { }, [this, promise = WTFMove(promise)](std::optional<Exception>&& exception) mutable { >+ retrieveRecords(URL { }, [this, promise = WTFMove(promise)](Optional<Exception>&& exception) mutable { > if (exception) { > promise.reject(WTFMove(exception.value())); > return; >@@ -429,7 +429,7 @@ void DOMCache::keys(std::optional<RequestInfo>&& info, CacheQueryOptions&& optio > }); > } > >-void DOMCache::retrieveRecords(const URL& url, WTF::Function<void(std::optional<Exception>&&)>&& callback) >+void DOMCache::retrieveRecords(const URL& url, WTF::Function<void(Optional<Exception>&&)>&& callback) > { > setPendingActivity(this); > >@@ -445,7 +445,7 @@ void DOMCache::retrieveRecords(const URL& url, WTF::Function<void(std::optional< > > if (result.has_value()) > updateRecords(WTFMove(result.value())); >- callback(std::nullopt); >+ callback(WTF::nullopt); > } > unsetPendingActivity(this); > }); >@@ -454,7 +454,7 @@ void DOMCache::retrieveRecords(const URL& url, WTF::Function<void(std::optional< > void DOMCache::queryCache(Ref<FetchRequest>&& request, CacheQueryOptions&& options, WTF::Function<void(ExceptionOr<Vector<CacheStorageRecord>>&&)>&& callback) > { > auto url = request->url(); >- retrieveRecords(url, [this, request = WTFMove(request), options = WTFMove(options), callback = WTFMove(callback)](std::optional<Exception>&& exception) mutable { >+ retrieveRecords(url, [this, request = WTFMove(request), options = WTFMove(options), callback = WTFMove(callback)](Optional<Exception>&& exception) mutable { > if (exception) { > callback(WTFMove(exception.value())); > return; >@@ -549,7 +549,7 @@ void DOMCache::updateRecords(Vector<Record>&& records) > if (index != notFound) { > auto& current = m_records[index]; > if (current.updateResponseCounter != record.updateResponseCounter) { >- auto response = FetchResponse::create(*scriptExecutionContext(), std::nullopt, record.responseHeadersGuard, WTFMove(record.response)); >+ auto response = FetchResponse::create(*scriptExecutionContext(), WTF::nullopt, record.responseHeadersGuard, WTFMove(record.response)); > response->setBodyData(WTFMove(record.responseBody), record.responseBodySize); > > current.response = WTFMove(response); >@@ -558,9 +558,9 @@ void DOMCache::updateRecords(Vector<Record>&& records) > newRecords.append(WTFMove(current)); > } else { > auto requestHeaders = FetchHeaders::create(record.requestHeadersGuard, HTTPHeaderMap { record.request.httpHeaderFields() }); >- auto request = FetchRequest::create(*scriptExecutionContext(), std::nullopt, WTFMove(requestHeaders), WTFMove(record.request), WTFMove(record.options), WTFMove(record.referrer)); >+ auto request = FetchRequest::create(*scriptExecutionContext(), WTF::nullopt, WTFMove(requestHeaders), WTFMove(record.request), WTFMove(record.options), WTFMove(record.referrer)); > >- auto response = FetchResponse::create(*scriptExecutionContext(), std::nullopt, record.responseHeadersGuard, WTFMove(record.response)); >+ auto response = FetchResponse::create(*scriptExecutionContext(), WTF::nullopt, record.responseHeadersGuard, WTFMove(record.response)); > response->setBodyData(WTFMove(record.responseBody), record.responseBodySize); > > newRecords.append(CacheStorageRecord { record.identifier, record.updateResponseCounter, WTFMove(request), WTFMove(response) }); >diff --git a/Source/WebCore/Modules/cache/DOMCache.h b/Source/WebCore/Modules/cache/DOMCache.h >index 4f5adf86895a07d4697502431198dd66f3a0c226..9951dda447fdbfc7aae6442eb9ed275fc3660ae1 100644 >--- a/Source/WebCore/Modules/cache/DOMCache.h >+++ b/Source/WebCore/Modules/cache/DOMCache.h >@@ -45,13 +45,13 @@ public: > void match(RequestInfo&&, CacheQueryOptions&&, Ref<DeferredPromise>&&); > > using MatchAllPromise = DOMPromiseDeferred<IDLSequence<IDLInterface<FetchResponse>>>; >- void matchAll(std::optional<RequestInfo>&&, CacheQueryOptions&&, MatchAllPromise&&); >+ void matchAll(Optional<RequestInfo>&&, CacheQueryOptions&&, MatchAllPromise&&); > void add(RequestInfo&&, DOMPromiseDeferred<void>&&); > > void addAll(Vector<RequestInfo>&&, DOMPromiseDeferred<void>&&); > void put(RequestInfo&&, Ref<FetchResponse>&&, DOMPromiseDeferred<void>&&); > void remove(RequestInfo&&, CacheQueryOptions&&, DOMPromiseDeferred<IDLBoolean>&&); >- void keys(std::optional<RequestInfo>&&, CacheQueryOptions&&, KeysPromise&&); >+ void keys(Optional<RequestInfo>&&, CacheQueryOptions&&, KeysPromise&&); > > const String& name() const { return m_name; } > uint64_t identifier() const { return m_identifier; } >@@ -71,7 +71,7 @@ private: > > void putWithResponseData(DOMPromiseDeferred<void>&&, Ref<FetchRequest>&&, Ref<FetchResponse>&&, ExceptionOr<RefPtr<SharedBuffer>>&&); > >- void retrieveRecords(const URL&, WTF::Function<void(std::optional<Exception>&&)>&&); >+ void retrieveRecords(const URL&, WTF::Function<void(Optional<Exception>&&)>&&); > Vector<CacheStorageRecord> queryCacheWithTargetStorage(const FetchRequest&, const CacheQueryOptions&, const Vector<CacheStorageRecord>&); > void queryCache(Ref<FetchRequest>&&, CacheQueryOptions&&, WTF::Function<void(ExceptionOr<Vector<CacheStorageRecord>>&&)>&&); > void batchDeleteOperation(const FetchRequest&, CacheQueryOptions&&, WTF::Function<void(ExceptionOr<bool>&&)>&&); >diff --git a/Source/WebCore/Modules/cache/DOMCacheEngine.h b/Source/WebCore/Modules/cache/DOMCacheEngine.h >index ca5cd7c7ce55dac5a7f738862e9e658d19577c00..ec3b48ded9bb350725557d1714fe818bb5b1d995 100644 >--- a/Source/WebCore/Modules/cache/DOMCacheEngine.h >+++ b/Source/WebCore/Modules/cache/DOMCacheEngine.h >@@ -82,7 +82,7 @@ struct CacheInfos { > CacheInfos isolatedCopy(); > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<CacheInfos> decode(Decoder&); >+ template<class Decoder> static Optional<CacheInfos> decode(Decoder&); > > Vector<CacheInfo> infos; > uint64_t updateCounter; >@@ -90,7 +90,7 @@ struct CacheInfos { > > struct CacheIdentifierOperationResult { > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<CacheIdentifierOperationResult> decode(Decoder&); >+ template<class Decoder> static Optional<CacheIdentifierOperationResult> decode(Decoder&); > > uint64_t identifier { 0 }; > // True in case storing cache list on the filesystem failed. >@@ -110,7 +110,7 @@ using CacheInfosCallback = WTF::Function<void(CacheInfosOrError&&)>; > using RecordsOrError = Expected<Vector<Record>, Error>; > using RecordsCallback = WTF::Function<void(RecordsOrError&&)>; > >-using CompletionCallback = WTF::Function<void(std::optional<Error>&&)>; >+using CompletionCallback = WTF::Function<void(Optional<Error>&&)>; > > template<class Encoder> inline void CacheInfos::encode(Encoder& encoder) const > { >@@ -118,17 +118,17 @@ template<class Encoder> inline void CacheInfos::encode(Encoder& encoder) const > encoder << updateCounter; > } > >-template<class Decoder> inline std::optional<CacheInfos> CacheInfos::decode(Decoder& decoder) >+template<class Decoder> inline Optional<CacheInfos> CacheInfos::decode(Decoder& decoder) > { >- std::optional<Vector<CacheInfo>> infos; >+ Optional<Vector<CacheInfo>> infos; > decoder >> infos; > if (!infos) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> updateCounter; >+ Optional<uint64_t> updateCounter; > decoder >> updateCounter; > if (!updateCounter) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*infos), WTFMove(*updateCounter) }}; > } >@@ -139,17 +139,17 @@ template<class Encoder> inline void CacheIdentifierOperationResult::encode(Encod > encoder << hadStorageError; > } > >-template<class Decoder> inline std::optional<CacheIdentifierOperationResult> CacheIdentifierOperationResult::decode(Decoder& decoder) >+template<class Decoder> inline Optional<CacheIdentifierOperationResult> CacheIdentifierOperationResult::decode(Decoder& decoder) > { >- std::optional<uint64_t> identifier; >+ Optional<uint64_t> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> hadStorageError; >+ Optional<bool> hadStorageError; > decoder >> hadStorageError; > if (!hadStorageError) >- return std::nullopt; >+ return WTF::nullopt; > return {{ WTFMove(*identifier), WTFMove(*hadStorageError) }}; > } > >diff --git a/Source/WebCore/Modules/cache/DOMCacheStorage.cpp b/Source/WebCore/Modules/cache/DOMCacheStorage.cpp >index 27e8f0293c083f748721f52e5cdb666ef91b78fe..bfa33771324a5c24008d6e4c3a34fb6634bab9d8 100644 >--- a/Source/WebCore/Modules/cache/DOMCacheStorage.cpp >+++ b/Source/WebCore/Modules/cache/DOMCacheStorage.cpp >@@ -43,11 +43,11 @@ DOMCacheStorage::DOMCacheStorage(ScriptExecutionContext& context, Ref<CacheStora > suspendIfNeeded(); > } > >-std::optional<ClientOrigin> DOMCacheStorage::origin() const >+Optional<ClientOrigin> DOMCacheStorage::origin() const > { > auto* origin = scriptExecutionContext() ? scriptExecutionContext()->securityOrigin() : nullptr; > if (!origin) >- return std::nullopt; >+ return WTF::nullopt; > > return ClientOrigin { scriptExecutionContext()->topOrigin().data(), origin->data() }; > } >@@ -84,7 +84,7 @@ static inline Ref<DOMCache> copyCache(const Ref<DOMCache>& cache) > > void DOMCacheStorage::match(DOMCache::RequestInfo&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise) > { >- retrieveCaches([this, info = WTFMove(info), options = WTFMove(options), promise = WTFMove(promise)](std::optional<Exception>&& exception) mutable { >+ retrieveCaches([this, info = WTFMove(info), options = WTFMove(options), promise = WTFMove(promise)](Optional<Exception>&& exception) mutable { > if (exception) { > promise->reject(WTFMove(exception.value())); > return; >@@ -119,7 +119,7 @@ void DOMCacheStorage::match(DOMCache::RequestInfo&& info, CacheQueryOptions&& op > > void DOMCacheStorage::has(const String& name, DOMPromiseDeferred<IDLBoolean>&& promise) > { >- retrieveCaches([this, name, promise = WTFMove(promise)](std::optional<Exception>&& exception) mutable { >+ retrieveCaches([this, name, promise = WTFMove(promise)](Optional<Exception>&& exception) mutable { > if (exception) { > promise.reject(WTFMove(exception.value())); > return; >@@ -136,7 +136,7 @@ Ref<DOMCache> DOMCacheStorage::findCacheOrCreate(CacheInfo&& info) > return DOMCache::create(*scriptExecutionContext(), WTFMove(info.name), info.identifier, m_connection.copyRef()); > } > >-void DOMCacheStorage::retrieveCaches(WTF::Function<void(std::optional<Exception>&&)>&& callback) >+void DOMCacheStorage::retrieveCaches(WTF::Function<void(Optional<Exception>&&)>&& callback) > { > auto origin = this->origin(); > if (!origin) >@@ -158,7 +158,7 @@ void DOMCacheStorage::retrieveCaches(WTF::Function<void(std::optional<Exception> > return findCacheOrCreate(WTFMove(info)); > }); > } >- callback(std::nullopt); >+ callback(WTF::nullopt); > } > }); > } >@@ -173,7 +173,7 @@ static void logConsolePersistencyError(ScriptExecutionContext* context, const St > > void DOMCacheStorage::open(const String& name, DOMPromiseDeferred<IDLInterface<DOMCache>>&& promise) > { >- retrieveCaches([this, name, promise = WTFMove(promise)](std::optional<Exception>&& exception) mutable { >+ retrieveCaches([this, name, promise = WTFMove(promise)](Optional<Exception>&& exception) mutable { > if (exception) { > promise.reject(WTFMove(exception.value())); > return; >@@ -209,7 +209,7 @@ void DOMCacheStorage::doOpen(const String& name, DOMPromiseDeferred<IDLInterface > > void DOMCacheStorage::remove(const String& name, DOMPromiseDeferred<IDLBoolean>&& promise) > { >- retrieveCaches([this, name, promise = WTFMove(promise)](std::optional<Exception>&& exception) mutable { >+ retrieveCaches([this, name, promise = WTFMove(promise)](Optional<Exception>&& exception) mutable { > if (exception) { > promise.reject(WTFMove(exception.value())); > return; >@@ -241,7 +241,7 @@ void DOMCacheStorage::doRemove(const String& name, DOMPromiseDeferred<IDLBoolean > > void DOMCacheStorage::keys(KeysPromise&& promise) > { >- retrieveCaches([this, promise = WTFMove(promise)](std::optional<Exception>&& exception) mutable { >+ retrieveCaches([this, promise = WTFMove(promise)](Optional<Exception>&& exception) mutable { > if (exception) { > promise.reject(WTFMove(exception.value())); > return; >diff --git a/Source/WebCore/Modules/cache/DOMCacheStorage.h b/Source/WebCore/Modules/cache/DOMCacheStorage.h >index f30fd3d326cc6d9f295feb3862462e56161e40e4..a5f96aa62ac2f442bcbe1f7523aabe2d88935d4c 100644 >--- a/Source/WebCore/Modules/cache/DOMCacheStorage.h >+++ b/Source/WebCore/Modules/cache/DOMCacheStorage.h >@@ -54,9 +54,9 @@ private: > > void doOpen(const String& name, DOMPromiseDeferred<IDLInterface<DOMCache>>&&); > void doRemove(const String&, DOMPromiseDeferred<IDLBoolean>&&); >- void retrieveCaches(WTF::Function<void(std::optional<Exception>&&)>&&); >+ void retrieveCaches(WTF::Function<void(Optional<Exception>&&)>&&); > Ref<DOMCache> findCacheOrCreate(DOMCacheEngine::CacheInfo&&); >- std::optional<ClientOrigin> origin() const; >+ Optional<ClientOrigin> origin() const; > > Vector<Ref<DOMCache>> m_caches; > uint64_t m_updateCounter { 0 }; >diff --git a/Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h b/Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h >index a8653392bcd31d6eb5d525130156b063dfb0898e..237b6f2931d682e1c1112a314a3dd4743c9e8ead 100644 >--- a/Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h >+++ b/Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h >@@ -36,7 +36,7 @@ namespace WebCore { > > struct CredentialCreationOptions { > RefPtr<AbortSignal> signal; >- std::optional<PublicKeyCredentialCreationOptions> publicKey; >+ Optional<PublicKeyCredentialCreationOptions> publicKey; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h b/Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h >index 81c94eaafa759dd8d269553ae318b68f41fdd583..8c7749cc4e2e2d685a8709f95f4c86e6179629d5 100644 >--- a/Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h >+++ b/Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h >@@ -40,7 +40,7 @@ struct CredentialRequestOptions { > > MediationRequirement mediation; > RefPtr<AbortSignal> signal; >- std::optional<PublicKeyCredentialRequestOptions> publicKey; >+ Optional<PublicKeyCredentialRequestOptions> publicKey; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/encryptedmedia/CDM.cpp b/Source/WebCore/Modules/encryptedmedia/CDM.cpp >index 34cf3d367818289853556a673caceca7a7af830f..93566501a99e19888b1bd395452881c474557df6 100644 >--- a/Source/WebCore/Modules/encryptedmedia/CDM.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/CDM.cpp >@@ -102,13 +102,13 @@ void CDM::doSupportedConfigurationStep(MediaKeySystemConfiguration&& candidateCo > // restrictions and origin. > auto optionalConfiguration = getSupportedConfiguration(candidateConfiguration, restrictions); > if (!optionalConfiguration) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > > auto consentCallback = [weakThis = makeWeakPtr(*this), callback = WTFMove(callback)] (ConsentStatus status, MediaKeySystemConfiguration&& configuration, MediaKeysRestrictions&& restrictions) mutable { > if (!weakThis) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > // 3.1.1.2 Get Supported Configuration and Consent, ctd. >@@ -162,14 +162,14 @@ bool CDM::isPersistentType(MediaKeySessionType sessionType) > return false; > } > >-std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const MediaKeySystemConfiguration& candidateConfiguration, MediaKeysRestrictions& restrictions) >+Optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const MediaKeySystemConfiguration& candidateConfiguration, MediaKeysRestrictions& restrictions) > { > // https://w3c.github.io/encrypted-media/#get-supported-configuration-and-consent > // W3C Editor's Draft 09 November 2016 > > ASSERT(m_private); > if (!m_private) >- return std::nullopt; >+ return WTF::nullopt; > > // 3.1.1.2 Get Supported Configuration and Consent > // Given a Key Systems implementation implementation, MediaKeySystemConfiguration candidate configuration, >@@ -201,7 +201,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > > // 3.3. If supported types is empty, return NotSupported. > if (supportedTypes.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > // 3.4. Set the initDataTypes member of accumulated configuration to supported types. > accumulatedConfiguration.initDataTypes = WTFMove(supportedTypes); >@@ -222,7 +222,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > // If the implementation does not support use of Distinctive Identifier(s) in combination > // with accumulated configuration and restrictions, return NotSupported. > if (m_private->distinctiveIdentifiersRequirement(accumulatedConfiguration, restrictions) == MediaKeysRequirement::NotAllowed) >- return std::nullopt; >+ return WTF::nullopt; > break; > > case MediaKeysRequirement::Optional: >@@ -235,7 +235,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > // If the implementation requires use Distinctive Identifier(s) or Distinctive Permanent Identifier(s) > // in combination with accumulated configuration and restrictions, return NotSupported. > if (m_private->distinctiveIdentifiersRequirement(accumulatedConfiguration, restrictions) == MediaKeysRequirement::Required) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > >@@ -257,7 +257,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > // If the implementation does not support persisting state in combination with accumulated configuration > // and restrictions, return NotSupported. > if (m_private->persistentStateRequirement(accumulatedConfiguration, restrictions) == MediaKeysRequirement::NotAllowed) >- return std::nullopt; >+ return WTF::nullopt; > break; > > case MediaKeysRequirement::Optional: >@@ -270,7 +270,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > // If the implementation requires persisting state in combination with accumulated configuration > // and restrictions, return NotSupported > if (m_private->persistentStateRequirement(accumulatedConfiguration, restrictions) == MediaKeysRequirement::Required) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > >@@ -296,12 +296,12 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > // 13.2. If accumulated configuration's persistentState value is "not-allowed" and the > // Is persistent session type? algorithm returns true for session type return NotSupported. > if (accumulatedConfiguration.persistentState == MediaKeysRequirement::NotAllowed && isPersistentType(sessionType)) >- return std::nullopt; >+ return WTF::nullopt; > > // 13.3. If the implementation does not support session type in combination with accumulated configuration > // and restrictions for other reasons, return NotSupported. > if (!m_private->supportsSessionTypeWithConfiguration(sessionType, accumulatedConfiguration)) >- return std::nullopt; >+ return WTF::nullopt; > > // 13.4 If accumulated configuration's persistentState value is "optional" and the result of running the Is > // persistent session type? algorithm on session type is true, change accumulated configuration's persistentState >@@ -315,7 +315,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > > // 15. If the videoCapabilities and audioCapabilities members in candidate configuration are both empty, return NotSupported. > if (candidateConfiguration.videoCapabilities.isEmpty() && candidateConfiguration.audioCapabilities.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > // 16. â³ If the videoCapabilities member in candidate configuration is non-empty: > if (!candidateConfiguration.videoCapabilities.isEmpty()) { >@@ -325,7 +325,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > > // 16.2. If video capabilities is null, return NotSupported. > if (!videoCapabilities) >- return std::nullopt; >+ return WTF::nullopt; > > // 16.3 Set the videoCapabilities member of accumulated configuration to video capabilities. > accumulatedConfiguration.videoCapabilities = WTFMove(videoCapabilities.value()); >@@ -343,7 +343,7 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > > // 17.2. If audio capabilities is null, return NotSupported. > if (!audioCapabilities) >- return std::nullopt; >+ return WTF::nullopt; > > // 17.3 Set the audioCapabilities member of accumulated configuration to audio capabilities. > accumulatedConfiguration.audioCapabilities = WTFMove(audioCapabilities.value()); >@@ -385,30 +385,30 @@ std::optional<MediaKeySystemConfiguration> CDM::getSupportedConfiguration(const > // 20. If implementation in the configuration specified by the combination of the values in accumulated configuration > // is not supported or not allowed in the origin, return NotSupported. > if (!m_private->supportsConfiguration(accumulatedConfiguration)) >- return std::nullopt; >+ return WTF::nullopt; > > Document* document = downcast<Document>(m_scriptExecutionContext); > if (!document) >- return std::nullopt; >+ return WTF::nullopt; > > SecurityOrigin& origin = document->securityOrigin(); > SecurityOrigin& topOrigin = document->topOrigin(); > > if ((accumulatedConfiguration.distinctiveIdentifier == MediaKeysRequirement::Required || accumulatedConfiguration.persistentState == MediaKeysRequirement::Required) && !origin.canAccessLocalStorage(&topOrigin)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(accumulatedConfiguration); > // NOTE: Continued in getConsentStatus(). > } > >-std::optional<Vector<MediaKeySystemMediaCapability>> CDM::getSupportedCapabilitiesForAudioVideoType(CDM::AudioVideoType type, const Vector<MediaKeySystemMediaCapability>& requestedCapabilities, const MediaKeySystemConfiguration& partialConfiguration, MediaKeysRestrictions& restrictions) >+Optional<Vector<MediaKeySystemMediaCapability>> CDM::getSupportedCapabilitiesForAudioVideoType(CDM::AudioVideoType type, const Vector<MediaKeySystemMediaCapability>& requestedCapabilities, const MediaKeySystemConfiguration& partialConfiguration, MediaKeysRestrictions& restrictions) > { > // https://w3c.github.io/encrypted-media/#get-supported-capabilities-for-audio-video-type > // W3C Editor's Draft 09 November 2016 > > ASSERT(m_private); > if (!m_private) >- return std::nullopt; >+ return WTF::nullopt; > > // 3.1.1.3 Get Supported Capabilities for Audio/Video Type > >@@ -430,7 +430,7 @@ std::optional<Vector<MediaKeySystemMediaCapability>> CDM::getSupportedCapabiliti > > // 3.3. If content type is the empty string, return null. > if (requestedCapability.contentType.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > // 3.4. If content type is an invalid or unrecognized MIME type, continue to the next iteration. > if (!isValidContentType(requestedCapability.contentType)) >@@ -493,7 +493,7 @@ std::optional<Vector<MediaKeySystemMediaCapability>> CDM::getSupportedCapabiliti > > // 4. If supported media capabilities is empty, return null. > if (supportedMediaCapabilities.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > // 5. Return supported media capabilities. > return supportedMediaCapabilities; >@@ -631,10 +631,10 @@ RefPtr<SharedBuffer> CDM::sanitizeResponse(const SharedBuffer& response) > return m_private->sanitizeResponse(response); > } > >-std::optional<String> CDM::sanitizeSessionId(const String& sessionId) >+Optional<String> CDM::sanitizeSessionId(const String& sessionId) > { > if (!m_private) >- return std::nullopt; >+ return WTF::nullopt; > return m_private->sanitizeSessionId(sessionId); > } > >diff --git a/Source/WebCore/Modules/encryptedmedia/CDM.h b/Source/WebCore/Modules/encryptedmedia/CDM.h >index e1558c5c2b04f3ebf9b56bcac9c07576897e407d..2e7fa187b4e67ad06e516ea3f54ad44554c5548b 100644 >--- a/Source/WebCore/Modules/encryptedmedia/CDM.h >+++ b/Source/WebCore/Modules/encryptedmedia/CDM.h >@@ -57,7 +57,7 @@ public: > static Ref<CDM> create(Document&, const String& keySystem); > ~CDM(); > >- using SupportedConfigurationCallback = WTF::Function<void(std::optional<MediaKeySystemConfiguration>)>; >+ using SupportedConfigurationCallback = WTF::Function<void(Optional<MediaKeySystemConfiguration>)>; > void getSupportedConfiguration(MediaKeySystemConfiguration&& candidateConfiguration, SupportedConfigurationCallback&&); > > const String& keySystem() const { return m_keySystem; } >@@ -73,7 +73,7 @@ public: > > RefPtr<SharedBuffer> sanitizeResponse(const SharedBuffer&); > >- std::optional<String> sanitizeSessionId(const String& sessionId); >+ Optional<String> sanitizeSessionId(const String& sessionId); > > String storageDirectory() const; > >@@ -98,8 +98,8 @@ private: > }; > > void doSupportedConfigurationStep(MediaKeySystemConfiguration&& candidateConfiguration, MediaKeysRestrictions&&, SupportedConfigurationCallback&&); >- std::optional<MediaKeySystemConfiguration> getSupportedConfiguration(const MediaKeySystemConfiguration& candidateConfiguration, MediaKeysRestrictions&); >- std::optional<Vector<MediaKeySystemMediaCapability>> getSupportedCapabilitiesForAudioVideoType(AudioVideoType, const Vector<MediaKeySystemMediaCapability>& requestedCapabilities, const MediaKeySystemConfiguration& partialConfiguration, MediaKeysRestrictions&); >+ Optional<MediaKeySystemConfiguration> getSupportedConfiguration(const MediaKeySystemConfiguration& candidateConfiguration, MediaKeysRestrictions&); >+ Optional<Vector<MediaKeySystemMediaCapability>> getSupportedCapabilitiesForAudioVideoType(AudioVideoType, const Vector<MediaKeySystemMediaCapability>& requestedCapabilities, const MediaKeySystemConfiguration& partialConfiguration, MediaKeysRestrictions&); > > using ConsentStatusCallback = WTF::Function<void(ConsentStatus, MediaKeySystemConfiguration&&, MediaKeysRestrictions&&)>; > void getConsentStatus(MediaKeySystemConfiguration&& accumulatedConfiguration, MediaKeysRestrictions&&, ConsentStatusCallback&&); >diff --git a/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp b/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp >index 01f883cec68bd9f3fb6efa686d7947e61daa6744..9f8b5e0551b65870da590793b25f991842a346cb 100644 >--- a/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp >@@ -49,25 +49,25 @@ namespace { > const uint32_t kKeyIdsMaxKeyIdSizeInBytes = 512; > } > >-static std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDsKeyids(const SharedBuffer& buffer) >+static Optional<Vector<Ref<SharedBuffer>>> extractKeyIDsKeyids(const SharedBuffer& buffer) > { > // 1. Format > // https://w3c.github.io/encrypted-media/format-registry/initdata/keyids.html#format > if (buffer.size() > std::numeric_limits<unsigned>::max()) >- return std::nullopt; >+ return WTF::nullopt; > String json { buffer.data(), static_cast<unsigned>(buffer.size()) }; > > RefPtr<JSON::Value> value; > if (!JSON::Value::parseJSON(json, value)) >- return std::nullopt; >+ return WTF::nullopt; > > RefPtr<JSON::Object> object; > if (!value->asObject(object)) >- return std::nullopt; >+ return WTF::nullopt; > > RefPtr<JSON::Array> kidsArray; > if (!object->getArray("kids", kidsArray)) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<Ref<SharedBuffer>> keyIDs; > for (auto& value : *kidsArray) { >@@ -80,7 +80,7 @@ static std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDsKeyids(const Shared > continue; > > if (keyIDData.size() < kKeyIdsMinKeyIdSizeInBytes || keyIDData.size() > kKeyIdsMaxKeyIdSizeInBytes) >- return std::nullopt; >+ return WTF::nullopt; > > Ref<SharedBuffer> keyIDBuffer = SharedBuffer::create(WTFMove(keyIDData)); > keyIDs.append(WTFMove(keyIDBuffer)); >@@ -107,12 +107,12 @@ static RefPtr<SharedBuffer> sanitizeKeyids(const SharedBuffer& buffer) > return SharedBuffer::create(jsonData.data(), jsonData.length()); > } > >-static std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDsCenc(const SharedBuffer& buffer) >+static Optional<Vector<Ref<SharedBuffer>>> extractKeyIDsCenc(const SharedBuffer& buffer) > { > // 4. Common SystemID and PSSH Box Format > // https://w3c.github.io/encrypted-media/format-registry/initdata/cenc.html#common-system > if (buffer.size() >= kCencMaxBoxSize) >- return std::nullopt; >+ return WTF::nullopt; > > unsigned offset = 0; > Vector<Ref<SharedBuffer>> keyIDs; >@@ -123,11 +123,11 @@ static std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDsCenc(const SharedBu > auto& boxSize = optionalBoxType.value().second; > > if (boxTypeName != ISOProtectionSystemSpecificHeaderBox::boxTypeName() || boxSize > buffer.size()) >- return std::nullopt; >+ return WTF::nullopt; > > ISOProtectionSystemSpecificHeaderBox psshBox; > if (!psshBox.read(view, offset)) >- return std::nullopt; >+ return WTF::nullopt; > > for (auto& value : psshBox.keyIDs()) > keyIDs.append(SharedBuffer::create(WTFMove(value))); >@@ -156,12 +156,12 @@ static RefPtr<SharedBuffer> sanitizeWebM(const SharedBuffer& buffer) > return buffer.copy(); > } > >-static std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDsWebM(const SharedBuffer& buffer) >+static Optional<Vector<Ref<SharedBuffer>>> extractKeyIDsWebM(const SharedBuffer& buffer) > { > Vector<Ref<SharedBuffer>> keyIDs; > RefPtr<SharedBuffer> sanitizedBuffer = sanitizeWebM(buffer); > if (!sanitizedBuffer) >- return std::nullopt; >+ return WTF::nullopt; > > // 1. Format > // https://w3c.github.io/encrypted-media/format-registry/initdata/webm.html#format >@@ -192,11 +192,11 @@ RefPtr<SharedBuffer> InitDataRegistry::sanitizeInitData(const AtomicString& init > return iter->value.sanitizeInitData(buffer); > } > >-std::optional<Vector<Ref<SharedBuffer>>> InitDataRegistry::extractKeyIDs(const AtomicString& initDataType, const SharedBuffer& buffer) >+Optional<Vector<Ref<SharedBuffer>>> InitDataRegistry::extractKeyIDs(const AtomicString& initDataType, const SharedBuffer& buffer) > { > auto iter = m_types.find(initDataType); > if (iter == m_types.end() || !iter->value.sanitizeInitData) >- return std::nullopt; >+ return WTF::nullopt; > return iter->value.extractKeyIDs(buffer); > } > >diff --git a/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.h b/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.h >index d1e3584dfe3509dfd2b4b9487068918d45b89223..054d3770e47538f0616647955e6ea977d6a07454 100644 >--- a/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.h >+++ b/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.h >@@ -46,11 +46,11 @@ public: > friend class NeverDestroyed<InitDataRegistry>; > > RefPtr<SharedBuffer> sanitizeInitData(const AtomicString& initDataType, const SharedBuffer&); >- WEBCORE_EXPORT std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDs(const AtomicString& initDataType, const SharedBuffer&); >+ WEBCORE_EXPORT Optional<Vector<Ref<SharedBuffer>>> extractKeyIDs(const AtomicString& initDataType, const SharedBuffer&); > > struct InitDataTypeCallbacks { > using SanitizeInitDataCallback = Function<RefPtr<SharedBuffer>(const SharedBuffer&)>; >- using ExtractKeyIDsCallback = Function<std::optional<Vector<Ref<SharedBuffer>>>(const SharedBuffer&)>; >+ using ExtractKeyIDsCallback = Function<Optional<Vector<Ref<SharedBuffer>>>(const SharedBuffer&)>; > > SanitizeInitDataCallback sanitizeInitData; > ExtractKeyIDsCallback extractKeyIDs; >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >index d9e96cc6345b92f98c3f10cebc583cb6c5b820de..392a37c636a8563a865800605fb09b2908df552a 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >@@ -275,7 +275,7 @@ void MediaKeySession::load(const String& sessionId, Ref<DeferredPromise>&& promi > m_taskQueue.enqueueTask([this, sessionId, promise = WTFMove(promise)] () mutable { > // 8.1. Let sanitized session ID be a validated and/or sanitized version of sessionId. > // 8.2. If the preceding step failed, or if sanitized session ID is empty, reject promise with a newly created TypeError. >- std::optional<String> sanitizedSessionId = m_implementation->sanitizeSessionId(sessionId); >+ Optional<String> sanitizedSessionId = m_implementation->sanitizeSessionId(sessionId); > if (!sanitizedSessionId || sanitizedSessionId->isEmpty()) { > promise->reject(TypeError); > return; >@@ -293,7 +293,7 @@ void MediaKeySession::load(const String& sessionId, Ref<DeferredPromise>&& promi > // 8.6. Let message type be null. > // 8.7. Let cdm be the CDM instance represented by this object's cdm instance value. > // 8.8. Use the cdm to execute the following steps: >- m_instanceSession->loadSession(m_sessionType, *sanitizedSessionId, origin, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise), sanitizedSessionId = *sanitizedSessionId] (std::optional<CDMInstanceSession::KeyStatusVector>&& knownKeys, std::optional<double>&& expiration, std::optional<CDMInstanceSession::Message>&& message, CDMInstanceSession::SuccessValue succeeded, CDMInstanceSession::SessionLoadFailure failure) mutable { >+ m_instanceSession->loadSession(m_sessionType, *sanitizedSessionId, origin, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise), sanitizedSessionId = *sanitizedSessionId] (Optional<CDMInstanceSession::KeyStatusVector>&& knownKeys, Optional<double>&& expiration, Optional<CDMInstanceSession::Message>&& message, CDMInstanceSession::SuccessValue succeeded, CDMInstanceSession::SessionLoadFailure failure) mutable { > // 8.8.1. If there is no data stored for the sanitized session ID in the origin, resolve promise with false and abort these steps. > // 8.8.2. If the stored session's session type is not the same as the current MediaKeySession session type, reject promise with a newly created TypeError. > // 8.8.3. Let session data be the data stored for the sanitized session ID in the origin. This must not include data from other origin(s) or that is not associated with an origin. >@@ -396,7 +396,7 @@ void MediaKeySession::update(const BufferSource& response, Ref<DeferredPromise>& > // 6.5. Let session closed be false. > // 6.6. Let cdm be the CDM instance represented by this object's cdm instance value. > // 6.7. Use the cdm to execute the following steps: >- m_instanceSession->updateLicense(m_sessionId, m_sessionType, *sanitizedResponse, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] (bool sessionWasClosed, std::optional<CDMInstanceSession::KeyStatusVector>&& changedKeys, std::optional<double>&& changedExpiration, std::optional<CDMInstanceSession::Message>&& message, CDMInstanceSession::SuccessValue succeeded) mutable { >+ m_instanceSession->updateLicense(m_sessionId, m_sessionType, *sanitizedResponse, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] (bool sessionWasClosed, Optional<CDMInstanceSession::KeyStatusVector>&& changedKeys, Optional<double>&& changedExpiration, Optional<CDMInstanceSession::Message>&& message, CDMInstanceSession::SuccessValue succeeded) mutable { > if (!weakThis) > return; > >@@ -553,7 +553,7 @@ void MediaKeySession::remove(Ref<DeferredPromise>&& promise) > // 4.3. Let message type be null. > > // 4.4. Use the cdm to execute the following steps: >- m_instanceSession->removeSessionData(m_sessionId, m_sessionType, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] (CDMInstanceSession::KeyStatusVector&& keys, std::optional<Ref<SharedBuffer>>&& message, CDMInstanceSession::SuccessValue succeeded) mutable { >+ m_instanceSession->removeSessionData(m_sessionId, m_sessionType, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] (CDMInstanceSession::KeyStatusVector&& keys, Optional<Ref<SharedBuffer>>&& message, CDMInstanceSession::SuccessValue succeeded) mutable { > if (!weakThis) > return; > >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp >index fc0451eedc4f43458d7d83b3f09f88d58e36c82f..6d55ff598f9084ceb12bec8eff7904549f70fd1b 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp >@@ -93,14 +93,14 @@ MediaKeyStatusMap::Iterator::Iterator(MediaKeyStatusMap& map) > { > } > >-std::optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> MediaKeyStatusMap::Iterator::next() >+Optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> MediaKeyStatusMap::Iterator::next() > { > if (!m_map->m_session) >- return std::nullopt; >+ return WTF::nullopt; > > auto& statuses = m_map->m_session->statuses(); > if (m_index >= statuses.size()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& pair = statuses[m_index++]; > auto buffer = ArrayBuffer::create(pair.first->data(), pair.first->size()); >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h >index 906af191dfb1068ca4d4f05f3b95d1e4ff7b85bf..72d6b6ee50c09a56d23b682c1e6ea102b1063fd4 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h >@@ -62,7 +62,7 @@ public: > class Iterator { > public: > explicit Iterator(MediaKeyStatusMap&); >- std::optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> next(); >+ Optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> next(); > > private: > Ref<MediaKeyStatusMap> m_map; >diff --git a/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp b/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp >index af8ff5a0a80ce8baaad07a1d5bca6140cee030e1..b751eea9f55242740dd27ff0b983a0b2d0d26469 100644 >--- a/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp >@@ -83,7 +83,7 @@ static void tryNextSupportedConfiguration(RefPtr<CDM>&& implementation, Vector<M > MediaKeySystemConfiguration candidateConfiguration = WTFMove(supportedConfigurations.first()); > supportedConfigurations.remove(0); > >- CDM::SupportedConfigurationCallback callback = [implementation = implementation, supportedConfigurations = WTFMove(supportedConfigurations), promise] (std::optional<MediaKeySystemConfiguration> supportedConfiguration) mutable { >+ CDM::SupportedConfigurationCallback callback = [implementation = implementation, supportedConfigurations = WTFMove(supportedConfigurations), promise] (Optional<MediaKeySystemConfiguration> supportedConfiguration) mutable { > // 6.3.3. If supported configuration is not NotSupported, run the following steps: > if (supportedConfiguration) { > // 6.3.3.1. Let access be a new MediaKeySystemAccess object, and initialize it as follows: >diff --git a/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp b/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp >index 8faf04d03780b00ea256fc3053a3848e7ecc52b9..6dd4171308ad467f2a4c27c9ce97729b3fad8cf9 100644 >--- a/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp >+++ b/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp >@@ -177,11 +177,11 @@ static ExceptionOr<String> validatePathIsExpectedType(const String& fullPath, St > return WTFMove(virtualPath); > } > >-static std::optional<FileMetadata::Type> fileType(const String& fullPath) >+static Optional<FileMetadata::Type> fileType(const String& fullPath) > { > auto metadata = FileSystem::fileMetadata(fullPath); > if (!metadata || metadata.value().isHidden) >- return std::nullopt; >+ return WTF::nullopt; > return metadata.value().type; > } > >diff --git a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h >index 4fb6479654ee419be59b38ccf57debbe7b6db7b8..3dd3d51030b66a879cf3f6904a2fd2c61ac0919f 100644 >--- a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h >+++ b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h >@@ -56,7 +56,7 @@ private: > bool canSuspendForDocumentSuspension() const final; > > Ref<FileSystemDirectoryEntry> m_directory; >- std::optional<Exception> m_error; >+ Optional<Exception> m_error; > bool m_isReading { false }; > bool m_isDone { false }; > }; >diff --git a/Source/WebCore/Modules/fetch/FetchBody.cpp b/Source/WebCore/Modules/fetch/FetchBody.cpp >index 07a4cddd1d4b3cf4339f2b0c987a3e1d271af2f0..4898ccc63ac2f42ea70e07a83e45bbd5bf4642fb 100644 >--- a/Source/WebCore/Modules/fetch/FetchBody.cpp >+++ b/Source/WebCore/Modules/fetch/FetchBody.cpp >@@ -70,7 +70,7 @@ FetchBody FetchBody::extract(ScriptExecutionContext& context, Init&& value, Stri > }); > } > >-std::optional<FetchBody> FetchBody::fromFormData(FormData& formData) >+Optional<FetchBody> FetchBody::fromFormData(FormData& formData) > { > ASSERT(!formData.isEmpty()); > >@@ -88,7 +88,7 @@ std::optional<FetchBody> FetchBody::fromFormData(FormData& formData) > } > > // FIXME: Support form data bodies. >- return std::nullopt; >+ return WTF::nullopt; > } > > void FetchBody::arrayBuffer(FetchBodyOwner& owner, Ref<DeferredPromise>&& promise) >diff --git a/Source/WebCore/Modules/fetch/FetchBody.h b/Source/WebCore/Modules/fetch/FetchBody.h >index daad7c42c4779b1a40695d0f150d7f9f4b996c52..816c63c98b15cefd904ecab9c703fa427700e146 100644 >--- a/Source/WebCore/Modules/fetch/FetchBody.h >+++ b/Source/WebCore/Modules/fetch/FetchBody.h >@@ -58,7 +58,7 @@ public: > static FetchBody extract(ScriptExecutionContext&, Init&&, String&); > FetchBody() = default; > >- WEBCORE_EXPORT static std::optional<FetchBody> fromFormData(FormData&); >+ WEBCORE_EXPORT static Optional<FetchBody> fromFormData(FormData&); > > void loadingFailed(); > void loadingSucceeded(); >diff --git a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp b/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp >index 03b94f112abeed45d2337e47d51343a67ce9c866..85dc88bd7f6bf09a8d57f3cbd73d160c59b6fcbd 100644 >--- a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp >+++ b/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp >@@ -37,7 +37,7 @@ > > namespace WebCore { > >-FetchBodyOwner::FetchBodyOwner(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers) >+FetchBodyOwner::FetchBodyOwner(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers) > : ActiveDOMObject(&context) > , m_body(WTFMove(body)) > , m_headers(WTFMove(headers)) >@@ -218,7 +218,7 @@ void FetchBodyOwner::loadBlob(const Blob& blob, FetchBodyConsumer* consumer) > m_blobLoader->loader->start(*scriptExecutionContext(), blob); > if (!m_blobLoader->loader->isStarted()) { > m_body->loadingFailed(); >- m_blobLoader = std::nullopt; >+ m_blobLoader = WTF::nullopt; > return; > } > setPendingActivity(this); >@@ -228,7 +228,7 @@ void FetchBodyOwner::finishBlobLoading() > { > ASSERT(m_blobLoader); > >- m_blobLoader = std::nullopt; >+ m_blobLoader = WTF::nullopt; > unsetPendingActivity(this); > } > >diff --git a/Source/WebCore/Modules/fetch/FetchBodyOwner.h b/Source/WebCore/Modules/fetch/FetchBodyOwner.h >index cc0ef2c963d550fdde95b4cc6cafd652de272cd9..45cc67e6a8eae08b26e9d055f9e4d459d35f66e2 100644 >--- a/Source/WebCore/Modules/fetch/FetchBodyOwner.h >+++ b/Source/WebCore/Modules/fetch/FetchBodyOwner.h >@@ -40,7 +40,7 @@ namespace WebCore { > > class FetchBodyOwner : public RefCounted<FetchBodyOwner>, public ActiveDOMObject { > public: >- FetchBodyOwner(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&); >+ FetchBodyOwner(ScriptExecutionContext&, Optional<FetchBody>&&, Ref<FetchHeaders>&&); > ~FetchBodyOwner(); > > bool bodyUsed() const { return isDisturbed(); } >@@ -109,17 +109,17 @@ private: > }; > > protected: >- std::optional<FetchBody> m_body; >+ Optional<FetchBody> m_body; > String m_contentType; > bool m_isDisturbed { false }; > #if ENABLE(STREAMS_API) > RefPtr<FetchBodySource> m_readableStreamSource; > #endif > Ref<FetchHeaders> m_headers; >- std::optional<ResourceError> m_loadingError; >+ Optional<ResourceError> m_loadingError; > > private: >- std::optional<BlobLoader> m_blobLoader; >+ Optional<BlobLoader> m_blobLoader; > bool m_isBodyOpaque { false }; > }; > >diff --git a/Source/WebCore/Modules/fetch/FetchHeaders.cpp b/Source/WebCore/Modules/fetch/FetchHeaders.cpp >index 1c87482add10bea448bc2ac6da6199d0e5ed31bc..cb171b5aa871e078566c8fa2ad9a42806335835a 100644 >--- a/Source/WebCore/Modules/fetch/FetchHeaders.cpp >+++ b/Source/WebCore/Modules/fetch/FetchHeaders.cpp >@@ -100,7 +100,7 @@ static ExceptionOr<void> fillHeaderMap(HTTPHeaderMap& headers, const FetchHeader > return { }; > } > >-ExceptionOr<Ref<FetchHeaders>> FetchHeaders::create(std::optional<Init>&& headersInit) >+ExceptionOr<Ref<FetchHeaders>> FetchHeaders::create(Optional<Init>&& headersInit) > { > HTTPHeaderMap headers; > >@@ -186,7 +186,7 @@ void FetchHeaders::filterAndFill(const HTTPHeaderMap& headers, Guard guard) > } > } > >-std::optional<WTF::KeyValuePair<String, String>> FetchHeaders::Iterator::next() >+Optional<WTF::KeyValuePair<String, String>> FetchHeaders::Iterator::next() > { > while (m_currentIndex < m_keys.size()) { > auto key = m_keys[m_currentIndex++]; >@@ -194,7 +194,7 @@ std::optional<WTF::KeyValuePair<String, String>> FetchHeaders::Iterator::next() > if (!value.isNull()) > return WTF::KeyValuePair<String, String> { WTFMove(key), WTFMove(value) }; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > FetchHeaders::Iterator::Iterator(FetchHeaders& headers) >diff --git a/Source/WebCore/Modules/fetch/FetchHeaders.h b/Source/WebCore/Modules/fetch/FetchHeaders.h >index 2e9c3bd48cbe45a33c5561b9e77878ab13f33789..c116f178f5dcb017fe07eeedea68adc2e3fc7b34 100644 >--- a/Source/WebCore/Modules/fetch/FetchHeaders.h >+++ b/Source/WebCore/Modules/fetch/FetchHeaders.h >@@ -47,7 +47,7 @@ public: > }; > > using Init = Variant<Vector<Vector<String>>, Vector<WTF::KeyValuePair<String, String>>>; >- static ExceptionOr<Ref<FetchHeaders>> create(std::optional<Init>&&); >+ static ExceptionOr<Ref<FetchHeaders>> create(Optional<Init>&&); > > static Ref<FetchHeaders> create(Guard guard = Guard::None, HTTPHeaderMap&& headers = { }) { return adoptRef(*new FetchHeaders { guard, WTFMove(headers) }); } > static Ref<FetchHeaders> create(const FetchHeaders& headers) { return adoptRef(*new FetchHeaders { headers }); } >@@ -69,7 +69,7 @@ public: > class Iterator { > public: > explicit Iterator(FetchHeaders&); >- std::optional<WTF::KeyValuePair<String, String>> next(); >+ Optional<WTF::KeyValuePair<String, String>> next(); > > private: > Ref<FetchHeaders> m_headers; >diff --git a/Source/WebCore/Modules/fetch/FetchRequest.cpp b/Source/WebCore/Modules/fetch/FetchRequest.cpp >index e3ee5d959a08c9dd676b022c8761dbf57c5c17e8..944451b86b9c5511f09e2574f97d83d26d05050d 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequest.cpp >+++ b/Source/WebCore/Modules/fetch/FetchRequest.cpp >@@ -35,14 +35,14 @@ > > namespace WebCore { > >-static std::optional<Exception> setMethod(ResourceRequest& request, const String& initMethod) >+static Optional<Exception> setMethod(ResourceRequest& request, const String& initMethod) > { > if (!isValidHTTPToken(initMethod)) > return Exception { TypeError, "Method is not a valid HTTP token."_s }; > if (isForbiddenMethod(initMethod)) > return Exception { TypeError, "Method is forbidden."_s }; > request.setHTTPMethod(normalizeHTTPMethod(initMethod)); >- return std::nullopt; >+ return WTF::nullopt; > } > > static ExceptionOr<String> computeReferrer(ScriptExecutionContext& context, const String& referrer) >@@ -64,7 +64,7 @@ static ExceptionOr<String> computeReferrer(ScriptExecutionContext& context, cons > return String { referrerURL.string() }; > } > >-static std::optional<Exception> buildOptions(FetchOptions& options, ResourceRequest& request, String& referrer, ScriptExecutionContext& context, const FetchRequest::Init& init) >+static Optional<Exception> buildOptions(FetchOptions& options, ResourceRequest& request, String& referrer, ScriptExecutionContext& context, const FetchRequest::Init& init) > { > if (!init.window.isUndefinedOrNull() && !init.window.isEmpty()) > return Exception { TypeError, "Window can only be null."_s }; >@@ -114,7 +114,7 @@ static std::optional<Exception> buildOptions(FetchOptions& options, ResourceRequ > return exception; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > static bool methodCanHaveBody(const ResourceRequest& request) >@@ -231,7 +231,7 @@ ExceptionOr<void> FetchRequest::setBody(FetchRequest& request) > if (!methodCanHaveBody(m_request)) > return Exception { TypeError, makeString("Request has method '", m_request.httpMethod(), "' and cannot have a body") }; > // FIXME: If body has a readable stream, we should pipe it to this new body stream. >- m_body = WTFMove(request.m_body); >+ m_body = WTFMove(*request.m_body); > request.setDisturbed(); > } > >@@ -242,7 +242,7 @@ ExceptionOr<void> FetchRequest::setBody(FetchRequest& request) > > ExceptionOr<Ref<FetchRequest>> FetchRequest::create(ScriptExecutionContext& context, Info&& input, Init&& init) > { >- auto request = adoptRef(*new FetchRequest(context, std::nullopt, FetchHeaders::create(FetchHeaders::Guard::Request), { }, { }, { })); >+ auto request = adoptRef(*new FetchRequest(context, WTF::nullopt, FetchHeaders::create(FetchHeaders::Guard::Request), { }, { }, { })); > > if (WTF::holds_alternative<String>(input)) { > auto result = request->initializeWith(WTF::get<String>(input), WTFMove(init)); >@@ -291,7 +291,7 @@ ExceptionOr<Ref<FetchRequest>> FetchRequest::clone(ScriptExecutionContext& conte > if (isDisturbedOrLocked()) > return Exception { TypeError, "Body is disturbed or locked"_s }; > >- auto clone = adoptRef(*new FetchRequest(context, std::nullopt, FetchHeaders::create(m_headers.get()), ResourceRequest { m_request }, FetchOptions { m_options}, String { m_referrer })); >+ auto clone = adoptRef(*new FetchRequest(context, WTF::nullopt, FetchHeaders::create(m_headers.get()), ResourceRequest { m_request }, FetchOptions { m_options}, String { m_referrer })); > clone->cloneBody(*this); > return WTFMove(clone); > } >diff --git a/Source/WebCore/Modules/fetch/FetchRequest.h b/Source/WebCore/Modules/fetch/FetchRequest.h >index 05685175d86bbd7f703a7fa56f521fb952a987f5..ccdbf86ab3884c3cf98fb51f34990a5d40128b69 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequest.h >+++ b/Source/WebCore/Modules/fetch/FetchRequest.h >@@ -53,7 +53,7 @@ public: > using Redirect = FetchOptions::Redirect; > > static ExceptionOr<Ref<FetchRequest>> create(ScriptExecutionContext&, Info&&, Init&&); >- static Ref<FetchRequest> create(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceRequest&& request, FetchOptions&& options, String&& referrer) { return adoptRef(*new FetchRequest(context, WTFMove(body), WTFMove(headers), WTFMove(request), WTFMove(options), WTFMove(referrer))); } >+ static Ref<FetchRequest> create(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceRequest&& request, FetchOptions&& options, String&& referrer) { return adoptRef(*new FetchRequest(context, WTFMove(body), WTFMove(headers), WTFMove(request), WTFMove(options), WTFMove(referrer))); } > > const String& method() const { return m_request.httpMethod(); } > const String& urlString() const; >@@ -81,7 +81,7 @@ public: > ResourceRequest resourceRequest() const; > > private: >- FetchRequest(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&, ResourceRequest&&, FetchOptions&&, String&& referrer); >+ FetchRequest(ScriptExecutionContext&, Optional<FetchBody>&&, Ref<FetchHeaders>&&, ResourceRequest&&, FetchOptions&&, String&& referrer); > > ExceptionOr<void> initializeOptions(const Init&); > ExceptionOr<void> initializeWith(FetchRequest&, Init&&); >@@ -98,7 +98,7 @@ private: > mutable String m_requestURL; > }; > >-inline FetchRequest::FetchRequest(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceRequest&& request, FetchOptions&& options, String&& referrer) >+inline FetchRequest::FetchRequest(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceRequest&& request, FetchOptions&& options, String&& referrer) > : FetchBodyOwner(context, WTFMove(body), WTFMove(headers)) > , m_request(WTFMove(request)) > , m_options(WTFMove(options)) >diff --git a/Source/WebCore/Modules/fetch/FetchRequestInit.h b/Source/WebCore/Modules/fetch/FetchRequestInit.h >index 97b001681e7f1ba4d30cfd84aed4ad9d7ea97b70..d2cb809564c21ae6ee7a48505cfdc6e6489939c2 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequestInit.h >+++ b/Source/WebCore/Modules/fetch/FetchRequestInit.h >@@ -36,16 +36,16 @@ namespace WebCore { > > struct FetchRequestInit { > String method; >- std::optional<FetchHeaders::Init> headers; >- std::optional<FetchBody::Init> body; >+ Optional<FetchHeaders::Init> headers; >+ Optional<FetchBody::Init> body; > String referrer; >- std::optional<ReferrerPolicy> referrerPolicy; >- std::optional<FetchOptions::Mode> mode; >- std::optional<FetchOptions::Credentials> credentials; >- std::optional<FetchOptions::Cache> cache; >- std::optional<FetchOptions::Redirect> redirect; >+ Optional<ReferrerPolicy> referrerPolicy; >+ Optional<FetchOptions::Mode> mode; >+ Optional<FetchOptions::Credentials> credentials; >+ Optional<FetchOptions::Cache> cache; >+ Optional<FetchOptions::Redirect> redirect; > String integrity; >- std::optional<bool> keepalive; >+ Optional<bool> keepalive; > JSC::JSValue window; > > bool hasMembers() const { return !method.isEmpty() || headers || body || !referrer.isEmpty() || referrerPolicy || mode || credentials || cache || redirect || !integrity.isEmpty() || keepalive || !window.isUndefined(); } >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.cpp b/Source/WebCore/Modules/fetch/FetchResponse.cpp >index ff8c3a24a041f20055ab3de81936c8eed9230e41..61fe682f6366c167a36ae5e1d41b7b95f94447f3 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.cpp >+++ b/Source/WebCore/Modules/fetch/FetchResponse.cpp >@@ -46,7 +46,7 @@ static inline bool isNullBodyStatus(int status) > return status == 101 || status == 204 || status == 205 || status == 304; > } > >-Ref<FetchResponse> FetchResponse::create(ScriptExecutionContext& context, std::optional<FetchBody>&& body, FetchHeaders::Guard guard, ResourceResponse&& response) >+Ref<FetchResponse> FetchResponse::create(ScriptExecutionContext& context, Optional<FetchBody>&& body, FetchHeaders::Guard guard, ResourceResponse&& response) > { > bool isSynthetic = response.type() == ResourceResponse::Type::Default || response.type() == ResourceResponse::Type::Error; > bool isOpaque = response.tainting() == ResourceResponse::Tainting::Opaque; >@@ -60,7 +60,7 @@ Ref<FetchResponse> FetchResponse::create(ScriptExecutionContext& context, std::o > return fetchResponse; > } > >-ExceptionOr<Ref<FetchResponse>> FetchResponse::create(ScriptExecutionContext& context, std::optional<FetchBody::Init>&& body, Init&& init) >+ExceptionOr<Ref<FetchResponse>> FetchResponse::create(ScriptExecutionContext& context, Optional<FetchBody::Init>&& body, Init&& init) > { > // 1. If initâs status member is not in the range 200 to 599, inclusive, then throw a RangeError. > if (init.status < 200 || init.status > 599) >@@ -89,7 +89,7 @@ ExceptionOr<Ref<FetchResponse>> FetchResponse::create(ScriptExecutionContext& co > return result.releaseException(); > } > >- std::optional<FetchBody> extractedBody; >+ Optional<FetchBody> extractedBody; > > // 8. If body is non-null, run these substeps: > if (body) { >@@ -157,7 +157,7 @@ ExceptionOr<Ref<FetchResponse>> FetchResponse::redirect(ScriptExecutionContext& > return WTFMove(redirectResponse); > } > >-FetchResponse::FetchResponse(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response) >+FetchResponse::FetchResponse(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response) > : FetchBodyOwner(context, WTFMove(body), WTFMove(headers)) > , m_internalResponse(WTFMove(response)) > { >@@ -178,7 +178,7 @@ ExceptionOr<Ref<FetchResponse>> FetchResponse::clone(ScriptExecutionContext& con > if (m_internalResponse.type() == ResourceResponse::Type::Default) > m_internalResponse.setHTTPHeaderFields(HTTPHeaderMap { headers().internalHeaders() }); > >- auto clone = FetchResponse::create(context, std::nullopt, headers().guard(), ResourceResponse { m_internalResponse }); >+ auto clone = FetchResponse::create(context, WTF::nullopt, headers().guard(), ResourceResponse { m_internalResponse }); > clone->m_loadingError = m_loadingError; > clone->cloneBody(*this); > clone->m_opaqueLoadIdentifier = m_opaqueLoadIdentifier; >@@ -199,7 +199,7 @@ void FetchResponse::fetch(ScriptExecutionContext& context, FetchRequest& request > > response->m_bodyLoader.emplace(response.get(), WTFMove(responseCallback)); > if (!response->m_bodyLoader->start(context, request)) >- response->m_bodyLoader = std::nullopt; >+ response->m_bodyLoader = WTF::nullopt; > } > > const String& FetchResponse::url() const >@@ -237,7 +237,7 @@ void FetchResponse::BodyLoader::didSucceed() > > if (m_loader->isStarted()) { > Ref<FetchResponse> protector(m_response); >- m_response.m_bodyLoader = std::nullopt; >+ m_response.m_bodyLoader = WTF::nullopt; > } > } > >@@ -264,7 +264,7 @@ void FetchResponse::BodyLoader::didFail(const ResourceError& error) > // Check whether didFail is called as part of FetchLoader::start. > if (m_loader->isStarted()) { > Ref<FetchResponse> protector(m_response); >- m_response.m_bodyLoader = std::nullopt; >+ m_response.m_bodyLoader = WTF::nullopt; > } > } > >@@ -481,7 +481,7 @@ void FetchResponse::stop() > FetchBodyOwner::stop(); > if (m_bodyLoader) { > m_bodyLoader->stop(); >- m_bodyLoader = std::nullopt; >+ m_bodyLoader = WTF::nullopt; > } > } > >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.h b/Source/WebCore/Modules/fetch/FetchResponse.h >index a8424ea8d19059a1973881087eadbd6be34ff1b9..97f7d3b0b811dfe25d4261eefdf9ab38ce299638 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.h >+++ b/Source/WebCore/Modules/fetch/FetchResponse.h >@@ -52,12 +52,12 @@ public: > struct Init { > unsigned short status { 200 }; > String statusText { "OK"_s }; >- std::optional<FetchHeaders::Init> headers; >+ Optional<FetchHeaders::Init> headers; > }; > >- WEBCORE_EXPORT static Ref<FetchResponse> create(ScriptExecutionContext&, std::optional<FetchBody>&&, FetchHeaders::Guard, ResourceResponse&&); >+ WEBCORE_EXPORT static Ref<FetchResponse> create(ScriptExecutionContext&, Optional<FetchBody>&&, FetchHeaders::Guard, ResourceResponse&&); > >- static ExceptionOr<Ref<FetchResponse>> create(ScriptExecutionContext&, std::optional<FetchBody::Init>&&, Init&&); >+ static ExceptionOr<Ref<FetchResponse>> create(ScriptExecutionContext&, Optional<FetchBody::Init>&&, Init&&); > static Ref<FetchResponse> error(ScriptExecutionContext&); > static ExceptionOr<Ref<FetchResponse>> redirect(ScriptExecutionContext&, const String& url, int status); > >@@ -107,12 +107,12 @@ public: > > void initializeOpaqueLoadIdentifierForTesting() { m_opaqueLoadIdentifier = 1; } > >- const std::optional<ResourceError>& loadingError() const { return m_loadingError; } >+ const Optional<ResourceError>& loadingError() const { return m_loadingError; } > > const HTTPHeaderMap& internalResponseHeaders() const { return m_internalResponse.httpHeaderFields(); } > > private: >- FetchResponse(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&, ResourceResponse&&); >+ FetchResponse(ScriptExecutionContext&, Optional<FetchBody>&&, Ref<FetchHeaders>&&, ResourceResponse&&); > > void stop() final; > const char* activeDOMObjectName() const final; >@@ -151,9 +151,9 @@ private: > std::unique_ptr<FetchLoader> m_loader; > }; > >- mutable std::optional<ResourceResponse> m_filteredResponse; >+ mutable Optional<ResourceResponse> m_filteredResponse; > ResourceResponse m_internalResponse; >- std::optional<BodyLoader> m_bodyLoader; >+ Optional<BodyLoader> m_bodyLoader; > mutable String m_responseURL; > // Opaque responses will padd their body size when used with Cache API. > uint64_t m_bodySizeWithPadding { 0 }; >diff --git a/Source/WebCore/Modules/geolocation/Coordinates.h b/Source/WebCore/Modules/geolocation/Coordinates.h >index e1975bea062abb2e18ac3ba9ab15e89572fd74ce..6d518282aecd51f61de6b5609631dcc533ef853e 100644 >--- a/Source/WebCore/Modules/geolocation/Coordinates.h >+++ b/Source/WebCore/Modules/geolocation/Coordinates.h >@@ -46,12 +46,12 @@ public: > > double latitude() const { return m_position.latitude; } > double longitude() const { return m_position.longitude; } >- std::optional<double> altitude() const { return m_position.altitude; } >+ Optional<double> altitude() const { return m_position.altitude; } > double accuracy() const { return m_position.accuracy; } >- std::optional<double> altitudeAccuracy() const { return m_position.altitudeAccuracy; } >- std::optional<double> heading() const { return m_position.heading; } >- std::optional<double> speed() const { return m_position.speed; } >- std::optional<double> floorLevel() const { return m_position.floorLevel; } >+ Optional<double> altitudeAccuracy() const { return m_position.altitudeAccuracy; } >+ Optional<double> heading() const { return m_position.heading; } >+ Optional<double> speed() const { return m_position.speed; } >+ Optional<double> floorLevel() const { return m_position.floorLevel; } > > private: > explicit Coordinates(GeolocationPosition&&); >diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp >index 9d250675fde7c2ec1fb631a91feea7cc438c5a9b..2b333e516bead7ff649f4e81f146bee986295458 100644 >--- a/Source/WebCore/Modules/geolocation/Geolocation.cpp >+++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp >@@ -52,7 +52,7 @@ static const ASCIILiteral failedToStartServiceErrorMessage { "Failed to start Ge > static const ASCIILiteral framelessDocumentErrorMessage { "Geolocation cannot be used in frameless documents"_s }; > static const ASCIILiteral originCannotRequestGeolocationErrorMessage { "Origin does not have permission to use Geolocation service"_s }; > >-static RefPtr<Geoposition> createGeoposition(std::optional<GeolocationPosition>&& position) >+static RefPtr<Geoposition> createGeoposition(Optional<GeolocationPosition>&& position) > { > if (!position) > return nullptr; >diff --git a/Source/WebCore/Modules/geolocation/GeolocationClient.h b/Source/WebCore/Modules/geolocation/GeolocationClient.h >index 25da5625633f37d797232a036ad3d2ec50844af0..e7e0e76d40fc55d2fc4b4ef527c32497341e3939 100644 >--- a/Source/WebCore/Modules/geolocation/GeolocationClient.h >+++ b/Source/WebCore/Modules/geolocation/GeolocationClient.h >@@ -44,7 +44,7 @@ public: > // We should update WebKit to reflect this if and when the V2 specification > // is published. > virtual void setEnableHighAccuracy(bool) = 0; >- virtual std::optional<GeolocationPosition> lastPosition() = 0; >+ virtual Optional<GeolocationPosition> lastPosition() = 0; > > virtual void requestPermission(Geolocation&) = 0; > virtual void cancelPermissionRequest(Geolocation&) = 0; >diff --git a/Source/WebCore/Modules/geolocation/GeolocationController.cpp b/Source/WebCore/Modules/geolocation/GeolocationController.cpp >index 08b34ed0a36663c78569847c73fae6a8126f0d98..b09fc3433bbfbb728f315c1533a6f2c9e4fc0071 100644 >--- a/Source/WebCore/Modules/geolocation/GeolocationController.cpp >+++ b/Source/WebCore/Modules/geolocation/GeolocationController.cpp >@@ -99,7 +99,7 @@ void GeolocationController::cancelPermissionRequest(Geolocation& geolocation) > m_client.cancelPermissionRequest(geolocation); > } > >-void GeolocationController::positionChanged(const std::optional<GeolocationPosition>& position) >+void GeolocationController::positionChanged(const Optional<GeolocationPosition>& position) > { > m_lastPosition = position; > Vector<Ref<Geolocation>> observersVector; >@@ -120,7 +120,7 @@ void GeolocationController::errorOccurred(GeolocationError& error) > observer->setError(error); > } > >-std::optional<GeolocationPosition> GeolocationController::lastPosition() >+Optional<GeolocationPosition> GeolocationController::lastPosition() > { > if (m_lastPosition) > return m_lastPosition.value(); >diff --git a/Source/WebCore/Modules/geolocation/GeolocationController.h b/Source/WebCore/Modules/geolocation/GeolocationController.h >index c0596238175045771b50da4c7e91625899d3316c..0c7049ba1013c242c9252c6152bfe3481aa16566 100644 >--- a/Source/WebCore/Modules/geolocation/GeolocationController.h >+++ b/Source/WebCore/Modules/geolocation/GeolocationController.h >@@ -53,10 +53,10 @@ public: > void requestPermission(Geolocation&); > void cancelPermissionRequest(Geolocation&); > >- WEBCORE_EXPORT void positionChanged(const std::optional<GeolocationPosition>&); >+ WEBCORE_EXPORT void positionChanged(const Optional<GeolocationPosition>&); > WEBCORE_EXPORT void errorOccurred(GeolocationError&); > >- std::optional<GeolocationPosition> lastPosition(); >+ Optional<GeolocationPosition> lastPosition(); > > GeolocationClient& client() { return m_client; } > >@@ -69,7 +69,7 @@ private: > > void activityStateDidChange(OptionSet<ActivityState::Flag> oldActivityState, OptionSet<ActivityState::Flag> newActivityState) override; > >- std::optional<GeolocationPosition> m_lastPosition; >+ Optional<GeolocationPosition> m_lastPosition; > > typedef HashSet<Ref<Geolocation>> ObserversSet; > // All observers; both those requesting high accuracy and those not. >diff --git a/Source/WebCore/Modules/geolocation/GeolocationPosition.h b/Source/WebCore/Modules/geolocation/GeolocationPosition.h >index 32e519152ac21895600ef34d21af60a6a7933326..d69db543f8e0f6de745dd630158e1d11d7162be4 100644 >--- a/Source/WebCore/Modules/geolocation/GeolocationPosition.h >+++ b/Source/WebCore/Modules/geolocation/GeolocationPosition.h >@@ -58,11 +58,11 @@ public: > double longitude { std::numeric_limits<double>::quiet_NaN() }; > double accuracy { std::numeric_limits<double>::quiet_NaN() }; > >- std::optional<double> altitude; >- std::optional<double> altitudeAccuracy; >- std::optional<double> heading; >- std::optional<double> speed; >- std::optional<double> floorLevel; >+ Optional<double> altitude; >+ Optional<double> altitudeAccuracy; >+ Optional<double> heading; >+ Optional<double> speed; >+ Optional<double> floorLevel; > > bool isValid() const; > >diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h >index 76a12859101046e652b8edab4f703e0d4ad1593e..a383166d8bf7ebcd4e0939594022df497f15ee38 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h >+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h >@@ -57,7 +57,7 @@ public: > RefPtr<DOMStringList> objectStoreNames() const; > > struct ObjectStoreParameters { >- std::optional<IDBKeyPath> keyPath; >+ Optional<IDBKeyPath> keyPath; > bool autoIncrement; > }; > >diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h >index 7de4cdad3e1dcdb01c3aaf44f025671762d25bb7..f42a9f9d8014d871d73eb9588190cc0bbb8b7c13 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h >+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h >@@ -91,7 +91,7 @@ public: > static String databaseDirectoryRelativeToRoot(const SecurityOriginData& topLevelOrigin, const SecurityOriginData& openingOrigin, const String& rootDirectory); > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<IDBDatabaseIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<IDBDatabaseIdentifier> decode(Decoder&); > > #if !LOG_DISABLED > String debugString() const; >@@ -128,27 +128,27 @@ void IDBDatabaseIdentifier::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<IDBDatabaseIdentifier> IDBDatabaseIdentifier::decode(Decoder& decoder) >+Optional<IDBDatabaseIdentifier> IDBDatabaseIdentifier::decode(Decoder& decoder) > { >- std::optional<String> databaseName; >+ Optional<String> databaseName; > decoder >> databaseName; > if (!databaseName) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<PAL::SessionID> sessionID; >+ Optional<PAL::SessionID> sessionID; > decoder >> sessionID; > if (!sessionID) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<SecurityOriginData> openingOrigin; >+ Optional<SecurityOriginData> openingOrigin; > decoder >> openingOrigin; > if (!openingOrigin) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<SecurityOriginData> mainFrameOrigin; >+ Optional<SecurityOriginData> mainFrameOrigin; > decoder >> mainFrameOrigin; > if (!mainFrameOrigin) >- return std::nullopt; >+ return WTF::nullopt; > > IDBDatabaseIdentifier identifier; > identifier.m_databaseName = WTFMove(*databaseName); // FIXME: When decoding from IPC, databaseName can be null, and the non-empty constructor asserts that this is not the case. >diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp >index 4e11e7bce72073c784cabb87dd76d1019e41371d..974c53479a933776ae1ff9b5afcbac71c308fafe 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp >@@ -72,7 +72,7 @@ IDBFactory::IDBFactory(IDBClient::IDBConnectionProxy& connectionProxy) > > IDBFactory::~IDBFactory() = default; > >-ExceptionOr<Ref<IDBOpenDBRequest>> IDBFactory::open(ScriptExecutionContext& context, const String& name, std::optional<uint64_t> version) >+ExceptionOr<Ref<IDBOpenDBRequest>> IDBFactory::open(ScriptExecutionContext& context, const String& name, Optional<uint64_t> version) > { > LOG(IndexedDB, "IDBFactory::open"); > >diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.h b/Source/WebCore/Modules/indexeddb/IDBFactory.h >index 1f04d130cb1772c24132096ce90766409c7dc161..a447132403b57eeb286d4d2faa41be0b9c04c64d 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBFactory.h >+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.h >@@ -53,7 +53,7 @@ public: > static Ref<IDBFactory> create(IDBClient::IDBConnectionProxy&); > ~IDBFactory(); > >- ExceptionOr<Ref<IDBOpenDBRequest>> open(ScriptExecutionContext&, const String& name, std::optional<uint64_t> version); >+ ExceptionOr<Ref<IDBOpenDBRequest>> open(ScriptExecutionContext&, const String& name, Optional<uint64_t> version); > ExceptionOr<Ref<IDBOpenDBRequest>> deleteDatabase(ScriptExecutionContext&, const String& name); > > ExceptionOr<short> cmp(JSC::ExecState&, JSC::JSValue first, JSC::JSValue second); >diff --git a/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h b/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h >index 27b759d50dfb4b49a0ff1b54ddf2f5efd8e20400..3e96f90cdf5a20fee2e371a7ba55934af3abd22a 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h >+++ b/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h >@@ -115,7 +115,7 @@ bool IDBGetAllResult::decode(Decoder& decoder, IDBGetAllResult& result) > } > case 1: { > result.m_results = Vector<IDBValue>(); >- std::optional<Vector<IDBValue>> optional; >+ Optional<Vector<IDBValue>> optional; > decoder >> optional; > if (!optional) > return false; >diff --git a/Source/WebCore/Modules/indexeddb/IDBGetResult.h b/Source/WebCore/Modules/indexeddb/IDBGetResult.h >index 109e4893f7136fadf925618a141c8de43b001f0b..7ec7abc112f35078aa8933de18b803fdd41e1648 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBGetResult.h >+++ b/Source/WebCore/Modules/indexeddb/IDBGetResult.h >@@ -131,13 +131,13 @@ void IDBGetResult::encode(Encoder& encoder) const > template<class Decoder> > bool IDBGetResult::decode(Decoder& decoder, IDBGetResult& result) > { >- std::optional<IDBKeyData> keyData; >+ Optional<IDBKeyData> keyData; > decoder >> keyData; > if (!keyData) > return false; > result.m_keyData = WTFMove(*keyData); > >- std::optional<IDBKeyData> primaryKeyData; >+ Optional<IDBKeyData> primaryKeyData; > decoder >> primaryKeyData; > if (!primaryKeyData) > return false; >@@ -149,7 +149,7 @@ bool IDBGetResult::decode(Decoder& decoder, IDBGetResult& result) > if (!decoder.decode(result.m_isDefined)) > return false; > >- std::optional<IDBValue> value; >+ Optional<IDBValue> value; > decoder >> value; > if (!value) > return false; >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >index 9d1f83937737ae80110b020ea9983b68d803f67f..6c09eafd6756cd4058b043b2ab811b0201ea2bf0 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >@@ -311,7 +311,7 @@ ExceptionOr<Ref<IDBRequest>> IDBIndex::doGetKey(ExecState& execState, const IDBK > return transaction.requestGetKey(execState, *this, range); > } > >-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count) > { > LOG(IndexedDB, "IDBIndex::getAll"); > ASSERT(&m_objectStore.transaction().database().originThread() == &Thread::current()); >@@ -325,7 +325,7 @@ ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, RefPtr<IDBKe > return m_objectStore.transaction().requestGetAllIndexRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count); > } > >-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, JSValue key, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, JSValue key, Optional<uint32_t> count) > { > auto onlyResult = IDBKeyRange::only(execState, key); > if (onlyResult.hasException()) >@@ -334,7 +334,7 @@ ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, JSValue key, > return getAll(execState, onlyResult.releaseReturnValue(), count); > } > >-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count) > { > LOG(IndexedDB, "IDBIndex::getAllKeys"); > ASSERT(&m_objectStore.transaction().database().originThread() == &Thread::current()); >@@ -348,7 +348,7 @@ ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, RefPtr<I > return m_objectStore.transaction().requestGetAllIndexRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count); > } > >-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, JSValue key, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, JSValue key, Optional<uint32_t> count) > { > auto onlyResult = IDBKeyRange::only(execState, key); > if (onlyResult.hasException()) >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h >index d6488d591cac3edf0d123dd8404090bf1507f325..ff8dbf928c3be2667f6a04745010c82c35e24336 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h >+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h >@@ -71,10 +71,10 @@ public: > ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, IDBKeyRange*); > ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, JSC::JSValue key); > >- ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count); >- ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count); >- ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count); >- ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count); > > const IDBIndexInfo& info() const { return m_info; } > >diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyData.h b/Source/WebCore/Modules/indexeddb/IDBKeyData.h >index 482780fd929e40f4e5744a1899d877b0babf0c79..d54491d90bcd7dd1291af2f70c9f5a4b904d9cf1 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBKeyData.h >+++ b/Source/WebCore/Modules/indexeddb/IDBKeyData.h >@@ -86,7 +86,7 @@ public: > WEBCORE_EXPORT void setNumberValue(double); > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<IDBKeyData> decode(Decoder&); >+ template<class Decoder> static Optional<IDBKeyData> decode(Decoder&); > > #if !LOG_DISABLED > WEBCORE_EXPORT String loggingString() const; >@@ -259,17 +259,17 @@ void IDBKeyData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<IDBKeyData> IDBKeyData::decode(Decoder& decoder) >+Optional<IDBKeyData> IDBKeyData::decode(Decoder& decoder) > { > IDBKeyData keyData; > if (!decoder.decode(keyData.m_isNull)) >- return std::nullopt; >+ return WTF::nullopt; > > if (keyData.m_isNull) > return WTFMove(keyData); > > if (!decoder.decodeEnum(keyData.m_type)) >- return std::nullopt; >+ return WTF::nullopt; > > switch (keyData.m_type) { > case IndexedDB::KeyType::Invalid: >@@ -279,23 +279,23 @@ std::optional<IDBKeyData> IDBKeyData::decode(Decoder& decoder) > case IndexedDB::KeyType::Array: > keyData.m_value = Vector<IDBKeyData>(); > if (!decoder.decode(WTF::get<Vector<IDBKeyData>>(keyData.m_value))) >- return std::nullopt; >+ return WTF::nullopt; > break; > case IndexedDB::KeyType::Binary: > keyData.m_value = ThreadSafeDataBuffer(); > if (!decoder.decode(WTF::get<ThreadSafeDataBuffer>(keyData.m_value))) >- return std::nullopt; >+ return WTF::nullopt; > break; > case IndexedDB::KeyType::String: > keyData.m_value = String(); > if (!decoder.decode(WTF::get<String>(keyData.m_value))) >- return std::nullopt; >+ return WTF::nullopt; > break; > case IndexedDB::KeyType::Date: > case IndexedDB::KeyType::Number: > keyData.m_value = 0.0; > if (!decoder.decode(WTF::get<double>(keyData.m_value))) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > >diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h >index 0b72d1c97f4f5dfa3ab5fbeeda170df0c4ea31ee..c6de05c432b16f4bc8ac6e099fdcb67b41d31e2a 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h >+++ b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h >@@ -46,7 +46,7 @@ enum class IDBKeyPathParseError { > > void IDBParseKeyPath(const String&, Vector<String>&, IDBKeyPathParseError&); > IDBKeyPath isolatedCopy(const IDBKeyPath&); >-inline std::optional<IDBKeyPath> isolatedCopy(const std::optional<IDBKeyPath>& variant) >+inline Optional<IDBKeyPath> isolatedCopy(const Optional<IDBKeyPath>& variant) > { > if (!variant) > return { }; >diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h b/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h >index 6a62fa6300360ca959b12248cf40a1dd550441e8..fec139d7c0cdd250c1cc1388b57e7242b24e72bf 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h >+++ b/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h >@@ -111,13 +111,13 @@ bool IDBKeyRangeData::decode(Decoder& decoder, IDBKeyRangeData& keyRange) > if (keyRange.isNull) > return true; > >- std::optional<IDBKeyData> upperKey; >+ Optional<IDBKeyData> upperKey; > decoder >> upperKey; > if (!upperKey) > return false; > keyRange.upperKey = WTFMove(*upperKey); > >- std::optional<IDBKeyData> lowerKey; >+ Optional<IDBKeyData> lowerKey; > decoder >> lowerKey; > if (!lowerKey) > return false; >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >index 7dc5e0f799c0a62862032efd1efcbaad8ad64e94..4bbde2bbeb5911fb3111cb3517fcf76a233a2923 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >@@ -116,7 +116,7 @@ ExceptionOr<void> IDBObjectStore::setName(const String& name) > return { }; > } > >-const std::optional<IDBKeyPath>& IDBObjectStore::keyPath() const >+const Optional<IDBKeyPath>& IDBObjectStore::keyPath() const > { > ASSERT(&m_transaction.database().originThread() == &Thread::current()); > return m_info.keyPath(); >@@ -570,7 +570,7 @@ ExceptionOr<Ref<IDBRequest>> IDBObjectStore::doCount(ExecState& execState, const > return m_transaction.requestCount(execState, *this, range); > } > >-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count) > { > LOG(IndexedDB, "IDBObjectStore::getAll"); > ASSERT(&m_transaction.database().originThread() == &Thread::current()); >@@ -584,7 +584,7 @@ ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, RefPtr > return m_transaction.requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count); > } > >-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, JSValue key, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, JSValue key, Optional<uint32_t> count) > { > auto onlyResult = IDBKeyRange::only(execState, key); > if (onlyResult.hasException()) >@@ -593,7 +593,7 @@ ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, JSValu > return getAll(execState, onlyResult.releaseReturnValue(), count); > } > >-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count) > { > LOG(IndexedDB, "IDBObjectStore::getAllKeys"); > ASSERT(&m_transaction.database().originThread() == &Thread::current()); >@@ -607,7 +607,7 @@ ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, Re > return m_transaction.requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count); > } > >-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, JSValue key, std::optional<uint32_t> count) >+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, JSValue key, Optional<uint32_t> count) > { > auto onlyResult = IDBKeyRange::only(execState, key); > if (onlyResult.hasException()) >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >index ed60647e2077b39a97dbc4de807935ba39a1d79d..6fdd3f3f008fcc102f737720e517214cffd190f2 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >@@ -63,7 +63,7 @@ public: > > const String& name() const; > ExceptionOr<void> setName(const String&); >- const std::optional<IDBKeyPath>& keyPath() const; >+ const Optional<IDBKeyPath>& keyPath() const; > RefPtr<DOMStringList> indexNames() const; > IDBTransaction& transaction(); > bool autoIncrement() const; >@@ -91,10 +91,10 @@ public: > ExceptionOr<void> deleteIndex(const String& name); > ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, IDBKeyRange*); > ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, JSC::JSValue key); >- ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count); >- ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count); >- ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count); >- ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count); >+ ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count); > > ExceptionOr<Ref<IDBRequest>> putForCursorUpdate(JSC::ExecState&, JSC::JSValue, JSC::JSValue key); > >diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp >index 6f5ce0e972653f6573ad5db76a4fccd49f22da9b..67178727f80d24412469f837478be1546564f665 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp >@@ -153,12 +153,12 @@ IDBRequest::~IDBRequest() > } > } > >-ExceptionOr<std::optional<IDBRequest::Result>> IDBRequest::result() const >+ExceptionOr<Optional<IDBRequest::Result>> IDBRequest::result() const > { > if (!isDone()) > return Exception { InvalidStateError, "Failed to read the 'result' property from 'IDBRequest': The request has not finished."_s }; > >- return std::optional<IDBRequest::Result> { m_result }; >+ return Optional<IDBRequest::Result> { m_result }; > } > > ExceptionOr<DOMException*> IDBRequest::error() const >@@ -470,7 +470,7 @@ void IDBRequest::willIterateCursor(IDBCursor& cursor) > > m_pendingCursor = &cursor; > m_hasPendingActivity = true; >- m_result = std::nullopt; >+ m_result = WTF::nullopt; > m_readyState = ReadyState::Pending; > m_domError = nullptr; > m_idbError = IDBError { }; >@@ -481,7 +481,7 @@ void IDBRequest::didOpenOrIterateCursor(const IDBResultData& resultData) > ASSERT(&originThread() == &Thread::current()); > ASSERT(m_pendingCursor); > >- m_result = std::nullopt; >+ m_result = WTF::nullopt; > > if (resultData.type() == IDBResultType::IterateCursorSuccess || resultData.type() == IDBResultType::OpenCursorSuccess) { > m_pendingCursor->setGetResult(*this, resultData.getResult()); >diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h >index e625cd3c7fbdc8913d6d49aa340ed9bb7239b5e8..a3433a5926993fe8f7920d263ebaddbdaaf5f6b3 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBRequest.h >+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h >@@ -72,10 +72,10 @@ public: > // FIXME: The following use of JSC::Strong is incorrect and can lead to storage leaks > // due to reference cycles; we should use JSValueInWrappedObject instead. > using Result = Variant<RefPtr<IDBCursor>, RefPtr<IDBDatabase>, JSC::Strong<JSC::Unknown>>; >- ExceptionOr<std::optional<Result>> result() const; >+ ExceptionOr<Optional<Result>> result() const; > > using Source = Variant<RefPtr<IDBObjectStore>, RefPtr<IDBIndex>, RefPtr<IDBCursor>>; >- const std::optional<Source>& source() const { return m_source; } >+ const Optional<Source>& source() const { return m_source; } > > ExceptionOr<DOMException*> error() const; > >@@ -165,8 +165,8 @@ private: > IDBError m_idbError; > IDBResourceIdentifier m_resourceIdentifier; > >- std::optional<Result> m_result; >- std::optional<Source> m_source; >+ Optional<Result> m_result; >+ Optional<Source> m_source; > > bool m_hasPendingActivity { true }; > IndexedDB::ObjectStoreRecordType m_requestedObjectStoreRecordType { IndexedDB::ObjectStoreRecordType::ValueOnly }; >diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >index ce728fce263885b207978b6c84f1bed478d7dc12..bdffe68e12cd24de4667e8271fc979f7abac2e1f 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >@@ -878,7 +878,7 @@ void IDBTransaction::didIterateCursorOnServer(IDBRequest& request, const IDBResu > completeCursorRequest(request, resultData); > } > >-Ref<IDBRequest> IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState& state, IDBObjectStore& objectStore, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, std::optional<uint32_t> count) >+Ref<IDBRequest> IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState& state, IDBObjectStore& objectStore, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, Optional<uint32_t> count) > { > LOG(IndexedDB, "IDBTransaction::requestGetAllObjectStoreRecords"); > ASSERT(isActive()); >@@ -897,7 +897,7 @@ Ref<IDBRequest> IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState& > return request; > } > >-Ref<IDBRequest> IDBTransaction::requestGetAllIndexRecords(JSC::ExecState& state, IDBIndex& index, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, std::optional<uint32_t> count) >+Ref<IDBRequest> IDBTransaction::requestGetAllIndexRecords(JSC::ExecState& state, IDBIndex& index, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, Optional<uint32_t> count) > { > LOG(IndexedDB, "IDBTransaction::requestGetAllIndexRecords"); > ASSERT(isActive()); >diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h >index ecac146e5d692efea999cef1106a76b131182723..5b8498644fd93f88eff0cb6fcb7c622d164bbc6a 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h >@@ -115,8 +115,8 @@ public: > > Ref<IDBRequest> requestPutOrAdd(JSC::ExecState&, IDBObjectStore&, IDBKey*, SerializedScriptValue&, IndexedDB::ObjectStoreOverwriteMode); > Ref<IDBRequest> requestGetRecord(JSC::ExecState&, IDBObjectStore&, const IDBGetRecordData&); >- Ref<IDBRequest> requestGetAllObjectStoreRecords(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&, IndexedDB::GetAllType, std::optional<uint32_t> count); >- Ref<IDBRequest> requestGetAllIndexRecords(JSC::ExecState&, IDBIndex&, const IDBKeyRangeData&, IndexedDB::GetAllType, std::optional<uint32_t> count); >+ Ref<IDBRequest> requestGetAllObjectStoreRecords(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&, IndexedDB::GetAllType, Optional<uint32_t> count); >+ Ref<IDBRequest> requestGetAllIndexRecords(JSC::ExecState&, IDBIndex&, const IDBKeyRangeData&, IndexedDB::GetAllType, Optional<uint32_t> count); > Ref<IDBRequest> requestDeleteRecord(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&); > Ref<IDBRequest> requestClearObjectStore(JSC::ExecState&, IDBObjectStore&); > Ref<IDBRequest> requestCount(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&); >diff --git a/Source/WebCore/Modules/indexeddb/IDBValue.h b/Source/WebCore/Modules/indexeddb/IDBValue.h >index e6126995c60a89313e5ea96f274d5f5b5aa2ed07..ae044cd67823ae42542594caa010013ba36bc82b 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBValue.h >+++ b/Source/WebCore/Modules/indexeddb/IDBValue.h >@@ -53,7 +53,7 @@ public: > const Vector<String>& blobFilePaths() const { return m_blobFilePaths; } > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<IDBValue> decode(Decoder&); >+ template<class Decoder> static Optional<IDBValue> decode(Decoder&); > > private: > ThreadSafeDataBuffer m_data; >@@ -73,20 +73,20 @@ void IDBValue::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<IDBValue> IDBValue::decode(Decoder& decoder) >+Optional<IDBValue> IDBValue::decode(Decoder& decoder) > { > IDBValue result; > if (!decoder.decode(result.m_data)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.m_blobURLs)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.m_sessionID)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.m_blobFilePaths)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >diff --git a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp >index c39bbcb153530c79421fd987d1c7cc3adc73beb8..b6c5a86300e7a077319df0f818bd78fa29d209fa 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp >@@ -38,7 +38,7 @@ IDBVersionChangeEvent::IDBVersionChangeEvent(const IDBResourceIdentifier& reques > if (newVersion) > m_newVersion = newVersion; > else >- m_newVersion = std::nullopt; >+ m_newVersion = WTF::nullopt; > } > > IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& name, const Init& init, IsTrusted isTrusted) >diff --git a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h >index 0801720bc2b8bd7dbef9d565bdcb74b14edad588..e9218eba1626092194008de02185c0b3806340cf 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h >+++ b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h >@@ -47,7 +47,7 @@ public: > > struct Init : EventInit { > uint64_t oldVersion { 0 }; >- std::optional<uint64_t> newVersion; >+ Optional<uint64_t> newVersion; > }; > > static Ref<IDBVersionChangeEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) >@@ -60,7 +60,7 @@ public: > bool isVersionChangeEvent() const final { return true; } > > uint64_t oldVersion() const { return m_oldVersion; } >- std::optional<uint64_t> newVersion() const { return m_newVersion; } >+ Optional<uint64_t> newVersion() const { return m_newVersion; } > > private: > IDBVersionChangeEvent(const IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion, const AtomicString& eventType); >@@ -70,7 +70,7 @@ private: > > IDBResourceIdentifier m_requestIdentifier; > uint64_t m_oldVersion; >- std::optional<uint64_t> m_newVersion; >+ Optional<uint64_t> m_newVersion; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp >index a5f02922519146976e4a1f9474ffca94c11e18b5..cd995e69c5980e2ba21cafbf3663ceae320ea485 100644 >--- a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp >+++ b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp >@@ -40,7 +40,7 @@ namespace WebCore { > > enum class KeyPathType { Null, String, Array }; > >-RefPtr<SharedBuffer> serializeIDBKeyPath(const std::optional<IDBKeyPath>& keyPath) >+RefPtr<SharedBuffer> serializeIDBKeyPath(const Optional<IDBKeyPath>& keyPath) > { > auto encoder = KeyedEncoder::encoder(); > >@@ -61,7 +61,7 @@ RefPtr<SharedBuffer> serializeIDBKeyPath(const std::optional<IDBKeyPath>& keyPat > return encoder->finishEncoding(); > } > >-bool deserializeIDBKeyPath(const uint8_t* data, size_t size, std::optional<IDBKeyPath>& result) >+bool deserializeIDBKeyPath(const uint8_t* data, size_t size, Optional<IDBKeyPath>& result) > { > if (!data || !size) > return false; >diff --git a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h >index 094fbc6ece5c023f4d8267ad304128fda5b83f69..597203ebb60f20fdc96932f57e2524bff7321b2c 100644 >--- a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h >+++ b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h >@@ -34,8 +34,8 @@ namespace WebCore { > > class IDBKeyData; > >-RefPtr<SharedBuffer> serializeIDBKeyPath(const std::optional<IDBKeyPath>&); >-bool deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize, std::optional<IDBKeyPath>&); >+RefPtr<SharedBuffer> serializeIDBKeyPath(const Optional<IDBKeyPath>&); >+bool deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize, Optional<IDBKeyPath>&); > > RefPtr<SharedBuffer> serializeIDBKeyData(const IDBKeyData&); > bool deserializeIDBKeyData(const uint8_t* buffer, size_t bufferSize, IDBKeyData&); >diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp >index d082bc232db736b3300d3f2a0d93667f43deda36..22a6ae8a5c8dc61477e2a56402658ecc732c8d7d 100644 >--- a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp >+++ b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp >@@ -152,7 +152,7 @@ uint64_t MemoryIndex::countForKeyRange(const IDBKeyRangeData& inRange) > return count; > } > >-void MemoryIndex::getAllRecords(const IDBKeyRangeData& keyRangeData, std::optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const >+void MemoryIndex::getAllRecords(const IDBKeyRangeData& keyRangeData, Optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const > { > LOG(IndexedDB, "MemoryIndex::getAllRecords"); > >diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h >index 5bf9cba893a47cb2f0c18adadb1336840e7da052..84759847529f6c5b703dde27f70703e4f058592b 100644 >--- a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h >+++ b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h >@@ -68,7 +68,7 @@ public: > > IDBGetResult getResultForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&) const; > uint64_t countForKeyRange(const IDBKeyRangeData&); >- void getAllRecords(const IDBKeyRangeData&, std::optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const; >+ void getAllRecords(const IDBKeyRangeData&, Optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const; > > IDBError putIndexKey(const IDBKeyData&, const IndexKey&); > >diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp >index 559291d10dc15f1f9d42f96ce6f3454e9f4820ea..30ca143c7d6360e8b125a4f02edc16a2571e0a85 100644 >--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp >@@ -405,7 +405,7 @@ ThreadSafeDataBuffer MemoryObjectStore::valueForKeyRange(const IDBKeyRangeData& > return m_keyValueStore->get(key); > } > >-void MemoryObjectStore::getAllRecords(const IDBKeyRangeData& keyRangeData, std::optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const >+void MemoryObjectStore::getAllRecords(const IDBKeyRangeData& keyRangeData, Optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const > { > result = { type }; > >diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h >index 5b3d833e556f6cc917c08802a35c078116d87318..657b638b3e25dd610d295fcfe1b92581e79a0e5b 100644 >--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h >+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h >@@ -88,7 +88,7 @@ public: > IDBGetResult indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&) const; > uint64_t countForKeyRange(uint64_t indexIdentifier, const IDBKeyRangeData&) const; > >- void getAllRecords(const IDBKeyRangeData&, std::optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const; >+ void getAllRecords(const IDBKeyRangeData&, Optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const; > > const IDBObjectStoreInfo& info() const { return m_info; } > >diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp >index 918c73d01ae6436b69885136b36bacb699ac7cc3..f8b23ea362ab2fd160dc2524e049f5fe1724a7fb 100644 >--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp >+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp >@@ -51,7 +51,7 @@ MemoryObjectStoreCursor::MemoryObjectStoreCursor(MemoryObjectStore& objectStore, > > void MemoryObjectStoreCursor::objectStoreCleared() > { >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > } > > void MemoryObjectStoreCursor::keyDeleted(const IDBKeyData& key) >@@ -59,7 +59,7 @@ void MemoryObjectStoreCursor::keyDeleted(const IDBKeyData& key) > if (m_currentPositionKey != key) > return; > >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > } > > void MemoryObjectStoreCursor::keyAdded(IDBKeyDataSet::iterator iterator) >@@ -73,7 +73,7 @@ void MemoryObjectStoreCursor::keyAdded(IDBKeyDataSet::iterator iterator) > > void MemoryObjectStoreCursor::setFirstInRemainingRange(IDBKeyDataSet& set) > { >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > > if (m_info.isDirectionForward()) { > setForwardIteratorFromRemainingRange(set); >@@ -95,19 +95,19 @@ void MemoryObjectStoreCursor::setFirstInRemainingRange(IDBKeyDataSet& set) > void MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange(IDBKeyDataSet& set) > { > if (!set.size()) { >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > return; > } > > if (m_remainingRange.isExactlyOneKey()) { > m_iterator = set.find(m_remainingRange.lowerKey); > if (*m_iterator == set.end()) >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > > return; > } > >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > > auto lowest = set.lower_bound(m_remainingRange.lowerKey); > if (lowest == set.end()) >@@ -133,14 +133,14 @@ void MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange(IDBKeyDataSet > void MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange(IDBKeyDataSet& set) > { > if (!set.size()) { >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > return; > } > > if (m_remainingRange.isExactlyOneKey()) { > m_iterator = set.find(m_remainingRange.lowerKey); > if (*m_iterator == set.end()) >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > > return; > } >@@ -148,12 +148,12 @@ void MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange(IDBKeyDataSet > if (!m_remainingRange.upperKey.isValid()) { > m_iterator = --set.end(); > if (!m_remainingRange.containsKey(**m_iterator)) >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > > return; > } > >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > > // This is one record past the actual key we're looking for. > auto highest = set.upper_bound(m_remainingRange.upperKey); >@@ -248,7 +248,7 @@ void MemoryObjectStoreCursor::incrementForwardIterator(IDBKeyDataSet& set, const > ++*m_iterator; > > if (*m_iterator == set.end() || !m_info.range().containsKey(**m_iterator)) { >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > return; > } > } >@@ -300,7 +300,7 @@ void MemoryObjectStoreCursor::incrementReverseIterator(IDBKeyDataSet& set, const > > while (count) { > if (*m_iterator == set.begin()) { >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > return; > } > >@@ -308,7 +308,7 @@ void MemoryObjectStoreCursor::incrementReverseIterator(IDBKeyDataSet& set, const > --*m_iterator; > > if (!m_info.range().containsKey(**m_iterator)) { >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > return; > } > } >diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h >index 42d162f5af35c5313991bc0cb8b350d43a34a395..575bfe7a804d8dd5cc919015d667ff249b55a5c9 100644 >--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h >+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h >@@ -62,7 +62,7 @@ private: > > IDBKeyRangeData m_remainingRange; > >- std::optional<IDBKeyDataSet::iterator> m_iterator; >+ Optional<IDBKeyDataSet::iterator> m_iterator; > > IDBKeyData m_currentPositionKey; > }; >diff --git a/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp >index a2eeb524a9425ada1972b50a8c6a56b8ecb67f41..3582c5873c5c933a33e5f3e7891c8be27e567f03 100644 >--- a/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp >@@ -674,7 +674,7 @@ std::unique_ptr<IDBDatabaseInfo> SQLiteIDBBackingStore::extractExistingDatabaseI > Vector<char> keyPathBuffer; > sql.getColumnBlobAsVector(2, keyPathBuffer); > >- std::optional<IDBKeyPath> objectStoreKeyPath; >+ Optional<IDBKeyPath> objectStoreKeyPath; > if (!deserializeIDBKeyPath(reinterpret_cast<const uint8_t*>(keyPathBuffer.data()), keyPathBuffer.size(), objectStoreKeyPath)) { > LOG_ERROR("Unable to extract key path from database"); > return nullptr; >@@ -707,7 +707,7 @@ std::unique_ptr<IDBDatabaseInfo> SQLiteIDBBackingStore::extractExistingDatabaseI > Vector<char> keyPathBuffer; > sql.getColumnBlobAsVector(3, keyPathBuffer); > >- std::optional<IDBKeyPath> indexKeyPath; >+ Optional<IDBKeyPath> indexKeyPath; > if (!deserializeIDBKeyPath(reinterpret_cast<const uint8_t*>(keyPathBuffer.data()), keyPathBuffer.size(), indexKeyPath)) { > LOG_ERROR("Unable to extract key path from database"); > return nullptr; >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp >index d0a2533168610419a651a894508636595882e559..6aea141be9390839ec685bcd5e7acea8d0144a38 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp >@@ -66,7 +66,7 @@ bool IDBDatabaseInfo::hasObjectStore(const String& name) const > return false; > } > >-IDBObjectStoreInfo IDBDatabaseInfo::createNewObjectStore(const String& name, std::optional<IDBKeyPath>&& keyPath, bool autoIncrement) >+IDBObjectStoreInfo IDBDatabaseInfo::createNewObjectStore(const String& name, Optional<IDBKeyPath>&& keyPath, bool autoIncrement) > { > IDBObjectStoreInfo info(++m_maxObjectStoreID, name, WTFMove(keyPath), autoIncrement); > m_objectStoreMap.set(info.identifier(), info); >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h >index db8ff2c7798b450ccbb66ac6b0fc38ee5c9a0e9b..53df05a4f8433cf4b0860a14e335ca5ee9c9e023 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h >@@ -47,7 +47,7 @@ public: > uint64_t version() const { return m_version; } > > bool hasObjectStore(const String& name) const; >- IDBObjectStoreInfo createNewObjectStore(const String& name, std::optional<IDBKeyPath>&&, bool autoIncrement); >+ IDBObjectStoreInfo createNewObjectStore(const String& name, Optional<IDBKeyPath>&&, bool autoIncrement); > void addExistingObjectStore(const IDBObjectStoreInfo&); > IDBObjectStoreInfo* infoForExistingObjectStore(uint64_t objectStoreIdentifier); > IDBObjectStoreInfo* infoForExistingObjectStore(const String& objectStoreName); >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBError.cpp b/Source/WebCore/Modules/indexeddb/shared/IDBError.cpp >index ae314b24ee72caa0969e6c3b9b6e76e9acac3398..64f200d2c6a13ae3f1840998cb9286b110e24eb0 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBError.cpp >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBError.cpp >@@ -32,7 +32,7 @@ > > namespace WebCore { > >-IDBError::IDBError(std::optional<ExceptionCode> code, const String& message) >+IDBError::IDBError(Optional<ExceptionCode> code, const String& message) > : m_code(code) > , m_message(message) > { >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBError.h b/Source/WebCore/Modules/indexeddb/shared/IDBError.h >index 0a28967b169565d04c639043969dd8e770dccb33..04c92c5cf00b489e96d37ceccafcdbb056c5cc70 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBError.h >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBError.h >@@ -35,7 +35,7 @@ namespace WebCore { > > class IDBError { > public: >- WEBCORE_EXPORT explicit IDBError(std::optional<ExceptionCode> = std::nullopt, const String& message = { }); >+ WEBCORE_EXPORT explicit IDBError(Optional<ExceptionCode> = WTF::nullopt, const String& message = { }); > > static IDBError userDeleteError() > { >@@ -51,7 +51,7 @@ public: > > RefPtr<DOMException> toDOMException() const; > >- std::optional<ExceptionCode> code() const { return m_code; } >+ Optional<ExceptionCode> code() const { return m_code; } > String name() const; > String message() const; > >@@ -63,7 +63,7 @@ public: > template<class Decoder> static bool decode(Decoder&, IDBError&); > > private: >- std::optional<ExceptionCode> m_code; >+ Optional<ExceptionCode> m_code; > String m_message; > }; > >@@ -91,7 +91,7 @@ bool IDBError::decode(Decoder& decoder, IDBError& error) > return false; > error.m_code = ec; > } else >- error.m_code = std::nullopt; >+ error.m_code = WTF::nullopt; > > if (!decoder.decode(error.m_message)) > return false; >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h b/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h >index e9b459800daf821737d7f7a7941580ce45b7b37d..c74389c4070722e11d86bc7266f554fbf35d5da1 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h >@@ -40,7 +40,7 @@ enum class GetAllType; > struct IDBGetAllRecordsData { > IDBKeyRangeData keyRangeData; > IndexedDB::GetAllType getAllType; >- std::optional<uint32_t> count; >+ Optional<uint32_t> count; > uint64_t objectStoreIdentifier; > uint64_t indexIdentifier; > >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBIterateCursorData.h b/Source/WebCore/Modules/indexeddb/shared/IDBIterateCursorData.h >index 1f3c7c5dca8e727403ded7a6cd4ccc465eab8d9a..f4cd3adc70fe0ec143dece664c6fbb43e010e1e4 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBIterateCursorData.h >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBIterateCursorData.h >@@ -55,13 +55,13 @@ void IDBIterateCursorData::encode(Encoder& encoder) const > template<class Decoder> > bool IDBIterateCursorData::decode(Decoder& decoder, IDBIterateCursorData& iteratorCursorData) > { >- std::optional<IDBKeyData> keyData; >+ Optional<IDBKeyData> keyData; > decoder >> keyData; > if (!keyData) > return false; > iteratorCursorData.keyData = WTFMove(*keyData); > >- std::optional<IDBKeyData> primaryKeyData; >+ Optional<IDBKeyData> primaryKeyData; > decoder >> primaryKeyData; > if (!primaryKeyData) > return false; >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp >index ce663ce927c0e15dfbf810bf4f19b8ad0c6e66ba..2938e9306df1ae3db0643c36fe4532b9baf31e1a 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp >@@ -35,7 +35,7 @@ IDBObjectStoreInfo::IDBObjectStoreInfo() > { > } > >-IDBObjectStoreInfo::IDBObjectStoreInfo(uint64_t identifier, const String& name, std::optional<IDBKeyPath>&& keyPath, bool autoIncrement) >+IDBObjectStoreInfo::IDBObjectStoreInfo(uint64_t identifier, const String& name, Optional<IDBKeyPath>&& keyPath, bool autoIncrement) > : m_identifier(identifier) > , m_name(name) > , m_keyPath(WTFMove(keyPath)) >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h >index 0b8525909c59b3859cd6bd48a7a0eee7dd19bfb0..c9b48b798f924e6c83fca268dbabdc5ac36eba52 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h >@@ -37,11 +37,11 @@ namespace WebCore { > class IDBObjectStoreInfo { > public: > WEBCORE_EXPORT IDBObjectStoreInfo(); >- IDBObjectStoreInfo(uint64_t identifier, const String& name, std::optional<IDBKeyPath>&&, bool autoIncrement); >+ IDBObjectStoreInfo(uint64_t identifier, const String& name, Optional<IDBKeyPath>&&, bool autoIncrement); > > uint64_t identifier() const { return m_identifier; } > const String& name() const { return m_name; } >- const std::optional<IDBKeyPath>& keyPath() const { return m_keyPath; } >+ const Optional<IDBKeyPath>& keyPath() const { return m_keyPath; } > bool autoIncrement() const { return m_autoIncrement; } > uint64_t maxIndexID() const { return m_maxIndexID; } > >@@ -73,7 +73,7 @@ public: > private: > uint64_t m_identifier { 0 }; > String m_name; >- std::optional<IDBKeyPath> m_keyPath; >+ Optional<IDBKeyPath> m_keyPath; > bool m_autoIncrement { false }; > uint64_t m_maxIndexID { 0 }; > >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h b/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h >index 9432511a3786e5501bbaa620cbc1b254178ca8b4..93b1f431d0e630251485799668f26cfdeb985545 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h >@@ -126,7 +126,7 @@ bool IDBRequestData::decode(Decoder& decoder, IDBRequestData& request) > if (!decoder.decode(request.m_indexIdentifier)) > return false; > >- std::optional<IDBDatabaseIdentifier> databaseIdentifier; >+ Optional<IDBDatabaseIdentifier> databaseIdentifier; > decoder >> databaseIdentifier; > if (!databaseIdentifier) > return false; >diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h b/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h >index 56bdcbf307efeb22adc089bcf21911916c94362c..f74fe96a2632805657691c60cd3431476ad45eb3 100644 >--- a/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h >+++ b/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h >@@ -111,7 +111,7 @@ public: > > WEBCORE_EXPORT IDBResultData(); > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<IDBResultData> decode(Decoder&); >+ template<class Decoder> static Optional<IDBResultData> decode(Decoder&); > > private: > IDBResultData(const IDBResourceIdentifier&); >@@ -160,71 +160,71 @@ void IDBResultData::encode(Encoder& encoder) const > encoder << *m_getAllResult; > } > >-template<class Decoder> std::optional<IDBResultData> IDBResultData::decode(Decoder& decoder) >+template<class Decoder> Optional<IDBResultData> IDBResultData::decode(Decoder& decoder) > { > IDBResultData result; > if (!decoder.decode(result.m_requestIdentifier)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.m_error)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.m_databaseConnectionIdentifier)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.m_resultInteger)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(result.m_type)) >- return std::nullopt; >+ return WTF::nullopt; > > bool hasObject; > > if (!decoder.decode(hasObject)) >- return std::nullopt; >+ return WTF::nullopt; > if (hasObject) { > auto object = std::make_unique<IDBDatabaseInfo>(); > if (!decoder.decode(*object)) >- return std::nullopt; >+ return WTF::nullopt; > result.m_databaseInfo = WTFMove(object); > } > > if (!decoder.decode(hasObject)) >- return std::nullopt; >+ return WTF::nullopt; > if (hasObject) { > auto object = std::make_unique<IDBTransactionInfo>(); > if (!decoder.decode(*object)) >- return std::nullopt; >+ return WTF::nullopt; > result.m_transactionInfo = WTFMove(object); > } > > if (!decoder.decode(hasObject)) >- return std::nullopt; >+ return WTF::nullopt; > if (hasObject) { > auto object = std::make_unique<IDBKeyData>(); >- std::optional<IDBKeyData> optional; >+ Optional<IDBKeyData> optional; > decoder >> optional; > if (!optional) >- return std::nullopt; >+ return WTF::nullopt; > *object = WTFMove(*optional); > result.m_resultKey = WTFMove(object); > } > > if (!decoder.decode(hasObject)) >- return std::nullopt; >+ return WTF::nullopt; > if (hasObject) { > auto object = std::make_unique<IDBGetResult>(); > if (!decoder.decode(*object)) >- return std::nullopt; >+ return WTF::nullopt; > result.m_getResult = WTFMove(object); > } > > if (!decoder.decode(hasObject)) >- return std::nullopt; >+ return WTF::nullopt; > if (hasObject) { > auto object = std::make_unique<IDBGetAllResult>(); > if (!decoder.decode(*object)) >- return std::nullopt; >+ return WTF::nullopt; > result.m_getAllResult = WTFMove(object); > } > >diff --git a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp >index f4cb2fb63d163507fd9a13d1d497cb3b0791e6aa..d01e013eddd3d7fd1cd55b03e9485a10fef162a3 100644 >--- a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp >+++ b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp >@@ -100,7 +100,7 @@ Vector<RefPtr<AudioTrack>> MediaControlsHost::sortedTrackListForMenu(AudioTrackL > return page->group().captionPreferences().sortedTrackListForMenu(&trackList); > } > >-String MediaControlsHost::displayNameForTrack(const std::optional<TextOrAudioTrack>& track) >+String MediaControlsHost::displayNameForTrack(const Optional<TextOrAudioTrack>& track) > { > if (!track) > return emptyString(); >diff --git a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h >index a2793eecf8d2fefe3d968b56f733a5732a6c80ae..2f51ad2b69d1a9c013a606becc6f56b9f46a4833 100644 >--- a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h >+++ b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h >@@ -56,7 +56,7 @@ public: > Vector<RefPtr<AudioTrack>> sortedTrackListForMenu(AudioTrackList&); > > using TextOrAudioTrack = WTF::Variant<RefPtr<TextTrack>, RefPtr<AudioTrack>>; >- String displayNameForTrack(const std::optional<TextOrAudioTrack>&); >+ String displayNameForTrack(const Optional<TextOrAudioTrack>&); > > TextTrack* captionMenuOffItem(); > TextTrack* captionMenuAutomaticItem(); >diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp b/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp >index ee8741d64ccb458668793e61d8355fdd12a893eb..f324651b81e9969a4a55f3e366fd3f45fc4f5724 100644 >--- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp >+++ b/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp >@@ -104,7 +104,7 @@ bool MediaRecorder::canSuspendForDocumentSuspension() const > return false; // FIXME: We should do better here as this prevents entering PageCache. > } > >-ExceptionOr<void> MediaRecorder::startRecording(std::optional<int> timeslice) >+ExceptionOr<void> MediaRecorder::startRecording(Optional<int> timeslice) > { > UNUSED_PARAM(timeslice); > if (state() != RecordingState::Inactive) >diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h b/Source/WebCore/Modules/mediarecorder/MediaRecorder.h >index e19953087095eb12a2506bf9017d73d8ec3df7e4..0cde81508208fdc3f43c7534917e228fbbdb7ec3 100644 >--- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h >+++ b/Source/WebCore/Modules/mediarecorder/MediaRecorder.h >@@ -68,7 +68,7 @@ public: > using RefCounted::ref; > using RefCounted::deref; > >- ExceptionOr<void> startRecording(std::optional<int>); >+ ExceptionOr<void> startRecording(Optional<int>); > ExceptionOr<void> stopRecording(); > > private: >diff --git a/Source/WebCore/Modules/mediasession/MediaSession.cpp b/Source/WebCore/Modules/mediasession/MediaSession.cpp >index 31fb9874294ca48e274526cdbbbef2698429b967..c69f1111cdfaa26e4a5a248f50f50791507ba499 100644 >--- a/Source/WebCore/Modules/mediasession/MediaSession.cpp >+++ b/Source/WebCore/Modules/mediasession/MediaSession.cpp >@@ -114,7 +114,7 @@ bool MediaSession::hasActiveMediaElements() const > return !m_activeParticipatingElements.isEmpty(); > } > >-void MediaSession::setMetadata(const std::optional<Metadata>& optionalMetadata) >+void MediaSession::setMetadata(const Optional<Metadata>& optionalMetadata) > { > if (!optionalMetadata) > m_metadata = { }; >diff --git a/Source/WebCore/Modules/mediasession/MediaSession.h b/Source/WebCore/Modules/mediasession/MediaSession.h >index ef591b522d655dbd6c909fd500191288e0cb5f1f..88d2493a430f2a619cb9be83a882eecf7380eec8 100644 >--- a/Source/WebCore/Modules/mediasession/MediaSession.h >+++ b/Source/WebCore/Modules/mediasession/MediaSession.h >@@ -62,7 +62,7 @@ public: > WEBCORE_EXPORT State currentState() const { return m_currentState; } > bool hasActiveMediaElements() const; > >- void setMetadata(const std::optional<Metadata>&); >+ void setMetadata(const Optional<Metadata>&); > > void deactivate(); > >diff --git a/Source/WebCore/Modules/mediasource/MediaSource.cpp b/Source/WebCore/Modules/mediasource/MediaSource.cpp >index e0ff27194d579f12a688ace195fae7745f3ce218..55399463714f1397e5bb946cf2d4242a4e6b9688 100644 >--- a/Source/WebCore/Modules/mediasource/MediaSource.cpp >+++ b/Source/WebCore/Modules/mediasource/MediaSource.cpp >@@ -548,7 +548,7 @@ void MediaSource::setReadyState(ReadyState state) > onReadyStateChange(oldState, state); > } > >-ExceptionOr<void> MediaSource::endOfStream(std::optional<EndOfStreamError> error) >+ExceptionOr<void> MediaSource::endOfStream(Optional<EndOfStreamError> error) > { > // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-MediaSource-endOfStream-void-EndOfStreamError-error > // 1. If the readyState attribute is not in the "open" state then throw an >@@ -567,7 +567,7 @@ ExceptionOr<void> MediaSource::endOfStream(std::optional<EndOfStreamError> error > return { }; > } > >-void MediaSource::streamEndedWithError(std::optional<EndOfStreamError> error) >+void MediaSource::streamEndedWithError(Optional<EndOfStreamError> error) > { > LOG(MediaSource, "MediaSource::streamEndedWithError(%p)", this); > if (isClosed()) >diff --git a/Source/WebCore/Modules/mediasource/MediaSource.h b/Source/WebCore/Modules/mediasource/MediaSource.h >index eca269ea9969b88f412af2471c31b6df770761d0..24110fe61ce570ad27a9098087de4d7e6e425f5f 100644 >--- a/Source/WebCore/Modules/mediasource/MediaSource.h >+++ b/Source/WebCore/Modules/mediasource/MediaSource.h >@@ -65,7 +65,7 @@ public: > void sourceBufferDidChangeActiveState(SourceBuffer&, bool); > > enum class EndOfStreamError { Network, Decode }; >- void streamEndedWithError(std::optional<EndOfStreamError>); >+ void streamEndedWithError(Optional<EndOfStreamError>); > > MediaTime duration() const final; > void durationChanged(const MediaTime&) final; >@@ -85,7 +85,7 @@ public: > > enum class ReadyState { Closed, Open, Ended }; > ReadyState readyState() const { return m_readyState; } >- ExceptionOr<void> endOfStream(std::optional<EndOfStreamError>); >+ ExceptionOr<void> endOfStream(Optional<EndOfStreamError>); > > HTMLMediaElement* mediaElement() const { return m_mediaElement; } > >diff --git a/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp b/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp >index 426c5d16cb014f78d8d88cf4291e1c1ecb49ab75..2860130c012b06f4b6895d6236b3c66f5948d3df 100644 >--- a/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp >+++ b/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp >@@ -33,7 +33,7 @@ > > namespace WebCore { > >-Ref<CanvasCaptureMediaStreamTrack> CanvasCaptureMediaStreamTrack::create(ScriptExecutionContext& context, Ref<HTMLCanvasElement>&& canvas, std::optional<double>&& frameRequestRate) >+Ref<CanvasCaptureMediaStreamTrack> CanvasCaptureMediaStreamTrack::create(ScriptExecutionContext& context, Ref<HTMLCanvasElement>&& canvas, Optional<double>&& frameRequestRate) > { > auto source = CanvasCaptureMediaStreamTrack::Source::create(canvas.get(), WTFMove(frameRequestRate)); > return adoptRef(*new CanvasCaptureMediaStreamTrack(context, WTFMove(canvas), WTFMove(source))); >@@ -51,7 +51,7 @@ CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(ScriptExecutionCont > { > } > >-Ref<CanvasCaptureMediaStreamTrack::Source> CanvasCaptureMediaStreamTrack::Source::create(HTMLCanvasElement& canvas, std::optional<double>&& frameRequestRate) >+Ref<CanvasCaptureMediaStreamTrack::Source> CanvasCaptureMediaStreamTrack::Source::create(HTMLCanvasElement& canvas, Optional<double>&& frameRequestRate) > { > auto source = adoptRef(*new Source(canvas, WTFMove(frameRequestRate))); > source->start(); >@@ -65,7 +65,7 @@ Ref<CanvasCaptureMediaStreamTrack::Source> CanvasCaptureMediaStreamTrack::Source > } > > // FIXME: Give source id and name >-CanvasCaptureMediaStreamTrack::Source::Source(HTMLCanvasElement& canvas, std::optional<double>&& frameRequestRate) >+CanvasCaptureMediaStreamTrack::Source::Source(HTMLCanvasElement& canvas, Optional<double>&& frameRequestRate) > : RealtimeMediaSource(Type::Video, "CanvasCaptureMediaStreamTrack"_s) > , m_frameRequestRate(WTFMove(frameRequestRate)) > , m_requestFrameTimer(*this, &Source::requestFrameTimerFired) >@@ -130,7 +130,7 @@ const RealtimeMediaSourceSettings& CanvasCaptureMediaStreamTrack::Source::settin > void CanvasCaptureMediaStreamTrack::Source::settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag> settings) > { > if (settings.containsAny({ RealtimeMediaSourceSettings::Flag::Width, RealtimeMediaSourceSettings::Flag::Height })) >- m_currentSettings = std::nullopt; >+ m_currentSettings = WTF::nullopt; > } > > void CanvasCaptureMediaStreamTrack::Source::canvasResized(CanvasBase& canvas) >diff --git a/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.h b/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.h >index 87d725b703dc8e883c79e9ea322d8f75aad2a37f..1f7f12da6070fc431f2b4dbb32dcff7db11578ef 100644 >--- a/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.h >+++ b/Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.h >@@ -39,7 +39,7 @@ class ScriptExecutionContext; > > class CanvasCaptureMediaStreamTrack final : public MediaStreamTrack { > public: >- static Ref<CanvasCaptureMediaStreamTrack> create(ScriptExecutionContext&, Ref<HTMLCanvasElement>&&, std::optional<double>&& frameRequestRate); >+ static Ref<CanvasCaptureMediaStreamTrack> create(ScriptExecutionContext&, Ref<HTMLCanvasElement>&&, Optional<double>&& frameRequestRate); > > HTMLCanvasElement& canvas() { return m_canvas.get(); } > void requestFrame() { static_cast<Source&>(source()).requestFrame(); } >@@ -49,13 +49,13 @@ public: > private: > class Source final : public RealtimeMediaSource, private CanvasObserver { > public: >- static Ref<Source> create(HTMLCanvasElement&, std::optional<double>&& frameRequestRate); >+ static Ref<Source> create(HTMLCanvasElement&, Optional<double>&& frameRequestRate); > > void requestFrame() { m_shouldEmitFrame = true; } >- std::optional<double> frameRequestRate() const { return m_frameRequestRate; } >+ Optional<double> frameRequestRate() const { return m_frameRequestRate; } > > private: >- Source(HTMLCanvasElement&, std::optional<double>&&); >+ Source(HTMLCanvasElement&, Optional<double>&&); > > // CanvasObserver API > void canvasChanged(CanvasBase&, const FloatRect&) final; >@@ -73,10 +73,10 @@ private: > void requestFrameTimerFired(); > > bool m_shouldEmitFrame { true }; >- std::optional<double> m_frameRequestRate; >+ Optional<double> m_frameRequestRate; > Timer m_requestFrameTimer; > Timer m_canvasChangedTimer; >- std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ Optional<RealtimeMediaSourceSettings> m_currentSettings; > HTMLCanvasElement* m_canvas; > RefPtr<Image> m_currentImage; > }; >diff --git a/Source/WebCore/Modules/mediastream/DoubleRange.h b/Source/WebCore/Modules/mediastream/DoubleRange.h >index 84a46bd60c65c546c647599672e2e7db5308bb30..2cb510a104d610dc998102e6742b447d7da32106 100644 >--- a/Source/WebCore/Modules/mediastream/DoubleRange.h >+++ b/Source/WebCore/Modules/mediastream/DoubleRange.h >@@ -31,8 +31,8 @@ > namespace WebCore { > > struct DoubleRange { >- std::optional<double> max; >- std::optional<double> min; >+ Optional<double> max; >+ Optional<double> min; > }; > > } >diff --git a/Source/WebCore/Modules/mediastream/LongRange.h b/Source/WebCore/Modules/mediastream/LongRange.h >index 160ef86b60827cf73fbbc6bdc47fc98b705450b8..0732627079fc4884cf8167229a62e5a167f570b1 100644 >--- a/Source/WebCore/Modules/mediastream/LongRange.h >+++ b/Source/WebCore/Modules/mediastream/LongRange.h >@@ -31,8 +31,8 @@ > namespace WebCore { > > struct LongRange { >- std::optional<int> max; >- std::optional<int> min; >+ Optional<int> max; >+ Optional<int> min; > }; > > } >diff --git a/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp b/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp >index 70533ad51ed81a569c02e55daebbbb7e9d4c108a..b5937c729444e091e6f7727029936834b608cf16 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp >@@ -316,7 +316,7 @@ MediaStreamTrack::TrackCapabilities MediaStreamTrack::getCapabilities() const > return result; > } > >-static MediaConstraints createMediaConstraints(const std::optional<MediaTrackConstraints>& constraints) >+static MediaConstraints createMediaConstraints(const Optional<MediaTrackConstraints>& constraints) > { > if (!constraints) { > MediaConstraints validConstraints; >@@ -326,7 +326,7 @@ static MediaConstraints createMediaConstraints(const std::optional<MediaTrackCon > return createMediaConstraints(constraints.value()); > } > >-void MediaStreamTrack::applyConstraints(const std::optional<MediaTrackConstraints>& constraints, DOMPromiseDeferred<void>&& promise) >+void MediaStreamTrack::applyConstraints(const Optional<MediaTrackConstraints>& constraints, DOMPromiseDeferred<void>&& promise) > { > m_promise = WTFMove(promise); > >diff --git a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h >index d82c3a9d8a36d75a898abd03e4ffa4a8578f3466..4982cb0bd932030ed0ea837e2910e5cc6a19d1fc 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h >+++ b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h >@@ -91,16 +91,16 @@ public: > bool isCaptureTrack() const { return m_private->isCaptureTrack(); } > > struct TrackSettings { >- std::optional<int> width; >- std::optional<int> height; >- std::optional<double> aspectRatio; >- std::optional<double> frameRate; >+ Optional<int> width; >+ Optional<int> height; >+ Optional<double> aspectRatio; >+ Optional<double> frameRate; > String facingMode; >- std::optional<double> volume; >- std::optional<int> sampleRate; >- std::optional<int> sampleSize; >- std::optional<bool> echoCancellation; >- std::optional<bool> displaySurface; >+ Optional<double> volume; >+ Optional<int> sampleRate; >+ Optional<int> sampleSize; >+ Optional<bool> echoCancellation; >+ Optional<bool> displaySurface; > String logicalSurface; > String deviceId; > String groupId; >@@ -108,22 +108,22 @@ public: > TrackSettings getSettings() const; > > struct TrackCapabilities { >- std::optional<LongRange> width; >- std::optional<LongRange> height; >- std::optional<DoubleRange> aspectRatio; >- std::optional<DoubleRange> frameRate; >- std::optional<Vector<String>> facingMode; >- std::optional<DoubleRange> volume; >- std::optional<LongRange> sampleRate; >- std::optional<LongRange> sampleSize; >- std::optional<Vector<bool>> echoCancellation; >+ Optional<LongRange> width; >+ Optional<LongRange> height; >+ Optional<DoubleRange> aspectRatio; >+ Optional<DoubleRange> frameRate; >+ Optional<Vector<String>> facingMode; >+ Optional<DoubleRange> volume; >+ Optional<LongRange> sampleRate; >+ Optional<LongRange> sampleSize; >+ Optional<Vector<bool>> echoCancellation; > String deviceId; > String groupId; > }; > TrackCapabilities getCapabilities() const; > > const MediaTrackConstraints& getConstraints() const { return m_constraints; } >- void applyConstraints(const std::optional<MediaTrackConstraints>&, DOMPromiseDeferred<void>&&); >+ void applyConstraints(const Optional<MediaTrackConstraints>&, DOMPromiseDeferred<void>&&); > > RealtimeMediaSource& source() const { return m_private->source(); } > MediaStreamTrackPrivate& privateTrack() { return m_private.get(); } >@@ -180,7 +180,7 @@ private: > > > MediaTrackConstraints m_constraints; >- std::optional<DOMPromiseDeferred<void>> m_promise; >+ Optional<DOMPromiseDeferred<void>> m_promise; > GenericTaskQueue<ScriptExecutionContext> m_taskQueue; > > bool m_ended { false }; >diff --git a/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp b/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp >index 9f10482196941b0f52468531c404f54f60a47c49..cd1c0e3198a5db570edacde3aa0fdafdc3ad7063 100644 >--- a/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp >@@ -148,7 +148,7 @@ static void set(MediaTrackConstraintSetMap& map, ConstraintSetType setType, cons > map.set(type, WTFMove(constraint)); > } > >-template<typename T> static inline void set(MediaTrackConstraintSetMap& map, ConstraintSetType setType, const char* typeAsString, MediaConstraintType type, const std::optional<T>& value) >+template<typename T> static inline void set(MediaTrackConstraintSetMap& map, ConstraintSetType setType, const char* typeAsString, MediaConstraintType type, const Optional<T>& value) > { > if (!value) > return; >@@ -185,7 +185,7 @@ static Vector<MediaTrackConstraintSetMap> convertAdvancedToInternalForm(const Ve > return result; > } > >-static Vector<MediaTrackConstraintSetMap> convertAdvancedToInternalForm(const std::optional<Vector<MediaTrackConstraintSet>>& optionalVector) >+static Vector<MediaTrackConstraintSetMap> convertAdvancedToInternalForm(const Optional<Vector<MediaTrackConstraintSet>>& optionalVector) > { > if (!optionalVector) > return { }; >diff --git a/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h b/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h >index 7314285ecf29d22a5df10040ccc7ca86362abd4d..0072aba336ffe9245f959b4f22ee2bbeea32dfc5 100644 >--- a/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h >+++ b/Source/WebCore/Modules/mediastream/MediaTrackConstraints.h >@@ -37,23 +37,23 @@ namespace WebCore { > struct MediaConstraints; > > struct ConstrainBooleanParameters { >- std::optional<bool> exact; >- std::optional<bool> ideal; >+ Optional<bool> exact; >+ Optional<bool> ideal; > }; > > struct ConstrainDOMStringParameters { >- std::optional<Variant<String, Vector<String>>> exact; >- std::optional<Variant<String, Vector<String>>> ideal; >+ Optional<Variant<String, Vector<String>>> exact; >+ Optional<Variant<String, Vector<String>>> ideal; > }; > > struct ConstrainDoubleRange : DoubleRange { >- std::optional<double> exact; >- std::optional<double> ideal; >+ Optional<double> exact; >+ Optional<double> ideal; > }; > > struct ConstrainLongRange : LongRange { >- std::optional<int> exact; >- std::optional<int> ideal; >+ Optional<int> exact; >+ Optional<int> ideal; > }; > > using ConstrainBoolean = Variant<bool, ConstrainBooleanParameters>; >@@ -62,23 +62,23 @@ using ConstrainDouble = Variant<double, ConstrainDoubleRange>; > using ConstrainLong = Variant<int, ConstrainLongRange>; > > struct MediaTrackConstraintSet { >- std::optional<ConstrainLong> width; >- std::optional<ConstrainLong> height; >- std::optional<ConstrainDouble> aspectRatio; >- std::optional<ConstrainDouble> frameRate; >- std::optional<ConstrainDOMString> facingMode; >- std::optional<ConstrainDouble> volume; >- std::optional<ConstrainLong> sampleRate; >- std::optional<ConstrainLong> sampleSize; >- std::optional<ConstrainBoolean> echoCancellation; >- std::optional<ConstrainDOMString> deviceId; >- std::optional<ConstrainDOMString> groupId; >- std::optional<ConstrainDOMString> displaySurface; >- std::optional<ConstrainBoolean> logicalSurface; >+ Optional<ConstrainLong> width; >+ Optional<ConstrainLong> height; >+ Optional<ConstrainDouble> aspectRatio; >+ Optional<ConstrainDouble> frameRate; >+ Optional<ConstrainDOMString> facingMode; >+ Optional<ConstrainDouble> volume; >+ Optional<ConstrainLong> sampleRate; >+ Optional<ConstrainLong> sampleSize; >+ Optional<ConstrainBoolean> echoCancellation; >+ Optional<ConstrainDOMString> deviceId; >+ Optional<ConstrainDOMString> groupId; >+ Optional<ConstrainDOMString> displaySurface; >+ Optional<ConstrainBoolean> logicalSurface; > }; > > struct MediaTrackConstraints : MediaTrackConstraintSet { >- std::optional<Vector<MediaTrackConstraintSet>> advanced; >+ Optional<Vector<MediaTrackConstraintSet>> advanced; > }; > > MediaConstraints createMediaConstraints(const MediaTrackConstraints&); >diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp >index d20dbca0c6cff6a4fe8039904f44968946c1173f..12a23e9072538e6cbd6652408c9470c896237c70 100644 >--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp >+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp >@@ -59,13 +59,13 @@ static std::unique_ptr<PeerConnectionBackend> createNoPeerConnectionBackend(RTCP > > CreatePeerConnectionBackend PeerConnectionBackend::create = createNoPeerConnectionBackend; > >-std::optional<RTCRtpCapabilities> PeerConnectionBackend::receiverCapabilities(ScriptExecutionContext&, const String&) >+Optional<RTCRtpCapabilities> PeerConnectionBackend::receiverCapabilities(ScriptExecutionContext&, const String&) > { > ASSERT_NOT_REACHED(); > return { }; > } > >-std::optional<RTCRtpCapabilities> PeerConnectionBackend::senderCapabilities(ScriptExecutionContext&, const String&) >+Optional<RTCRtpCapabilities> PeerConnectionBackend::senderCapabilities(ScriptExecutionContext&, const String&) > { > ASSERT_NOT_REACHED(); > return { }; >@@ -100,7 +100,7 @@ void PeerConnectionBackend::createOfferSucceeded(String&& sdp) > > ASSERT(m_offerAnswerPromise); > m_offerAnswerPromise->resolve(RTCSessionDescription::Init { RTCSdpType::Offer, filterSDP(WTFMove(sdp)) }); >- m_offerAnswerPromise = std::nullopt; >+ m_offerAnswerPromise = WTF::nullopt; > } > > void PeerConnectionBackend::createOfferFailed(Exception&& exception) >@@ -113,7 +113,7 @@ void PeerConnectionBackend::createOfferFailed(Exception&& exception) > > ASSERT(m_offerAnswerPromise); > m_offerAnswerPromise->reject(WTFMove(exception)); >- m_offerAnswerPromise = std::nullopt; >+ m_offerAnswerPromise = WTF::nullopt; > } > > void PeerConnectionBackend::createAnswer(RTCAnswerOptions&& options, PeerConnection::SessionDescriptionPromise&& promise) >@@ -135,7 +135,7 @@ void PeerConnectionBackend::createAnswerSucceeded(String&& sdp) > > ASSERT(m_offerAnswerPromise); > m_offerAnswerPromise->resolve(RTCSessionDescription::Init { RTCSdpType::Answer, WTFMove(sdp) }); >- m_offerAnswerPromise = std::nullopt; >+ m_offerAnswerPromise = WTF::nullopt; > } > > void PeerConnectionBackend::createAnswerFailed(Exception&& exception) >@@ -148,7 +148,7 @@ void PeerConnectionBackend::createAnswerFailed(Exception&& exception) > > ASSERT(m_offerAnswerPromise); > m_offerAnswerPromise->reject(WTFMove(exception)); >- m_offerAnswerPromise = std::nullopt; >+ m_offerAnswerPromise = WTF::nullopt; > } > > static inline bool isLocalDescriptionTypeValidForState(RTCSdpType type, RTCSignalingState state) >@@ -194,7 +194,7 @@ void PeerConnectionBackend::setLocalDescriptionSucceeded() > ASSERT(m_setDescriptionPromise); > > m_setDescriptionPromise->resolve(); >- m_setDescriptionPromise = std::nullopt; >+ m_setDescriptionPromise = WTF::nullopt; > } > > void PeerConnectionBackend::setLocalDescriptionFailed(Exception&& exception) >@@ -208,7 +208,7 @@ void PeerConnectionBackend::setLocalDescriptionFailed(Exception&& exception) > ASSERT(m_setDescriptionPromise); > > m_setDescriptionPromise->reject(WTFMove(exception)); >- m_setDescriptionPromise = std::nullopt; >+ m_setDescriptionPromise = WTF::nullopt; > } > > static inline bool isRemoteDescriptionTypeValidForState(RTCSdpType type, RTCSignalingState state) >@@ -254,7 +254,7 @@ void PeerConnectionBackend::setRemoteDescriptionSucceeded() > ASSERT(m_setDescriptionPromise); > > m_setDescriptionPromise->resolve(); >- m_setDescriptionPromise = std::nullopt; >+ m_setDescriptionPromise = WTF::nullopt; > } > > void PeerConnectionBackend::setRemoteDescriptionFailed(Exception&& exception) >@@ -268,7 +268,7 @@ void PeerConnectionBackend::setRemoteDescriptionFailed(Exception&& exception) > ASSERT(m_setDescriptionPromise); > > m_setDescriptionPromise->reject(WTFMove(exception)); >- m_setDescriptionPromise = std::nullopt; >+ m_setDescriptionPromise = WTF::nullopt; > } > > static String extractIPAddres(const String& sdp) >@@ -312,7 +312,7 @@ void PeerConnectionBackend::addIceCandidateSucceeded() > ASSERT(m_addIceCandidatePromise); > > m_addIceCandidatePromise->resolve(); >- m_addIceCandidatePromise = std::nullopt; >+ m_addIceCandidatePromise = WTF::nullopt; > > if (!m_waitingForMDNSResolution && m_finishedReceivingCandidates) > endOfIceCandidates(WTFMove(*m_endOfIceCandidatePromise)); >@@ -329,7 +329,7 @@ void PeerConnectionBackend::addIceCandidateFailed(Exception&& exception) > ASSERT(m_addIceCandidatePromise); > > m_addIceCandidatePromise->reject(WTFMove(exception)); >- m_addIceCandidatePromise = std::nullopt; >+ m_addIceCandidatePromise = WTF::nullopt; > > if (!m_waitingForMDNSResolution && m_finishedReceivingCandidates) > endOfIceCandidates(WTFMove(*m_endOfIceCandidatePromise)); >@@ -494,9 +494,9 @@ void PeerConnectionBackend::updateSignalingState(RTCSignalingState newSignalingS > > void PeerConnectionBackend::stop() > { >- m_offerAnswerPromise = std::nullopt; >- m_setDescriptionPromise = std::nullopt; >- m_addIceCandidatePromise = std::nullopt; >+ m_offerAnswerPromise = WTF::nullopt; >+ m_setDescriptionPromise = WTF::nullopt; >+ m_addIceCandidatePromise = WTF::nullopt; > > doStop(); > } >diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >index a2c1bee9ea1794da4ab33e288adf58779985b5f1..d496ce1e7d5d8b36b25d5d8414a62e7a2a2044b9 100644 >--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >@@ -79,8 +79,8 @@ class PeerConnectionBackend > public: > WEBCORE_EXPORT static CreatePeerConnectionBackend create; > >- static std::optional<RTCRtpCapabilities> receiverCapabilities(ScriptExecutionContext&, const String& kind); >- static std::optional<RTCRtpCapabilities> senderCapabilities(ScriptExecutionContext&, const String& kind); >+ static Optional<RTCRtpCapabilities> receiverCapabilities(ScriptExecutionContext&, const String& kind); >+ static Optional<RTCRtpCapabilities> senderCapabilities(ScriptExecutionContext&, const String& kind); > > explicit PeerConnectionBackend(RTCPeerConnection&); > virtual ~PeerConnectionBackend() = default; >@@ -161,9 +161,9 @@ public: > } > > Type type; >- std::optional<double> expires; >+ Optional<double> expires; > >- std::optional<RSA> rsaParameters; >+ Optional<RSA> rsaParameters; > }; > static void generateCertificate(Document&, const CertificateInformation&, DOMPromiseDeferred<IDLInterface<RTCCertificate>>&&); > >@@ -207,10 +207,10 @@ protected: > RTCPeerConnection& m_peerConnection; > > private: >- std::optional<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise; >- std::optional<DOMPromiseDeferred<void>> m_setDescriptionPromise; >- std::optional<DOMPromiseDeferred<void>> m_addIceCandidatePromise; >- std::optional<DOMPromiseDeferred<void>> m_endOfIceCandidatePromise; >+ Optional<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise; >+ Optional<DOMPromiseDeferred<void>> m_setDescriptionPromise; >+ Optional<DOMPromiseDeferred<void>> m_addIceCandidatePromise; >+ Optional<DOMPromiseDeferred<void>> m_endOfIceCandidatePromise; > > bool m_shouldFilterICECandidates { true }; > struct PendingICECandidate { >diff --git a/Source/WebCore/Modules/mediastream/RTCConfiguration.h b/Source/WebCore/Modules/mediastream/RTCConfiguration.h >index dd1e17c0d6303f5ab691e07e14ab71acc4e284fa..307deefee8e064104c6caebb029b9846087adc2d 100644 >--- a/Source/WebCore/Modules/mediastream/RTCConfiguration.h >+++ b/Source/WebCore/Modules/mediastream/RTCConfiguration.h >@@ -42,7 +42,7 @@ > namespace WebCore { > > struct RTCConfiguration { >- std::optional<Vector<RTCIceServer>> iceServers; >+ Optional<Vector<RTCIceServer>> iceServers; > RTCIceTransportPolicy iceTransportPolicy; > RTCBundlePolicy bundlePolicy; > RTCPMuxPolicy rtcpMuxPolicy; >diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >index 794ca8f4904dfb64dd867bcc6f6d13c70bcaf163..3f26e65e5872cbcad9bd2830694c97df8b36fa54 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >@@ -68,7 +68,7 @@ String RTCDTMFSender::toneBuffer() const > return { }; > } > >-ExceptionOr<void> RTCDTMFSender::insertDTMF(const String&, std::optional<int> duration, std::optional<int> interToneGap) >+ExceptionOr<void> RTCDTMFSender::insertDTMF(const String&, Optional<int> duration, Optional<int> interToneGap) > { > if (!canInsertDTMF()) > return Exception { NotSupportedError }; >diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >index 00fce07c95229ae88505b6116cb6681f03881f8d..c975a5910c704ea843448d7e8f0bc5a03f142852 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >@@ -47,7 +47,7 @@ public: > int duration() const { return m_duration; } > int interToneGap() const { return m_interToneGap; } > >- ExceptionOr<void> insertDTMF(const String& tones, std::optional<int> duration, std::optional<int> interToneGap); >+ ExceptionOr<void> insertDTMF(const String& tones, Optional<int> duration, Optional<int> interToneGap); > > using RefCounted::ref; > using RefCounted::deref; >diff --git a/Source/WebCore/Modules/mediastream/RTCDataChannel.h b/Source/WebCore/Modules/mediastream/RTCDataChannel.h >index 620adb4348c6462bebd7b5efe5e643a0a36ae6db..b016b8aa422933f69b3181b24e5ed3b73ba0c6a7 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDataChannel.h >+++ b/Source/WebCore/Modules/mediastream/RTCDataChannel.h >@@ -51,11 +51,11 @@ public: > static Ref<RTCDataChannel> create(ScriptExecutionContext&, std::unique_ptr<RTCDataChannelHandler>&&, String&&, RTCDataChannelInit&&); > > bool ordered() const { return *m_options.ordered; } >- std::optional<unsigned short> maxPacketLifeTime() const { return m_options.maxPacketLifeTime; } >- std::optional<unsigned short> maxRetransmits() const { return m_options.maxRetransmits; } >+ Optional<unsigned short> maxPacketLifeTime() const { return m_options.maxPacketLifeTime; } >+ Optional<unsigned short> maxRetransmits() const { return m_options.maxRetransmits; } > String protocol() const { return m_options.protocol; } > bool negotiated() const { return *m_options.negotiated; }; >- std::optional<unsigned short> id() const { return m_options.id; }; >+ Optional<unsigned short> id() const { return m_options.id; }; > > String label() const { return m_label; } > RTCDataChannelState readyState() const {return m_readyState; } >diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp >index eaf7aff52f2fabe51252c37d4a4380a3f8eac7a0..17afd213d1c6c99fcfb9a6690483adb21183b4bb 100644 >--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp >@@ -37,7 +37,7 @@ > > namespace WebCore { > >-inline RTCIceCandidate::RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex) >+inline RTCIceCandidate::RTCIceCandidate(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex) > : m_candidate(candidate) > , m_sdpMid(sdpMid) > , m_sdpMLineIndex(sdpMLineIndex) >@@ -52,7 +52,7 @@ ExceptionOr<Ref<RTCIceCandidate>> RTCIceCandidate::create(const Init& dictionary > return create(dictionary.candidate, dictionary.sdpMid, dictionary.sdpMLineIndex); > } > >-Ref<RTCIceCandidate> RTCIceCandidate::create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex) >+Ref<RTCIceCandidate> RTCIceCandidate::create(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex) > { > return adoptRef(*new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex)); > } >diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h >index b35c20db7f13b709ab51c95c8d11f44fa542976c..73a6097eef7d5065803bbe76423c41fbd453d959 100644 >--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h >+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h >@@ -42,24 +42,24 @@ public: > struct Init { > String candidate; > String sdpMid; >- std::optional<unsigned short> sdpMLineIndex; >+ Optional<unsigned short> sdpMLineIndex; > }; > > static ExceptionOr<Ref<RTCIceCandidate>> create(const Init&); >- static Ref<RTCIceCandidate> create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex); >+ static Ref<RTCIceCandidate> create(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex); > > const String& candidate() const { return m_candidate; } > const String& sdpMid() const { return m_sdpMid; } >- std::optional<unsigned short> sdpMLineIndex() const { return m_sdpMLineIndex; } >+ Optional<unsigned short> sdpMLineIndex() const { return m_sdpMLineIndex; } > > void setCandidate(String&& candidate) { m_candidate = WTFMove(candidate); } > > private: >- RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex); >+ RTCIceCandidate(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex); > > String m_candidate; > String m_sdpMid; >- std::optional<unsigned short> m_sdpMLineIndex; >+ Optional<unsigned short> m_sdpMLineIndex; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >index 2e13663f84e42fcfa74076d6079f0280ef859400..da67c56b5f54e7cdb9bbd859ea67ea233580264e 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >@@ -89,9 +89,9 @@ public: > String name; > String hash; > String namedCurve; >- std::optional<uint32_t> modulusLength; >+ Optional<uint32_t> modulusLength; > RefPtr<Uint8Array> publicExponent; >- std::optional<double> expires; >+ Optional<double> expires; > }; > > using AlgorithmIdentifier = Variant<JSC::Strong<JSC::JSObject>, String>; >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpContributingSource.h b/Source/WebCore/Modules/mediastream/RTCRtpContributingSource.h >index 8d89753b2995638ff3655f2546141149c8ede23e..4bfe235507d292f0bb03b740fea944a87b5c66f9 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpContributingSource.h >+++ b/Source/WebCore/Modules/mediastream/RTCRtpContributingSource.h >@@ -32,7 +32,7 @@ namespace WebCore { > struct RTCRtpContributingSource { > double timestamp; > unsigned long source; >- std::optional<double> audioLevel; >+ Optional<double> audioLevel; > }; > > >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.h b/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.h >index 7a5c7dcd7e5da19d536caa5efdb0d33c8cda9f63..aa80c6f4ef2921011d9a5b65aa428949b8fdf278 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.h >+++ b/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.h >@@ -39,7 +39,7 @@ struct RTCRtpEncodingParameters : RTCRtpCodingParameters { > unsigned long ssrc { 0 }; > RTCRtpRtxParameters rtx; > RTCRtpFecParameters fec; >- std::optional<RTCDtxStatus> dtx; >+ Optional<RTCDtxStatus> dtx; > bool active { false}; > RTCPriorityType priority { RTCPriorityType::Medium }; > unsigned long maxBitrate { 0 }; >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp b/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp >index 7ffb5c8e2927826538aefb9ca05d25477b9b742a..926d53fbfc98012d32cacf2098e7aa184f9807d0 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp >@@ -63,7 +63,7 @@ void RTCRtpReceiver::getStats(Ref<DeferredPromise>&& promise) > m_connection->getStats(*this, WTFMove(promise)); > } > >-std::optional<RTCRtpCapabilities> RTCRtpReceiver::getCapabilities(ScriptExecutionContext& context, const String& kind) >+Optional<RTCRtpCapabilities> RTCRtpReceiver::getCapabilities(ScriptExecutionContext& context, const String& kind) > { > return PeerConnectionBackend::receiverCapabilities(context, kind); > } >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpReceiver.h b/Source/WebCore/Modules/mediastream/RTCRtpReceiver.h >index 97feb815b4e0f31bb1b7fa894b9545d05212aca4..7e7229e6593204ba450237646d0cf3360ce7f3d5 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpReceiver.h >+++ b/Source/WebCore/Modules/mediastream/RTCRtpReceiver.h >@@ -49,7 +49,7 @@ public: > return adoptRef(*new RTCRtpReceiver(connection, WTFMove(track), WTFMove(backend))); > } > >- static std::optional<RTCRtpCapabilities> getCapabilities(ScriptExecutionContext&, const String& kind); >+ static Optional<RTCRtpCapabilities> getCapabilities(ScriptExecutionContext&, const String& kind); > > void stop(); > >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp b/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp >index 2744d064bf86b84783feca3fa803e633b0f67929..b27cfb330f689e954d508aa223a8a819aff51310 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp >@@ -127,7 +127,7 @@ bool RTCRtpSender::isCreatedBy(const PeerConnectionBackend& connection) const > return &connection == m_connection.get(); > } > >-std::optional<RTCRtpCapabilities> RTCRtpSender::getCapabilities(ScriptExecutionContext& context, const String& kind) >+Optional<RTCRtpCapabilities> RTCRtpSender::getCapabilities(ScriptExecutionContext& context, const String& kind) > { > return PeerConnectionBackend::senderCapabilities(context, kind); > } >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpSender.h b/Source/WebCore/Modules/mediastream/RTCRtpSender.h >index 3f4483f3074e371ee3a1cc6243d9e272e38dc6a3..e7387d34a884708ee264564d2240ee6c308d55cf 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpSender.h >+++ b/Source/WebCore/Modules/mediastream/RTCRtpSender.h >@@ -47,7 +47,7 @@ public: > static Ref<RTCRtpSender> create(PeerConnectionBackend&, Ref<MediaStreamTrack>&&, Vector<String>&& mediaStreamIds, std::unique_ptr<RTCRtpSenderBackend>&&); > static Ref<RTCRtpSender> create(PeerConnectionBackend&, String&& trackKind, Vector<String>&& mediaStreamIds, std::unique_ptr<RTCRtpSenderBackend>&&); > >- static std::optional<RTCRtpCapabilities> getCapabilities(ScriptExecutionContext&, const String& kind); >+ static Optional<RTCRtpCapabilities> getCapabilities(ScriptExecutionContext&, const String& kind); > > MediaStreamTrack* track() { return m_track.get(); } > >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpSynchronizationSource.h b/Source/WebCore/Modules/mediastream/RTCRtpSynchronizationSource.h >index 7f33816a75fd1dc30c6f4877d956842eaf06ce33..572ae8598587ba05eca1898bc470506cd0b50133 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpSynchronizationSource.h >+++ b/Source/WebCore/Modules/mediastream/RTCRtpSynchronizationSource.h >@@ -32,7 +32,7 @@ > namespace WebCore { > > struct RTCRtpSynchronizationSource : RTCRtpContributingSource { >- std::optional<bool> voiceActivityFlag; >+ Optional<bool> voiceActivityFlag; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp b/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp >index 84bcc1ea90a1091725f46c5cb832f20a028ad8d3..6b463476f72fe3d30f32c0112608242b1a0bba48 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp >@@ -64,10 +64,10 @@ RTCRtpTransceiverDirection RTCRtpTransceiver::direction() const > return m_backend->direction(); > } > >-std::optional<RTCRtpTransceiverDirection> RTCRtpTransceiver::currentDirection() const >+Optional<RTCRtpTransceiverDirection> RTCRtpTransceiver::currentDirection() const > { > if (!m_backend) >- return std::nullopt; >+ return WTF::nullopt; > return m_backend->currentDirection(); > } > >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h b/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h >index 456749452026c953f5b3f386ac88a262727eed00..e4879b59478c48bd16002f7cf6c094a8dd8da149 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h >+++ b/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h >@@ -55,7 +55,7 @@ public: > void disableSendingDirection(); > > RTCRtpTransceiverDirection direction() const; >- std::optional<RTCRtpTransceiverDirection> currentDirection() const; >+ Optional<RTCRtpTransceiverDirection> currentDirection() const; > void setDirection(RTCRtpTransceiverDirection); > String mid() const; > >diff --git a/Source/WebCore/Modules/mediastream/RTCRtpTransceiverBackend.h b/Source/WebCore/Modules/mediastream/RTCRtpTransceiverBackend.h >index 670b2d8d64488f8cade1dbdece68395414661825..822b2e26ca40c51bf7a81672029b857cc024c353 100644 >--- a/Source/WebCore/Modules/mediastream/RTCRtpTransceiverBackend.h >+++ b/Source/WebCore/Modules/mediastream/RTCRtpTransceiverBackend.h >@@ -35,7 +35,7 @@ public: > virtual ~RTCRtpTransceiverBackend() = default; > > virtual RTCRtpTransceiverDirection direction() const = 0; >- virtual std::optional<RTCRtpTransceiverDirection> currentDirection() const = 0; >+ virtual Optional<RTCRtpTransceiverDirection> currentDirection() const = 0; > virtual void setDirection(RTCRtpTransceiverDirection) = 0; > > virtual String mid() = 0; >diff --git a/Source/WebCore/Modules/mediastream/RTCStatsReport.h b/Source/WebCore/Modules/mediastream/RTCStatsReport.h >index dc0dd5bef725198aa2b18b1a095c3fa6274ecccb..a8be605d39d80a224c631456d36d28eeccaba50f 100644 >--- a/Source/WebCore/Modules/mediastream/RTCStatsReport.h >+++ b/Source/WebCore/Modules/mediastream/RTCStatsReport.h >@@ -59,7 +59,7 @@ public: > }; > > struct RTCRTPStreamStats : Stats { >- std::optional<uint32_t> ssrc; >+ Optional<uint32_t> ssrc; > String associateStatsId; > bool isRemote { false }; > String mediaType; >@@ -67,63 +67,63 @@ public: > String trackId; > String transportId; > String codecId; >- std::optional<uint32_t> firCount; >- std::optional<uint32_t> pliCount; >- std::optional<uint32_t> nackCount; >- std::optional<uint32_t> sliCount; >- std::optional<uint64_t> qpSum; >+ Optional<uint32_t> firCount; >+ Optional<uint32_t> pliCount; >+ Optional<uint32_t> nackCount; >+ Optional<uint32_t> sliCount; >+ Optional<uint64_t> qpSum; > }; > > struct InboundRTPStreamStats : RTCRTPStreamStats { > InboundRTPStreamStats() { type = RTCStatsReport::Type::InboundRtp; } > >- std::optional<uint32_t> packetsReceived; >- std::optional<uint64_t> bytesReceived; >- std::optional<uint32_t> packetsLost; >- std::optional<double> jitter; >- std::optional<double> fractionLost; >- std::optional<uint32_t> packetsDiscarded; >- std::optional<uint32_t> packetsRepaired; >- std::optional<uint32_t> burstPacketsLost; >- std::optional<uint32_t> burstPacketsDiscarded; >- std::optional<uint32_t> burstLossCount; >- std::optional<uint32_t> burstDiscardCount; >- std::optional<double> burstLossRate; >- std::optional<double> burstDiscardRate; >- std::optional<double> gapLossRate; >- std::optional<double> gapDiscardRate; >- std::optional<uint32_t> framesDecoded; >+ Optional<uint32_t> packetsReceived; >+ Optional<uint64_t> bytesReceived; >+ Optional<uint32_t> packetsLost; >+ Optional<double> jitter; >+ Optional<double> fractionLost; >+ Optional<uint32_t> packetsDiscarded; >+ Optional<uint32_t> packetsRepaired; >+ Optional<uint32_t> burstPacketsLost; >+ Optional<uint32_t> burstPacketsDiscarded; >+ Optional<uint32_t> burstLossCount; >+ Optional<uint32_t> burstDiscardCount; >+ Optional<double> burstLossRate; >+ Optional<double> burstDiscardRate; >+ Optional<double> gapLossRate; >+ Optional<double> gapDiscardRate; >+ Optional<uint32_t> framesDecoded; > }; > > struct OutboundRTPStreamStats : RTCRTPStreamStats { > OutboundRTPStreamStats() { type = RTCStatsReport::Type::OutboundRtp; } > >- std::optional<uint32_t> packetsSent; >- std::optional<uint64_t> bytesSent; >- std::optional<double> targetBitrate; >- std::optional<uint32_t> framesEncoded; >+ Optional<uint32_t> packetsSent; >+ Optional<uint64_t> bytesSent; >+ Optional<double> targetBitrate; >+ Optional<uint32_t> framesEncoded; > }; > > struct MediaStreamTrackStats : Stats { > MediaStreamTrackStats() { type = RTCStatsReport::Type::Track; } > > String trackIdentifier; >- std::optional<bool> remoteSource; >- std::optional<bool> ended; >- std::optional<bool> detached; >- std::optional<uint32_t> frameWidth; >- std::optional<uint32_t> frameHeight; >- std::optional<double> framesPerSecond; >- std::optional<uint32_t> framesSent; >- std::optional<uint32_t> framesReceived; >- std::optional<uint32_t> framesDecoded; >- std::optional<uint32_t> framesDropped; >- std::optional<uint32_t> framesCorrupted; >- std::optional<uint32_t> partialFramesLost; >- std::optional<uint32_t> fullFramesLost; >- std::optional<double> audioLevel; >- std::optional<double> echoReturnLoss; >- std::optional<double> echoReturnLossEnhancement; >+ Optional<bool> remoteSource; >+ Optional<bool> ended; >+ Optional<bool> detached; >+ Optional<uint32_t> frameWidth; >+ Optional<uint32_t> frameHeight; >+ Optional<double> framesPerSecond; >+ Optional<uint32_t> framesSent; >+ Optional<uint32_t> framesReceived; >+ Optional<uint32_t> framesDecoded; >+ Optional<uint32_t> framesDropped; >+ Optional<uint32_t> framesCorrupted; >+ Optional<uint32_t> partialFramesLost; >+ Optional<uint32_t> fullFramesLost; >+ Optional<double> audioLevel; >+ Optional<double> echoReturnLoss; >+ Optional<double> echoReturnLossEnhancement; > }; > > struct DataChannelStats : Stats { >@@ -131,12 +131,12 @@ public: > > String label; > String protocol; >- std::optional<int> datachannelid; >+ Optional<int> datachannelid; > String state; >- std::optional<uint32_t> messagesSent; >- std::optional<uint64_t> bytesSent; >- std::optional<uint32_t> messagesReceived; >- std::optional<uint64_t> bytesReceived; >+ Optional<uint32_t> messagesSent; >+ Optional<uint64_t> bytesSent; >+ Optional<uint32_t> messagesReceived; >+ Optional<uint64_t> bytesReceived; > }; > > enum class IceCandidatePairState { >@@ -155,26 +155,26 @@ public: > String localCandidateId; > String remoteCandidateId; > IceCandidatePairState state; >- std::optional<uint64_t> priority; >- std::optional<bool> nominated; >- std::optional<bool> writable; >- std::optional<bool> readable; >- std::optional<uint64_t> bytesSent; >- std::optional<uint64_t> bytesReceived; >- std::optional<double> totalRoundTripTime; >- std::optional<double> currentRoundTripTime; >- std::optional<double> availableOutgoingBitrate; >- std::optional<double> availableIncomingBitrate; >- std::optional<uint64_t> requestsReceived; >- std::optional<uint64_t> requestsSent; >- std::optional<uint64_t> responsesReceived; >- std::optional<uint64_t> responsesSent; >- std::optional<uint64_t> retransmissionsReceived; >- std::optional<uint64_t> retransmissionsSent; >- std::optional<uint64_t> consentRequestsReceived; >- std::optional<uint64_t> consentRequestsSent; >- std::optional<uint64_t> consentResponsesReceived; >- std::optional<uint64_t> consentResponsesSent; >+ Optional<uint64_t> priority; >+ Optional<bool> nominated; >+ Optional<bool> writable; >+ Optional<bool> readable; >+ Optional<uint64_t> bytesSent; >+ Optional<uint64_t> bytesReceived; >+ Optional<double> totalRoundTripTime; >+ Optional<double> currentRoundTripTime; >+ Optional<double> availableOutgoingBitrate; >+ Optional<double> availableIncomingBitrate; >+ Optional<uint64_t> requestsReceived; >+ Optional<uint64_t> requestsSent; >+ Optional<uint64_t> responsesReceived; >+ Optional<uint64_t> responsesSent; >+ Optional<uint64_t> retransmissionsReceived; >+ Optional<uint64_t> retransmissionsSent; >+ Optional<uint64_t> consentRequestsReceived; >+ Optional<uint64_t> consentRequestsSent; >+ Optional<uint64_t> consentResponsesReceived; >+ Optional<uint64_t> consentResponsesSent; > }; > > enum class IceCandidateType { Host, Srflx, Prflx, Relay }; >@@ -182,10 +182,10 @@ public: > struct IceCandidateStats : Stats { > String transportId; > String address; >- std::optional<int32_t> port; >+ Optional<int32_t> port; > String protocol; >- std::optional<IceCandidateType> candidateType; >- std::optional<int32_t> priority; >+ Optional<IceCandidateType> candidateType; >+ Optional<int32_t> priority; > String url; > bool deleted { false }; > }; >@@ -207,12 +207,12 @@ public: > struct CodecStats : Stats { > CodecStats() { type = RTCStatsReport::Type::Codec; } > >- std::optional<uint32_t> payloadType; >- std::optional<CodecType> codecType; >+ Optional<uint32_t> payloadType; >+ Optional<CodecType> codecType; > String transportId; > String mimeType; >- std::optional<uint32_t> clockRate; >- std::optional<uint32_t> channels; >+ Optional<uint32_t> clockRate; >+ Optional<uint32_t> channels; > String sdpFmtpLine; > String implementation; > }; >@@ -220,8 +220,8 @@ public: > struct TransportStats : Stats { > TransportStats() { type = RTCStatsReport::Type::Transport; } > >- std::optional<uint64_t> bytesSent; >- std::optional<uint64_t> bytesReceived; >+ Optional<uint64_t> bytesSent; >+ Optional<uint64_t> bytesReceived; > String rtcpTransportStatsId; > String selectedCandidatePairId; > String localCertificateId; >@@ -231,8 +231,8 @@ public: > struct PeerConnectionStats : Stats { > PeerConnectionStats() { type = RTCStatsReport::Type::PeerConnection; } > >- std::optional<uint32_t> dataChannelsOpened; >- std::optional<uint32_t> dataChannelsClosed; >+ Optional<uint32_t> dataChannelsOpened; >+ Optional<uint32_t> dataChannelsClosed; > }; > > private: >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp >index 8a088be3e3cce151ff1ec5454976fb17edad8474..8630332fe237e58649718f4f602ad482df7900c5 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp >@@ -87,7 +87,7 @@ private: > } > > RefPtr<SecurityOrigin> m_origin; >- std::optional<DOMPromiseDeferred<IDLInterface<RTCCertificate>>> m_promise; >+ Optional<DOMPromiseDeferred<IDLInterface<RTCCertificate>>> m_promise; > }; > > static inline rtc::KeyParams keyParamsFromCertificateType(const PeerConnectionBackend::CertificateInformation& info) >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp >index 291ca8e93cbc41086c39a0a82de2fee4543d444d..ad820957c1a6a356e543d7f76b4c3ac52772dd2d 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp >@@ -534,17 +534,17 @@ void LibWebRTCMediaEndpoint::removeRemoteTrack(rtc::scoped_refptr<webrtc::RtpRec > } > > template<typename T> >-std::optional<LibWebRTCMediaEndpoint::Backends> LibWebRTCMediaEndpoint::createTransceiverBackends(T&& trackOrKind, const RTCRtpTransceiverInit& init, LibWebRTCRtpSenderBackend::Source&& source) >+Optional<LibWebRTCMediaEndpoint::Backends> LibWebRTCMediaEndpoint::createTransceiverBackends(T&& trackOrKind, const RTCRtpTransceiverInit& init, LibWebRTCRtpSenderBackend::Source&& source) > { > auto result = m_backend->AddTransceiver(WTFMove(trackOrKind), fromRtpTransceiverInit(init)); > if (!result.ok()) >- return std::nullopt; >+ return WTF::nullopt; > > auto transceiver = std::make_unique<LibWebRTCRtpTransceiverBackend>(result.MoveValue()); > return LibWebRTCMediaEndpoint::Backends { transceiver->createSenderBackend(m_peerConnectionBackend, WTFMove(source)), transceiver->createReceiverBackend(), WTFMove(transceiver) }; > } > >-std::optional<LibWebRTCMediaEndpoint::Backends> LibWebRTCMediaEndpoint::addTransceiver(const String& trackKind, const RTCRtpTransceiverInit& init) >+Optional<LibWebRTCMediaEndpoint::Backends> LibWebRTCMediaEndpoint::addTransceiver(const String& trackKind, const RTCRtpTransceiverInit& init) > { > auto type = trackKind == "audio" ? cricket::MediaType::MEDIA_TYPE_AUDIO : cricket::MediaType::MEDIA_TYPE_VIDEO; > return createTransceiverBackends(type, init, nullptr); >@@ -574,7 +574,7 @@ std::pair<LibWebRTCRtpSenderBackend::Source, rtc::scoped_refptr<webrtc::MediaStr > return std::make_pair(WTFMove(source), WTFMove(rtcTrack)); > } > >-std::optional<LibWebRTCMediaEndpoint::Backends> LibWebRTCMediaEndpoint::addTransceiver(MediaStreamTrack& track, const RTCRtpTransceiverInit& init) >+Optional<LibWebRTCMediaEndpoint::Backends> LibWebRTCMediaEndpoint::addTransceiver(MediaStreamTrack& track, const RTCRtpTransceiverInit& init) > { > auto sourceAndTrack = createSourceAndRTCTrack(track); > return createTransceiverBackends(WTFMove(sourceAndTrack.second), init, WTFMove(sourceAndTrack.first)); >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >index 41cd8847d36c0e78b48234d41b24519977b8a363..19e856c0887725f7a2fc0dc8f0318b8814eeca13 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h >@@ -106,8 +106,8 @@ public: > std::unique_ptr<LibWebRTCRtpReceiverBackend> receiverBackend; > std::unique_ptr<LibWebRTCRtpTransceiverBackend> transceiverBackend; > }; >- std::optional<Backends> addTransceiver(const String& trackKind, const RTCRtpTransceiverInit&); >- std::optional<Backends> addTransceiver(MediaStreamTrack&, const RTCRtpTransceiverInit&); >+ Optional<Backends> addTransceiver(const String& trackKind, const RTCRtpTransceiverInit&); >+ Optional<Backends> addTransceiver(MediaStreamTrack&, const RTCRtpTransceiverInit&); > std::unique_ptr<LibWebRTCRtpTransceiverBackend> transceiverBackendFromSender(LibWebRTCRtpSenderBackend&); > > void setSenderSourceFromTrack(LibWebRTCRtpSenderBackend&, MediaStreamTrack&); >@@ -146,7 +146,7 @@ private: > void fireTrackEvent(Ref<RTCRtpReceiver>&&, Ref<MediaStreamTrack>&&, const std::vector<rtc::scoped_refptr<webrtc::MediaStreamInterface>>&, RefPtr<RTCRtpTransceiver>&&); > > template<typename T> >- std::optional<Backends> createTransceiverBackends(T&&, const RTCRtpTransceiverInit&, LibWebRTCRtpSenderBackend::Source&&); >+ Optional<Backends> createTransceiverBackends(T&&, const RTCRtpTransceiverInit&, LibWebRTCRtpSenderBackend::Source&&); > > void OnStatsDelivered(const rtc::scoped_refptr<const webrtc::RTCStatsReport>&) final; > void gatherStatsForLogging(); >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp >index a78557ad8d7235f8e221fb2168bb779adfa2f757..1253c0f2c3910e4d17704a727d6c0e7459ea084e 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp >@@ -66,7 +66,7 @@ static std::unique_ptr<PeerConnectionBackend> createLibWebRTCPeerConnectionBacke > > CreatePeerConnectionBackend PeerConnectionBackend::create = createLibWebRTCPeerConnectionBackend; > >-std::optional<RTCRtpCapabilities> PeerConnectionBackend::receiverCapabilities(ScriptExecutionContext& context, const String& kind) >+Optional<RTCRtpCapabilities> PeerConnectionBackend::receiverCapabilities(ScriptExecutionContext& context, const String& kind) > { > auto* page = downcast<Document>(context).page(); > if (!page) >@@ -74,7 +74,7 @@ std::optional<RTCRtpCapabilities> PeerConnectionBackend::receiverCapabilities(Sc > return page->libWebRTCProvider().receiverCapabilities(kind); > } > >-std::optional<RTCRtpCapabilities> PeerConnectionBackend::senderCapabilities(ScriptExecutionContext& context, const String& kind) >+Optional<RTCRtpCapabilities> PeerConnectionBackend::senderCapabilities(ScriptExecutionContext& context, const String& kind) > { > auto* page = downcast<Document>(context).page(); > if (!page) >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp >index 2c1c0158b88763deb28f32c2e8434417ee554e66..1752761fedc7b87da7e77483910aa0ebb4d4f602 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp >@@ -135,7 +135,7 @@ void LibWebRTCRtpSenderBackend::setParameters(const RTCRtpSendParameters& parame > > auto rtcParameters = WTFMove(*m_currentParameters); > updateRTCRtpSendParameters(parameters, rtcParameters); >- m_currentParameters = std::nullopt; >+ m_currentParameters = WTF::nullopt; > > auto error = m_rtcSender->SetParameters(rtcParameters); > if (!error.ok()) { >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h >index ee615a40c4fb398c6b04310d8c1ce61e6818a166..ccd28a0d343169d117df159a4e59429305bb74dd 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h >@@ -114,7 +114,7 @@ private: > WeakPtr<LibWebRTCPeerConnectionBackend> m_peerConnectionBackend; > rtc::scoped_refptr<webrtc::RtpSenderInterface> m_rtcSender; > Source m_source; >- mutable std::optional<webrtc::RtpParameters> m_currentParameters; >+ mutable Optional<webrtc::RtpParameters> m_currentParameters; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp >index a8983404c818b2407cb9dad34c1eaeb39a548768..eb871eb7db03884f4cc7e0adef68782e1c0972d7 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp >@@ -48,11 +48,11 @@ RTCRtpTransceiverDirection LibWebRTCRtpTransceiverBackend::direction() const > return toRTCRtpTransceiverDirection(m_rtcTransceiver->direction()); > } > >-std::optional<RTCRtpTransceiverDirection> LibWebRTCRtpTransceiverBackend::currentDirection() const >+Optional<RTCRtpTransceiverDirection> LibWebRTCRtpTransceiverBackend::currentDirection() const > { > auto value = m_rtcTransceiver->current_direction(); > if (!value) >- return std::nullopt; >+ return WTF::nullopt; > return toRTCRtpTransceiverDirection(*value); > } > >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h >index 3112d6bb44295c20473454a0336c4dcb4ff9223f..5ad569e4e238a6600f3d9a19ac21e741fa2ef33a 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h >@@ -55,7 +55,7 @@ public: > > private: > RTCRtpTransceiverDirection direction() const final; >- std::optional<RTCRtpTransceiverDirection> currentDirection() const final; >+ Optional<RTCRtpTransceiverDirection> currentDirection() const final; > void setDirection(RTCRtpTransceiverDirection) final; > String mid() final; > void stop() final; >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp >index 1ac8378eb95ad624a9e1f048607c01be000d9160..2d977e0499609982e0109c95bde9ad7b6d126e89 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp >@@ -278,7 +278,7 @@ static inline void fillRTCIceCandidatePairStats(RTCStatsReport::IceCandidatePair > stats.consentResponsesSent = *rtcStats.responses_sent; > } > >-static inline std::optional<RTCStatsReport::IceCandidateType> iceCandidateState(const std::string& state) >+static inline Optional<RTCStatsReport::IceCandidateType> iceCandidateState(const std::string& state) > { > if (state == "host") > return RTCStatsReport::IceCandidateType::Host; >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentDetailsModifier.h b/Source/WebCore/Modules/paymentrequest/PaymentDetailsModifier.h >index eed9ab4c1a5f9132741744d146289019ebe5cb27..4b61f01efe1896d188863c6bc30010e799cea98b 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentDetailsModifier.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentDetailsModifier.h >@@ -37,7 +37,7 @@ namespace WebCore { > > struct PaymentDetailsModifier { > String supportedMethods; >- std::optional<PaymentItem> total; >+ Optional<PaymentItem> total; > Vector<PaymentItem> additionalDisplayItems; > JSC::Strong<JSC::JSObject> data; > }; >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentHandler.h b/Source/WebCore/Modules/paymentrequest/PaymentHandler.h >index a6f50eac8dcce6bb48d8ff622786ce803f2c0681..91ea35e533537a2d19864394d8d15c1ef33f98e7 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentHandler.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentHandler.h >@@ -54,7 +54,7 @@ public: > virtual void canMakePayment(WTF::Function<void(bool)>&& completionHandler) = 0; > virtual ExceptionOr<void> detailsUpdated(PaymentRequest::UpdateReason, String&& error, AddressErrors&&, PayerErrorFields&&, JSC::JSObject* paymentMethodErrors) = 0; > virtual ExceptionOr<void> merchantValidationCompleted(JSC::JSValue&&) = 0; >- virtual void complete(std::optional<PaymentComplete>&&) = 0; >+ virtual void complete(Optional<PaymentComplete>&&) = 0; > virtual ExceptionOr<void> retry(PaymentValidationErrors&&) = 0; > }; > >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp b/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp >index 970906804d827391b3797a7728d42beb35379d4e..a122bb30395c5e051b1a91924903cc6d42f893fd 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp >+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp >@@ -225,19 +225,19 @@ static bool isValidURLBasedPaymentMethodIdentifier(const URL& url) > > // Implements "validate a payment method identifier" > // https://www.w3.org/TR/payment-method-id/#validity >-std::optional<PaymentRequest::MethodIdentifier> convertAndValidatePaymentMethodIdentifier(const String& identifier) >+Optional<PaymentRequest::MethodIdentifier> convertAndValidatePaymentMethodIdentifier(const String& identifier) > { > URL url { URL(), identifier }; > if (!url.isValid()) { > if (isValidStandardizedPaymentMethodIdentifier(identifier)) > return { identifier }; >- return std::nullopt; >+ return WTF::nullopt; > } > > if (isValidURLBasedPaymentMethodIdentifier(url)) > return { WTFMove(url) }; > >- return std::nullopt; >+ return WTF::nullopt; > } > > enum class ShouldValidatePaymentMethodIdentifier { >@@ -457,13 +457,13 @@ void PaymentRequest::abortWithException(Exception&& exception) > > void PaymentRequest::settleShowPromise(ExceptionOr<PaymentResponse&>&& result) > { >- if (auto showPromise = std::exchange(m_showPromise, std::nullopt)) >+ if (auto showPromise = std::exchange(m_showPromise, WTF::nullopt)) > showPromise->settle(WTFMove(result)); > } > > void PaymentRequest::closeActivePaymentHandler() > { >- if (auto activePaymentHandler = std::exchange(m_activePaymentHandler, std::nullopt)) >+ if (auto activePaymentHandler = std::exchange(m_activePaymentHandler, WTF::nullopt)) > activePaymentHandler->paymentHandler->hide(); > > m_isUpdating = false; >@@ -520,11 +520,11 @@ const String& PaymentRequest::id() const > return m_details.id; > } > >-std::optional<PaymentShippingType> PaymentRequest::shippingType() const >+Optional<PaymentShippingType> PaymentRequest::shippingType() const > { > if (m_options.requestShipping) > return m_options.shippingType; >- return std::nullopt; >+ return WTF::nullopt; > } > > bool PaymentRequest::canSuspendForDocumentSuspension() const >@@ -711,14 +711,14 @@ void PaymentRequest::accept(const String& methodName, PaymentResponse::DetailsFu > m_state = State::Closed; > } > >-ExceptionOr<void> PaymentRequest::complete(std::optional<PaymentComplete>&& result) >+ExceptionOr<void> PaymentRequest::complete(Optional<PaymentComplete>&& result) > { > ASSERT(m_state == State::Closed); > if (!m_activePaymentHandler) > return Exception { AbortError }; > > activePaymentHandler()->complete(WTFMove(result)); >- m_activePaymentHandler = std::nullopt; >+ m_activePaymentHandler = WTF::nullopt; > return { }; > } > >@@ -734,7 +734,7 @@ ExceptionOr<void> PaymentRequest::retry(PaymentValidationErrors&& errors) > > void PaymentRequest::cancel() > { >- m_activePaymentHandler = std::nullopt; >+ m_activePaymentHandler = WTF::nullopt; > > if (m_isUpdating) { > m_isCancelPending = true; >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >index 7eae137ad245828b7dd98804652a5d0915bc4668..b8b2d9d3361f6c8768b794c5d2eaa2974897ed52 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >@@ -66,7 +66,7 @@ public: > const String& id() const; > PaymentAddress* shippingAddress() const { return m_shippingAddress.get(); } > const String& shippingOption() const { return m_shippingOption; } >- std::optional<PaymentShippingType> shippingType() const; >+ Optional<PaymentShippingType> shippingType() const; > > enum class State { > Created, >@@ -93,7 +93,7 @@ public: > ExceptionOr<void> updateWith(UpdateReason, Ref<DOMPromise>&&); > ExceptionOr<void> completeMerchantValidation(Event&, Ref<DOMPromise>&&); > void accept(const String& methodName, PaymentResponse::DetailsFunction&&, Ref<PaymentAddress>&& shippingAddress, const String& payerName, const String& payerEmail, const String& payerPhone); >- ExceptionOr<void> complete(std::optional<PaymentComplete>&&); >+ ExceptionOr<void> complete(Optional<PaymentComplete>&&); > ExceptionOr<void> retry(PaymentValidationErrors&&); > void cancel(); > >@@ -140,8 +140,8 @@ private: > String m_shippingOption; > RefPtr<PaymentAddress> m_shippingAddress; > State m_state { State::Created }; >- std::optional<ShowPromise> m_showPromise; >- std::optional<PaymentHandlerWithPendingActivity> m_activePaymentHandler; >+ Optional<ShowPromise> m_showPromise; >+ Optional<PaymentHandlerWithPendingActivity> m_activePaymentHandler; > RefPtr<DOMPromise> m_detailsPromise; > RefPtr<DOMPromise> m_merchantSessionPromise; > RefPtr<PaymentResponse> m_response; >@@ -149,7 +149,7 @@ private: > bool m_isCancelPending { false }; > }; > >-std::optional<PaymentRequest::MethodIdentifier> convertAndValidatePaymentMethodIdentifier(const String& identifier); >+Optional<PaymentRequest::MethodIdentifier> convertAndValidatePaymentMethodIdentifier(const String& identifier); > > } // namespace WebCore > >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >index dde78efdc6aea29da3ef66fc45b2a101d08d64d4..c915a6e30a087b524d0e3a11d7bdb9c9695daf7b 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >@@ -59,7 +59,7 @@ void PaymentResponse::setDetailsFunction(DetailsFunction&& detailsFunction) > m_cachedDetails = { }; > } > >-void PaymentResponse::complete(std::optional<PaymentComplete>&& result, DOMPromiseDeferred<void>&& promise) >+void PaymentResponse::complete(Optional<PaymentComplete>&& result, DOMPromiseDeferred<void>&& promise) > { > if (m_state == State::Stopped || !m_request) { > promise.reject(Exception { AbortError }); >@@ -117,7 +117,7 @@ void PaymentResponse::settleRetryPromise(ExceptionOr<void>&& result) > > ASSERT(hasPendingActivity()); > ASSERT(m_state == State::Created); >- std::exchange(m_retryPromise, std::nullopt)->settle(WTFMove(result)); >+ std::exchange(m_retryPromise, WTF::nullopt)->settle(WTFMove(result)); > } > > bool PaymentResponse::canSuspendForDocumentSuspension() const >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >index 97eac7fc40a1986265da14b61d23595c66076081..0c98274bd200f0a2f57c240e91f2db131d9ffa69 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >@@ -81,7 +81,7 @@ public: > const String& payerPhone() const { return m_payerPhone; } > void setPayerPhone(const String& payerPhone) { m_payerPhone = payerPhone; } > >- void complete(std::optional<PaymentComplete>&&, DOMPromiseDeferred<void>&&); >+ void complete(Optional<PaymentComplete>&&, DOMPromiseDeferred<void>&&); > void retry(PaymentValidationErrors&&, DOMPromiseDeferred<void>&&); > void abortWithException(Exception&&); > bool hasRetryPromise() const { return !!m_retryPromise; } >@@ -122,7 +122,7 @@ private: > String m_payerEmail; > String m_payerPhone; > State m_state { State::Created }; >- std::optional<DOMPromiseDeferred<void>> m_retryPromise; >+ Optional<DOMPromiseDeferred<void>> m_retryPromise; > RefPtr<PendingActivity<PaymentResponse>> m_pendingActivity; > }; > >diff --git a/Source/WebCore/Modules/streams/ReadableStreamSource.h b/Source/WebCore/Modules/streams/ReadableStreamSource.h >index 3d039113cb93c84c2d6b96bef632876e02b6f60c..f4f02b3aa6c1fb7279e443a7e19ca72337aa522f 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamSource.h >+++ b/Source/WebCore/Modules/streams/ReadableStreamSource.h >@@ -63,8 +63,8 @@ protected: > virtual void doCancel() = 0; > > private: >- std::optional<DOMPromiseDeferred<void>> m_promise; >- std::optional<ReadableStreamDefaultController> m_controller; >+ Optional<DOMPromiseDeferred<void>> m_promise; >+ Optional<ReadableStreamDefaultController> m_controller; > }; > > inline void ReadableStreamSource::start(ReadableStreamDefaultController&& controller, DOMPromiseDeferred<void>&& promise) >@@ -91,14 +91,14 @@ inline void ReadableStreamSource::pull(DOMPromiseDeferred<void>&& promise) > inline void ReadableStreamSource::startFinished() > { > ASSERT(m_promise); >- std::exchange(m_promise, std::nullopt).value().resolve(); >+ std::exchange(m_promise, WTF::nullopt).value().resolve(); > setInactive(); > } > > inline void ReadableStreamSource::pullFinished() > { > ASSERT(m_promise); >- std::exchange(m_promise, std::nullopt).value().resolve(); >+ std::exchange(m_promise, WTF::nullopt).value().resolve(); > setInactive(); > } > >@@ -111,7 +111,7 @@ inline void ReadableStreamSource::cancel(JSC::JSValue) > inline void ReadableStreamSource::clean() > { > if (m_promise) { >- m_promise = std::nullopt; >+ m_promise = WTF::nullopt; > setInactive(); > } > } >diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp >index b02515c24faf919985fa79c124e5ce695904e9a6..b8a74015eb5d3c08dff456ed3b9ac76f3da96ee0 100644 >--- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp >+++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp >@@ -437,7 +437,7 @@ unsigned AudioBufferSourceNode::numberOfChannels() > return output(0)->numberOfChannels(); > } > >-ExceptionOr<void> AudioBufferSourceNode::start(double when, double grainOffset, std::optional<double> optionalGrainDuration) >+ExceptionOr<void> AudioBufferSourceNode::start(double when, double grainOffset, Optional<double> optionalGrainDuration) > { > double grainDuration = 0; > if (optionalGrainDuration) >diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h >index 30b79b79333731821fa257a08d13580fa2590dc7..106b9c99d81d61aee08ea44da5f9e10725a0cc43 100644 >--- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h >+++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h >@@ -56,7 +56,7 @@ public: > unsigned numberOfChannels(); > > // Play-state >- ExceptionOr<void> start(double when, double grainOffset, std::optional<double> grainDuration); >+ ExceptionOr<void> start(double when, double grainOffset, Optional<double> grainDuration); > > // Note: the attribute was originally exposed as .looping, but to be more consistent in naming with <audio> > // and with how it's described in the specification, the proper attribute name is .loop >diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h b/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h >index ba68df92b182c7a9b13a366fa9116082eb465dbe..6f9271a6df391457bb75ae5b7b0ed3ee06b88b36 100644 >--- a/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h >+++ b/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h >@@ -62,16 +62,16 @@ struct PublicKeyCredentialCreationOptions { > int64_t alg; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<Parameters> decode(Decoder&); >+ template<class Decoder> static Optional<Parameters> decode(Decoder&); > }; > > struct AuthenticatorSelectionCriteria { >- std::optional<AuthenticatorAttachment> authenticatorAttachment; >+ Optional<AuthenticatorAttachment> authenticatorAttachment; > bool requireResidentKey { false }; > UserVerificationRequirement userVerification { UserVerificationRequirement::Preferred }; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<AuthenticatorSelectionCriteria> decode(Decoder&); >+ template<class Decoder> static Optional<AuthenticatorSelectionCriteria> decode(Decoder&); > }; > > RpEntity rp; >@@ -80,12 +80,12 @@ struct PublicKeyCredentialCreationOptions { > BufferSource challenge; > Vector<Parameters> pubKeyCredParams; > >- std::optional<unsigned> timeout; >+ Optional<unsigned> timeout; > Vector<PublicKeyCredentialDescriptor> excludeCredentials; >- std::optional<AuthenticatorSelectionCriteria> authenticatorSelection; >+ Optional<AuthenticatorSelectionCriteria> authenticatorSelection; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<PublicKeyCredentialCreationOptions> decode(Decoder&); >+ template<class Decoder> static Optional<PublicKeyCredentialCreationOptions> decode(Decoder&); > }; > > template<class Encoder> >@@ -95,13 +95,13 @@ void PublicKeyCredentialCreationOptions::Parameters::encode(Encoder& encoder) co > } > > template<class Decoder> >-std::optional<PublicKeyCredentialCreationOptions::Parameters> PublicKeyCredentialCreationOptions::Parameters::decode(Decoder& decoder) >+Optional<PublicKeyCredentialCreationOptions::Parameters> PublicKeyCredentialCreationOptions::Parameters::decode(Decoder& decoder) > { > PublicKeyCredentialCreationOptions::Parameters result; > if (!decoder.decodeEnum(result.type)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.alg)) >- return std::nullopt; >+ return WTF::nullopt; > return result; > } > >@@ -112,24 +112,24 @@ void PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode( > } > > template<class Decoder> >-std::optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria> PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode(Decoder& decoder) >+Optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria> PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode(Decoder& decoder) > { > PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria result; > >- std::optional<std::optional<AuthenticatorAttachment>> authenticatorAttachment; >+ Optional<Optional<AuthenticatorAttachment>> authenticatorAttachment; > decoder >> authenticatorAttachment; > if (!authenticatorAttachment) >- return std::nullopt; >+ return WTF::nullopt; > result.authenticatorAttachment = WTFMove(*authenticatorAttachment); > >- std::optional<bool> requireResidentKey; >+ Optional<bool> requireResidentKey; > decoder >> requireResidentKey; > if (!requireResidentKey) >- return std::nullopt; >+ return WTF::nullopt; > result.requireResidentKey = *requireResidentKey; > > if (!decoder.decodeEnum(result.userVerification)) >- return std::nullopt; >+ return WTF::nullopt; > return result; > } > >@@ -144,39 +144,39 @@ void PublicKeyCredentialCreationOptions::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<PublicKeyCredentialCreationOptions> PublicKeyCredentialCreationOptions::decode(Decoder& decoder) >+Optional<PublicKeyCredentialCreationOptions> PublicKeyCredentialCreationOptions::decode(Decoder& decoder) > { > PublicKeyCredentialCreationOptions result; > if (!decoder.decode(result.rp.id)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.rp.name)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.rp.icon)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.user.idVector)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.user.displayName)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.user.name)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.user.icon)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.pubKeyCredParams)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<unsigned>> timeout; >+ Optional<Optional<unsigned>> timeout; > decoder >> timeout; > if (!timeout) >- return std::nullopt; >+ return WTF::nullopt; > result.timeout = WTFMove(*timeout); > > if (!decoder.decode(result.excludeCredentials)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<AuthenticatorSelectionCriteria>> authenticatorSelection; >+ Optional<Optional<AuthenticatorSelectionCriteria>> authenticatorSelection; > decoder >> authenticatorSelection; > if (!authenticatorSelection) >- return std::nullopt; >+ return WTF::nullopt; > result.authenticatorSelection = WTFMove(*authenticatorSelection); > > return result; >diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredentialData.h b/Source/WebCore/Modules/webauthn/PublicKeyCredentialData.h >index 9bbef17b001c4463c25ef2e994e434fefbbd730c..2126cac92c461043603819ba52c70fcbd27b949d 100644 >--- a/Source/WebCore/Modules/webauthn/PublicKeyCredentialData.h >+++ b/Source/WebCore/Modules/webauthn/PublicKeyCredentialData.h >@@ -50,7 +50,7 @@ struct PublicKeyCredentialData { > mutable RefPtr<ArrayBuffer> userHandle; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<PublicKeyCredentialData> decode(Decoder&); >+ template<class Decoder> static Optional<PublicKeyCredentialData> decode(Decoder&); > }; > > // Noted: clientDataJSON is never encoded or decoded as it is never sent across different processes. >@@ -91,78 +91,78 @@ void PublicKeyCredentialData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<PublicKeyCredentialData> PublicKeyCredentialData::decode(Decoder& decoder) >+Optional<PublicKeyCredentialData> PublicKeyCredentialData::decode(Decoder& decoder) > { > PublicKeyCredentialData result; > >- std::optional<bool> isEmpty; >+ Optional<bool> isEmpty; > decoder >> isEmpty; > if (!isEmpty) >- return std::nullopt; >+ return WTF::nullopt; > if (isEmpty.value()) > return result; > >- std::optional<uint64_t> rawIdLength; >+ Optional<uint64_t> rawIdLength; > decoder >> rawIdLength; > if (!rawIdLength) >- return std::nullopt; >+ return WTF::nullopt; > > result.rawId = ArrayBuffer::create(rawIdLength.value(), sizeof(uint8_t)); > if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(result.rawId->data()), rawIdLength.value(), 1)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> isAuthenticatorAttestationResponse; >+ Optional<bool> isAuthenticatorAttestationResponse; > decoder >> isAuthenticatorAttestationResponse; > if (!isAuthenticatorAttestationResponse) >- return std::nullopt; >+ return WTF::nullopt; > result.isAuthenticatorAttestationResponse = isAuthenticatorAttestationResponse.value(); > > if (result.isAuthenticatorAttestationResponse) { >- std::optional<uint64_t> attestationObjectLength; >+ Optional<uint64_t> attestationObjectLength; > decoder >> attestationObjectLength; > if (!attestationObjectLength) >- return std::nullopt; >+ return WTF::nullopt; > > result.attestationObject = ArrayBuffer::create(attestationObjectLength.value(), sizeof(uint8_t)); > if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(result.attestationObject->data()), attestationObjectLength.value(), 1)) >- return std::nullopt; >+ return WTF::nullopt; > > return result; > } > >- std::optional<uint64_t> authenticatorDataLength; >+ Optional<uint64_t> authenticatorDataLength; > decoder >> authenticatorDataLength; > if (!authenticatorDataLength) >- return std::nullopt; >+ return WTF::nullopt; > > result.authenticatorData = ArrayBuffer::create(authenticatorDataLength.value(), sizeof(uint8_t)); > if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(result.authenticatorData->data()), authenticatorDataLength.value(), 1)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> signatureLength; >+ Optional<uint64_t> signatureLength; > decoder >> signatureLength; > if (!signatureLength) >- return std::nullopt; >+ return WTF::nullopt; > > result.signature = ArrayBuffer::create(signatureLength.value(), sizeof(uint8_t)); > if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(result.signature->data()), signatureLength.value(), 1)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> hasUserHandle; >+ Optional<bool> hasUserHandle; > decoder >> hasUserHandle; > if (!hasUserHandle) >- return std::nullopt; >+ return WTF::nullopt; > if (!*hasUserHandle) > return result; > >- std::optional<uint64_t> userHandleLength; >+ Optional<uint64_t> userHandleLength; > decoder >> userHandleLength; > if (!userHandleLength) >- return std::nullopt; >+ return WTF::nullopt; > > result.userHandle = ArrayBuffer::create(userHandleLength.value(), sizeof(uint8_t)); > if (!decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(result.userHandle->data()), userHandleLength.value(), 1)) >- return std::nullopt; >+ return WTF::nullopt; > > return result; > } >diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.h b/Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.h >index 3f7b6b519175086fba226e80cfb55c1ae379e958..226468adaed80d77e1e3bfbe19e5f01d7e7b0499 100644 >--- a/Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.h >+++ b/Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.h >@@ -40,7 +40,7 @@ struct PublicKeyCredentialDescriptor { > Vector<AuthenticatorTransport> transports; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<PublicKeyCredentialDescriptor> decode(Decoder&); >+ template<class Decoder> static Optional<PublicKeyCredentialDescriptor> decode(Decoder&); > }; > > template<class Encoder> >@@ -53,15 +53,15 @@ void PublicKeyCredentialDescriptor::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<PublicKeyCredentialDescriptor> PublicKeyCredentialDescriptor::decode(Decoder& decoder) >+Optional<PublicKeyCredentialDescriptor> PublicKeyCredentialDescriptor::decode(Decoder& decoder) > { > PublicKeyCredentialDescriptor result; > if (!decoder.decodeEnum(result.type)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.idVector)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.transports)) >- return std::nullopt; >+ return WTF::nullopt; > return result; > } > >diff --git a/Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.h b/Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.h >index e2b0e336d5213f99825de6ba009a40f1b35f0a31..6b9cab77d86a68f76fb8ba88e95c0d8321b249cd 100644 >--- a/Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.h >+++ b/Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.h >@@ -36,13 +36,13 @@ namespace WebCore { > > struct PublicKeyCredentialRequestOptions { > BufferSource challenge; >- std::optional<unsigned> timeout; >+ Optional<unsigned> timeout; > mutable String rpId; > Vector<PublicKeyCredentialDescriptor> allowCredentials; > UserVerificationRequirement userVerification { UserVerificationRequirement::Preferred }; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<PublicKeyCredentialRequestOptions> decode(Decoder&); >+ template<class Decoder> static Optional<PublicKeyCredentialRequestOptions> decode(Decoder&); > }; > > // Not every member is encoded. >@@ -53,25 +53,25 @@ void PublicKeyCredentialRequestOptions::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<PublicKeyCredentialRequestOptions> PublicKeyCredentialRequestOptions::decode(Decoder& decoder) >+Optional<PublicKeyCredentialRequestOptions> PublicKeyCredentialRequestOptions::decode(Decoder& decoder) > { > PublicKeyCredentialRequestOptions result; > >- std::optional<std::optional<unsigned>> timeout; >+ Optional<Optional<unsigned>> timeout; > decoder >> timeout; > if (!timeout) >- return std::nullopt; >+ return WTF::nullopt; > result.timeout = WTFMove(*timeout); > > if (!decoder.decode(result.rpId)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.allowCredentials)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<UserVerificationRequirement> userVerification; >+ Optional<UserVerificationRequirement> userVerification; > decoder >> userVerification; > if (!userVerification) >- return std::nullopt; >+ return WTF::nullopt; > result.userVerification = WTFMove(*userVerification); > > return result; >diff --git a/Source/WebCore/Modules/webauthn/cbor/CBORReader.cpp b/Source/WebCore/Modules/webauthn/cbor/CBORReader.cpp >index e9d926a336c34b8ac9d688f3f82b8f18df0282dc..af5b103c6e59be3001ef1b6703f363d016f3e1d1 100644 >--- a/Source/WebCore/Modules/webauthn/cbor/CBORReader.cpp >+++ b/Source/WebCore/Modules/webauthn/cbor/CBORReader.cpp >@@ -80,10 +80,10 @@ CBORReader::~CBORReader() > } > > // static >-std::optional<CBORValue> CBORReader::read(const Bytes& data, DecoderError* errorCodeOut, int maxNestingLevel) >+Optional<CBORValue> CBORReader::read(const Bytes& data, DecoderError* errorCodeOut, int maxNestingLevel) > { > CBORReader reader(data.begin(), data.end()); >- std::optional<CBORValue> decodedCbor = reader.decodeCBOR(maxNestingLevel); >+ Optional<CBORValue> decodedCbor = reader.decodeCBOR(maxNestingLevel); > > if (decodedCbor) > reader.checkExtraneousData(); >@@ -91,20 +91,20 @@ std::optional<CBORValue> CBORReader::read(const Bytes& data, DecoderError* error > *errorCodeOut = reader.getErrorCode(); > > if (reader.getErrorCode() != DecoderError::CBORNoError) >- return std::nullopt; >+ return WTF::nullopt; > return decodedCbor; > } > >-std::optional<CBORValue> CBORReader::decodeCBOR(int maxNestingLevel) >+Optional<CBORValue> CBORReader::decodeCBOR(int maxNestingLevel) > { > if (maxNestingLevel < 0 || maxNestingLevel > kCBORMaxDepth) { > m_errorCode = DecoderError::TooMuchNesting; >- return std::nullopt; >+ return WTF::nullopt; > } > > if (!canConsume(1)) { > m_errorCode = DecoderError::IncompleteCBORData; >- return std::nullopt; >+ return WTF::nullopt; > } > > const uint8_t initialByte = *m_it++; >@@ -113,7 +113,7 @@ std::optional<CBORValue> CBORReader::decodeCBOR(int maxNestingLevel) > > uint64_t value; > if (!readVariadicLengthInteger(additionalInfo, &value)) >- return std::nullopt; >+ return WTF::nullopt; > > switch (major_type) { > case CBORValue::Type::Unsigned: >@@ -135,7 +135,7 @@ std::optional<CBORValue> CBORReader::decodeCBOR(int maxNestingLevel) > } > > m_errorCode = DecoderError::UnsupportedMajorType; >- return std::nullopt; >+ return WTF::nullopt; > } > > bool CBORReader::readVariadicLengthInteger(uint8_t additionalInfo, uint64_t* value) >@@ -174,30 +174,30 @@ bool CBORReader::readVariadicLengthInteger(uint8_t additionalInfo, uint64_t* val > return checkMinimalEncoding(additionalBytes, intData); > } > >-std::optional<CBORValue> CBORReader::decodeValueToNegative(uint64_t value) >+Optional<CBORValue> CBORReader::decodeValueToNegative(uint64_t value) > { > if (value > static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) { > m_errorCode = DecoderError::OutOfRangeIntegerValue; >- return std::nullopt; >+ return WTF::nullopt; > } > return CBORValue(-static_cast<int64_t>(value) - 1); > } > >-std::optional<CBORValue> CBORReader::decodeValueToUnsigned(uint64_t value) >+Optional<CBORValue> CBORReader::decodeValueToUnsigned(uint64_t value) > { > if (value > static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) { > m_errorCode = DecoderError::OutOfRangeIntegerValue; >- return std::nullopt; >+ return WTF::nullopt; > } > return CBORValue(static_cast<int64_t>(value)); > } > >-std::optional<CBORValue> CBORReader::readSimpleValue(uint8_t additionalInfo, uint64_t value) >+Optional<CBORValue> CBORReader::readSimpleValue(uint8_t additionalInfo, uint64_t value) > { > // Floating point numbers are not supported. > if (additionalInfo > 24 && additionalInfo < 28) { > m_errorCode = DecoderError::UnsupportedFloatingPointValue; >- return std::nullopt; >+ return WTF::nullopt; > } > > ASSERT(value <= 255u); >@@ -211,14 +211,14 @@ std::optional<CBORValue> CBORReader::readSimpleValue(uint8_t additionalInfo, uin > } > > m_errorCode = DecoderError::UnsupportedSimpleValue; >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<CBORValue> CBORReader::readString(uint64_t numBytes) >+Optional<CBORValue> CBORReader::readString(uint64_t numBytes) > { > if (!canConsume(numBytes)) { > m_errorCode = DecoderError::IncompleteCBORData; >- return std::nullopt; >+ return WTF::nullopt; > } > > ASSERT(numBytes <= std::numeric_limits<size_t>::max()); >@@ -229,14 +229,14 @@ std::optional<CBORValue> CBORReader::readString(uint64_t numBytes) > // Not to confuse it with an actual empty WTFString. > if (!numBytes || hasValidUTF8Format(cborString)) > return CBORValue(WTFMove(cborString)); >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<CBORValue> CBORReader::readBytes(uint64_t numBytes) >+Optional<CBORValue> CBORReader::readBytes(uint64_t numBytes) > { > if (!canConsume(numBytes)) { > m_errorCode = DecoderError::IncompleteCBORData; >- return std::nullopt; >+ return WTF::nullopt; > } > > Bytes cborByteString; >@@ -247,34 +247,34 @@ std::optional<CBORValue> CBORReader::readBytes(uint64_t numBytes) > return CBORValue(WTFMove(cborByteString)); > } > >-std::optional<CBORValue> CBORReader::readCBORArray(uint64_t length, int maxNestingLevel) >+Optional<CBORValue> CBORReader::readCBORArray(uint64_t length, int maxNestingLevel) > { > CBORValue::ArrayValue cborArray; > while (length-- > 0) { >- std::optional<CBORValue> cborElement = decodeCBOR(maxNestingLevel - 1); >+ Optional<CBORValue> cborElement = decodeCBOR(maxNestingLevel - 1); > if (!cborElement) >- return std::nullopt; >+ return WTF::nullopt; > cborArray.append(WTFMove(cborElement.value())); > } > return CBORValue(WTFMove(cborArray)); > } > >-std::optional<CBORValue> CBORReader::readCBORMap(uint64_t length, int maxNestingLevel) >+Optional<CBORValue> CBORReader::readCBORMap(uint64_t length, int maxNestingLevel) > { > CBORValue::MapValue cborMap; > while (length-- > 0) { >- std::optional<CBORValue> key = decodeCBOR(maxNestingLevel - 1); >- std::optional<CBORValue> value = decodeCBOR(maxNestingLevel - 1); >+ Optional<CBORValue> key = decodeCBOR(maxNestingLevel - 1); >+ Optional<CBORValue> value = decodeCBOR(maxNestingLevel - 1); > if (!key || !value) >- return std::nullopt; >+ return WTF::nullopt; > > // Only CBOR maps with integer or string type keys are allowed. > if (key.value().type() != CBORValue::Type::String && key.value().type() != CBORValue::Type::Unsigned) { > m_errorCode = DecoderError::IncorrectMapKeyType; >- return std::nullopt; >+ return WTF::nullopt; > } > if (!checkDuplicateKey(key.value(), cborMap) || !checkOutOfOrderKey(key.value(), cborMap)) >- return std::nullopt; >+ return WTF::nullopt; > > cborMap.emplace(std::make_pair(WTFMove(key.value()), WTFMove(value.value()))); > } >diff --git a/Source/WebCore/Modules/webauthn/cbor/CBORReader.h b/Source/WebCore/Modules/webauthn/cbor/CBORReader.h >index 16164ded4e45e7bc4b808fdf68ebe8bfcf4775e8..7fbf3359e25839ebb6a23bfd80ba6ede42d19af0 100644 >--- a/Source/WebCore/Modules/webauthn/cbor/CBORReader.h >+++ b/Source/WebCore/Modules/webauthn/cbor/CBORReader.h >@@ -101,22 +101,22 @@ public: > // CBOR data- then an empty optional is returned. Optional |errorCodeOut| > // can be provided by the caller to obtain additional information about > // decoding failures. >- WEBCORE_EXPORT static std::optional<CBORValue> read(const Bytes&, DecoderError* errorCodeOut = nullptr, int maxNestingLevel = kCBORMaxDepth); >+ WEBCORE_EXPORT static Optional<CBORValue> read(const Bytes&, DecoderError* errorCodeOut = nullptr, int maxNestingLevel = kCBORMaxDepth); > > // Translates errors to human-readable error messages. > static const char* errorCodeToString(DecoderError errorCode); > > private: > CBORReader(Bytes::const_iterator, const Bytes::const_iterator); >- std::optional<CBORValue> decodeCBOR(int maxNestingLevel); >- std::optional<CBORValue> decodeValueToNegative(uint64_t value); >- std::optional<CBORValue> decodeValueToUnsigned(uint64_t value); >- std::optional<CBORValue> readSimpleValue(uint8_t additionalInfo, uint64_t value); >+ Optional<CBORValue> decodeCBOR(int maxNestingLevel); >+ Optional<CBORValue> decodeValueToNegative(uint64_t value); >+ Optional<CBORValue> decodeValueToUnsigned(uint64_t value); >+ Optional<CBORValue> readSimpleValue(uint8_t additionalInfo, uint64_t value); > bool readVariadicLengthInteger(uint8_t additionalInfo, uint64_t* value); >- std::optional<CBORValue> readBytes(uint64_t numBytes); >- std::optional<CBORValue> readString(uint64_t numBytes); >- std::optional<CBORValue> readCBORArray(uint64_t length, int maxNestingLevel); >- std::optional<CBORValue> readCBORMap(uint64_t length, int maxNestingLevel); >+ Optional<CBORValue> readBytes(uint64_t numBytes); >+ Optional<CBORValue> readString(uint64_t numBytes); >+ Optional<CBORValue> readCBORArray(uint64_t length, int maxNestingLevel); >+ Optional<CBORValue> readCBORMap(uint64_t length, int maxNestingLevel); > bool canConsume(uint64_t bytes); > void checkExtraneousData(); > bool checkDuplicateKey(const CBORValue& newKey, const CBORValue::MapValue&); >diff --git a/Source/WebCore/Modules/webauthn/cbor/CBORWriter.cpp b/Source/WebCore/Modules/webauthn/cbor/CBORWriter.cpp >index 71f58c026abbdd721a5fa8c624933e9871d89047..769b27271b07def67cbbf0a129ad94c5142a97c8 100644 >--- a/Source/WebCore/Modules/webauthn/cbor/CBORWriter.cpp >+++ b/Source/WebCore/Modules/webauthn/cbor/CBORWriter.cpp >@@ -41,13 +41,13 @@ CBORWriter::~CBORWriter() > } > > // static >-std::optional<Vector<uint8_t>> CBORWriter::write(const CBORValue& node, size_t maxNestingLevel) >+Optional<Vector<uint8_t>> CBORWriter::write(const CBORValue& node, size_t maxNestingLevel) > { > Vector<uint8_t> cbor; > CBORWriter writer(&cbor); > if (writer.encodeCBOR(node, static_cast<int>(maxNestingLevel))) > return cbor; >- return std::nullopt; >+ return WTF::nullopt; > } > > CBORWriter::CBORWriter(Vector<uint8_t>* cbor) >diff --git a/Source/WebCore/Modules/webauthn/cbor/CBORWriter.h b/Source/WebCore/Modules/webauthn/cbor/CBORWriter.h >index 5f946c10055fc55603829e6934c9ba806cc9ee86..b525617686aa95e27c41be51b675be50e96c02d9 100644 >--- a/Source/WebCore/Modules/webauthn/cbor/CBORWriter.h >+++ b/Source/WebCore/Modules/webauthn/cbor/CBORWriter.h >@@ -87,7 +87,7 @@ public: > // arrays/maps that has to be traversed to reach the most nested CBORValue > // contained in |node|. Primitive values and empty containers have nesting > // depths of 0. >- WEBCORE_EXPORT static std::optional<Vector<uint8_t>> write(const CBORValue&, size_t maxNestingLevel = kDefaultMaxNestingDepth); >+ WEBCORE_EXPORT static Optional<Vector<uint8_t>> write(const CBORValue&, size_t maxNestingLevel = kDefaultMaxNestingDepth); > > private: > explicit CBORWriter(Vector<uint8_t>*); >diff --git a/Source/WebCore/Modules/webauthn/fido/AuthenticatorGetInfoResponse.h b/Source/WebCore/Modules/webauthn/fido/AuthenticatorGetInfoResponse.h >index c063c4f5c935f973dc11540203597c5856c34afe..00e5575423c5b979b51848b249ce483cb732dfac 100644 >--- a/Source/WebCore/Modules/webauthn/fido/AuthenticatorGetInfoResponse.h >+++ b/Source/WebCore/Modules/webauthn/fido/AuthenticatorGetInfoResponse.h >@@ -55,17 +55,17 @@ public: > > const StdSet<ProtocolVersion>& versions() const { return m_versions; } > const Vector<uint8_t>& aaguid() const { return m_aaguid; } >- const std::optional<uint32_t>& maxMsgSize() const { return m_maxMsgSize; } >- const std::optional<Vector<uint8_t>>& pinProtocol() const { return m_pinProtocols; } >- const std::optional<Vector<String>>& extensions() const { return m_extensions; } >+ const Optional<uint32_t>& maxMsgSize() const { return m_maxMsgSize; } >+ const Optional<Vector<uint8_t>>& pinProtocol() const { return m_pinProtocols; } >+ const Optional<Vector<String>>& extensions() const { return m_extensions; } > const AuthenticatorSupportedOptions& options() const { return m_options; } > > private: > StdSet<ProtocolVersion> m_versions; > Vector<uint8_t> m_aaguid; >- std::optional<uint32_t> m_maxMsgSize; >- std::optional<Vector<uint8_t>> m_pinProtocols; >- std::optional<Vector<String>> m_extensions; >+ Optional<uint32_t> m_maxMsgSize; >+ Optional<Vector<uint8_t>> m_pinProtocols; >+ Optional<Vector<String>> m_extensions; > AuthenticatorSupportedOptions m_options; > }; > >diff --git a/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.cpp b/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.cpp >index 80cf6de712c20abed8542fab15c6f631ae9a7d6f..a404a120ce46121394c7247e30e910f4ee3d3fda 100644 >--- a/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.cpp >+++ b/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.cpp >@@ -83,35 +83,35 @@ static Vector<uint8_t> getCredentialId(const Vector<uint8_t>& authenticatorData) > > // Decodes byte array response from authenticator to CBOR value object and > // checks for correct encoding format. >-std::optional<PublicKeyCredentialData> readCTAPMakeCredentialResponse(const Vector<uint8_t>& inBuffer) >+Optional<PublicKeyCredentialData> readCTAPMakeCredentialResponse(const Vector<uint8_t>& inBuffer) > { > if (inBuffer.size() <= kResponseCodeLength) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<uint8_t> buffer; > buffer.append(inBuffer.data() + 1, inBuffer.size() - 1); >- std::optional<CBOR> decodedResponse = cbor::CBORReader::read(buffer); >+ Optional<CBOR> decodedResponse = cbor::CBORReader::read(buffer); > if (!decodedResponse || !decodedResponse->isMap()) >- return std::nullopt; >+ return WTF::nullopt; > const auto& decodedMap = decodedResponse->getMap(); > > auto it = decodedMap.find(CBOR(1)); > if (it == decodedMap.end() || !it->second.isString()) >- return std::nullopt; >+ return WTF::nullopt; > auto format = it->second.clone(); > > it = decodedMap.find(CBOR(2)); > if (it == decodedMap.end() || !it->second.isByteString()) >- return std::nullopt; >+ return WTF::nullopt; > auto authenticatorData = it->second.clone(); > > auto credentialId = getCredentialId(authenticatorData.getByteString()); > if (credentialId.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > it = decodedMap.find(CBOR(3)); > if (it == decodedMap.end() || !it->second.isMap()) >- return std::nullopt; >+ return WTF::nullopt; > auto attStmt = it->second.clone(); > > CBOR::MapValue attestationObjectMap; >@@ -123,17 +123,17 @@ std::optional<PublicKeyCredentialData> readCTAPMakeCredentialResponse(const Vect > return PublicKeyCredentialData { ArrayBuffer::create(credentialId.data(), credentialId.size()), true, nullptr, ArrayBuffer::create(attestationObject.value().data(), attestationObject.value().size()), nullptr, nullptr, nullptr }; > } > >-std::optional<PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector<uint8_t>& inBuffer) >+Optional<PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector<uint8_t>& inBuffer) > { > if (inBuffer.size() <= kResponseCodeLength) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<uint8_t> buffer; > buffer.append(inBuffer.data() + 1, inBuffer.size() - 1); >- std::optional<CBOR> decodedResponse = cbor::CBORReader::read(buffer); >+ Optional<CBOR> decodedResponse = cbor::CBORReader::read(buffer); > > if (!decodedResponse || !decodedResponse->isMap()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& responseMap = decodedResponse->getMap(); > >@@ -143,19 +143,19 @@ std::optional<PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector > auto& credential = it->second.getMap(); > auto itr = credential.find(CBOR(kCredentialIdKey)); > if (itr == credential.end() || !itr->second.isByteString()) >- return std::nullopt; >+ return WTF::nullopt; > auto& id = itr->second.getByteString(); > credentialId = ArrayBuffer::create(id.data(), id.size()); > } > > it = responseMap.find(CBOR(2)); > if (it == responseMap.end() || !it->second.isByteString()) >- return std::nullopt; >+ return WTF::nullopt; > auto& authData = it->second.getByteString(); > > it = responseMap.find(CBOR(3)); > if (it == responseMap.end() || !it->second.isByteString()) >- return std::nullopt; >+ return WTF::nullopt; > auto& signature = it->second.getByteString(); > > RefPtr<ArrayBuffer> userHandle; >@@ -164,7 +164,7 @@ std::optional<PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector > auto& user = it->second.getMap(); > auto itr = user.find(CBOR(kEntityIdMapKey)); > if (itr == user.end() || !itr->second.isByteString()) >- return std::nullopt; >+ return WTF::nullopt; > auto& id = itr->second.getByteString(); > userHandle = ArrayBuffer::create(id.data(), id.size()); > } >@@ -172,25 +172,25 @@ std::optional<PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector > return PublicKeyCredentialData { WTFMove(credentialId), false, nullptr, nullptr, ArrayBuffer::create(authData.data(), authData.size()), ArrayBuffer::create(signature.data(), signature.size()), WTFMove(userHandle) }; > } > >-std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector<uint8_t>& inBuffer) >+Optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector<uint8_t>& inBuffer) > { > if (inBuffer.size() <= kResponseCodeLength || getResponseCode(inBuffer) != CtapDeviceResponseCode::kSuccess) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<uint8_t> buffer; > buffer.append(inBuffer.data() + 1, inBuffer.size() - 1); >- std::optional<CBOR> decodedResponse = cbor::CBORReader::read(buffer); >+ Optional<CBOR> decodedResponse = cbor::CBORReader::read(buffer); > if (!decodedResponse || !decodedResponse->isMap()) >- return std::nullopt; >+ return WTF::nullopt; > const auto& responseMap = decodedResponse->getMap(); > > auto it = responseMap.find(CBOR(1)); > if (it == responseMap.end() || !it->second.isArray() || it->second.getArray().size() > 2) >- return std::nullopt; >+ return WTF::nullopt; > StdSet<ProtocolVersion> protocolVersions; > for (const auto& version : it->second.getArray()) { > if (!version.isString()) >- return std::nullopt; >+ return WTF::nullopt; > > auto protocol = convertStringToProtocolVersion(version.getString()); > if (protocol == ProtocolVersion::kUnknown) { >@@ -199,26 +199,26 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > } > > if (!protocolVersions.insert(protocol).second) >- return std::nullopt; >+ return WTF::nullopt; > } > if (protocolVersions.empty()) >- return std::nullopt; >+ return WTF::nullopt; > > it = responseMap.find(CBOR(3)); > if (it == responseMap.end() || !it->second.isByteString() || it->second.getByteString().size() != kAaguidLength) >- return std::nullopt; >+ return WTF::nullopt; > > AuthenticatorGetInfoResponse response(WTFMove(protocolVersions), Vector<uint8_t>(it->second.getByteString())); > > it = responseMap.find(CBOR(2)); > if (it != responseMap.end()) { > if (!it->second.isArray()) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<String> extensions; > for (const auto& extension : it->second.getArray()) { > if (!extension.isString()) >- return std::nullopt; >+ return WTF::nullopt; > > extensions.append(extension.getString()); > } >@@ -229,12 +229,12 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > it = responseMap.find(CBOR(4)); > if (it != responseMap.end()) { > if (!it->second.isMap()) >- return std::nullopt; >+ return WTF::nullopt; > const auto& optionMap = it->second.getMap(); > auto optionMapIt = optionMap.find(CBOR(kPlatformDeviceMapKey)); > if (optionMapIt != optionMap.end()) { > if (!optionMapIt->second.isBool()) >- return std::nullopt; >+ return WTF::nullopt; > > options.setIsPlatformDevice(optionMapIt->second.getBool()); > } >@@ -242,7 +242,7 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > optionMapIt = optionMap.find(CBOR(kResidentKeyMapKey)); > if (optionMapIt != optionMap.end()) { > if (!optionMapIt->second.isBool()) >- return std::nullopt; >+ return WTF::nullopt; > > options.setSupportsResidentKey(optionMapIt->second.getBool()); > } >@@ -250,7 +250,7 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > optionMapIt = optionMap.find(CBOR(kUserPresenceMapKey)); > if (optionMapIt != optionMap.end()) { > if (!optionMapIt->second.isBool()) >- return std::nullopt; >+ return WTF::nullopt; > > options.setUserPresenceRequired(optionMapIt->second.getBool()); > } >@@ -258,7 +258,7 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > optionMapIt = optionMap.find(CBOR(kUserVerificationMapKey)); > if (optionMapIt != optionMap.end()) { > if (!optionMapIt->second.isBool()) >- return std::nullopt; >+ return WTF::nullopt; > > if (optionMapIt->second.getBool()) > options.setUserVerificationAvailability(AuthenticatorSupportedOptions::UserVerificationAvailability::kSupportedAndConfigured); >@@ -269,7 +269,7 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > optionMapIt = optionMap.find(CBOR(kClientPinMapKey)); > if (optionMapIt != optionMap.end()) { > if (!optionMapIt->second.isBool()) >- return std::nullopt; >+ return WTF::nullopt; > > if (optionMapIt->second.getBool()) > options.setClientPinAvailability(AuthenticatorSupportedOptions::ClientPinAvailability::kSupportedAndPinSet); >@@ -282,7 +282,7 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > it = responseMap.find(CBOR(5)); > if (it != responseMap.end()) { > if (!it->second.isUnsigned()) >- return std::nullopt; >+ return WTF::nullopt; > > response.setMaxMsgSize(it->second.getUnsigned()); > } >@@ -290,12 +290,12 @@ std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector > it = responseMap.find(CBOR(6)); > if (it != responseMap.end()) { > if (!it->second.isArray()) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<uint8_t> supportedPinProtocols; > for (const auto& protocol : it->second.getArray()) { > if (!protocol.isUnsigned()) >- return std::nullopt; >+ return WTF::nullopt; > > supportedPinProtocols.append(protocol.getUnsigned()); > } >diff --git a/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.h b/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.h >index 819633545cde25c0dbdc4c63da5f1b166e237493..affb54c79e453df18cd7dec77ea70c96bf3f2d1c 100644 >--- a/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.h >+++ b/Source/WebCore/Modules/webauthn/fido/DeviceResponseConverter.h >@@ -48,18 +48,18 @@ WEBCORE_EXPORT CtapDeviceResponseCode getResponseCode(const Vector<uint8_t>&); > // and converts response to AuthenticatorMakeCredentialResponse object with > // CBOR map keys that conform to format of attestation object defined by the > // WebAuthN spec : https://w3c.github.io/webauthn/#fig-attStructs >-WEBCORE_EXPORT std::optional<WebCore::PublicKeyCredentialData> readCTAPMakeCredentialResponse(const Vector<uint8_t>&); >+WEBCORE_EXPORT Optional<WebCore::PublicKeyCredentialData> readCTAPMakeCredentialResponse(const Vector<uint8_t>&); > > // De-serializes CBOR encoded response to AuthenticatorGetAssertion / > // AuthenticatorGetNextAssertion request to AuthenticatorGetAssertionResponse > // object. > // FIXME(190783): Probably need to remake AuthenticatorResponse to include more fields like numberOfCredentials, > // and use it here instead of PublicKeyCredentialData. >-WEBCORE_EXPORT std::optional<WebCore::PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector<uint8_t>&); >+WEBCORE_EXPORT Optional<WebCore::PublicKeyCredentialData> readCTAPGetAssertionResponse(const Vector<uint8_t>&); > > // De-serializes CBOR encoded response to AuthenticatorGetInfo request to > // AuthenticatorGetInfoResponse object. >-WEBCORE_EXPORT std::optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector<uint8_t>&); >+WEBCORE_EXPORT Optional<AuthenticatorGetInfoResponse> readCTAPGetInfoResponse(const Vector<uint8_t>&); > > } // namespace fido > >diff --git a/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.cpp b/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.cpp >index 395e5eced8849f2b6c3a3829a260a97a0c6e01ec..c715a394964548a45629a4e6338221f0c733d46d 100644 >--- a/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.cpp >+++ b/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.cpp >@@ -37,10 +37,10 @@ > namespace fido { > > // static >-std::optional<FidoHidMessage> FidoHidMessage::create(uint32_t channelId, FidoHidDeviceCommand type, const Vector<uint8_t>& data) >+Optional<FidoHidMessage> FidoHidMessage::create(uint32_t channelId, FidoHidDeviceCommand type, const Vector<uint8_t>& data) > { > if (data.size() > kHidMaxMessageSize) >- return std::nullopt; >+ return WTF::nullopt; > > switch (type) { > case FidoHidDeviceCommand::kPing: >@@ -48,46 +48,46 @@ std::optional<FidoHidMessage> FidoHidMessage::create(uint32_t channelId, FidoHid > case FidoHidDeviceCommand::kMsg: > case FidoHidDeviceCommand::kCbor: { > if (data.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > > case FidoHidDeviceCommand::kCancel: > case FidoHidDeviceCommand::kWink: { > if (!data.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > case FidoHidDeviceCommand::kLock: { > if (data.size() != 1 || data[0] > kHidMaxLockSeconds) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > case FidoHidDeviceCommand::kInit: { > if (data.size() != 8) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > case FidoHidDeviceCommand::kKeepAlive: > case FidoHidDeviceCommand::kError: > if (data.size() != 1) >- return std::nullopt; >+ return WTF::nullopt; > } > > return FidoHidMessage(channelId, type, data); > } > > // static >-std::optional<FidoHidMessage> FidoHidMessage::createFromSerializedData(const Vector<uint8_t>& serializedData) >+Optional<FidoHidMessage> FidoHidMessage::createFromSerializedData(const Vector<uint8_t>& serializedData) > { > size_t remainingSize = 0; > if (serializedData.size() > kHidPacketSize || serializedData.size() < kHidInitPacketHeaderSize) >- return std::nullopt; >+ return WTF::nullopt; > > auto initPacket = FidoHidInitPacket::createFromSerializedData(serializedData, &remainingSize); > > if (!initPacket) >- return std::nullopt; >+ return WTF::nullopt; > > return FidoHidMessage(WTFMove(initPacket), remainingSize); > } >diff --git a/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.h b/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.h >index 0d9d3fc93ba8d0b67a783d7e912e9de29bbee8c3..595f6029fc17eac1be6fbea9fab640b530ca3aa5 100644 >--- a/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.h >+++ b/Source/WebCore/Modules/webauthn/fido/FidoHidMessage.h >@@ -45,10 +45,10 @@ class WEBCORE_EXPORT FidoHidMessage { > WTF_MAKE_NONCOPYABLE(FidoHidMessage); > public: > // Static functions to create CTAP/U2F HID commands. >- static std::optional<FidoHidMessage> create(uint32_t channelId, FidoHidDeviceCommand, const Vector<uint8_t>& data); >+ static Optional<FidoHidMessage> create(uint32_t channelId, FidoHidDeviceCommand, const Vector<uint8_t>& data); > > // Reconstruct a message from serialized message data. >- static std::optional<FidoHidMessage> createFromSerializedData(const Vector<uint8_t>&); >+ static Optional<FidoHidMessage> createFromSerializedData(const Vector<uint8_t>&); > > FidoHidMessage(FidoHidMessage&& that) = default; > FidoHidMessage& operator=(FidoHidMessage&& other) = default; >diff --git a/Source/WebCore/Modules/webdatabase/Database.cpp b/Source/WebCore/Modules/webdatabase/Database.cpp >index 873143c7c4396bce678497b7d19fbd5f9bf9a5ac..7a53fec4998046ae16fb88886bd50ef205c84e6a 100644 >--- a/Source/WebCore/Modules/webdatabase/Database.cpp >+++ b/Source/WebCore/Modules/webdatabase/Database.cpp >@@ -638,7 +638,7 @@ String Database::fileName() const > DatabaseDetails Database::details() const > { > // This code path is only used for database quota delegate calls, so file dates are irrelevant and left uninitialized. >- return DatabaseDetails(stringIdentifier(), displayName(), estimatedSize(), 0, std::nullopt, std::nullopt); >+ return DatabaseDetails(stringIdentifier(), displayName(), estimatedSize(), 0, WTF::nullopt, WTF::nullopt); > } > > void Database::disableAuthorizer() >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseDetails.h b/Source/WebCore/Modules/webdatabase/DatabaseDetails.h >index 670210240b2a868c627eb510defc72a8804d9527..0f7f915893efe8a77b6fb5ca6cddac854a2c7769 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseDetails.h >+++ b/Source/WebCore/Modules/webdatabase/DatabaseDetails.h >@@ -66,7 +66,7 @@ public: > return *this; > } > >- DatabaseDetails(const String& databaseName, const String& displayName, unsigned long long expectedUsage, unsigned long long currentUsage, std::optional<WallTime> creationTime, std::optional<WallTime> modificationTime) >+ DatabaseDetails(const String& databaseName, const String& displayName, unsigned long long expectedUsage, unsigned long long currentUsage, Optional<WallTime> creationTime, Optional<WallTime> modificationTime) > : m_name(databaseName) > , m_displayName(displayName) > , m_expectedUsage(expectedUsage) >@@ -80,8 +80,8 @@ public: > const String& displayName() const { return m_displayName; } > uint64_t expectedUsage() const { return m_expectedUsage; } > uint64_t currentUsage() const { return m_currentUsage; } >- std::optional<WallTime> creationTime() const { return m_creationTime; } >- std::optional<WallTime> modificationTime() const { return m_modificationTime; } >+ Optional<WallTime> creationTime() const { return m_creationTime; } >+ Optional<WallTime> modificationTime() const { return m_modificationTime; } > #ifndef NDEBUG > Thread& thread() const { return m_thread.get(); } > #endif >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp b/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp >index 23c3c3034fd6ac81b51a427869db3fdd7682afe5..356f07fefd4b956a229b789b36c96504f60b1e99 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp >+++ b/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp >@@ -59,7 +59,7 @@ private: > DatabaseManager::ProposedDatabase::ProposedDatabase(DatabaseManager& manager, SecurityOrigin& origin, const String& name, const String& displayName, unsigned long estimatedSize) > : m_manager(manager) > , m_origin(origin.isolatedCopy()) >- , m_details(name.isolatedCopy(), displayName.isolatedCopy(), estimatedSize, 0, std::nullopt, std::nullopt) >+ , m_details(name.isolatedCopy(), displayName.isolatedCopy(), estimatedSize, 0, WTF::nullopt, WTF::nullopt) > { > m_manager.addProposedDatabase(*this); > } >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp b/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp >index 9f5b5ae18c73947da97e3b2d6ad401d96e0d54ab..d96541ed49f693824ed1dfc525088dac32bc59c5 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp >+++ b/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp >@@ -472,7 +472,7 @@ DatabaseDetails DatabaseTracker::detailsForNameAndOrigin(const String& name, con > > String path = fullPathForDatabase(origin, name, false); > if (path.isEmpty()) >- return DatabaseDetails(name, displayName, expectedUsage, 0, std::nullopt, std::nullopt); >+ return DatabaseDetails(name, displayName, expectedUsage, 0, WTF::nullopt, WTF::nullopt); > return DatabaseDetails(name, displayName, expectedUsage, SQLiteFileSystem::getDatabaseFileSize(path), SQLiteFileSystem::databaseCreationTime(path), SQLiteFileSystem::databaseModificationTime(path)); > } > >diff --git a/Source/WebCore/Modules/webdatabase/SQLResultSet.h b/Source/WebCore/Modules/webdatabase/SQLResultSet.h >index e2283999fa89a3c6ff716c14c5894f538fd84547..d716fbf0157eff8e18dcd6cfbbabf62bbafe8bee 100644 >--- a/Source/WebCore/Modules/webdatabase/SQLResultSet.h >+++ b/Source/WebCore/Modules/webdatabase/SQLResultSet.h >@@ -50,7 +50,7 @@ private: > SQLResultSet(); > > Ref<SQLResultSetRowList> m_rows; >- std::optional<int64_t> m_insertId; >+ Optional<int64_t> m_insertId; > int m_rowsAffected { 0 }; > }; > >diff --git a/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp b/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp >index b5ddd563aac77193c61178ecec0f24bfe4edd87b..197798067dbbd8d4d97dfc85eb1650d523c837ec 100644 >--- a/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp >+++ b/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp >@@ -70,7 +70,7 @@ SQLTransaction::SQLTransaction(Ref<Database>&& database, RefPtr<SQLTransactionCa > > SQLTransaction::~SQLTransaction() = default; > >-ExceptionOr<void> SQLTransaction::executeSql(const String& sqlStatement, std::optional<Vector<SQLValue>>&& arguments, RefPtr<SQLStatementCallback>&& callback, RefPtr<SQLStatementErrorCallback>&& callbackError) >+ExceptionOr<void> SQLTransaction::executeSql(const String& sqlStatement, Optional<Vector<SQLValue>>&& arguments, RefPtr<SQLStatementCallback>&& callback, RefPtr<SQLStatementErrorCallback>&& callbackError) > { > if (!m_executeSqlAllowed || !m_database->opened()) > return Exception { InvalidStateError }; >diff --git a/Source/WebCore/Modules/webdatabase/SQLTransaction.h b/Source/WebCore/Modules/webdatabase/SQLTransaction.h >index fd23d8732b538a54d6b8ebe98ee52101a6468711..dd5807fdc27f083d92e58454cfeaab6eff29dcd9 100644 >--- a/Source/WebCore/Modules/webdatabase/SQLTransaction.h >+++ b/Source/WebCore/Modules/webdatabase/SQLTransaction.h >@@ -62,7 +62,7 @@ public: > static Ref<SQLTransaction> create(Ref<Database>&&, RefPtr<SQLTransactionCallback>&&, RefPtr<VoidCallback>&& successCallback, RefPtr<SQLTransactionErrorCallback>&&, RefPtr<SQLTransactionWrapper>&&, bool readOnly); > ~SQLTransaction(); > >- ExceptionOr<void> executeSql(const String& sqlStatement, std::optional<Vector<SQLValue>>&& arguments, RefPtr<SQLStatementCallback>&&, RefPtr<SQLStatementErrorCallback>&&); >+ ExceptionOr<void> executeSql(const String& sqlStatement, Optional<Vector<SQLValue>>&& arguments, RefPtr<SQLStatementCallback>&&, RefPtr<SQLStatementErrorCallback>&&); > > void lockAcquired(); > void performNextStep(); >diff --git a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >index 77ba4cbc08f96b1e322c69d487f705941286c438..37e808623a3c1b2c1452fe09dccf3a5698a31a32 100644 >--- a/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >+++ b/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp >@@ -71,10 +71,10 @@ RefPtr<WebGPUShaderModule> WebGPUDevice::createShaderModule(WebGPUShaderModuleDe > return module ? WebGPUShaderModule::create(module.releaseNonNull()) : nullptr; > } > >-static std::optional<GPUPipelineStageDescriptor> validateAndConvertPipelineStage(const WebGPUPipelineStageDescriptor& descriptor) >+static Optional<GPUPipelineStageDescriptor> validateAndConvertPipelineStage(const WebGPUPipelineStageDescriptor& descriptor) > { > if (!descriptor.module || !descriptor.module->module() || descriptor.entryPoint.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > return GPUPipelineStageDescriptor { descriptor.module->module(), descriptor.entryPoint }; > } >diff --git a/Source/WebCore/Modules/websockets/WebSocket.cpp b/Source/WebCore/Modules/websockets/WebSocket.cpp >index 58536213b5c7ab639d55e6c70f71d16996a0cdd7..26d38ff1b6d23126c8dd76eb7d56aa55441f8e30 100644 >--- a/Source/WebCore/Modules/websockets/WebSocket.cpp >+++ b/Source/WebCore/Modules/websockets/WebSocket.cpp >@@ -389,7 +389,7 @@ ExceptionOr<void> WebSocket::send(Blob& binaryData) > return { }; > } > >-ExceptionOr<void> WebSocket::close(std::optional<unsigned short> optionalCode, const String& reason) >+ExceptionOr<void> WebSocket::close(Optional<unsigned short> optionalCode, const String& reason) > { > int code = optionalCode ? optionalCode.value() : static_cast<int>(WebSocketChannel::CloseEventCodeNotSpecified); > if (code == WebSocketChannel::CloseEventCodeNotSpecified) >diff --git a/Source/WebCore/Modules/websockets/WebSocket.h b/Source/WebCore/Modules/websockets/WebSocket.h >index 5043c494235d07085506aabdce3bc4d0b84bbc1b..ca6790c304f959f12d33a230f36f90d12b2cba75 100644 >--- a/Source/WebCore/Modules/websockets/WebSocket.h >+++ b/Source/WebCore/Modules/websockets/WebSocket.h >@@ -78,7 +78,7 @@ public: > ExceptionOr<void> send(JSC::ArrayBufferView&); > ExceptionOr<void> send(Blob&); > >- ExceptionOr<void> close(std::optional<unsigned short> code, const String& reason); >+ ExceptionOr<void> close(Optional<unsigned short> code, const String& reason); > > RefPtr<ThreadableWebSocketChannel> channel() const; > >diff --git a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >index 1b19edab4c9a6f3812f7130b76a6b9537c5c75e6..57ec8c9e923e4f0671021c2954b17342ecd9ead0 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >+++ b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >@@ -264,10 +264,10 @@ ResourceRequest WebSocketHandshake::clientHandshakeRequest() const > return request; > } > >-std::optional<CookieRequestHeaderFieldProxy> WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy() const >+Optional<CookieRequestHeaderFieldProxy> WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy() const > { > if (!m_document || !m_allowCookies) >- return std::nullopt; >+ return WTF::nullopt; > return cookieRequestHeaderFieldProxy(*m_document, httpURLForAuthenticationAndCookies()); > } > >diff --git a/Source/WebCore/Modules/websockets/WebSocketHandshake.h b/Source/WebCore/Modules/websockets/WebSocketHandshake.h >index e96f8602a87a935269696765c80e7302cf737eb0..129f5b4ee0985d74b68d6385bcc19d13b3559291 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketHandshake.h >+++ b/Source/WebCore/Modules/websockets/WebSocketHandshake.h >@@ -66,7 +66,7 @@ public: > > CString clientHandshakeMessage() const; > ResourceRequest clientHandshakeRequest() const; >- std::optional<CookieRequestHeaderFieldProxy> clientHandshakeCookieRequestHeaderFieldProxy() const; >+ Optional<CookieRequestHeaderFieldProxy> clientHandshakeCookieRequestHeaderFieldProxy() const; > > void reset(); > void clearDocument(); >diff --git a/Source/WebCore/Modules/webvr/NavigatorWebVR.cpp b/Source/WebCore/Modules/webvr/NavigatorWebVR.cpp >index a611f4320374fd9a0709d4425b44b204982858b3..d97b5c2a85a9d2328f9840f44d3d1e9632c82d9e 100644 >--- a/Source/WebCore/Modules/webvr/NavigatorWebVR.cpp >+++ b/Source/WebCore/Modules/webvr/NavigatorWebVR.cpp >@@ -48,7 +48,7 @@ void NavigatorWebVR::getVRDisplays(Navigator& navigator, Document& document, Get > void NavigatorWebVR::getVRDisplays(Document& document, GetVRDisplaysPromise&& promise) > { > document.postTask([this, promise = WTFMove(promise)] (ScriptExecutionContext& context) mutable { >- std::optional<VRManager::VRDisplaysVector> platformDisplays = VRManager::singleton().getVRDisplays(); >+ Optional<VRManager::VRDisplaysVector> platformDisplays = VRManager::singleton().getVRDisplays(); > if (!platformDisplays) { > promise.reject(); > m_displays.clear(); >diff --git a/Source/WebCore/Modules/webvr/VRDisplay.cpp b/Source/WebCore/Modules/webvr/VRDisplay.cpp >index a933d980fcf5a99174ab0e0c40020916cbf1b366..4af23b512b17bb8a85b953f1f03b64dbd1c299f4 100644 >--- a/Source/WebCore/Modules/webvr/VRDisplay.cpp >+++ b/Source/WebCore/Modules/webvr/VRDisplay.cpp >@@ -180,7 +180,7 @@ void VRDisplay::requestPresent(const Vector<VRLayerInit>& layers, Ref<DeferredPr > > void VRDisplay::stopPresenting() > { >- m_presentingLayer = std::nullopt; >+ m_presentingLayer = WTF::nullopt; > } > > void VRDisplay::exitPresent(Ref<DeferredPromise>&& promise) >@@ -207,12 +207,12 @@ void VRDisplay::submitFrame() > > void VRDisplay::platformDisplayConnected() > { >- document()->domWindow()->dispatchEvent(VRDisplayEvent::create(eventNames().vrdisplayconnectEvent, makeRefPtr(this), std::nullopt)); >+ document()->domWindow()->dispatchEvent(VRDisplayEvent::create(eventNames().vrdisplayconnectEvent, makeRefPtr(this), WTF::nullopt)); > } > > void VRDisplay::platformDisplayDisconnected() > { >- document()->domWindow()->dispatchEvent(VRDisplayEvent::create(eventNames().vrdisplaydisconnectEvent, makeRefPtr(this), std::nullopt)); >+ document()->domWindow()->dispatchEvent(VRDisplayEvent::create(eventNames().vrdisplaydisconnectEvent, makeRefPtr(this), WTF::nullopt)); > } > > void VRDisplay::platformDisplayMounted() >diff --git a/Source/WebCore/Modules/webvr/VRDisplay.h b/Source/WebCore/Modules/webvr/VRDisplay.h >index 2f8ea8c267a06e7ee9c99db7e4eccc6d5ea62c6c..ef82619fb9d5bc8ecd039327f4849fd0621c5ce7 100644 >--- a/Source/WebCore/Modules/webvr/VRDisplay.h >+++ b/Source/WebCore/Modules/webvr/VRDisplay.h >@@ -127,7 +127,7 @@ private: > > RefPtr<ScriptedAnimationController> m_scriptedAnimationController; > >- std::optional<VRLayerInit> m_presentingLayer; >+ Optional<VRLayerInit> m_presentingLayer; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/webvr/VRDisplayEvent.cpp b/Source/WebCore/Modules/webvr/VRDisplayEvent.cpp >index 0aa8ea1173a7a3de5f7f6ce85c88cffe61453e63..9b74c184c330d957641ea6cc2ffed9d40ae9b14f 100644 >--- a/Source/WebCore/Modules/webvr/VRDisplayEvent.cpp >+++ b/Source/WebCore/Modules/webvr/VRDisplayEvent.cpp >@@ -36,7 +36,7 @@ VRDisplayEvent::VRDisplayEvent(const AtomicString& type, const Init& initializer > { > } > >-VRDisplayEvent::VRDisplayEvent(const AtomicString& name, const RefPtr<VRDisplay>& display, std::optional<VRDisplayEventReason>&& reason) >+VRDisplayEvent::VRDisplayEvent(const AtomicString& name, const RefPtr<VRDisplay>& display, Optional<VRDisplayEventReason>&& reason) > : Event(name, CanBubble::No, IsCancelable::No) > , m_display(display) > , m_reason(WTFMove(reason)) >diff --git a/Source/WebCore/Modules/webvr/VRDisplayEvent.h b/Source/WebCore/Modules/webvr/VRDisplayEvent.h >index dae7a6d1d25d51282ddebb62b26e5a6040ecce3a..21ccb889be37267ca6b866920a13fcbc5697dacb 100644 >--- a/Source/WebCore/Modules/webvr/VRDisplayEvent.h >+++ b/Source/WebCore/Modules/webvr/VRDisplayEvent.h >@@ -32,14 +32,14 @@ namespace WebCore { > > class VRDisplayEvent final : public Event { > public: >- static Ref<VRDisplayEvent> create(const AtomicString& type, const RefPtr<VRDisplay>& display, std::optional<VRDisplayEventReason>&& reason) >+ static Ref<VRDisplayEvent> create(const AtomicString& type, const RefPtr<VRDisplay>& display, Optional<VRDisplayEventReason>&& reason) > { > return adoptRef(*new VRDisplayEvent(type, display, WTFMove(reason))); > } > > struct Init : EventInit { > RefPtr<VRDisplay> display; >- std::optional<VRDisplayEventReason> reason; >+ Optional<VRDisplayEventReason> reason; > }; > > static Ref<VRDisplayEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) >@@ -50,17 +50,17 @@ public: > virtual ~VRDisplayEvent(); > > RefPtr<VRDisplay> display() const { return m_display; } >- const std::optional<VRDisplayEventReason>& reason() const { return m_reason; } >+ const Optional<VRDisplayEventReason>& reason() const { return m_reason; } > > private: > VRDisplayEvent(const AtomicString&, const Init&, IsTrusted); >- VRDisplayEvent(const AtomicString&, const RefPtr<VRDisplay>&, std::optional<VRDisplayEventReason>&&); >+ VRDisplayEvent(const AtomicString&, const RefPtr<VRDisplay>&, Optional<VRDisplayEventReason>&&); > > // Event > EventInterface eventInterface() const override; > > RefPtr<VRDisplay> m_display; >- std::optional<VRDisplayEventReason> m_reason; >+ Optional<VRDisplayEventReason> m_reason; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/webvr/VRPose.cpp b/Source/WebCore/Modules/webvr/VRPose.cpp >index 1686b9a5ab7df7c37ae3ce223570d049b50e9792..f7ce8fb93989d2ac4892adccc343c05d12410ce2 100644 >--- a/Source/WebCore/Modules/webvr/VRPose.cpp >+++ b/Source/WebCore/Modules/webvr/VRPose.cpp >@@ -27,7 +27,7 @@ > > namespace WebCore { > >-static RefPtr<Float32Array> optionalFloat3ToJSCArray(const std::optional<VRPlatformTrackingInfo::Float3>& data) >+static RefPtr<Float32Array> optionalFloat3ToJSCArray(const Optional<VRPlatformTrackingInfo::Float3>& data) > { > if (!data) > return nullptr; >diff --git a/Source/WebCore/Modules/webvr/VRStageParameters.h b/Source/WebCore/Modules/webvr/VRStageParameters.h >index bffcc12a9c68c5ba137074a136e90c1a1edf3176..75196b7ac3753f7724984e92dd3f8a145bd91927 100644 >--- a/Source/WebCore/Modules/webvr/VRStageParameters.h >+++ b/Source/WebCore/Modules/webvr/VRStageParameters.h >@@ -33,7 +33,7 @@ namespace WebCore { > > class VRStageParameters : public RefCounted<VRStageParameters> { > public: >- static RefPtr<VRStageParameters> create(const std::optional<TransformationMatrix>& sittingToStandingTransform, const std::optional<FloatSize>& playAreaBounds) >+ static RefPtr<VRStageParameters> create(const Optional<TransformationMatrix>& sittingToStandingTransform, const Optional<FloatSize>& playAreaBounds) > { > if (!sittingToStandingTransform || !playAreaBounds) > return nullptr; >diff --git a/Source/WebCore/PAL/pal/SessionID.h b/Source/WebCore/PAL/pal/SessionID.h >index d7268305db4afa470d6546a617fb6a809bb67368..2b1cdb29874940f7005f2b9924451402a2cace1c 100644 >--- a/Source/WebCore/PAL/pal/SessionID.h >+++ b/Source/WebCore/PAL/pal/SessionID.h >@@ -64,7 +64,7 @@ public: > > template<class Encoder> void encode(Encoder&) const; > template<class Decoder> static bool decode(Decoder&, SessionID&); >- template<class Decoder> static std::optional<SessionID> decode(Decoder&); >+ template<class Decoder> static Optional<SessionID> decode(Decoder&); > > SessionID isolatedCopy() const; > >@@ -87,7 +87,7 @@ void SessionID::encode(Encoder& encoder) const > template<class Decoder> > bool SessionID::decode(Decoder& decoder, SessionID& sessionID) > { >- std::optional<SessionID> decodedSessionID; >+ Optional<SessionID> decodedSessionID; > decoder >> decodedSessionID; > if (!decodedSessionID) > return false; >@@ -97,12 +97,12 @@ bool SessionID::decode(Decoder& decoder, SessionID& sessionID) > } > > template<class Decoder> >-std::optional<SessionID> SessionID::decode(Decoder& decoder) >+Optional<SessionID> SessionID::decode(Decoder& decoder) > { >- std::optional<uint64_t> sessionID; >+ Optional<uint64_t> sessionID; > decoder >> sessionID; > if (!sessionID) >- return std::nullopt; >+ return WTF::nullopt; > > // FIXME: Eliminate places that encode invalid SessionIDs, then fail to decode an invalid sessionID. > return SessionID { *sessionID }; >diff --git a/Source/WebCore/PAL/pal/crypto/gcrypt/Utilities.h b/Source/WebCore/PAL/pal/crypto/gcrypt/Utilities.h >index 6292a0f80bb0f5826532fe41b3baa091bde2c616..59bf24d5ec2341531cb23a721bad0eef9f6939af 100644 >--- a/Source/WebCore/PAL/pal/crypto/gcrypt/Utilities.h >+++ b/Source/WebCore/PAL/pal/crypto/gcrypt/Utilities.h >@@ -53,7 +53,7 @@ static inline void logError(gcry_error_t error) > #endif > } > >-static inline std::optional<int> aesAlgorithmForKeySize(size_t keySize) >+static inline Optional<int> aesAlgorithmForKeySize(size_t keySize) > { > switch (keySize) { > case 128: >@@ -63,7 +63,7 @@ static inline std::optional<int> aesAlgorithmForKeySize(size_t keySize) > case 256: > return GCRY_CIPHER_AES256; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.cpp b/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.cpp >index ac8ad8bef5fac1e7be39e2ec5bc3adda768ef787..e20df6305b97b12bf7fdfdec547500a02b94cccc 100644 >--- a/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.cpp >+++ b/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.cpp >@@ -118,39 +118,39 @@ bool decodeStructure(asn1_node* root, const char* elementName, const Vector<uint > return ret == ASN1_SUCCESS; > } > >-std::optional<Vector<uint8_t>> elementData(asn1_node root, const char* elementName) >+Optional<Vector<uint8_t>> elementData(asn1_node root, const char* elementName) > { > int length = 0; > unsigned type = 0; > int ret = asn1_read_value_type(root, elementName, nullptr, &length, &type); > if (ret != ASN1_MEM_ERROR) >- return std::nullopt; >+ return WTF::nullopt; > > if (type == ASN1_ETYPE_BIT_STRING) { > if (length % 8) >- return std::nullopt; >+ return WTF::nullopt; > length /= 8; > } > > Vector<uint8_t> data(length); > ret = asn1_read_value(root, elementName, data.data(), &length); > if (ret != ASN1_SUCCESS) >- return std::nullopt; >+ return WTF::nullopt; > > return data; > } > >-std::optional<Vector<uint8_t>> encodedData(asn1_node root, const char* elementName) >+Optional<Vector<uint8_t>> encodedData(asn1_node root, const char* elementName) > { > int length = 0; > int ret = asn1_der_coding(root, elementName, nullptr, &length, nullptr); > if (ret != ASN1_MEM_ERROR) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<uint8_t> data(length); > ret = asn1_der_coding(root, elementName, data.data(), &length, nullptr); > if (ret != ASN1_SUCCESS) >- return std::nullopt; >+ return WTF::nullopt; > > return data; > } >diff --git a/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.h b/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.h >index 65aaf6ce39553ad48348effba9bad3af4feb3bc2..f8aad174d723dacfac61d5b676a9c5f051af2ecb 100644 >--- a/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.h >+++ b/Source/WebCore/PAL/pal/crypto/tasn1/Utilities.h >@@ -57,8 +57,8 @@ private: > > bool createStructure(const char* elementName, asn1_node* root); > bool decodeStructure(asn1_node* root, const char* elementName, const Vector<uint8_t>& data); >-std::optional<Vector<uint8_t>> elementData(asn1_node root, const char* elementName); >-std::optional<Vector<uint8_t>> encodedData(asn1_node root, const char* elementName); >+Optional<Vector<uint8_t>> elementData(asn1_node root, const char* elementName); >+Optional<Vector<uint8_t>> encodedData(asn1_node root, const char* elementName); > bool writeElement(asn1_node root, const char* elementName, const void* data, size_t dataSize); > > } // namespace TASN1 >diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp >index f114ba949b0b32d0f6e689212dfd51f3e12315b2..e296946ddf25b4ae6266d95ec2d10c73c44b637b 100644 >--- a/Source/WebCore/accessibility/AXObjectCache.cpp >+++ b/Source/WebCore/accessibility/AXObjectCache.cpp >@@ -2188,19 +2188,19 @@ AccessibilityObject* AXObjectCache::accessibilityObjectForTextMarkerData(TextMar > return this->getOrCreate(domNode); > } > >-std::optional<TextMarkerData> AXObjectCache::textMarkerDataForVisiblePosition(const VisiblePosition& visiblePos) >+Optional<TextMarkerData> AXObjectCache::textMarkerDataForVisiblePosition(const VisiblePosition& visiblePos) > { > if (visiblePos.isNull()) >- return std::nullopt; >+ return WTF::nullopt; > > Position deepPos = visiblePos.deepEquivalent(); > Node* domNode = deepPos.deprecatedNode(); > ASSERT(domNode); > if (!domNode) >- return std::nullopt; >+ return WTF::nullopt; > > if (is<HTMLInputElement>(*domNode) && downcast<HTMLInputElement>(*domNode).isPasswordField()) >- return std::nullopt; >+ return WTF::nullopt; > > // If the visible position has an anchor type referring to a node other than the anchored node, we should > // set the text marker data with CharacterOffset so that the offset will correspond to the node. >@@ -2214,7 +2214,7 @@ std::optional<TextMarkerData> AXObjectCache::textMarkerDataForVisiblePosition(co > // find or create an accessibility object for this node > AXObjectCache* cache = domNode->document().axObjectCache(); > if (!cache) >- return std::nullopt; >+ return WTF::nullopt; > RefPtr<AccessibilityObject> obj = cache->getOrCreate(domNode); > > // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence. >@@ -2236,18 +2236,18 @@ std::optional<TextMarkerData> AXObjectCache::textMarkerDataForVisiblePosition(co > } > > // This function exits as a performance optimization to avoid a synchronous layout. >-std::optional<TextMarkerData> AXObjectCache::textMarkerDataForFirstPositionInTextControl(HTMLTextFormControlElement& textControl) >+Optional<TextMarkerData> AXObjectCache::textMarkerDataForFirstPositionInTextControl(HTMLTextFormControlElement& textControl) > { > if (is<HTMLInputElement>(textControl) && downcast<HTMLInputElement>(textControl).isPasswordField()) >- return std::nullopt; >+ return WTF::nullopt; > > AXObjectCache* cache = textControl.document().axObjectCache(); > if (!cache) >- return std::nullopt; >+ return WTF::nullopt; > > RefPtr<AccessibilityObject> obj = cache->getOrCreate(&textControl); > if (!obj) >- return std::nullopt; >+ return WTF::nullopt; > > // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence. > // Warning: This is risky and bad because TextMarkerData is a nontrivial type. >diff --git a/Source/WebCore/accessibility/AXObjectCache.h b/Source/WebCore/accessibility/AXObjectCache.h >index 3e4c6146d9ba38c8642805b3243b0812faf6b700..da4eba8e5b1ed78468455109f6089f180cb48d69 100644 >--- a/Source/WebCore/accessibility/AXObjectCache.h >+++ b/Source/WebCore/accessibility/AXObjectCache.h >@@ -204,8 +204,8 @@ public: > AccessibilityObject* objectFromAXID(AXID id) const { return m_objects.get(id); } > > // Text marker utilities. >- std::optional<TextMarkerData> textMarkerDataForVisiblePosition(const VisiblePosition&); >- std::optional<TextMarkerData> textMarkerDataForFirstPositionInTextControl(HTMLTextFormControlElement&); >+ Optional<TextMarkerData> textMarkerDataForVisiblePosition(const VisiblePosition&); >+ Optional<TextMarkerData> textMarkerDataForFirstPositionInTextControl(HTMLTextFormControlElement&); > void textMarkerDataForCharacterOffset(TextMarkerData&, const CharacterOffset&); > void textMarkerDataForNextCharacterOffset(TextMarkerData&, const CharacterOffset&); > void textMarkerDataForPreviousCharacterOffset(TextMarkerData&, const CharacterOffset&); >diff --git a/Source/WebCore/animation/AnimationEffect.cpp b/Source/WebCore/animation/AnimationEffect.cpp >index 2b8c538313f1ec16ab6f4bc7df91a95aee783dd2..dc6c494fbc1d0ead7222b6d350e0e791c866fc13 100644 >--- a/Source/WebCore/animation/AnimationEffect.cpp >+++ b/Source/WebCore/animation/AnimationEffect.cpp >@@ -41,11 +41,11 @@ AnimationEffect::~AnimationEffect() > { > } > >-std::optional<Seconds> AnimationEffect::localTime() const >+Optional<Seconds> AnimationEffect::localTime() const > { > if (m_animation) > return m_animation->currentTime(); >- return std::nullopt; >+ return WTF::nullopt; > } > > auto AnimationEffect::phase() const -> Phase >@@ -86,7 +86,7 @@ auto AnimationEffect::phase() const -> Phase > return Phase::Active; > } > >-std::optional<Seconds> AnimationEffect::activeTime() const >+Optional<Seconds> AnimationEffect::activeTime() const > { > // 3.8.3.1. Calculating the active time > // https://drafts.csswg.org/web-animations-1/#calculating-the-active-time >@@ -105,7 +105,7 @@ std::optional<Seconds> AnimationEffect::activeTime() const > if (m_fill == FillMode::Backwards || m_fill == FillMode::Both) > return std::max(localTime().value() - m_delay, 0_s); > // Otherwise, return an unresolved time value. >- return std::nullopt; >+ return WTF::nullopt; > } > > // If the animation effect is in the active phase, return the result of evaluating local time - start delay. >@@ -120,14 +120,14 @@ std::optional<Seconds> AnimationEffect::activeTime() const > if (m_fill == FillMode::Forwards || m_fill == FillMode::Both) > return std::max(std::min(localTime().value() - m_delay, activeDuration()), 0_s); > // Otherwise, return an unresolved time value. >- return std::nullopt; >+ return WTF::nullopt; > } > > // Otherwise (the local time is unresolved), return an unresolved time value. >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<double> AnimationEffect::overallProgress() const >+Optional<double> AnimationEffect::overallProgress() const > { > // 3.8.3.2. Calculating the overall progress > // https://drafts.csswg.org/web-animations-1/#calculating-the-overall-progress >@@ -137,7 +137,7 @@ std::optional<double> AnimationEffect::overallProgress() const > // 1. If the active time is unresolved, return unresolved. > auto effectActiveTime = activeTime(); > if (!effectActiveTime) >- return std::nullopt; >+ return WTF::nullopt; > > // 2. Calculate an initial value for overall progress based on the first matching condition from below, > double overallProgress; >@@ -156,7 +156,7 @@ std::optional<double> AnimationEffect::overallProgress() const > return std::abs(overallProgress); > } > >-std::optional<double> AnimationEffect::simpleIterationProgress() const >+Optional<double> AnimationEffect::simpleIterationProgress() const > { > // 3.8.3.3. Calculating the simple iteration progress > // https://drafts.csswg.org/web-animations-1/#calculating-the-simple-iteration-progress >@@ -168,7 +168,7 @@ std::optional<double> AnimationEffect::simpleIterationProgress() const > // 1. If the overall progress is unresolved, return unresolved. > auto effectOverallProgress = overallProgress(); > if (!effectOverallProgress) >- return std::nullopt; >+ return WTF::nullopt; > > // 2. If overall progress is infinity, let the simple iteration progress be iteration start % 1.0, > // otherwise, let the simple iteration progress be overall progress % 1.0. >@@ -189,7 +189,7 @@ std::optional<double> AnimationEffect::simpleIterationProgress() const > return simpleIterationProgress; > } > >-std::optional<double> AnimationEffect::currentIteration() const >+Optional<double> AnimationEffect::currentIteration() const > { > // 3.8.4. Calculating the current iteration > // https://drafts.csswg.org/web-animations-1/#calculating-the-current-iteration >@@ -198,7 +198,7 @@ std::optional<double> AnimationEffect::currentIteration() const > > // 1. If the active time is unresolved, return unresolved. > if (!activeTime()) >- return std::nullopt; >+ return WTF::nullopt; > > // 2. If the animation effect is in the after phase and the iteration count is infinity, return infinity. > if (phase() == Phase::After && std::isinf(m_iterations)) >@@ -237,7 +237,7 @@ AnimationEffect::ComputedDirection AnimationEffect::currentDirection() const > return AnimationEffect::ComputedDirection::Reverse; > } > >-std::optional<double> AnimationEffect::directedProgress() const >+Optional<double> AnimationEffect::directedProgress() const > { > // 3.9.1. Calculating the directed progress > // https://drafts.csswg.org/web-animations-1/#calculating-the-directed-progress >@@ -247,7 +247,7 @@ std::optional<double> AnimationEffect::directedProgress() const > // 1. If the simple iteration progress is unresolved, return unresolved. > auto effectSimpleIterationProgress = simpleIterationProgress(); > if (!effectSimpleIterationProgress) >- return std::nullopt; >+ return WTF::nullopt; > > // 2. Calculate the current direction (we implement this as a separate method). > >@@ -259,7 +259,7 @@ std::optional<double> AnimationEffect::directedProgress() const > return 1 - effectSimpleIterationProgress.value(); > } > >-std::optional<double> AnimationEffect::transformedProgress() const >+Optional<double> AnimationEffect::transformedProgress() const > { > // 3.10.1. Calculating the transformed progress > // https://drafts.csswg.org/web-animations-1/#calculating-the-transformed-progress >@@ -269,7 +269,7 @@ std::optional<double> AnimationEffect::transformedProgress() const > // 1. If the directed progress is unresolved, return unresolved. > auto effectDirectedProgress = directedProgress(); > if (!effectDirectedProgress) >- return std::nullopt; >+ return WTF::nullopt; > > auto effectDirectedProgressValue = effectDirectedProgress.value(); > >@@ -294,7 +294,7 @@ std::optional<double> AnimationEffect::transformedProgress() const > return effectDirectedProgressValue; > } > >-std::optional<double> AnimationEffect::iterationProgress() const >+Optional<double> AnimationEffect::iterationProgress() const > { > return transformedProgress(); > } >@@ -336,7 +336,7 @@ ComputedEffectTiming AnimationEffect::getComputedTiming() > return computedTiming; > } > >-ExceptionOr<void> AnimationEffect::updateTiming(std::optional<OptionalEffectTiming> timing) >+ExceptionOr<void> AnimationEffect::updateTiming(Optional<OptionalEffectTiming> timing) > { > // 6.5.4. Updating the timing of an AnimationEffect > // https://drafts.csswg.org/web-animations/#updating-animationeffect-timing >diff --git a/Source/WebCore/animation/AnimationEffect.h b/Source/WebCore/animation/AnimationEffect.h >index 8584db2b9d78d987c878f8ac47d2b46d42314bf6..29d1abd1cc4f99164c359334977ae03474b7c492 100644 >--- a/Source/WebCore/animation/AnimationEffect.h >+++ b/Source/WebCore/animation/AnimationEffect.h >@@ -53,7 +53,7 @@ public: > > EffectTiming getTiming(); > ComputedEffectTiming getComputedTiming(); >- ExceptionOr<void> updateTiming(std::optional<OptionalEffectTiming>); >+ ExceptionOr<void> updateTiming(Optional<OptionalEffectTiming>); > > virtual void apply(RenderStyle&) = 0; > virtual void invalidate() = 0; >@@ -87,12 +87,12 @@ public: > TimingFunction* timingFunction() const { return m_timingFunction.get(); } > void setTimingFunction(const RefPtr<TimingFunction>&); > >- std::optional<Seconds> localTime() const; >- std::optional<Seconds> activeTime() const; >+ Optional<Seconds> localTime() const; >+ Optional<Seconds> activeTime() const; > Seconds endTime() const; >- std::optional<double> simpleIterationProgress() const; >- std::optional<double> iterationProgress() const; >- std::optional<double> currentIteration() const; >+ Optional<double> simpleIterationProgress() const; >+ Optional<double> iterationProgress() const; >+ Optional<double> currentIteration() const; > Seconds activeDuration() const; > > enum class Phase { Before, Active, After, Idle }; >@@ -104,10 +104,10 @@ protected: > private: > enum class ComputedDirection { Forwards, Reverse }; > >- std::optional<double> overallProgress() const; >+ Optional<double> overallProgress() const; > AnimationEffect::ComputedDirection currentDirection() const; >- std::optional<double> directedProgress() const; >- std::optional<double> transformedProgress() const; >+ Optional<double> directedProgress() const; >+ Optional<double> transformedProgress() const; > > Seconds m_delay { 0_s }; > Seconds m_endDelay { 0_s }; >diff --git a/Source/WebCore/animation/AnimationPlaybackEvent.cpp b/Source/WebCore/animation/AnimationPlaybackEvent.cpp >index 96c09248b4487e49f76c489ee56676b09723b072..8cfa54f23bf5764ee32b58e7625b367529d4e8d7 100644 >--- a/Source/WebCore/animation/AnimationPlaybackEvent.cpp >+++ b/Source/WebCore/animation/AnimationPlaybackEvent.cpp >@@ -33,18 +33,18 @@ namespace WebCore { > AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, const AnimationPlaybackEventInit& initializer, IsTrusted isTrusted) > : Event(type, initializer, isTrusted) > { >- if (initializer.currentTime == std::nullopt) >- m_currentTime = std::nullopt; >+ if (initializer.currentTime == WTF::nullopt) >+ m_currentTime = WTF::nullopt; > else > m_currentTime = Seconds::fromMilliseconds(initializer.currentTime.value()); > >- if (initializer.timelineTime == std::nullopt) >- m_timelineTime = std::nullopt; >+ if (initializer.timelineTime == WTF::nullopt) >+ m_timelineTime = WTF::nullopt; > else > m_timelineTime = Seconds::fromMilliseconds(initializer.timelineTime.value()); > } > >-AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, std::optional<Seconds> currentTime, std::optional<Seconds> timelineTime) >+AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, Optional<Seconds> currentTime, Optional<Seconds> timelineTime) > : Event(type, CanBubble::Yes, IsCancelable::No) > , m_currentTime(currentTime) > , m_timelineTime(timelineTime) >@@ -53,17 +53,17 @@ AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, std::op > > AnimationPlaybackEvent::~AnimationPlaybackEvent() = default; > >-std::optional<double> AnimationPlaybackEvent::bindingsCurrentTime() const >+Optional<double> AnimationPlaybackEvent::bindingsCurrentTime() const > { > if (!m_currentTime) >- return std::nullopt; >+ return WTF::nullopt; > return secondsToWebAnimationsAPITime(m_currentTime.value()); > } > >-std::optional<double> AnimationPlaybackEvent::bindingsTimelineTime() const >+Optional<double> AnimationPlaybackEvent::bindingsTimelineTime() const > { > if (!m_timelineTime) >- return std::nullopt; >+ return WTF::nullopt; > return secondsToWebAnimationsAPITime(m_timelineTime.value()); > } > >diff --git a/Source/WebCore/animation/AnimationPlaybackEvent.h b/Source/WebCore/animation/AnimationPlaybackEvent.h >index 384ce3eb35d2b256bbf18ba0093627670c641d17..cb7fb885bcac239bc1e9ec7561845c4d59aa8851 100644 >--- a/Source/WebCore/animation/AnimationPlaybackEvent.h >+++ b/Source/WebCore/animation/AnimationPlaybackEvent.h >@@ -32,7 +32,7 @@ namespace WebCore { > > class AnimationPlaybackEvent final : public Event { > public: >- static Ref<AnimationPlaybackEvent> create(const AtomicString& type, std::optional<Seconds> currentTime, std::optional<Seconds> timelineTime) >+ static Ref<AnimationPlaybackEvent> create(const AtomicString& type, Optional<Seconds> currentTime, Optional<Seconds> timelineTime) > { > return adoptRef(*new AnimationPlaybackEvent(type, currentTime, timelineTime)); > } >@@ -44,19 +44,19 @@ public: > > virtual ~AnimationPlaybackEvent(); > >- std::optional<double> bindingsCurrentTime() const; >- std::optional<Seconds> currentTime() const { return m_currentTime; } >- std::optional<double> bindingsTimelineTime() const; >- std::optional<Seconds> timelineTime() const { return m_timelineTime; } >+ Optional<double> bindingsCurrentTime() const; >+ Optional<Seconds> currentTime() const { return m_currentTime; } >+ Optional<double> bindingsTimelineTime() const; >+ Optional<Seconds> timelineTime() const { return m_timelineTime; } > > EventInterface eventInterface() const override { return AnimationPlaybackEventInterfaceType; } > > private: >- AnimationPlaybackEvent(const AtomicString&, std::optional<Seconds>, std::optional<Seconds>); >+ AnimationPlaybackEvent(const AtomicString&, Optional<Seconds>, Optional<Seconds>); > AnimationPlaybackEvent(const AtomicString&, const AnimationPlaybackEventInit&, IsTrusted); > >- std::optional<Seconds> m_currentTime; >- std::optional<Seconds> m_timelineTime; >+ Optional<Seconds> m_currentTime; >+ Optional<Seconds> m_timelineTime; > }; > > } >diff --git a/Source/WebCore/animation/AnimationPlaybackEventInit.h b/Source/WebCore/animation/AnimationPlaybackEventInit.h >index 3e2ed7393eaae59427b939d314b796024c96dd87..dc1e788f01c008c56becbec201613d10394123ab 100644 >--- a/Source/WebCore/animation/AnimationPlaybackEventInit.h >+++ b/Source/WebCore/animation/AnimationPlaybackEventInit.h >@@ -31,8 +31,8 @@ > namespace WebCore { > > struct AnimationPlaybackEventInit : EventInit { >- std::optional<double> currentTime; >- std::optional<double> timelineTime; >+ Optional<double> currentTime; >+ Optional<double> timelineTime; > }; > > } >diff --git a/Source/WebCore/animation/AnimationTimeline.cpp b/Source/WebCore/animation/AnimationTimeline.cpp >index 67a6f3f85b0d7a5107b39a9a8e27a7a498941a76..fcba25cbec5f01e5d7c4c0bdcd527de92a6469ad 100644 >--- a/Source/WebCore/animation/AnimationTimeline.cpp >+++ b/Source/WebCore/animation/AnimationTimeline.cpp >@@ -80,11 +80,11 @@ void AnimationTimeline::removeAnimation(WebAnimation& animation) > } > } > >-std::optional<double> AnimationTimeline::bindingsCurrentTime() >+Optional<double> AnimationTimeline::bindingsCurrentTime() > { > auto time = currentTime(); > if (!time) >- return std::nullopt; >+ return WTF::nullopt; > return secondsToWebAnimationsAPITime(*time); > } > >@@ -365,7 +365,7 @@ void AnimationTimeline::updateCSSTransitionsForElement(Element& element, const R > > auto numberOfProperties = CSSPropertyAnimation::getNumProperties(); > for (int propertyIndex = 0; propertyIndex < numberOfProperties; ++propertyIndex) { >- std::optional<bool> isShorthand; >+ Optional<bool> isShorthand; > auto property = CSSPropertyAnimation::getPropertyAtIndex(propertyIndex, isShorthand); > if (isShorthand && *isShorthand) > continue; >diff --git a/Source/WebCore/animation/AnimationTimeline.h b/Source/WebCore/animation/AnimationTimeline.h >index 896eb553dc62e30c430a772f59b35641b8948271..1e15f1804b676307b0e833fcf24d4b95a9f5ce31 100644 >--- a/Source/WebCore/animation/AnimationTimeline.h >+++ b/Source/WebCore/animation/AnimationTimeline.h >@@ -52,8 +52,8 @@ public: > virtual void animationTimingDidChange(WebAnimation&); > virtual void removeAnimation(WebAnimation&); > >- std::optional<double> bindingsCurrentTime(); >- virtual std::optional<Seconds> currentTime() { return m_currentTime; } >+ Optional<double> bindingsCurrentTime(); >+ virtual Optional<Seconds> currentTime() { return m_currentTime; } > > enum class Ordering { Sorted, Unsorted }; > Vector<RefPtr<WebAnimation>> animationsForElement(Element&, Ordering ordering = Ordering::Unsorted) const; >@@ -91,7 +91,7 @@ private: > void cancelDeclarativeAnimation(DeclarativeAnimation&); > > ClassType m_classType; >- std::optional<Seconds> m_currentTime; >+ Optional<Seconds> m_currentTime; > ElementToAnimationsMap m_elementToAnimationsMap; > ElementToAnimationsMap m_elementToCSSAnimationsMap; > ElementToAnimationsMap m_elementToCSSTransitionsMap; >diff --git a/Source/WebCore/animation/ComputedEffectTiming.h b/Source/WebCore/animation/ComputedEffectTiming.h >index eb9fe9384963b5cd4620100471ebc2e7185a4f58..77cfdc01c97284909c48f68456d3fd8bbb872240 100644 >--- a/Source/WebCore/animation/ComputedEffectTiming.h >+++ b/Source/WebCore/animation/ComputedEffectTiming.h >@@ -33,9 +33,9 @@ namespace WebCore { > struct ComputedEffectTiming : EffectTiming { > double endTime; > double activeDuration; >- std::optional<double> localTime; >- std::optional<double> progress; >- std::optional<double> currentIteration; >+ Optional<double> localTime; >+ Optional<double> progress; >+ Optional<double> currentIteration; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/animation/DeclarativeAnimation.cpp b/Source/WebCore/animation/DeclarativeAnimation.cpp >index 87a75235c00b397f907a3b7b40051762d35db570..0c20c5287cb53a20e90a3a8b322e4d21226e7e88 100644 >--- a/Source/WebCore/animation/DeclarativeAnimation.cpp >+++ b/Source/WebCore/animation/DeclarativeAnimation.cpp >@@ -117,25 +117,25 @@ void DeclarativeAnimation::syncPropertiesWithBackingAnimation() > { > } > >-std::optional<double> DeclarativeAnimation::startTime() const >+Optional<double> DeclarativeAnimation::startTime() const > { > flushPendingStyleChanges(); > return WebAnimation::startTime(); > } > >-void DeclarativeAnimation::setStartTime(std::optional<double> startTime) >+void DeclarativeAnimation::setStartTime(Optional<double> startTime) > { > flushPendingStyleChanges(); > return WebAnimation::setStartTime(startTime); > } > >-std::optional<double> DeclarativeAnimation::bindingsCurrentTime() const >+Optional<double> DeclarativeAnimation::bindingsCurrentTime() const > { > flushPendingStyleChanges(); > return WebAnimation::bindingsCurrentTime(); > } > >-ExceptionOr<void> DeclarativeAnimation::setBindingsCurrentTime(std::optional<double> currentTime) >+ExceptionOr<void> DeclarativeAnimation::setBindingsCurrentTime(Optional<double> currentTime) > { > flushPendingStyleChanges(); > return WebAnimation::setBindingsCurrentTime(currentTime); >diff --git a/Source/WebCore/animation/DeclarativeAnimation.h b/Source/WebCore/animation/DeclarativeAnimation.h >index b27a5462c825e8549bef431c05dc22ad6a3423b8..931ed7632cd05fa555c21ba4cf34dc4261625ca3 100644 >--- a/Source/WebCore/animation/DeclarativeAnimation.h >+++ b/Source/WebCore/animation/DeclarativeAnimation.h >@@ -47,10 +47,10 @@ public: > void setBackingAnimation(const Animation&); > void cancelFromStyle(); > >- std::optional<double> startTime() const final; >- void setStartTime(std::optional<double>) final; >- std::optional<double> bindingsCurrentTime() const final; >- ExceptionOr<void> setBindingsCurrentTime(std::optional<double>) final; >+ Optional<double> startTime() const final; >+ void setStartTime(Optional<double>) final; >+ Optional<double> bindingsCurrentTime() const final; >+ ExceptionOr<void> setBindingsCurrentTime(Optional<double>) final; > WebAnimation::PlayState bindingsPlayState() const final; > bool bindingsPending() const final; > WebAnimation::ReadyPromise& bindingsReady() final; >diff --git a/Source/WebCore/animation/DocumentTimeline.cpp b/Source/WebCore/animation/DocumentTimeline.cpp >index 5381424ba55829353f25d6efb8700617b7c87c18..fb445c1d868eb24c5c4fb920c5043f65f4f3df72 100644 >--- a/Source/WebCore/animation/DocumentTimeline.cpp >+++ b/Source/WebCore/animation/DocumentTimeline.cpp >@@ -227,7 +227,7 @@ void DocumentTimeline::resumeAnimations() > if (!animationsAreSuspended()) > return; > >- m_cachedCurrentTime = std::nullopt; >+ m_cachedCurrentTime = WTF::nullopt; > > m_isSuspended = false; > >@@ -261,7 +261,7 @@ Seconds DocumentTimeline::liveCurrentTime() const > #endif > } > >-std::optional<Seconds> DocumentTimeline::currentTime() >+Optional<Seconds> DocumentTimeline::currentTime() > { > if (!m_document || !m_document->domWindow()) > return AnimationTimeline::currentTime(); >@@ -270,7 +270,7 @@ std::optional<Seconds> DocumentTimeline::currentTime() > if (mainDocumentTimeline != this) { > if (auto mainDocumentTimelineCurrentTime = mainDocumentTimeline->currentTime()) > return mainDocumentTimelineCurrentTime.value() - m_originTime; >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -323,7 +323,7 @@ void DocumentTimeline::maybeClearCachedCurrentTime() > // we're guaranteed to have a consistent current time reported for all work happening in a given > // JS frame or throughout updating animations in WebCore. > if (!m_isSuspended && !m_waitingOnVMIdle && !m_currentTimeClearingTaskQueue.hasPendingTasks()) >- m_cachedCurrentTime = std::nullopt; >+ m_cachedCurrentTime = WTF::nullopt; > } > > void DocumentTimeline::scheduleAnimationResolutionIfNeeded() >diff --git a/Source/WebCore/animation/DocumentTimeline.h b/Source/WebCore/animation/DocumentTimeline.h >index fa05217323834c5e09c0786f265365741db17c70..1e880f516030bbf655b9132e06b470c572caefa8 100644 >--- a/Source/WebCore/animation/DocumentTimeline.h >+++ b/Source/WebCore/animation/DocumentTimeline.h >@@ -47,7 +47,7 @@ public: > > Document* document() const { return m_document.get(); } > >- std::optional<Seconds> currentTime() override; >+ Optional<Seconds> currentTime() override; > > void animationTimingDidChange(WebAnimation&) override; > void removeAnimation(WebAnimation&) override; >@@ -105,7 +105,7 @@ private: > bool m_isSuspended { false }; > bool m_waitingOnVMIdle { false }; > bool m_isUpdatingAnimations { false }; >- std::optional<Seconds> m_cachedCurrentTime; >+ Optional<Seconds> m_cachedCurrentTime; > GenericTaskQueue<Timer> m_currentTimeClearingTaskQueue; > HashSet<RefPtr<WebAnimation>> m_acceleratedAnimationsPendingRunningStateChange; > Vector<Ref<AnimationPlaybackEvent>> m_pendingAnimationEvents; >diff --git a/Source/WebCore/animation/KeyframeEffect.cpp b/Source/WebCore/animation/KeyframeEffect.cpp >index 95daf9123e5106f73d4677bdae48dcf2981f75e3..1e6462d3b8a29db1979bbcc5d563d2c176eb0c88 100644 >--- a/Source/WebCore/animation/KeyframeEffect.cpp >+++ b/Source/WebCore/animation/KeyframeEffect.cpp >@@ -112,7 +112,7 @@ static inline void computeMissingKeyframeOffsets(Vector<KeyframeEffect::ParsedKe > return; > > // 1. For each keyframe, in keyframes, let the computed keyframe offset of the keyframe be equal to its keyframe offset value. >- // In our implementation, we only set non-null values to avoid making computedOffset std::optional<double>. Instead, we'll know >+ // In our implementation, we only set non-null values to avoid making computedOffset Optional<double>. Instead, we'll know > // that a keyframe hasn't had a computed offset by checking if it has a null offset and a 0 computedOffset, since the first > // keyframe will already have a 0 computedOffset. > for (auto& keyframe : keyframes) >@@ -390,13 +390,13 @@ static inline ExceptionOr<void> processPropertyIndexedKeyframes(ExecState& state > // 5. Let offsets be a sequence of nullable double values assigned based on the type of the âoffsetâ member of the property-indexed keyframe as follows: > // - sequence<double?>, the value of âoffsetâ as-is. > // - double?, a sequence of length one with the value of âoffsetâ as its single item, i.e. « offset », >- Vector<std::optional<double>> offsets; >- if (WTF::holds_alternative<Vector<std::optional<double>>>(propertyIndexedKeyframe.baseProperties.offset)) >- offsets = WTF::get<Vector<std::optional<double>>>(propertyIndexedKeyframe.baseProperties.offset); >+ Vector<Optional<double>> offsets; >+ if (WTF::holds_alternative<Vector<Optional<double>>>(propertyIndexedKeyframe.baseProperties.offset)) >+ offsets = WTF::get<Vector<Optional<double>>>(propertyIndexedKeyframe.baseProperties.offset); > else if (WTF::holds_alternative<double>(propertyIndexedKeyframe.baseProperties.offset)) > offsets.append(WTF::get<double>(propertyIndexedKeyframe.baseProperties.offset)); > else if (WTF::holds_alternative<std::nullptr_t>(propertyIndexedKeyframe.baseProperties.offset)) >- offsets.append(std::nullopt); >+ offsets.append(WTF::nullopt); > > // 6. Assign each value in offsets to the keyframe offset of the keyframe with corresponding position in property keyframes until the end of either sequence is reached. > for (size_t i = 0; i < offsets.size() && i < parsedKeyframes.size(); ++i) >@@ -459,7 +459,7 @@ static inline ExceptionOr<void> processPropertyIndexedKeyframes(ExecState& state > return { }; > } > >-ExceptionOr<Ref<KeyframeEffect>> KeyframeEffect::create(ExecState& state, Element* target, Strong<JSObject>&& keyframes, std::optional<Variant<double, KeyframeEffectOptions>>&& options) >+ExceptionOr<Ref<KeyframeEffect>> KeyframeEffect::create(ExecState& state, Element* target, Strong<JSObject>&& keyframes, Optional<Variant<double, KeyframeEffectOptions>>&& options) > { > auto keyframeEffect = adoptRef(*new KeyframeEffect(target)); > >@@ -1077,7 +1077,7 @@ void KeyframeEffect::setAnimatedPropertiesInStyle(RenderStyle& targetStyle, doub > // 6. Remove any keyframes from property-specific keyframes that do not have a property value for target property. > unsigned numberOfKeyframesWithZeroOffset = 0; > unsigned numberOfKeyframesWithOneOffset = 0; >- Vector<std::optional<size_t>> propertySpecificKeyframes; >+ Vector<Optional<size_t>> propertySpecificKeyframes; > for (size_t i = 0; i < m_blendingKeyframes.size(); ++i) { > auto& keyframe = m_blendingKeyframes[i]; > auto offset = keyframe.key(); >@@ -1102,7 +1102,7 @@ void KeyframeEffect::setAnimatedPropertiesInStyle(RenderStyle& targetStyle, doub > // offset of 0, a property value set to the neutral value for composition, and a composite operation of add, and prepend it to the beginning of > // property-specific keyframes. > if (!numberOfKeyframesWithZeroOffset) { >- propertySpecificKeyframes.insert(0, std::nullopt); >+ propertySpecificKeyframes.insert(0, WTF::nullopt); > numberOfKeyframesWithZeroOffset = 1; > } > >@@ -1110,12 +1110,12 @@ void KeyframeEffect::setAnimatedPropertiesInStyle(RenderStyle& targetStyle, doub > // keyframe offset of 1, a property value set to the neutral value for composition, and a composite operation of add, and append it to the end of > // property-specific keyframes. > if (!numberOfKeyframesWithOneOffset) { >- propertySpecificKeyframes.append(std::nullopt); >+ propertySpecificKeyframes.append(WTF::nullopt); > numberOfKeyframesWithOneOffset = 1; > } > > // 10. Let interval endpoints be an empty sequence of keyframes. >- Vector<std::optional<size_t>> intervalEndpoints; >+ Vector<Optional<size_t>> intervalEndpoints; > > // 11. Populate interval endpoints by following the steps from the first matching condition from below: > if (iterationProgress < 0 && numberOfKeyframesWithZeroOffset > 1) { >diff --git a/Source/WebCore/animation/KeyframeEffect.h b/Source/WebCore/animation/KeyframeEffect.h >index e973e6f5c36e4fdb5a3f4f7446e2655c24c452e8..4f64ca4eade092e82548c743df5d1b7aaeac8a74 100644 >--- a/Source/WebCore/animation/KeyframeEffect.h >+++ b/Source/WebCore/animation/KeyframeEffect.h >@@ -46,7 +46,7 @@ class FilterOperations; > class KeyframeEffect : public AnimationEffect > , public CSSPropertyBlendingClient { > public: >- static ExceptionOr<Ref<KeyframeEffect>> create(JSC::ExecState&, Element*, JSC::Strong<JSC::JSObject>&&, std::optional<Variant<double, KeyframeEffectOptions>>&&); >+ static ExceptionOr<Ref<KeyframeEffect>> create(JSC::ExecState&, Element*, JSC::Strong<JSC::JSObject>&&, Optional<Variant<double, KeyframeEffectOptions>>&&); > static ExceptionOr<Ref<KeyframeEffect>> create(JSC::ExecState&, Ref<KeyframeEffect>&&); > static Ref<KeyframeEffect> create(const Element&); > ~KeyframeEffect() { } >@@ -54,13 +54,13 @@ public: > bool isKeyframeEffect() const final { return true; } > > struct BasePropertyIndexedKeyframe { >- Variant<std::nullptr_t, Vector<std::optional<double>>, double> offset = Vector<std::optional<double>>(); >+ Variant<std::nullptr_t, Vector<Optional<double>>, double> offset = Vector<Optional<double>>(); > Variant<Vector<String>, String> easing = Vector<String>(); > Variant<Vector<CompositeOperationOrAuto>, CompositeOperationOrAuto> composite = Vector<CompositeOperationOrAuto>(); > }; > > struct BaseKeyframe { >- std::optional<double> offset; >+ Optional<double> offset; > String easing { "linear" }; > CompositeOperationOrAuto composite { CompositeOperationOrAuto::Auto }; > }; >@@ -76,7 +76,7 @@ public: > }; > > struct ParsedKeyframe { >- std::optional<double> offset; >+ Optional<double> offset; > double computedOffset; > CompositeOperationOrAuto composite { CompositeOperationOrAuto::Auto }; > String easing; >@@ -91,7 +91,7 @@ public: > }; > > struct BaseComputedKeyframe { >- std::optional<double> offset; >+ Optional<double> offset; > double computedOffset; > String easing { "linear" }; > CompositeOperationOrAuto composite { CompositeOperationOrAuto::Auto }; >diff --git a/Source/WebCore/animation/OptionalEffectTiming.h b/Source/WebCore/animation/OptionalEffectTiming.h >index 23af2ad87551f3b098d31b670f92c5a26c491221..6d911819c4e097b85e3dcf0b68d137eec3650f79 100644 >--- a/Source/WebCore/animation/OptionalEffectTiming.h >+++ b/Source/WebCore/animation/OptionalEffectTiming.h >@@ -33,13 +33,13 @@ > namespace WebCore { > > struct OptionalEffectTiming { >- std::optional<double> delay; >- std::optional<double> endDelay; >- std::optional<FillMode> fill; >- std::optional<double> iterationStart; >- std::optional<double> iterations; >- std::optional<Variant<double, String>> duration; >- std::optional<PlaybackDirection> direction; >+ Optional<double> delay; >+ Optional<double> endDelay; >+ Optional<FillMode> fill; >+ Optional<double> iterationStart; >+ Optional<double> iterations; >+ Optional<Variant<double, String>> duration; >+ Optional<PlaybackDirection> direction; > String easing; > }; > >diff --git a/Source/WebCore/animation/WebAnimation.cpp b/Source/WebCore/animation/WebAnimation.cpp >index 850d8387e3518aa5b68ae5d6f5c9136f736cdcb6..c02ee568bb85b14d72d198915f589301abd7ff20 100644 >--- a/Source/WebCore/animation/WebAnimation.cpp >+++ b/Source/WebCore/animation/WebAnimation.cpp >@@ -180,7 +180,7 @@ void WebAnimation::setTimeline(RefPtr<AnimationTimeline>&& timeline) > > // 4. If the animation start time of animation is resolved, make animation's hold time unresolved. > if (m_startTime) >- m_holdTime = std::nullopt; >+ m_holdTime = WTF::nullopt; > > if (is<KeyframeEffect>(m_effect)) { > auto* keyframeEffect = downcast<KeyframeEffect>(m_effect.get()); >@@ -232,32 +232,32 @@ void WebAnimation::effectTargetDidChange(Element* previousTarget, Element* newTa > m_timeline->animationWasAddedToElement(*this, *newTarget); > } > >-std::optional<double> WebAnimation::startTime() const >+Optional<double> WebAnimation::startTime() const > { > if (!m_startTime) >- return std::nullopt; >+ return WTF::nullopt; > return secondsToWebAnimationsAPITime(m_startTime.value()); > } > >-void WebAnimation::setStartTime(std::optional<double> startTime) >+void WebAnimation::setStartTime(Optional<double> startTime) > { > // 3.4.6 The procedure to set the start time of animation, animation, to new start time, is as follows: > // https://drafts.csswg.org/web-animations/#setting-the-start-time-of-an-animation > >- std::optional<Seconds> newStartTime; >+ Optional<Seconds> newStartTime; > if (!startTime) >- newStartTime = std::nullopt; >+ newStartTime = WTF::nullopt; > else > newStartTime = Seconds::fromMilliseconds(startTime.value()); > > // 1. Let timeline time be the current time value of the timeline that animation is associated with. If > // there is no timeline associated with animation or the associated timeline is inactive, let the timeline > // time be unresolved. >- auto timelineTime = m_timeline ? m_timeline->currentTime() : std::nullopt; >+ auto timelineTime = m_timeline ? m_timeline->currentTime() : WTF::nullopt; > > // 2. If timeline time is unresolved and new start time is resolved, make animation's hold time unresolved. > if (!timelineTime && newStartTime) >- m_holdTime = std::nullopt; >+ m_holdTime = WTF::nullopt; > > // 3. Let previous current time be animation's current time. > auto previousCurrentTime = currentTime(); >@@ -273,7 +273,7 @@ void WebAnimation::setStartTime(std::optional<double> startTime) > // If new start time is resolved, > // If animation's playback rate is not zero, make animation's hold time unresolved. > if (m_playbackRate) >- m_holdTime = std::nullopt; >+ m_holdTime = WTF::nullopt; > } else { > // Otherwise (new start time is unresolved), > // Set animation's hold time to previous current time even if previous current time is unresolved. >@@ -293,27 +293,27 @@ void WebAnimation::setStartTime(std::optional<double> startTime) > invalidateEffect(); > } > >-std::optional<double> WebAnimation::bindingsCurrentTime() const >+Optional<double> WebAnimation::bindingsCurrentTime() const > { > auto time = currentTime(); > if (!time) >- return std::nullopt; >+ return WTF::nullopt; > return secondsToWebAnimationsAPITime(time.value()); > } > >-ExceptionOr<void> WebAnimation::setBindingsCurrentTime(std::optional<double> currentTime) >+ExceptionOr<void> WebAnimation::setBindingsCurrentTime(Optional<double> currentTime) > { > if (!currentTime) >- return setCurrentTime(std::nullopt); >+ return setCurrentTime(WTF::nullopt); > return setCurrentTime(Seconds::fromMilliseconds(currentTime.value())); > } > >-std::optional<Seconds> WebAnimation::currentTime() const >+Optional<Seconds> WebAnimation::currentTime() const > { > return currentTime(RespectHoldTime::Yes); > } > >-std::optional<Seconds> WebAnimation::currentTime(RespectHoldTime respectHoldTime) const >+Optional<Seconds> WebAnimation::currentTime(RespectHoldTime respectHoldTime) const > { > // 3.4.4. The current time of an animation > // https://drafts.csswg.org/web-animations-1/#the-current-time-of-an-animation >@@ -330,13 +330,13 @@ std::optional<Seconds> WebAnimation::currentTime(RespectHoldTime respectHoldTime > // 3. the animation's start time is unresolved. > // The current time is an unresolved time value. > if (!m_timeline || !m_timeline->currentTime() || !m_startTime) >- return std::nullopt; >+ return WTF::nullopt; > > // Otherwise, current time = (timeline time - start time) * playback rate > return (m_timeline->currentTime().value() - m_startTime.value()) * m_playbackRate; > } > >-ExceptionOr<void> WebAnimation::silentlySetCurrentTime(std::optional<Seconds> seekTime) >+ExceptionOr<void> WebAnimation::silentlySetCurrentTime(Optional<Seconds> seekTime) > { > // 3.4.5. Setting the current time of an animation > // https://drafts.csswg.org/web-animations-1/#setting-the-current-time-of-an-animation >@@ -366,15 +366,15 @@ ExceptionOr<void> WebAnimation::silentlySetCurrentTime(std::optional<Seconds> se > > // 3. If animation has no associated timeline or the associated timeline is inactive, make animation's start time unresolved. > if (!m_timeline || !m_timeline->currentTime()) >- m_startTime = std::nullopt; >+ m_startTime = WTF::nullopt; > > // 4. Make animation's previous current time unresolved. >- m_previousCurrentTime = std::nullopt; >+ m_previousCurrentTime = WTF::nullopt; > > return { }; > } > >-ExceptionOr<void> WebAnimation::setCurrentTime(std::optional<Seconds> seekTime) >+ExceptionOr<void> WebAnimation::setCurrentTime(Optional<Seconds> seekTime) > { > // 3.4.5. Setting the current time of an animation > // https://drafts.csswg.org/web-animations-1/#setting-the-current-time-of-an-animation >@@ -391,7 +391,7 @@ ExceptionOr<void> WebAnimation::setCurrentTime(std::optional<Seconds> seekTime) > // 2. Apply any pending playback rate to animation. > applyPendingPlaybackRate(); > // 3. Make animation's start time unresolved. >- m_startTime = std::nullopt; >+ m_startTime = WTF::nullopt; > // 4. Cancel the pending pause task. > m_timeToRunPendingPauseTask = TimeToRunPendingTask::NotScheduled; > // 5. Resolve animation's current ready promise with animation. >@@ -422,7 +422,7 @@ void WebAnimation::setPlaybackRate(double newPlaybackRate) > // https://drafts.csswg.org/web-animations-1/#updating-the-playback-rate-of-an-animation > > // 1. Clear any pending playback rate on animation. >- m_pendingPlaybackRate = std::nullopt; >+ m_pendingPlaybackRate = WTF::nullopt; > > // 2. Let previous time be the value of the current time of animation before changing the playback rate. > auto previousTime = currentTime(); >@@ -499,7 +499,7 @@ void WebAnimation::applyPendingPlaybackRate() > m_playbackRate = m_pendingPlaybackRate.value(); > > // 3. Clear animation's pending playback rate. >- m_pendingPlaybackRate = std::nullopt; >+ m_pendingPlaybackRate = WTF::nullopt; > } > > auto WebAnimation::playState() const -> PlayState >@@ -580,21 +580,21 @@ void WebAnimation::cancel(Silently silently) > // scheduled event time is an unresolved time value. > // Otherwise, queue a task to dispatch cancelEvent at animation. The task source for this task is the DOM manipulation task source. > if (silently == Silently::No) >- enqueueAnimationPlaybackEvent(eventNames().cancelEvent, std::nullopt, m_timeline ? m_timeline->currentTime() : std::nullopt); >+ enqueueAnimationPlaybackEvent(eventNames().cancelEvent, WTF::nullopt, m_timeline ? m_timeline->currentTime() : WTF::nullopt); > } > > // 2. Make animation's hold time unresolved. >- m_holdTime = std::nullopt; >+ m_holdTime = WTF::nullopt; > > // 3. Make animation's start time unresolved. >- m_startTime = std::nullopt; >+ m_startTime = WTF::nullopt; > > timingDidChange(DidSeek::No, SynchronouslyNotify::No); > > invalidateEffect(); > } > >-void WebAnimation::enqueueAnimationPlaybackEvent(const AtomicString& type, std::optional<Seconds> currentTime, std::optional<Seconds> timelineTime) >+void WebAnimation::enqueueAnimationPlaybackEvent(const AtomicString& type, Optional<Seconds> currentTime, Optional<Seconds> timelineTime) > { > auto event = AnimationPlaybackEvent::create(type, currentTime, timelineTime); > event->setTarget(this); >@@ -673,7 +673,7 @@ ExceptionOr<void> WebAnimation::finish() > // 6. If there is a pending pause task and start time is resolved, > if (hasPendingPauseTask() && m_startTime) { > // 1. Let the hold time be unresolved. >- m_holdTime = std::nullopt; >+ m_holdTime = WTF::nullopt; > // 2. Cancel the pending pause task. > m_timeToRunPendingPauseTask = TimeToRunPendingTask::NotScheduled; > // 3. Resolve the current ready promise of animation with animation. >@@ -751,7 +751,7 @@ void WebAnimation::updateFinishedState(DidSeek didSeek, SynchronouslyNotify sync > if (didSeek == DidSeek::Yes && m_holdTime) > m_startTime = m_timeline->currentTime().value() - (m_holdTime.value() / m_playbackRate); > // 2. Let the hold time be unresolved. >- m_holdTime = std::nullopt; >+ m_holdTime = WTF::nullopt; > } > } > >@@ -827,7 +827,7 @@ void WebAnimation::finishNotificationSteps() > // queue along with its target, animation. For the scheduled event time, use the result of converting animation's target > // effect end to an origin-relative time. > // Otherwise, queue a task to dispatch finishEvent at animation. The task source for this task is the DOM manipulation task source. >- enqueueAnimationPlaybackEvent(eventNames().finishEvent, currentTime(), m_timeline ? m_timeline->currentTime() : std::nullopt); >+ enqueueAnimationPlaybackEvent(eventNames().finishEvent, currentTime(), m_timeline ? m_timeline->currentTime() : WTF::nullopt); > } > > ExceptionOr<void> WebAnimation::play() >@@ -891,7 +891,7 @@ ExceptionOr<void> WebAnimation::play(AutoRewind autoRewind) > > // 6. If animation's hold time is resolved, let its start time be unresolved. > if (m_holdTime) >- m_startTime = std::nullopt; >+ m_startTime = WTF::nullopt; > > // 7. If has pending ready promise is false, let animation's current ready promise be a new (pending) Promise object. > if (!hasPendingReadyPromise) >@@ -930,7 +930,7 @@ void WebAnimation::runPendingPlayTask() > // If the animation playback rate is zero, let new start time be simply ready time. > // FIXME: Implementation cannot guarantee an active timeline at the point of this async dispatch. > // Subsequently, the resulting readyTime value can be null. Unify behavior between C++17 and >- // C++14 builds (the latter using WTF's std::optional) and avoid null std::optional dereferencing >+ // C++14 builds (the latter using WTF's Optional) and avoid null Optional dereferencing > // by defaulting to a Seconds(0) value. See https://bugs.webkit.org/show_bug.cgi?id=186189. > auto newStartTime = readyTime.value_or(0_s); > if (m_playbackRate) >@@ -939,7 +939,7 @@ void WebAnimation::runPendingPlayTask() > m_startTime = newStartTime; > // 4. If animation's playback rate is not 0, make animation's hold time unresolved. > if (m_playbackRate) >- m_holdTime = std::nullopt; >+ m_holdTime = WTF::nullopt; > } else if (m_startTime && m_pendingPlaybackRate) { > // If animation's start time is resolved and animation has a pending playback rate, > // 1. Let current time to match be the result of evaluating (ready time - start time) à playback rate for animation. >@@ -1072,7 +1072,7 @@ void WebAnimation::runPendingPauseTask() > if (animationStartTime && !m_holdTime) { > // FIXME: Implementation cannot guarantee an active timeline at the point of this async dispatch. > // Subsequently, the resulting readyTime value can be null. Unify behavior between C++17 and >- // C++14 builds (the latter using WTF's std::optional) and avoid null std::optional dereferencing >+ // C++14 builds (the latter using WTF's Optional) and avoid null Optional dereferencing > // by defaulting to a Seconds(0) value. See https://bugs.webkit.org/show_bug.cgi?id=186189. > m_holdTime = (readyTime.value_or(0_s) - animationStartTime.value()) * m_playbackRate; > } >@@ -1081,7 +1081,7 @@ void WebAnimation::runPendingPauseTask() > applyPendingPlaybackRate(); > > // 4. Make animation's start time unresolved. >- m_startTime = std::nullopt; >+ m_startTime = WTF::nullopt; > > // 5. Resolve animation's current ready promise with animation. > if (!m_readyPromise->isFulfilled()) >diff --git a/Source/WebCore/animation/WebAnimation.h b/Source/WebCore/animation/WebAnimation.h >index c99dafa1ba652d1899af0ba3660a338937830ac0..857beca6439732ffd8686e6228b0e2fe12a0a43d 100644 >--- a/Source/WebCore/animation/WebAnimation.h >+++ b/Source/WebCore/animation/WebAnimation.h >@@ -65,8 +65,8 @@ public: > AnimationTimeline* timeline() const { return m_timeline.get(); } > virtual void setTimeline(RefPtr<AnimationTimeline>&&); > >- std::optional<Seconds> currentTime() const; >- ExceptionOr<void> setCurrentTime(std::optional<Seconds>); >+ Optional<Seconds> currentTime() const; >+ ExceptionOr<void> setCurrentTime(Optional<Seconds>); > > enum class Silently { Yes, No }; > double playbackRate() const { return m_playbackRate + 0; } >@@ -91,10 +91,10 @@ public: > ExceptionOr<void> pause(); > ExceptionOr<void> reverse(); > >- virtual std::optional<double> startTime() const; >- virtual void setStartTime(std::optional<double>); >- virtual std::optional<double> bindingsCurrentTime() const; >- virtual ExceptionOr<void> setBindingsCurrentTime(std::optional<double>); >+ virtual Optional<double> startTime() const; >+ virtual void setStartTime(Optional<double>); >+ virtual Optional<double> bindingsCurrentTime() const; >+ virtual ExceptionOr<void> setBindingsCurrentTime(Optional<double>); > virtual PlayState bindingsPlayState() const { return playState(); } > virtual bool bindingsPending() const { return pending(); } > virtual ReadyPromise& bindingsReady() { return ready(); } >@@ -136,12 +136,12 @@ private: > > void timingDidChange(DidSeek, SynchronouslyNotify); > void updateFinishedState(DidSeek, SynchronouslyNotify); >- void enqueueAnimationPlaybackEvent(const AtomicString&, std::optional<Seconds>, std::optional<Seconds>); >+ void enqueueAnimationPlaybackEvent(const AtomicString&, Optional<Seconds>, Optional<Seconds>); > Seconds effectEndTime() const; > WebAnimation& readyPromiseResolve(); > WebAnimation& finishedPromiseResolve(); >- std::optional<Seconds> currentTime(RespectHoldTime) const; >- ExceptionOr<void> silentlySetCurrentTime(std::optional<Seconds>); >+ Optional<Seconds> currentTime(RespectHoldTime) const; >+ ExceptionOr<void> silentlySetCurrentTime(Optional<Seconds>); > void finishNotificationSteps(); > void scheduleMicrotaskIfNeeded(); > void performMicrotask(); >@@ -163,12 +163,12 @@ private: > String m_id; > RefPtr<AnimationEffect> m_effect; > RefPtr<AnimationTimeline> m_timeline; >- std::optional<Seconds> m_previousCurrentTime; >- std::optional<Seconds> m_startTime; >- std::optional<Seconds> m_holdTime; >+ Optional<Seconds> m_previousCurrentTime; >+ Optional<Seconds> m_startTime; >+ Optional<Seconds> m_holdTime; > int m_suspendCount { 0 }; > double m_playbackRate { 1 }; >- std::optional<double> m_pendingPlaybackRate; >+ Optional<double> m_pendingPlaybackRate; > bool m_isStopped { false }; > bool m_isSuspended { false }; > bool m_finishNotificationStepsMicrotaskPending; >diff --git a/Source/WebCore/bindings/IDLTypes.h b/Source/WebCore/bindings/IDLTypes.h >index 8057dfa115888d3db4a0f0be26b4c662b69c787c..18a3c10e3bf0c4735c9901902d5acddff3f4f638 100644 >--- a/Source/WebCore/bindings/IDLTypes.h >+++ b/Source/WebCore/bindings/IDLTypes.h >@@ -65,13 +65,13 @@ struct IDLType { > using StorageType = T; > > using ParameterType = T; >- using NullableParameterType = std::optional<ImplementationType>; >+ using NullableParameterType = Optional<ImplementationType>; > > using InnerParameterType = T; >- using NullableInnerParameterType = std::optional<ImplementationType>; >+ using NullableInnerParameterType = Optional<ImplementationType>; > >- using NullableType = std::optional<ImplementationType>; >- static NullableType nullValue() { return std::nullopt; } >+ using NullableType = Optional<ImplementationType>; >+ static NullableType nullValue() { return WTF::nullopt; } > static bool isNullValue(const NullableType& value) { return !value; } > static ImplementationType extractValueFromNullable(const NullableType& value) { return value.value(); } > }; >@@ -204,14 +204,14 @@ template<typename T> struct IDLSequence : IDLType<Vector<typename T::Implementat > using InnerType = T; > > using ParameterType = const Vector<typename T::InnerParameterType>&; >- using NullableParameterType = const std::optional<Vector<typename T::InnerParameterType>>&; >+ using NullableParameterType = const Optional<Vector<typename T::InnerParameterType>>&; > }; > > template<typename T> struct IDLFrozenArray : IDLType<Vector<typename T::ImplementationType>> { > using InnerType = T; > > using ParameterType = const Vector<typename T::ImplementationType>&; >- using NullableParameterType = const std::optional<Vector<typename T::ImplementationType>>&; >+ using NullableParameterType = const Optional<Vector<typename T::ImplementationType>>&; > }; > > template<typename K, typename V> struct IDLRecord : IDLType<Vector<WTF::KeyValuePair<typename K::ImplementationType, typename V::ImplementationType>>> { >@@ -219,7 +219,7 @@ template<typename K, typename V> struct IDLRecord : IDLType<Vector<WTF::KeyValue > using ValueType = V; > > using ParameterType = const Vector<WTF::KeyValuePair<typename K::ImplementationType, typename V::ImplementationType>>&; >- using NullableParameterType = const std::optional<Vector<WTF::KeyValuePair<typename K::ImplementationType, typename V::ImplementationType>>>&; >+ using NullableParameterType = const Optional<Vector<WTF::KeyValuePair<typename K::ImplementationType, typename V::ImplementationType>>>&; > }; > > template<typename T> struct IDLPromise : IDLWrapper<DOMPromise> { >@@ -234,7 +234,7 @@ struct IDLUnion : IDLType<Variant<typename Ts::ImplementationType...>> { > using TypeList = brigand::list<Ts...>; > > using ParameterType = const Variant<typename Ts::ImplementationType...>&; >- using NullableParameterType = const std::optional<Variant<typename Ts::ImplementationType...>>&; >+ using NullableParameterType = const Optional<Variant<typename Ts::ImplementationType...>>&; > }; > > template<typename T> struct IDLBufferSource : IDLWrapper<T> { }; >diff --git a/Source/WebCore/bindings/js/DOMPromiseProxy.h b/Source/WebCore/bindings/js/DOMPromiseProxy.h >index 8b26e3a2830f183a41b7f55acf9f8af490eba33f..e75c3ed40a9ad4c32c90d82811d5ea75065ea755 100644 >--- a/Source/WebCore/bindings/js/DOMPromiseProxy.h >+++ b/Source/WebCore/bindings/js/DOMPromiseProxy.h >@@ -53,7 +53,7 @@ public: > void reject(Exception); > > private: >- std::optional<ExceptionOr<Value>> m_valueOrException; >+ Optional<ExceptionOr<Value>> m_valueOrException; > Vector<Ref<DeferredPromise>, 1> m_deferredPromises; > }; > >@@ -73,7 +73,7 @@ public: > void reject(Exception); > > private: >- std::optional<ExceptionOr<void>> m_valueOrException; >+ Optional<ExceptionOr<void>> m_valueOrException; > Vector<Ref<DeferredPromise>, 1> m_deferredPromises; > }; > >@@ -103,7 +103,7 @@ public: > > private: > ResolveCallback m_resolveCallback; >- std::optional<ExceptionOr<void>> m_valueOrException; >+ Optional<ExceptionOr<void>> m_valueOrException; > Vector<Ref<DeferredPromise>, 1> m_deferredPromises; > }; > >@@ -138,7 +138,7 @@ inline JSC::JSValue DOMPromiseProxy<IDLType>::promise(JSC::ExecState& state, JSD > template<typename IDLType> > inline void DOMPromiseProxy<IDLType>::clear() > { >- m_valueOrException = std::nullopt; >+ m_valueOrException = WTF::nullopt; > m_deferredPromises.clear(); > } > >@@ -207,7 +207,7 @@ inline JSC::JSValue DOMPromiseProxy<IDLVoid>::promise(JSC::ExecState& state, JSD > > inline void DOMPromiseProxy<IDLVoid>::clear() > { >- m_valueOrException = std::nullopt; >+ m_valueOrException = WTF::nullopt; > m_deferredPromises.clear(); > } > >@@ -275,7 +275,7 @@ inline JSC::JSValue DOMPromiseProxyWithResolveCallback<IDLType>::promise(JSC::Ex > template<typename IDLType> > inline void DOMPromiseProxyWithResolveCallback<IDLType>::clear() > { >- m_valueOrException = std::nullopt; >+ m_valueOrException = WTF::nullopt; > m_deferredPromises.clear(); > } > >diff --git a/Source/WebCore/bindings/js/JSDOMAbstractOperations.h b/Source/WebCore/bindings/js/JSDOMAbstractOperations.h >index 179abf4b175bdc554f0581639764403d6d216a5d..9ce6e7a80b2316f3607c5860f5f5638d03c9e7f6 100644 >--- a/Source/WebCore/bindings/js/JSDOMAbstractOperations.h >+++ b/Source/WebCore/bindings/js/JSDOMAbstractOperations.h >@@ -91,17 +91,17 @@ static auto accessVisibleNamedProperty(JSC::ExecState& state, JSClass& thisObjec > // NOTE: While it is not specified, a Symbol can never be a 'supported property > // name' so we check that first. > if (propertyName.isSymbol()) >- return std::nullopt; >+ return WTF::nullopt; > > // 1. If P is not a supported property name of O, then return false. > auto result = itemAccessor(thisObject, propertyName); > if (!result) >- return std::nullopt; >+ return WTF::nullopt; > > // 2. If O has an own property named P, then return false. > JSC::PropertySlot slot { &thisObject, JSC::PropertySlot::InternalMethodType::VMInquiry }; > if (JSC::JSObject::getOwnPropertySlot(&thisObject, &state, propertyName, slot)) >- return std::nullopt; >+ return WTF::nullopt; > > // 3. If O implements an interface that has the [OverrideBuiltins] extended attribute, then return true. > if (overrideBuiltins == OverrideBuiltins::Yes && !worldForDOMObject(thisObject).shouldDisableOverrideBuiltinsBehavior()) >@@ -114,7 +114,7 @@ static auto accessVisibleNamedProperty(JSC::ExecState& state, JSClass& thisObjec > // 2. Set prototype to be the value of the internal [[Prototype]] property of prototype. > auto prototype = thisObject.getPrototypeDirect(state.vm()); > if (prototype.isObject() && JSC::asObject(prototype)->getPropertySlot(&state, propertyName, slot)) >- return std::nullopt; >+ return WTF::nullopt; > > // 6. Return true. > return result; >diff --git a/Source/WebCore/bindings/js/JSDOMConvertAny.h b/Source/WebCore/bindings/js/JSDOMConvertAny.h >index 3734a8b732b86d9f333c3d31e1a0b86bdc6001de..9e7ca09983b74af1bc3026d387c9632c9d3dad49 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertAny.h >+++ b/Source/WebCore/bindings/js/JSDOMConvertAny.h >@@ -64,13 +64,13 @@ template<> struct JSConverter<IDLAny> { > template<> struct VariadicConverter<IDLAny> { > using Item = typename IDLAny::ImplementationType; > >- static std::optional<Item> convert(JSC::ExecState& state, JSC::JSValue value) >+ static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value) > { > auto& vm = state.vm(); > auto scope = DECLARE_THROW_SCOPE(vm); > > auto result = Converter<IDLAny>::convert(state, value); >- RETURN_IF_EXCEPTION(scope, std::nullopt); >+ RETURN_IF_EXCEPTION(scope, WTF::nullopt); > > return Item { vm, result }; > } >diff --git a/Source/WebCore/bindings/js/JSDOMConvertEnumeration.h b/Source/WebCore/bindings/js/JSDOMConvertEnumeration.h >index 4316aa0110d004cd000eb0c4459998a419880cd5..1feb897929b29b31f57aec5b7e32d9fa668d5e7d 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertEnumeration.h >+++ b/Source/WebCore/bindings/js/JSDOMConvertEnumeration.h >@@ -31,7 +31,7 @@ > namespace WebCore { > > // Specialized by generated code for IDL enumeration conversion. >-template<typename T> std::optional<T> parseEnumeration(JSC::ExecState&, JSC::JSValue); >+template<typename T> Optional<T> parseEnumeration(JSC::ExecState&, JSC::JSValue); > template<typename T> const char* expectedEnumerationValues(); > > // Specialized by generated code for IDL enumeration conversion. >diff --git a/Source/WebCore/bindings/js/JSDOMConvertInterface.h b/Source/WebCore/bindings/js/JSDOMConvertInterface.h >index f239110d3f8e32e45fafdf7ed71445933e2f9eb1..aef8ab3c8d204376455fea2b4f7ad524d2cb08e5 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertInterface.h >+++ b/Source/WebCore/bindings/js/JSDOMConvertInterface.h >@@ -91,12 +91,12 @@ template<typename T> struct JSConverter<IDLInterface<T>> { > template<typename T> struct VariadicConverter<IDLInterface<T>> { > using Item = std::reference_wrapper<T>; > >- static std::optional<Item> convert(JSC::ExecState& state, JSC::JSValue value) >+ static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value) > { > auto* result = Converter<IDLInterface<T>>::convert(state, value); > if (!result) >- return std::nullopt; >- return std::optional<Item> { *result }; >+ return WTF::nullopt; >+ return Optional<Item> { *result }; > } > }; > >diff --git a/Source/WebCore/bindings/js/JSDOMConvertUnion.h b/Source/WebCore/bindings/js/JSDOMConvertUnion.h >index 7ba91351adb580588eef8c0896e5d5b9d244c311..2357157372d25cfc5631f957cb2c6b41c3643b99 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertUnion.h >+++ b/Source/WebCore/bindings/js/JSDOMConvertUnion.h >@@ -42,7 +42,7 @@ struct ConditionalReturner; > template<typename ReturnType> > struct ConditionalReturner<ReturnType, true> { > template<typename T> >- static std::optional<ReturnType> get(T&& value) >+ static Optional<ReturnType> get(T&& value) > { > return ReturnType(std::forward<T>(value)); > } >@@ -51,9 +51,9 @@ struct ConditionalReturner<ReturnType, true> { > template<typename ReturnType> > struct ConditionalReturner<ReturnType, false> { > template<typename T> >- static std::optional<ReturnType> get(T&&) >+ static Optional<ReturnType> get(T&&) > { >- return std::nullopt; >+ return WTF::nullopt; > } > }; > >@@ -62,7 +62,7 @@ struct ConditionalConverter; > > template<typename ReturnType, typename T> > struct ConditionalConverter<ReturnType, T, true> { >- static std::optional<ReturnType> convert(JSC::ExecState& state, JSC::JSValue value) >+ static Optional<ReturnType> convert(JSC::ExecState& state, JSC::JSValue value) > { > return ReturnType(Converter<T>::convert(state, value)); > } >@@ -70,9 +70,9 @@ struct ConditionalConverter<ReturnType, T, true> { > > template<typename ReturnType, typename T> > struct ConditionalConverter<ReturnType, T, false> { >- static std::optional<ReturnType> convert(JSC::ExecState&, JSC::JSValue) >+ static Optional<ReturnType> convert(JSC::ExecState&, JSC::JSValue) > { >- return std::nullopt; >+ return WTF::nullopt; > } > }; > >@@ -81,7 +81,7 @@ struct ConditionalSequenceConverter; > > template<typename ReturnType, typename T> > struct ConditionalSequenceConverter<ReturnType, T, true> { >- static std::optional<ReturnType> convert(JSC::ExecState& state, JSC::JSObject* object, JSC::JSValue method) >+ static Optional<ReturnType> convert(JSC::ExecState& state, JSC::JSObject* object, JSC::JSValue method) > { > return ReturnType(Converter<T>::convert(state, object, method)); > } >@@ -89,9 +89,9 @@ struct ConditionalSequenceConverter<ReturnType, T, true> { > > template<typename ReturnType, typename T> > struct ConditionalSequenceConverter<ReturnType, T, false> { >- static std::optional<ReturnType> convert(JSC::ExecState&, JSC::JSObject*, JSC::JSValue) >+ static Optional<ReturnType> convert(JSC::ExecState&, JSC::JSObject*, JSC::JSValue) > { >- return std::nullopt; >+ return WTF::nullopt; > } > }; > >@@ -191,7 +191,7 @@ template<typename... T> struct Converter<IDLUnion<T...>> : DefaultConverter<IDLU > // 2. If types includes object, then return the IDL value that is a reference to the object V. > // (FIXME: Add support for object and step 4.2) > if (brigand::any<TypeList, IsIDLInterface<brigand::_1>>::value) { >- std::optional<ReturnType> returnValue; >+ Optional<ReturnType> returnValue; > brigand::for_each<InterfaceTypeList>([&](auto&& type) { > if (returnValue) > return; >@@ -264,7 +264,7 @@ template<typename... T> struct Converter<IDLUnion<T...>> : DefaultConverter<IDLU > // (FIXME: Add support for object and step 9.2) > constexpr bool hasTypedArrayType = brigand::any<TypeList, IsIDLTypedArray<brigand::_1>>::value; > if (hasTypedArrayType) { >- std::optional<ReturnType> returnValue; >+ Optional<ReturnType> returnValue; > brigand::for_each<TypedArrayTypeList>([&](auto&& type) { > if (returnValue) > return; >@@ -391,7 +391,7 @@ template<typename... T> struct JSConverter<IDLUnion<T...>> { > { > auto index = variant.index(); > >- std::optional<JSC::JSValue> returnValue; >+ Optional<JSC::JSValue> returnValue; > brigand::for_each<Sequence>([&](auto&& type) { > using I = typename WTF::RemoveCVAndReference<decltype(type)>::type::type; > if (I::value == index) { >diff --git a/Source/WebCore/bindings/js/JSDOMConvertVariadic.h b/Source/WebCore/bindings/js/JSDOMConvertVariadic.h >index 18bd11f68e52f6ef5fb54943a33b10c9a65498ed..0d214d184f8278ddec216491a31a0988e2788853 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertVariadic.h >+++ b/Source/WebCore/bindings/js/JSDOMConvertVariadic.h >@@ -34,13 +34,13 @@ template<typename IDLType> > struct VariadicConverter { > using Item = typename IDLType::ImplementationType; > >- static std::optional<Item> convert(JSC::ExecState& state, JSC::JSValue value) >+ static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value) > { > auto& vm = state.vm(); > auto scope = DECLARE_THROW_SCOPE(vm); > > auto result = Converter<IDLType>::convert(state, value); >- RETURN_IF_EXCEPTION(scope, std::nullopt); >+ RETURN_IF_EXCEPTION(scope, WTF::nullopt); > > return WTFMove(result); > } >diff --git a/Source/WebCore/bindings/js/JSDOMIterator.h b/Source/WebCore/bindings/js/JSDOMIterator.h >index 32c4005a147cb7d717f80ef5880b9e2433ffbe3e..2709b1fb980f17038dcb9c7a84756799ce2a4ebd 100644 >--- a/Source/WebCore/bindings/js/JSDOMIterator.h >+++ b/Source/WebCore/bindings/js/JSDOMIterator.h >@@ -118,7 +118,7 @@ private: > > static void destroy(JSC::JSCell*); > >- std::optional<typename DOMWrapped::Iterator> m_iterator; >+ Optional<typename DOMWrapped::Iterator> m_iterator; > IterationKind m_kind; > }; > >@@ -240,7 +240,7 @@ JSC::JSValue JSDOMIterator<JSWrapper, IteratorTraits>::next(JSC::ExecState& stat > auto iteratorValue = m_iterator->next(); > if (iteratorValue) > return createIteratorResultObject(&state, asJS(state, iteratorValue), false); >- m_iterator = std::nullopt; >+ m_iterator = WTF::nullopt; > } > return createIteratorResultObject(&state, JSC::jsUndefined(), true); > } >diff --git a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >index f2eb2f78be6bee815bd05a1f8b00fd591a287aab..60b8c525724ea78709c981efa2a93cb8537ff993 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >@@ -351,12 +351,12 @@ JSC::JSObject* JSDOMWindowBase::moduleLoaderCreateImportMetaProperties(JSC::JSGl > } > > #if ENABLE(WEBASSEMBLY) >-static std::optional<Vector<uint8_t>> tryAllocate(JSC::ExecState* exec, JSC::JSPromiseDeferred* promise, const char* data, size_t byteSize) >+static Optional<Vector<uint8_t>> tryAllocate(JSC::ExecState* exec, JSC::JSPromiseDeferred* promise, const char* data, size_t byteSize) > { > Vector<uint8_t> arrayBuffer; > if (!arrayBuffer.tryReserveCapacity(byteSize)) { > promise->reject(exec, createOutOfMemoryError(exec)); >- return std::nullopt; >+ return WTF::nullopt; > } > > arrayBuffer.grow(byteSize); >diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >index 33b88ca9eaa54df71a2c2fb8f358a997caa0797d..d68e703efe77dfc0f8cfc1dcec393924f4d33516 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >@@ -182,7 +182,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* state, Propert > { > // (1) First, indexed properties. > // Hand off all indexed access to getOwnPropertySlotByIndex, which supports the indexed getter. >- if (std::optional<unsigned> index = parseIndex(propertyName)) >+ if (Optional<unsigned> index = parseIndex(propertyName)) > return getOwnPropertySlotByIndex(object, state, index.value(), slot); > > auto* thisObject = jsCast<JSDOMWindow*>(object); >@@ -235,7 +235,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, > slot.disableCaching(); > > String errorMessage; >- std::optional<bool> cachedIsCrossOriginAccess; >+ Optional<bool> cachedIsCrossOriginAccess; > auto isCrossOriginAccess = [&] { > if (!cachedIsCrossOriginAccess) > cachedIsCrossOriginAccess = !BindingSecurity::shouldAllowAccessToDOMWindow(*state, window, errorMessage); >diff --git a/Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp >index a7a50812c3c4715ac8c614dbbef4474e072f62b9..92a430c5e9e61987e3a9b5686ea44afa05681703 100644 >--- a/Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp >+++ b/Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp >@@ -34,7 +34,7 @@ using namespace JSC; > > bool JSRemoteDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot) > { >- if (std::optional<unsigned> index = parseIndex(propertyName)) >+ if (Optional<unsigned> index = parseIndex(propertyName)) > return getOwnPropertySlotByIndex(object, state, index.value(), slot); > > auto* thisObject = jsCast<JSRemoteDOMWindow*>(object); >diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp >index 21d1d347ca1d07e17a62ba76b5af79b121e23524..280b7e53835cea42c7dea66dd9ae6b64b405c1c8 100644 >--- a/Source/WebCore/bindings/js/ScriptController.cpp >+++ b/Source/WebCore/bindings/js/ScriptController.cpp >@@ -295,7 +295,7 @@ void ScriptController::setupModuleScriptHandlers(LoadableModuleScript& moduleScr > case ModuleFetchFailureKind::WasErrored: > moduleScript->notifyLoadFailed(LoadableScript::Error { > LoadableScript::ErrorType::CachedScript, >- std::nullopt >+ WTF::nullopt > }); > break; > case ModuleFetchFailureKind::WasCanceled: >@@ -542,7 +542,7 @@ void ScriptController::clearScriptObjects() > > JSValue ScriptController::executeScriptInWorld(DOMWrapperWorld& world, const String& script, bool forceUserGesture, ExceptionDetails* exceptionDetails) > { >- UserGestureIndicator gestureIndicator(forceUserGesture ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt); >+ UserGestureIndicator gestureIndicator(forceUserGesture ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt); > ScriptSourceCode sourceCode(script, m_frame.document()->url(), TextPosition(), JSC::SourceProviderSourceType::Program, CachedScriptFetcher::create(m_frame.document()->charset())); > > if (!canExecuteScripts(AboutToExecuteScript) || isPaused()) >@@ -571,7 +571,7 @@ bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso > > JSValue ScriptController::executeScript(const String& script, bool forceUserGesture, ExceptionDetails* exceptionDetails) > { >- UserGestureIndicator gestureIndicator(forceUserGesture ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt); >+ UserGestureIndicator gestureIndicator(forceUserGesture ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt); > return executeScript(ScriptSourceCode(script, m_frame.document()->url(), TextPosition(), JSC::SourceProviderSourceType::Program, CachedScriptFetcher::create(m_frame.document()->charset())), exceptionDetails); > } > >diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp >index 2b8d9c0528ba8ceb9873cb6f133593635bc3faa5..99981085b5505c745c975a6d97abc58ceae1c5f9 100644 >--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp >+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp >@@ -2066,7 +2066,7 @@ private: > CachedStringRef name; > if (!readStringData(name)) > return false; >- std::optional<int64_t> optionalLastModified; >+ Optional<int64_t> optionalLastModified; > if (m_version > 6) { > double lastModified; > if (!read(lastModified)) >@@ -2629,17 +2629,17 @@ private: > return toJSNewlyCreated(m_exec, jsCast<JSDOMGlobalObject*>(m_globalObject), T::create(x, y, width, height)); > } > >- std::optional<DOMPointInit> readDOMPointInit() >+ Optional<DOMPointInit> readDOMPointInit() > { > DOMPointInit point; > if (!read(point.x)) >- return std::nullopt; >+ return WTF::nullopt; > if (!read(point.y)) >- return std::nullopt; >+ return WTF::nullopt; > if (!read(point.z)) >- return std::nullopt; >+ return WTF::nullopt; > if (!read(point.w)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(point); > } >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index a93453aaff446b2a270fd85a980512fee29f7736..5601710c41b07d1b63e6323cc6a8396961792272 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -591,15 +591,15 @@ sub GenerateNamedGetterLambda > # dependant on the IDL type). This is based on the assumption that no named getter will > # ever actually want to return null as an actual return value, which seems like an ok > # assumption to make (should it turn out this doesn't hold in the future, we have lots >- # of options; do two lookups, add an extra layer of std::optional, etc.). >+ # of options; do two lookups, add an extra layer of Optional, etc.). > > my $resultType = "typename ${IDLType}::ImplementationType"; > $resultType = "ExceptionOr<" . $resultType . ">" if $namedGetterOperation->extendedAttributes->{MayThrowException}; >- my $returnType = "std::optional<" . $resultType . ">"; >+ my $returnType = "Optional<" . $resultType . ">"; > > push(@$outputArray, " auto getterFunctor = [] (auto& thisObject, auto propertyName) -> ${returnType} {\n"); > >- my @arguments = GenerateCallWithUsingReferences($namedGetterOperation->extendedAttributes->{CallWith}, $outputArray, "std::nullopt", "thisObject", " "); >+ my @arguments = GenerateCallWithUsingReferences($namedGetterOperation->extendedAttributes->{CallWith}, $outputArray, "WTF::nullopt", "thisObject", " "); > push(@arguments, "propertyNameToAtomicString(propertyName)"); > > push(@$outputArray, " auto result = thisObject.wrapped().${namedGetterFunctionName}(" . join(", ", @arguments) . ");\n"); >@@ -609,11 +609,11 @@ sub GenerateNamedGetterLambda > push(@$outputArray, " return ${resultType} { result.releaseException() };\n"); > push(@$outputArray, " if (!${IDLType}::isNullValue(result.returnValue()))\n"); > push(@$outputArray, " return ${resultType} { ${IDLType}::extractValueFromNullable(result.releaseReturnValue()) };\n"); >- push(@$outputArray, " return std::nullopt;\n"); >+ push(@$outputArray, " return WTF::nullopt;\n"); > } else { > push(@$outputArray, " if (!${IDLType}::isNullValue(result))\n"); > push(@$outputArray, " return ${resultType} { ${IDLType}::extractValueFromNullable(result) };\n"); >- push(@$outputArray, " return std::nullopt;\n"); >+ push(@$outputArray, " return WTF::nullopt;\n"); > } > push(@$outputArray, " };\n"); > } >@@ -2090,7 +2090,7 @@ sub GenerateEnumerationImplementationContent > # FIXME: Change to take VM& instead of ExecState&. > # FIXME: Consider using toStringOrNull to make exception checking faster. > # FIXME: Consider finding a more efficient way to match against all the strings quickly. >- $result .= "template<> std::optional<$className> parseEnumeration<$className>(ExecState& state, JSValue value)\n"; >+ $result .= "template<> Optional<$className> parseEnumeration<$className>(ExecState& state, JSValue value)\n"; > $result .= "{\n"; > $result .= " auto stringValue = value.toWTFString(&state);\n"; > foreach my $value (@{$enumeration->values}) { >@@ -2102,7 +2102,7 @@ sub GenerateEnumerationImplementationContent > } > $result .= " return ${className}::${enumerationValueName};\n"; > } >- $result .= " return std::nullopt;\n"; >+ $result .= " return WTF::nullopt;\n"; > $result .= "}\n\n"; > > $result .= "template<> const char* expectedEnumerationValues<$className>()\n"; >@@ -2143,7 +2143,7 @@ sub GenerateEnumerationHeaderContent > > $result .= "${exportMacro}String convertEnumerationToString($className);\n"; > $result .= "template<> ${exportMacro}JSC::JSString* convertEnumerationToJS(JSC::ExecState&, $className);\n\n"; >- $result .= "template<> ${exportMacro}std::optional<$className> parseEnumeration<$className>(JSC::ExecState&, JSC::JSValue);\n"; >+ $result .= "template<> ${exportMacro}Optional<$className> parseEnumeration<$className>(JSC::ExecState&, JSC::JSValue);\n"; > $result .= "template<> ${exportMacro}const char* expectedEnumerationValues<$className>();\n\n"; > $result .= "#endif\n\n" if $conditionalString; > >@@ -2202,7 +2202,7 @@ sub GenerateDefaultValue > # FIXME: Would be nice to report an error if the value is not one of the enumeration values. > if ($defaultValue eq "null") { > die if !$type->isNullable; >- return "std::nullopt"; >+ return "WTF::nullopt"; > } > my $className = GetEnumerationClassName($type, $typeScope); > my $enumerationValueName = GetEnumerationValueName(substr($defaultValue, 1, -1)); >@@ -2210,7 +2210,7 @@ sub GenerateDefaultValue > } > if ($defaultValue eq "null") { > if ($type->isUnion) { >- return "std::nullopt" if $type->isNullable; >+ return "WTF::nullopt" if $type->isNullable; > > my $IDLType = GetIDLType($typeScope, $type); > return "convert<${IDLType}>(state, jsNull());"; >@@ -2219,7 +2219,7 @@ sub GenerateDefaultValue > return "jsNull()" if $type->name eq "any"; > return "nullptr" if $codeGenerator->IsWrapperType($type) || $codeGenerator->IsBufferSourceType($type); > return "String()" if $codeGenerator->IsStringType($type); >- return "std::nullopt"; >+ return "WTF::nullopt"; > } > > if ($defaultValue eq "[]") { >@@ -5740,8 +5740,8 @@ sub GenerateParametersCheck > if ($codeGenerator->IsPromiseType($argument->type)) { > $defaultValue = "nullptr"; > } else { >- $defaultValue = "std::optional<Converter<$argumentIDLType>::ReturnType>()"; >- $nativeValueCastFunction = "std::optional<Converter<$argumentIDLType>::ReturnType>"; >+ $defaultValue = "Optional<Converter<$argumentIDLType>::ReturnType>()"; >+ $nativeValueCastFunction = "Optional<Converter<$argumentIDLType>::ReturnType>"; > } > > $optionalCheck = "state->argument($argumentIndex).isUndefined() ? $defaultValue : "; >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp >index dbd71818c290d03dabf3c1557092d8abd67b6843..6b81bffe495e500bcba3451c7fd7b6bee7754250 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp >@@ -485,7 +485,7 @@ static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperation > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto variantOptionalArg = state->argument(0).isUndefined() ? std::optional<Converter<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>::ReturnType>() : std::optional<Converter<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>::ReturnType>(convert<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>(*state, state->uncheckedArgument(0))); >+ auto variantOptionalArg = state->argument(0).isUndefined() ? Optional<Converter<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>::ReturnType>() : Optional<Converter<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>::ReturnType>(convert<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > if (UNLIKELY(impl.callTracingActive())) { > Vector<TestCallTracerInterfaceVariant> callTracerParameters; >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp >index 2fc738220b8d75c2a7083534ab312b52f559d649..be333567733fe74bb0e5d9cd4db1b67cd70cd911 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp >@@ -64,14 +64,14 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestCallbackInterf > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestCallbackInterface::Enum> parseEnumeration<TestCallbackInterface::Enum>(ExecState& state, JSValue value) >+template<> Optional<TestCallbackInterface::Enum> parseEnumeration<TestCallbackInterface::Enum>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "value1") > return TestCallbackInterface::Enum::Value1; > if (stringValue == "value2") > return TestCallbackInterface::Enum::Value2; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestCallbackInterface::Enum>() >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h b/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h >index 8f21fd2c55ad804ffe678b6f46c409505eb4bea6..c7f34daf3a23a560311a67f2958a780d5ba9719b 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h >@@ -69,7 +69,7 @@ inline JSC::JSValue toJS(TestCallbackInterface* impl) { return impl ? toJS(*impl > String convertEnumerationToString(TestCallbackInterface::Enum); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestCallbackInterface::Enum); > >-template<> std::optional<TestCallbackInterface::Enum> parseEnumeration<TestCallbackInterface::Enum>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestCallbackInterface::Enum> parseEnumeration<TestCallbackInterface::Enum>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestCallbackInterface::Enum>(); > > template<> TestCallbackInterface::Dictionary convertDictionary<TestCallbackInterface::Dictionary>(JSC::ExecState&, JSC::JSValue); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp >index 54b9205782f965d3b7569e9c31d3e5a6bff51a8a..5fc7cb6c555e745bcfbabca0643118c6d61f076f 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp >@@ -151,11 +151,11 @@ bool JSTestEventTarget::getOwnPropertySlot(JSObject* object, ExecState* state, P > return JSObject::getOwnPropertySlot(object, state, propertyName, slot); > } > using GetterIDLType = IDLInterface<Node>; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLInterface<Node>>(*state, *thisObject->globalObject(), WTFMove(namedProperty.value())); >@@ -179,11 +179,11 @@ bool JSTestEventTarget::getOwnPropertySlotByIndex(JSObject* object, ExecState* s > } > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLInterface<Node>; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLInterface<Node>>(*state, *thisObject->globalObject(), WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp >index 9c2a2dd91ccf9eed1dbc6d9dd115cf9c17cee38e..35b77a74db67869f4da76726848ca3c633950c57 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp >@@ -150,11 +150,11 @@ bool JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlot(JSObject* objec > return JSObject::getOwnPropertySlot(object, state, propertyName, slot); > } > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -178,11 +178,11 @@ bool JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlotByIndex(JSObject > } > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp >index e72a66a5ce05d0c565000e956b4d42fbf99531f4..f1b1da1b54b4ba24c8794e921db565b991c9dc7f 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp >@@ -150,11 +150,11 @@ bool JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlot(JSObject* > return JSObject::getOwnPropertySlot(object, state, propertyName, slot); > } > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -178,11 +178,11 @@ bool JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlotByIndex(JSO > } > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp >index 67af9e19e5979ea8ec23969979a7efe8590ad10e..fb6089cbd41a5bfe3282737b227158d30817fe7a 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp >@@ -159,11 +159,11 @@ bool JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlot(JSObject* obj > return JSObject::getOwnPropertySlot(object, state, propertyName, slot); > } > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -187,11 +187,11 @@ bool JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlotByIndex(JSObje > } > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp >index c0787f754647eb91a3374add599259602cf12e0d..e7d91f8c868c253d6b88012142553112c3f8d80e 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp >@@ -141,11 +141,11 @@ bool JSTestNamedDeleterNoIdentifier::getOwnPropertySlot(JSObject* object, ExecSt > auto* thisObject = jsCast<JSTestNamedDeleterNoIdentifier*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -161,11 +161,11 @@ bool JSTestNamedDeleterNoIdentifier::getOwnPropertySlotByIndex(JSObject* object, > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp >index 25bf0b2cc499da3d3d6a31d0f70feaace6bdab75..a7d76ba7a3deb5845304be65c89d8e0da29daf7a 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp >@@ -141,11 +141,11 @@ bool JSTestNamedDeleterThrowingException::getOwnPropertySlot(JSObject* object, E > auto* thisObject = jsCast<JSTestNamedDeleterThrowingException*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -161,11 +161,11 @@ bool JSTestNamedDeleterThrowingException::getOwnPropertySlotByIndex(JSObject* ob > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp >index 0eb3a6ea6502c719b25468c2e45ce4803c209444..9edab591d948349650ad123919f6b36316d54d6b 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp >@@ -147,11 +147,11 @@ bool JSTestNamedDeleterWithIdentifier::getOwnPropertySlot(JSObject* object, Exec > auto* thisObject = jsCast<JSTestNamedDeleterWithIdentifier*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -167,11 +167,11 @@ bool JSTestNamedDeleterWithIdentifier::getOwnPropertySlotByIndex(JSObject* objec > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp >index d2604b17cd8b336998ab739aacde7e31b119eed9..2fb624a015b4ba7898d909250bd074c920ca6e3e 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp >@@ -150,11 +150,11 @@ bool JSTestNamedDeleterWithIndexedGetter::getOwnPropertySlot(JSObject* object, E > return JSObject::getOwnPropertySlot(object, state, propertyName, slot); > } > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -178,11 +178,11 @@ bool JSTestNamedDeleterWithIndexedGetter::getOwnPropertySlotByIndex(JSObject* ob > } > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp >index 471d14f105ae88107ce224877bff21a34773de47..f5959690980573180e86246f1483be9d03090f2e 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp >@@ -141,11 +141,11 @@ bool JSTestNamedGetterCallWith::getOwnPropertySlot(JSObject* object, ExecState* > auto* thisObject = jsCast<JSTestNamedGetterCallWith*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(worldForDOMObject(thisObject), propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -161,11 +161,11 @@ bool JSTestNamedGetterCallWith::getOwnPropertySlotByIndex(JSObject* object, Exec > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(worldForDOMObject(thisObject), propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp >index 8e5bc2009f93cb37951b25012644985f8a67bf60..fae104a834cd1db8a4b2a41a7c167c9b7bd1f8a5 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp >@@ -141,11 +141,11 @@ bool JSTestNamedGetterNoIdentifier::getOwnPropertySlot(JSObject* object, ExecSta > auto* thisObject = jsCast<JSTestNamedGetterNoIdentifier*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -161,11 +161,11 @@ bool JSTestNamedGetterNoIdentifier::getOwnPropertySlotByIndex(JSObject* object, > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp >index 4847061cc7d0c58d32b8b43908088c7d8b771441..918b2d61ebd6d22f7062164f65dd241ca48b4814 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp >@@ -147,11 +147,11 @@ bool JSTestNamedGetterWithIdentifier::getOwnPropertySlot(JSObject* object, ExecS > auto* thisObject = jsCast<JSTestNamedGetterWithIdentifier*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().getterName(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -167,11 +167,11 @@ bool JSTestNamedGetterWithIdentifier::getOwnPropertySlotByIndex(JSObject* object > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().getterName(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp >index 5057577c4308a6528c0a177f2ad493780c18e08b..021ce1ea16742d3910eab1e9756e1655fbf757b1 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp >@@ -141,11 +141,11 @@ bool JSTestNamedSetterNoIdentifier::getOwnPropertySlot(JSObject* object, ExecSta > auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -161,11 +161,11 @@ bool JSTestNamedSetterNoIdentifier::getOwnPropertySlotByIndex(JSObject* object, > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp >index 668773981e4449c17fb8da1bce0b260c9204cbef..052a1a22825ab4d6099b8db6da18d5174d50ba01 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp >@@ -141,11 +141,11 @@ bool JSTestNamedSetterThrowingException::getOwnPropertySlot(JSObject* object, Ex > auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -161,11 +161,11 @@ bool JSTestNamedSetterThrowingException::getOwnPropertySlotByIndex(JSObject* obj > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp >index 0db74292a9144239a20569393138cfe566245f18..0b8f5de1cac641abdf0f690bd82dbb05d3f29a71 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp >@@ -147,11 +147,11 @@ bool JSTestNamedSetterWithIdentifier::getOwnPropertySlot(JSObject* object, ExecS > auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -167,11 +167,11 @@ bool JSTestNamedSetterWithIdentifier::getOwnPropertySlotByIndex(JSObject* object > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp >index aa40bd1f0a9bc0a6fdb30f84a270ef9709c2dc92..090da163fc52093171cb4fdc04abd6beb8577850 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp >@@ -159,11 +159,11 @@ bool JSTestNamedSetterWithIndexedGetter::getOwnPropertySlot(JSObject* object, Ex > return JSObject::getOwnPropertySlot(object, state, propertyName, slot); > } > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -187,11 +187,11 @@ bool JSTestNamedSetterWithIndexedGetter::getOwnPropertySlotByIndex(JSObject* obj > } > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp >index bed173a1d4a8781145495b542f733955579fe0ae..5d0ba23c476c9c6215b2ce7e115f3559839caf2c 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp >@@ -159,11 +159,11 @@ bool JSTestNamedSetterWithIndexedGetterAndSetter::getOwnPropertySlot(JSObject* o > return JSObject::getOwnPropertySlot(object, state, propertyName, slot); > } > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -187,11 +187,11 @@ bool JSTestNamedSetterWithIndexedGetterAndSetter::getOwnPropertySlotByIndex(JSOb > } > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp >index 50bfcb1bc148327eab0e98c8b3ba8d233116b7bc..f27629c7bbb3a2b88bb556d09e754536eb7c400e 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp >@@ -141,11 +141,11 @@ bool JSTestNamedSetterWithOverrideBuiltins::getOwnPropertySlot(JSObject* object, > auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::Yes>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -161,11 +161,11 @@ bool JSTestNamedSetterWithOverrideBuiltins::getOwnPropertySlotByIndex(JSObject* > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::Yes>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp >index fed2dc1bc06cc376cf361e8bfc3301bfc8870320..d4d9738cdb01b8426b663c21fc8298f144ba2637 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp >@@ -165,11 +165,11 @@ bool JSTestNamedSetterWithUnforgableProperties::getOwnPropertySlot(JSObject* obj > auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -185,11 +185,11 @@ bool JSTestNamedSetterWithUnforgableProperties::getOwnPropertySlotByIndex(JSObje > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp >index 727f3781170e2955dd659f88d5b303998f084b9f..ce59e749c273e01c4409f6653af5dfa8d04d2a34 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp >@@ -165,11 +165,11 @@ bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropert > auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::Yes>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >@@ -185,11 +185,11 @@ bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropert > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLDOMString; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::Yes>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >index a95931f9d9eb5570dc36818715dd45c709762b90..7a43437d7d446625665f6eb35b0c2fc5eaf5b3db 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >@@ -135,7 +135,7 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::EnumType > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(ExecState& state, JSValue value) >+template<> Optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue.isEmpty()) >@@ -146,7 +146,7 @@ template<> std::optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>( > return TestObj::EnumType::EnumValue2; > if (stringValue == "EnumValue3") > return TestObj::EnumType::EnumValue3; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::EnumType>() >@@ -175,7 +175,7 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::Optional > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(ExecState& state, JSValue value) >+template<> Optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue.isEmpty()) >@@ -186,7 +186,7 @@ template<> std::optional<TestObj::Optional> parseEnumeration<TestObj::Optional>( > return TestObj::Optional::OptionalValue2; > if (stringValue == "OptionalValue3") > return TestObj::Optional::OptionalValue3; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::Optional>() >@@ -211,14 +211,14 @@ template<> JSString* convertEnumerationToJS(ExecState& state, AlternateEnumName > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(ExecState& state, JSValue value) >+template<> Optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "enumValue1") > return AlternateEnumName::EnumValue1; > if (stringValue == "EnumValue2") > return AlternateEnumName::EnumValue2; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<AlternateEnumName>() >@@ -243,12 +243,12 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::EnumA enu > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(ExecState& state, JSValue value) >+template<> Optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "A") > return TestObj::EnumA::A; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::EnumA>() >@@ -275,12 +275,12 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::EnumB enu > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(ExecState& state, JSValue value) >+template<> Optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "B") > return TestObj::EnumB::B; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::EnumB>() >@@ -307,12 +307,12 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::EnumC enu > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(ExecState& state, JSValue value) >+template<> Optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "C") > return TestObj::EnumC::C; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::EnumC>() >@@ -339,14 +339,14 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::Kind enum > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(ExecState& state, JSValue value) >+template<> Optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "quick") > return TestObj::Kind::Quick; > if (stringValue == "dead") > return TestObj::Kind::Dead; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::Kind>() >@@ -371,14 +371,14 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::Size enum > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::Size> parseEnumeration<TestObj::Size>(ExecState& state, JSValue value) >+template<> Optional<TestObj::Size> parseEnumeration<TestObj::Size>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "small") > return TestObj::Size::Small; > if (stringValue == "much-much-larger") > return TestObj::Size::MuchMuchLarger; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::Size>() >@@ -403,14 +403,14 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestObj::Confidenc > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(ExecState& state, JSValue value) >+template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "high") > return TestObj::Confidence::High; > if (stringValue == "kinda-low") > return TestObj::Confidence::KindaLow; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestObj::Confidence>() >@@ -648,7 +648,7 @@ template<> TestObj::Dictionary convertDictionary<TestObj::Dictionary>(ExecState& > result.nullableEnum = convert<IDLNullable<IDLEnumeration<TestObj::EnumType>>>(state, nullableEnumValue); > RETURN_IF_EXCEPTION(throwScope, { }); > } else >- result.nullableEnum = std::nullopt; >+ result.nullableEnum = WTF::nullopt; > JSValue nullableIntegerWithDefaultValue; > if (isNullOrUndefined) > nullableIntegerWithDefaultValue = jsUndefined(); >@@ -660,7 +660,7 @@ template<> TestObj::Dictionary convertDictionary<TestObj::Dictionary>(ExecState& > result.nullableIntegerWithDefault = convert<IDLNullable<IDLLong>>(state, nullableIntegerWithDefaultValue); > RETURN_IF_EXCEPTION(throwScope, { }); > } else >- result.nullableIntegerWithDefault = std::nullopt; >+ result.nullableIntegerWithDefault = WTF::nullopt; > JSValue nullableNodeValue; > if (isNullOrUndefined) > nullableNodeValue = jsUndefined(); >@@ -696,7 +696,7 @@ template<> TestObj::Dictionary convertDictionary<TestObj::Dictionary>(ExecState& > result.nullableUnionMember = convert<IDLNullable<IDLUnion<IDLLong, IDLInterface<Node>>>>(state, nullableUnionMemberValue); > RETURN_IF_EXCEPTION(throwScope, { }); > } else >- result.nullableUnionMember = std::nullopt; >+ result.nullableUnionMember = WTF::nullopt; > JSValue requiredBufferSourceValueValue; > if (isNullOrUndefined) > requiredBufferSourceValueValue = jsUndefined(); >@@ -5752,7 +5752,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalEn > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto enumArg = state->argument(0).isUndefined() ? std::optional<Converter<IDLEnumeration<TestObj::EnumType>>::ReturnType>() : std::optional<Converter<IDLEnumeration<TestObj::EnumType>>::ReturnType>(convert<IDLEnumeration<TestObj::EnumType>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 0, "enumArg", "TestObject", "methodWithOptionalEnumArg", expectedEnumerationValues<TestObj::EnumType>()); })); >+ auto enumArg = state->argument(0).isUndefined() ? Optional<Converter<IDLEnumeration<TestObj::EnumType>>::ReturnType>() : Optional<Converter<IDLEnumeration<TestObj::EnumType>>::ReturnType>(convert<IDLEnumeration<TestObj::EnumType>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeEnumError(state, scope, 0, "enumArg", "TestObject", "methodWithOptionalEnumArg", expectedEnumerationValues<TestObj::EnumType>()); })); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithOptionalEnumArg(WTFMove(enumArg)); > return JSValue::encode(jsUndefined()); >@@ -6259,7 +6259,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalAr > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto opt = state->argument(0).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(0))); >+ auto opt = state->argument(0).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithOptionalArg(WTFMove(opt)); > return JSValue::encode(jsUndefined()); >@@ -6295,7 +6295,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithNonOptiona > return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); > auto nonOpt = convert<IDLLong>(*state, state->uncheckedArgument(0)); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- auto opt = state->argument(1).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); >+ auto opt = state->argument(1).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithNonOptionalArgAndOptionalArg(WTFMove(nonOpt), WTFMove(opt)); > return JSValue::encode(jsUndefined()); >@@ -6315,9 +6315,9 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithNonOptiona > return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); > auto nonOpt = convert<IDLLong>(*state, state->uncheckedArgument(0)); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- auto opt1 = state->argument(1).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); >+ auto opt1 = state->argument(1).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- auto opt2 = state->argument(2).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(2))); >+ auto opt2 = state->argument(2).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(2))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithNonOptionalArgAndTwoOptionalArgs(WTFMove(nonOpt), WTFMove(opt1), WTFMove(opt2)); > return JSValue::encode(jsUndefined()); >@@ -6541,7 +6541,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalLo > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto number = state->argument(0).isUndefined() ? std::optional<Converter<IDLLongLong>::ReturnType>() : std::optional<Converter<IDLLongLong>::ReturnType>(convert<IDLLongLong>(*state, state->uncheckedArgument(0))); >+ auto number = state->argument(0).isUndefined() ? Optional<Converter<IDLLongLong>::ReturnType>() : Optional<Converter<IDLLongLong>::ReturnType>(convert<IDLLongLong>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithOptionalLongLong(WTFMove(number)); > return JSValue::encode(jsUndefined()); >@@ -6573,7 +6573,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalUn > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto number = state->argument(0).isUndefined() ? std::optional<Converter<IDLUnsignedLongLong>::ReturnType>() : std::optional<Converter<IDLUnsignedLongLong>::ReturnType>(convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(0))); >+ auto number = state->argument(0).isUndefined() ? Optional<Converter<IDLUnsignedLongLong>::ReturnType>() : Optional<Converter<IDLUnsignedLongLong>::ReturnType>(convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithOptionalUnsignedLongLong(WTFMove(number)); > return JSValue::encode(jsUndefined()); >@@ -6637,7 +6637,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalBo > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto b = state->argument(0).isUndefined() ? std::optional<Converter<IDLBoolean>::ReturnType>() : std::optional<Converter<IDLBoolean>::ReturnType>(convert<IDLBoolean>(*state, state->uncheckedArgument(0))); >+ auto b = state->argument(0).isUndefined() ? Optional<Converter<IDLBoolean>::ReturnType>() : Optional<Converter<IDLBoolean>::ReturnType>(convert<IDLBoolean>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithOptionalBoolean(WTFMove(b)); > return JSValue::encode(jsUndefined()); >@@ -6685,7 +6685,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalOb > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto a = state->argument(0).isUndefined() ? std::optional<Converter<IDLObject>::ReturnType>() : std::optional<Converter<IDLObject>::ReturnType>(convert<IDLObject>(*state, state->uncheckedArgument(0))); >+ auto a = state->argument(0).isUndefined() ? Optional<Converter<IDLObject>::ReturnType>() : Optional<Converter<IDLObject>::ReturnType>(convert<IDLObject>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithOptionalObject(WTFMove(a)); > return JSValue::encode(jsUndefined()); >@@ -6749,7 +6749,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalRe > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto record = state->argument(0).isUndefined() ? std::nullopt : convert<IDLNullable<IDLRecord<IDLDOMString, IDLLong>>>(*state, state->uncheckedArgument(0)); >+ auto record = state->argument(0).isUndefined() ? WTF::nullopt : convert<IDLNullable<IDLRecord<IDLDOMString, IDLLong>>>(*state, state->uncheckedArgument(0)); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.methodWithOptionalRecord(WTFMove(record)); > return JSValue::encode(jsUndefined()); >@@ -6986,7 +6986,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionOverloadedMethod2Bod > auto& impl = castedThis->wrapped(); > auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj"); }); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- auto longArg = state->argument(1).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); >+ auto longArg = state->argument(1).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.overloadedMethod(WTFMove(objArg), WTFMove(longArg)); > return JSValue::encode(jsUndefined()); >@@ -7185,7 +7185,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionOverloadedMethodWith > auto& impl = castedThis->wrapped(); > auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj"); }); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- auto longArg = state->argument(1).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); >+ auto longArg = state->argument(1).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(1))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.overloadedMethodWithOptionalParameter(WTFMove(objArg), WTFMove(longArg)); > return JSValue::encode(jsUndefined()); >@@ -7531,7 +7531,7 @@ static inline JSC::EncodedJSValue jsTestObjConstructorFunctionClassMethodWithOpt > { > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); >- auto arg = state->argument(0).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(0))); >+ auto arg = state->argument(0).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > return JSValue::encode(toJS<IDLLong>(TestObj::classMethodWithOptional(WTFMove(arg)))); > } >@@ -7737,7 +7737,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionOperationWithOptiona > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto optionalUnion = state->argument(0).isUndefined() ? std::optional<Converter<IDLUnion<IDLDOMString, IDLSequence<IDLUnrestrictedDouble>>>::ReturnType>() : std::optional<Converter<IDLUnion<IDLDOMString, IDLSequence<IDLUnrestrictedDouble>>>::ReturnType>(convert<IDLUnion<IDLDOMString, IDLSequence<IDLUnrestrictedDouble>>>(*state, state->uncheckedArgument(0))); >+ auto optionalUnion = state->argument(0).isUndefined() ? Optional<Converter<IDLUnion<IDLDOMString, IDLSequence<IDLUnrestrictedDouble>>>::ReturnType>() : Optional<Converter<IDLUnion<IDLDOMString, IDLSequence<IDLUnrestrictedDouble>>>::ReturnType>(convert<IDLUnion<IDLDOMString, IDLSequence<IDLUnrestrictedDouble>>>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.operationWithOptionalUnionParameter(WTFMove(optionalUnion)); > return JSValue::encode(jsUndefined()); >@@ -8048,7 +8048,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionTestPromiseFunctionW > UNUSED_PARAM(state); > UNUSED_PARAM(throwScope); > auto& impl = castedThis->wrapped(); >- auto a = state->argument(0).isUndefined() ? std::optional<Converter<IDLLong>::ReturnType>() : std::optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(0))); >+ auto a = state->argument(0).isUndefined() ? Optional<Converter<IDLLong>::ReturnType>() : Optional<Converter<IDLLong>::ReturnType>(convert<IDLLong>(*state, state->uncheckedArgument(0))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.testPromiseFunctionWithOptionalIntArgument(WTFMove(a), WTFMove(promise)); > return JSValue::encode(jsUndefined()); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >index d55404eefcd5c198eff17398ce11e0c72e462119..e28a340146e19279805b65d2f786e056ee16d39b 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >@@ -112,19 +112,19 @@ template<> struct JSDOMWrapperConverterTraits<TestObj> { > String convertEnumerationToString(TestObj::EnumType); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumType); > >-template<> std::optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::EnumType>(); > > String convertEnumerationToString(TestObj::Optional); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Optional); > >-template<> std::optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::Optional>(); > > String convertEnumerationToString(AlternateEnumName); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, AlternateEnumName); > >-template<> std::optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<AlternateEnumName>(); > > #if ENABLE(Condition1) >@@ -132,7 +132,7 @@ template<> const char* expectedEnumerationValues<AlternateEnumName>(); > String convertEnumerationToString(TestObj::EnumA); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumA); > >-template<> std::optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::EnumA>(); > > #endif >@@ -142,7 +142,7 @@ template<> const char* expectedEnumerationValues<TestObj::EnumA>(); > String convertEnumerationToString(TestObj::EnumB); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumB); > >-template<> std::optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::EnumB>(); > > #endif >@@ -152,7 +152,7 @@ template<> const char* expectedEnumerationValues<TestObj::EnumB>(); > String convertEnumerationToString(TestObj::EnumC); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumC); > >-template<> std::optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::EnumC>(); > > #endif >@@ -160,19 +160,19 @@ template<> const char* expectedEnumerationValues<TestObj::EnumC>(); > String convertEnumerationToString(TestObj::Kind); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Kind); > >-template<> std::optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::Kind>(); > > String convertEnumerationToString(TestObj::Size); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Size); > >-template<> std::optional<TestObj::Size> parseEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::Size> parseEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::Size>(); > > String convertEnumerationToString(TestObj::Confidence); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Confidence); > >-template<> std::optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestObj::Confidence>(); > > template<> TestObj::Dictionary convertDictionary<TestObj::Dictionary>(JSC::ExecState&, JSC::JSValue); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp >index f21b343157e2e500145ea9f6cd8a18563af88b59..9b5a0272316c7583af327c2bae97f52c79cc8399 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp >@@ -150,11 +150,11 @@ bool JSTestOverrideBuiltins::getOwnPropertySlot(JSObject* object, ExecState* sta > auto* thisObject = jsCast<JSTestOverrideBuiltins*>(object); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > using GetterIDLType = IDLInterface<Node>; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::Yes>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLInterface<Node>>(*state, *thisObject->globalObject(), WTFMove(namedProperty.value())); >@@ -170,11 +170,11 @@ bool JSTestOverrideBuiltins::getOwnPropertySlotByIndex(JSObject* object, ExecSta > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > auto propertyName = Identifier::from(state, index); > using GetterIDLType = IDLInterface<Node>; >- auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> { >+ auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional<typename GetterIDLType::ImplementationType> { > auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName)); > if (!GetterIDLType::isNullValue(result)) > return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; >- return std::nullopt; >+ return WTF::nullopt; > }; > if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::Yes>(*state, *thisObject, propertyName, getterFunctor)) { > auto value = toJS<IDLInterface<Node>>(*state, *thisObject->globalObject(), WTFMove(namedProperty.value())); >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp >index e3f459649851da2d7539cba641282023b63214ee..abc7c41c3503561a90d8aee14c1e0374b61a219b 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp >@@ -102,14 +102,14 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestStandaloneDict > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(ExecState& state, JSValue value) >+template<> Optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "enumValue1") > return TestStandaloneDictionary::EnumInStandaloneDictionaryFile::EnumValue1; > if (stringValue == "enumValue2") > return TestStandaloneDictionary::EnumInStandaloneDictionaryFile::EnumValue2; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>() >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h >index ddbfbfd04b5fb85d63656c771663757a26e05b43..3467869cea955e933964df19f0515b2bec41a4fc 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h >@@ -33,7 +33,7 @@ template<> WEBCORE_EXPORT DictionaryImplName convertDictionary<DictionaryImplNam > String convertEnumerationToString(TestStandaloneDictionary::EnumInStandaloneDictionaryFile); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestStandaloneDictionary::EnumInStandaloneDictionaryFile); > >-template<> std::optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(); > > } // namespace WebCore >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp >index 6e0bd8ee7ee85b447ce2798fcb7663cafc101d61..48c29fae1f427e67102086a50ef67fd59ca30719 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp >@@ -49,14 +49,14 @@ template<> JSString* convertEnumerationToJS(ExecState& state, TestStandaloneEnum > return jsStringWithCache(&state, convertEnumerationToString(enumerationValue)); > } > >-template<> std::optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(ExecState& state, JSValue value) >+template<> Optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(ExecState& state, JSValue value) > { > auto stringValue = value.toWTFString(&state); > if (stringValue == "enumValue1") > return TestStandaloneEnumeration::EnumValue1; > if (stringValue == "enumValue2") > return TestStandaloneEnumeration::EnumValue2; >- return std::nullopt; >+ return WTF::nullopt; > } > > template<> const char* expectedEnumerationValues<TestStandaloneEnumeration>() >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h >index a0e7bd9c504158d37bb5a57e36c6f0a9f6e8b43a..f41678bba7ea9c269293e66e3c390a45904e86bb 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h >@@ -30,7 +30,7 @@ namespace WebCore { > String convertEnumerationToString(TestStandaloneEnumeration); > template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestStandaloneEnumeration); > >-template<> std::optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(JSC::ExecState&, JSC::JSValue); >+template<> Optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(JSC::ExecState&, JSC::JSValue); > template<> const char* expectedEnumerationValues<TestStandaloneEnumeration>(); > > } // namespace WebCore >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp >index 6b678bcf5eefd6b8b9df71a79d000a7d3ba3a1d3..906b66de8fa22cd2735eb9b36f9ffee80a283b65 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp >@@ -510,7 +510,7 @@ static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionSetShadowBody(J > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > auto color = state->argument(3).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(3)); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- auto alpha = state->argument(4).isUndefined() ? std::optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : std::optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4))); >+ auto alpha = state->argument(4).isUndefined() ? Optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : Optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(color), WTFMove(alpha)); > return JSValue::encode(jsUndefined()); >@@ -637,7 +637,7 @@ static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionFuncWithClampBo > return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); > auto arg1 = convert<IDLClampAdaptor<IDLUnsignedLongLong>>(*state, state->uncheckedArgument(0)); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- auto arg2 = state->argument(1).isUndefined() ? std::optional<Converter<IDLClampAdaptor<IDLUnsignedLongLong>>::ReturnType>() : std::optional<Converter<IDLClampAdaptor<IDLUnsignedLongLong>>::ReturnType>(convert<IDLClampAdaptor<IDLUnsignedLongLong>>(*state, state->uncheckedArgument(1))); >+ auto arg2 = state->argument(1).isUndefined() ? Optional<Converter<IDLClampAdaptor<IDLUnsignedLongLong>>::ReturnType>() : Optional<Converter<IDLClampAdaptor<IDLUnsignedLongLong>>::ReturnType>(convert<IDLClampAdaptor<IDLUnsignedLongLong>>(*state, state->uncheckedArgument(1))); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > impl.funcWithClamp(WTFMove(arg1), WTFMove(arg2)); > return JSValue::encode(jsUndefined()); >diff --git a/Source/WebCore/bridge/runtime_array.cpp b/Source/WebCore/bridge/runtime_array.cpp >index 59b362aded7454b1e70388505f6b4971bb40dc40..95ff8f270a5003751721f2e7ee6c3a8274796399 100644 >--- a/Source/WebCore/bridge/runtime_array.cpp >+++ b/Source/WebCore/bridge/runtime_array.cpp >@@ -94,7 +94,7 @@ bool RuntimeArray::getOwnPropertySlot(JSObject* object, ExecState* exec, Propert > return true; > } > >- std::optional<uint32_t> index = parseIndex(propertyName); >+ Optional<uint32_t> index = parseIndex(propertyName); > if (index && index.value() < thisObject->getLength()) { > slot.setValue(thisObject, PropertyAttribute::DontDelete | PropertyAttribute::DontEnum, > thisObject->getConcreteArray()->valueAt(exec, index.value())); >@@ -127,7 +127,7 @@ bool RuntimeArray::put(JSCell* cell, ExecState* exec, PropertyName propertyName, > return false; > } > >- if (std::optional<uint32_t> index = parseIndex(propertyName)) >+ if (Optional<uint32_t> index = parseIndex(propertyName)) > return thisObject->getConcreteArray()->setValueAt(exec, index.value(), value); > > RELEASE_AND_RETURN(scope, JSObject::put(thisObject, exec, propertyName, value, slot)); >diff --git a/Source/WebCore/contentextensions/ContentExtensionParser.cpp b/Source/WebCore/contentextensions/ContentExtensionParser.cpp >index 928c37e7d3c82646b8318a4060b58798507ef701..ce23f6e11e37529b482c180d3fbbafe1951288ae 100644 >--- a/Source/WebCore/contentextensions/ContentExtensionParser.cpp >+++ b/Source/WebCore/contentextensions/ContentExtensionParser.cpp >@@ -240,7 +240,7 @@ bool isValidCSSSelector(const String& selector) > return selectorList.isValid(); > } > >-static Expected<std::optional<Action>, std::error_code> loadAction(ExecState& exec, const JSObject& ruleObject) >+static Expected<Optional<Action>, std::error_code> loadAction(ExecState& exec, const JSObject& ruleObject) > { > VM& vm = exec.vm(); > auto scope = DECLARE_THROW_SCOPE(vm); >@@ -269,7 +269,7 @@ static Expected<std::optional<Action>, std::error_code> loadAction(ExecState& ex > String selectorString = asString(selector)->value(&exec); > if (!isValidCSSSelector(selectorString)) { > // Skip rules with invalid selectors to be backwards-compatible. >- return { std::nullopt }; >+ return { WTF::nullopt }; > } > return { Action(ActionType::CSSDisplayNoneSelector, selectorString) }; > } >@@ -284,7 +284,7 @@ static Expected<std::optional<Action>, std::error_code> loadAction(ExecState& ex > return makeUnexpected(ContentExtensionError::JSONInvalidActionType); > } > >-static Expected<std::optional<ContentExtensionRule>, std::error_code> loadRule(ExecState& exec, const JSObject& ruleObject) >+static Expected<Optional<ContentExtensionRule>, std::error_code> loadRule(ExecState& exec, const JSObject& ruleObject) > { > auto trigger = loadTrigger(exec, ruleObject); > if (!trigger.has_value()) >@@ -297,7 +297,7 @@ static Expected<std::optional<ContentExtensionRule>, std::error_code> loadRule(E > if (action.value()) > return {{{ WTFMove(trigger.value()), WTFMove(action.value().value()) }}}; > >- return { std::nullopt }; >+ return { WTF::nullopt }; > } > > static Expected<Vector<ContentExtensionRule>, std::error_code> loadEncodedRules(ExecState& exec, const String& ruleJSON) >diff --git a/Source/WebCore/contentextensions/URLFilterParser.cpp b/Source/WebCore/contentextensions/URLFilterParser.cpp >index c50128e9658904db75e8b9aace50f0207be3c0cc..0b86fa65aee17123ab5d71383129e0156fd5e042 100644 >--- a/Source/WebCore/contentextensions/URLFilterParser.cpp >+++ b/Source/WebCore/contentextensions/URLFilterParser.cpp >@@ -218,7 +218,7 @@ public: > fail(URLFilterParser::AtomCharacter); > } > >- void atomParenthesesSubpatternBegin(bool = true, std::optional<String> = std::nullopt) >+ void atomParenthesesSubpatternBegin(bool = true, Optional<String> = WTF::nullopt) > { > if (hasError()) > return; >diff --git a/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp b/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp >index b160a54b127a4b9eae7c12c1ce0ff84e37d84bf6..7a4801ab0a4752b0d1cd4d275a0363609fce0a8f 100644 >--- a/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp >+++ b/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp >@@ -47,17 +47,17 @@ CryptoAlgorithmRegistry::CryptoAlgorithmRegistry() > platformRegisterAlgorithms(); > } > >-std::optional<CryptoAlgorithmIdentifier> CryptoAlgorithmRegistry::identifier(const String& name) >+Optional<CryptoAlgorithmIdentifier> CryptoAlgorithmRegistry::identifier(const String& name) > { > if (name.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > std::lock_guard<Lock> lock(registryMutex); > > // FIXME: How is it helpful to call isolatedCopy on the argument to find? > auto identifier = m_identifiers.find(name.isolatedCopy()); > if (identifier == m_identifiers.end()) >- return std::nullopt; >+ return WTF::nullopt; > > return identifier->value; > } >diff --git a/Source/WebCore/crypto/CryptoAlgorithmRegistry.h b/Source/WebCore/crypto/CryptoAlgorithmRegistry.h >index fa7a84c2bcb78fd8d6ccc1920faf13132bfdfa3e..fea3cca923e47912a84f0687938810f3981254c5 100644 >--- a/Source/WebCore/crypto/CryptoAlgorithmRegistry.h >+++ b/Source/WebCore/crypto/CryptoAlgorithmRegistry.h >@@ -44,7 +44,7 @@ class CryptoAlgorithmRegistry { > public: > static CryptoAlgorithmRegistry& singleton(); > >- std::optional<CryptoAlgorithmIdentifier> identifier(const String&); >+ Optional<CryptoAlgorithmIdentifier> identifier(const String&); > String name(CryptoAlgorithmIdentifier); > > RefPtr<CryptoAlgorithm> create(CryptoAlgorithmIdentifier); >diff --git a/Source/WebCore/crypto/JsonWebKey.h b/Source/WebCore/crypto/JsonWebKey.h >index eec00d747e6b07216d09b38d0713946b69717dc7..5aed39c5561a7863c80de311814f8a78dbf180ce 100644 >--- a/Source/WebCore/crypto/JsonWebKey.h >+++ b/Source/WebCore/crypto/JsonWebKey.h >@@ -37,11 +37,11 @@ struct JsonWebKey { > String kty; > String use; > // FIXME: Consider merging key_ops and usages. >- std::optional<Vector<CryptoKeyUsage>> key_ops; >+ Optional<Vector<CryptoKeyUsage>> key_ops; > CryptoKeyUsageBitmap usages; > String alg; > >- std::optional<bool> ext; >+ Optional<bool> ext; > > String crv; > String x; >@@ -54,7 +54,7 @@ struct JsonWebKey { > String dp; > String dq; > String qi; >- std::optional<Vector<RsaOtherPrimesInfo>> oth; >+ Optional<Vector<RsaOtherPrimesInfo>> oth; > String k; > }; > >diff --git a/Source/WebCore/crypto/SubtleCrypto.cpp b/Source/WebCore/crypto/SubtleCrypto.cpp >index a9446da5a6c689fd006de74c3454ed7c45230a90..b95d74189ecf24e2e3bfc9ae424ec57e618132ef 100644 >--- a/Source/WebCore/crypto/SubtleCrypto.cpp >+++ b/Source/WebCore/crypto/SubtleCrypto.cpp >@@ -442,22 +442,22 @@ static void normalizeJsonWebKey(JsonWebKey& webKey) > webKey.usages = webKey.key_ops ? toCryptoKeyUsageBitmap(webKey.key_ops.value()) : 0; > } > >-// FIXME: This returns an std::optional<KeyData> and takes a promise, rather than returning an >+// FIXME: This returns an Optional<KeyData> and takes a promise, rather than returning an > // ExceptionOr<KeyData> and letting the caller handle the promise, to work around an issue where > // Variant types (which KeyData is) in ExceptionOr<> cause compile issues on some platforms. This > // should be resolved by adopting a standards compliant std::variant (see https://webkit.org/b/175583) >-static std::optional<KeyData> toKeyData(SubtleCrypto::KeyFormat format, SubtleCrypto::KeyDataVariant&& keyDataVariant, Ref<DeferredPromise>& promise) >+static Optional<KeyData> toKeyData(SubtleCrypto::KeyFormat format, SubtleCrypto::KeyDataVariant&& keyDataVariant, Ref<DeferredPromise>& promise) > { > switch (format) { > case SubtleCrypto::KeyFormat::Spki: > case SubtleCrypto::KeyFormat::Pkcs8: > case SubtleCrypto::KeyFormat::Raw: > return WTF::switchOn(keyDataVariant, >- [&promise] (JsonWebKey&) -> std::optional<KeyData> { >+ [&promise] (JsonWebKey&) -> Optional<KeyData> { > promise->reject(Exception { TypeError }); >- return std::nullopt; >+ return WTF::nullopt; > }, >- [] (auto& bufferSource) -> std::optional<KeyData> { >+ [] (auto& bufferSource) -> Optional<KeyData> { > Vector<uint8_t> result; > result.append(static_cast<const uint8_t*>(bufferSource->data()), bufferSource->byteLength()); > return KeyData { result }; >@@ -465,13 +465,13 @@ static std::optional<KeyData> toKeyData(SubtleCrypto::KeyFormat format, SubtleCr > ); > case SubtleCrypto::KeyFormat::Jwk: > return WTF::switchOn(keyDataVariant, >- [] (JsonWebKey& webKey) -> std::optional<KeyData> { >+ [] (JsonWebKey& webKey) -> Optional<KeyData> { > normalizeJsonWebKey(webKey); > return KeyData { webKey }; > }, >- [&promise] (auto&) -> std::optional<KeyData> { >+ [&promise] (auto&) -> Optional<KeyData> { > promise->reject(Exception { TypeError }); >- return std::nullopt; >+ return WTF::nullopt; > } > ); > } >diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp >index dd2d90eec80baf42ea2cadff34b22502a44a1e5d..4e521d62574fbdf136c997955d5a6836cb8e7558 100644 >--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp >+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp >@@ -96,7 +96,7 @@ void CryptoAlgorithmECDH::deriveBits(const CryptoAlgorithmParameters& parameters > return; > } > >- auto unifiedCallback = [callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback)](std::optional<Vector<uint8_t>>&& derivedKey, size_t length) mutable { >+ auto unifiedCallback = [callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback)](Optional<Vector<uint8_t>>&& derivedKey, size_t length) mutable { > if (!derivedKey) { > exceptionCallback(OperationError); > return; >diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h b/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h >index 3f5891b1120af6c6de8a7c4cf764ba4608e415b6..78391c927e8a5153a0c09018c66c9c78ce099823 100644 >--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h >+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h >@@ -48,7 +48,7 @@ private: > void importKey(CryptoKeyFormat, KeyData&&, const CryptoAlgorithmParameters&, bool extractable, CryptoKeyUsageBitmap, KeyCallback&&, ExceptionCallback&&) final; > void exportKey(CryptoKeyFormat, Ref<CryptoKey>&&, KeyDataCallback&&, ExceptionCallback&&) final; > >- static std::optional<Vector<uint8_t>> platformDeriveBits(const CryptoKeyEC&, const CryptoKeyEC&); >+ static Optional<Vector<uint8_t>> platformDeriveBits(const CryptoKeyEC&, const CryptoKeyEC&); > }; > > } // namespace WebCore >diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp >index 78b277efdafc970bebe2c408ab8eb8d1e57f8c42..f22cc515f4f787885fdccfc7b8e424c7faa70827 100644 >--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp >+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp >@@ -112,7 +112,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData& > exceptionCallback(DataError); > return; > } >- result = CryptoKeyRSA::importJwk(parameters.identifier, std::nullopt, WTFMove(key), extractable, usages); >+ result = CryptoKeyRSA::importJwk(parameters.identifier, WTF::nullopt, WTFMove(key), extractable, usages); > break; > } > case CryptoKeyFormat::Spki: { >@@ -120,7 +120,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData& > exceptionCallback(SyntaxError); > return; > } >- result = CryptoKeyRSA::importSpki(parameters.identifier, std::nullopt, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages); >+ result = CryptoKeyRSA::importSpki(parameters.identifier, WTF::nullopt, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages); > break; > } > case CryptoKeyFormat::Pkcs8: { >@@ -128,7 +128,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData& > exceptionCallback(SyntaxError); > return; > } >- result = CryptoKeyRSA::importPkcs8(parameters.identifier, std::nullopt, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages); >+ result = CryptoKeyRSA::importPkcs8(parameters.identifier, WTF::nullopt, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages); > break; > } > default: >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp >index ebe2b384c3691b71a19e6a96d8b270e584d62ebc..98a6b219be202f335379a5518786fcc24cca2253 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp >@@ -36,33 +36,33 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, Vector<uint8_t>&& plainText) >+static Optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, Vector<uint8_t>&& plainText) > { > // Determine the AES algorithm for the given key size. > auto algorithm = PAL::GCrypt::aesAlgorithmForKeySize(key.size() * 8); > if (!algorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Create a new GCrypt cipher object for the AES algorithm and the CBC cipher mode. > PAL::GCrypt::Handle<gcry_cipher_hd_t> handle; > gcry_error_t error = gcry_cipher_open(&handle, *algorithm, GCRY_CIPHER_MODE_CBC, 0); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given key for this cipher object. > error = gcry_cipher_setkey(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given IV for this cipher object. > error = gcry_cipher_setiv(handle, iv.data(), iv.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the PKCS#7 padding. >@@ -74,7 +74,7 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > // Padded size should be bigger than size, but bail if the value doesn't fit into a byte. > ASSERT(paddedSize > size); > if (paddedSize - size > 255) >- return std::nullopt; >+ return WTF::nullopt; > uint8_t paddingValue = paddedSize - size; > > plainText.grow(paddedSize); >@@ -85,7 +85,7 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > error = gcry_cipher_final(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Perform the encryption and retrieve the encrypted output. >@@ -93,46 +93,46 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > error = gcry_cipher_encrypt(handle, output.data(), output.size(), plainText.data(), plainText.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return output; > } > >-static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, const Vector<uint8_t>& cipherText) >+static Optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, const Vector<uint8_t>& cipherText) > { > // Determine the AES algorithm for the given key size. > auto algorithm = PAL::GCrypt::aesAlgorithmForKeySize(key.size() * 8); > if (!algorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Create a new GCrypt cipher object for the AES algorithm and the CBC cipher mode. > PAL::GCrypt::Handle<gcry_cipher_hd_t> handle; > gcry_error_t error = gcry_cipher_open(&handle, *algorithm, GCRY_CIPHER_MODE_CBC, 0); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given key for this cipher object. > error = gcry_cipher_setkey(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given IV for this cipher object. > error = gcry_cipher_setiv(handle, iv.data(), iv.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Finalize the cipher object before performing the decryption. > error = gcry_cipher_final(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Perform the decryption and retrieve the decrypted output. >@@ -140,7 +140,7 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, > error = gcry_cipher_decrypt(handle, output.data(), output.size(), cipherText.data(), cipherText.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Remove the PKCS#7 padding from the decrypted output. >@@ -148,16 +148,16 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, > // The padding value can be retrieved from the last byte. > uint8_t paddingValue = output.last(); > if (paddingValue > gcry_cipher_get_algo_blklen(*algorithm)) >- return std::nullopt; >+ return WTF::nullopt; > > // Padding value mustn't be greater than the size of the padded output. > size_t size = output.size(); > if (paddingValue > size) >- return std::nullopt; >+ return WTF::nullopt; > > // Bail if the last `paddingValue` bytes don't have the value of `paddingValue`. > if (std::count(output.end() - paddingValue, output.end(), paddingValue) != paddingValue) >- return std::nullopt; >+ return WTF::nullopt; > > // Shrink the output Vector object to drop the PKCS#7 padding. > output.shrink(size - paddingValue); >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp >index 22c129965aadcd02c67b8c8cea1a082bc4a8a070..3c905940ad5ac9e81cd84b436ef2251b286b6df7 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp >@@ -39,42 +39,42 @@ namespace WebCore { > > // This is a helper function that resets the cipher object, sets the provided counter data, > // and executes the encrypt or decrypt operation, retrieving and returning the output data. >-static std::optional<Vector<uint8_t>> callOperation(PAL::GCrypt::CipherOperation operation, gcry_cipher_hd_t handle, const Vector<uint8_t>& counter, const uint8_t* data, const size_t size) >+static Optional<Vector<uint8_t>> callOperation(PAL::GCrypt::CipherOperation operation, gcry_cipher_hd_t handle, const Vector<uint8_t>& counter, const uint8_t* data, const size_t size) > { > gcry_error_t error = gcry_cipher_reset(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > error = gcry_cipher_setctr(handle, counter.data(), counter.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > error = gcry_cipher_final(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > Vector<uint8_t> output(size); > error = operation(handle, output.data(), output.size(), data, size); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return output; > } > >-static std::optional<Vector<uint8_t>> gcryptAES_CTR(PAL::GCrypt::CipherOperation operation, const Vector<uint8_t>& key, const Vector<uint8_t>& counter, size_t counterLength, const Vector<uint8_t>& inputText) >+static Optional<Vector<uint8_t>> gcryptAES_CTR(PAL::GCrypt::CipherOperation operation, const Vector<uint8_t>& key, const Vector<uint8_t>& counter, size_t counterLength, const Vector<uint8_t>& inputText) > { > constexpr size_t blockSize = 16; > auto algorithm = PAL::GCrypt::aesAlgorithmForKeySize(key.size() * 8); > if (!algorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Construct the libgcrypt cipher object and attach the key to it. Key information on this > // cipher object will live through any gcry_cipher_reset() calls. >@@ -82,13 +82,13 @@ static std::optional<Vector<uint8_t>> gcryptAES_CTR(PAL::GCrypt::CipherOperation > gcry_error_t error = gcry_cipher_open(&handle, *algorithm, GCRY_CIPHER_MODE_CTR, 0); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > error = gcry_cipher_setkey(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Calculate the block count: ((inputText.size() + blockSize - 1) / blockSize), remainder discarded. >@@ -111,7 +111,7 @@ static std::optional<Vector<uint8_t>> gcryptAES_CTR(PAL::GCrypt::CipherOperation > // the number of unique counter values we could produce for the specified counter > // length) is lower than the deduced block count, we bail. > if (gcry_mpi_cmp(counterLimitMPI, blockCountMPI) < 0) >- return std::nullopt; >+ return WTF::nullopt; > > // If the counter length, in bits, matches the size of the counter data, we don't have to > // use any part of the counter Vector<> as nonce. This allows us to directly encrypt or >@@ -125,7 +125,7 @@ static std::optional<Vector<uint8_t>> gcryptAES_CTR(PAL::GCrypt::CipherOperation > error = gcry_mpi_scan(&counterDataMPI, GCRYMPI_FMT_USG, counter.data(), counter.size(), nullptr); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Extract the counter MPI from the counterDataMPI: (counterDataMPI % counterLimitMPI). >@@ -175,14 +175,14 @@ static std::optional<Vector<uint8_t>> gcryptAES_CTR(PAL::GCrypt::CipherOperation > error = gcry_mpi_print(GCRYMPI_FMT_USG, blockCounterData.data(), blockCounterData.size(), nullptr, blockCounterMPI); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Encrypt/decrypt this single block with the block-specific counter. Output for this > // single block is appended to the general output vector. > auto blockOutput = callOperation(operation, handle, blockCounterData, inputText.data() + i, blockInputSize); > if (!blockOutput) >- return std::nullopt; >+ return WTF::nullopt; > > output.appendVector(*blockOutput); > >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp >index 7dd00508cbb083cfe01372f0eb1c3c8b2bc5a70c..3ccc1e6dc508650f26755aa07dad16fa856efd2a 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp >@@ -39,33 +39,33 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, const Vector<uint8_t>& plainText, const Vector<uint8_t>& additionalData, uint8_t tagLength) >+static Optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, const Vector<uint8_t>& plainText, const Vector<uint8_t>& additionalData, uint8_t tagLength) > { > // Determine the AES algorithm for the given key size. > auto algorithm = PAL::GCrypt::aesAlgorithmForKeySize(key.size() * 8); > if (!algorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Create a new GCrypt cipher object for the AES algorithm and the GCM cipher mode. > PAL::GCrypt::Handle<gcry_cipher_hd_t> handle; > gcry_error_t error = gcry_cipher_open(&handle, *algorithm, GCRY_CIPHER_MODE_GCM, GCRY_CIPHER_SECURE); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given key for this cipher object. > error = gcry_cipher_setkey(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given IV for this cipher object. > error = gcry_cipher_setiv(handle, iv.data(), iv.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given additonal data, if any, as the authentication data for this cipher object. >@@ -73,7 +73,7 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > error = gcry_cipher_authenticate(handle, additionalData.data(), additionalData.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -81,7 +81,7 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > error = gcry_cipher_final(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Perform the encryption and retrieve the encrypted output. >@@ -89,7 +89,7 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > error = gcry_cipher_encrypt(handle, output.data(), output.size(), plainText.data(), plainText.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // If tag length was specified, retrieve the tag data and append it to the output vector. >@@ -98,7 +98,7 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > error = gcry_cipher_gettag(handle, tag.data(), tag.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > output.appendVector(tag); >@@ -107,33 +107,33 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(const Vector<uint8_t>& key, > return output; > } > >-static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, const Vector<uint8_t>& cipherText, const Vector<uint8_t>& additionalData, uint8_t tagLength) >+static Optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, const Vector<uint8_t>& iv, const Vector<uint8_t>& cipherText, const Vector<uint8_t>& additionalData, uint8_t tagLength) > { > // Determine the AES algorithm for the given key size. > auto algorithm = PAL::GCrypt::aesAlgorithmForKeySize(key.size() * 8); > if (!algorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Create a new GCrypt cipher object for the AES algorithm and the GCM cipher mode. > PAL::GCrypt::Handle<gcry_cipher_hd_t> handle; > gcry_error_t error = gcry_cipher_open(&handle, *algorithm, GCRY_CIPHER_MODE_GCM, 0); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given key for this cipher object. > error = gcry_cipher_setkey(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given IV for this cipher object. > error = gcry_cipher_setiv(handle, iv.data(), iv.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given additonal data, if any, as the authentication data for this cipher object. >@@ -141,7 +141,7 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, > error = gcry_cipher_authenticate(handle, additionalData.data(), additionalData.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -149,7 +149,7 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, > error = gcry_cipher_final(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Account for the specified tag length when performing the decryption and retrieving the decrypted output. >@@ -158,7 +158,7 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, > error = gcry_cipher_decrypt(handle, output.data(), output.size(), cipherText.data(), cipherLength); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // If tag length was indeed specified, retrieve the tag data and compare it securely to the tag data that >@@ -169,11 +169,11 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, > error = gcry_cipher_gettag(handle, tag.data(), tagLength); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > if (constantTimeMemcmp(tag.data(), cipherText.data() + cipherLength, tagLength)) >- return std::nullopt; >+ return WTF::nullopt; > } > > return output; >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp >index 6af2f71c06e69553e4ab69651fea4ad352b1eb4a..bab260d658f801d6c94d6203ad31379bd538bbd2 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp >@@ -35,33 +35,33 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptWrapKey(const Vector<uint8_t>& key, const Vector<uint8_t>& data) >+static Optional<Vector<uint8_t>> gcryptWrapKey(const Vector<uint8_t>& key, const Vector<uint8_t>& data) > { > // Determine the AES algorithm for the given key size. > auto algorithm = PAL::GCrypt::aesAlgorithmForKeySize(key.size() * 8); > if (!algorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Create a new GCrypt cipher object for the AES algorithm and the AES-Wrap cipher mode. > PAL::GCrypt::Handle<gcry_cipher_hd_t> handle; > gcry_error_t error = gcry_cipher_open(&handle, *algorithm, GCRY_CIPHER_MODE_AESWRAP, 0); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given key for this cipher object. > error = gcry_cipher_setkey(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Finalize the cipher object before performing the encryption. > error = gcry_cipher_final(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Perform the encryption. The provided output buffer must be 64 bits larger than the input buffer. >@@ -69,39 +69,39 @@ static std::optional<Vector<uint8_t>> gcryptWrapKey(const Vector<uint8_t>& key, > error = gcry_cipher_encrypt(handle, output.data(), output.size(), data.data(), data.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return output; > } > >-static std::optional<Vector<uint8_t>> gcryptUnwrapKey(const Vector<uint8_t>& key, const Vector<uint8_t>& data) >+static Optional<Vector<uint8_t>> gcryptUnwrapKey(const Vector<uint8_t>& key, const Vector<uint8_t>& data) > { > // Determine the AES algorithm for the given key size. > auto algorithm = PAL::GCrypt::aesAlgorithmForKeySize(key.size() * 8); > if (!algorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Create a new GCrypt cipher object for the AES algorithm and the AES-Wrap cipher mode. > PAL::GCrypt::Handle<gcry_cipher_hd_t> handle; > gcry_error_t error = gcry_cipher_open(&handle, *algorithm, GCRY_CIPHER_MODE_AESWRAP, 0); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Use the given key for this cipher object. > error = gcry_cipher_setkey(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Finalize the cipher object before performing the encryption. > error = gcry_cipher_final(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Perform the decryption. The output buffer may be specified 64 bits shorter than the input buffer. >@@ -109,7 +109,7 @@ static std::optional<Vector<uint8_t>> gcryptUnwrapKey(const Vector<uint8_t>& key > error = gcry_cipher_decrypt(handle, output.data(), output.size(), data.data(), data.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return output; >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp >index 498e6216833b54e2dfef0a963354eb3ee7c10e17..0fe6751154546c64769941b85d830dbe401aeebf 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp >@@ -37,7 +37,7 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptDerive(gcry_sexp_t baseKeySexp, gcry_sexp_t publicKeySexp, size_t keySizeInBytes) >+static Optional<Vector<uint8_t>> gcryptDerive(gcry_sexp_t baseKeySexp, gcry_sexp_t publicKeySexp, size_t keySizeInBytes) > { > // First, retrieve private key data, which is roughly of the following form: > // (private-key >@@ -48,15 +48,15 @@ static std::optional<Vector<uint8_t>> gcryptDerive(gcry_sexp_t baseKeySexp, gcry > { > PAL::GCrypt::Handle<gcry_sexp_t> dSexp(gcry_sexp_find_token(baseKeySexp, "d", 0)); > if (!dSexp) >- return std::nullopt; >+ return WTF::nullopt; > > auto data = mpiData(dSexp); > if (!data) >- return std::nullopt; >+ return WTF::nullopt; > > gcry_sexp_build(&dataSexp, nullptr, "(data(flags raw)(value %b))", data->size(), data->data()); > if (!dataSexp) >- return std::nullopt; >+ return WTF::nullopt; > } > > // Encrypt the data s-expression with the public key. >@@ -64,7 +64,7 @@ static std::optional<Vector<uint8_t>> gcryptDerive(gcry_sexp_t baseKeySexp, gcry > gcry_error_t error = gcry_pk_encrypt(&cipherSexp, dataSexp, publicKeySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Retrieve the shared point value from the generated s-expression, which is of the following form: >@@ -74,24 +74,24 @@ static std::optional<Vector<uint8_t>> gcryptDerive(gcry_sexp_t baseKeySexp, gcry > // (e ...))) > PAL::GCrypt::Handle<gcry_mpi_t> xMPI(gcry_mpi_new(0)); > if (!xMPI) >- return std::nullopt; >+ return WTF::nullopt; > > { > PAL::GCrypt::Handle<gcry_sexp_t> sSexp(gcry_sexp_find_token(cipherSexp, "s", 0)); > if (!sSexp) >- return std::nullopt; >+ return WTF::nullopt; > > PAL::GCrypt::Handle<gcry_mpi_t> sMPI(gcry_sexp_nth_mpi(sSexp, 1, GCRYMPI_FMT_USG)); > if (!sMPI) >- return std::nullopt; >+ return WTF::nullopt; > > PAL::GCrypt::Handle<gcry_mpi_point_t> point(gcry_mpi_point_new(0)); > if (!point) >- return std::nullopt; >+ return WTF::nullopt; > > error = gcry_mpi_ec_decode_point(point, sMPI, nullptr); > if (error != GPG_ERR_NO_ERROR) >- return std::nullopt; >+ return WTF::nullopt; > > // We're only interested in the x-coordinate. > gcry_mpi_point_snatch_get(xMPI, nullptr, nullptr, point.release()); >@@ -100,7 +100,7 @@ static std::optional<Vector<uint8_t>> gcryptDerive(gcry_sexp_t baseKeySexp, gcry > return mpiZeroPrefixedData(xMPI, keySizeInBytes); > } > >-std::optional<Vector<uint8_t>> CryptoAlgorithmECDH::platformDeriveBits(const CryptoKeyEC& baseKey, const CryptoKeyEC& publicKey) >+Optional<Vector<uint8_t>> CryptoAlgorithmECDH::platformDeriveBits(const CryptoKeyEC& baseKey, const CryptoKeyEC& publicKey) > { > return gcryptDerive(baseKey.platformKey(), publicKey.platformKey(), (baseKey.keySizeInBits() + 7) / 8); > } >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp >index 8f589fc6c35bfaf160be0ba1073b0b1e76be9084..881823f8190ecf1f3f57a355cc415cac84da29a9 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp >@@ -62,18 +62,18 @@ static bool extractECDSASignatureInteger(Vector<uint8_t>& signature, gcry_sexp_t > return true; > } > >-static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t keySizeInBytes) >+static Optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t keySizeInBytes) > { > // Perform digest operation with the specified algorithm on the given data. > Vector<uint8_t> dataHash; > { > auto digestAlgorithm = hashCryptoDigestAlgorithm(hashAlgorithmIdentifier); > if (!digestAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > auto digest = PAL::CryptoDigest::create(*digestAlgorithm); > if (!digest) >- return std::nullopt; >+ return WTF::nullopt; > > digest->addBytes(data.data(), data.size()); > dataHash = digest->computeHash(); >@@ -84,13 +84,13 @@ static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vect > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > gcry_error_t error = gcry_sexp_build(&dataSexp, nullptr, "(data(flags raw)(hash %s %b))", > *shaAlgorithm, dataHash.size(), dataHash.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -103,7 +103,7 @@ static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vect > gcry_error_t error = gcry_pk_sign(&signatureSexp, dataSexp, keySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Retrieve MPI data of the resulting r and s integers. They are concatenated into >@@ -113,12 +113,12 @@ static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vect > > if (!extractECDSASignatureInteger(signature, signatureSexp, "r", keySizeInBytes) > || !extractECDSASignatureInteger(signature, signatureSexp, "s", keySizeInBytes)) >- return std::nullopt; >+ return WTF::nullopt; > > return signature; > } > >-static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_t>& signature, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t keySizeInBytes) >+static Optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_t>& signature, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t keySizeInBytes) > { > // Bail if the signature size isn't double the key size (i.e. concatenated r and s components). > if (signature.size() != keySizeInBytes * 2) >@@ -129,11 +129,11 @@ static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_ > { > auto digestAlgorithm = hashCryptoDigestAlgorithm(hashAlgorithmIdentifier); > if (!digestAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > auto digest = PAL::CryptoDigest::create(*digestAlgorithm); > if (!digest) >- return std::nullopt; >+ return WTF::nullopt; > > digest->addBytes(data.data(), data.size()); > dataHash = digest->computeHash(); >@@ -145,7 +145,7 @@ static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_ > keySizeInBytes, signature.data(), keySizeInBytes, signature.data() + keySizeInBytes); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Construct the data s-expression that contains raw hashed data. >@@ -153,13 +153,13 @@ static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_ > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > error = gcry_sexp_build(&dataSexp, nullptr, "(data(flags raw)(hash %s %b))", > *shaAlgorithm, dataHash.size(), dataHash.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp >index f2e61710a20f9333c39e684bec91052f9506ca42..bf6696a3a318d80a725ce0eebb20ff38be967fa1 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp >@@ -40,7 +40,7 @@ namespace WebCore { > // We should switch to the libgcrypt-provided implementation once it's available. > // https://bugs.webkit.org/show_bug.cgi?id=171536 > >-static std::optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& key, const Vector<uint8_t>& salt, const Vector<uint8_t>& info, size_t lengthInBytes, CryptoAlgorithmIdentifier identifier) >+static Optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& key, const Vector<uint8_t>& salt, const Vector<uint8_t>& info, size_t lengthInBytes, CryptoAlgorithmIdentifier identifier) > { > // libgcrypt doesn't provide HKDF support, so we have to implement > // the functionality ourselves as specified in RFC5869. >@@ -48,18 +48,18 @@ static std::optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& ke > > auto macAlgorithm = hmacAlgorithm(identifier); > if (!macAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // We can immediately discard invalid output lengths, otherwise needed for the expand step. > size_t macLength = gcry_mac_get_algo_maclen(*macAlgorithm); > if (lengthInBytes > macLength * 255) >- return std::nullopt; >+ return WTF::nullopt; > > PAL::GCrypt::Handle<gcry_mac_hd_t> handle; > gcry_error_t error = gcry_mac_open(&handle, *macAlgorithm, 0, nullptr); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Step 1 -- Extract. A pseudo-random key is generated with the specified algorithm >@@ -74,25 +74,25 @@ static std::optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& ke > error = gcry_mac_setkey(handle, salt.data(), salt.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > error = gcry_mac_write(handle, key.data(), key.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > size_t pseudoRandomKeySize = pseudoRandomKey.size(); > error = gcry_mac_read(handle, pseudoRandomKey.data(), &pseudoRandomKeySize); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Something went wrong if libgcrypt didn't write out the proper amount of data. > if (pseudoRandomKeySize != macLength) >- return std::nullopt; >+ return WTF::nullopt; > } > > // Step #2 -- Expand. >@@ -108,13 +108,13 @@ static std::optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& ke > error = gcry_mac_reset(handle); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > error = gcry_mac_setkey(handle, pseudoRandomKey.data(), pseudoRandomKey.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // T(0) = empty string (zero length) -- i.e. empty lastBlock >@@ -128,19 +128,19 @@ static std::optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& ke > error = gcry_mac_write(handle, blockData.data(), blockData.size()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > size_t blockSize = lastBlock.size(); > error = gcry_mac_read(handle, lastBlock.data(), &blockSize); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Something went wrong if libgcrypt didn't write out the proper amount of data. > if (blockSize != lastBlock.size()) >- return std::nullopt; >+ return WTF::nullopt; > > // Append the current block data to the output vector. > output.appendVector(lastBlock); >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp >index 4b52095298dd8234afbc63a9692aa69ab67a8758..62ea5fbb8d12b708bddfb2e8e8e0cdfc98e49e0f 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp >@@ -55,28 +55,28 @@ static int getGCryptDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction) > } > } > >-static std::optional<Vector<uint8_t>> calculateSignature(int algorithm, const Vector<uint8_t>& key, const uint8_t* data, size_t dataLength) >+static Optional<Vector<uint8_t>> calculateSignature(int algorithm, const Vector<uint8_t>& key, const uint8_t* data, size_t dataLength) > { > const void* keyData = key.data() ? key.data() : reinterpret_cast<const uint8_t*>(""); > > PAL::GCrypt::Handle<gcry_mac_hd_t> hd; > gcry_error_t err = gcry_mac_open(&hd, algorithm, 0, nullptr); > if (err) >- return std::nullopt; >+ return WTF::nullopt; > > err = gcry_mac_setkey(hd, keyData, key.size()); > if (err) >- return std::nullopt; >+ return WTF::nullopt; > > err = gcry_mac_write(hd, data, dataLength); > if (err) >- return std::nullopt; >+ return WTF::nullopt; > > size_t digestLength = gcry_mac_get_algo_maclen(algorithm); > Vector<uint8_t> signature(digestLength); > err = gcry_mac_read(hd, signature.data(), &digestLength); > if (err) >- return std::nullopt; >+ return WTF::nullopt; > > signature.resize(digestLength); > return WTFMove(signature); >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp >index 66edfbd81998f17e0c28578b1d4eeb35bf71c900..7c900515bc190b65a68ff886de9d8b94a65c9e75 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp >@@ -36,12 +36,12 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& keyData, const Vector<uint8_t>& saltData, CryptoAlgorithmIdentifier hashIdentifier, size_t iterations, size_t length) >+static Optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& keyData, const Vector<uint8_t>& saltData, CryptoAlgorithmIdentifier hashIdentifier, size_t iterations, size_t length) > { > // Determine the hash algorithm that will be used for derivation. > auto hashAlgorithm = digestAlgorithm(hashIdentifier); > if (!hashAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > // Length, in bits, is a multiple of 8, as guaranteed by CryptoAlgorithmPBKDF2::deriveBits(). > ASSERT(!(length % 8)); >@@ -51,7 +51,7 @@ static std::optional<Vector<uint8_t>> gcryptDeriveBits(const Vector<uint8_t>& ke > gcry_error_t error = gcry_kdf_derive(keyData.data(), keyData.size(), GCRY_KDF_PBKDF2, *hashAlgorithm, saltData.data(), saltData.size(), iterations, result.size(), result.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return result; >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp >index 0e4e2de719f2759d55f5c95f358845e62893a82f..389fbbda3b58f52986b05b964324d3043b42c102 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp >@@ -33,7 +33,7 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptEncrypt(gcry_sexp_t keySexp, const Vector<uint8_t>& plainText, size_t keySizeInBytes) >+static Optional<Vector<uint8_t>> gcryptEncrypt(gcry_sexp_t keySexp, const Vector<uint8_t>& plainText, size_t keySizeInBytes) > { > // Embed the plain-text data in a `data` s-expression using PKCS#1 padding. > PAL::GCrypt::Handle<gcry_sexp_t> dataSexp; >@@ -41,7 +41,7 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(gcry_sexp_t keySexp, const V > plainText.size(), plainText.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Encrypt data with the provided key. The returned s-expression is of this form: >@@ -52,18 +52,18 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(gcry_sexp_t keySexp, const V > error = gcry_pk_encrypt(&cipherSexp, dataSexp, keySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Return MPI data of the embedded `a` integer. > PAL::GCrypt::Handle<gcry_sexp_t> aSexp(gcry_sexp_find_token(cipherSexp, "a", 0)); > if (!aSexp) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiZeroPrefixedData(aSexp, keySizeInBytes); > } > >-static std::optional<Vector<uint8_t>> gcryptDecrypt(gcry_sexp_t keySexp, const Vector<uint8_t>& cipherText) >+static Optional<Vector<uint8_t>> gcryptDecrypt(gcry_sexp_t keySexp, const Vector<uint8_t>& cipherText) > { > // Embed the cipher-text data in an `enc-val` s-expression using PKCS#1 padding. > PAL::GCrypt::Handle<gcry_sexp_t> encValSexp; >@@ -71,7 +71,7 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(gcry_sexp_t keySexp, const V > cipherText.size(), cipherText.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Decrypt data with the provided key. The returned s-expression is of this form: >@@ -82,13 +82,13 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(gcry_sexp_t keySexp, const V > error = gcry_pk_decrypt(&plainSexp, encValSexp, keySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Return MPI data of the embedded `value` integer. > PAL::GCrypt::Handle<gcry_sexp_t> valueSexp(gcry_sexp_find_token(plainSexp, "value", 0)); > if (!valueSexp) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiData(valueSexp); > } >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp >index be6aa86f80793594f81196b4448a6e10a124dca2..4ca400fba146ea055563f70f7e48aa0923545357 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp >@@ -35,18 +35,18 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t keySizeInBytes) >+static Optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t keySizeInBytes) > { > // Perform digest operation with the specified algorithm on the given data. > Vector<uint8_t> dataHash; > { > auto digestAlgorithm = hashCryptoDigestAlgorithm(hashAlgorithmIdentifier); > if (!digestAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > auto digest = PAL::CryptoDigest::create(*digestAlgorithm); > if (!digest) >- return std::nullopt; >+ return WTF::nullopt; > > digest->addBytes(data.data(), data.size()); > dataHash = digest->computeHash(); >@@ -57,13 +57,13 @@ static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vect > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > gcry_error_t error = gcry_sexp_build(&dataSexp, nullptr, "(data(flags pkcs1)(hash %s %b))", > *shaAlgorithm, dataHash.size(), dataHash.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -75,29 +75,29 @@ static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vect > gcry_error_t error = gcry_pk_sign(&signatureSexp, dataSexp, keySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Return MPI data of the embedded s integer. > PAL::GCrypt::Handle<gcry_sexp_t> sSexp(gcry_sexp_find_token(signatureSexp, "s", 0)); > if (!sSexp) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiZeroPrefixedData(sSexp, keySizeInBytes); > } > >-static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_t>& signature, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier) >+static Optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_t>& signature, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier) > { > // Perform digest operation with the specified algorithm on the given data. > Vector<uint8_t> dataHash; > { > auto digestAlgorithm = hashCryptoDigestAlgorithm(hashAlgorithmIdentifier); > if (!digestAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > auto digest = PAL::CryptoDigest::create(*digestAlgorithm); > if (!digest) >- return std::nullopt; >+ return WTF::nullopt; > > digest->addBytes(data.data(), data.size()); > dataHash = digest->computeHash(); >@@ -109,7 +109,7 @@ static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_ > signature.size(), signature.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Construct the data s-expression that contains PKCS#1-padded hashed data. >@@ -117,13 +117,13 @@ static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_ > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > error = gcry_sexp_build(&dataSexp, nullptr, "(data(flags pkcs1)(hash %s %b))", > *shaAlgorithm, dataHash.size(), dataHash.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp >index 87c56c0673156903fa4507429be0604fd618e5b7..e51e0d7b50d39fccd727e244639331cc4cd029d2 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp >@@ -35,7 +35,7 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptEncrypt(CryptoAlgorithmIdentifier hashAlgorithmIdentifier, gcry_sexp_t keySexp, const Vector<uint8_t>& labelVector, const Vector<uint8_t>& plainText, size_t keySizeInBytes) >+static Optional<Vector<uint8_t>> gcryptEncrypt(CryptoAlgorithmIdentifier hashAlgorithmIdentifier, gcry_sexp_t keySexp, const Vector<uint8_t>& labelVector, const Vector<uint8_t>& plainText, size_t keySizeInBytes) > { > // Embed the plain-text data in a data s-expression using OAEP padding. > // Empty label data is properly handled by gcry_sexp_build(). >@@ -43,13 +43,13 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(CryptoAlgorithmIdentifier ha > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > gcry_error_t error = gcry_sexp_build(&dataSexp, nullptr, "(data(flags oaep)(hash-algo %s)(label %b)(value %b))", > *shaAlgorithm, labelVector.size(), labelVector.data(), plainText.size(), plainText.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -62,18 +62,18 @@ static std::optional<Vector<uint8_t>> gcryptEncrypt(CryptoAlgorithmIdentifier ha > gcry_error_t error = gcry_pk_encrypt(&cipherSexp, dataSexp, keySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Return MPI data of the embedded a integer. > PAL::GCrypt::Handle<gcry_sexp_t> aSexp(gcry_sexp_find_token(cipherSexp, "a", 0)); > if (!aSexp) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiZeroPrefixedData(aSexp, keySizeInBytes); > } > >-static std::optional<Vector<uint8_t>> gcryptDecrypt(CryptoAlgorithmIdentifier hashAlgorithmIdentifier, gcry_sexp_t keySexp, const Vector<uint8_t>& labelVector, const Vector<uint8_t>& cipherText) >+static Optional<Vector<uint8_t>> gcryptDecrypt(CryptoAlgorithmIdentifier hashAlgorithmIdentifier, gcry_sexp_t keySexp, const Vector<uint8_t>& labelVector, const Vector<uint8_t>& cipherText) > { > // Embed the cipher-text data in an enc-val s-expression using OAEP padding. > // Empty label data is properly handled by gcry_sexp_build(). >@@ -81,13 +81,13 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(CryptoAlgorithmIdentifier ha > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > gcry_error_t error = gcry_sexp_build(&encValSexp, nullptr, "(enc-val(flags oaep)(hash-algo %s)(label %b)(rsa(a %b)))", > *shaAlgorithm, labelVector.size(), labelVector.data(), cipherText.size(), cipherText.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -99,13 +99,13 @@ static std::optional<Vector<uint8_t>> gcryptDecrypt(CryptoAlgorithmIdentifier ha > gcry_error_t error = gcry_pk_decrypt(&plainSexp, encValSexp, keySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Return MPI data of the embedded value integer. > PAL::GCrypt::Handle<gcry_sexp_t> valueSexp(gcry_sexp_find_token(plainSexp, "value", 0)); > if (!valueSexp) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiData(valueSexp); > } >diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp >index fe1618a745743bb50e988b89f732e978fe7e4c14..bf73d84c33c8b3bd7fb8feedf176533c03cb5e37 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp >@@ -36,18 +36,18 @@ > > namespace WebCore { > >-static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t saltLength, size_t keySizeInBytes) >+static Optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t saltLength, size_t keySizeInBytes) > { > // Perform digest operation with the specified algorithm on the given data. > Vector<uint8_t> dataHash; > { > auto digestAlgorithm = hashCryptoDigestAlgorithm(hashAlgorithmIdentifier); > if (!digestAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > auto digest = PAL::CryptoDigest::create(*digestAlgorithm); > if (!digest) >- return std::nullopt; >+ return WTF::nullopt; > > digest->addBytes(data.data(), data.size()); > dataHash = digest->computeHash(); >@@ -58,13 +58,13 @@ static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vect > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > gcry_error_t error = gcry_sexp_build(&dataSexp, nullptr, "(data(flags pss)(salt-length %u)(hash %s %b))", > saltLength, *shaAlgorithm, dataHash.size(), dataHash.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -76,29 +76,29 @@ static std::optional<Vector<uint8_t>> gcryptSign(gcry_sexp_t keySexp, const Vect > gcry_error_t error = gcry_pk_sign(&signatureSexp, dataSexp, keySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Retrieve MPI data of the embedded `s` integer. > PAL::GCrypt::Handle<gcry_sexp_t> sSexp(gcry_sexp_find_token(signatureSexp, "s", 0)); > if (!sSexp) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiZeroPrefixedData(sSexp, keySizeInBytes); > } > >-static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_t>& signature, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t saltLength) >+static Optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_t>& signature, const Vector<uint8_t>& data, CryptoAlgorithmIdentifier hashAlgorithmIdentifier, size_t saltLength) > { > // Perform digest operation with the specified algorithm on the given data. > Vector<uint8_t> dataHash; > { > auto digestAlgorithm = hashCryptoDigestAlgorithm(hashAlgorithmIdentifier); > if (!digestAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > auto digest = PAL::CryptoDigest::create(*digestAlgorithm); > if (!digest) >- return std::nullopt; >+ return WTF::nullopt; > > digest->addBytes(data.data(), data.size()); > dataHash = digest->computeHash(); >@@ -110,7 +110,7 @@ static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_ > signature.size(), signature.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > // Construct the `data` s-expression that contains PSS-padded hashed data. >@@ -118,13 +118,13 @@ static std::optional<bool> gcryptVerify(gcry_sexp_t keySexp, const Vector<uint8_ > { > auto shaAlgorithm = hashAlgorithmName(hashAlgorithmIdentifier); > if (!shaAlgorithm) >- return std::nullopt; >+ return WTF::nullopt; > > error = gcry_sexp_build(&dataSexp, nullptr, "(data(flags pss)(salt-length %u)(hash %s %b))", > saltLength, *shaAlgorithm, dataHash.size(), dataHash.data()); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp >index 798eacea326613f00649331d78617006f113e096..e862b3a032b1a9bcc73ec98170a392747ebf178c 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp >@@ -121,26 +121,26 @@ bool CryptoKeyEC::platformSupportedCurve(NamedCurve curve) > return curve == NamedCurve::P256 || curve == NamedCurve::P384 || curve == NamedCurve::P521; > } > >-std::optional<CryptoKeyPair> CryptoKeyEC::platformGeneratePair(CryptoAlgorithmIdentifier identifier, NamedCurve curve, bool extractable, CryptoKeyUsageBitmap usages) >+Optional<CryptoKeyPair> CryptoKeyEC::platformGeneratePair(CryptoAlgorithmIdentifier identifier, NamedCurve curve, bool extractable, CryptoKeyUsageBitmap usages) > { > PAL::GCrypt::Handle<gcry_sexp_t> genkeySexp; > gcry_error_t error = gcry_sexp_build(&genkeySexp, nullptr, "(genkey(ecc(curve %s)))", curveName(curve)); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > PAL::GCrypt::Handle<gcry_sexp_t> keyPairSexp; > error = gcry_pk_genkey(&keyPairSexp, genkeySexp); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > PAL::GCrypt::Handle<gcry_sexp_t> publicKeySexp(gcry_sexp_find_token(keyPairSexp, "public-key", 0)); > PAL::GCrypt::Handle<gcry_sexp_t> privateKeySexp(gcry_sexp_find_token(keyPairSexp, "private-key", 0)); > if (!publicKeySexp || !privateKeySexp) >- return std::nullopt; >+ return WTF::nullopt; > > auto publicKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Public, publicKeySexp.release(), true, usages); > auto privateKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Private, privateKeySexp.release(), extractable, usages); >@@ -237,7 +237,7 @@ static bool supportedAlgorithmIdentifier(CryptoAlgorithmIdentifier keyIdentifier > return false; > } > >-static std::optional<CryptoKeyEC::NamedCurve> curveForIdentifier(const Vector<uint8_t>& identifier) >+static Optional<CryptoKeyEC::NamedCurve> curveForIdentifier(const Vector<uint8_t>& identifier) > { > auto* data = identifier.data(); > auto size = identifier.size(); >@@ -249,7 +249,7 @@ static std::optional<CryptoKeyEC::NamedCurve> curveForIdentifier(const Vector<ui > if (CryptoConstants::matches(data, size, CryptoConstants::s_secp521r1Identifier)) > return CryptoKeyEC::NamedCurve::P521; > >- return std::nullopt; >+ return WTF::nullopt; > } > > RefPtr<CryptoKeyEC> CryptoKeyEC::platformImportSpki(CryptoAlgorithmIdentifier identifier, NamedCurve curve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) >diff --git a/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp >index 3e109ff5e076d6d6b6e75733929810d01f17c3d2..c642ca68f3fefe1655f79b4ba584ec3077c5fb26 100644 >--- a/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp >+++ b/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp >@@ -177,11 +177,11 @@ size_t CryptoKeyRSA::keySizeInBits() const > } > > // Convert the exponent vector to a 32-bit value, if possible. >-static std::optional<uint32_t> exponentVectorToUInt32(const Vector<uint8_t>& exponent) >+static Optional<uint32_t> exponentVectorToUInt32(const Vector<uint8_t>& exponent) > { > if (exponent.size() > 4) { > if (std::any_of(exponent.begin(), exponent.end() - 4, [](uint8_t element) { return !!element; })) >- return std::nullopt; >+ return WTF::nullopt; > } > > uint32_t result = 0; >@@ -269,7 +269,7 @@ static bool supportedAlgorithmIdentifier(const uint8_t* data, size_t size) > return false; > } > >-RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifier, std::optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) >+RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifier, Optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) > { > // Decode the `SubjectPublicKeyInfo` structure using the provided key data. > PAL::TASN1::Structure spki; >@@ -316,7 +316,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifi > return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, platformKey.release(), extractable, usages)); > } > >-RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identifier, std::optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) >+RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identifier, Optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) > { > // Decode the `PrivateKeyInfo` structure using the provided key data. > PAL::TASN1::Structure pkcs8; >diff --git a/Source/WebCore/crypto/gcrypt/GCryptUtilities.cpp b/Source/WebCore/crypto/gcrypt/GCryptUtilities.cpp >index 092eef7da467ebc4f30ebcc5026d49900104e9a3..8094546ee4ecb15cfdaf1f56ed3f6fd7441d5a2c 100644 >--- a/Source/WebCore/crypto/gcrypt/GCryptUtilities.cpp >+++ b/Source/WebCore/crypto/gcrypt/GCryptUtilities.cpp >@@ -30,7 +30,7 @@ > > namespace WebCore { > >-std::optional<const char*> hashAlgorithmName(CryptoAlgorithmIdentifier identifier) >+Optional<const char*> hashAlgorithmName(CryptoAlgorithmIdentifier identifier) > { > switch (identifier) { > case CryptoAlgorithmIdentifier::SHA_1: >@@ -44,11 +44,11 @@ std::optional<const char*> hashAlgorithmName(CryptoAlgorithmIdentifier identifie > case CryptoAlgorithmIdentifier::SHA_512: > return "sha512"; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-std::optional<int> hmacAlgorithm(CryptoAlgorithmIdentifier identifier) >+Optional<int> hmacAlgorithm(CryptoAlgorithmIdentifier identifier) > { > switch (identifier) { > case CryptoAlgorithmIdentifier::SHA_1: >@@ -62,11 +62,11 @@ std::optional<int> hmacAlgorithm(CryptoAlgorithmIdentifier identifier) > case CryptoAlgorithmIdentifier::SHA_512: > return GCRY_MAC_HMAC_SHA512; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-std::optional<int> digestAlgorithm(CryptoAlgorithmIdentifier identifier) >+Optional<int> digestAlgorithm(CryptoAlgorithmIdentifier identifier) > { > switch (identifier) { > case CryptoAlgorithmIdentifier::SHA_1: >@@ -80,11 +80,11 @@ std::optional<int> digestAlgorithm(CryptoAlgorithmIdentifier identifier) > case CryptoAlgorithmIdentifier::SHA_512: > return GCRY_MD_SHA512; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-std::optional<PAL::CryptoDigest::Algorithm> hashCryptoDigestAlgorithm(CryptoAlgorithmIdentifier identifier) >+Optional<PAL::CryptoDigest::Algorithm> hashCryptoDigestAlgorithm(CryptoAlgorithmIdentifier identifier) > { > switch (identifier) { > case CryptoAlgorithmIdentifier::SHA_1: >@@ -98,57 +98,57 @@ std::optional<PAL::CryptoDigest::Algorithm> hashCryptoDigestAlgorithm(CryptoAlgo > case CryptoAlgorithmIdentifier::SHA_512: > return PAL::CryptoDigest::Algorithm::SHA_512; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-std::optional<size_t> mpiLength(gcry_mpi_t paramMPI) >+Optional<size_t> mpiLength(gcry_mpi_t paramMPI) > { > // Retrieve the MPI length for the unsigned format. > size_t dataLength = 0; > gcry_error_t error = gcry_mpi_print(GCRYMPI_FMT_USG, nullptr, 0, &dataLength, paramMPI); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return dataLength; > } > >-std::optional<size_t> mpiLength(gcry_sexp_t paramSexp) >+Optional<size_t> mpiLength(gcry_sexp_t paramSexp) > { > // Retrieve the MPI value stored in the s-expression: (name mpi-data) > PAL::GCrypt::Handle<gcry_mpi_t> paramMPI(gcry_sexp_nth_mpi(paramSexp, 1, GCRYMPI_FMT_USG)); > if (!paramMPI) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiLength(paramMPI); > } > >-std::optional<Vector<uint8_t>> mpiData(gcry_mpi_t paramMPI) >+Optional<Vector<uint8_t>> mpiData(gcry_mpi_t paramMPI) > { > // Retrieve the MPI length. > auto length = mpiLength(paramMPI); > if (!length) >- return std::nullopt; >+ return WTF::nullopt; > > // Copy the MPI data into a properly-sized buffer. > Vector<uint8_t> output(*length); > gcry_error_t error = gcry_mpi_print(GCRYMPI_FMT_USG, output.data(), output.size(), nullptr, paramMPI); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return output; > } > >-std::optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_mpi_t paramMPI, size_t targetLength) >+Optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_mpi_t paramMPI, size_t targetLength) > { > // Retrieve the MPI length. Bail if the retrieved length is longer than target length. > auto length = mpiLength(paramMPI); > if (!length || *length > targetLength) >- return std::nullopt; >+ return WTF::nullopt; > > // Fill out the output buffer with zeros. Properly determine the zero prefix length, > // and copy the MPI data into memory area following the prefix (if any). >@@ -157,37 +157,37 @@ std::optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_mpi_t paramMPI, size_t t > gcry_error_t error = gcry_mpi_print(GCRYMPI_FMT_USG, output.data() + prefixLength, targetLength, nullptr, paramMPI); > if (error != GPG_ERR_NO_ERROR) { > PAL::GCrypt::logError(error); >- return std::nullopt; >+ return WTF::nullopt; > } > > return output; > } > >-std::optional<Vector<uint8_t>> mpiData(gcry_sexp_t paramSexp) >+Optional<Vector<uint8_t>> mpiData(gcry_sexp_t paramSexp) > { > // Retrieve the MPI value stored in the s-expression: (name mpi-data) > PAL::GCrypt::Handle<gcry_mpi_t> paramMPI(gcry_sexp_nth_mpi(paramSexp, 1, GCRYMPI_FMT_USG)); > if (!paramMPI) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiData(paramMPI); > } > >-std::optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_sexp_t paramSexp, size_t targetLength) >+Optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_sexp_t paramSexp, size_t targetLength) > { > // Retrieve the MPI value stored in the s-expression: (name mpi-data) > PAL::GCrypt::Handle<gcry_mpi_t> paramMPI(gcry_sexp_nth_mpi(paramSexp, 1, GCRYMPI_FMT_USG)); > if (!paramMPI) >- return std::nullopt; >+ return WTF::nullopt; > > return mpiZeroPrefixedData(paramMPI, targetLength); > } > >-std::optional<Vector<uint8_t>> mpiSignedData(gcry_mpi_t mpi) >+Optional<Vector<uint8_t>> mpiSignedData(gcry_mpi_t mpi) > { > auto data = mpiData(mpi); > if (!data) >- return std::nullopt; >+ return WTF::nullopt; > > if (data->at(0) & 0x80) > data->insert(0, 0x00); >@@ -195,11 +195,11 @@ std::optional<Vector<uint8_t>> mpiSignedData(gcry_mpi_t mpi) > return data; > } > >-std::optional<Vector<uint8_t>> mpiSignedData(gcry_sexp_t paramSexp) >+Optional<Vector<uint8_t>> mpiSignedData(gcry_sexp_t paramSexp) > { > auto data = mpiData(paramSexp); > if (!data) >- return std::nullopt; >+ return WTF::nullopt; > > if (data->at(0) & 0x80) > data->insert(0, 0x00); >diff --git a/Source/WebCore/crypto/gcrypt/GCryptUtilities.h b/Source/WebCore/crypto/gcrypt/GCryptUtilities.h >index 36f48d04d782d52399dd77c4bc3d7828d795a9f1..a0c6c3d2dfa5ba643b15d4a179a0c3d81f2ae232 100644 >--- a/Source/WebCore/crypto/gcrypt/GCryptUtilities.h >+++ b/Source/WebCore/crypto/gcrypt/GCryptUtilities.h >@@ -68,19 +68,19 @@ static inline bool matches(const void* lhs, size_t size, const std::array<uint8_ > > } // namespace CryptoConstants > >-std::optional<const char*> hashAlgorithmName(CryptoAlgorithmIdentifier); >- >-std::optional<int> hmacAlgorithm(CryptoAlgorithmIdentifier); >-std::optional<int> digestAlgorithm(CryptoAlgorithmIdentifier); >-std::optional<PAL::CryptoDigest::Algorithm> hashCryptoDigestAlgorithm(CryptoAlgorithmIdentifier); >- >-std::optional<size_t> mpiLength(gcry_mpi_t); >-std::optional<size_t> mpiLength(gcry_sexp_t); >-std::optional<Vector<uint8_t>> mpiData(gcry_mpi_t); >-std::optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_mpi_t, size_t targetLength); >-std::optional<Vector<uint8_t>> mpiData(gcry_sexp_t); >-std::optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_sexp_t, size_t targetLength); >-std::optional<Vector<uint8_t>> mpiSignedData(gcry_mpi_t); >-std::optional<Vector<uint8_t>> mpiSignedData(gcry_sexp_t); >+Optional<const char*> hashAlgorithmName(CryptoAlgorithmIdentifier); >+ >+Optional<int> hmacAlgorithm(CryptoAlgorithmIdentifier); >+Optional<int> digestAlgorithm(CryptoAlgorithmIdentifier); >+Optional<PAL::CryptoDigest::Algorithm> hashCryptoDigestAlgorithm(CryptoAlgorithmIdentifier); >+ >+Optional<size_t> mpiLength(gcry_mpi_t); >+Optional<size_t> mpiLength(gcry_sexp_t); >+Optional<Vector<uint8_t>> mpiData(gcry_mpi_t); >+Optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_mpi_t, size_t targetLength); >+Optional<Vector<uint8_t>> mpiData(gcry_sexp_t); >+Optional<Vector<uint8_t>> mpiZeroPrefixedData(gcry_sexp_t, size_t targetLength); >+Optional<Vector<uint8_t>> mpiSignedData(gcry_mpi_t); >+Optional<Vector<uint8_t>> mpiSignedData(gcry_sexp_t); > > } // namespace WebCore >diff --git a/Source/WebCore/crypto/keys/CryptoKeyEC.cpp b/Source/WebCore/crypto/keys/CryptoKeyEC.cpp >index 6784fa8c320ae4b2a859fe6c23f4345889836af0..369b97f448c2c3af3070fc84ae19e18615465e4c 100644 >--- a/Source/WebCore/crypto/keys/CryptoKeyEC.cpp >+++ b/Source/WebCore/crypto/keys/CryptoKeyEC.cpp >@@ -38,7 +38,7 @@ static const ASCIILiteral P256 { "P-256"_s }; > static const ASCIILiteral P384 { "P-384"_s }; > static const ASCIILiteral P521 { "P-521"_s }; > >-static std::optional<CryptoKeyEC::NamedCurve> toNamedCurve(const String& curve) >+static Optional<CryptoKeyEC::NamedCurve> toNamedCurve(const String& curve) > { > if (curve == P256) > return CryptoKeyEC::NamedCurve::P256; >@@ -47,7 +47,7 @@ static std::optional<CryptoKeyEC::NamedCurve> toNamedCurve(const String& curve) > if (curve == P521) > return CryptoKeyEC::NamedCurve::P521; > >- return std::nullopt; >+ return WTF::nullopt; > } > > CryptoKeyEC::CryptoKeyEC(CryptoAlgorithmIdentifier identifier, NamedCurve curve, CryptoKeyType type, PlatformECKey platformKey, bool extractable, CryptoKeyUsageBitmap usages) >diff --git a/Source/WebCore/crypto/keys/CryptoKeyEC.h b/Source/WebCore/crypto/keys/CryptoKeyEC.h >index 2e9c2e3d2fb2cd6cffe92dcdc3597b67929564e2..42004e7d15149f7fe2397957013c6b08978f8710 100644 >--- a/Source/WebCore/crypto/keys/CryptoKeyEC.h >+++ b/Source/WebCore/crypto/keys/CryptoKeyEC.h >@@ -86,7 +86,7 @@ private: > KeyAlgorithm algorithm() const final; > > static bool platformSupportedCurve(NamedCurve); >- static std::optional<CryptoKeyPair> platformGeneratePair(CryptoAlgorithmIdentifier, NamedCurve, bool extractable, CryptoKeyUsageBitmap); >+ static Optional<CryptoKeyPair> platformGeneratePair(CryptoAlgorithmIdentifier, NamedCurve, bool extractable, CryptoKeyUsageBitmap); > static RefPtr<CryptoKeyEC> platformImportRaw(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap); > static RefPtr<CryptoKeyEC> platformImportJWKPublic(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& x, Vector<uint8_t>&& y, bool extractable, CryptoKeyUsageBitmap); > static RefPtr<CryptoKeyEC> platformImportJWKPrivate(CryptoAlgorithmIdentifier, NamedCurve, Vector<uint8_t>&& x, Vector<uint8_t>&& y, Vector<uint8_t>&& d, bool extractable, CryptoKeyUsageBitmap); >diff --git a/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp b/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp >index 41e021cb3dea73849914f8b7a00070bee8949de9..73de51aeb214e164e17fd50af80f438dfb39bbfa 100644 >--- a/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp >+++ b/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp >@@ -34,7 +34,7 @@ > > namespace WebCore { > >-RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm, std::optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages) >+RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm, Optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages) > { > if (keyData.kty != "RSA") > return nullptr; >@@ -57,7 +57,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm > if (keyData.d.isNull()) { > // import public key > auto publicKeyComponents = CryptoKeyRSAComponents::createPublic(WTFMove(modulus), WTFMove(exponent)); >- // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. >+ // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt. > return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *publicKeyComponents, extractable, usages); > } > >@@ -67,7 +67,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm > return nullptr; > if (keyData.p.isNull() && keyData.q.isNull() && keyData.dp.isNull() && keyData.dp.isNull() && keyData.qi.isNull()) { > auto privateKeyComponents = CryptoKeyRSAComponents::createPrivate(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent)); >- // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. >+ // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt. > return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages); > } > >@@ -87,7 +87,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm > return nullptr; > if (!keyData.oth) { > auto privateKeyComponents = CryptoKeyRSAComponents::createPrivateWithAdditionalData(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), { }); >- // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. >+ // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt. > return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages); > } > >@@ -104,7 +104,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm > } > > auto privateKeyComponents = CryptoKeyRSAComponents::createPrivateWithAdditionalData(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), WTFMove(otherPrimeInfos)); >- // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. >+ // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt. > return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages); > } > >diff --git a/Source/WebCore/crypto/keys/CryptoKeyRSA.h b/Source/WebCore/crypto/keys/CryptoKeyRSA.h >index a0119d13a29f95604a3ea1330e469aedc74a2290..d24d67394c47580dc9967f025f22c5e59108a0c8 100644 >--- a/Source/WebCore/crypto/keys/CryptoKeyRSA.h >+++ b/Source/WebCore/crypto/keys/CryptoKeyRSA.h >@@ -67,9 +67,9 @@ public: > using KeyPairCallback = WTF::Function<void(CryptoKeyPair&&)>; > using VoidCallback = WTF::Function<void()>; > static void generatePair(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap, KeyPairCallback&&, VoidCallback&& failureCallback, ScriptExecutionContext*); >- static RefPtr<CryptoKeyRSA> importJwk(CryptoAlgorithmIdentifier, std::optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap); >- static RefPtr<CryptoKeyRSA> importSpki(CryptoAlgorithmIdentifier, std::optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&&, bool extractable, CryptoKeyUsageBitmap); >- static RefPtr<CryptoKeyRSA> importPkcs8(CryptoAlgorithmIdentifier, std::optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&&, bool extractable, CryptoKeyUsageBitmap); >+ static RefPtr<CryptoKeyRSA> importJwk(CryptoAlgorithmIdentifier, Optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap); >+ static RefPtr<CryptoKeyRSA> importSpki(CryptoAlgorithmIdentifier, Optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&&, bool extractable, CryptoKeyUsageBitmap); >+ static RefPtr<CryptoKeyRSA> importPkcs8(CryptoAlgorithmIdentifier, Optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&&, bool extractable, CryptoKeyUsageBitmap); > > PlatformRSAKey platformKey() const { return m_platformKey; } > JsonWebKey exportJwk() const; >diff --git a/Source/WebCore/crypto/mac/CryptoAlgorithmECDHMac.cpp b/Source/WebCore/crypto/mac/CryptoAlgorithmECDHMac.cpp >index a72060e3fcee8ee9510fe2ad46d17f9de1e18f5c..d780ef0160db09b41bd806016e148104c5a3068f 100644 >--- a/Source/WebCore/crypto/mac/CryptoAlgorithmECDHMac.cpp >+++ b/Source/WebCore/crypto/mac/CryptoAlgorithmECDHMac.cpp >@@ -33,9 +33,9 @@ > > namespace WebCore { > >-std::optional<Vector<uint8_t>> CryptoAlgorithmECDH::platformDeriveBits(const CryptoKeyEC& baseKey, const CryptoKeyEC& publicKey) >+Optional<Vector<uint8_t>> CryptoAlgorithmECDH::platformDeriveBits(const CryptoKeyEC& baseKey, const CryptoKeyEC& publicKey) > { >- std::optional<Vector<uint8_t>> result = std::nullopt; >+ Optional<Vector<uint8_t>> result = WTF::nullopt; > Vector<uint8_t> derivedKey(baseKey.keySizeInBits() / 8); // Per https://tools.ietf.org/html/rfc6090#section-4. > size_t size = derivedKey.size(); > if (!CCECCryptorComputeSharedSecret(baseKey.platformKey(), publicKey.platformKey(), derivedKey.data(), &size)) >diff --git a/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp b/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp >index a09772aa71a5632ac1f6dc2a7344dd9efe004b50..2078d192e8fd4ceb84a1b6a4917cf75343cf1294 100644 >--- a/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp >+++ b/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp >@@ -34,7 +34,7 @@ > > namespace WebCore { > >-static std::optional<CCHmacAlgorithm> commonCryptoHMACAlgorithm(CryptoAlgorithmIdentifier hashFunction) >+static Optional<CCHmacAlgorithm> commonCryptoHMACAlgorithm(CryptoAlgorithmIdentifier hashFunction) > { > switch (hashFunction) { > case CryptoAlgorithmIdentifier::SHA_1: >@@ -48,7 +48,7 @@ static std::optional<CCHmacAlgorithm> commonCryptoHMACAlgorithm(CryptoAlgorithmI > case CryptoAlgorithmIdentifier::SHA_512: > return kCCHmacAlgSHA512; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/crypto/mac/CryptoDigestAlgorithm.h b/Source/WebCore/crypto/mac/CryptoDigestAlgorithm.h >index 848d89416a0361c1add165b9270256c5ee6e75fe..0891d3914a94de448f1c52421ef3ab2a1f21e119 100644 >--- a/Source/WebCore/crypto/mac/CryptoDigestAlgorithm.h >+++ b/Source/WebCore/crypto/mac/CryptoDigestAlgorithm.h >@@ -33,7 +33,7 @@ > > namespace WebCore { > >-static std::optional<PAL::CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction) >+static Optional<PAL::CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction) > { > switch (hashFunction) { > case CryptoAlgorithmIdentifier::SHA_1: >@@ -47,7 +47,7 @@ static std::optional<PAL::CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoA > case CryptoAlgorithmIdentifier::SHA_512: > return PAL::CryptoDigest::Algorithm::SHA_512; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/crypto/mac/CryptoKeyECMac.cpp b/Source/WebCore/crypto/mac/CryptoKeyECMac.cpp >index 2f3b8532012ab5bc5d4c0443836c18735da3f3af..3960b7424ba05f166b25e1185048242493dc1cb2 100644 >--- a/Source/WebCore/crypto/mac/CryptoKeyECMac.cpp >+++ b/Source/WebCore/crypto/mac/CryptoKeyECMac.cpp >@@ -111,13 +111,13 @@ bool CryptoKeyEC::platformSupportedCurve(NamedCurve curve) > return curve == NamedCurve::P256 || curve == NamedCurve::P384; > } > >-std::optional<CryptoKeyPair> CryptoKeyEC::platformGeneratePair(CryptoAlgorithmIdentifier identifier, NamedCurve curve, bool extractable, CryptoKeyUsageBitmap usages) >+Optional<CryptoKeyPair> CryptoKeyEC::platformGeneratePair(CryptoAlgorithmIdentifier identifier, NamedCurve curve, bool extractable, CryptoKeyUsageBitmap usages) > { > size_t size = getKeySizeFromNamedCurve(curve); > CCECCryptorRef ccPublicKey; > CCECCryptorRef ccPrivateKey; > if (CCECCryptorGeneratePair(size, &ccPublicKey, &ccPrivateKey)) >- return std::nullopt; >+ return WTF::nullopt; > > auto publicKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Public, ccPublicKey, true, usages); > auto privateKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Private, ccPrivateKey, extractable, usages); >diff --git a/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp b/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp >index e36fa76d2e83d2faf9595dffb7dd6a44b1b89544..3aa701d314723717485429ee4788bbbf9c3d0274 100644 >--- a/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp >+++ b/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp >@@ -342,7 +342,7 @@ void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgor > }); > } > >-RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifier, std::optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) >+RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifier, Optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) > { > // The current SecLibrary cannot import a SPKI format binary. Hence, we need to strip out the SPKI header. > // This hack can be removed when <rdar://problem/29523286> is resolved. >@@ -362,7 +362,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifi > if (CCRSACryptorImport(keyData.data() + headerSize, keyData.size() - headerSize, &ccPublicKey)) > return nullptr; > >- // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. >+ // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt. > return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, ccPublicKey, extractable, usages)); > } > >@@ -398,7 +398,7 @@ ExceptionOr<Vector<uint8_t>> CryptoKeyRSA::exportSpki() const > return WTFMove(result); > } > >-RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identifier, std::optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) >+RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identifier, Optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages) > { > // The current SecLibrary cannot import a PKCS8 format binary. Hence, we need to strip out the PKCS8 header. > // This hack can be removed when <rdar://problem/29523286> is resolved. >@@ -419,7 +419,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identif > if (CCRSACryptorImport(keyData.data() + headerSize, keyData.size() - headerSize, &ccPrivateKey)) > return nullptr; > >- // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. >+ // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt. > return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Private, ccPrivateKey, extractable, usages)); > } > >diff --git a/Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h b/Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h >index 67af03987fec69542f8d7c92cafb0a069a7c4116..86887b5afaa5c2d8104b498223d95ed64f3e669c 100644 >--- a/Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h >+++ b/Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h >@@ -37,8 +37,8 @@ class CryptoAlgorithmAesGcmParams final : public CryptoAlgorithmParameters { > public: > BufferSource iv; > // Use additionalDataVector() instead of additionalData. The label will be gone once additionalDataVector() is called. >- mutable std::optional<BufferSource::VariantType> additionalData; >- mutable std::optional<uint8_t> tagLength; >+ mutable Optional<BufferSource::VariantType> additionalData; >+ mutable Optional<uint8_t> tagLength; > > Class parametersClass() const final { return Class::AesGcmParams; } > >@@ -57,7 +57,7 @@ public: > return m_additionalDataVector; > > BufferSource additionalDataBuffer = WTFMove(*additionalData); >- additionalData = std::nullopt; >+ additionalData = WTF::nullopt; > if (!additionalDataBuffer.length()) > return m_additionalDataVector; > >diff --git a/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h b/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h >index 9d109c0f84b6cc8cdefcb36a05af3e672a78e1ad..e84e417a08366c140f2e349a3c3d97658c0ffbf6 100644 >--- a/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h >+++ b/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h >@@ -39,7 +39,7 @@ public: > // FIXME: Consider merging hash and hashIdentifier. > Variant<JSC::Strong<JSC::JSObject>, String> hash; > CryptoAlgorithmIdentifier hashIdentifier; >- std::optional<size_t> length; >+ Optional<size_t> length; > > Class parametersClass() const final { return Class::HmacKeyParams; } > >diff --git a/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h b/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h >index 769f3d9cb3aaa799672fc7554729583e63b4015f..0b332c426633483b47ecec8e5c551e50de1671b0 100644 >--- a/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h >+++ b/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h >@@ -36,7 +36,7 @@ namespace WebCore { > class CryptoAlgorithmRsaOaepParams final : public CryptoAlgorithmParameters { > public: > // Use labelVector() instead of label. The label will be gone once labelVector() is called. >- mutable std::optional<BufferSource::VariantType> label; >+ mutable Optional<BufferSource::VariantType> label; > > Class parametersClass() const final { return Class::RsaOaepParams; } > >@@ -46,7 +46,7 @@ public: > return m_labelVector; > > BufferSource labelBuffer = WTFMove(*label); >- label = std::nullopt; >+ label = WTF::nullopt; > if (!labelBuffer.length()) > return m_labelVector; > >diff --git a/Source/WebCore/css/CSSCalculationValue.cpp b/Source/WebCore/css/CSSCalculationValue.cpp >index 05872e2b22438be203a536f90bcbffeb304bc009..c80d545cd4ffd34e05956093abf214dff7b82a60 100644 >--- a/Source/WebCore/css/CSSCalculationValue.cpp >+++ b/Source/WebCore/css/CSSCalculationValue.cpp >@@ -418,7 +418,7 @@ public: > { > ASSERT(op == CalcOperator::Min || op == CalcOperator::Max); > >- std::optional<CalculationCategory> category = std::nullopt; >+ Optional<CalculationCategory> category = WTF::nullopt; > for (auto& value : values) { > auto valueCategory = resolvedTypeForMinOrMax(value->category(), destinationCategory); > >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 677841206fbe1e4e3789a0f802bdd1c1d334b8ea..7b26e3adac5fbd61322c626f69b43d282ef43561 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -2040,7 +2040,7 @@ Ref<CSSFontStyleValue> ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue > return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(CSSValueOblique), CSSValuePool::singleton().createValue(static_cast<float>(italic), CSSPrimitiveValue::CSS_DEG)); > } > >-Ref<CSSFontStyleValue> ComputedStyleExtractor::fontStyleFromStyleValue(std::optional<FontSelectionValue> italic, FontStyleAxis fontStyleAxis) >+Ref<CSSFontStyleValue> ComputedStyleExtractor::fontStyleFromStyleValue(Optional<FontSelectionValue> italic, FontStyleAxis fontStyleAxis) > { > if (auto keyword = fontStyleKeyword(italic, fontStyleAxis)) > return CSSFontStyleValue::create(CSSValuePool::singleton().createIdentifierValue(keyword.value())); >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.h b/Source/WebCore/css/CSSComputedStyleDeclaration.h >index bdf343272a6aa41b76e31d2a19ff711772367f73..93838798f2461af3e7fc2c79d9b93e8e369ed1dc 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.h >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.h >@@ -73,7 +73,7 @@ public: > static Ref<CSSPrimitiveValue> fontNonKeywordStretchFromStyleValue(FontSelectionValue); > static Ref<CSSPrimitiveValue> fontStretchFromStyleValue(FontSelectionValue); > static Ref<CSSFontStyleValue> fontNonKeywordStyleFromStyleValue(FontSelectionValue); >- static Ref<CSSFontStyleValue> fontStyleFromStyleValue(std::optional<FontSelectionValue>, FontStyleAxis); >+ static Ref<CSSFontStyleValue> fontStyleFromStyleValue(Optional<FontSelectionValue>, FontStyleAxis); > > private: > // The styled element is either the element passed into >diff --git a/Source/WebCore/css/CSSFontFaceSet.h b/Source/WebCore/css/CSSFontFaceSet.h >index 337feab4b158f36585dacfd9987ace3556f37b27..7d75f54637e7ac949db7e692813814ce38759184 100644 >--- a/Source/WebCore/css/CSSFontFaceSet.h >+++ b/Source/WebCore/css/CSSFontFaceSet.h >@@ -97,7 +97,7 @@ private: > > static String familyNameFromPrimitive(const CSSPrimitiveValue&); > >- using FontSelectionKey = std::optional<FontSelectionRequest>; >+ using FontSelectionKey = Optional<FontSelectionRequest>; > struct FontSelectionKeyHash { > static unsigned hash(const FontSelectionKey& key) { return computeHash(key); } > static bool equal(const FontSelectionKey& a, const FontSelectionKey& b) { return a == b; } >@@ -106,7 +106,7 @@ private: > struct FontSelectionKeyHashTraits : SimpleClassHashTraits<FontSelectionKey> { > static const bool emptyValueIsZero = false; > static FontSelectionKey emptyValue() { return FontSelectionRequest { }; } >- static void constructDeletedValue(FontSelectionKey& slot) { slot = std::nullopt; } >+ static void constructDeletedValue(FontSelectionKey& slot) { slot = WTF::nullopt; } > static bool isDeletedValue(const FontSelectionKey& value) { return !value; } > }; > using FontSelectionHashMap = HashMap<FontSelectionKey, RefPtr<CSSSegmentedFontFace>, FontSelectionKeyHash, FontSelectionKeyHashTraits>; >diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp >index 636d601924b9c7b7545970f1dd55cdc2cd7c8dc4..6ae62671983eb70f7139b9be5c176a091bfcd0a7 100644 >--- a/Source/WebCore/css/CSSPrimitiveValue.cpp >+++ b/Source/WebCore/css/CSSPrimitiveValue.cpp >@@ -822,10 +822,10 @@ CSSPrimitiveValue::UnitType CSSPrimitiveValue::canonicalUnitTypeForCategory(Unit > } > } > >-std::optional<double> CSSPrimitiveValue::doubleValueInternal(UnitType requestedUnitType) const >+Optional<double> CSSPrimitiveValue::doubleValueInternal(UnitType requestedUnitType) const > { > if (!isValidCSSUnitTypeForDoubleConversion(static_cast<UnitType>(m_primitiveUnitType)) || !isValidCSSUnitTypeForDoubleConversion(requestedUnitType)) >- return std::nullopt; >+ return WTF::nullopt; > > UnitType sourceUnitType = static_cast<UnitType>(primitiveType()); > if (requestedUnitType == sourceUnitType || requestedUnitType == CSS_DIMENSION) >@@ -840,20 +840,20 @@ std::optional<double> CSSPrimitiveValue::doubleValueInternal(UnitType requestedU > > // Cannot convert between unrelated unit categories if one of them is not UNumber. > if (sourceCategory != targetCategory && sourceCategory != UNumber && targetCategory != UNumber) >- return std::nullopt; >+ return WTF::nullopt; > > if (targetCategory == UNumber) { > // We interpret conversion to CSS_NUMBER as conversion to a canonical unit in this value's category. > targetUnitType = canonicalUnitTypeForCategory(sourceCategory); > if (targetUnitType == CSS_UNKNOWN) >- return std::nullopt; >+ return WTF::nullopt; > } > > if (sourceUnitType == CSS_NUMBER) { > // We interpret conversion from CSS_NUMBER in the same way as CSSParser::validUnit() while using non-strict mode. > sourceUnitType = canonicalUnitTypeForCategory(targetCategory); > if (sourceUnitType == CSS_UNKNOWN) >- return std::nullopt; >+ return WTF::nullopt; > } > > double convertedValue = doubleValue(); >diff --git a/Source/WebCore/css/CSSPrimitiveValue.h b/Source/WebCore/css/CSSPrimitiveValue.h >index 53088cca7f2a86084e15da5a0bc8f373a815d6af..5f423fd78a48927fb0a1089e1c73d2d3e3d169e1 100644 >--- a/Source/WebCore/css/CSSPrimitiveValue.h >+++ b/Source/WebCore/css/CSSPrimitiveValue.h >@@ -325,7 +325,7 @@ private: > void init(RefPtr<DashboardRegion>&&); // FIXME: Dashboard region should not be a primitive value. > #endif > >- std::optional<double> doubleValueInternal(UnitType targetUnitType) const; >+ Optional<double> doubleValueInternal(UnitType targetUnitType) const; > > double computeLengthDouble(const CSSToLengthConversionData&) const; > >diff --git a/Source/WebCore/css/CSSSegmentedFontFace.cpp b/Source/WebCore/css/CSSSegmentedFontFace.cpp >index dda20fd413d308cf3b06f957e0b691bad0175d7a..ae1ce5b6afd8faefd16f9b141d0392506e6e9364 100644 >--- a/Source/WebCore/css/CSSSegmentedFontFace.cpp >+++ b/Source/WebCore/css/CSSSegmentedFontFace.cpp >@@ -88,7 +88,7 @@ private: > return m_result && m_result.value() && m_result.value()->isInterstitial(); > } > >- mutable std::optional<RefPtr<Font>> m_result; // Caches nullptr too >+ mutable Optional<RefPtr<Font>> m_result; // Caches nullptr too > mutable Ref<CSSFontFace> m_fontFace; > FontDescription m_fontDescription; > bool m_syntheticBold; >diff --git a/Source/WebCore/css/CSSStyleDeclaration.cpp b/Source/WebCore/css/CSSStyleDeclaration.cpp >index a42659c037094f8ca5248cc7d68784853b4e9059..04d717ffde62a2e85d58235aa150e1ff1250c9d6 100644 >--- a/Source/WebCore/css/CSSStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSStyleDeclaration.cpp >@@ -255,11 +255,11 @@ CSSPropertyID CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName(co > return parseJavaScriptCSSPropertyName(propertyName).propertyID; > } > >-std::optional<Variant<String, double>> CSSStyleDeclaration::namedItem(const AtomicString& propertyName) >+Optional<Variant<String, double>> CSSStyleDeclaration::namedItem(const AtomicString& propertyName) > { > auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName); > if (!propertyInfo.propertyID) >- return std::nullopt; >+ return WTF::nullopt; > > auto value = getPropertyCSSValueInternal(propertyInfo.propertyID); > if (!value) { >diff --git a/Source/WebCore/css/CSSStyleDeclaration.h b/Source/WebCore/css/CSSStyleDeclaration.h >index b18c9ce327499acd052ae28f08357cdf74029f98..c6a78f5457e47a5efaf56395761d086fda4186dc 100644 >--- a/Source/WebCore/css/CSSStyleDeclaration.h >+++ b/Source/WebCore/css/CSSStyleDeclaration.h >@@ -75,7 +75,7 @@ public: > virtual CSSStyleSheet* parentStyleSheet() const { return nullptr; } > > // Bindings support. >- std::optional<Variant<String, double>> namedItem(const AtomicString&); >+ Optional<Variant<String, double>> namedItem(const AtomicString&); > ExceptionOr<void> setNamedItem(const AtomicString& name, String value, bool& propertySupported); > Vector<AtomicString> supportedPropertyNames() const; > >diff --git a/Source/WebCore/css/CSSStyleSheet.cpp b/Source/WebCore/css/CSSStyleSheet.cpp >index 1ecc5ba3708792fa637f16b12cd73e11efb04a62..12cda545d7bcc75dedb7a795351bd6f003674fc2 100644 >--- a/Source/WebCore/css/CSSStyleSheet.cpp >+++ b/Source/WebCore/css/CSSStyleSheet.cpp >@@ -74,7 +74,7 @@ Ref<CSSStyleSheet> CSSStyleSheet::create(Ref<StyleSheetContents>&& sheet, CSSImp > return adoptRef(*new CSSStyleSheet(WTFMove(sheet), ownerRule)); > } > >-Ref<CSSStyleSheet> CSSStyleSheet::create(Ref<StyleSheetContents>&& sheet, Node& ownerNode, const std::optional<bool>& isCleanOrigin) >+Ref<CSSStyleSheet> CSSStyleSheet::create(Ref<StyleSheetContents>&& sheet, Node& ownerNode, const Optional<bool>& isCleanOrigin) > { > return adoptRef(*new CSSStyleSheet(WTFMove(sheet), ownerNode, TextPosition(), false, isCleanOrigin)); > } >@@ -96,7 +96,7 @@ CSSStyleSheet::CSSStyleSheet(Ref<StyleSheetContents>&& contents, CSSImportRule* > m_contents->registerClient(this); > } > >-CSSStyleSheet::CSSStyleSheet(Ref<StyleSheetContents>&& contents, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const std::optional<bool>& isOriginClean) >+CSSStyleSheet::CSSStyleSheet(Ref<StyleSheetContents>&& contents, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const Optional<bool>& isOriginClean) > : m_contents(WTFMove(contents)) > , m_isInlineStylesheet(isInlineStylesheet) > , m_isDisabled(false) >@@ -307,7 +307,7 @@ ExceptionOr<void> CSSStyleSheet::deleteRule(unsigned index) > return { }; > } > >-ExceptionOr<int> CSSStyleSheet::addRule(const String& selector, const String& style, std::optional<unsigned> index) >+ExceptionOr<int> CSSStyleSheet::addRule(const String& selector, const String& style, Optional<unsigned> index) > { > StringBuilder text; > text.append(selector); >diff --git a/Source/WebCore/css/CSSStyleSheet.h b/Source/WebCore/css/CSSStyleSheet.h >index 5d37fa8d2e85488b38a51b7cd4758ec56a8c273c..23768e50fbc8c7cd041ab0263f93d1337767e38a 100644 >--- a/Source/WebCore/css/CSSStyleSheet.h >+++ b/Source/WebCore/css/CSSStyleSheet.h >@@ -49,7 +49,7 @@ class Scope; > class CSSStyleSheet final : public StyleSheet { > public: > static Ref<CSSStyleSheet> create(Ref<StyleSheetContents>&&, CSSImportRule* ownerRule = 0); >- static Ref<CSSStyleSheet> create(Ref<StyleSheetContents>&&, Node& ownerNode, const std::optional<bool>& isOriginClean = std::nullopt); >+ static Ref<CSSStyleSheet> create(Ref<StyleSheetContents>&&, Node& ownerNode, const Optional<bool>& isOriginClean = WTF::nullopt); > static Ref<CSSStyleSheet> createInline(Ref<StyleSheetContents>&&, Element& owner, const TextPosition& startPosition); > > virtual ~CSSStyleSheet(); >@@ -67,7 +67,7 @@ public: > WEBCORE_EXPORT ExceptionOr<void> deleteRule(unsigned index); > > WEBCORE_EXPORT RefPtr<CSSRuleList> rules(); >- WEBCORE_EXPORT ExceptionOr<int> addRule(const String& selector, const String& style, std::optional<unsigned> index); >+ WEBCORE_EXPORT ExceptionOr<int> addRule(const String& selector, const String& style, Optional<unsigned> index); > ExceptionOr<void> removeRule(unsigned index) { return deleteRule(index); } > > // For CSSRuleList. >@@ -130,7 +130,7 @@ public: > private: > CSSStyleSheet(Ref<StyleSheetContents>&&, CSSImportRule* ownerRule); > CSSStyleSheet(Ref<StyleSheetContents>&&, Node* ownerNode, const TextPosition& startPosition, bool isInlineStylesheet); >- CSSStyleSheet(Ref<StyleSheetContents>&&, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const std::optional<bool>&); >+ CSSStyleSheet(Ref<StyleSheetContents>&&, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const Optional<bool>&); > > bool isCSSStyleSheet() const final { return true; } > String type() const final { return "text/css"_s; } >@@ -139,7 +139,7 @@ private: > bool m_isInlineStylesheet; > bool m_isDisabled; > bool m_mutatedRules; >- std::optional<bool> m_isOriginClean; >+ Optional<bool> m_isOriginClean; > String m_title; > RefPtr<MediaQuerySet> m_mediaQueries; > >diff --git a/Source/WebCore/css/DOMMatrix.cpp b/Source/WebCore/css/DOMMatrix.cpp >index 756647523fbd696b228024ed3e4af22609dcd9d0..c354e978273ba56e2ffb547ff3918339cd0fccaf 100644 >--- a/Source/WebCore/css/DOMMatrix.cpp >+++ b/Source/WebCore/css/DOMMatrix.cpp >@@ -33,7 +33,7 @@ > namespace WebCore { > > // https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-dommatrixreadonly >-ExceptionOr<Ref<DOMMatrix>> DOMMatrix::create(ScriptExecutionContext& scriptExecutionContext, std::optional<Variant<String, Vector<double>>>&& init) >+ExceptionOr<Ref<DOMMatrix>> DOMMatrix::create(ScriptExecutionContext& scriptExecutionContext, Optional<Variant<String, Vector<double>>>&& init) > { > if (!init) > return adoptRef(*new DOMMatrix); >@@ -154,7 +154,7 @@ Ref<DOMMatrix> DOMMatrix::translateSelf(double tx, double ty, double tz) > } > > // https://drafts.fxtf.org/geometry/#dom-dommatrix-scaleself >-Ref<DOMMatrix> DOMMatrix::scaleSelf(double scaleX, std::optional<double> scaleY, double scaleZ, double originX, double originY, double originZ) >+Ref<DOMMatrix> DOMMatrix::scaleSelf(double scaleX, Optional<double> scaleY, double scaleZ, double originX, double originY, double originZ) > { > if (!scaleY) > scaleY = scaleX; >@@ -182,7 +182,7 @@ Ref<DOMMatrix> DOMMatrix::scale3dSelf(double scale, double originX, double origi > } > > // https://drafts.fxtf.org/geometry/#dom-dommatrix-rotateself >-Ref<DOMMatrix> DOMMatrix::rotateSelf(double rotX, std::optional<double> rotY, std::optional<double> rotZ) >+Ref<DOMMatrix> DOMMatrix::rotateSelf(double rotX, Optional<double> rotY, Optional<double> rotZ) > { > if (!rotY && !rotZ) { > rotZ = rotX; >diff --git a/Source/WebCore/css/DOMMatrix.h b/Source/WebCore/css/DOMMatrix.h >index ed2e11f408fc6bebeb3e21778e403934ca6f6cc5..292bc17dcacf74c4c4114b8021562692b6055f66 100644 >--- a/Source/WebCore/css/DOMMatrix.h >+++ b/Source/WebCore/css/DOMMatrix.h >@@ -33,7 +33,7 @@ class ScriptExecutionContext; > > class DOMMatrix : public DOMMatrixReadOnly { > public: >- static ExceptionOr<Ref<DOMMatrix>> create(ScriptExecutionContext&, std::optional<Variant<String, Vector<double>>>&&); >+ static ExceptionOr<Ref<DOMMatrix>> create(ScriptExecutionContext&, Optional<Variant<String, Vector<double>>>&&); > > static Ref<DOMMatrix> create(const TransformationMatrix& matrix, Is2D is2D) > { >@@ -53,9 +53,9 @@ public: > ExceptionOr<Ref<DOMMatrix>> multiplySelf(DOMMatrixInit&& other); > ExceptionOr<Ref<DOMMatrix>> preMultiplySelf(DOMMatrixInit&& other); > Ref<DOMMatrix> translateSelf(double tx = 0, double ty = 0, double tz = 0); >- Ref<DOMMatrix> scaleSelf(double scaleX = 1, std::optional<double> scaleY = std::nullopt, double scaleZ = 1, double originX = 0, double originY = 0, double originZ = 0); >+ Ref<DOMMatrix> scaleSelf(double scaleX = 1, Optional<double> scaleY = WTF::nullopt, double scaleZ = 1, double originX = 0, double originY = 0, double originZ = 0); > Ref<DOMMatrix> scale3dSelf(double scale = 1, double originX = 0, double originY = 0, double originZ = 0); >- Ref<DOMMatrix> rotateSelf(double rotX = 0, std::optional<double> rotY = std::nullopt, std::optional<double> rotZ = std::nullopt); // Angles are in degrees. >+ Ref<DOMMatrix> rotateSelf(double rotX = 0, Optional<double> rotY = WTF::nullopt, Optional<double> rotZ = WTF::nullopt); // Angles are in degrees. > Ref<DOMMatrix> rotateFromVectorSelf(double x = 0, double y = 0); > Ref<DOMMatrix> rotateAxisAngleSelf(double x = 0, double y = 0, double z = 0, double angle = 0); // Angle is in degrees. > Ref<DOMMatrix> skewXSelf(double sx = 0); // Angle is in degrees. >diff --git a/Source/WebCore/css/DOMMatrix2DInit.h b/Source/WebCore/css/DOMMatrix2DInit.h >index f39d2795851dbe617956d8f4eb529826a9f1e451..c871c48ff94c8c4c0253faad68ebecc29f18a9dd 100644 >--- a/Source/WebCore/css/DOMMatrix2DInit.h >+++ b/Source/WebCore/css/DOMMatrix2DInit.h >@@ -30,18 +30,18 @@ > namespace WebCore { > > struct DOMMatrix2DInit { >- std::optional<double> a; >- std::optional<double> b; >- std::optional<double> c; >- std::optional<double> d; >- std::optional<double> e; >- std::optional<double> f; >- std::optional<double> m11; >- std::optional<double> m12; >- std::optional<double> m21; >- std::optional<double> m22; >- std::optional<double> m41; >- std::optional<double> m42; >+ Optional<double> a; >+ Optional<double> b; >+ Optional<double> c; >+ Optional<double> d; >+ Optional<double> e; >+ Optional<double> f; >+ Optional<double> m11; >+ Optional<double> m12; >+ Optional<double> m21; >+ Optional<double> m22; >+ Optional<double> m41; >+ Optional<double> m42; > }; > > } >diff --git a/Source/WebCore/css/DOMMatrixInit.h b/Source/WebCore/css/DOMMatrixInit.h >index 168db3d3bb73a1857343797e7610e5c69e9577bd..f5b5934c039c6be53a496470b0e1718bf124f3e8 100644 >--- a/Source/WebCore/css/DOMMatrixInit.h >+++ b/Source/WebCore/css/DOMMatrixInit.h >@@ -40,7 +40,7 @@ struct DOMMatrixInit : DOMMatrix2DInit { > double m34 { 0 }; > double m43 { 0 }; > double m44 { 1 }; >- std::optional<bool> is2D; >+ Optional<bool> is2D; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/css/DOMMatrixReadOnly.cpp b/Source/WebCore/css/DOMMatrixReadOnly.cpp >index 731754e466f3736e9cc47d730475257f7ea5bfe5..cc7f72698513ee8380398827d919b48f75313395 100644 >--- a/Source/WebCore/css/DOMMatrixReadOnly.cpp >+++ b/Source/WebCore/css/DOMMatrixReadOnly.cpp >@@ -41,7 +41,7 @@ > namespace WebCore { > > // https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-dommatrixreadonly >-ExceptionOr<Ref<DOMMatrixReadOnly>> DOMMatrixReadOnly::create(ScriptExecutionContext& scriptExecutionContext, std::optional<Variant<String, Vector<double>>>&& init) >+ExceptionOr<Ref<DOMMatrixReadOnly>> DOMMatrixReadOnly::create(ScriptExecutionContext& scriptExecutionContext, Optional<Variant<String, Vector<double>>>&& init) > { > if (!init) > return adoptRef(*new DOMMatrixReadOnly); >@@ -288,7 +288,7 @@ ExceptionOr<Ref<DOMMatrix>> DOMMatrixReadOnly::multiply(DOMMatrixInit&& other) c > return matrix->multiplySelf(WTFMove(other)); > } > >-Ref<DOMMatrix> DOMMatrixReadOnly::scale(double scaleX, std::optional<double> scaleY, double scaleZ, double originX, double originY, double originZ) >+Ref<DOMMatrix> DOMMatrixReadOnly::scale(double scaleX, Optional<double> scaleY, double scaleZ, double originX, double originY, double originZ) > { > auto matrix = cloneAsDOMMatrix(); > return matrix->scaleSelf(scaleX, scaleY, scaleZ, originX, originY, originZ); >@@ -300,7 +300,7 @@ Ref<DOMMatrix> DOMMatrixReadOnly::scale3d(double scale, double originX, double o > return matrix->scale3dSelf(scale, originX, originY, originZ); > } > >-Ref<DOMMatrix> DOMMatrixReadOnly::rotate(double rotX, std::optional<double> rotY, std::optional<double> rotZ) >+Ref<DOMMatrix> DOMMatrixReadOnly::rotate(double rotX, Optional<double> rotY, Optional<double> rotZ) > { > auto matrix = cloneAsDOMMatrix(); > return matrix->rotateSelf(rotX, rotY, rotZ); >diff --git a/Source/WebCore/css/DOMMatrixReadOnly.h b/Source/WebCore/css/DOMMatrixReadOnly.h >index 2e93eac4138b8c9edf51f56140b1323f2aec4c12..8a2c779df3a44282e2e7a9e5597f3acf27db7d62 100644 >--- a/Source/WebCore/css/DOMMatrixReadOnly.h >+++ b/Source/WebCore/css/DOMMatrixReadOnly.h >@@ -46,7 +46,7 @@ struct DOMPointInit; > class DOMMatrixReadOnly : public ScriptWrappable, public RefCounted<DOMMatrixReadOnly> { > WTF_MAKE_FAST_ALLOCATED; > public: >- static ExceptionOr<Ref<DOMMatrixReadOnly>> create(ScriptExecutionContext&, std::optional<Variant<String, Vector<double>>>&&); >+ static ExceptionOr<Ref<DOMMatrixReadOnly>> create(ScriptExecutionContext&, Optional<Variant<String, Vector<double>>>&&); > > enum class Is2D { No, Yes }; > static Ref<DOMMatrixReadOnly> create(const TransformationMatrix& matrix, Is2D is2D) >@@ -101,9 +101,9 @@ public: > ExceptionOr<Ref<DOMMatrix>> multiply(DOMMatrixInit&& other) const; > Ref<DOMMatrix> flipX(); > Ref<DOMMatrix> flipY(); >- Ref<DOMMatrix> scale(double scaleX = 1, std::optional<double> scaleY = std::nullopt, double scaleZ = 1, double originX = 0, double originY = 0, double originZ = 0); >+ Ref<DOMMatrix> scale(double scaleX = 1, Optional<double> scaleY = WTF::nullopt, double scaleZ = 1, double originX = 0, double originY = 0, double originZ = 0); > Ref<DOMMatrix> scale3d(double scale = 1, double originX = 0, double originY = 0, double originZ = 0); >- Ref<DOMMatrix> rotate(double rotX = 0, std::optional<double> rotY = std::nullopt, std::optional<double> rotZ = std::nullopt); // Angles are in degrees. >+ Ref<DOMMatrix> rotate(double rotX = 0, Optional<double> rotY = WTF::nullopt, Optional<double> rotZ = WTF::nullopt); // Angles are in degrees. > Ref<DOMMatrix> rotateFromVector(double x = 0, double y = 0); > Ref<DOMMatrix> rotateAxisAngle(double x = 0, double y = 0, double z = 0, double angle = 0); // Angle is in degrees. > Ref<DOMMatrix> skewX(double sx = 0); // Angle is in degrees. >diff --git a/Source/WebCore/css/DocumentRuleSets.cpp b/Source/WebCore/css/DocumentRuleSets.cpp >index fbd8aad9ef05e730549c4cac19b598976df790f1..a2ef908386be703a6fafe926c30a77f14bafd945 100644 >--- a/Source/WebCore/css/DocumentRuleSets.cpp >+++ b/Source/WebCore/css/DocumentRuleSets.cpp >@@ -169,7 +169,7 @@ void DocumentRuleSets::collectFeatures() const > > m_classInvalidationRuleSets.clear(); > m_attributeInvalidationRuleSets.clear(); >- m_cachedHasComplexSelectorsForStyleAttribute = std::nullopt; >+ m_cachedHasComplexSelectorsForStyleAttribute = WTF::nullopt; > > m_features.shrinkToFit(); > } >diff --git a/Source/WebCore/css/DocumentRuleSets.h b/Source/WebCore/css/DocumentRuleSets.h >index 9414b8cbd48090a37fc903917eb544f9679c3e28..1bf0649482c157bd0f76733c3db87413c2c9d4e4 100644 >--- a/Source/WebCore/css/DocumentRuleSets.h >+++ b/Source/WebCore/css/DocumentRuleSets.h >@@ -92,7 +92,7 @@ private: > mutable HashMap<AtomicString, std::unique_ptr<Vector<InvalidationRuleSet>>> m_classInvalidationRuleSets; > mutable HashMap<AtomicString, std::unique_ptr<Vector<InvalidationRuleSet>>> m_attributeInvalidationRuleSets; > >- mutable std::optional<bool> m_cachedHasComplexSelectorsForStyleAttribute; >+ mutable Optional<bool> m_cachedHasComplexSelectorsForStyleAttribute; > > mutable unsigned m_defaultStyleVersionOnFeatureCollection { 0 }; > mutable unsigned m_userAgentMediaQueryRuleCountOnUpdate { 0 }; >diff --git a/Source/WebCore/css/FontSelectionValueInlines.h b/Source/WebCore/css/FontSelectionValueInlines.h >index fd87c900b3655fafe719efd0cadc403c4d725c84..c81f000f8db2ab12abd92059ae3385fb7f0ed8e4 100644 >--- a/Source/WebCore/css/FontSelectionValueInlines.h >+++ b/Source/WebCore/css/FontSelectionValueInlines.h >@@ -48,16 +48,16 @@ inline bool isCSS21Weight(int weight) > return !((weight % 100) || weight < 100 || weight > 900); > } > >-inline std::optional<CSSValueID> fontWeightKeyword(FontSelectionValue weight) >+inline Optional<CSSValueID> fontWeightKeyword(FontSelectionValue weight) > { > if (weight == normalWeightValue()) > return CSSValueNormal; > if (weight == boldWeightValue()) > return CSSValueBold; >- return std::nullopt; >+ return WTF::nullopt; > } > >-inline std::optional<FontSelectionValue> fontWeightValue(CSSValueID value) >+inline Optional<FontSelectionValue> fontWeightValue(CSSValueID value) > { > switch (value) { > case CSSValueNormal: >@@ -68,11 +68,11 @@ inline std::optional<FontSelectionValue> fontWeightValue(CSSValueID value) > case CSSValueLighter: > return lightWeightValue(); > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-inline std::optional<CSSValueID> fontStretchKeyword(FontSelectionValue stretch) >+inline Optional<CSSValueID> fontStretchKeyword(FontSelectionValue stretch) > { > if (stretch == ultraCondensedStretchValue()) > return CSSValueUltraCondensed; >@@ -92,10 +92,10 @@ inline std::optional<CSSValueID> fontStretchKeyword(FontSelectionValue stretch) > return CSSValueExtraExpanded; > if (stretch == ultraExpandedStretchValue()) > return CSSValueUltraExpanded; >- return std::nullopt; >+ return WTF::nullopt; > } > >-inline std::optional<FontSelectionValue> fontStretchValue(CSSValueID value) >+inline Optional<FontSelectionValue> fontStretchValue(CSSValueID value) > { > switch (value) { > case CSSValueUltraCondensed: >@@ -117,17 +117,17 @@ inline std::optional<FontSelectionValue> fontStretchValue(CSSValueID value) > case CSSValueUltraExpanded: > return ultraExpandedStretchValue(); > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-inline std::optional<CSSValueID> fontStyleKeyword(std::optional<FontSelectionValue> style, FontStyleAxis axis) >+inline Optional<CSSValueID> fontStyleKeyword(Optional<FontSelectionValue> style, FontStyleAxis axis) > { > if (!style || style.value() == normalItalicValue()) > return CSSValueNormal; > if (style.value() == italicValue()) > return axis == FontStyleAxis::ital ? CSSValueItalic : CSSValueOblique; >- return std::nullopt; >+ return WTF::nullopt; > } > > } >diff --git a/Source/WebCore/css/MediaQueryEvaluator.cpp b/Source/WebCore/css/MediaQueryEvaluator.cpp >index e959ae60cfa6744a78ab80a3c3b636b00e9f8884..18dfe84f20e0f7de1304491c648f584d538a1db4 100644 >--- a/Source/WebCore/css/MediaQueryEvaluator.cpp >+++ b/Source/WebCore/css/MediaQueryEvaluator.cpp >@@ -255,10 +255,10 @@ static bool compareAspectRatioValue(CSSValue* value, int width, int height, Medi > return compareValue(width * aspectRatio.denominatorValue(), height * aspectRatio.numeratorValue(), op); > } > >-static std::optional<double> doubleValue(CSSValue* value) >+static Optional<double> doubleValue(CSSValue* value) > { > if (!is<CSSPrimitiveValue>(value) || !downcast<CSSPrimitiveValue>(*value).isNumber()) >- return std::nullopt; >+ return WTF::nullopt; > return downcast<CSSPrimitiveValue>(*value).doubleValue(CSSPrimitiveValue::CSS_NUMBER); > } > >@@ -798,7 +798,7 @@ static bool displayModeEvaluate(CSSValue* value, const CSSToLengthConversionData > > auto keyword = downcast<CSSPrimitiveValue>(*value).valueID(); > >- auto manifest = frame.page() ? frame.page()->applicationManifest() : std::nullopt; >+ auto manifest = frame.page() ? frame.page()->applicationManifest() : WTF::nullopt; > if (!manifest) > return keyword == CSSValueBrowser; > >diff --git a/Source/WebCore/css/RuleFeature.h b/Source/WebCore/css/RuleFeature.h >index b77a7d930209ae2de165ec32f450c663ea3368a6..f8c94035c315f48fcaaf3204afde39d8b525f48b 100644 >--- a/Source/WebCore/css/RuleFeature.h >+++ b/Source/WebCore/css/RuleFeature.h >@@ -37,7 +37,7 @@ enum class MatchElement { Subject, Parent, Ancestor, DirectSibling, IndirectSibl > constexpr unsigned matchElementCount = static_cast<unsigned>(MatchElement::Host) + 1; > > struct RuleFeature { >- RuleFeature(StyleRule* rule, unsigned selectorIndex, unsigned selectorListIndex, std::optional<MatchElement> matchElement = std::nullopt, const CSSSelector* invalidationSelector = nullptr) >+ RuleFeature(StyleRule* rule, unsigned selectorIndex, unsigned selectorListIndex, Optional<MatchElement> matchElement = WTF::nullopt, const CSSSelector* invalidationSelector = nullptr) > : rule(rule) > , selectorIndex(selectorIndex) > , selectorListIndex(selectorListIndex) >@@ -48,7 +48,7 @@ struct RuleFeature { > StyleRule* rule; > unsigned selectorIndex; > unsigned selectorListIndex; >- std::optional<MatchElement> matchElement; >+ Optional<MatchElement> matchElement; > const CSSSelector* invalidationSelector; > }; > >diff --git a/Source/WebCore/css/StyleBuilderConverter.h b/Source/WebCore/css/StyleBuilderConverter.h >index e61d1f5472d49950e5ee353fa601594af46cf0d0..da000d3af01b55bb7db83fad82150251ebcde829 100644 >--- a/Source/WebCore/css/StyleBuilderConverter.h >+++ b/Source/WebCore/css/StyleBuilderConverter.h >@@ -105,12 +105,12 @@ public: > #endif > static GridTrackSize convertGridTrackSize(StyleResolver&, const CSSValue&); > static Vector<GridTrackSize> convertGridTrackSizeList(StyleResolver&, const CSSValue&); >- static std::optional<GridPosition> convertGridPosition(StyleResolver&, const CSSValue&); >+ static Optional<GridPosition> convertGridPosition(StyleResolver&, const CSSValue&); > static GridAutoFlow convertGridAutoFlow(StyleResolver&, const CSSValue&); >- static std::optional<Length> convertWordSpacing(StyleResolver&, const CSSValue&); >- static std::optional<float> convertPerspective(StyleResolver&, const CSSValue&); >- static std::optional<Length> convertMarqueeIncrement(StyleResolver&, const CSSValue&); >- static std::optional<FilterOperations> convertFilterOperations(StyleResolver&, const CSSValue&); >+ static Optional<Length> convertWordSpacing(StyleResolver&, const CSSValue&); >+ static Optional<float> convertPerspective(StyleResolver&, const CSSValue&); >+ static Optional<Length> convertMarqueeIncrement(StyleResolver&, const CSSValue&); >+ static Optional<FilterOperations> convertFilterOperations(StyleResolver&, const CSSValue&); > #if PLATFORM(IOS_FAMILY) > static bool convertTouchCallout(StyleResolver&, const CSSValue&); > #endif >@@ -123,7 +123,7 @@ public: > static FontFeatureSettings convertFontFeatureSettings(StyleResolver&, const CSSValue&); > static FontSelectionValue convertFontWeightFromValue(const CSSValue&); > static FontSelectionValue convertFontStretchFromValue(const CSSValue&); >- static std::optional<FontSelectionValue> convertFontStyleFromValue(const CSSValue&); >+ static Optional<FontSelectionValue> convertFontStyleFromValue(const CSSValue&); > static FontSelectionValue convertFontWeight(StyleResolver&, const CSSValue&); > static FontSelectionValue convertFontStretch(StyleResolver&, const CSSValue&); > static FontSelectionValue convertFontStyle(StyleResolver&, const CSSValue&); >@@ -141,7 +141,7 @@ public: > static StyleContentAlignmentData convertContentAlignmentData(StyleResolver&, const CSSValue&); > static GlyphOrientation convertGlyphOrientation(StyleResolver&, const CSSValue&); > static GlyphOrientation convertGlyphOrientationOrAuto(StyleResolver&, const CSSValue&); >- static std::optional<Length> convertLineHeight(StyleResolver&, const CSSValue&, float multiplier = 1.f); >+ static Optional<Length> convertLineHeight(StyleResolver&, const CSSValue&, float multiplier = 1.f); > static FontSynthesis convertFontSynthesis(StyleResolver&, const CSSValue&); > > static BreakBetween convertPageBreakBetween(StyleResolver&, const CSSValue&); >@@ -1105,12 +1105,12 @@ inline GridTrackSize StyleBuilderConverter::convertGridTrackSize(StyleResolver& > return createGridTrackSize(value, styleResolver); > } > >-inline std::optional<GridPosition> StyleBuilderConverter::convertGridPosition(StyleResolver&, const CSSValue& value) >+inline Optional<GridPosition> StyleBuilderConverter::convertGridPosition(StyleResolver&, const CSSValue& value) > { > GridPosition gridPosition; > if (createGridPosition(value, gridPosition)) > return gridPosition; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline GridAutoFlow StyleBuilderConverter::convertGridAutoFlow(StyleResolver&, const CSSValue& value) >@@ -1160,9 +1160,9 @@ inline CSSToLengthConversionData StyleBuilderConverter::csstoLengthConversionDat > return styleResolver.state().cssToLengthConversionData(); > } > >-inline std::optional<Length> StyleBuilderConverter::convertWordSpacing(StyleResolver& styleResolver, const CSSValue& value) >+inline Optional<Length> StyleBuilderConverter::convertWordSpacing(StyleResolver& styleResolver, const CSSValue& value) > { >- std::optional<Length> wordSpacing; >+ Optional<Length> wordSpacing; > auto& primitiveValue = downcast<CSSPrimitiveValue>(value); > if (primitiveValue.valueID() == CSSValueNormal) > wordSpacing = RenderStyle::initialWordSpacing(); >@@ -1176,7 +1176,7 @@ inline std::optional<Length> StyleBuilderConverter::convertWordSpacing(StyleReso > return wordSpacing; > } > >-inline std::optional<float> StyleBuilderConverter::convertPerspective(StyleResolver& styleResolver, const CSSValue& value) >+inline Optional<float> StyleBuilderConverter::convertPerspective(StyleResolver& styleResolver, const CSSValue& value) > { > auto& primitiveValue = downcast<CSSPrimitiveValue>(value); > if (primitiveValue.valueID() == CSSValueNone) >@@ -1190,12 +1190,12 @@ inline std::optional<float> StyleBuilderConverter::convertPerspective(StyleResol > else > ASSERT_NOT_REACHED(); > >- return perspective < 0 ? std::optional<float>(std::nullopt) : std::optional<float>(perspective); >+ return perspective < 0 ? Optional<float>(WTF::nullopt) : Optional<float>(perspective); > } > >-inline std::optional<Length> StyleBuilderConverter::convertMarqueeIncrement(StyleResolver& styleResolver, const CSSValue& value) >+inline Optional<Length> StyleBuilderConverter::convertMarqueeIncrement(StyleResolver& styleResolver, const CSSValue& value) > { >- std::optional<Length> marqueeLength; >+ Optional<Length> marqueeLength; > auto& primitiveValue = downcast<CSSPrimitiveValue>(value); > switch (primitiveValue.valueID()) { > case CSSValueSmall: >@@ -1219,12 +1219,12 @@ inline std::optional<Length> StyleBuilderConverter::convertMarqueeIncrement(Styl > return marqueeLength; > } > >-inline std::optional<FilterOperations> StyleBuilderConverter::convertFilterOperations(StyleResolver& styleResolver, const CSSValue& value) >+inline Optional<FilterOperations> StyleBuilderConverter::convertFilterOperations(StyleResolver& styleResolver, const CSSValue& value) > { > FilterOperations operations; > if (styleResolver.createFilterOperations(value, operations)) > return operations; >- return std::nullopt; >+ return WTF::nullopt; > } > > inline FontFeatureSettings StyleBuilderConverter::convertFontFeatureSettings(StyleResolver&, const CSSValue& value) >@@ -1280,15 +1280,15 @@ inline FontSelectionValue StyleBuilderConverter::convertFontStretchFromValue(con > return normalStretchValue(); > } > >-// The input value needs to parsed and valid, this function returns std::nullopt if the input was "normal". >-inline std::optional<FontSelectionValue> StyleBuilderConverter::convertFontStyleFromValue(const CSSValue& value) >+// The input value needs to parsed and valid, this function returns WTF::nullopt if the input was "normal". >+inline Optional<FontSelectionValue> StyleBuilderConverter::convertFontStyleFromValue(const CSSValue& value) > { > ASSERT(is<CSSFontStyleValue>(value)); > const auto& fontStyleValue = downcast<CSSFontStyleValue>(value); > > auto valueID = fontStyleValue.fontStyleValue->valueID(); > if (valueID == CSSValueNormal) >- return std::nullopt; >+ return WTF::nullopt; > if (valueID == CSSValueItalic) > return italicValue(); > ASSERT(valueID == CSSValueOblique); >@@ -1481,7 +1481,7 @@ inline GlyphOrientation StyleBuilderConverter::convertGlyphOrientationOrAuto(Sty > return convertGlyphOrientation(styleResolver, value); > } > >-inline std::optional<Length> StyleBuilderConverter::convertLineHeight(StyleResolver& styleResolver, const CSSValue& value, float multiplier) >+inline Optional<Length> StyleBuilderConverter::convertLineHeight(StyleResolver& styleResolver, const CSSValue& value, float multiplier) > { > auto& primitiveValue = downcast<CSSPrimitiveValue>(value); > if (primitiveValue.valueID() == CSSValueNormal) >@@ -1509,7 +1509,7 @@ inline std::optional<Length> StyleBuilderConverter::convertLineHeight(StyleResol > > // FIXME: The parser should only emit the above types, so this should never be reached. We should change the > // type of this function to return just a Length (and not an Optional). >- return std::nullopt; >+ return WTF::nullopt; > } > > inline FontSynthesis StyleBuilderConverter::convertFontSynthesis(StyleResolver&, const CSSValue& value) >diff --git a/Source/WebCore/css/StyleBuilderCustom.h b/Source/WebCore/css/StyleBuilderCustom.h >index 4370218f955e047f37465840809d81ff259b2ce0..c7852f029d838409ab4e53ac03d1029a48e94834 100644 >--- a/Source/WebCore/css/StyleBuilderCustom.h >+++ b/Source/WebCore/css/StyleBuilderCustom.h >@@ -708,7 +708,7 @@ static inline float computeLineHeightMultiplierDueToFontSize(const Document& doc > > inline void StyleBuilderCustom::applyValueLineHeight(StyleResolver& styleResolver, CSSValue& value) > { >- std::optional<Length> lineHeight = StyleBuilderConverter::convertLineHeight(styleResolver, value, 1); >+ Optional<Length> lineHeight = StyleBuilderConverter::convertLineHeight(styleResolver, value, 1); > if (!lineHeight) > return; > >@@ -1177,9 +1177,9 @@ inline void StyleBuilderCustom::applyValueCounter(StyleResolver& styleResolver, > CounterDirectiveMap& map = styleResolver.style()->accessCounterDirectives(); > for (auto& keyValue : map) { > if (counterBehavior == Reset) >- keyValue.value.resetValue = std::nullopt; >+ keyValue.value.resetValue = WTF::nullopt; > else >- keyValue.value.incrementValue = std::nullopt; >+ keyValue.value.incrementValue = WTF::nullopt; > } > > if (setCounterIncrementToNone) >diff --git a/Source/WebCore/css/StyleProperties.cpp b/Source/WebCore/css/StyleProperties.cpp >index 5acb48f911a37178fae8a80e1783e69b7588cb58..7bddbdc353563ab7482ad6a7de415a651b11b881 100644 >--- a/Source/WebCore/css/StyleProperties.cpp >+++ b/Source/WebCore/css/StyleProperties.cpp >@@ -248,11 +248,11 @@ String StyleProperties::getPropertyValue(CSSPropertyID propertyID) const > } > } > >-std::optional<Color> StyleProperties::propertyAsColor(CSSPropertyID property) const >+Optional<Color> StyleProperties::propertyAsColor(CSSPropertyID property) const > { > auto colorValue = getPropertyCSSValue(property); > if (!is<CSSPrimitiveValue>(colorValue)) >- return std::nullopt; >+ return WTF::nullopt; > > auto& primitiveColor = downcast<CSSPrimitiveValue>(*colorValue); > return primitiveColor.isRGBColor() ? primitiveColor.color() : CSSParser::parseColor(colorValue->cssText()); >diff --git a/Source/WebCore/css/StyleProperties.h b/Source/WebCore/css/StyleProperties.h >index 50f72e9bac64a68186ff53fbf61f3bb9b331c238..4c48a891da0681f863561d1a142bc3e6f4c6baab 100644 >--- a/Source/WebCore/css/StyleProperties.h >+++ b/Source/WebCore/css/StyleProperties.h >@@ -113,7 +113,7 @@ public: > WEBCORE_EXPORT RefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; > WEBCORE_EXPORT String getPropertyValue(CSSPropertyID) const; > >- WEBCORE_EXPORT std::optional<Color> propertyAsColor(CSSPropertyID) const; >+ WEBCORE_EXPORT Optional<Color> propertyAsColor(CSSPropertyID) const; > WEBCORE_EXPORT CSSValueID propertyAsValueID(CSSPropertyID) const; > > bool propertyIsImportant(CSSPropertyID) const; >diff --git a/Source/WebCore/css/StyleRuleImport.cpp b/Source/WebCore/css/StyleRuleImport.cpp >index 20354cc1785659718e57a4975f7efa6d45949780..3f312a41779dfaa3774ec1671397b74d34033204 100644 >--- a/Source/WebCore/css/StyleRuleImport.cpp >+++ b/Source/WebCore/css/StyleRuleImport.cpp >@@ -118,7 +118,7 @@ void StyleRuleImport::requestStyleSheet() > > // FIXME: Skip Content Security Policy check when stylesheet is in a user agent shadow tree. > // See <https://bugs.webkit.org/show_bug.cgi?id=146663>. >- CachedResourceRequest request(absURL, CachedResourceLoader::defaultCachedResourceOptions(), std::nullopt, String(m_parentStyleSheet->charset())); >+ CachedResourceRequest request(absURL, CachedResourceLoader::defaultCachedResourceOptions(), WTF::nullopt, String(m_parentStyleSheet->charset())); > request.setInitiator(cachedResourceRequestInitiators().css); > if (m_cachedSheet) > m_cachedSheet->removeClient(m_styleSheetClient); >diff --git a/Source/WebCore/css/parser/MediaQueryParser.cpp b/Source/WebCore/css/parser/MediaQueryParser.cpp >index a71de6d3a19bec1c58b0057113397f9c9a99d2b3..8c3562ecf57f59b08f263af9894edaa896e3ee82 100644 >--- a/Source/WebCore/css/parser/MediaQueryParser.cpp >+++ b/Source/WebCore/css/parser/MediaQueryParser.cpp >@@ -285,7 +285,7 @@ MediaQueryParser::MediaQueryData::MediaQueryData(MediaQueryParserContext context > void MediaQueryParser::MediaQueryData::clear() > { > m_restrictor = MediaQuery::None; >- m_mediaType = std::nullopt; >+ m_mediaType = WTF::nullopt; > m_mediaFeature = String(); > m_expressions.clear(); > } >diff --git a/Source/WebCore/css/parser/MediaQueryParser.h b/Source/WebCore/css/parser/MediaQueryParser.h >index 90f0439b72f641415aff8e00f3586ca1e9182c88..fb67277436f0ea5f4908a4371e3e194889436c1f 100644 >--- a/Source/WebCore/css/parser/MediaQueryParser.h >+++ b/Source/WebCore/css/parser/MediaQueryParser.h >@@ -95,7 +95,7 @@ private: > > MediaQuery::Restrictor restrictor() const { return m_restrictor; } > Vector<MediaQueryExpression>& expressions() { return m_expressions; } >- const std::optional<String>& mediaType() const { return m_mediaType; } >+ const Optional<String>& mediaType() const { return m_mediaType; } > > bool currentMediaQueryChanged() const > { >@@ -111,7 +111,7 @@ private: > > private: > MediaQuery::Restrictor m_restrictor { MediaQuery::None }; >- std::optional<String> m_mediaType; >+ Optional<String> m_mediaType; > Vector<MediaQueryExpression> m_expressions; > String m_mediaFeature; > MediaQueryParserContext m_context; >diff --git a/Source/WebCore/cssjit/SelectorCompiler.cpp b/Source/WebCore/cssjit/SelectorCompiler.cpp >index efbcc0dcd45db55994c80441c12aab7f9658a3a6..2a43fd8200baf38a127545bdae1b1a32294c626a 100644 >--- a/Source/WebCore/cssjit/SelectorCompiler.cpp >+++ b/Source/WebCore/cssjit/SelectorCompiler.cpp >@@ -329,8 +329,8 @@ private: > void generateElementHasFocusWithin(Assembler::JumpList& failureCases); > > // Helpers. >- void generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type, std::optional<Assembler::RegisterID> value = { }); >- void generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type, std::optional<Assembler::RegisterID> value = { }); >+ void generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type, Optional<Assembler::RegisterID> value = { }); >+ void generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type, Optional<Assembler::RegisterID> value = { }); > Assembler::Jump branchOnResolvingModeWithCheckingContext(Assembler::RelationalCondition, SelectorChecker::Mode, Assembler::RegisterID checkingContext); > Assembler::Jump branchOnResolvingMode(Assembler::RelationalCondition, SelectorChecker::Mode, Assembler::RegisterID checkingContext); > void generateElementIsFirstLink(Assembler::JumpList& failureCases, Assembler::RegisterID element); >@@ -2205,7 +2205,7 @@ void SelectorCodeGenerator::generateIndirectAdjacentTreeWalker(Assembler::JumpLi > localFailureCases.linkTo(loopStart, &m_assembler); > } > >-void SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type relationType, std::optional<Assembler::RegisterID> value) >+void SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type relationType, Optional<Assembler::RegisterID> value) > { > if (m_selectorContext == SelectorContext::QuerySelector) > return; >@@ -2223,7 +2223,7 @@ static void addStyleRelationFunction(SelectorChecker::CheckingContext* checkingC > checkingContext->styleRelations.append({ *element, Style::Relation::AffectedByActive, 1 }); > } > >-void SelectorCodeGenerator::generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type relationType, std::optional<Assembler::RegisterID> value) >+void SelectorCodeGenerator::generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type relationType, Optional<Assembler::RegisterID> value) > { > ASSERT(m_selectorContext != SelectorContext::QuerySelector); > >diff --git a/Source/WebCore/dom/ConstantPropertyMap.h b/Source/WebCore/dom/ConstantPropertyMap.h >index 9a9cd229b23107bb0575c3b3c81e88bdd79661ea..befc896fff57dcb6ea0f90a973ffe0f151d168c5 100644 >--- a/Source/WebCore/dom/ConstantPropertyMap.h >+++ b/Source/WebCore/dom/ConstantPropertyMap.h >@@ -70,7 +70,7 @@ private: > void updateConstantsForSafeAreaInsets(); > void updateConstantsForFullscreen(); > >- std::optional<Values> m_values; >+ Optional<Values> m_values; > > Document& m_document; > }; >diff --git a/Source/WebCore/dom/CustomElementReactionQueue.cpp b/Source/WebCore/dom/CustomElementReactionQueue.cpp >index e0d13d82c9b88a55ff36c40f0c7d315de6182cc3..bd49e873474d513019d2247a8a61ce34fe343104 100644 >--- a/Source/WebCore/dom/CustomElementReactionQueue.cpp >+++ b/Source/WebCore/dom/CustomElementReactionQueue.cpp >@@ -98,7 +98,7 @@ private: > Type m_type; > RefPtr<Document> m_oldDocument; > RefPtr<Document> m_newDocument; >- std::optional<QualifiedName> m_attributeName; >+ Optional<QualifiedName> m_attributeName; > AtomicString m_oldValue; > AtomicString m_newValue; > }; >diff --git a/Source/WebCore/dom/DataTransferItemList.h b/Source/WebCore/dom/DataTransferItemList.h >index d25359abac9b536607dd133440fe93fdd116c8a3..9a55b23dff51fc47a88b9b8795e00eb5498e59a5 100644 >--- a/Source/WebCore/dom/DataTransferItemList.h >+++ b/Source/WebCore/dom/DataTransferItemList.h >@@ -76,7 +76,7 @@ private: > Vector<Ref<DataTransferItem>>& ensureItems() const; > > DataTransfer& m_dataTransfer; >- mutable std::optional<Vector<Ref<DataTransferItem>>> m_items; >+ mutable Optional<Vector<Ref<DataTransferItem>>> m_items; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/dom/DeviceMotionData.cpp b/Source/WebCore/dom/DeviceMotionData.cpp >index 06816a6c89141232f265fef0aa3d04977603ab32..11247858ab21bb1b5ee2cecb0041b869d737cd77 100644 >--- a/Source/WebCore/dom/DeviceMotionData.cpp >+++ b/Source/WebCore/dom/DeviceMotionData.cpp >@@ -33,12 +33,12 @@ Ref<DeviceMotionData> DeviceMotionData::create() > return adoptRef(*new DeviceMotionData); > } > >-Ref<DeviceMotionData> DeviceMotionData::create(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, std::optional<double> interval) >+Ref<DeviceMotionData> DeviceMotionData::create(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, Optional<double> interval) > { > return adoptRef(*new DeviceMotionData(WTFMove(acceleration), WTFMove(accelerationIncludingGravity), WTFMove(rotationRate), interval)); > } > >-DeviceMotionData::DeviceMotionData(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, std::optional<double> interval) >+DeviceMotionData::DeviceMotionData(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, Optional<double> interval) > : m_acceleration(WTFMove(acceleration)) > , m_accelerationIncludingGravity(WTFMove(accelerationIncludingGravity)) > , m_rotationRate(WTFMove(rotationRate)) >diff --git a/Source/WebCore/dom/DeviceMotionData.h b/Source/WebCore/dom/DeviceMotionData.h >index ccdb87a08f54540af2b11b25e2ee04160874f267..e7994e37e72016edb3956b3a7a28dc301711dc5c 100644 >--- a/Source/WebCore/dom/DeviceMotionData.h >+++ b/Source/WebCore/dom/DeviceMotionData.h >@@ -39,27 +39,27 @@ public: > { > return adoptRef(*new Acceleration); > } >- static Ref<Acceleration> create(std::optional<double> x, std::optional<double> y, std::optional<double> z) >+ static Ref<Acceleration> create(Optional<double> x, Optional<double> y, Optional<double> z) > { > return adoptRef(*new Acceleration(x, y, z)); > } > >- std::optional<double> x() const { return m_x; } >- std::optional<double> y() const { return m_y; } >- std::optional<double> z() const { return m_z; } >+ Optional<double> x() const { return m_x; } >+ Optional<double> y() const { return m_y; } >+ Optional<double> z() const { return m_z; } > > private: > Acceleration() = default; >- Acceleration(std::optional<double> x, std::optional<double> y, std::optional<double> z) >+ Acceleration(Optional<double> x, Optional<double> y, Optional<double> z) > : m_x(x) > , m_y(y) > , m_z(z) > { > } > >- std::optional<double> m_x; >- std::optional<double> m_y; >- std::optional<double> m_z; >+ Optional<double> m_x; >+ Optional<double> m_y; >+ Optional<double> m_z; > }; > > class RotationRate : public RefCounted<DeviceMotionData::RotationRate> { >@@ -68,46 +68,46 @@ public: > { > return adoptRef(*new RotationRate); > } >- static Ref<RotationRate> create(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma) >+ static Ref<RotationRate> create(Optional<double> alpha, Optional<double> beta, Optional<double> gamma) > { > return adoptRef(*new RotationRate(alpha, beta, gamma)); > } > >- std::optional<double> alpha() const { return m_alpha; } >- std::optional<double> beta() const { return m_beta; } >- std::optional<double> gamma() const { return m_gamma; } >+ Optional<double> alpha() const { return m_alpha; } >+ Optional<double> beta() const { return m_beta; } >+ Optional<double> gamma() const { return m_gamma; } > > private: > RotationRate() = default; >- RotationRate(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma) >+ RotationRate(Optional<double> alpha, Optional<double> beta, Optional<double> gamma) > : m_alpha(alpha) > , m_beta(beta) > , m_gamma(gamma) > { > } > >- std::optional<double> m_alpha; >- std::optional<double> m_beta; >- std::optional<double> m_gamma; >+ Optional<double> m_alpha; >+ Optional<double> m_beta; >+ Optional<double> m_gamma; > }; > > WEBCORE_EXPORT static Ref<DeviceMotionData> create(); >- WEBCORE_EXPORT static Ref<DeviceMotionData> create(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, std::optional<double> interval); >+ WEBCORE_EXPORT static Ref<DeviceMotionData> create(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, Optional<double> interval); > > const Acceleration* acceleration() const { return m_acceleration.get(); } > const Acceleration* accelerationIncludingGravity() const { return m_accelerationIncludingGravity.get(); } > const RotationRate* rotationRate() const { return m_rotationRate.get(); } > >- std::optional<double> interval() const { return m_interval; } >+ Optional<double> interval() const { return m_interval; } > > private: > DeviceMotionData() = default; >- DeviceMotionData(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, std::optional<double> interval); >+ DeviceMotionData(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, Optional<double> interval); > > RefPtr<Acceleration> m_acceleration; > RefPtr<Acceleration> m_accelerationIncludingGravity; > RefPtr<RotationRate> m_rotationRate; >- std::optional<double> m_interval; >+ Optional<double> m_interval; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/dom/DeviceMotionEvent.cpp b/Source/WebCore/dom/DeviceMotionEvent.cpp >index 904ef3af1b707deee95cf4f1f16e731fbe69078c..90d702dc39052d0fc76de08415da47b8373b2d96 100644 >--- a/Source/WebCore/dom/DeviceMotionEvent.cpp >+++ b/Source/WebCore/dom/DeviceMotionEvent.cpp >@@ -43,23 +43,23 @@ DeviceMotionEvent::DeviceMotionEvent(const AtomicString& eventType, DeviceMotion > { > } > >-static std::optional<DeviceMotionEvent::Acceleration> convert(const DeviceMotionData::Acceleration* acceleration) >+static Optional<DeviceMotionEvent::Acceleration> convert(const DeviceMotionData::Acceleration* acceleration) > { > if (!acceleration) >- return std::nullopt; >+ return WTF::nullopt; > > return DeviceMotionEvent::Acceleration { acceleration->x(), acceleration->y(), acceleration->z() }; > } > >-static std::optional<DeviceMotionEvent::RotationRate> convert(const DeviceMotionData::RotationRate* rotationRate) >+static Optional<DeviceMotionEvent::RotationRate> convert(const DeviceMotionData::RotationRate* rotationRate) > { > if (!rotationRate) >- return std::nullopt; >+ return WTF::nullopt; > > return DeviceMotionEvent::RotationRate { rotationRate->alpha(), rotationRate->beta(), rotationRate->gamma() }; > } > >-static RefPtr<DeviceMotionData::Acceleration> convert(std::optional<DeviceMotionEvent::Acceleration>&& acceleration) >+static RefPtr<DeviceMotionData::Acceleration> convert(Optional<DeviceMotionEvent::Acceleration>&& acceleration) > { > if (!acceleration) > return nullptr; >@@ -70,7 +70,7 @@ static RefPtr<DeviceMotionData::Acceleration> convert(std::optional<DeviceMotion > return DeviceMotionData::Acceleration::create(acceleration->x, acceleration->y, acceleration->z); > } > >-static RefPtr<DeviceMotionData::RotationRate> convert(std::optional<DeviceMotionEvent::RotationRate>&& rotationRate) >+static RefPtr<DeviceMotionData::RotationRate> convert(Optional<DeviceMotionEvent::RotationRate>&& rotationRate) > { > if (!rotationRate) > return nullptr; >@@ -81,27 +81,27 @@ static RefPtr<DeviceMotionData::RotationRate> convert(std::optional<DeviceMotion > return DeviceMotionData::RotationRate::create(rotationRate->alpha, rotationRate->beta, rotationRate->gamma); > } > >-std::optional<DeviceMotionEvent::Acceleration> DeviceMotionEvent::acceleration() const >+Optional<DeviceMotionEvent::Acceleration> DeviceMotionEvent::acceleration() const > { > return convert(m_deviceMotionData->acceleration()); > } > >-std::optional<DeviceMotionEvent::Acceleration> DeviceMotionEvent::accelerationIncludingGravity() const >+Optional<DeviceMotionEvent::Acceleration> DeviceMotionEvent::accelerationIncludingGravity() const > { > return convert(m_deviceMotionData->accelerationIncludingGravity()); > } > >-std::optional<DeviceMotionEvent::RotationRate> DeviceMotionEvent::rotationRate() const >+Optional<DeviceMotionEvent::RotationRate> DeviceMotionEvent::rotationRate() const > { > return convert(m_deviceMotionData->rotationRate()); > } > >-std::optional<double> DeviceMotionEvent::interval() const >+Optional<double> DeviceMotionEvent::interval() const > { > return m_deviceMotionData->interval(); > } > >-void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, std::optional<DeviceMotionEvent::Acceleration>&& acceleration, std::optional<DeviceMotionEvent::Acceleration>&& accelerationIncludingGravity, std::optional<DeviceMotionEvent::RotationRate>&& rotationRate, std::optional<double> interval) >+void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, Optional<DeviceMotionEvent::Acceleration>&& acceleration, Optional<DeviceMotionEvent::Acceleration>&& accelerationIncludingGravity, Optional<DeviceMotionEvent::RotationRate>&& rotationRate, Optional<double> interval) > { > if (isBeingDispatched()) > return; >diff --git a/Source/WebCore/dom/DeviceMotionEvent.h b/Source/WebCore/dom/DeviceMotionEvent.h >index 7a8e9a5a1689f39deb00655f83864c796ddac13a..3ecc5bd4c0c7eec18e9fb8e4156f18bf3ef4533d 100644 >--- a/Source/WebCore/dom/DeviceMotionEvent.h >+++ b/Source/WebCore/dom/DeviceMotionEvent.h >@@ -37,16 +37,16 @@ public: > > // FIXME: Merge this with DeviceMotionData::Acceleration > struct Acceleration { >- std::optional<double> x; >- std::optional<double> y; >- std::optional<double> z; >+ Optional<double> x; >+ Optional<double> y; >+ Optional<double> z; > }; > > // FIXME: Merge this with DeviceMotionData::RotationRate > struct RotationRate { >- std::optional<double> alpha; >- std::optional<double> beta; >- std::optional<double> gamma; >+ Optional<double> alpha; >+ Optional<double> beta; >+ Optional<double> gamma; > }; > > static Ref<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData) >@@ -59,12 +59,12 @@ public: > return adoptRef(*new DeviceMotionEvent); > } > >- std::optional<Acceleration> acceleration() const; >- std::optional<Acceleration> accelerationIncludingGravity() const; >- std::optional<RotationRate> rotationRate() const; >- std::optional<double> interval() const; >+ Optional<Acceleration> acceleration() const; >+ Optional<Acceleration> accelerationIncludingGravity() const; >+ Optional<RotationRate> rotationRate() const; >+ Optional<double> interval() const; > >- void initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, std::optional<Acceleration>&&, std::optional<Acceleration>&&, std::optional<RotationRate>&&, std::optional<double>); >+ void initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, Optional<Acceleration>&&, Optional<Acceleration>&&, Optional<RotationRate>&&, Optional<double>); > > private: > DeviceMotionEvent(); >diff --git a/Source/WebCore/dom/DeviceOrientationData.cpp b/Source/WebCore/dom/DeviceOrientationData.cpp >index 668a41f5480f174ef50d962c0eb6900cb7f681e2..3b9d7131513cf73d379d6060eb3839df1694eb83 100644 >--- a/Source/WebCore/dom/DeviceOrientationData.cpp >+++ b/Source/WebCore/dom/DeviceOrientationData.cpp >@@ -31,12 +31,12 @@ namespace WebCore { > #if PLATFORM(IOS_FAMILY) > > // FIXME: We should reconcile the iOS and OpenSource differences. >-Ref<DeviceOrientationData> DeviceOrientationData::create(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<double> compassHeading, std::optional<double> compassAccuracy) >+Ref<DeviceOrientationData> DeviceOrientationData::create(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<double> compassHeading, Optional<double> compassAccuracy) > { > return adoptRef(*new DeviceOrientationData(alpha, beta, gamma, compassHeading, compassAccuracy)); > } > >-DeviceOrientationData::DeviceOrientationData(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<double> compassHeading, std::optional<double> compassAccuracy) >+DeviceOrientationData::DeviceOrientationData(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<double> compassHeading, Optional<double> compassAccuracy) > : m_alpha(alpha) > , m_beta(beta) > , m_gamma(gamma) >@@ -47,12 +47,12 @@ DeviceOrientationData::DeviceOrientationData(std::optional<double> alpha, std::o > > #else > >-Ref<DeviceOrientationData> DeviceOrientationData::create(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<bool> absolute) >+Ref<DeviceOrientationData> DeviceOrientationData::create(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<bool> absolute) > { > return adoptRef(*new DeviceOrientationData(alpha, beta, gamma, absolute)); > } > >-DeviceOrientationData::DeviceOrientationData(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<bool> absolute) >+DeviceOrientationData::DeviceOrientationData(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<bool> absolute) > : m_alpha(alpha) > , m_beta(beta) > , m_gamma(gamma) >diff --git a/Source/WebCore/dom/DeviceOrientationData.h b/Source/WebCore/dom/DeviceOrientationData.h >index c8051ddf476834b90b0ae71db8ca53fb1c08f465..dacb3d52800ecc0ac9c7059131217cd58398446c 100644 >--- a/Source/WebCore/dom/DeviceOrientationData.h >+++ b/Source/WebCore/dom/DeviceOrientationData.h >@@ -39,37 +39,37 @@ public: > } > > #if PLATFORM(IOS_FAMILY) >- WEBCORE_EXPORT static Ref<DeviceOrientationData> create(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<double> compassHeading, std::optional<double> compassAccuracy); >+ WEBCORE_EXPORT static Ref<DeviceOrientationData> create(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<double> compassHeading, Optional<double> compassAccuracy); > #else >- WEBCORE_EXPORT static Ref<DeviceOrientationData> create(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<bool> absolute); >+ WEBCORE_EXPORT static Ref<DeviceOrientationData> create(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<bool> absolute); > #endif > >- std::optional<double> alpha() const { return m_alpha; } >- std::optional<double> beta() const { return m_beta; } >- std::optional<double> gamma() const { return m_gamma; } >+ Optional<double> alpha() const { return m_alpha; } >+ Optional<double> beta() const { return m_beta; } >+ Optional<double> gamma() const { return m_gamma; } > #if PLATFORM(IOS_FAMILY) >- std::optional<double> compassHeading() const { return m_compassHeading; } >- std::optional<double> compassAccuracy() const { return m_compassAccuracy; } >+ Optional<double> compassHeading() const { return m_compassHeading; } >+ Optional<double> compassAccuracy() const { return m_compassAccuracy; } > #else >- std::optional<bool> absolute() const { return m_absolute; } >+ Optional<bool> absolute() const { return m_absolute; } > #endif > > private: > DeviceOrientationData() = default; > #if PLATFORM(IOS_FAMILY) >- DeviceOrientationData(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<double> compassHeading, std::optional<double> compassAccuracy); >+ DeviceOrientationData(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<double> compassHeading, Optional<double> compassAccuracy); > #else >- DeviceOrientationData(std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<bool> absolute); >+ DeviceOrientationData(Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<bool> absolute); > #endif > >- std::optional<double> m_alpha; >- std::optional<double> m_beta; >- std::optional<double> m_gamma; >+ Optional<double> m_alpha; >+ Optional<double> m_beta; >+ Optional<double> m_gamma; > #if PLATFORM(IOS_FAMILY) >- std::optional<double> m_compassHeading; >- std::optional<double> m_compassAccuracy; >+ Optional<double> m_compassHeading; >+ Optional<double> m_compassAccuracy; > #else >- std::optional<bool> m_absolute; >+ Optional<bool> m_absolute; > #endif > }; > >diff --git a/Source/WebCore/dom/DeviceOrientationEvent.cpp b/Source/WebCore/dom/DeviceOrientationEvent.cpp >index c47ad46714bf722bb96faefcebe2b6a24761dc1b..e821b6553108a120c0fb27127ba5755190e71e1e 100644 >--- a/Source/WebCore/dom/DeviceOrientationEvent.cpp >+++ b/Source/WebCore/dom/DeviceOrientationEvent.cpp >@@ -43,34 +43,34 @@ DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, De > { > } > >-std::optional<double> DeviceOrientationEvent::alpha() const >+Optional<double> DeviceOrientationEvent::alpha() const > { > return m_orientation->alpha(); > } > >-std::optional<double> DeviceOrientationEvent::beta() const >+Optional<double> DeviceOrientationEvent::beta() const > { > return m_orientation->beta(); > } > >-std::optional<double> DeviceOrientationEvent::gamma() const >+Optional<double> DeviceOrientationEvent::gamma() const > { > return m_orientation->gamma(); > } > > #if PLATFORM(IOS_FAMILY) > >-std::optional<double> DeviceOrientationEvent::compassHeading() const >+Optional<double> DeviceOrientationEvent::compassHeading() const > { > return m_orientation->compassHeading(); > } > >-std::optional<double> DeviceOrientationEvent::compassAccuracy() const >+Optional<double> DeviceOrientationEvent::compassAccuracy() const > { > return m_orientation->compassAccuracy(); > } > >-void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<double> compassHeading, std::optional<double> compassAccuracy) >+void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<double> compassHeading, Optional<double> compassAccuracy) > { > if (isBeingDispatched()) > return; >@@ -81,12 +81,12 @@ void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type > > #else > >-std::optional<bool> DeviceOrientationEvent::absolute() const >+Optional<bool> DeviceOrientationEvent::absolute() const > { > return m_orientation->absolute(); > } > >-void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<bool> absolute) >+void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<bool> absolute) > { > if (isBeingDispatched()) > return; >diff --git a/Source/WebCore/dom/DeviceOrientationEvent.h b/Source/WebCore/dom/DeviceOrientationEvent.h >index c288492c8c577a19a676c7524ebdcbef516f9d7a..025b2e32a751e42f650bb53b515a10bdb527f478 100644 >--- a/Source/WebCore/dom/DeviceOrientationEvent.h >+++ b/Source/WebCore/dom/DeviceOrientationEvent.h >@@ -45,19 +45,19 @@ public: > > virtual ~DeviceOrientationEvent(); > >- std::optional<double> alpha() const; >- std::optional<double> beta() const; >- std::optional<double> gamma() const; >+ Optional<double> alpha() const; >+ Optional<double> beta() const; >+ Optional<double> gamma() const; > > #if PLATFORM(IOS_FAMILY) >- std::optional<double> compassHeading() const; >- std::optional<double> compassAccuracy() const; >+ Optional<double> compassHeading() const; >+ Optional<double> compassAccuracy() const; > >- void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<double> compassHeading, std::optional<double> compassAccuracy); >+ void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<double> compassHeading, Optional<double> compassAccuracy); > #else >- std::optional<bool> absolute() const; >+ Optional<bool> absolute() const; > >- void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, std::optional<double> alpha, std::optional<double> beta, std::optional<double> gamma, std::optional<bool> absolute); >+ void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, Optional<double> alpha, Optional<double> beta, Optional<double> gamma, Optional<bool> absolute); > #endif > > private: >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index d6be912b123ab17970e88b482146091383aabdda..4a3be9212b5bff5f7c6da0137fb019ed5960dd29 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -1981,7 +1981,7 @@ void Document::updateTextRenderer(Text& text, unsigned offsetOfReplacedText, uns > SetForScope<bool> inRenderTreeUpdate(m_inRenderTreeUpdate, true); > > auto textUpdate = std::make_unique<Style::Update>(*this); >- textUpdate->addText(text, { offsetOfReplacedText, lengthOfReplacedText, std::nullopt }); >+ textUpdate->addText(text, { offsetOfReplacedText, lengthOfReplacedText, WTF::nullopt }); > > RenderTreeUpdater renderTreeUpdater(*this); > renderTreeUpdater.commit(WTFMove(textUpdate)); >@@ -3562,7 +3562,7 @@ void Document::dispatchDisabledAdaptationsDidChangeForMainFrame() > page()->chrome().dispatchDisabledAdaptationsDidChange(m_disabledAdaptations); > } > >-void Document::setOverrideViewportArguments(const std::optional<ViewportArguments>& viewportArguments) >+void Document::setOverrideViewportArguments(const Optional<ViewportArguments>& viewportArguments) > { > if (viewportArguments == m_overrideViewportArguments) > return; >@@ -4873,7 +4873,7 @@ ExceptionOr<void> Document::setDomain(const String& newDomain) > return { }; > } > >-void Document::overrideLastModified(const std::optional<WallTime>& lastModified) >+void Document::overrideLastModified(const Optional<WallTime>& lastModified) > { > m_overrideLastModified = lastModified; > } >@@ -4881,7 +4881,7 @@ void Document::overrideLastModified(const std::optional<WallTime>& lastModified) > // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified > String Document::lastModified() const > { >- std::optional<WallTime> dateTime; >+ Optional<WallTime> dateTime; > if (m_overrideLastModified) > dateTime = m_overrideLastModified; > else if (loader()) >@@ -5956,15 +5956,15 @@ void Document::detachRange(Range* range) > m_ranges.remove(range); > } > >-std::optional<RenderingContext> Document::getCSSCanvasContext(const String& type, const String& name, int width, int height) >+Optional<RenderingContext> Document::getCSSCanvasContext(const String& type, const String& name, int width, int height) > { > HTMLCanvasElement* element = getCSSCanvasElement(name); > if (!element) >- return std::nullopt; >+ return WTF::nullopt; > element->setSize({ width, height }); > auto context = element->getContext(type); > if (!context) >- return std::nullopt; >+ return WTF::nullopt; > > #if ENABLE(WEBGL) > if (is<WebGLRenderingContext>(*context)) >@@ -7706,21 +7706,21 @@ static void expandRootBoundsWithRootMargin(FloatRect& localRootBounds, const Len > localRootBounds.expand(rootMarginFloatBox); > } > >-static std::optional<LayoutRect> computeClippedRectInRootContentsSpace(const LayoutRect& rect, const RenderElement* renderer) >+static Optional<LayoutRect> computeClippedRectInRootContentsSpace(const LayoutRect& rect, const RenderElement* renderer) > { > OptionSet<RenderObject::VisibleRectContextOption> visibleRectOptions = { RenderObject::VisibleRectContextOption::UseEdgeInclusiveIntersection, RenderObject::VisibleRectContextOption::ApplyCompositedClips, RenderObject::VisibleRectContextOption::ApplyCompositedContainerScrolls }; >- std::optional<LayoutRect> rectInFrameAbsoluteSpace = renderer->computeVisibleRectInContainer(rect, &renderer->view(), {false /* hasPositionFixedDescendant */, false /* dirtyRectIsFlipped */, visibleRectOptions }); >+ Optional<LayoutRect> rectInFrameAbsoluteSpace = renderer->computeVisibleRectInContainer(rect, &renderer->view(), {false /* hasPositionFixedDescendant */, false /* dirtyRectIsFlipped */, visibleRectOptions }); > if (!rectInFrameAbsoluteSpace || renderer->frame().isMainFrame()) > return rectInFrameAbsoluteSpace; > > bool intersects = rectInFrameAbsoluteSpace->edgeInclusiveIntersect(renderer->view().frameView().layoutViewportRect()); > if (!intersects) >- return std::nullopt; >+ return WTF::nullopt; > > LayoutRect rectInFrameViewSpace(renderer->view().frameView().contentsToView(snappedIntRect(*rectInFrameAbsoluteSpace))); > auto* ownerRenderer = renderer->frame().ownerRenderer(); > if (!ownerRenderer) >- return std::nullopt; >+ return WTF::nullopt; > > rectInFrameViewSpace.moveBy(ownerRenderer->contentBoxLocation()); > return computeClippedRectInRootContentsSpace(rectInFrameViewSpace, ownerRenderer); >@@ -7733,24 +7733,24 @@ struct IntersectionObservationState { > bool isIntersecting { false }; > }; > >-static std::optional<IntersectionObservationState> computeIntersectionState(FrameView& frameView, const IntersectionObserver& observer, Element& target, bool applyRootMargin) >+static Optional<IntersectionObservationState> computeIntersectionState(FrameView& frameView, const IntersectionObserver& observer, Element& target, bool applyRootMargin) > { > auto* targetRenderer = target.renderer(); > if (!targetRenderer) >- return std::nullopt; >+ return WTF::nullopt; > > FloatRect localRootBounds; > RenderBlock* rootRenderer; > if (observer.root()) { > if (observer.trackingDocument() != &target.document()) >- return std::nullopt; >+ return WTF::nullopt; > > if (!observer.root()->renderer() || !is<RenderBlock>(observer.root()->renderer())) >- return std::nullopt; >+ return WTF::nullopt; > > rootRenderer = downcast<RenderBlock>(observer.root()->renderer()); > if (!rootRenderer->isContainingBlockAncestorFor(*targetRenderer)) >- return std::nullopt; >+ return WTF::nullopt; > > if (rootRenderer->hasOverflowClip()) > localRootBounds = rootRenderer->contentBoxRect(); >@@ -7760,7 +7760,7 @@ static std::optional<IntersectionObservationState> computeIntersectionState(Fram > ASSERT(frameView.frame().isMainFrame()); > // FIXME: Handle the case of an implicit-root observer that has a target in a different frame tree. > if (&targetRenderer->frame().mainFrame() != &frameView.frame()) >- return std::nullopt; >+ return WTF::nullopt; > rootRenderer = frameView.renderView(); > localRootBounds = frameView.layoutViewportRect(); > } >@@ -7776,7 +7776,7 @@ static std::optional<IntersectionObservationState> computeIntersectionState(Fram > else if (is<RenderLineBreak>(targetRenderer)) > localTargetBounds = downcast<RenderLineBreak>(targetRenderer)->linesBoundingBox(); > >- std::optional<LayoutRect> rootLocalTargetRect; >+ Optional<LayoutRect> rootLocalTargetRect; > if (observer.root()) { > OptionSet<RenderObject::VisibleRectContextOption> visibleRectOptions = { RenderObject::VisibleRectContextOption::UseEdgeInclusiveIntersection, RenderObject::VisibleRectContextOption::ApplyCompositedClips, RenderObject::VisibleRectContextOption::ApplyCompositedContainerScrolls }; > rootLocalTargetRect = targetRenderer->computeVisibleRectInContainer(localTargetBounds, rootRenderer, { false /* hasPositionFixedDescendant */, false /* dirtyRectIsFlipped */, visibleRectOptions }); >@@ -7860,7 +7860,7 @@ void Document::updateIntersectionObservations() > clientIntersectionRect = targetFrameView->absoluteToClientRect(intersectionState->absoluteIntersectionRect, target->renderer()->style().effectiveZoom()); > } > >- std::optional<DOMRectInit> reportedRootBounds; >+ Optional<DOMRectInit> reportedRootBounds; > if (isSameOriginObservation) { > reportedRootBounds = DOMRectInit({ > clientRootBounds.x(), >@@ -8474,7 +8474,7 @@ void Document::setServiceWorkerConnection(SWClientConnection* serviceWorkerConne > if (!m_serviceWorkerConnection) > return; > >- auto controllingServiceWorkerRegistrationIdentifier = activeServiceWorker() ? std::make_optional<ServiceWorkerRegistrationIdentifier>(activeServiceWorker()->registrationIdentifier()) : std::nullopt; >+ auto controllingServiceWorkerRegistrationIdentifier = activeServiceWorker() ? makeOptional<ServiceWorkerRegistrationIdentifier>(activeServiceWorker()->registrationIdentifier()) : WTF::nullopt; > m_serviceWorkerConnection->registerServiceWorkerClient(topOrigin(), ServiceWorkerClientData::from(*this, *serviceWorkerConnection), controllingServiceWorkerRegistrationIdentifier); > } > #endif >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 4cca3a1d1204582882ad87238187bc24d8e9b952..6d5cddb83f8ec20f0d856ef14bca18248037d4ce 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -415,7 +415,7 @@ public: > void setViewportArguments(const ViewportArguments& viewportArguments) { m_viewportArguments = viewportArguments; } > ViewportArguments viewportArguments() const { return m_viewportArguments; } > >- WEBCORE_EXPORT void setOverrideViewportArguments(const std::optional<ViewportArguments>&); >+ WEBCORE_EXPORT void setOverrideViewportArguments(const Optional<ViewportArguments>&); > > OptionSet<DisabledAdaptations> disabledAdaptations() const { return m_disabledAdaptations; } > #ifndef NDEBUG >@@ -929,7 +929,7 @@ public: > WEBCORE_EXPORT String domain() const; > ExceptionOr<void> setDomain(const String& newDomain); > >- void overrideLastModified(const std::optional<WallTime>&); >+ void overrideLastModified(const Optional<WallTime>&); > WEBCORE_EXPORT String lastModified() const; > > // The cookieURL is used to query the cookie database for this document's >@@ -1050,7 +1050,7 @@ public: > void setHasNodesWithMissingStyle() { m_hasNodesWithMissingStyle = true; } > > // Extension for manipulating canvas drawing contexts for use in CSS >- std::optional<RenderingContext> getCSSCanvasContext(const String& type, const String& name, int width, int height); >+ Optional<RenderingContext> getCSSCanvasContext(const String& type, const String& name, int width, int height); > HTMLCanvasElement* getCSSCanvasElement(const String& name); > String nameForCSSCanvasElement(const HTMLCanvasElement&) const; > >@@ -1844,7 +1844,7 @@ private: > Timer m_loadEventDelayTimer; > > ViewportArguments m_viewportArguments; >- std::optional<ViewportArguments> m_overrideViewportArguments; >+ Optional<ViewportArguments> m_overrideViewportArguments; > OptionSet<DisabledAdaptations> m_disabledAdaptations; > > DocumentTiming m_documentTiming; >@@ -1931,7 +1931,7 @@ private: > > String m_cachedDOMCookies; > >- std::optional<WallTime> m_overrideLastModified; >+ Optional<WallTime> m_overrideLastModified; > > HashSet<RefPtr<Element>> m_associatedFormControls; > unsigned m_disabledFieldsetElementsCount { 0 }; >@@ -1959,7 +1959,7 @@ private: > MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; > bool m_userHasInteractedWithMediaElement { false }; > PageCacheState m_pageCacheState { NotInPageCache }; >- std::optional<ReferrerPolicy> m_referrerPolicy; >+ Optional<ReferrerPolicy> m_referrerPolicy; > ReadyState m_readyState { Complete }; > > MutationObserverOptions m_mutationObserverTypes { 0 }; >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index 6468eabf340002285c4c542984ef77d9cda55894..f7c618652f3b042deae1e69624f4e64244a3b7b9 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -655,7 +655,7 @@ void Element::setHovered(bool flag) > } > > // FIXME(webkit.org/b/161611): Take into account orientation/direction. >-inline ScrollAlignment toScrollAlignment(std::optional<ScrollLogicalPosition> position, bool isVertical) >+inline ScrollAlignment toScrollAlignment(Optional<ScrollLogicalPosition> position, bool isVertical) > { > switch (position.value_or(isVertical ? ScrollLogicalPosition::Start : ScrollLogicalPosition::Nearest)) { > case ScrollLogicalPosition::Start: >@@ -672,7 +672,7 @@ inline ScrollAlignment toScrollAlignment(std::optional<ScrollLogicalPosition> po > } > } > >-void Element::scrollIntoView(std::optional<Variant<bool, ScrollIntoViewOptions>>&& arg) >+void Element::scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& arg) > { > document().updateLayoutIgnorePendingStylesheets(); > >@@ -1270,7 +1270,7 @@ LayoutRect Element::absoluteEventHandlerBounds(bool& includesFixedPositionElemen > return absoluteEventBoundsOfElementAndDescendants(includesFixedPositionElements); > } > >-static std::optional<std::pair<RenderObject*, LayoutRect>> listBoxElementBoundingBox(Element& element) >+static Optional<std::pair<RenderObject*, LayoutRect>> listBoxElementBoundingBox(Element& element) > { > HTMLSelectElement* selectElement; > bool isGroup; >@@ -1281,13 +1281,13 @@ static std::optional<std::pair<RenderObject*, LayoutRect>> listBoxElementBoundin > selectElement = downcast<HTMLOptGroupElement>(element).ownerSelectElement(); > isGroup = true; > } else >- return std::nullopt; >+ return WTF::nullopt; > > if (!selectElement || !selectElement->renderer() || !is<RenderListBox>(selectElement->renderer())) >- return std::nullopt; >+ return WTF::nullopt; > > auto& renderer = downcast<RenderListBox>(*selectElement->renderer()); >- std::optional<LayoutRect> boundingBox; >+ Optional<LayoutRect> boundingBox; > int optionIndex = 0; > for (auto* item : selectElement->listItems()) { > if (item == &element) { >@@ -1305,7 +1305,7 @@ static std::optional<std::pair<RenderObject*, LayoutRect>> listBoxElementBoundin > } > > if (!boundingBox) >- return std::nullopt; >+ return WTF::nullopt; > > return std::pair<RenderObject*, LayoutRect> { &renderer, boundingBox.value() }; > } >@@ -1398,7 +1398,7 @@ const AtomicString& Element::getAttributeNS(const AtomicString& namespaceURI, co > } > > // https://dom.spec.whatwg.org/#dom-element-toggleattribute >-ExceptionOr<bool> Element::toggleAttribute(const AtomicString& qualifiedName, std::optional<bool> force) >+ExceptionOr<bool> Element::toggleAttribute(const AtomicString& qualifiedName, Optional<bool> force) > { > if (!Document::isValidName(qualifiedName)) > return Exception { InvalidCharacterError }; >@@ -3756,10 +3756,10 @@ void Element::didDetachRenderers() > ASSERT(hasCustomStyleResolveCallbacks()); > } > >-std::optional<ElementStyle> Element::resolveCustomStyle(const RenderStyle&, const RenderStyle*) >+Optional<ElementStyle> Element::resolveCustomStyle(const RenderStyle&, const RenderStyle*) > { > ASSERT(hasCustomStyleResolveCallbacks()); >- return std::nullopt; >+ return WTF::nullopt; > } > > void Element::cloneAttributesFromElement(const Element& other) >@@ -4003,10 +4003,10 @@ Element* Element::findAnchorElementForLink(String& outAnchorName) > return nullptr; > } > >-ExceptionOr<Ref<WebAnimation>> Element::animate(JSC::ExecState& state, JSC::Strong<JSC::JSObject>&& keyframes, std::optional<Variant<double, KeyframeAnimationOptions>>&& options) >+ExceptionOr<Ref<WebAnimation>> Element::animate(JSC::ExecState& state, JSC::Strong<JSC::JSObject>&& keyframes, Optional<Variant<double, KeyframeAnimationOptions>>&& options) > { > String id = ""; >- std::optional<Variant<double, KeyframeEffectOptions>> keyframeEffectOptions; >+ Optional<Variant<double, KeyframeEffectOptions>> keyframeEffectOptions; > if (options) { > auto optionsValue = options.value(); > Variant<double, KeyframeEffectOptions> keyframeEffectOptionsVariant; >diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h >index bc6eba852548670077f3888bb20bcc0ac9f6f5a0..26a2f62067b055f8e30a630304fec90aa49b2755 100644 >--- a/Source/WebCore/dom/Element.h >+++ b/Source/WebCore/dom/Element.h >@@ -122,7 +122,7 @@ public: > static ExceptionOr<QualifiedName> parseAttributeName(const AtomicString& namespaceURI, const AtomicString& qualifiedName); > WEBCORE_EXPORT ExceptionOr<void> setAttributeNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, const AtomicString& value); > >- ExceptionOr<bool> toggleAttribute(const AtomicString& qualifiedName, std::optional<bool> force); >+ ExceptionOr<bool> toggleAttribute(const AtomicString& qualifiedName, Optional<bool> force); > > const AtomicString& getIdAttribute() const; > void setIdAttribute(const AtomicString&); >@@ -143,7 +143,7 @@ public: > unsigned findAttributeIndexByName(const QualifiedName& name) const { return elementData()->findAttributeIndexByName(name); } > unsigned findAttributeIndexByName(const AtomicString& name, bool shouldIgnoreAttributeCase) const { return elementData()->findAttributeIndexByName(name, shouldIgnoreAttributeCase); } > >- WEBCORE_EXPORT void scrollIntoView(std::optional<Variant<bool, ScrollIntoViewOptions>>&& arg); >+ WEBCORE_EXPORT void scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& arg); > WEBCORE_EXPORT void scrollIntoView(bool alignToTop = true); > WEBCORE_EXPORT void scrollIntoViewIfNeeded(bool centerIfNeeded = true); > WEBCORE_EXPORT void scrollIntoViewIfNotVisible(bool centerIfNotVisible = true); >@@ -522,7 +522,7 @@ public: > virtual void didAttachRenderers(); > virtual void willDetachRenderers(); > virtual void didDetachRenderers(); >- virtual std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle); >+ virtual Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle); > > LayoutRect absoluteEventHandlerBounds(bool& includesFixedPositionElements) override; > >@@ -582,7 +582,7 @@ public: > > Element* findAnchorElementForLink(String& outAnchorName); > >- ExceptionOr<Ref<WebAnimation>> animate(JSC::ExecState&, JSC::Strong<JSC::JSObject>&&, std::optional<Variant<double, KeyframeAnimationOptions>>&&); >+ ExceptionOr<Ref<WebAnimation>> animate(JSC::ExecState&, JSC::Strong<JSC::JSObject>&&, Optional<Variant<double, KeyframeAnimationOptions>>&&); > Vector<RefPtr<WebAnimation>> getAnimations(); > > protected: >diff --git a/Source/WebCore/dom/ElementIteratorAssertions.h b/Source/WebCore/dom/ElementIteratorAssertions.h >index 393b351c74760806b0c8aaf343f2a54d7bd28525..29f2eea36425a0568c98ba40a0e48351aafcb322 100644 >--- a/Source/WebCore/dom/ElementIteratorAssertions.h >+++ b/Source/WebCore/dom/ElementIteratorAssertions.h >@@ -39,7 +39,7 @@ public: > private: > const Document* m_document; > uint64_t m_initialDOMTreeVersion; >- std::optional<ScriptDisallowedScope> m_eventDispatchAssertion; >+ Optional<ScriptDisallowedScope> m_eventDispatchAssertion; > }; > > // FIXME: No real point in doing these as inlines; they are for debugging and we usually turn off inlining in debug builds. >@@ -59,14 +59,14 @@ inline bool ElementIteratorAssertions::domTreeHasMutated() const > > inline void ElementIteratorAssertions::dropEventDispatchAssertion() > { >- m_eventDispatchAssertion = std::nullopt; >+ m_eventDispatchAssertion = WTF::nullopt; > } > > inline void ElementIteratorAssertions::clear() > { > m_document = nullptr; > m_initialDOMTreeVersion = 0; >- m_eventDispatchAssertion = std::nullopt; >+ m_eventDispatchAssertion = WTF::nullopt; > } > > } // namespace WebCore >diff --git a/Source/WebCore/dom/EventTarget.h b/Source/WebCore/dom/EventTarget.h >index 7c7e110b4d0011470892a0aa04699f8719328552..d6c5c60fba2e58e9994d5b296b73fd64a942c75e 100644 >--- a/Source/WebCore/dom/EventTarget.h >+++ b/Source/WebCore/dom/EventTarget.h >@@ -70,13 +70,13 @@ public: > }; > > struct AddEventListenerOptions : ListenerOptions { >- AddEventListenerOptions(bool capture = false, std::optional<bool> passive = std::nullopt, bool once = false) >+ AddEventListenerOptions(bool capture = false, Optional<bool> passive = WTF::nullopt, bool once = false) > : ListenerOptions(capture) > , passive(passive) > , once(once) > { } > >- std::optional<bool> passive; >+ Optional<bool> passive; > bool once { false }; > }; > >diff --git a/Source/WebCore/dom/GCReachableRef.h b/Source/WebCore/dom/GCReachableRef.h >index e66c975460a86ac240d51cc60e8b60640f8a8a12..997bc5e5c775ba6570cd484a724949375ec16e19 100644 >--- a/Source/WebCore/dom/GCReachableRef.h >+++ b/Source/WebCore/dom/GCReachableRef.h >@@ -124,8 +124,8 @@ template<typename P> struct HashTraits<WebCore::GCReachableRef<P>> : SimpleClass > static PeekType peek(const Ref<P>& value) { return const_cast<PeekType>(value.ptrAllowingHashTableEmptyValue()); } > static PeekType peek(P* value) { return value; } > >- typedef std::optional<Ref<P>> TakeType; >- static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? std::nullopt : std::optional<Ref<P>>(WTFMove(value)); } >+ typedef Optional<Ref<P>> TakeType; >+ static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? WTF::nullopt : Optional<Ref<P>>(WTFMove(value)); } > }; > > template <typename T, typename U> >diff --git a/Source/WebCore/dom/InlineStyleSheetOwner.cpp b/Source/WebCore/dom/InlineStyleSheetOwner.cpp >index 109f724c583160a718cb5874d0eff84eaa4fffbd..0d8b6bce75e1f075e8b3eafb8521975d6283bc8d 100644 >--- a/Source/WebCore/dom/InlineStyleSheetOwner.cpp >+++ b/Source/WebCore/dom/InlineStyleSheetOwner.cpp >@@ -58,7 +58,7 @@ static CSSParserContext parserContextForElement(const Element& element) > return result; > } > >-static std::optional<InlineStyleSheetCacheKey> makeInlineStyleSheetCacheKey(const String& text, const Element& element) >+static Optional<InlineStyleSheetCacheKey> makeInlineStyleSheetCacheKey(const String& text, const Element& element) > { > // Only cache for shadow trees. Main document inline stylesheets are generally unique and can't be shared between documents. > // FIXME: This could be relaxed when a stylesheet does not contain document-relative URLs (or #urls). >diff --git a/Source/WebCore/dom/KeyboardEvent.cpp b/Source/WebCore/dom/KeyboardEvent.cpp >index eed5bd92aaf274872d5e477635313af5f9308821..23de812c55d0d3fbb19b0567f28f6c7c0b3fefc3 100644 >--- a/Source/WebCore/dom/KeyboardEvent.cpp >+++ b/Source/WebCore/dom/KeyboardEvent.cpp >@@ -162,12 +162,12 @@ void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, > > setModifierKeys(ctrlKey, altKey, shiftKey, metaKey, altGraphKey); > >- m_charCode = std::nullopt; >+ m_charCode = WTF::nullopt; > m_isComposing = false; >- m_keyCode = std::nullopt; >+ m_keyCode = WTF::nullopt; > m_repeat = false; > m_underlyingPlatformEvent = nullptr; >- m_which = std::nullopt; >+ m_which = WTF::nullopt; > > #if ENABLE(KEYBOARD_CODE_ATTRIBUTE) > m_code = { }; >diff --git a/Source/WebCore/dom/KeyboardEvent.h b/Source/WebCore/dom/KeyboardEvent.h >index 07a32da0c80dbf83e711e7db857fdd4426a7b45d..b7340b304fb8785f09c385c2724165822a56ce84 100644 >--- a/Source/WebCore/dom/KeyboardEvent.h >+++ b/Source/WebCore/dom/KeyboardEvent.h >@@ -55,7 +55,7 @@ public: > > // Legacy. > String keyIdentifier; >- std::optional<unsigned> keyLocation; >+ Optional<unsigned> keyLocation; > unsigned charCode; > unsigned keyCode; > unsigned which; >@@ -114,9 +114,9 @@ private: > unsigned m_location { DOM_KEY_LOCATION_STANDARD }; > bool m_repeat { false }; > bool m_isComposing { false }; >- std::optional<unsigned> m_charCode; >- std::optional<unsigned> m_keyCode; >- std::optional<unsigned> m_which; >+ Optional<unsigned> m_charCode; >+ Optional<unsigned> m_keyCode; >+ Optional<unsigned> m_which; > > #if PLATFORM(COCOA) > // Commands that were sent by AppKit when interpreting the event. Doesn't include input method commands. >diff --git a/Source/WebCore/dom/LoadableClassicScript.cpp b/Source/WebCore/dom/LoadableClassicScript.cpp >index b3d12702539150a46986d39850795f3622971dc6..d927e95be269a25ae4336a74b00027c1758fe48a 100644 >--- a/Source/WebCore/dom/LoadableClassicScript.cpp >+++ b/Source/WebCore/dom/LoadableClassicScript.cpp >@@ -52,16 +52,16 @@ bool LoadableClassicScript::isLoaded() const > return m_cachedScript->isLoaded(); > } > >-std::optional<LoadableScript::Error> LoadableClassicScript::error() const >+Optional<LoadableScript::Error> LoadableClassicScript::error() const > { > ASSERT(m_cachedScript); > if (m_error) > return m_error; > > if (m_cachedScript->errorOccurred()) >- return Error { ErrorType::CachedScript, std::nullopt }; >+ return Error { ErrorType::CachedScript, WTF::nullopt }; > >- return std::nullopt; >+ return WTF::nullopt; > } > > bool LoadableClassicScript::wasCanceled() const >diff --git a/Source/WebCore/dom/LoadableClassicScript.h b/Source/WebCore/dom/LoadableClassicScript.h >index 73a28b7ec78dc3b933177e5bc757ad42a4512abd..067644a47d1f9d902b4e196aaeffa8a6f95d4f0f 100644 >--- a/Source/WebCore/dom/LoadableClassicScript.h >+++ b/Source/WebCore/dom/LoadableClassicScript.h >@@ -42,7 +42,7 @@ public: > > static Ref<LoadableClassicScript> create(const String& nonce, const String& integrity, const String& crossOriginMode, const String& charset, const AtomicString& initiatorName, bool isInUserAgentShadowTree); > bool isLoaded() const final; >- std::optional<Error> error() const final; >+ Optional<Error> error() const final; > bool wasCanceled() const final; > > CachedScript& cachedScript() { return *m_cachedScript; } >@@ -64,7 +64,7 @@ private: > void notifyFinished(CachedResource&) final; > > CachedResourceHandle<CachedScript> m_cachedScript { }; >- std::optional<Error> m_error { std::nullopt }; >+ Optional<Error> m_error { WTF::nullopt }; > String m_integrity; > }; > >diff --git a/Source/WebCore/dom/LoadableModuleScript.cpp b/Source/WebCore/dom/LoadableModuleScript.cpp >index 267ff01beb657cb1c383db6ee085590cae6449c4..322cd3a7392c9bf0e4570d571275daa367748e21 100644 >--- a/Source/WebCore/dom/LoadableModuleScript.cpp >+++ b/Source/WebCore/dom/LoadableModuleScript.cpp >@@ -52,7 +52,7 @@ bool LoadableModuleScript::isLoaded() const > return m_isLoaded; > } > >-std::optional<LoadableScript::Error> LoadableModuleScript::error() const >+Optional<LoadableScript::Error> LoadableModuleScript::error() const > { > return m_error; > } >diff --git a/Source/WebCore/dom/LoadableModuleScript.h b/Source/WebCore/dom/LoadableModuleScript.h >index ba1fe1da1f9049a4fb7cd2e4f9d9b12635e06a10..173dca36aa174c3813182490d1aec6f6f7af64d5 100644 >--- a/Source/WebCore/dom/LoadableModuleScript.h >+++ b/Source/WebCore/dom/LoadableModuleScript.h >@@ -40,7 +40,7 @@ public: > static Ref<LoadableModuleScript> create(const String& nonce, const String& integrity, const String& crossOriginMode, const String& charset, const AtomicString& initiatorName, bool isInUserAgentShadowTree); > > bool isLoaded() const final; >- std::optional<Error> error() const final; >+ Optional<Error> error() const final; > bool wasCanceled() const final; > > bool isClassicScript() const final { return false; } >@@ -64,7 +64,7 @@ private: > > Ref<ModuleFetchParameters> m_parameters; > RefPtr<UniquedStringImpl> m_moduleKey; >- std::optional<LoadableScript::Error> m_error; >+ Optional<LoadableScript::Error> m_error; > bool m_wasCanceled { false }; > bool m_isLoaded { false }; > }; >diff --git a/Source/WebCore/dom/LoadableScript.h b/Source/WebCore/dom/LoadableScript.h >index a320a368b524eb34fc908f5da19653e49f1a3b96..670badf34d8caddd3e5a8ab106a1bc35c4826027 100644 >--- a/Source/WebCore/dom/LoadableScript.h >+++ b/Source/WebCore/dom/LoadableScript.h >@@ -53,13 +53,13 @@ public: > > struct Error { > ErrorType type; >- std::optional<ConsoleMessage> consoleMessage; >+ Optional<ConsoleMessage> consoleMessage; > }; > > virtual ~LoadableScript() = default; > > virtual bool isLoaded() const = 0; >- virtual std::optional<Error> error() const = 0; >+ virtual Optional<Error> error() const = 0; > virtual bool wasCanceled() const = 0; > > virtual void execute(ScriptElement&) = 0; >diff --git a/Source/WebCore/dom/MessageEvent.cpp b/Source/WebCore/dom/MessageEvent.cpp >index a9ae6e931957ebed7221ecd1fd479b93e1d54c54..afb24e5b76bec8baead175f79d081111ccab0881 100644 >--- a/Source/WebCore/dom/MessageEvent.cpp >+++ b/Source/WebCore/dom/MessageEvent.cpp >@@ -48,7 +48,7 @@ inline MessageEvent::MessageEvent(const AtomicString& type, Init&& initializer, > { > } > >-inline MessageEvent::MessageEvent(DataType&& data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports) >+inline MessageEvent::MessageEvent(DataType&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports) > : Event(eventNames().messageEvent, CanBubble::No, IsCancelable::No) > , m_data(WTFMove(data)) > , m_origin(origin) >@@ -66,7 +66,7 @@ inline MessageEvent::MessageEvent(const AtomicString& type, Ref<SerializedScript > { > } > >-Ref<MessageEvent> MessageEvent::create(Vector<RefPtr<MessagePort>>&& ports, Ref<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source) >+Ref<MessageEvent> MessageEvent::create(Vector<RefPtr<MessagePort>>&& ports, Ref<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source) > { > return adoptRef(*new MessageEvent(WTFMove(data), origin, lastEventId, WTFMove(source), WTFMove(ports))); > } >@@ -103,7 +103,7 @@ Ref<MessageEvent> MessageEvent::create(const AtomicString& type, Init&& initiali > > MessageEvent::~MessageEvent() = default; > >-void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, JSValue data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports) >+void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, JSValue data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports) > { > if (isBeingDispatched()) > return; >diff --git a/Source/WebCore/dom/MessageEvent.h b/Source/WebCore/dom/MessageEvent.h >index e15dcc24bf4a83d3b55ba7c1404b9b311858feee..9216968263260d51047fcf62683abad24547187d 100644 >--- a/Source/WebCore/dom/MessageEvent.h >+++ b/Source/WebCore/dom/MessageEvent.h >@@ -47,7 +47,7 @@ using MessageEventSource = Variant<RefPtr<WindowProxy>, RefPtr<MessagePort>>; > > class MessageEvent final : public Event { > public: >- static Ref<MessageEvent> create(Vector<RefPtr<MessagePort>>&&, Ref<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, std::optional<MessageEventSource>&& source = std::nullopt); >+ static Ref<MessageEvent> create(Vector<RefPtr<MessagePort>>&&, Ref<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, Optional<MessageEventSource>&& source = WTF::nullopt); > static Ref<MessageEvent> create(const AtomicString& type, Ref<SerializedScriptValue>&&, const String& origin, const String& lastEventId); > static Ref<MessageEvent> create(const String& data, const String& origin = { }); > static Ref<MessageEvent> create(Ref<Blob>&& data, const String& origin); >@@ -58,18 +58,18 @@ public: > JSC::JSValue data; > String origin; > String lastEventId; >- std::optional<MessageEventSource> source; >+ Optional<MessageEventSource> source; > Vector<RefPtr<MessagePort>> ports; > }; > static Ref<MessageEvent> create(const AtomicString& type, Init&&, IsTrusted = IsTrusted::No); > > virtual ~MessageEvent(); > >- void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, JSC::JSValue data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&); >+ void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, JSC::JSValue data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&); > > const String& origin() const { return m_origin; } > const String& lastEventId() const { return m_lastEventId; } >- const std::optional<MessageEventSource>& source() const { return m_source; } >+ const Optional<MessageEventSource>& source() const { return m_source; } > const Vector<RefPtr<MessagePort>>& ports() const { return m_ports; } > > using DataType = Variant<JSValueInWrappedObject, Ref<SerializedScriptValue>, String, Ref<Blob>, Ref<ArrayBuffer>>; >@@ -82,14 +82,14 @@ private: > MessageEvent(); > MessageEvent(const AtomicString& type, Init&&, IsTrusted); > MessageEvent(const AtomicString& type, Ref<SerializedScriptValue>&& data, const String& origin, const String& lastEventId); >- MessageEvent(DataType&&, const String& origin, const String& lastEventId = { }, std::optional<MessageEventSource>&& = std::nullopt, Vector<RefPtr<MessagePort>>&& = { }); >+ MessageEvent(DataType&&, const String& origin, const String& lastEventId = { }, Optional<MessageEventSource>&& = WTF::nullopt, Vector<RefPtr<MessagePort>>&& = { }); > > EventInterface eventInterface() const final; > > DataType m_data; > String m_origin; > String m_lastEventId; >- std::optional<MessageEventSource> m_source; >+ Optional<MessageEventSource> m_source; > Vector<RefPtr<MessagePort>> m_ports; > > JSValueInWrappedObject m_cachedData; >diff --git a/Source/WebCore/dom/MessagePortIdentifier.h b/Source/WebCore/dom/MessagePortIdentifier.h >index f88a0494c0080aad90496bfe62e056cd4e74e24c..dfb055c0d1890ba156cc6cc24948feeb920f2a7c 100644 >--- a/Source/WebCore/dom/MessagePortIdentifier.h >+++ b/Source/WebCore/dom/MessagePortIdentifier.h >@@ -39,7 +39,7 @@ struct MessagePortIdentifier { > unsigned hash() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<MessagePortIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<MessagePortIdentifier> decode(Decoder&); > > #if !LOG_DISABLED > String logString() const; >@@ -58,17 +58,17 @@ void MessagePortIdentifier::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<MessagePortIdentifier> MessagePortIdentifier::decode(Decoder& decoder) >+Optional<MessagePortIdentifier> MessagePortIdentifier::decode(Decoder& decoder) > { >- std::optional<ProcessIdentifier> processIdentifier; >+ Optional<ProcessIdentifier> processIdentifier; > decoder >> processIdentifier; > if (!processIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ObjectIdentifier<PortIdentifierType>> portIdentifier; >+ Optional<ObjectIdentifier<PortIdentifierType>> portIdentifier; > decoder >> portIdentifier; > if (!portIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*processIdentifier), WTFMove(*portIdentifier) } }; > } >diff --git a/Source/WebCore/dom/MutationObserver.h b/Source/WebCore/dom/MutationObserver.h >index b0817f01fb52135019c8b0d804a92c5bbb66539d..d3825e28e2d0879d3bdb30ad674b8653a2cd8df1 100644 >--- a/Source/WebCore/dom/MutationObserver.h >+++ b/Source/WebCore/dom/MutationObserver.h >@@ -77,12 +77,12 @@ public: > > struct Init { > bool childList; >- std::optional<bool> attributes; >- std::optional<bool> characterData; >+ Optional<bool> attributes; >+ Optional<bool> characterData; > bool subtree; >- std::optional<bool> attributeOldValue; >- std::optional<bool> characterDataOldValue; >- std::optional<Vector<String>> attributeFilter; >+ Optional<bool> attributeOldValue; >+ Optional<bool> characterDataOldValue; >+ Optional<Vector<String>> attributeFilter; > }; > > ExceptionOr<void> observe(Node&, const Init&); >diff --git a/Source/WebCore/dom/ProcessingInstruction.cpp b/Source/WebCore/dom/ProcessingInstruction.cpp >index bb099bf20ec8b73218f50218fd1f9100431e3e8c..ace4acdafb67233d174897c783dd916102fbb597 100644 >--- a/Source/WebCore/dom/ProcessingInstruction.cpp >+++ b/Source/WebCore/dom/ProcessingInstruction.cpp >@@ -167,7 +167,7 @@ void ProcessingInstruction::checkStyleSheet() > #endif > { > String charset = attributes->get("charset"); >- CachedResourceRequest request(document().completeURL(href), CachedResourceLoader::defaultCachedResourceOptions(), std::nullopt, charset.isEmpty() ? document().charset() : WTFMove(charset)); >+ CachedResourceRequest request(document().completeURL(href), CachedResourceLoader::defaultCachedResourceOptions(), WTF::nullopt, charset.isEmpty() ? document().charset() : WTFMove(charset)); > > m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)).value_or(nullptr); > } >diff --git a/Source/WebCore/dom/RangeBoundaryPoint.h b/Source/WebCore/dom/RangeBoundaryPoint.h >index d85fa32dd434afef83498d3d70f3dc711d2c41c7..cffbef59ae86142de4fc034698316a9be0e8b857 100644 >--- a/Source/WebCore/dom/RangeBoundaryPoint.h >+++ b/Source/WebCore/dom/RangeBoundaryPoint.h >@@ -58,7 +58,7 @@ public: > > private: > RefPtr<Node> m_containerNode; >- mutable std::optional<unsigned> m_offsetInContainer { 0 }; >+ mutable Optional<unsigned> m_offsetInContainer { 0 }; > RefPtr<Node> m_childBeforeBoundary; > }; > >@@ -135,7 +135,7 @@ inline void RangeBoundaryPoint::setToBeforeChild(Node& child) > ASSERT(child.parentNode()); > m_childBeforeBoundary = child.previousSibling(); > m_containerNode = child.parentNode(); >- m_offsetInContainer = m_childBeforeBoundary ? std::nullopt : std::optional<unsigned>(0); >+ m_offsetInContainer = m_childBeforeBoundary ? WTF::nullopt : Optional<unsigned>(0); > } > > inline void RangeBoundaryPoint::setToAfterChild(Node& child) >@@ -143,7 +143,7 @@ inline void RangeBoundaryPoint::setToAfterChild(Node& child) > ASSERT(child.parentNode()); > m_childBeforeBoundary = &child; > m_containerNode = child.parentNode(); >- m_offsetInContainer = m_childBeforeBoundary ? std::nullopt : std::optional<unsigned>(0); >+ m_offsetInContainer = m_childBeforeBoundary ? WTF::nullopt : Optional<unsigned>(0); > } > > inline void RangeBoundaryPoint::setToStartOfNode(Ref<Node>&& container) >@@ -161,7 +161,7 @@ inline void RangeBoundaryPoint::setToEndOfNode(Ref<Node>&& container) > m_childBeforeBoundary = nullptr; > } else { > m_childBeforeBoundary = m_containerNode->lastChild(); >- m_offsetInContainer = m_childBeforeBoundary ? std::nullopt : std::optional<unsigned>(0); >+ m_offsetInContainer = m_childBeforeBoundary ? WTF::nullopt : Optional<unsigned>(0); > } > } > >@@ -177,7 +177,7 @@ inline void RangeBoundaryPoint::childBeforeWillBeRemoved() > > inline void RangeBoundaryPoint::invalidateOffset() const > { >- m_offsetInContainer = std::nullopt; >+ m_offsetInContainer = WTF::nullopt; > } > > inline bool operator==(const RangeBoundaryPoint& a, const RangeBoundaryPoint& b) >diff --git a/Source/WebCore/dom/ScriptElement.cpp b/Source/WebCore/dom/ScriptElement.cpp >index 488ab8e1ddba6c7dd1dbad2c98c0cdc790d287e0..6a3fed430b317ea0586845b0c411e697e3ea6dec 100644 >--- a/Source/WebCore/dom/ScriptElement.cpp >+++ b/Source/WebCore/dom/ScriptElement.cpp >@@ -128,7 +128,7 @@ void ScriptElement::dispatchErrorEvent() > m_element.dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No)); > } > >-std::optional<ScriptElement::ScriptType> ScriptElement::determineScriptType(LegacyTypeSupport supportLegacyTypes) const >+Optional<ScriptElement::ScriptType> ScriptElement::determineScriptType(LegacyTypeSupport supportLegacyTypes) const > { > // FIXME: isLegacySupportedJavaScriptLanguage() is not valid HTML5. It is used here to maintain backwards compatibility with existing layout tests. The specific violations are: > // - Allowing type=javascript. type= should only support MIME types, such as text/javascript. >@@ -142,7 +142,7 @@ std::optional<ScriptElement::ScriptType> ScriptElement::determineScriptType(Lega > return ScriptType::Classic; > if (isLegacySupportedJavaScriptLanguage(language)) > return ScriptType::Classic; >- return std::nullopt; >+ return WTF::nullopt; > } > if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSpace())) > return ScriptType::Classic; >@@ -154,13 +154,13 @@ std::optional<ScriptElement::ScriptType> ScriptElement::determineScriptType(Lega > // Once "defer" is implemented, we can reconsider enabling modules in XHTML. > // https://bugs.webkit.org/show_bug.cgi?id=123387 > if (!m_element.document().isHTMLDocument()) >- return std::nullopt; >+ return WTF::nullopt; > > // https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type > // Setting the attribute to an ASCII case-insensitive match for the string "module" means that the script is a module script. > if (equalLettersIgnoringASCIICase(type, "module")) > return ScriptType::Module; >- return std::nullopt; >+ return WTF::nullopt; > } > > // http://dev.w3.org/html5/spec/Overview.html#prepare-a-script >@@ -187,7 +187,7 @@ bool ScriptElement::prepareScript(const TextPosition& scriptStartPosition, Legac > return false; > > ScriptType scriptType = ScriptType::Classic; >- if (std::optional<ScriptType> result = determineScriptType(supportLegacyTypes)) >+ if (Optional<ScriptType> result = determineScriptType(supportLegacyTypes)) > scriptType = result.value(); > else > return false; >@@ -417,8 +417,8 @@ void ScriptElement::dispatchLoadEventRespectingUserGestureIndicator() > > void ScriptElement::executeScriptAndDispatchEvent(LoadableScript& loadableScript) > { >- if (std::optional<LoadableScript::Error> error = loadableScript.error()) { >- if (std::optional<LoadableScript::ConsoleMessage> message = error->consoleMessage) >+ if (Optional<LoadableScript::Error> error = loadableScript.error()) { >+ if (Optional<LoadableScript::ConsoleMessage> message = error->consoleMessage) > m_element.document().addConsoleMessage(message->source, message->level, message->message); > dispatchErrorEvent(); > } else if (!loadableScript.wasCanceled()) { >diff --git a/Source/WebCore/dom/ScriptElement.h b/Source/WebCore/dom/ScriptElement.h >index 62454e793cb1334f64ccf3be2095d33ca9a72c8a..ac1d7d4dff880fb32ab641d1659b1d422f96ecca 100644 >--- a/Source/WebCore/dom/ScriptElement.h >+++ b/Source/WebCore/dom/ScriptElement.h >@@ -95,7 +95,7 @@ protected: > private: > void executeScriptAndDispatchEvent(LoadableScript&); > >- std::optional<ScriptType> determineScriptType(LegacyTypeSupport) const; >+ Optional<ScriptType> determineScriptType(LegacyTypeSupport) const; > bool ignoresLoadRequest() const; > bool isScriptForEventSupported() const; > void dispatchLoadEventRespectingUserGestureIndicator(); >diff --git a/Source/WebCore/dom/SuccessOr.h b/Source/WebCore/dom/SuccessOr.h >index 65a30591bf9a0114788a564303a87fe796b056e4..b0b3e0560d88649c8bfe408d5d24919fa181439e 100644 >--- a/Source/WebCore/dom/SuccessOr.h >+++ b/Source/WebCore/dom/SuccessOr.h >@@ -30,12 +30,12 @@ > namespace WebCore { > > template <typename T> >-class SuccessOr : public std::optional<T> { >+class SuccessOr : public Optional<T> { > public: >- SuccessOr() : std::optional<T>() { } >- SuccessOr(T&& error) : std::optional<T>(error) { } >+ SuccessOr() : Optional<T>() { } >+ SuccessOr(T&& error) : Optional<T>(error) { } > >- explicit constexpr operator bool() const { return !std::optional<T>::operator bool(); } >+ explicit constexpr operator bool() const { return !Optional<T>::operator bool(); } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/dom/TextDecoder.cpp b/Source/WebCore/dom/TextDecoder.cpp >index 159a285a3b4dadf3dc034bb232037d6e72054aa6..286c4a8b661ed3659fc9651212149d876466c0e6 100644 >--- a/Source/WebCore/dom/TextDecoder.cpp >+++ b/Source/WebCore/dom/TextDecoder.cpp >@@ -90,9 +90,9 @@ static size_t codeUnitByteSize(const TextEncoding& encoding) > return encoding.isByteBasedEncoding() ? 1 : 2; > } > >-ExceptionOr<String> TextDecoder::decode(std::optional<BufferSource::VariantType> input, DecodeOptions options) >+ExceptionOr<String> TextDecoder::decode(Optional<BufferSource::VariantType> input, DecodeOptions options) > { >- std::optional<BufferSource> inputBuffer; >+ Optional<BufferSource> inputBuffer; > const uint8_t* data = nullptr; > size_t length = 0; > if (input) { >diff --git a/Source/WebCore/dom/TextDecoder.h b/Source/WebCore/dom/TextDecoder.h >index e4201243a554cdab80137437f380c9fe405dd44b..ac3dd1e055bdff31c2f8fc72033c96425dda3e3e 100644 >--- a/Source/WebCore/dom/TextDecoder.h >+++ b/Source/WebCore/dom/TextDecoder.h >@@ -49,7 +49,7 @@ public: > String encoding() const; > bool fatal() const { return m_options.fatal; } > bool ignoreBOM() const { return m_options.ignoreBOM; } >- ExceptionOr<String> decode(std::optional<BufferSource::VariantType>, DecodeOptions); >+ ExceptionOr<String> decode(Optional<BufferSource::VariantType>, DecodeOptions); > > private: > String prependBOMIfNecessary(const String&); >diff --git a/Source/WebCore/dom/TreeScope.cpp b/Source/WebCore/dom/TreeScope.cpp >index 828138f662580277200b42ed3b3952ac4ff4a292..7ba3578a4f74efa7429ad65983f1d15ea703c352 100644 >--- a/Source/WebCore/dom/TreeScope.cpp >+++ b/Source/WebCore/dom/TreeScope.cpp >@@ -312,21 +312,21 @@ HTMLLabelElement* TreeScope::labelElementForId(const AtomicString& forAttributeV > return m_labelsByForAttribute->getElementByLabelForAttribute(*forAttributeValue.impl(), *this); > } > >-static std::optional<LayoutPoint> absolutePointIfNotClipped(Document& document, const LayoutPoint& clientPoint) >+static Optional<LayoutPoint> absolutePointIfNotClipped(Document& document, const LayoutPoint& clientPoint) > { > if (!document.frame() || !document.view()) >- return std::nullopt; >+ return WTF::nullopt; > > const auto& settings = document.frame()->settings(); > if (settings.visualViewportEnabled() && settings.clientCoordinatesRelativeToLayoutViewport()) { > document.updateLayout(); > if (!document.view() || !document.hasLivingRenderTree()) >- return std::nullopt; >+ return WTF::nullopt; > auto* view = document.view(); > FloatPoint layoutViewportPoint = view->clientToLayoutViewportPoint(clientPoint); > FloatRect layoutViewportBounds({ }, view->layoutViewportRect().size()); > if (!layoutViewportBounds.contains(layoutViewportPoint)) >- return std::nullopt; >+ return WTF::nullopt; > return LayoutPoint(view->layoutViewportToAbsolutePoint(layoutViewportPoint)); > } > >@@ -346,7 +346,7 @@ static std::optional<LayoutPoint> absolutePointIfNotClipped(Document& document, > #endif > if (visibleRect.contains(absolutePoint)) > return absolutePoint; >- return std::nullopt; >+ return WTF::nullopt; > } > > Node* TreeScope::nodeFromPoint(const LayoutPoint& clientPoint, LayoutPoint* localPoint) >diff --git a/Source/WebCore/dom/UserGestureIndicator.cpp b/Source/WebCore/dom/UserGestureIndicator.cpp >index 23c936f91b139a4e17ccd22b5cdf7d97815c9217..d1685b9ae5f2c85349639de387340e99c4925b02 100644 >--- a/Source/WebCore/dom/UserGestureIndicator.cpp >+++ b/Source/WebCore/dom/UserGestureIndicator.cpp >@@ -46,7 +46,7 @@ UserGestureToken::~UserGestureToken() > observer(*this); > } > >-UserGestureIndicator::UserGestureIndicator(std::optional<ProcessingUserGestureState> state, Document* document, UserGestureType gestureType, ProcessInteractionStyle processInteractionStyle) >+UserGestureIndicator::UserGestureIndicator(Optional<ProcessingUserGestureState> state, Document* document, UserGestureType gestureType, ProcessInteractionStyle processInteractionStyle) > : m_previousToken { currentToken() } > { > ASSERT(isMainThread()); >diff --git a/Source/WebCore/dom/UserGestureIndicator.h b/Source/WebCore/dom/UserGestureIndicator.h >index cf8e393b863f7e4993cd20a23f9ae8552539e7ca..011272007b157a049ced7bc49a3c96931832aaac 100644 >--- a/Source/WebCore/dom/UserGestureIndicator.h >+++ b/Source/WebCore/dom/UserGestureIndicator.h >@@ -85,7 +85,7 @@ public: > > // If a document is provided, its last known user gesture timestamp is updated. > enum class ProcessInteractionStyle { Immediate, Delayed }; >- WEBCORE_EXPORT explicit UserGestureIndicator(std::optional<ProcessingUserGestureState>, Document* = nullptr, UserGestureType = UserGestureType::Other, ProcessInteractionStyle = ProcessInteractionStyle::Immediate); >+ WEBCORE_EXPORT explicit UserGestureIndicator(Optional<ProcessingUserGestureState>, Document* = nullptr, UserGestureType = UserGestureType::Other, ProcessInteractionStyle = ProcessInteractionStyle::Immediate); > WEBCORE_EXPORT explicit UserGestureIndicator(RefPtr<UserGestureToken>); > WEBCORE_EXPORT ~UserGestureIndicator(); > >diff --git a/Source/WebCore/dom/WheelEvent.cpp b/Source/WebCore/dom/WheelEvent.cpp >index f5b1251810a72ff55fd554ef8bf0715f18a2c761..37e07104463a4d3766c34980c79a3da922db7c1f 100644 >--- a/Source/WebCore/dom/WheelEvent.cpp >+++ b/Source/WebCore/dom/WheelEvent.cpp >@@ -87,7 +87,7 @@ void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, RefPtr<Windo > > m_deltaMode = DOM_DELTA_PIXEL; > >- m_underlyingPlatformEvent = std::nullopt; >+ m_underlyingPlatformEvent = WTF::nullopt; > } > > EventInterface WheelEvent::eventInterface() const >diff --git a/Source/WebCore/dom/WheelEvent.h b/Source/WebCore/dom/WheelEvent.h >index 66997dff3be12338a69a301fa8c5c50c378433a1..366157e9d32845a82cf54cc76786211f60b3c422 100644 >--- a/Source/WebCore/dom/WheelEvent.h >+++ b/Source/WebCore/dom/WheelEvent.h >@@ -55,7 +55,7 @@ public: > > WEBCORE_EXPORT void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, RefPtr<WindowProxy>&&, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); > >- const std::optional<PlatformWheelEvent>& underlyingPlatformEvent() const { return m_underlyingPlatformEvent; } >+ const Optional<PlatformWheelEvent>& underlyingPlatformEvent() const { return m_underlyingPlatformEvent; } > > double deltaX() const { return m_deltaX; } // Positive when scrolling right. > double deltaY() const { return m_deltaY; } // Positive when scrolling down. >@@ -86,7 +86,7 @@ private: > double m_deltaY { 0 }; > double m_deltaZ { 0 }; > unsigned m_deltaMode { DOM_DELTA_PIXEL }; >- std::optional<PlatformWheelEvent> m_underlyingPlatformEvent; >+ Optional<PlatformWheelEvent> m_underlyingPlatformEvent; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/dom/messageports/MessagePortChannel.cpp b/Source/WebCore/dom/messageports/MessagePortChannel.cpp >index bb4b08d6ad87a24eff89f11fdeeaff58dbeeec08..9cf54974cc5a4c222605d0d0d2af4132c94ff181 100644 >--- a/Source/WebCore/dom/messageports/MessagePortChannel.cpp >+++ b/Source/WebCore/dom/messageports/MessagePortChannel.cpp >@@ -60,7 +60,7 @@ MessagePortChannel::~MessagePortChannel() > m_registry.messagePortChannelDestroyed(*this); > } > >-std::optional<ProcessIdentifier> MessagePortChannel::processForPort(const MessagePortIdentifier& port) >+Optional<ProcessIdentifier> MessagePortChannel::processForPort(const MessagePortIdentifier& port) > { > ASSERT(isMainThread()); > ASSERT(port == m_ports[0] || port == m_ports[1]); >@@ -100,7 +100,7 @@ void MessagePortChannel::disentanglePort(const MessagePortIdentifier& port) > size_t i = port == m_ports[0] ? 0 : 1; > > ASSERT(m_processes[i] || m_isClosed[i]); >- m_processes[i] = std::nullopt; >+ m_processes[i] = WTF::nullopt; > m_pendingMessagePortTransfers[i].add(this); > > // This set of steps is to guarantee that the lock is unlocked before the >@@ -115,7 +115,7 @@ void MessagePortChannel::closePort(const MessagePortIdentifier& port) > ASSERT(port == m_ports[0] || port == m_ports[1]); > size_t i = port == m_ports[0] ? 0 : 1; > >- m_processes[i] = std::nullopt; >+ m_processes[i] = WTF::nullopt; > m_isClosed[i] = true; > > // This set of steps is to guarantee that the lock is unlocked before the >diff --git a/Source/WebCore/dom/messageports/MessagePortChannel.h b/Source/WebCore/dom/messageports/MessagePortChannel.h >index 88224340417755abebbded57d014050dbc5053f5..15e9c681eedaa0e43bfdb1325f441deb076adbc8 100644 >--- a/Source/WebCore/dom/messageports/MessagePortChannel.h >+++ b/Source/WebCore/dom/messageports/MessagePortChannel.h >@@ -46,7 +46,7 @@ public: > const MessagePortIdentifier& port1() const { return m_ports[0]; } > const MessagePortIdentifier& port2() const { return m_ports[1]; } > >- WEBCORE_EXPORT std::optional<ProcessIdentifier> processForPort(const MessagePortIdentifier&); >+ WEBCORE_EXPORT Optional<ProcessIdentifier> processForPort(const MessagePortIdentifier&); > bool includesPort(const MessagePortIdentifier&); > void entanglePortWithProcess(const MessagePortIdentifier&, ProcessIdentifier); > void disentanglePort(const MessagePortIdentifier&); >@@ -69,7 +69,7 @@ private: > > MessagePortIdentifier m_ports[2]; > bool m_isClosed[2] { false, false }; >- std::optional<ProcessIdentifier> m_processes[2]; >+ Optional<ProcessIdentifier> m_processes[2]; > RefPtr<MessagePortChannel> m_entangledToProcessProtectors[2]; > Vector<MessageWithMessagePorts> m_pendingMessages[2]; > HashSet<RefPtr<MessagePortChannel>> m_pendingMessagePortTransfers[2]; >diff --git a/Source/WebCore/dom/messageports/MessageWithMessagePorts.h b/Source/WebCore/dom/messageports/MessageWithMessagePorts.h >index 8dedf4ed88f0e9d415ca476f06d4c6f1c5b0d85a..a39075759e9964a5e38a1e8c83c5735d2ad501fe 100644 >--- a/Source/WebCore/dom/messageports/MessageWithMessagePorts.h >+++ b/Source/WebCore/dom/messageports/MessageWithMessagePorts.h >@@ -40,7 +40,7 @@ struct MessageWithMessagePorts { > TransferredMessagePortArray transferredPorts; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<MessageWithMessagePorts> decode(Decoder&); >+ template<class Decoder> static Optional<MessageWithMessagePorts> decode(Decoder&); > }; > > >@@ -52,16 +52,16 @@ void MessageWithMessagePorts::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<MessageWithMessagePorts> MessageWithMessagePorts::decode(Decoder& decoder) >+Optional<MessageWithMessagePorts> MessageWithMessagePorts::decode(Decoder& decoder) > { > MessageWithMessagePorts result; > > result.message = SerializedScriptValue::decode(decoder); > if (!result.message) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.transferredPorts)) >- return std::nullopt; >+ return WTF::nullopt; > > return result; > } >diff --git a/Source/WebCore/editing/ChangeListTypeCommand.cpp b/Source/WebCore/editing/ChangeListTypeCommand.cpp >index 297f218c47274b89fb53dc18689e5443390a7178..2bc04d0495aba388858c3e825a2ee3d2d20050c3 100644 >--- a/Source/WebCore/editing/ChangeListTypeCommand.cpp >+++ b/Source/WebCore/editing/ChangeListTypeCommand.cpp >@@ -35,7 +35,7 @@ > > namespace WebCore { > >-static std::optional<std::pair<ChangeListTypeCommand::Type, Ref<HTMLElement>>> listConversionTypeForSelection(const VisibleSelection& selection) >+static Optional<std::pair<ChangeListTypeCommand::Type, Ref<HTMLElement>>> listConversionTypeForSelection(const VisibleSelection& selection) > { > RefPtr<HTMLElement> listToReplace; > auto commonAncestor = makeRefPtr(Range::commonAncestorContainer(selection.start().containerNode(), selection.end().containerNode())); >@@ -50,16 +50,16 @@ static std::optional<std::pair<ChangeListTypeCommand::Type, Ref<HTMLElement>>> l > if (is<HTMLOListElement>(listToReplace)) > return {{ ChangeListTypeCommand::Type::ConvertToUnorderedList, listToReplace.releaseNonNull() }}; > >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<ChangeListTypeCommand::Type> ChangeListTypeCommand::listConversionType(Document& document) >+Optional<ChangeListTypeCommand::Type> ChangeListTypeCommand::listConversionType(Document& document) > { > if (auto frame = makeRefPtr(document.frame())) { > if (auto typeAndElement = listConversionTypeForSelection(frame->selection().selection())) > return typeAndElement->first; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > Ref<HTMLElement> ChangeListTypeCommand::createNewList(const HTMLElement& listToReplace) >diff --git a/Source/WebCore/editing/ChangeListTypeCommand.h b/Source/WebCore/editing/ChangeListTypeCommand.h >index eae3c55995466e553651a8cbd635361f7c91fc62..bb96132345b5139ae528c88f5683b86f4dec6a17 100644 >--- a/Source/WebCore/editing/ChangeListTypeCommand.h >+++ b/Source/WebCore/editing/ChangeListTypeCommand.h >@@ -39,7 +39,7 @@ class HTMLElement; > class ChangeListTypeCommand final : public CompositeEditCommand { > public: > enum class Type : uint8_t { ConvertToOrderedList, ConvertToUnorderedList }; >- static std::optional<Type> listConversionType(Document&); >+ static Optional<Type> listConversionType(Document&); > static Ref<ChangeListTypeCommand> create(Document& document, Type type) > { > return adoptRef(*new ChangeListTypeCommand(document, type)); >diff --git a/Source/WebCore/editing/CompositeEditCommand.cpp b/Source/WebCore/editing/CompositeEditCommand.cpp >index ac1f2710dc711844b1b3137a934264cb5c1db083..c0e5c9ce757f567aca9622aa882713e5f5a881e1 100644 >--- a/Source/WebCore/editing/CompositeEditCommand.cpp >+++ b/Source/WebCore/editing/CompositeEditCommand.cpp >@@ -1518,11 +1518,11 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap > } > } > >-std::optional<VisibleSelection> CompositeEditCommand::shouldBreakOutOfEmptyListItem() const >+Optional<VisibleSelection> CompositeEditCommand::shouldBreakOutOfEmptyListItem() const > { > auto emptyListItem = enclosingEmptyListItem(endingSelection().visibleStart()); > if (!emptyListItem) >- return std::nullopt; >+ return WTF::nullopt; > > auto listNode = emptyListItem->parentNode(); > // FIXME: Can't we do something better when the immediate parent wasn't a list node? >@@ -1530,7 +1530,7 @@ std::optional<VisibleSelection> CompositeEditCommand::shouldBreakOutOfEmptyListI > || (!listNode->hasTagName(ulTag) && !listNode->hasTagName(olTag)) > || !listNode->hasEditableStyle() > || listNode == emptyListItem->rootEditableElement()) >- return std::nullopt; >+ return WTF::nullopt; > > return VisibleSelection(endingSelection().start().previous(BackwardDeletion), endingSelection().end()); > } >diff --git a/Source/WebCore/editing/CompositeEditCommand.h b/Source/WebCore/editing/CompositeEditCommand.h >index 4a424a1924fcaa9c664c8c75e5b79feac1f64d0a..2da520fdc4649292dc7bfca20b7d11b118c5da1c 100644 >--- a/Source/WebCore/editing/CompositeEditCommand.h >+++ b/Source/WebCore/editing/CompositeEditCommand.h >@@ -199,7 +199,7 @@ protected: > void cloneParagraphUnderNewElement(const Position& start, const Position& end, Node* outerNode, Element* blockElement); > void cleanupAfterDeletion(VisiblePosition destination = VisiblePosition()); > >- std::optional<VisibleSelection> shouldBreakOutOfEmptyListItem() const; >+ Optional<VisibleSelection> shouldBreakOutOfEmptyListItem() const; > bool breakOutOfEmptyListItem(); > bool breakOutOfEmptyMailBlockquotedParagraph(); > >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 69c16a94dd9dbd83a09d0e6df33ca83d8b32f954..8ce5854c22959c31bfab07ec32043ac3cc53f7f9 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -198,7 +198,7 @@ using namespace HTMLNames; > using namespace WTF; > using namespace Unicode; > >-TemporarySelectionChange::TemporarySelectionChange(Frame& frame, std::optional<VisibleSelection> temporarySelection, OptionSet<TemporarySelectionOption> options) >+TemporarySelectionChange::TemporarySelectionChange(Frame& frame, Optional<VisibleSelection> temporarySelection, OptionSet<TemporarySelectionOption> options) > : m_frame(frame) > , m_options(options) > , m_wasIgnoringSelectionChanges(frame.editor().ignoreSelectionChanges()) >@@ -4090,7 +4090,7 @@ void Editor::notifyClientOfAttachmentUpdates() > } > } > >-void Editor::insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType) >+void Editor::insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType) > { > auto attachment = HTMLAttachmentElement::create(HTMLNames::attachmentTag, document()); > attachment->setUniqueIdentifier(identifier); >diff --git a/Source/WebCore/editing/Editor.h b/Source/WebCore/editing/Editor.h >index 87b684f903a33fddb66304cf13486f9c84045bd4..7cad22098526006f9cc89c1ce0e279422ec7385f 100644 >--- a/Source/WebCore/editing/Editor.h >+++ b/Source/WebCore/editing/Editor.h >@@ -115,7 +115,7 @@ enum class TemporarySelectionOption : uint8_t { > > class TemporarySelectionChange { > public: >- TemporarySelectionChange(Frame&, std::optional<VisibleSelection> = std::nullopt, OptionSet<TemporarySelectionOption> = { }); >+ TemporarySelectionChange(Frame&, Optional<VisibleSelection> = WTF::nullopt, OptionSet<TemporarySelectionOption> = { }); > ~TemporarySelectionChange(); > > private: >@@ -127,7 +127,7 @@ private: > #if PLATFORM(IOS_FAMILY) > bool m_appearanceUpdatesWereEnabled; > #endif >- std::optional<VisibleSelection> m_selectionToRestore; >+ Optional<VisibleSelection> m_selectionToRestore; > }; > > class Editor { >@@ -518,7 +518,7 @@ public: > bool isGettingDictionaryPopupInfo() const { return m_isGettingDictionaryPopupInfo; } > > #if ENABLE(ATTACHMENT_ELEMENT) >- WEBCORE_EXPORT void insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType); >+ WEBCORE_EXPORT void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType); > void registerAttachmentIdentifier(const String&, const String& contentType, const String& preferredFileName, Ref<SharedBuffer>&& fileData); > void registerAttachments(Vector<SerializedAttachmentData>&&); > void registerAttachmentIdentifier(const String&, const String& contentType, const String& filePath); >diff --git a/Source/WebCore/editing/FontAttributeChanges.h b/Source/WebCore/editing/FontAttributeChanges.h >index 45d768c332120c895d895dbd8f2dc5d37fb62148..24f82b85dbcfa4cf2a76b43df342cc9ca136014c 100644 >--- a/Source/WebCore/editing/FontAttributeChanges.h >+++ b/Source/WebCore/editing/FontAttributeChanges.h >@@ -63,10 +63,10 @@ private: > > String m_fontName; > String m_fontFamily; >- std::optional<double> m_fontSize; >- std::optional<double> m_fontSizeDelta; >- std::optional<bool> m_bold; >- std::optional<bool> m_italic; >+ Optional<double> m_fontSize; >+ Optional<double> m_fontSizeDelta; >+ Optional<bool> m_bold; >+ Optional<bool> m_italic; > }; > > class FontAttributeChanges { >@@ -86,12 +86,12 @@ public: > WEBCORE_EXPORT EditAction editAction() const; > > private: >- std::optional<VerticalAlignChange> m_verticalAlign; >- std::optional<Color> m_backgroundColor; >- std::optional<Color> m_foregroundColor; >- std::optional<FontShadow> m_shadow; >- std::optional<bool> m_strikeThrough; >- std::optional<bool> m_underline; >+ Optional<VerticalAlignChange> m_verticalAlign; >+ Optional<Color> m_backgroundColor; >+ Optional<Color> m_foregroundColor; >+ Optional<FontShadow> m_shadow; >+ Optional<bool> m_strikeThrough; >+ Optional<bool> m_underline; > FontChanges m_fontChanges; > }; > >diff --git a/Source/WebCore/editing/FontAttributes.h b/Source/WebCore/editing/FontAttributes.h >index 728b219242ed26933e1121bcaa552035e3a132c8..83f264e09b1da3a6d0dc2db0ad43c5c3572395d7 100644 >--- a/Source/WebCore/editing/FontAttributes.h >+++ b/Source/WebCore/editing/FontAttributes.h >@@ -42,7 +42,7 @@ struct TextList { > bool ordered { false }; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<TextList> decode(Decoder&); >+ template<class Decoder> static Optional<TextList> decode(Decoder&); > > #if PLATFORM(COCOA) > RetainPtr<NSTextList> createTextList() const; >@@ -54,22 +54,22 @@ template<class Encoder> inline void TextList::encode(Encoder& encoder) const > encoder << static_cast<uint8_t>(style) << startingItemNumber << ordered; > } > >-template<class Decoder> inline std::optional<TextList> TextList::decode(Decoder& decoder) >+template<class Decoder> inline Optional<TextList> TextList::decode(Decoder& decoder) > { >- std::optional<uint8_t> style; >+ Optional<uint8_t> style; > decoder >> style; > if (!style) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> startingItemNumber; >+ Optional<int> startingItemNumber; > decoder >> startingItemNumber; > if (!startingItemNumber) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> ordered; >+ Optional<bool> ordered; > decoder >> ordered; > if (!ordered) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ static_cast<ListStyleType>(WTFMove(*style)), WTFMove(*startingItemNumber), WTFMove(*ordered) }}; > } >diff --git a/Source/WebCore/editing/TextCheckingHelper.h b/Source/WebCore/editing/TextCheckingHelper.h >index 1e8c9faa35405f03348ea6ca014bf7795a992fba..ca712805004ba067896a7912ab07e6a980e9e99f 100644 >--- a/Source/WebCore/editing/TextCheckingHelper.h >+++ b/Source/WebCore/editing/TextCheckingHelper.h >@@ -75,11 +75,11 @@ private: > mutable RefPtr<Range> m_paragraphRange; > mutable RefPtr<Range> m_offsetAsRange; > mutable String m_text; >- mutable std::optional<int> m_checkingStart; >- mutable std::optional<int> m_checkingEnd; >- mutable std::optional<int> m_checkingLength; >- mutable std::optional<int> m_automaticReplacementStart; >- mutable std::optional<int> m_automaticReplacementLength; >+ mutable Optional<int> m_checkingStart; >+ mutable Optional<int> m_checkingEnd; >+ mutable Optional<int> m_checkingLength; >+ mutable Optional<int> m_automaticReplacementStart; >+ mutable Optional<int> m_automaticReplacementLength; > }; > > class TextCheckingHelper { >diff --git a/Source/WebCore/editing/VisibleUnits.cpp b/Source/WebCore/editing/VisibleUnits.cpp >index 3950361bbad5914dddd32343ba788b3017479c41..f4f9d50ed1205f88454b6e86a4a1bff4c4da21bf 100644 >--- a/Source/WebCore/editing/VisibleUnits.cpp >+++ b/Source/WebCore/editing/VisibleUnits.cpp >@@ -360,7 +360,7 @@ static VisiblePosition visualWordPosition(const VisiblePosition& visiblePosition > TextDirection blockDirection = directionOfEnclosingBlock(visiblePosition.deepEquivalent()); > InlineBox* previouslyVisitedBox = nullptr; > VisiblePosition current = visiblePosition; >- std::optional<VisiblePosition> previousPosition; >+ Optional<VisiblePosition> previousPosition; > UBreakIterator* iter = nullptr; > > CachedLogicallyOrderedLeafBoxes leafBoxes; >diff --git a/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm b/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >index e7c781e626396713e2bdbffe64b338834718bdad..97217f1d75d0e546fcf8431e2d4af8ba543ab61c 100644 >--- a/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >+++ b/Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm >@@ -442,19 +442,19 @@ struct MarkupAndArchive { > Ref<Archive> archive; > }; > >-static std::optional<MarkupAndArchive> extractMarkupAndArchive(SharedBuffer& buffer, const std::function<bool(const String)>& canShowMIMETypeAsHTML) >+static Optional<MarkupAndArchive> extractMarkupAndArchive(SharedBuffer& buffer, const std::function<bool(const String)>& canShowMIMETypeAsHTML) > { > auto archive = LegacyWebArchive::create(URL(), buffer); > if (!archive) >- return std::nullopt; >+ return WTF::nullopt; > > RefPtr<ArchiveResource> mainResource = archive->mainResource(); > if (!mainResource) >- return std::nullopt; >+ return WTF::nullopt; > > auto type = mainResource->mimeType(); > if (!canShowMIMETypeAsHTML(type)) >- return std::nullopt; >+ return WTF::nullopt; > > return MarkupAndArchive { String::fromUTF8(mainResource->data().data(), mainResource->data().size()), mainResource.releaseNonNull(), archive.releaseNonNull() }; > } >@@ -727,7 +727,7 @@ static Ref<HTMLElement> attachmentForFilePath(Frame& frame, const String& path) > } > > String contentType; >- std::optional<uint64_t> fileSizeForDisplay; >+ Optional<uint64_t> fileSizeForDisplay; > if (FileSystem::fileIsDirectory(path, FileSystem::ShouldFollowSymbolicLinks::Yes)) > contentType = kUTTypeDirectory; > else { >diff --git a/Source/WebCore/editing/ios/AutofillElements.cpp b/Source/WebCore/editing/ios/AutofillElements.cpp >index 75b1a04d47211c5ba229b2923ca5c85cb2cbbd1f..cb1d7aeb6f444c5bc1159ae7e523e150791e4de7 100644 >--- a/Source/WebCore/editing/ios/AutofillElements.cpp >+++ b/Source/WebCore/editing/ios/AutofillElements.cpp >@@ -78,17 +78,17 @@ AutofillElements::AutofillElements(RefPtr<HTMLInputElement>&& username, RefPtr<H > { > } > >-std::optional<AutofillElements> AutofillElements::computeAutofillElements(Ref<HTMLInputElement> start) >+Optional<AutofillElements> AutofillElements::computeAutofillElements(Ref<HTMLInputElement> start) > { > if (!start->document().page()) >- return std::nullopt; >+ return WTF::nullopt; > FocusController& focusController = start->document().page()->focusController(); > if (start->isPasswordField()) { > RefPtr<HTMLInputElement> previousElement = previousAutofillableElement(start.ptr(), focusController); > RefPtr<HTMLInputElement> nextElement = nextAutofillableElement(start.ptr(), focusController); > bool hasDuplicatePasswordElements = (nextElement && nextElement->isPasswordField()) || (previousElement && previousElement->isPasswordField()); > if (hasDuplicatePasswordElements) >- return std::nullopt; >+ return WTF::nullopt; > > if (previousElement && is<HTMLInputElement>(*previousElement)) { > if (previousElement->isTextField()) >@@ -101,7 +101,7 @@ std::optional<AutofillElements> AutofillElements::computeAutofillElements(Ref<HT > RefPtr<HTMLInputElement> elementAfternextElement = nextAutofillableElement(nextElement.get(), focusController); > bool hasDuplicatePasswordElements = elementAfternextElement && elementAfternextElement->isPasswordField(); > if (hasDuplicatePasswordElements) >- return std::nullopt; >+ return WTF::nullopt; > > return AutofillElements(WTFMove(start), WTFMove(nextElement)); > } >@@ -114,7 +114,7 @@ std::optional<AutofillElements> AutofillElements::computeAutofillElements(Ref<HT > if (!previousElement && !nextElement) > return AutofillElements(nullptr, start.ptr()); > } >- return std::nullopt; >+ return WTF::nullopt; > } > > void AutofillElements::autofill(String username, String password) >diff --git a/Source/WebCore/editing/ios/AutofillElements.h b/Source/WebCore/editing/ios/AutofillElements.h >index bce5e08274b154816069a231333f7ff2bb5b038b..870e386279271c3004cdbb01adfc41bfde7d47b7 100644 >--- a/Source/WebCore/editing/ios/AutofillElements.h >+++ b/Source/WebCore/editing/ios/AutofillElements.h >@@ -30,7 +30,7 @@ namespace WebCore { > class AutofillElements { > WTF_MAKE_FAST_ALLOCATED; > public: >- WEBCORE_EXPORT static std::optional<AutofillElements> computeAutofillElements(Ref<HTMLInputElement>); >+ WEBCORE_EXPORT static Optional<AutofillElements> computeAutofillElements(Ref<HTMLInputElement>); > WEBCORE_EXPORT void autofill(String, String); > > const HTMLInputElement* username() const { return m_username.get(); } >diff --git a/Source/WebCore/editing/markup.cpp b/Source/WebCore/editing/markup.cpp >index 795b12d0e63b015a9f559ac72f8b61aabda19834..31e18a51c8bbb49ea14647ff441c5470ae2904ab 100644 >--- a/Source/WebCore/editing/markup.cpp >+++ b/Source/WebCore/editing/markup.cpp >@@ -199,7 +199,7 @@ std::unique_ptr<Page> createPageForSanitizingWebContent() > return page; > } > >-String sanitizeMarkup(const String& rawHTML, MSOListQuirks msoListQuirks, std::optional<WTF::Function<void(DocumentFragment&)>> fragmentSanitizer) >+String sanitizeMarkup(const String& rawHTML, MSOListQuirks msoListQuirks, Optional<WTF::Function<void(DocumentFragment&)>> fragmentSanitizer) > { > auto page = createPageForSanitizingWebContent(); > Document* stagingDocument = page->mainFrame().document(); >diff --git a/Source/WebCore/editing/markup.h b/Source/WebCore/editing/markup.h >index 22486ce2c8ad5ecd574b2814d0fbccfd24278781..f22a464f902ab649ff4f654049f8a732bd808512 100644 >--- a/Source/WebCore/editing/markup.h >+++ b/Source/WebCore/editing/markup.h >@@ -52,7 +52,7 @@ void removeSubresourceURLAttributes(Ref<DocumentFragment>&&, WTF::Function<bool( > > enum class MSOListQuirks { CheckIfNeeded, Disabled }; > std::unique_ptr<Page> createPageForSanitizingWebContent(); >-String sanitizeMarkup(const String&, MSOListQuirks = MSOListQuirks::Disabled, std::optional<WTF::Function<void(DocumentFragment&)>> fragmentSanitizer = std::nullopt); >+String sanitizeMarkup(const String&, MSOListQuirks = MSOListQuirks::Disabled, Optional<WTF::Function<void(DocumentFragment&)>> fragmentSanitizer = WTF::nullopt); > String sanitizedMarkupForFragmentInDocument(Ref<DocumentFragment>&&, Document&, MSOListQuirks, const String& originalMarkup); > > WEBCORE_EXPORT Ref<DocumentFragment> createFragmentFromText(Range& context, const String& text); >diff --git a/Source/WebCore/fileapi/AsyncFileStream.cpp b/Source/WebCore/fileapi/AsyncFileStream.cpp >index 325e34d0c6b8e7cc93afdb6445f548f5fcebee3e..9c9eccb77a328589a23320ac8dfc72dd8a39b373 100644 >--- a/Source/WebCore/fileapi/AsyncFileStream.cpp >+++ b/Source/WebCore/fileapi/AsyncFileStream.cpp >@@ -134,7 +134,7 @@ void AsyncFileStream::perform(WTF::Function<WTF::Function<void(FileStreamClient& > }); > } > >-void AsyncFileStream::getSize(const String& path, std::optional<WallTime> expectedModificationTime) >+void AsyncFileStream::getSize(const String& path, Optional<WallTime> expectedModificationTime) > { > // FIXME: Explicit return type here and in all the other cases like this below is a workaround for a deficiency > // in the Windows compiler at the time of this writing. Could remove it if that is resolved. >diff --git a/Source/WebCore/fileapi/AsyncFileStream.h b/Source/WebCore/fileapi/AsyncFileStream.h >index 7a9337e33be2c93e793266e611b13bc4ce36e438..9c1bb8f385c441c36645b2dededd78f0fe469b6d 100644 >--- a/Source/WebCore/fileapi/AsyncFileStream.h >+++ b/Source/WebCore/fileapi/AsyncFileStream.h >@@ -45,7 +45,7 @@ public: > explicit AsyncFileStream(FileStreamClient&); > ~AsyncFileStream(); > >- void getSize(const String& path, std::optional<WallTime> expectedModificationTime); >+ void getSize(const String& path, Optional<WallTime> expectedModificationTime); > void openForRead(const String& path, long long offset, long long length); > void close(); > void read(char* buffer, int length); >diff --git a/Source/WebCore/fileapi/File.cpp b/Source/WebCore/fileapi/File.cpp >index 8b1f724673874675839037f9c9eefbe3bc89e0a5..fc0fa57f0bedb9d759af79f458e50560848128d2 100644 >--- a/Source/WebCore/fileapi/File.cpp >+++ b/Source/WebCore/fileapi/File.cpp >@@ -63,7 +63,7 @@ File::File(const String& path, const String& nameOverride) > ThreadableBlobRegistry::registerFileBlobURL(m_internalURL, path, m_type); > } > >-File::File(DeserializationContructor, const String& path, const URL& url, const String& type, const String& name, const std::optional<int64_t>& lastModified) >+File::File(DeserializationContructor, const String& path, const URL& url, const String& type, const String& name, const Optional<int64_t>& lastModified) > : Blob(deserializationContructor, url, type, -1, path) > , m_path(path) > , m_name(name) >diff --git a/Source/WebCore/fileapi/File.h b/Source/WebCore/fileapi/File.h >index da2e8bca352ca3fc7ec7cb4562d79bbb728bf05f..8e56cea9cc7cf3cb7f28554ec5d6bd7ec8976125 100644 >--- a/Source/WebCore/fileapi/File.h >+++ b/Source/WebCore/fileapi/File.h >@@ -36,7 +36,7 @@ namespace WebCore { > class File final : public Blob { > public: > struct PropertyBag : BlobPropertyBag { >- std::optional<int64_t> lastModified; >+ Optional<int64_t> lastModified; > }; > > static Ref<File> create(const String& path) >@@ -50,7 +50,7 @@ public: > return adoptRef(*new File(WTFMove(blobPartVariants), filename, propertyBag)); > } > >- static Ref<File> deserialize(const String& path, const URL& srcURL, const String& type, const String& name, const std::optional<int64_t>& lastModified = std::nullopt) >+ static Ref<File> deserialize(const String& path, const URL& srcURL, const String& type, const String& name, const Optional<int64_t>& lastModified = WTF::nullopt) > { > return adoptRef(*new File(deserializationContructor, path, srcURL, type, name, lastModified)); > } >@@ -82,7 +82,7 @@ public: > void setRelativePath(const String& relativePath) { m_relativePath = relativePath; } > const String& name() const { return m_name; } > WEBCORE_EXPORT int64_t lastModified() const; // Number of milliseconds since Epoch. >- const std::optional<int64_t>& lastModifiedOverride() const { return m_lastModifiedDateOverride; } // Number of milliseconds since Epoch. >+ const Optional<int64_t>& lastModifiedOverride() const { return m_lastModifiedDateOverride; } // Number of milliseconds since Epoch. > > static String contentTypeForFile(const String& path); > >@@ -99,7 +99,7 @@ private: > File(const Blob&, const String& name); > File(const File&, const String& name); > >- File(DeserializationContructor, const String& path, const URL& srcURL, const String& type, const String& name, const std::optional<int64_t>& lastModified); >+ File(DeserializationContructor, const String& path, const URL& srcURL, const String& type, const String& name, const Optional<int64_t>& lastModified); > > static void computeNameAndContentType(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType); > #if ENABLE(FILE_REPLACEMENT) >@@ -110,8 +110,8 @@ private: > String m_relativePath; > String m_name; > >- std::optional<int64_t> m_lastModifiedDateOverride; >- mutable std::optional<bool> m_isDirectory; >+ Optional<int64_t> m_lastModifiedDateOverride; >+ mutable Optional<bool> m_isDirectory; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/fileapi/FileReader.cpp b/Source/WebCore/fileapi/FileReader.cpp >index b5fcf626ca1ff1fdb4035b10f1dbf2fa3deae3e0..ebf6b5c37da3eac82da9560b3de363b26866de3f 100644 >--- a/Source/WebCore/fileapi/FileReader.cpp >+++ b/Source/WebCore/fileapi/FileReader.cpp >@@ -226,19 +226,19 @@ void FileReader::fireEvent(const AtomicString& type) > dispatchEvent(ProgressEvent::create(type, true, m_loader ? m_loader->bytesLoaded() : 0, m_loader ? m_loader->totalBytes() : 0)); > } > >-std::optional<Variant<String, RefPtr<JSC::ArrayBuffer>>> FileReader::result() const >+Optional<Variant<String, RefPtr<JSC::ArrayBuffer>>> FileReader::result() const > { > if (!m_loader || m_error) >- return std::nullopt; >+ return WTF::nullopt; > if (m_readType == FileReaderLoader::ReadAsArrayBuffer) { > auto result = m_loader->arrayBufferResult(); > if (!result) >- return std::nullopt; >+ return WTF::nullopt; > return { result }; > } > String result = m_loader->stringResult(); > if (result.isNull()) >- return std::nullopt; >+ return WTF::nullopt; > return { WTFMove(result) }; > } > >diff --git a/Source/WebCore/fileapi/FileReader.h b/Source/WebCore/fileapi/FileReader.h >index ef89f5bd6e012e5e4d058c30104439a72ef0ea6c..070d3b172ed7b2cd7433993eca47855211076b45 100644 >--- a/Source/WebCore/fileapi/FileReader.h >+++ b/Source/WebCore/fileapi/FileReader.h >@@ -68,7 +68,7 @@ public: > ReadyState readyState() const { return m_state; } > RefPtr<FileError> error() { return m_error; } > FileReaderLoader::ReadType readType() const { return m_readType; } >- std::optional<Variant<String, RefPtr<JSC::ArrayBuffer>>> result() const; >+ Optional<Variant<String, RefPtr<JSC::ArrayBuffer>>> result() const; > > using RefCounted::ref; > using RefCounted::deref; >diff --git a/Source/WebCore/history/BackForwardItemIdentifier.h b/Source/WebCore/history/BackForwardItemIdentifier.h >index 6ded64ad4f3ca1f22cd2cf4f6079ce2cc115cd3c..1e830637640bb0a116edd94b6c88100f55b8e9f9 100644 >--- a/Source/WebCore/history/BackForwardItemIdentifier.h >+++ b/Source/WebCore/history/BackForwardItemIdentifier.h >@@ -40,7 +40,7 @@ struct BackForwardItemIdentifier { > unsigned hash() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<BackForwardItemIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<BackForwardItemIdentifier> decode(Decoder&); > > #if !LOG_DISABLED > const char* logString() const; >@@ -66,17 +66,17 @@ void BackForwardItemIdentifier::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<BackForwardItemIdentifier> BackForwardItemIdentifier::decode(Decoder& decoder) >+Optional<BackForwardItemIdentifier> BackForwardItemIdentifier::decode(Decoder& decoder) > { >- std::optional<ProcessIdentifier> processIdentifier; >+ Optional<ProcessIdentifier> processIdentifier; > decoder >> processIdentifier; > if (!processIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ObjectIdentifier<ItemIdentifierType>> itemIdentifier; >+ Optional<ObjectIdentifier<ItemIdentifierType>> itemIdentifier; > decoder >> itemIdentifier; > if (!itemIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*processIdentifier), WTFMove(*itemIdentifier) } }; > } >diff --git a/Source/WebCore/history/CachedFrame.h b/Source/WebCore/history/CachedFrame.h >index dbdbaf31f75570593d723ec8b2bfb19e6c8a2156..1468c2bda44d3e45d32e8846d60ce417d0bc1bb5 100644 >--- a/Source/WebCore/history/CachedFrame.h >+++ b/Source/WebCore/history/CachedFrame.h >@@ -62,7 +62,7 @@ protected: > std::unique_ptr<ScriptCachedFrameData> m_cachedFrameScriptData; > std::unique_ptr<CachedFramePlatformData> m_cachedFramePlatformData; > bool m_isMainFrame; >- std::optional<HasInsecureContent> m_hasInsecureContent; >+ Optional<HasInsecureContent> m_hasInsecureContent; > > Vector<std::unique_ptr<CachedFrame>> m_childFrames; > }; >@@ -80,7 +80,7 @@ public: > WEBCORE_EXPORT CachedFramePlatformData* cachedFramePlatformData(); > > WEBCORE_EXPORT void setHasInsecureContent(HasInsecureContent); >- std::optional<HasInsecureContent> hasInsecureContent() const { return m_hasInsecureContent; } >+ Optional<HasInsecureContent> hasInsecureContent() const { return m_hasInsecureContent; } > > using CachedFrameBase::document; > using CachedFrameBase::view; >diff --git a/Source/WebCore/html/ColorInputType.cpp b/Source/WebCore/html/ColorInputType.cpp >index 075290a25f7c8baaf913dbc58ca95ad7ef6daa41..9c07bbd4168418d7695e8d5c929a9a3032a5d812 100644 >--- a/Source/WebCore/html/ColorInputType.cpp >+++ b/Source/WebCore/html/ColorInputType.cpp >@@ -69,10 +69,10 @@ static bool isValidSimpleColor(StringView string) > } > > // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#rules-for-parsing-simple-colour-values >-static std::optional<RGBA32> parseSimpleColorValue(StringView string) >+static Optional<RGBA32> parseSimpleColorValue(StringView string) > { > if (!isValidSimpleColor(string)) >- return std::nullopt; >+ return WTF::nullopt; > return makeRGB(toASCIIHexValue(string[1], string[2]), toASCIIHexValue(string[3], string[4]), toASCIIHexValue(string[5], string[6])); > } > >diff --git a/Source/WebCore/html/DOMFormData.cpp b/Source/WebCore/html/DOMFormData.cpp >index d2eb67d670237b671cc13ccb319305b372ff23f2..1196edaf33d0a425b00153ad46ad919eca2baff2 100644 >--- a/Source/WebCore/html/DOMFormData.cpp >+++ b/Source/WebCore/html/DOMFormData.cpp >@@ -82,14 +82,14 @@ void DOMFormData::remove(const String& name) > }); > } > >-auto DOMFormData::get(const String& name) -> std::optional<FormDataEntryValue> >+auto DOMFormData::get(const String& name) -> Optional<FormDataEntryValue> > { > for (auto& item : m_items) { > if (item.name == name) > return item.data; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > auto DOMFormData::getAll(const String& name) -> Vector<FormDataEntryValue> >@@ -126,7 +126,7 @@ void DOMFormData::set(const String& name, Blob& blob, const String& filename) > > void DOMFormData::set(const String& name, Item&& item) > { >- std::optional<size_t> initialMatchLocation; >+ Optional<size_t> initialMatchLocation; > > // Find location of the first item with a matching name. > for (size_t i = 0; i < m_items.size(); ++i) { >@@ -153,11 +153,11 @@ DOMFormData::Iterator::Iterator(DOMFormData& target) > { > } > >-std::optional<KeyValuePair<String, DOMFormData::FormDataEntryValue>> DOMFormData::Iterator::next() >+Optional<KeyValuePair<String, DOMFormData::FormDataEntryValue>> DOMFormData::Iterator::next() > { > auto& items = m_target->items(); > if (m_index >= items.size()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& item = items[m_index++]; > return makeKeyValuePair(item.name, item.data); >diff --git a/Source/WebCore/html/DOMFormData.h b/Source/WebCore/html/DOMFormData.h >index 80e49fc774442f702727f1e7b53af3d75f9e948f..fb6c11256ac2ee1a27fac9e240e3c7e68735515c 100644 >--- a/Source/WebCore/html/DOMFormData.h >+++ b/Source/WebCore/html/DOMFormData.h >@@ -60,7 +60,7 @@ public: > void append(const String& name, const String& value); > void append(const String& name, Blob&, const String& filename = { }); > void remove(const String& name); >- std::optional<FormDataEntryValue> get(const String& name); >+ Optional<FormDataEntryValue> get(const String& name); > Vector<FormDataEntryValue> getAll(const String& name); > bool has(const String& name); > void set(const String& name, const String& value); >@@ -69,7 +69,7 @@ public: > class Iterator { > public: > explicit Iterator(DOMFormData&); >- std::optional<KeyValuePair<String, FormDataEntryValue>> next(); >+ Optional<KeyValuePair<String, FormDataEntryValue>> next(); > > private: > Ref<DOMFormData> m_target; >diff --git a/Source/WebCore/html/DOMTokenList.cpp b/Source/WebCore/html/DOMTokenList.cpp >index c95f969a699b1753d18ad832e5c95aca1b262ab3..cea1cd309cdc35287e84e0dd07055fbba974b449 100644 >--- a/Source/WebCore/html/DOMTokenList.cpp >+++ b/Source/WebCore/html/DOMTokenList.cpp >@@ -132,7 +132,7 @@ ExceptionOr<void> DOMTokenList::remove(const AtomicString& token) > return removeInternal(&token.string(), 1); > } > >-ExceptionOr<bool> DOMTokenList::toggle(const AtomicString& token, std::optional<bool> force) >+ExceptionOr<bool> DOMTokenList::toggle(const AtomicString& token, Optional<bool> force) > { > auto result = validateToken(token); > if (result.hasException()) >diff --git a/Source/WebCore/html/DOMTokenList.h b/Source/WebCore/html/DOMTokenList.h >index 3940f035eaeba02394e5a912b90c833baf4a9afb..8c0267e84d6351f4b1621a1a55b22b734e61f8f0 100644 >--- a/Source/WebCore/html/DOMTokenList.h >+++ b/Source/WebCore/html/DOMTokenList.h >@@ -48,7 +48,7 @@ public: > ExceptionOr<void> add(const AtomicString&); > ExceptionOr<void> remove(const Vector<String>&); > ExceptionOr<void> remove(const AtomicString&); >- WEBCORE_EXPORT ExceptionOr<bool> toggle(const AtomicString&, std::optional<bool> force); >+ WEBCORE_EXPORT ExceptionOr<bool> toggle(const AtomicString&, Optional<bool> force); > ExceptionOr<bool> replace(const AtomicString& token, const AtomicString& newToken); > ExceptionOr<bool> supports(StringView token); > >diff --git a/Source/WebCore/html/FormController.cpp b/Source/WebCore/html/FormController.cpp >index 8a80698f26cec343cbe54cf7f4200b6710ddb0ad..c2ca4c848cb0f9de810815f61a96bad35fee1ee7 100644 >--- a/Source/WebCore/html/FormController.cpp >+++ b/Source/WebCore/html/FormController.cpp >@@ -61,13 +61,13 @@ static inline void serializeFormControlStateTo(const FormControlState& formContr > stateVector.append(value.isNull() ? emptyString() : value); > } > >-static inline std::optional<FormControlState> deserializeFormControlState(const Vector<String>& stateVector, size_t& index) >+static inline Optional<FormControlState> deserializeFormControlState(const Vector<String>& stateVector, size_t& index) > { > if (index >= stateVector.size()) >- return std::nullopt; >+ return WTF::nullopt; > size_t size = stateVector[index++].toUInt(); > if (index + size > stateVector.size()) >- return std::nullopt; >+ return WTF::nullopt; > Vector<String> subvector; > subvector.reserveInitialCapacity(size); > for (size_t i = 0; i < size; ++i) >diff --git a/Source/WebCore/html/HTMLAllCollection.cpp b/Source/WebCore/html/HTMLAllCollection.cpp >index 1238cb195416899f19bf3e4dbde7530f260d3ba9..43047cd9c332f4d6dcf6a8d3c3372c0ccbc57a6a 100644 >--- a/Source/WebCore/html/HTMLAllCollection.cpp >+++ b/Source/WebCore/html/HTMLAllCollection.cpp >@@ -43,10 +43,10 @@ inline HTMLAllCollection::HTMLAllCollection(Document& document, CollectionType t > } > > // https://html.spec.whatwg.org/multipage/infrastructure.html#dom-htmlallcollection-item >-std::optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> HTMLAllCollection::namedOrIndexedItemOrItems(const AtomicString& nameOrIndex) const >+Optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> HTMLAllCollection::namedOrIndexedItemOrItems(const AtomicString& nameOrIndex) const > { > if (nameOrIndex.isNull()) >- return std::nullopt; >+ return WTF::nullopt; > > if (auto index = JSC::parseIndex(*nameOrIndex.impl())) > return Variant<RefPtr<HTMLCollection>, RefPtr<Element>> { RefPtr<Element> { item(index.value()) } }; >@@ -55,12 +55,12 @@ std::optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> HTMLAllCollectio > } > > // https://html.spec.whatwg.org/multipage/infrastructure.html#concept-get-all-named >-std::optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> HTMLAllCollection::namedItemOrItems(const AtomicString& name) const >+Optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> HTMLAllCollection::namedItemOrItems(const AtomicString& name) const > { > auto namedItems = this->namedItems(name); > > if (namedItems.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > if (namedItems.size() == 1) > return Variant<RefPtr<HTMLCollection>, RefPtr<Element>> { RefPtr<Element> { WTFMove(namedItems[0]) } }; > >diff --git a/Source/WebCore/html/HTMLAllCollection.h b/Source/WebCore/html/HTMLAllCollection.h >index 98a6f8f3b822953bd84756e3f984c2f041338cfb..8ae0f9df20421ab7ff0d2ddce013be15ba3fd35e 100644 >--- a/Source/WebCore/html/HTMLAllCollection.h >+++ b/Source/WebCore/html/HTMLAllCollection.h >@@ -35,8 +35,8 @@ class HTMLAllCollection final : public AllDescendantsCollection { > public: > static Ref<HTMLAllCollection> create(Document&, CollectionType); > >- std::optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> namedOrIndexedItemOrItems(const AtomicString& nameOrIndex) const; >- std::optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> namedItemOrItems(const AtomicString&) const; >+ Optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> namedOrIndexedItemOrItems(const AtomicString& nameOrIndex) const; >+ Optional<Variant<RefPtr<HTMLCollection>, RefPtr<Element>>> namedItemOrItems(const AtomicString&) const; > > private: > HTMLAllCollection(Document&, CollectionType); >diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp >index a1aeb527b64c891d1878b160edfa8cc7aae18dfd..e7e167c95b4177513432f96c6f41e385afb62e44 100644 >--- a/Source/WebCore/html/HTMLAnchorElement.cpp >+++ b/Source/WebCore/html/HTMLAnchorElement.cpp >@@ -432,7 +432,7 @@ void HTMLAnchorElement::handleClick(Event& event) > ShouldSendReferrer shouldSendReferrer = hasRel(Relation::NoReferrer) ? NeverSendReferrer : MaybeSendReferrer; > > auto effectiveTarget = this->effectiveTarget(); >- std::optional<NewFrameOpenerPolicy> newFrameOpenerPolicy; >+ Optional<NewFrameOpenerPolicy> newFrameOpenerPolicy; > if (hasRel(Relation::Opener)) > newFrameOpenerPolicy = NewFrameOpenerPolicy::Allow; > else if (hasRel(Relation::NoOpener) || (RuntimeEnabledFeatures::sharedFeatures().blankAnchorTargetImpliesNoOpenerEnabled() && equalIgnoringASCIICase(effectiveTarget, "_blank"))) >diff --git a/Source/WebCore/html/HTMLAttachmentElement.cpp b/Source/WebCore/html/HTMLAttachmentElement.cpp >index cb6acb718b3864813054e8694615deb9fd18bac1..7111cf6d8d93788e705b8d636be125dcd2f36fca 100644 >--- a/Source/WebCore/html/HTMLAttachmentElement.cpp >+++ b/Source/WebCore/html/HTMLAttachmentElement.cpp >@@ -205,7 +205,7 @@ String HTMLAttachmentElement::attachmentPath() const > return attributeWithoutSynchronization(webkitattachmentpathAttr); > } > >-void HTMLAttachmentElement::updateAttributes(std::optional<uint64_t>&& newFileSize, const String& newContentType, const String& newFilename) >+void HTMLAttachmentElement::updateAttributes(Optional<uint64_t>&& newFileSize, const String& newContentType, const String& newFilename) > { > if (!newFilename.isNull()) > setAttributeWithoutSynchronization(HTMLNames::titleAttr, newFilename); >diff --git a/Source/WebCore/html/HTMLAttachmentElement.h b/Source/WebCore/html/HTMLAttachmentElement.h >index 12e20a350691c6eca1268bbbd9081fb5bb06a510..c84a8bf95df1d49810c4746d98e8a00328887b57 100644 >--- a/Source/WebCore/html/HTMLAttachmentElement.h >+++ b/Source/WebCore/html/HTMLAttachmentElement.h >@@ -54,7 +54,7 @@ public: > > void copyNonAttributePropertiesFromElement(const Element&) final; > >- WEBCORE_EXPORT void updateAttributes(std::optional<uint64_t>&& newFileSize, const String& newContentType, const String& newFilename); >+ WEBCORE_EXPORT void updateAttributes(Optional<uint64_t>&& newFileSize, const String& newContentType, const String& newFilename); > WEBCORE_EXPORT void updateEnclosingImageWithData(const String& contentType, Ref<SharedBuffer>&& data); > > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final; >diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp >index 7485640a31ed1772330156b724a4a424466eab3e..7a70b24a20eab8bf88f0d41ce1889677e717a1f9 100644 >--- a/Source/WebCore/html/HTMLCanvasElement.cpp >+++ b/Source/WebCore/html/HTMLCanvasElement.cpp >@@ -211,7 +211,7 @@ static inline size_t maxActivePixelMemory() > return maxPixelMemory; > } > >-ExceptionOr<std::optional<RenderingContext>> HTMLCanvasElement::getContext(JSC::ExecState& state, const String& contextId, Vector<JSC::Strong<JSC::Unknown>>&& arguments) >+ExceptionOr<Optional<RenderingContext>> HTMLCanvasElement::getContext(JSC::ExecState& state, const String& contextId, Vector<JSC::Strong<JSC::Unknown>>&& arguments) > { > if (m_context) { > if (m_context->isPlaceholder()) >@@ -219,25 +219,25 @@ ExceptionOr<std::optional<RenderingContext>> HTMLCanvasElement::getContext(JSC:: > > if (m_context->is2d()) { > if (!is2dType(contextId)) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<CanvasRenderingContext2D> { &downcast<CanvasRenderingContext2D>(*m_context) } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<CanvasRenderingContext2D> { &downcast<CanvasRenderingContext2D>(*m_context) } }; > } > > if (m_context->isBitmapRenderer()) { > if (!isBitmapRendererType(contextId)) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<ImageBitmapRenderingContext> { &downcast<ImageBitmapRenderingContext>(*m_context) } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<ImageBitmapRenderingContext> { &downcast<ImageBitmapRenderingContext>(*m_context) } }; > } > > #if ENABLE(WEBGL) > if (m_context->isWebGL()) { > if (!isWebGLType(contextId)) >- return std::optional<RenderingContext> { std::nullopt }; >+ return Optional<RenderingContext> { WTF::nullopt }; > if (is<WebGLRenderingContext>(*m_context)) >- return std::optional<RenderingContext> { RefPtr<WebGLRenderingContext> { &downcast<WebGLRenderingContext>(*m_context) } }; >+ return Optional<RenderingContext> { RefPtr<WebGLRenderingContext> { &downcast<WebGLRenderingContext>(*m_context) } }; > #if ENABLE(WEBGL2) > ASSERT(is<WebGL2RenderingContext>(*m_context)); >- return std::optional<RenderingContext> { RefPtr<WebGL2RenderingContext> { &downcast<WebGL2RenderingContext>(*m_context) } }; >+ return Optional<RenderingContext> { RefPtr<WebGL2RenderingContext> { &downcast<WebGL2RenderingContext>(*m_context) } }; > #endif > } > #endif >@@ -245,28 +245,28 @@ ExceptionOr<std::optional<RenderingContext>> HTMLCanvasElement::getContext(JSC:: > #if ENABLE(WEBGPU) > if (m_context->isWebGPU()) { > if (!isWebGPUType(contextId)) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<WebGPURenderingContext> { &downcast<WebGPURenderingContext>(*m_context) } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<WebGPURenderingContext> { &downcast<WebGPURenderingContext>(*m_context) } }; > } > #endif > > #if ENABLE(WEBMETAL) > if (m_context->isWebMetal()) { > if (!isWebMetalType(contextId)) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<WebMetalRenderingContext> { &downcast<WebMetalRenderingContext>(*m_context) } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<WebMetalRenderingContext> { &downcast<WebMetalRenderingContext>(*m_context) } }; > } > #endif > > ASSERT_NOT_REACHED(); >- return std::optional<RenderingContext> { std::nullopt }; >+ return Optional<RenderingContext> { WTF::nullopt }; > } > > if (is2dType(contextId)) { > auto context = createContext2d(contextId); > if (!context) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<CanvasRenderingContext2D> { context } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<CanvasRenderingContext2D> { context } }; > } > > if (isBitmapRendererType(contextId)) { >@@ -276,8 +276,8 @@ ExceptionOr<std::optional<RenderingContext>> HTMLCanvasElement::getContext(JSC:: > > auto context = createContextBitmapRenderer(contextId, WTFMove(attributes)); > if (!context) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<ImageBitmapRenderingContext> { context } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<ImageBitmapRenderingContext> { context } }; > } > > #if ENABLE(WEBGL) >@@ -288,13 +288,13 @@ ExceptionOr<std::optional<RenderingContext>> HTMLCanvasElement::getContext(JSC:: > > auto context = createContextWebGL(contextId, WTFMove(attributes)); > if (!context) >- return std::optional<RenderingContext> { std::nullopt }; >+ return Optional<RenderingContext> { WTF::nullopt }; > > if (is<WebGLRenderingContext>(*context)) >- return std::optional<RenderingContext> { RefPtr<WebGLRenderingContext> { &downcast<WebGLRenderingContext>(*context) } }; >+ return Optional<RenderingContext> { RefPtr<WebGLRenderingContext> { &downcast<WebGLRenderingContext>(*context) } }; > #if ENABLE(WEBGL2) > ASSERT(is<WebGL2RenderingContext>(*context)); >- return std::optional<RenderingContext> { RefPtr<WebGL2RenderingContext> { &downcast<WebGL2RenderingContext>(*context) } }; >+ return Optional<RenderingContext> { RefPtr<WebGL2RenderingContext> { &downcast<WebGL2RenderingContext>(*context) } }; > #endif > } > #endif >@@ -303,8 +303,8 @@ ExceptionOr<std::optional<RenderingContext>> HTMLCanvasElement::getContext(JSC:: > if (isWebGPUType(contextId)) { > auto context = createContextWebGPU(contextId); > if (!context) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<WebGPURenderingContext> { context } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<WebGPURenderingContext> { context } }; > } > #endif > >@@ -312,12 +312,12 @@ ExceptionOr<std::optional<RenderingContext>> HTMLCanvasElement::getContext(JSC:: > if (isWebMetalType(contextId)) { > auto context = createContextWebMetal(contextId); > if (!context) >- return std::optional<RenderingContext> { std::nullopt }; >- return std::optional<RenderingContext> { RefPtr<WebMetalRenderingContext> { context } }; >+ return Optional<RenderingContext> { WTF::nullopt }; >+ return Optional<RenderingContext> { RefPtr<WebMetalRenderingContext> { context } }; > } > #endif > >- return std::optional<RenderingContext> { std::nullopt }; >+ return Optional<RenderingContext> { WTF::nullopt }; > } > > CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type) >@@ -748,14 +748,14 @@ static String toEncodingMimeType(const String& mimeType) > } > > // https://html.spec.whatwg.org/multipage/canvas.html#a-serialisation-of-the-bitmap-as-a-file >-static std::optional<double> qualityFromJSValue(JSC::JSValue qualityValue) >+static Optional<double> qualityFromJSValue(JSC::JSValue qualityValue) > { > if (!qualityValue.isNumber()) >- return std::nullopt; >+ return WTF::nullopt; > > double qualityNumber = qualityValue.asNumber(); > if (qualityNumber < 0 || qualityNumber > 1) >- return std::nullopt; >+ return WTF::nullopt; > > return qualityNumber; > } >@@ -855,7 +855,7 @@ RefPtr<MediaSample> HTMLCanvasElement::toMediaSample() > #endif > } > >-ExceptionOr<Ref<MediaStream>> HTMLCanvasElement::captureStream(ScriptExecutionContext& context, std::optional<double>&& frameRequestRate) >+ExceptionOr<Ref<MediaStream>> HTMLCanvasElement::captureStream(ScriptExecutionContext& context, Optional<double>&& frameRequestRate) > { > if (!originClean()) > return Exception(SecurityError, "Canvas is tainted"_s); >diff --git a/Source/WebCore/html/HTMLCanvasElement.h b/Source/WebCore/html/HTMLCanvasElement.h >index a6ca3a290c3e41d56f6930f7a3367bcf890b319c..58b99f8afd20cc1c2a107f5282ab1e8f604ca505 100644 >--- a/Source/WebCore/html/HTMLCanvasElement.h >+++ b/Source/WebCore/html/HTMLCanvasElement.h >@@ -85,7 +85,7 @@ public: > reset(); > } > >- ExceptionOr<std::optional<RenderingContext>> getContext(JSC::ExecState&, const String& contextId, Vector<JSC::Strong<JSC::Unknown>>&& arguments); >+ ExceptionOr<Optional<RenderingContext>> getContext(JSC::ExecState&, const String& contextId, Vector<JSC::Strong<JSC::Unknown>>&& arguments); > > CanvasRenderingContext* getContext(const String&); > >@@ -127,7 +127,7 @@ public: > > #if ENABLE(MEDIA_STREAM) > RefPtr<MediaSample> toMediaSample(); >- ExceptionOr<Ref<MediaStream>> captureStream(ScriptExecutionContext&, std::optional<double>&& frameRequestRate); >+ ExceptionOr<Ref<MediaStream>> captureStream(ScriptExecutionContext&, Optional<double>&& frameRequestRate); > #endif > > ImageBuffer* buffer() const; >diff --git a/Source/WebCore/html/HTMLDocument.cpp b/Source/WebCore/html/HTMLDocument.cpp >index 9d581cedfa841e0adf1aac432591c8b6f2f76518..eb62e9e06af574d6dbdda3d2ed500a610ec42013 100644 >--- a/Source/WebCore/html/HTMLDocument.cpp >+++ b/Source/WebCore/html/HTMLDocument.cpp >@@ -114,10 +114,10 @@ Ref<DocumentParser> HTMLDocument::createParser() > } > > // https://html.spec.whatwg.org/multipage/dom.html#dom-document-nameditem >-std::optional<Variant<RefPtr<WindowProxy>, RefPtr<Element>, RefPtr<HTMLCollection>>> HTMLDocument::namedItem(const AtomicString& name) >+Optional<Variant<RefPtr<WindowProxy>, RefPtr<Element>, RefPtr<HTMLCollection>>> HTMLDocument::namedItem(const AtomicString& name) > { > if (name.isNull() || !hasDocumentNamedItem(*name.impl())) >- return std::nullopt; >+ return WTF::nullopt; > > if (UNLIKELY(documentNamedItemContainsMultipleElements(*name.impl()))) { > auto collection = documentNamedItems(name); >diff --git a/Source/WebCore/html/HTMLDocument.h b/Source/WebCore/html/HTMLDocument.h >index 5e57204880aa28174a296c001e2ee4c17c643ba2..3060eb74c4a29a3beede80950b2c5a3b7b2e5b97 100644 >--- a/Source/WebCore/html/HTMLDocument.h >+++ b/Source/WebCore/html/HTMLDocument.h >@@ -44,7 +44,7 @@ public: > WEBCORE_EXPORT int width(); > WEBCORE_EXPORT int height(); > >- std::optional<Variant<RefPtr<WindowProxy>, RefPtr<Element>, RefPtr<HTMLCollection>>> namedItem(const AtomicString&); >+ Optional<Variant<RefPtr<WindowProxy>, RefPtr<Element>, RefPtr<HTMLCollection>>> namedItem(const AtomicString&); > Vector<AtomicString> supportedPropertyNames() const; > > Element* documentNamedItem(const AtomicStringImpl& name) const { return m_documentNamedItem.getElementByDocumentNamedItem(name, *this); } >diff --git a/Source/WebCore/html/HTMLFormControlsCollection.cpp b/Source/WebCore/html/HTMLFormControlsCollection.cpp >index d921e31e9f12eafe7d8f53bc12fc5dbcbd961c9c..615a625721292ea503b7d2f863e1f838e0a885f0 100644 >--- a/Source/WebCore/html/HTMLFormControlsCollection.cpp >+++ b/Source/WebCore/html/HTMLFormControlsCollection.cpp >@@ -50,12 +50,12 @@ Ref<HTMLFormControlsCollection> HTMLFormControlsCollection::create(ContainerNode > > HTMLFormControlsCollection::~HTMLFormControlsCollection() = default; > >-std::optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> HTMLFormControlsCollection::namedItemOrItems(const String& name) const >+Optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> HTMLFormControlsCollection::namedItemOrItems(const String& name) const > { > auto namedItems = this->namedItems(name); > > if (namedItems.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > if (namedItems.size() == 1) > return Variant<RefPtr<RadioNodeList>, RefPtr<Element>> { RefPtr<Element> { WTFMove(namedItems[0]) } }; > >diff --git a/Source/WebCore/html/HTMLFormControlsCollection.h b/Source/WebCore/html/HTMLFormControlsCollection.h >index 540756794d92157618c915c71e855dee6776ab88..99487fe3cd2177bd162f363d9ac9c99315f672ee 100644 >--- a/Source/WebCore/html/HTMLFormControlsCollection.h >+++ b/Source/WebCore/html/HTMLFormControlsCollection.h >@@ -40,7 +40,7 @@ public: > virtual ~HTMLFormControlsCollection(); > > HTMLElement* item(unsigned offset) const override; >- std::optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> namedItemOrItems(const String&) const; >+ Optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> namedItemOrItems(const String&) const; > > HTMLFormElement& ownerNode() const; > >diff --git a/Source/WebCore/html/HTMLFormElement.cpp b/Source/WebCore/html/HTMLFormElement.cpp >index ed92ac8fe7b046fca81e2a894ed387b376447993..ec6bba31ebd99638d6cd35dfb7edb7ac55f06ab2 100644 >--- a/Source/WebCore/html/HTMLFormElement.cpp >+++ b/Source/WebCore/html/HTMLFormElement.cpp >@@ -166,12 +166,12 @@ HTMLElement* HTMLFormElement::item(unsigned index) > return elements()->item(index); > } > >-std::optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> HTMLFormElement::namedItem(const AtomicString& name) >+Optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> HTMLFormElement::namedItem(const AtomicString& name) > { > auto namedItems = namedElements(name); > > if (namedItems.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > if (namedItems.size() == 1) > return Variant<RefPtr<RadioNodeList>, RefPtr<Element>> { RefPtr<Element> { WTFMove(namedItems[0]) } }; > >diff --git a/Source/WebCore/html/HTMLFormElement.h b/Source/WebCore/html/HTMLFormElement.h >index 7fe0426066e036fa585de9e95a5c656669da87eb..8d289c95be2d54a97991e215a17578be43d10d4a 100644 >--- a/Source/WebCore/html/HTMLFormElement.h >+++ b/Source/WebCore/html/HTMLFormElement.h >@@ -54,7 +54,7 @@ public: > > WEBCORE_EXPORT unsigned length() const; > HTMLElement* item(unsigned index); >- std::optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> namedItem(const AtomicString&); >+ Optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> namedItem(const AtomicString&); > Vector<AtomicString> supportedPropertyNames() const; > > String enctype() const { return m_attributes.encodingType(); } >diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp >index dd780f7b3045fa21992f647e3dff4ab564e604bb..7fb2713ad5810c21d9a018276c7caa63c31d4ed8 100644 >--- a/Source/WebCore/html/HTMLImageElement.cpp >+++ b/Source/WebCore/html/HTMLImageElement.cpp >@@ -100,7 +100,7 @@ HTMLImageElement::~HTMLImageElement() > setPictureElement(nullptr); > } > >-Ref<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, std::optional<unsigned> width, std::optional<unsigned> height) >+Ref<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, Optional<unsigned> width, Optional<unsigned> height) > { > auto image = adoptRef(*new HTMLImageElement(imgTag, document)); > if (width) >diff --git a/Source/WebCore/html/HTMLImageElement.h b/Source/WebCore/html/HTMLImageElement.h >index 4f709dd88d03941a2f3fb32b324843a9e8be2d42..ad6aa9387e4494036b56ca9be5424b937a22488e 100644 >--- a/Source/WebCore/html/HTMLImageElement.h >+++ b/Source/WebCore/html/HTMLImageElement.h >@@ -45,7 +45,7 @@ class HTMLImageElement : public HTMLElement, public FormNamedItem { > public: > static Ref<HTMLImageElement> create(Document&); > static Ref<HTMLImageElement> create(const QualifiedName&, Document&, HTMLFormElement*); >- static Ref<HTMLImageElement> createForJSConstructor(Document&, std::optional<unsigned> width, std::optional<unsigned> height); >+ static Ref<HTMLImageElement> createForJSConstructor(Document&, Optional<unsigned> width, Optional<unsigned> height); > > virtual ~HTMLImageElement(); > >diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp >index 400c8e32402978cecf3e4637a2713a8d2e6eba98..a8e1acf57935b08a5ab5a2a0b20ee50664cba1e0 100644 >--- a/Source/WebCore/html/HTMLInputElement.cpp >+++ b/Source/WebCore/html/HTMLInputElement.cpp >@@ -399,7 +399,7 @@ StepRange HTMLInputElement::createStepRange(AnyStepHandling anyStepHandling) con > } > > #if ENABLE(DATALIST_ELEMENT) >-std::optional<Decimal> HTMLInputElement::findClosestTickMarkValue(const Decimal& value) >+Optional<Decimal> HTMLInputElement::findClosestTickMarkValue(const Decimal& value) > { > return m_inputType->findClosestTickMarkValue(value); > } >diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h >index ac50d36e2226b412caf584ba1050d9a99b07c7e6..a5ea709a298254eb599e834bf49e21167de67e87 100644 >--- a/Source/WebCore/html/HTMLInputElement.h >+++ b/Source/WebCore/html/HTMLInputElement.h >@@ -86,7 +86,7 @@ public: > StepRange createStepRange(AnyStepHandling) const; > > #if ENABLE(DATALIST_ELEMENT) >- std::optional<Decimal> findClosestTickMarkValue(const Decimal&); >+ Optional<Decimal> findClosestTickMarkValue(const Decimal&); > #endif > > WEBCORE_EXPORT ExceptionOr<void> stepUp(int = 1); >diff --git a/Source/WebCore/html/HTMLLIElement.cpp b/Source/WebCore/html/HTMLLIElement.cpp >index f980f4cd4e934ce77147c28d09b7127275857255..e92815b8f92043e5b78d4cd3300eaa2ddb763fdb 100644 >--- a/Source/WebCore/html/HTMLLIElement.cpp >+++ b/Source/WebCore/html/HTMLLIElement.cpp >@@ -123,7 +123,7 @@ inline void HTMLLIElement::parseValue(const AtomicString& value) > if (valueOK) > downcast<RenderListItem>(*renderer()).setExplicitValue(requestedValue); > else >- downcast<RenderListItem>(*renderer()).setExplicitValue(std::nullopt); >+ downcast<RenderListItem>(*renderer()).setExplicitValue(WTF::nullopt); > } > > } >diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp >index 02ca3c52bf43a60e55a0517cbcc85b3dc70fd2af..107e0e8b17786b6f4a1ad987f8f93b8122516d75 100644 >--- a/Source/WebCore/html/HTMLLinkElement.cpp >+++ b/Source/WebCore/html/HTMLLinkElement.cpp >@@ -289,7 +289,7 @@ void HTMLLinkElement::process() > > bool mediaQueryMatches = true; > if (!m_media.isEmpty()) { >- std::optional<RenderStyle> documentStyle; >+ Optional<RenderStyle> documentStyle; > if (document().hasLivingRenderTree()) > documentStyle = Style::resolveForDocument(document()); > auto media = MediaQuerySet::create(m_media, MediaQueryParserContext(document())); >@@ -303,7 +303,7 @@ void HTMLLinkElement::process() > addPendingSheet(isActive ? ActiveSheet : InactiveSheet); > > // Load stylesheets that are not needed for the rendering immediately with low priority. >- std::optional<ResourceLoadPriority> priority; >+ Optional<ResourceLoadPriority> priority; > if (!isActive) > priority = ResourceLoadPriority::VeryLow; > >@@ -395,7 +395,7 @@ void HTMLLinkElement::finishParsingChildren() > void HTMLLinkElement::initializeStyleSheet(Ref<StyleSheetContents>&& styleSheet, const CachedCSSStyleSheet& cachedStyleSheet, MediaQueryParserContext context) > { > // FIXME: originClean should be turned to false except if fetch mode is CORS. >- std::optional<bool> originClean; >+ Optional<bool> originClean; > if (cachedStyleSheet.options().mode == FetchOptions::Mode::Cors) > originClean = cachedStyleSheet.isCORSSameOrigin(); > >@@ -580,7 +580,7 @@ const AtomicString& HTMLLinkElement::type() const > return attributeWithoutSynchronization(typeAttr); > } > >-std::optional<LinkIconType> HTMLLinkElement::iconType() const >+Optional<LinkIconType> HTMLLinkElement::iconType() const > { > return m_relAttribute.iconType; > } >diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h >index 6828f9343b5724095db6021742687654070cdf89..61ab5b367c2504b0c62c7efb673aaa3c07e50f0b 100644 >--- a/Source/WebCore/html/HTMLLinkElement.h >+++ b/Source/WebCore/html/HTMLLinkElement.h >@@ -54,7 +54,7 @@ public: > > const AtomicString& type() const; > >- std::optional<LinkIconType> iconType() const; >+ Optional<LinkIconType> iconType() const; > > CSSStyleSheet* sheet() const { return m_sheet.get(); } > >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 0dcc88905063d2eb2709e62e34e95ea073b288a4..35429f1c86b0c1ea9978fda4cf9ae04eb43f0e95 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -1758,7 +1758,7 @@ void HTMLMediaElement::updateActiveTextTrackCues(const MediaTime& movieTime) > if (auto nearestEndingCue = std::min_element(currentCues.begin(), currentCues.end(), compareCueIntervalEndTime)) > nextInterestingTime = nearestEndingCue->data()->endMediaTime(); > >- std::optional<CueInterval> nextCue = m_cueTree.nextIntervalAfter(movieTimeInterval); >+ Optional<CueInterval> nextCue = m_cueTree.nextIntervalAfter(movieTimeInterval); > if (nextCue) > nextInterestingTime = std::min(nextInterestingTime, nextCue->low()); > >@@ -7185,7 +7185,7 @@ RefPtr<VideoPlaybackQuality> HTMLMediaElement::getVideoPlaybackQuality() > RefPtr<DOMWindow> domWindow = document().domWindow(); > double timestamp = domWindow ? 1000 * domWindow->nowTimestamp() : 0; > >- auto metrics = m_player ? m_player->videoPlaybackQualityMetrics() : std::nullopt; >+ auto metrics = m_player ? m_player->videoPlaybackQualityMetrics() : WTF::nullopt; > if (!metrics) > return VideoPlaybackQuality::create(timestamp, { }); > >@@ -7783,10 +7783,10 @@ void HTMLMediaElement::setPlaybackWithoutUserGesture(PlaybackWithoutUserGesture > m_playbackWithoutUserGestureStartedTime = currentMediaTime(); > break; > case PlaybackWithoutUserGesture::None: >- m_playbackWithoutUserGestureStartedTime = std::nullopt; >+ m_playbackWithoutUserGestureStartedTime = WTF::nullopt; > break; > case PlaybackWithoutUserGesture::Prevented: >- m_playbackWithoutUserGestureStartedTime = std::nullopt; >+ m_playbackWithoutUserGestureStartedTime = WTF::nullopt; > > dispatchPlayPauseEventsIfNeedsQuirks(); > handleAutoplayEvent(AutoplayEvent::DidPreventMediaFromPlaying); >diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h >index 0c871593e285867c3bd82aa86107fbbf643af6da..118fd4f7967269b2329efe5731f96b7841345d43 100644 >--- a/Source/WebCore/html/HTMLMediaElement.h >+++ b/Source/WebCore/html/HTMLMediaElement.h >@@ -113,7 +113,7 @@ using CueInterval = CueIntervalTree::IntervalType; > using CueList = Vector<CueInterval>; > #endif > >-using MediaProvider = std::optional<Variant< >+using MediaProvider = Optional<Variant< > #if ENABLE(MEDIA_STREAM) > RefPtr<MediaStream>, > #endif >@@ -1118,12 +1118,12 @@ private: > bool m_processingPreferenceChange : 1; > > PlaybackWithoutUserGesture m_playbackWithoutUserGesture { PlaybackWithoutUserGesture::None }; >- std::optional<MediaTime> m_playbackWithoutUserGestureStartedTime; >+ Optional<MediaTime> m_playbackWithoutUserGestureStartedTime; > > String m_subtitleTrackLanguage; > MediaTime m_lastTextTrackUpdateTime { -1, 1 }; > >- std::optional<CaptionUserPreferences::CaptionDisplayMode> m_captionDisplayMode; >+ Optional<CaptionUserPreferences::CaptionDisplayMode> m_captionDisplayMode; > > RefPtr<AudioTrackList> m_audioTracks; > RefPtr<TextTrackList> m_textTracks; >diff --git a/Source/WebCore/html/HTMLOListElement.cpp b/Source/WebCore/html/HTMLOListElement.cpp >index eff762905edbb6c85d578ba3c4aaee047f7e797d..4cd8659e59c4aed0a08f3e5961c5adcc64b7cebd 100644 >--- a/Source/WebCore/html/HTMLOListElement.cpp >+++ b/Source/WebCore/html/HTMLOListElement.cpp >@@ -30,11 +30,11 @@ > #include "RenderListItem.h" > #include <wtf/IsoMallocInlines.h> > >-// FIXME: There should be a standard way to turn a std::expected into a std::optional. >+// FIXME: There should be a standard way to turn a std::expected into a Optional. > // Maybe we should put this into the header file for Expected and give it a better name. >-template<typename T, typename E> inline std::optional<T> optionalValue(Expected<T, E>&& expected) >+template<typename T, typename E> inline Optional<T> optionalValue(Expected<T, E>&& expected) > { >- return expected ? std::optional<T>(WTFMove(expected.value())) : std::nullopt; >+ return expected ? Optional<T>(WTFMove(expected.value())) : WTF::nullopt; > } > > namespace WebCore { >diff --git a/Source/WebCore/html/HTMLOListElement.h b/Source/WebCore/html/HTMLOListElement.h >index c2bed0be233f782c167c70e9865bb764843a9c7c..5f4d9efdad5d3de0601a06a0fe30ab20ee2d6d3f 100644 >--- a/Source/WebCore/html/HTMLOListElement.h >+++ b/Source/WebCore/html/HTMLOListElement.h >@@ -41,7 +41,7 @@ public: > > int start() const { return m_start ? m_start.value() : (m_isReversed ? itemCount() : 1); } > bool isReversed() const { return m_isReversed; } >- void itemCountChanged() { m_itemCount = std::nullopt; } >+ void itemCountChanged() { m_itemCount = WTF::nullopt; } > > private: > HTMLOListElement(const QualifiedName&, Document&); >@@ -52,8 +52,8 @@ private: > bool isPresentationAttribute(const QualifiedName&) const final; > void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final; > >- std::optional<int> m_start; >- mutable std::optional<unsigned> m_itemCount; >+ Optional<int> m_start; >+ mutable Optional<unsigned> m_itemCount; > bool m_isReversed { false }; > }; > >diff --git a/Source/WebCore/html/HTMLOptionsCollection.cpp b/Source/WebCore/html/HTMLOptionsCollection.cpp >index 1c4b3d119e40ff6534573e0db0a0ff5c2eb3caaa..22681b066bcc057b4fcf4b3a38200086c10a357f 100644 >--- a/Source/WebCore/html/HTMLOptionsCollection.cpp >+++ b/Source/WebCore/html/HTMLOptionsCollection.cpp >@@ -33,7 +33,7 @@ Ref<HTMLOptionsCollection> HTMLOptionsCollection::create(HTMLSelectElement& sele > return adoptRef(*new HTMLOptionsCollection(select)); > } > >-ExceptionOr<void> HTMLOptionsCollection::add(const OptionOrOptGroupElement& element, const std::optional<HTMLElementOrInt>& before) >+ExceptionOr<void> HTMLOptionsCollection::add(const OptionOrOptGroupElement& element, const Optional<HTMLElementOrInt>& before) > { > return selectElement().add(element, before); > } >diff --git a/Source/WebCore/html/HTMLOptionsCollection.h b/Source/WebCore/html/HTMLOptionsCollection.h >index 983a38feb49238942dfb16f6e5bf1b8d6d26652a..0d4bf98e1e49319c191499687cffc0219ff2656c 100644 >--- a/Source/WebCore/html/HTMLOptionsCollection.h >+++ b/Source/WebCore/html/HTMLOptionsCollection.h >@@ -45,7 +45,7 @@ public: > > using OptionOrOptGroupElement = Variant<RefPtr<HTMLOptionElement>, RefPtr<HTMLOptGroupElement>>; > using HTMLElementOrInt = Variant<RefPtr<HTMLElement>, int>; >- WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const std::optional<HTMLElementOrInt>& before); >+ WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const Optional<HTMLElementOrInt>& before); > WEBCORE_EXPORT void remove(int index); > > WEBCORE_EXPORT int selectedIndex() const; >diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp >index c1740b77477cf23cb86406bd4d654264e91a1c3f..d499b91b80d014353b8f36ab1f08f7bb53dffd39 100644 >--- a/Source/WebCore/html/HTMLSelectElement.cpp >+++ b/Source/WebCore/html/HTMLSelectElement.cpp >@@ -222,7 +222,7 @@ int HTMLSelectElement::activeSelectionEndListIndex() const > return lastSelectedListIndex(); > } > >-ExceptionOr<void> HTMLSelectElement::add(const OptionOrOptGroupElement& element, const std::optional<HTMLElementOrInt>& before) >+ExceptionOr<void> HTMLSelectElement::add(const OptionOrOptGroupElement& element, const Optional<HTMLElementOrInt>& before) > { > RefPtr<HTMLElement> beforeElement; > if (before) { >@@ -467,7 +467,7 @@ ExceptionOr<void> HTMLSelectElement::setLength(unsigned newLength) > > if (diff < 0) { // Add dummy elements. > do { >- auto result = add(HTMLOptionElement::create(document()).ptr(), std::nullopt); >+ auto result = add(HTMLOptionElement::create(document()).ptr(), WTF::nullopt); > if (result.hasException()) > return result; > } while (++diff); >diff --git a/Source/WebCore/html/HTMLSelectElement.h b/Source/WebCore/html/HTMLSelectElement.h >index 26ebda8f225e7f870df57c799409462271f91d16..4eca39626d91fa7a32ea70ca2175e6a8f6575d22 100644 >--- a/Source/WebCore/html/HTMLSelectElement.h >+++ b/Source/WebCore/html/HTMLSelectElement.h >@@ -54,7 +54,7 @@ public: > > using OptionOrOptGroupElement = Variant<RefPtr<HTMLOptionElement>, RefPtr<HTMLOptGroupElement>>; > using HTMLElementOrInt = Variant<RefPtr<HTMLElement>, int>; >- WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const std::optional<HTMLElementOrInt>& before); >+ WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const Optional<HTMLElementOrInt>& before); > > using Node::remove; > WEBCORE_EXPORT void remove(int); >diff --git a/Source/WebCore/html/HTMLSourceElement.cpp b/Source/WebCore/html/HTMLSourceElement.cpp >index d3e88d35d9873fa928a33dcb4e65d78ffa249d07..cfdeb535229e94dcfe3aeb8cd4bc96b2885c959a 100644 >--- a/Source/WebCore/html/HTMLSourceElement.cpp >+++ b/Source/WebCore/html/HTMLSourceElement.cpp >@@ -160,7 +160,7 @@ void HTMLSourceElement::parseAttribute(const QualifiedName& name, const AtomicSt > HTMLElement::parseAttribute(name, value); > if (name == srcsetAttr || name == sizesAttr || name == mediaAttr || name == typeAttr) { > if (name == mediaAttr) >- m_cachedParsedMediaAttribute = std::nullopt; >+ m_cachedParsedMediaAttribute = WTF::nullopt; > auto parent = makeRefPtr(parentNode()); > if (is<HTMLPictureElement>(parent)) > downcast<HTMLPictureElement>(*parent).sourcesChanged(); >diff --git a/Source/WebCore/html/HTMLSourceElement.h b/Source/WebCore/html/HTMLSourceElement.h >index 3204f54a1029f24a33f93a60e6d6c334b3bff578..4f64854e28a2a950e84a23d7989c3cab5b775bbd 100644 >--- a/Source/WebCore/html/HTMLSourceElement.h >+++ b/Source/WebCore/html/HTMLSourceElement.h >@@ -63,7 +63,7 @@ private: > > Timer m_errorEventTimer; > bool m_shouldRescheduleErrorEventOnResume { false }; >- mutable std::optional<RefPtr<const MediaQuerySet>> m_cachedParsedMediaAttribute; >+ mutable Optional<RefPtr<const MediaQuerySet>> m_cachedParsedMediaAttribute; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/html/ImageBitmap.cpp b/Source/WebCore/html/ImageBitmap.cpp >index d1a4814c2404ca072bbb3946dca5857ef3f62d31..6b2ee1849e49ef575386dedb15efdb455c84183f 100644 >--- a/Source/WebCore/html/ImageBitmap.cpp >+++ b/Source/WebCore/html/ImageBitmap.cpp >@@ -76,7 +76,7 @@ void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, > { > WTF::switchOn(source, > [&] (auto& specificSource) { >- createPromise(scriptExecutionContext, specificSource, WTFMove(options), std::nullopt, WTFMove(promise)); >+ createPromise(scriptExecutionContext, specificSource, WTFMove(options), WTF::nullopt, WTFMove(promise)); > } > ); > } >@@ -147,7 +147,7 @@ static bool taintsOrigin(SecurityOrigin* origin, HTMLVideoElement& video) > #endif > > // https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#cropped-to-the-source-rectangle-with-formatting >-static ExceptionOr<IntRect> croppedSourceRectangleWithFormatting(IntSize inputSize, ImageBitmapOptions& options, std::optional<IntRect> rect) >+static ExceptionOr<IntRect> croppedSourceRectangleWithFormatting(IntSize inputSize, ImageBitmapOptions& options, Optional<IntRect> rect) > { > // 2. If either or both of resizeWidth and resizeHeight members of options are less > // than or equal to 0, then return a promise rejected with "InvalidStateError" >@@ -250,7 +250,7 @@ static InterpolationQuality interpolationQualityForResizeQuality(ImageBitmapOpti > > // 13. Return output. > >-void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<HTMLImageElement>& imageElement, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<HTMLImageElement>& imageElement, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > { > // 2. If image is not completely available, then return a promise rejected with > // an "InvalidStateError" DOMException and abort these steps. >@@ -338,7 +338,7 @@ void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<HTMLImageElement > promise.resolve(WTFMove(imageBitmap)); > } > >-void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<HTMLCanvasElement>& canvasElement, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<HTMLCanvasElement>& canvasElement, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > { > // 2. If the canvas element's bitmap has either a horizontal dimension or a vertical > // dimension equal to zero, then return a promise rejected with an "InvalidStateError" >@@ -388,7 +388,7 @@ void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<HTMLCanvasElemen > } > > #if ENABLE(VIDEO) >-void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, RefPtr<HTMLVideoElement>& video, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, RefPtr<HTMLVideoElement>& video, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > { > // https://html.spec.whatwg.org/multipage/#dom-createimagebitmap > // WHATWG HTML 2102913b313078cd8eeac7e81e6a8756cbd3e773 >@@ -450,13 +450,13 @@ void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, > #endif > > #if ENABLE(CSS_TYPED_OM) >-void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, std::optional<IntRect>, ImageBitmap::Promise&& promise) >+void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, Optional<IntRect>, ImageBitmap::Promise&& promise) > { > promise.reject(InvalidStateError, "Not implemented"); > } > #endif > >-void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>& existingImageBitmap, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>& existingImageBitmap, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > { > // 2. If image's [[Detached]] internal slot value is true, return a promise > // rejected with an "InvalidStateError" DOMException and abort these steps. >@@ -529,14 +529,14 @@ private: > > class PendingImageBitmap final : public ActiveDOMObject, public FileReaderLoaderClient { > public: >- static void fetch(ScriptExecutionContext& scriptExecutionContext, RefPtr<Blob>&& blob, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+ static void fetch(ScriptExecutionContext& scriptExecutionContext, RefPtr<Blob>&& blob, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > { > auto pendingImageBitmap = new PendingImageBitmap(scriptExecutionContext, WTFMove(blob), WTFMove(options), WTFMove(rect), WTFMove(promise)); > pendingImageBitmap->start(scriptExecutionContext); > } > > private: >- PendingImageBitmap(ScriptExecutionContext& scriptExecutionContext, RefPtr<Blob>&& blob, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+ PendingImageBitmap(ScriptExecutionContext& scriptExecutionContext, RefPtr<Blob>&& blob, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > : ActiveDOMObject(&scriptExecutionContext) > , m_blobLoader(FileReaderLoader::ReadAsArrayBuffer, this) > , m_blob(WTFMove(blob)) >@@ -600,7 +600,7 @@ private: > FileReaderLoader m_blobLoader; > RefPtr<Blob> m_blob; > ImageBitmapOptions m_options; >- std::optional<IntRect> m_rect; >+ Optional<IntRect> m_rect; > ImageBitmap::Promise m_promise; > }; > >@@ -610,7 +610,7 @@ void ImageBitmap::createFromBuffer( > long long expectedContentLength, > const URL& sourceUrl, > ImageBitmapOptions&& options, >- std::optional<IntRect> rect, >+ Optional<IntRect> rect, > ImageBitmap::Promise&& promise) > { > if (!arrayBuffer->byteLength()) { >@@ -656,13 +656,13 @@ void ImageBitmap::createFromBuffer( > promise.resolve(WTFMove(imageBitmap)); > } > >-void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, RefPtr<Blob>& blob, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, RefPtr<Blob>& blob, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > { > // 2. Return a new promise, but continue running these steps in parallel. > PendingImageBitmap::fetch(scriptExecutionContext, WTFMove(blob), WTFMove(options), WTFMove(rect), WTFMove(promise)); > } > >-void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<ImageData>& imageData, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) >+void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<ImageData>& imageData, ImageBitmapOptions&& options, Optional<IntRect> rect, ImageBitmap::Promise&& promise) > { > UNUSED_PARAM(imageData); > UNUSED_PARAM(options); >diff --git a/Source/WebCore/html/ImageBitmap.h b/Source/WebCore/html/ImageBitmap.h >index cbd1f7dd958c9fd9be41f374a4ccef5324d9893d..dd4863317594b39ed7e50de3253e22ee60ce4036 100644 >--- a/Source/WebCore/html/ImageBitmap.h >+++ b/Source/WebCore/html/ImageBitmap.h >@@ -94,16 +94,16 @@ private: > static Ref<ImageBitmap> create(std::unique_ptr<ImageBuffer>&&); > ImageBitmap(std::unique_ptr<ImageBuffer>&&); > >- static void createPromise(ScriptExecutionContext&, RefPtr<HTMLImageElement>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<HTMLImageElement>&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); > #if ENABLE(VIDEO) >- static void createPromise(ScriptExecutionContext&, RefPtr<HTMLVideoElement>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<HTMLVideoElement>&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); > #endif >- static void createPromise(ScriptExecutionContext&, RefPtr<HTMLCanvasElement>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >- static void createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >- static void createPromise(ScriptExecutionContext&, RefPtr<Blob>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >- static void createPromise(ScriptExecutionContext&, RefPtr<ImageData>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >- static void createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >- static void createFromBuffer(Ref<ArrayBuffer>&&, String mimeType, long long expectedContentLength, const URL&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<HTMLCanvasElement>&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<Blob>&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<ImageData>&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); >+ static void createFromBuffer(Ref<ArrayBuffer>&&, String mimeType, long long expectedContentLength, const URL&, ImageBitmapOptions&&, Optional<IntRect>, Promise&&); > > std::unique_ptr<ImageBuffer> m_bitmapData; > bool m_detached { false }; >diff --git a/Source/WebCore/html/ImageBitmapOptions.h b/Source/WebCore/html/ImageBitmapOptions.h >index d5f09b7d1f9ee7b38a79fbc839d89d49fed1c60e..61a0b3a74b9cf705cfdb1d9030ae834f0841105a 100644 >--- a/Source/WebCore/html/ImageBitmapOptions.h >+++ b/Source/WebCore/html/ImageBitmapOptions.h >@@ -38,8 +38,8 @@ struct ImageBitmapOptions { > Orientation imageOrientation { Orientation::None }; > PremultiplyAlpha premultiplyAlpha { PremultiplyAlpha::Default }; > ColorSpaceConversion colorSpaceConversion { ColorSpaceConversion::Default }; >- std::optional<unsigned> resizeWidth; >- std::optional<unsigned> resizeHeight; >+ Optional<unsigned> resizeWidth; >+ Optional<unsigned> resizeHeight; > ResizeQuality resizeQuality { ResizeQuality::Low }; > }; > >diff --git a/Source/WebCore/html/ImageData.cpp b/Source/WebCore/html/ImageData.cpp >index 3b2a23663d107731d3271b643813451a1318756d..06462ae84c4e5d3edc033a16324f440168b2ad69 100644 >--- a/Source/WebCore/html/ImageData.cpp >+++ b/Source/WebCore/html/ImageData.cpp >@@ -77,7 +77,7 @@ RefPtr<ImageData> ImageData::create(const IntSize& size, Ref<Uint8ClampedArray>& > return adoptRef(*new ImageData(size, WTFMove(byteArray))); > } > >-ExceptionOr<RefPtr<ImageData>> ImageData::create(Ref<Uint8ClampedArray>&& byteArray, unsigned sw, std::optional<unsigned> sh) >+ExceptionOr<RefPtr<ImageData>> ImageData::create(Ref<Uint8ClampedArray>&& byteArray, unsigned sw, Optional<unsigned> sh) > { > unsigned length = byteArray->length(); > if (!length || length % 4) >diff --git a/Source/WebCore/html/ImageData.h b/Source/WebCore/html/ImageData.h >index a0ffa298718bf277e8a16b613e5758a7872c22f3..f798850f3e27c34728e0bb509735ba8e81a5518b 100644 >--- a/Source/WebCore/html/ImageData.h >+++ b/Source/WebCore/html/ImageData.h >@@ -39,7 +39,7 @@ public: > WEBCORE_EXPORT static ExceptionOr<Ref<ImageData>> create(unsigned sw, unsigned sh); > WEBCORE_EXPORT static RefPtr<ImageData> create(const IntSize&); > WEBCORE_EXPORT static RefPtr<ImageData> create(const IntSize&, Ref<Uint8ClampedArray>&&); >- WEBCORE_EXPORT static ExceptionOr<RefPtr<ImageData>> create(Ref<Uint8ClampedArray>&&, unsigned sw, std::optional<unsigned> sh); >+ WEBCORE_EXPORT static ExceptionOr<RefPtr<ImageData>> create(Ref<Uint8ClampedArray>&&, unsigned sw, Optional<unsigned> sh); > > IntSize size() const { return m_size; } > int width() const { return m_size.width(); } >diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp >index 15aa139240af9e5152a1378e6538ceb4058da5ec..c43ebf88f5929ce0c5038d1b7beecb058be357b2 100644 >--- a/Source/WebCore/html/InputType.cpp >+++ b/Source/WebCore/html/InputType.cpp >@@ -924,10 +924,10 @@ void InputType::listAttributeTargetChanged() > { > } > >-std::optional<Decimal> InputType::findClosestTickMarkValue(const Decimal&) >+Optional<Decimal> InputType::findClosestTickMarkValue(const Decimal&) > { > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > #endif > >diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h >index 7a01d20b2b989195a3ed94c6de61d2109488fc26..b5256e06546e839de6b50d25a7bae650e925da93 100644 >--- a/Source/WebCore/html/InputType.h >+++ b/Source/WebCore/html/InputType.h >@@ -298,7 +298,7 @@ public: > > #if ENABLE(DATALIST_ELEMENT) > virtual void listAttributeTargetChanged(); >- virtual std::optional<Decimal> findClosestTickMarkValue(const Decimal&); >+ virtual Optional<Decimal> findClosestTickMarkValue(const Decimal&); > #endif > > #if ENABLE(DRAG_SUPPORT) >diff --git a/Source/WebCore/html/LinkIconCollector.cpp b/Source/WebCore/html/LinkIconCollector.cpp >index 6a749d9a9b00de7d30e21e1027aec15a4f378951..ee25d8125f732ae72704bbc6b5fb5b8bd1817580 100644 >--- a/Source/WebCore/html/LinkIconCollector.cpp >+++ b/Source/WebCore/html/LinkIconCollector.cpp >@@ -95,7 +95,7 @@ auto LinkIconCollector::iconsOfTypes(OptionSet<LinkIconType> iconTypes) -> Vecto > // This icon size parsing is a little wonky - it only parses the first > // part of the size, "60x70" becomes "60". This is for compatibility reasons > // and is probably good enough for now. >- std::optional<unsigned> iconSize; >+ Optional<unsigned> iconSize; > > if (linkElement.sizes().length()) { > bool ok; >diff --git a/Source/WebCore/html/LinkRelAttribute.h b/Source/WebCore/html/LinkRelAttribute.h >index 3ab094d4b7442a5fbffd7eef2b94d162f2c091f3..ac1a39db9aa52f4ffe83ae680cbd45dd7d6a06d1 100644 >--- a/Source/WebCore/html/LinkRelAttribute.h >+++ b/Source/WebCore/html/LinkRelAttribute.h >@@ -42,7 +42,7 @@ enum class LinkIconType; > > struct LinkRelAttribute { > bool isStyleSheet { false }; >- std::optional<LinkIconType> iconType; >+ Optional<LinkIconType> iconType; > bool isAlternate { false }; > bool isDNSPrefetch { false }; > bool isLinkPreload { false }; >diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp >index 4bf8898b40364427d29085d717556b3bf02d5f6d..6ac3b01e825190ec5b6c28e0d37943e0848f555a 100644 >--- a/Source/WebCore/html/RangeInputType.cpp >+++ b/Source/WebCore/html/RangeInputType.cpp >@@ -409,11 +409,11 @@ void RangeInputType::updateTickMarkValues() > std::sort(m_tickMarkValues.begin(), m_tickMarkValues.end()); > } > >-std::optional<Decimal> RangeInputType::findClosestTickMarkValue(const Decimal& value) >+Optional<Decimal> RangeInputType::findClosestTickMarkValue(const Decimal& value) > { > updateTickMarkValues(); > if (!m_tickMarkValues.size()) >- return std::nullopt; >+ return WTF::nullopt; > > size_t left = 0; > size_t right = m_tickMarkValues.size(); >@@ -436,8 +436,8 @@ std::optional<Decimal> RangeInputType::findClosestTickMarkValue(const Decimal& v > right = middle; > } > >- std::optional<Decimal> closestLeft = middle ? std::make_optional(m_tickMarkValues[middle - 1]) : std::nullopt; >- std::optional<Decimal> closestRight = middle != m_tickMarkValues.size() ? std::make_optional(m_tickMarkValues[middle]) : std::nullopt; >+ Optional<Decimal> closestLeft = middle ? makeOptional(m_tickMarkValues[middle - 1]) : WTF::nullopt; >+ Optional<Decimal> closestRight = middle != m_tickMarkValues.size() ? makeOptional(m_tickMarkValues[middle]) : WTF::nullopt; > > if (!closestLeft) > return closestRight; >diff --git a/Source/WebCore/html/RangeInputType.h b/Source/WebCore/html/RangeInputType.h >index 1fc35bd410feab69e5b9ee3c5f705b83da9f1819..706642b9e52cc3b91af6abd6cbf1e215b6e831d8 100644 >--- a/Source/WebCore/html/RangeInputType.h >+++ b/Source/WebCore/html/RangeInputType.h >@@ -72,7 +72,7 @@ private: > #if ENABLE(DATALIST_ELEMENT) > void listAttributeTargetChanged() final; > void updateTickMarkValues(); >- std::optional<Decimal> findClosestTickMarkValue(const Decimal&) final; >+ Optional<Decimal> findClosestTickMarkValue(const Decimal&) final; > > bool m_tickMarkValuesDirty { true }; > Vector<Decimal> m_tickMarkValues; >diff --git a/Source/WebCore/html/URLSearchParams.cpp b/Source/WebCore/html/URLSearchParams.cpp >index 4e7fbaefdf0a416cc654aa73d59b7be80b41d0f8..d3fdd30dee68b53f4b783b4186fd8a2f1dff8daa 100644 >--- a/Source/WebCore/html/URLSearchParams.cpp >+++ b/Source/WebCore/html/URLSearchParams.cpp >@@ -149,11 +149,11 @@ void URLSearchParams::updateFromAssociatedURL() > m_pairs = search.startsWith('?') ? WTF::URLParser::parseURLEncodedForm(StringView(search).substring(1)) : WTF::URLParser::parseURLEncodedForm(search); > } > >-std::optional<WTF::KeyValuePair<String, String>> URLSearchParams::Iterator::next() >+Optional<WTF::KeyValuePair<String, String>> URLSearchParams::Iterator::next() > { > auto& pairs = m_target->pairs(); > if (m_index >= pairs.size()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& pair = pairs[m_index++]; > return WTF::KeyValuePair<String, String> { pair.key, pair.value }; >diff --git a/Source/WebCore/html/URLSearchParams.h b/Source/WebCore/html/URLSearchParams.h >index 3e4bfa614851e33a9fa3a34df25669aafc34fb61..882a5455b87e36e75f4637743bca60e9d3796ffc 100644 >--- a/Source/WebCore/html/URLSearchParams.h >+++ b/Source/WebCore/html/URLSearchParams.h >@@ -53,7 +53,7 @@ public: > class Iterator { > public: > explicit Iterator(URLSearchParams&); >- std::optional<WTF::KeyValuePair<String, String>> next(); >+ Optional<WTF::KeyValuePair<String, String>> next(); > > private: > Ref<URLSearchParams> m_target; >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >index 28638c6c83a5ddca1c3afd0bfc606d14ba018853..77b6df21aaa3cc44bef6355aae323cd5f8e3cd7f 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >@@ -323,12 +323,12 @@ void CanvasRenderingContext2D::setDirection(CanvasDirection direction) > modifiableState().direction = direction; > } > >-void CanvasRenderingContext2D::fillText(const String& text, float x, float y, std::optional<float> maxWidth) >+void CanvasRenderingContext2D::fillText(const String& text, float x, float y, Optional<float> maxWidth) > { > drawTextInternal(text, x, y, true, maxWidth); > } > >-void CanvasRenderingContext2D::strokeText(const String& text, float x, float y, std::optional<float> maxWidth) >+void CanvasRenderingContext2D::strokeText(const String& text, float x, float y, Optional<float> maxWidth) > { > drawTextInternal(text, x, y, false, maxWidth); > } >@@ -457,7 +457,7 @@ FloatPoint CanvasRenderingContext2D::textOffset(float width, TextDirection direc > return offset; > } > >-void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, float y, bool fill, std::optional<float> maxWidth) >+void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, float y, bool fill, Optional<float> maxWidth) > { > if (RuntimeEnabledFeatures::sharedFeatures().webAPIStatisticsEnabled()) > ResourceLoadObserver::shared().logCanvasWriteOrMeasure(this->canvas().document(), text); >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.h b/Source/WebCore/html/canvas/CanvasRenderingContext2D.h >index e67160ae8aa56b30c0267573253ebb35afa50d89..317eccc424d35c6a0818e58c1c365ec553ba5ee0 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.h >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.h >@@ -62,8 +62,8 @@ public: > CanvasDirection direction() const; > void setDirection(CanvasDirection); > >- void fillText(const String& text, float x, float y, std::optional<float> maxWidth = std::nullopt); >- void strokeText(const String& text, float x, float y, std::optional<float> maxWidth = std::nullopt); >+ void fillText(const String& text, float x, float y, Optional<float> maxWidth = WTF::nullopt); >+ void strokeText(const String& text, float x, float y, Optional<float> maxWidth = WTF::nullopt); > Ref<TextMetrics> measureText(const String& text); > > bool is2d() const override { return true; } >@@ -75,7 +75,7 @@ private: > // Therefore, all font operations must pass through the State. > const FontProxy& fontProxy(); > >- void drawTextInternal(const String& text, float x, float y, bool fill, std::optional<float> maxWidth = std::nullopt); >+ void drawTextInternal(const String& text, float x, float y, bool fill, Optional<float> maxWidth = WTF::nullopt); > > void drawFocusIfNeededInternal(const Path&, Element&); > >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >index c139a026914d995de2a126f91167476806bdf6c2..8bf7f03e002e96b481e3f5ef1f299478a282e2b0 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >@@ -387,7 +387,7 @@ void CanvasRenderingContext2DBase::restore() > return; > m_path.transform(state().transform); > m_stateStack.removeLast(); >- if (std::optional<AffineTransform> inverse = state().transform.inverse()) >+ if (Optional<AffineTransform> inverse = state().transform.inverse()) > m_path.transform(inverse.value()); > GraphicsContext* c = drawingContext(); > if (!c) >@@ -939,7 +939,7 @@ void CanvasRenderingContext2DBase::resetTransform() > modifiableState().hasInvertibleTransform = true; > } > >-void CanvasRenderingContext2DBase::setStrokeColor(const String& color, std::optional<float> alpha) >+void CanvasRenderingContext2DBase::setStrokeColor(const String& color, Optional<float> alpha) > { > if (alpha) { > setStrokeStyle(CanvasStyle::createFromStringWithOverrideAlpha(color, alpha.value())); >@@ -975,7 +975,7 @@ void CanvasRenderingContext2DBase::setStrokeColor(float c, float m, float y, flo > setStrokeStyle(CanvasStyle(c, m, y, k, a)); > } > >-void CanvasRenderingContext2DBase::setFillColor(const String& color, std::optional<float> alpha) >+void CanvasRenderingContext2DBase::setFillColor(const String& color, Optional<float> alpha) > { > if (alpha) { > setFillStyle(CanvasStyle::createFromStringWithOverrideAlpha(color, alpha.value())); >@@ -1339,7 +1339,7 @@ void CanvasRenderingContext2DBase::strokeRect(float x, float y, float width, flo > } > } > >-void CanvasRenderingContext2DBase::setShadow(float width, float height, float blur, const String& colorString, std::optional<float> alpha) >+void CanvasRenderingContext2DBase::setShadow(float width, float height, float blur, const String& colorString, Optional<float> alpha) > { > Color color = Color::transparent; > if (!colorString.isNull()) { >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h >index a14b605aa892ff43ebc418848a82fc35a8ec376c..6b3c800a9d58d0b8894789270c3214edc80e8140 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h >@@ -135,12 +135,12 @@ public: > ExceptionOr<void> setTransform(DOMMatrix2DInit&&); > void resetTransform(); > >- void setStrokeColor(const String& color, std::optional<float> alpha = std::nullopt); >+ void setStrokeColor(const String& color, Optional<float> alpha = WTF::nullopt); > void setStrokeColor(float grayLevel, float alpha = 1.0); > void setStrokeColor(float r, float g, float b, float a); > void setStrokeColor(float c, float m, float y, float k, float a); > >- void setFillColor(const String& color, std::optional<float> alpha = std::nullopt); >+ void setFillColor(const String& color, Optional<float> alpha = WTF::nullopt); > void setFillColor(float grayLevel, float alpha = 1.0f); > void setFillColor(float r, float g, float b, float a); > void setFillColor(float c, float m, float y, float k, float a); >@@ -165,7 +165,7 @@ public: > void fillRect(float x, float y, float width, float height); > void strokeRect(float x, float y, float width, float height); > >- void setShadow(float width, float height, float blur, const String& color = String(), std::optional<float> alpha = std::nullopt); >+ void setShadow(float width, float height, float blur, const String& color = String(), Optional<float> alpha = WTF::nullopt); > void setShadow(float width, float height, float blur, float grayLevel, float alpha = 1.0); > void setShadow(float width, float height, float blur, float r, float g, float b, float a); > void setShadow(float width, float height, float blur, float c, float m, float y, float k, float a); >diff --git a/Source/WebCore/html/canvas/CanvasStyle.cpp b/Source/WebCore/html/canvas/CanvasStyle.cpp >index aca8a60d8c62b3ece8aaed4853a59001829bc1da..ca6f35de02062b7eb0e6e22503d76cacdcdf081c 100644 >--- a/Source/WebCore/html/canvas/CanvasStyle.cpp >+++ b/Source/WebCore/html/canvas/CanvasStyle.cpp >@@ -112,7 +112,7 @@ inline CanvasStyle::CanvasStyle(CurrentColor color) > CanvasStyle CanvasStyle::createFromString(const String& colorString) > { > if (isCurrentColorString(colorString)) >- return CurrentColor { std::nullopt }; >+ return CurrentColor { WTF::nullopt }; > > Color color = parseColor(colorString); > if (!color.isValid()) >diff --git a/Source/WebCore/html/canvas/CanvasStyle.h b/Source/WebCore/html/canvas/CanvasStyle.h >index bead14e2c0cab6b62b9fa282282a71c1884bf88f..68d578cd74258e44b69dc13f0dc59ac19c58cb0b 100644 >--- a/Source/WebCore/html/canvas/CanvasStyle.h >+++ b/Source/WebCore/html/canvas/CanvasStyle.h >@@ -79,7 +79,7 @@ private: > }; > > struct CurrentColor { >- std::optional<float> overrideAlpha; >+ Optional<float> overrideAlpha; > }; > > CanvasStyle(CurrentColor); >diff --git a/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp b/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp >index 45cdeee695a9f278c1c31b6a9b7d10205f6c489b..4a835f73da9e2fed963cb166b264f1d12420c1d6 100644 >--- a/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp >+++ b/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp >@@ -113,12 +113,12 @@ void WebGL2RenderingContext::initializeShaderExtensions() > m_context->getExtensions().ensureEnabled("GL_EXT_frag_depth"); > } > >-inline static std::optional<unsigned> arrayBufferViewElementSize(const ArrayBufferView& data) >+inline static Optional<unsigned> arrayBufferViewElementSize(const ArrayBufferView& data) > { > switch (data.getType()) { > case JSC::NotTypedArray: > case JSC::TypeDataView: >- return std::nullopt; >+ return WTF::nullopt; > case JSC::TypeInt8: > case JSC::TypeUint8: > case JSC::TypeUint8Clamped: >@@ -1236,10 +1236,10 @@ WebGLAny WebGL2RenderingContext::getIndexedParameter(GC3Denum target, GC3Duint) > } > } > >-std::optional<Vector<GC3Duint>> WebGL2RenderingContext::getUniformIndices(WebGLProgram&, const Vector<String>&) >+Optional<Vector<GC3Duint>> WebGL2RenderingContext::getUniformIndices(WebGLProgram&, const Vector<String>&) > { > LOG(WebGL, "[[ NOT IMPLEMENTED ]] getUniformIndices()"); >- return std::nullopt; >+ return WTF::nullopt; > } > > WebGLAny WebGL2RenderingContext::getActiveUniforms(WebGLProgram& program, const Vector<GC3Duint>& uniformIndices, GC3Denum pname) >@@ -1380,10 +1380,10 @@ WebGLExtension* WebGL2RenderingContext::getExtension(const String& name) > return nullptr; > } > >-std::optional<Vector<String>> WebGL2RenderingContext::getSupportedExtensions() >+Optional<Vector<String>> WebGL2RenderingContext::getSupportedExtensions() > { > if (isContextLost()) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<String> result; > >@@ -2106,7 +2106,7 @@ bool WebGL2RenderingContext::validateIndexArrayConservative(GC3Denum type, unsig > auto buffer = elementArrayBuffer->elementArrayBuffer(); > ASSERT(buffer); > >- std::optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type); >+ Optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type); > if (!maxIndex) { > // Compute the maximum index in the entire buffer for the given type of index. > switch (type) { >diff --git a/Source/WebCore/html/canvas/WebGL2RenderingContext.h b/Source/WebCore/html/canvas/WebGL2RenderingContext.h >index 6407976833fe07be22f654cfd4566b496c57056e..fe9759515fad5e8006f84d2bf46613c0faf5169c 100644 >--- a/Source/WebCore/html/canvas/WebGL2RenderingContext.h >+++ b/Source/WebCore/html/canvas/WebGL2RenderingContext.h >@@ -184,7 +184,7 @@ public: > void bindBufferBase(GC3Denum target, GC3Duint index, WebGLBuffer*); > void bindBufferRange(GC3Denum target, GC3Duint index, WebGLBuffer*, GC3Dint64 offset, GC3Dint64 size); > WebGLAny getIndexedParameter(GC3Denum target, GC3Duint index); >- std::optional<Vector<GC3Duint>> getUniformIndices(WebGLProgram&, const Vector<String>& uniformNames); >+ Optional<Vector<GC3Duint>> getUniformIndices(WebGLProgram&, const Vector<String>& uniformNames); > WebGLAny getActiveUniforms(WebGLProgram&, const Vector<GC3Duint>& uniformIndices, GC3Denum pname); > GC3Duint getUniformBlockIndex(WebGLProgram&, const String& uniformBlockName); > WebGLAny getActiveUniformBlockParameter(WebGLProgram&, GC3Duint uniformBlockIndex, GC3Denum pname); >@@ -198,7 +198,7 @@ public: > void bindVertexArray(WebGLVertexArrayObject* vertexArray); > > WebGLExtension* getExtension(const String&) final; >- std::optional<Vector<String>> getSupportedExtensions() final; >+ Optional<Vector<String>> getSupportedExtensions() final; > WebGLAny getParameter(GC3Denum pname) final; > > void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) final; >diff --git a/Source/WebCore/html/canvas/WebGLBuffer.cpp b/Source/WebCore/html/canvas/WebGLBuffer.cpp >index bc914a4a782fce41078211ffcc1e80a1e993e2e7..61a62a5dc6d95fccd41582dd2e464e9a95142249 100644 >--- a/Source/WebCore/html/canvas/WebGLBuffer.cpp >+++ b/Source/WebCore/html/canvas/WebGLBuffer.cpp >@@ -228,13 +228,13 @@ GC3Dsizeiptr WebGLBuffer::byteLength() const > return m_byteLength; > } > >-std::optional<unsigned> WebGLBuffer::getCachedMaxIndex(GC3Denum type) >+Optional<unsigned> WebGLBuffer::getCachedMaxIndex(GC3Denum type) > { > for (auto& cache : m_maxIndexCache) { > if (cache.type == type) > return cache.maxIndex; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > void WebGLBuffer::setCachedMaxIndex(GC3Denum type, unsigned value) >diff --git a/Source/WebCore/html/canvas/WebGLBuffer.h b/Source/WebCore/html/canvas/WebGLBuffer.h >index c396b3a46be6ffc75eefff9e40546722cc5c0533..c9a9934e21c020192f0a443b40d2eaa2daa7db61 100644 >--- a/Source/WebCore/html/canvas/WebGLBuffer.h >+++ b/Source/WebCore/html/canvas/WebGLBuffer.h >@@ -53,7 +53,7 @@ public: > const RefPtr<JSC::ArrayBuffer> elementArrayBuffer() const { return m_elementArrayBuffer; } > > // Gets the cached max index for the given type if one has been set. >- std::optional<unsigned> getCachedMaxIndex(GC3Denum type); >+ Optional<unsigned> getCachedMaxIndex(GC3Denum type); > // Sets the cached max index for the given type. > void setCachedMaxIndex(GC3Denum type, unsigned value); > >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp >index b7a989a8d2d3d4b9768e2c9f681524b512a2fdfe..642372995001a7db1252d0ed945302738f4afbd7 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp >@@ -179,10 +179,10 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name) > return nullptr; > } > >-std::optional<Vector<String>> WebGLRenderingContext::getSupportedExtensions() >+Optional<Vector<String>> WebGLRenderingContext::getSupportedExtensions() > { > if (isContextLost()) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<String> result; > >@@ -691,7 +691,7 @@ bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, unsign > auto buffer = elementArrayBuffer->elementArrayBuffer(); > ASSERT(buffer); > >- std::optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type); >+ Optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type); > if (!maxIndex) { > // Compute the maximum index in the entire buffer for the given type of index. > switch (type) { >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.h b/Source/WebCore/html/canvas/WebGLRenderingContext.h >index bacf9ebdea5e0d07b83dad71a2d0073d5c96027c..d4054e87d1caecc75b0d9be769c74ed0c87950e2 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContext.h >+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.h >@@ -41,7 +41,7 @@ public: > > WebGLExtension* getExtension(const String&) final; > WebGLAny getParameter(GC3Denum pname) final; >- std::optional<Vector<String>> getSupportedExtensions() final; >+ Optional<Vector<String>> getSupportedExtensions() final; > > WebGLAny getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) final; > void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) final; >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >index cfb3ad4811b787bb4f7f20282794f52aa93d9693..7b9c1c322a5cae64b8f5875ae00dab2824d3d66e 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >@@ -1422,7 +1422,7 @@ void WebGLRenderingContextBase::bufferData(GC3Denum target, long long size, GC3D > } > } > >-void WebGLRenderingContextBase::bufferData(GC3Denum target, std::optional<BufferDataSource>&& data, GC3Denum usage) >+void WebGLRenderingContextBase::bufferData(GC3Denum target, Optional<BufferDataSource>&& data, GC3Denum usage) > { > if (isContextLostOrPending()) > return; >@@ -1449,7 +1449,7 @@ void WebGLRenderingContextBase::bufferData(GC3Denum target, std::optional<Buffer > }, data.value()); > } > >-void WebGLRenderingContextBase::bufferSubData(GC3Denum target, long long offset, std::optional<BufferDataSource>&& data) >+void WebGLRenderingContextBase::bufferSubData(GC3Denum target, long long offset, Optional<BufferDataSource>&& data) > { > if (isContextLostOrPending()) > return; >@@ -2541,10 +2541,10 @@ RefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveUniform(WebGLProgram > return WebGLActiveInfo::create(info.name, info.type, info.size); > } > >-std::optional<Vector<RefPtr<WebGLShader>>> WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program) >+Optional<Vector<RefPtr<WebGLShader>>> WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program) > { > if (isContextLostOrPending() || !validateWebGLObject("getAttachedShaders", program)) >- return std::nullopt; >+ return WTF::nullopt; > > const GC3Denum shaderTypes[] = { > GraphicsContext3D::VERTEX_SHADER, >@@ -2614,10 +2614,10 @@ WebGLAny WebGLRenderingContextBase::getBufferParameter(GC3Denum target, GC3Denum > return static_cast<unsigned>(value); > } > >-std::optional<WebGLContextAttributes> WebGLRenderingContextBase::getContextAttributes() >+Optional<WebGLContextAttributes> WebGLRenderingContextBase::getContextAttributes() > { > if (isContextLostOrPending()) >- return std::nullopt; >+ return WTF::nullopt; > > // Also, we need to enforce requested values of "false" for depth > // and stencil, regardless of the properties of the underlying >@@ -3880,7 +3880,7 @@ void WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3Dint level, GC > m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment); > } > >-ExceptionOr<void> WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, std::optional<TexImageSource>&& source) >+ExceptionOr<void> WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Optional<TexImageSource>&& source) > { > if (!source) { > synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "texSubImage2D", "source is null"); >@@ -4042,7 +4042,7 @@ ExceptionOr<void> WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3D > return WTF::visit(visitor, source.value()); > } > >-bool WebGLRenderingContextBase::validateArrayBufferType(const char* functionName, GC3Denum type, std::optional<JSC::TypedArrayType> arrayType) >+bool WebGLRenderingContextBase::validateArrayBufferType(const char* functionName, GC3Denum type, Optional<JSC::TypedArrayType> arrayType) > { > #define TYPE_VALIDATION_CASE(arrayTypeMacro) if (arrayType && arrayType.value() != JSC::arrayTypeMacro) { \ > synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "ArrayBufferView not " #arrayTypeMacro); \ >@@ -4103,7 +4103,7 @@ bool WebGLRenderingContextBase::validateTexFuncData(const char* functionName, GC > return false; > if (!validateSettableTexInternalFormat(functionName, internalFormat)) > return false; >- if (!validateArrayBufferType(functionName, type, pixels ? std::optional<JSC::TypedArrayType>(pixels->getType()) : std::nullopt)) >+ if (!validateArrayBufferType(functionName, type, pixels ? Optional<JSC::TypedArrayType>(pixels->getType()) : WTF::nullopt)) > return false; > > unsigned totalBytesRequired; >@@ -4449,7 +4449,7 @@ static bool isRGBFormat(GC3Denum internalFormat) > || internalFormat == GraphicsContext3D::RGBA8; > } > >-ExceptionOr<void> WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, std::optional<TexImageSource> source) >+ExceptionOr<void> WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional<TexImageSource> source) > { > if (!source) { > synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "texImage2D", "source is null"); >@@ -5835,7 +5835,7 @@ bool WebGLRenderingContextBase::validateUniformMatrixParameters(const char* func > > WebGLBuffer* WebGLRenderingContextBase::validateBufferDataParameters(const char* functionName, GC3Denum target, GC3Denum usage) > { >- std::optional<WebGLBuffer*> buffer; >+ Optional<WebGLBuffer*> buffer; > switch (target) { > case GraphicsContext3D::ELEMENT_ARRAY_BUFFER: > buffer = m_boundVertexArrayObject->getElementArrayBuffer(); >@@ -6046,7 +6046,7 @@ bool WebGLRenderingContextBase::validateSimulatedVertexAttrib0(GC3Duint numVerte > return !bufferDataSize.hasOverflowed() && bufferDataSize.unsafeGet() > 0; > } > >-std::optional<bool> WebGLRenderingContextBase::simulateVertexAttrib0(GC3Duint numVertex) >+Optional<bool> WebGLRenderingContextBase::simulateVertexAttrib0(GC3Duint numVertex) > { > if (!m_currentProgram) > return false; >@@ -6074,7 +6074,7 @@ std::optional<bool> WebGLRenderingContextBase::simulateVertexAttrib0(GC3Duint nu > m_vertexAttrib0UsedBefore = false; > m_vertexAttrib0BufferSize = 0; > m_forceAttrib0BufferRefill = true; >- return std::nullopt; >+ return WTF::nullopt; > } > m_vertexAttrib0BufferSize = bufferDataSize; > m_forceAttrib0BufferRefill = true; >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >index 96cc17bd85b313e9379d9b60c552c72179d5789e..beb59b5636e60d8fa8235987b3540a9c3c6b1d12 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >@@ -119,8 +119,8 @@ public: > > using BufferDataSource = WTF::Variant<RefPtr<ArrayBuffer>, RefPtr<ArrayBufferView>>; > void bufferData(GC3Denum target, long long size, GC3Denum usage); >- void bufferData(GC3Denum target, std::optional<BufferDataSource>&&, GC3Denum usage); >- void bufferSubData(GC3Denum target, long long offset, std::optional<BufferDataSource>&&); >+ void bufferData(GC3Denum target, Optional<BufferDataSource>&&, GC3Denum usage); >+ void bufferSubData(GC3Denum target, long long offset, Optional<BufferDataSource>&&); > > GC3Denum checkFramebufferStatus(GC3Denum target); > virtual void clear(GC3Dbitfield mask) = 0; >@@ -172,10 +172,10 @@ public: > > RefPtr<WebGLActiveInfo> getActiveAttrib(WebGLProgram*, GC3Duint index); > RefPtr<WebGLActiveInfo> getActiveUniform(WebGLProgram*, GC3Duint index); >- std::optional<Vector<RefPtr<WebGLShader>>> getAttachedShaders(WebGLProgram*); >+ Optional<Vector<RefPtr<WebGLShader>>> getAttachedShaders(WebGLProgram*); > GC3Dint getAttribLocation(WebGLProgram*, const String& name); > WebGLAny getBufferParameter(GC3Denum target, GC3Denum pname); >- std::optional<WebGLContextAttributes> getContextAttributes(); >+ Optional<WebGLContextAttributes> getContextAttributes(); > GC3Denum getError(); > virtual WebGLExtension* getExtension(const String& name) = 0; > virtual WebGLAny getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) = 0; >@@ -187,7 +187,7 @@ public: > String getShaderInfoLog(WebGLShader*); > RefPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType); > String getShaderSource(WebGLShader*); >- virtual std::optional<Vector<String>> getSupportedExtensions() = 0; >+ virtual Optional<Vector<String>> getSupportedExtensions() = 0; > WebGLAny getTexParameter(GC3Denum target, GC3Denum pname); > WebGLAny getUniform(WebGLProgram*, const WebGLUniformLocation*); > RefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const String&); >@@ -238,13 +238,13 @@ public: > using TexImageSource = WTF::Variant<RefPtr<ImageBitmap>, RefPtr<ImageData>, RefPtr<HTMLImageElement>, RefPtr<HTMLCanvasElement>>; > #endif > >- ExceptionOr<void> texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, std::optional<TexImageSource>); >+ ExceptionOr<void> texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional<TexImageSource>); > > void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param); > void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param); > > void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr<ArrayBufferView>&&); >- ExceptionOr<void> texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, std::optional<TexImageSource>&&); >+ ExceptionOr<void> texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Optional<TexImageSource>&&); > > template <class TypedArray, class DataType> > class TypedList { >@@ -797,7 +797,7 @@ protected: > > // Helpers for simulating vertexAttrib0. > void initVertexAttrib0(); >- std::optional<bool> simulateVertexAttrib0(GC3Duint numVertex); >+ Optional<bool> simulateVertexAttrib0(GC3Duint numVertex); > bool validateSimulatedVertexAttrib0(GC3Duint numVertex); > void restoreStatesAfterVertexAttrib0Simulation(); > >@@ -834,11 +834,11 @@ protected: > HTMLCanvasElement* htmlCanvas(); > OffscreenCanvas* offscreenCanvas(); > >- template <typename T> inline std::optional<T> checkedAddAndMultiply(T value, T add, T multiply); >+ template <typename T> inline Optional<T> checkedAddAndMultiply(T value, T add, T multiply); > template <typename T> unsigned getMaxIndex(const RefPtr<JSC::ArrayBuffer> elementArrayBuffer, GC3Dintptr uoffset, GC3Dsizei n); > > private: >- bool validateArrayBufferType(const char* functionName, GC3Denum type, std::optional<JSC::TypedArrayType>); >+ bool validateArrayBufferType(const char* functionName, GC3Denum type, Optional<JSC::TypedArrayType>); > void registerWithWebGLStateTracker(); > void checkForContextLossHandling(); > >@@ -849,13 +849,13 @@ private: > }; > > template <typename T> >-inline std::optional<T> WebGLRenderingContextBase::checkedAddAndMultiply(T value, T add, T multiply) >+inline Optional<T> WebGLRenderingContextBase::checkedAddAndMultiply(T value, T add, T multiply) > { > Checked<T, RecordOverflow> checkedResult = Checked<T>(value); > checkedResult += Checked<T>(add); > checkedResult *= Checked<T>(multiply); > if (checkedResult.hasOverflowed()) >- return std::nullopt; >+ return WTF::nullopt; > > return checkedResult.unsafeGet(); > } >diff --git a/Source/WebCore/html/canvas/WebMetalEnums.cpp b/Source/WebCore/html/canvas/WebMetalEnums.cpp >index d7f9255846bbc63a5578df607fd9fb72bb9ea4f0..d0c051ee647612cfa2f626b8fefbc907ecaba942 100644 >--- a/Source/WebCore/html/canvas/WebMetalEnums.cpp >+++ b/Source/WebCore/html/canvas/WebMetalEnums.cpp >@@ -33,7 +33,7 @@ > > namespace WebCore { > >-std::optional<WebMetalCompareFunction> toWebMetalCompareFunction(const String& name) >+Optional<WebMetalCompareFunction> toWebMetalCompareFunction(const String& name) > { > if (equalLettersIgnoringASCIICase(name, "never")) > return WebMetalCompareFunction::Never; >@@ -53,7 +53,7 @@ std::optional<WebMetalCompareFunction> toWebMetalCompareFunction(const String& n > return WebMetalCompareFunction::Always; > > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > > String web3DCompareFunctionName(WebMetalCompareFunction value) >diff --git a/Source/WebCore/html/canvas/WebMetalEnums.h b/Source/WebCore/html/canvas/WebMetalEnums.h >index 9119b123d0bc6110cd20d128db2ae6d2f82f339c..4b38b88c9fd79497604178ac68a55b77f30780d8 100644 >--- a/Source/WebCore/html/canvas/WebMetalEnums.h >+++ b/Source/WebCore/html/canvas/WebMetalEnums.h >@@ -45,7 +45,7 @@ enum class WebMetalCompareFunction { > Always > }; > >-std::optional<WebMetalCompareFunction> toWebMetalCompareFunction(const String&); >+Optional<WebMetalCompareFunction> toWebMetalCompareFunction(const String&); > String web3DCompareFunctionName(WebMetalCompareFunction); > GPULegacyCompareFunction toGPULegacyCompareFunction(WebMetalCompareFunction); > >diff --git a/Source/WebCore/html/parser/HTMLConstructionSite.cpp b/Source/WebCore/html/parser/HTMLConstructionSite.cpp >index aca51a77f03153392662f40c3d4e2579bddd04b2..ab89ff9e87d5db388796b94592c71c99d7459928 100644 >--- a/Source/WebCore/html/parser/HTMLConstructionSite.cpp >+++ b/Source/WebCore/html/parser/HTMLConstructionSite.cpp >@@ -720,17 +720,17 @@ Ref<HTMLStackItem> HTMLConstructionSite::createElementFromSavedToken(HTMLStackIt > return HTMLStackItem::create(createHTMLElement(fakeToken), WTFMove(fakeToken), item.namespaceURI()); > } > >-std::optional<unsigned> HTMLConstructionSite::indexOfFirstUnopenFormattingElement() const >+Optional<unsigned> HTMLConstructionSite::indexOfFirstUnopenFormattingElement() const > { > if (m_activeFormattingElements.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > unsigned index = m_activeFormattingElements.size(); > do { > --index; > const auto& entry = m_activeFormattingElements.at(index); > if (entry.isMarker() || m_openElements.contains(entry.element())) { > unsigned firstUnopenElementIndex = index + 1; >- return firstUnopenElementIndex < m_activeFormattingElements.size() ? firstUnopenElementIndex : std::optional<unsigned>(std::nullopt); >+ return firstUnopenElementIndex < m_activeFormattingElements.size() ? firstUnopenElementIndex : Optional<unsigned>(WTF::nullopt); > } > } while (index); > >@@ -739,7 +739,7 @@ std::optional<unsigned> HTMLConstructionSite::indexOfFirstUnopenFormattingElemen > > void HTMLConstructionSite::reconstructTheActiveFormattingElements() > { >- std::optional<unsigned> firstUnopenElementIndex = indexOfFirstUnopenFormattingElement(); >+ Optional<unsigned> firstUnopenElementIndex = indexOfFirstUnopenFormattingElement(); > if (!firstUnopenElementIndex) > return; > >diff --git a/Source/WebCore/html/parser/HTMLConstructionSite.h b/Source/WebCore/html/parser/HTMLConstructionSite.h >index 96e64cfc7a98abec92f459c21f5b1fa0179949df..3af622ee9ab4896efd3cfe8a225a99e1eb865b55 100644 >--- a/Source/WebCore/html/parser/HTMLConstructionSite.h >+++ b/Source/WebCore/html/parser/HTMLConstructionSite.h >@@ -130,7 +130,7 @@ public: > bool shouldFosterParent() const; > void fosterParent(Ref<Node>&&); > >- std::optional<unsigned> indexOfFirstUnopenFormattingElement() const; >+ Optional<unsigned> indexOfFirstUnopenFormattingElement() const; > void reconstructTheActiveFormattingElements(); > > void generateImpliedEndTags(); >diff --git a/Source/WebCore/html/parser/HTMLParserIdioms.cpp b/Source/WebCore/html/parser/HTMLParserIdioms.cpp >index 42309268e9bdd095ac9bf16ad9f7332a371cd5b7..80e27fd6664e6a30cdf7cc9b9d630a870420fcce 100644 >--- a/Source/WebCore/html/parser/HTMLParserIdioms.cpp >+++ b/Source/WebCore/html/parser/HTMLParserIdioms.cpp >@@ -218,26 +218,26 @@ Expected<unsigned, HTMLIntegerParsingError> parseHTMLNonNegativeInteger(StringVi > } > > template <typename CharacterType> >-static std::optional<int> parseValidHTMLNonNegativeIntegerInternal(const CharacterType* position, const CharacterType* end) >+static Optional<int> parseValidHTMLNonNegativeIntegerInternal(const CharacterType* position, const CharacterType* end) > { > // A string is a valid non-negative integer if it consists of one or more ASCII digits. > for (auto* c = position; c < end; ++c) { > if (!isASCIIDigit(*c)) >- return std::nullopt; >+ return WTF::nullopt; > } > > auto optionalSignedValue = parseHTMLIntegerInternal(position, end); > if (!optionalSignedValue || optionalSignedValue.value() < 0) >- return std::nullopt; >+ return WTF::nullopt; > > return optionalSignedValue.value(); > } > > // https://html.spec.whatwg.org/#valid-non-negative-integer >-std::optional<int> parseValidHTMLNonNegativeInteger(StringView input) >+Optional<int> parseValidHTMLNonNegativeInteger(StringView input) > { > if (input.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > if (LIKELY(input.is8Bit())) { > auto* start = input.characters8(); >@@ -249,25 +249,25 @@ std::optional<int> parseValidHTMLNonNegativeInteger(StringView input) > } > > template <typename CharacterType> >-static std::optional<double> parseValidHTMLFloatingPointNumberInternal(const CharacterType* position, size_t length) >+static Optional<double> parseValidHTMLFloatingPointNumberInternal(const CharacterType* position, size_t length) > { > ASSERT(length > 0); > > // parseDouble() allows the string to start with a '+' or to end with a '.' but those > // are not valid floating point numbers as per HTML. > if (*position == '+' || *(position + length - 1) == '.') >- return std::nullopt; >+ return WTF::nullopt; > > size_t parsedLength = 0; > double number = parseDouble(position, length, parsedLength); >- return parsedLength == length && std::isfinite(number) ? number : std::optional<double>(); >+ return parsedLength == length && std::isfinite(number) ? number : Optional<double>(); > } > > // https://html.spec.whatwg.org/#valid-floating-point-number >-std::optional<double> parseValidHTMLFloatingPointNumber(StringView input) >+Optional<double> parseValidHTMLFloatingPointNumber(StringView input) > { > if (input.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > if (LIKELY(input.is8Bit())) { > auto* start = input.characters8(); >diff --git a/Source/WebCore/html/parser/HTMLParserIdioms.h b/Source/WebCore/html/parser/HTMLParserIdioms.h >index dcccc269945564bf1ebfc3d151f8b1de0c60d757..1f63a3c400c5433e93486cb30062b49b36ba61e4 100644 >--- a/Source/WebCore/html/parser/HTMLParserIdioms.h >+++ b/Source/WebCore/html/parser/HTMLParserIdioms.h >@@ -71,10 +71,10 @@ WEBCORE_EXPORT Expected<int, HTMLIntegerParsingError> parseHTMLInteger(StringVie > WEBCORE_EXPORT Expected<unsigned, HTMLIntegerParsingError> parseHTMLNonNegativeInteger(StringView); > > // https://html.spec.whatwg.org/#valid-non-negative-integer >-std::optional<int> parseValidHTMLNonNegativeInteger(StringView); >+Optional<int> parseValidHTMLNonNegativeInteger(StringView); > > // https://html.spec.whatwg.org/#valid-floating-point-number >-std::optional<double> parseValidHTMLFloatingPointNumber(StringView); >+Optional<double> parseValidHTMLFloatingPointNumber(StringView); > > // https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-floating-point-number-values > Vector<double> parseHTMLListOfOfFloatingPointNumberValues(StringView); >diff --git a/Source/WebCore/html/parser/HTMLPreloadScanner.cpp b/Source/WebCore/html/parser/HTMLPreloadScanner.cpp >index 6c6d7ed8763c602c8de7faf3673297d65da514d4..d71ec552505745816d55364e3fab6eb1c8e90c0b 100644 >--- a/Source/WebCore/html/parser/HTMLPreloadScanner.cpp >+++ b/Source/WebCore/html/parser/HTMLPreloadScanner.cpp >@@ -305,7 +305,7 @@ private: > return m_charset; > } > >- std::optional<CachedResource::Type> resourceType() const >+ Optional<CachedResource::Type> resourceType() const > { > switch (m_tagId) { > case TagId::Script: >diff --git a/Source/WebCore/html/parser/HTMLSrcsetParser.cpp b/Source/WebCore/html/parser/HTMLSrcsetParser.cpp >index 3a35b8bb72d299765eb06cafb1bbe3242d3e8f26..af426cdb41b0d8ff98877c3b8562afe19c8318be 100644 >--- a/Source/WebCore/html/parser/HTMLSrcsetParser.cpp >+++ b/Source/WebCore/html/parser/HTMLSrcsetParser.cpp >@@ -134,14 +134,14 @@ static bool parseDescriptors(Vector<StringView>& descriptors, DescriptorParsingR > if (descriptorChar == 'x') { > if (result.hasDensity() || result.hasHeight() || result.hasWidth()) > return false; >- std::optional<double> density = parseValidHTMLFloatingPointNumber(descriptor); >+ Optional<double> density = parseValidHTMLFloatingPointNumber(descriptor); > if (!density || density.value() < 0) > return false; > result.setDensity(density.value()); > } else if (descriptorChar == 'w') { > if (result.hasDensity() || result.hasWidth()) > return false; >- std::optional<int> resourceWidth = parseValidHTMLNonNegativeInteger(descriptor); >+ Optional<int> resourceWidth = parseValidHTMLNonNegativeInteger(descriptor); > if (!resourceWidth || resourceWidth.value() <= 0) > return false; > result.setResourceWidth(resourceWidth.value()); >@@ -150,7 +150,7 @@ static bool parseDescriptors(Vector<StringView>& descriptors, DescriptorParsingR > // The value of the 'h' descriptor is not used. > if (result.hasDensity() || result.hasHeight()) > return false; >- std::optional<int> resourceHeight = parseValidHTMLNonNegativeInteger(descriptor); >+ Optional<int> resourceHeight = parseValidHTMLNonNegativeInteger(descriptor); > if (!resourceHeight || resourceHeight.value() <= 0) > return false; > result.setResourceHeight(resourceHeight.value()); >diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp >index 9c459f23b01c0563889d6430621b8e7a0335f82d..9fbd58b94f01e91d25069817e1b0eb1f705f0ba0 100644 >--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp >+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp >@@ -298,7 +298,7 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& absolutePoint) > #if ENABLE(DATALIST_ELEMENT) > const LayoutUnit snappingThreshold = renderer()->theme().sliderTickSnappingThreshold(); > if (snappingThreshold > 0) { >- if (std::optional<Decimal> closest = input->findClosestTickMarkValue(value)) { >+ if (Optional<Decimal> closest = input->findClosestTickMarkValue(value)) { > double closestFraction = stepRange.proportionFromValue(*closest).toDouble(); > double closestRatio = isVertical || !isLeftToRightDirection ? 1.0 - closestFraction : closestFraction; > LayoutUnit closestPosition = trackLength * closestRatio; >@@ -590,7 +590,7 @@ RefPtr<HTMLInputElement> SliderThumbElement::hostInput() const > return downcast<HTMLInputElement>(shadowHost()); > } > >-std::optional<ElementStyle> SliderThumbElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle) >+Optional<ElementStyle> SliderThumbElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle) > { > // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known. > >@@ -598,7 +598,7 @@ std::optional<ElementStyle> SliderThumbElement::resolveCustomStyle(const RenderS > static NeverDestroyed<const AtomicString> mediaSliderThumbShadowPseudoId("-webkit-media-slider-thumb", AtomicString::ConstructFromLiteral); > > if (!hostStyle) >- return std::nullopt; >+ return WTF::nullopt; > > switch (hostStyle->appearance()) { > case MediaSliderPart: >@@ -613,7 +613,7 @@ std::optional<ElementStyle> SliderThumbElement::resolveCustomStyle(const RenderS > m_shadowPseudoId = sliderThumbShadowPseudoId; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > const AtomicString& SliderThumbElement::shadowPseudoId() const >@@ -644,7 +644,7 @@ RenderPtr<RenderElement> SliderContainerElement::createElementRenderer(RenderSty > return createRenderer<RenderSliderContainer>(*this, WTFMove(style)); > } > >-std::optional<ElementStyle> SliderContainerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle) >+Optional<ElementStyle> SliderContainerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle) > { > // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known. > >@@ -652,7 +652,7 @@ std::optional<ElementStyle> SliderContainerElement::resolveCustomStyle(const Ren > static NeverDestroyed<const AtomicString> sliderContainer("-webkit-slider-container", AtomicString::ConstructFromLiteral); > > if (!hostStyle) >- return std::nullopt; >+ return WTF::nullopt; > > switch (hostStyle->appearance()) { > case MediaSliderPart: >@@ -667,7 +667,7 @@ std::optional<ElementStyle> SliderContainerElement::resolveCustomStyle(const Ren > m_shadowPseudoId = sliderContainer; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > const AtomicString& SliderContainerElement::shadowPseudoId() const >diff --git a/Source/WebCore/html/shadow/SliderThumbElement.h b/Source/WebCore/html/shadow/SliderThumbElement.h >index 054a2e428f095ed637ca8b5b6e4e5da0477a3fde..6bab3f292e6a7d9c5465e091d8e9ba801c8991e8 100644 >--- a/Source/WebCore/html/shadow/SliderThumbElement.h >+++ b/Source/WebCore/html/shadow/SliderThumbElement.h >@@ -77,7 +77,7 @@ private: > #endif > void willDetachRenderers() final; > >- std::optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) final; >+ Optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) final; > const AtomicString& shadowPseudoId() const final; > > void startDragging(); >@@ -136,7 +136,7 @@ public: > private: > SliderContainerElement(Document&); > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; >- std::optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) final; >+ Optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) final; > const AtomicString& shadowPseudoId() const final; > bool isSliderContainerElement() const final { return true; } > >diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.cpp b/Source/WebCore/html/shadow/TextControlInnerElements.cpp >index 08c6e50b58548dc87713e20c2084096642a13fa4..854ea77fa8c7470ffdbfe52695d2af34561ca616 100644 >--- a/Source/WebCore/html/shadow/TextControlInnerElements.cpp >+++ b/Source/WebCore/html/shadow/TextControlInnerElements.cpp >@@ -80,7 +80,7 @@ static inline bool isStrongPasswordTextField(const Element* element) > return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element)->hasAutoFillStrongPasswordButton(); > } > >-std::optional<ElementStyle> TextControlInnerContainer::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*) >+Optional<ElementStyle> TextControlInnerContainer::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*) > { > auto elementStyle = resolveStyle(&parentStyle); > if (isStrongPasswordTextField(shadowHost())) { >@@ -102,7 +102,7 @@ Ref<TextControlInnerElement> TextControlInnerElement::create(Document& document) > return adoptRef(*new TextControlInnerElement(document)); > } > >-std::optional<ElementStyle> TextControlInnerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle) >+Optional<ElementStyle> TextControlInnerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle) > { > auto newStyle = RenderStyle::createPtr(); > newStyle->inheritFrom(*shadowHostStyle); >@@ -172,7 +172,7 @@ RenderTextControlInnerBlock* TextControlInnerTextElement::renderer() const > return downcast<RenderTextControlInnerBlock>(HTMLDivElement::renderer()); > } > >-std::optional<ElementStyle> TextControlInnerTextElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle) >+Optional<ElementStyle> TextControlInnerTextElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle) > { > auto style = downcast<HTMLTextFormControlElement>(*shadowHost()).createInnerTextStyle(*shadowHostStyle); > return ElementStyle(std::make_unique<RenderStyle>(WTFMove(style))); >@@ -192,7 +192,7 @@ Ref<TextControlPlaceholderElement> TextControlPlaceholderElement::create(Documen > return adoptRef(*new TextControlPlaceholderElement(document)); > } > >-std::optional<ElementStyle> TextControlPlaceholderElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) >+Optional<ElementStyle> TextControlPlaceholderElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) > { > auto style = resolveStyle(&parentStyle); > >diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.h b/Source/WebCore/html/shadow/TextControlInnerElements.h >index 4125191714ed0fb7176df6e7223c677a975942a7..7f65839010181dafb40ff3ee47ce93aa8a06c1cf 100644 >--- a/Source/WebCore/html/shadow/TextControlInnerElements.h >+++ b/Source/WebCore/html/shadow/TextControlInnerElements.h >@@ -40,7 +40,7 @@ public: > protected: > TextControlInnerContainer(Document&); > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; >- std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; >+ Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; > }; > > class TextControlInnerElement final : public HTMLDivElement { >@@ -50,7 +50,7 @@ public: > > protected: > TextControlInnerElement(Document&); >- std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; >+ Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; > > private: > bool isMouseFocusable() const override { return false; } >@@ -68,7 +68,7 @@ public: > private: > TextControlInnerTextElement(Document&); > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; >- std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; >+ Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; > bool isMouseFocusable() const override { return false; } > bool isTextControlInnerTextElement() const override { return true; } > }; >@@ -81,7 +81,7 @@ public: > private: > TextControlPlaceholderElement(Document&); > >- std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; >+ Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; > }; > > class SearchFieldResultsButtonElement final : public HTMLDivElement { >diff --git a/Source/WebCore/html/track/BufferedLineReader.cpp b/Source/WebCore/html/track/BufferedLineReader.cpp >index 8f2362512850962680b1cb4992b1fb838eda03cc..5ebf19b082343496c3276b03aaac4e56e60da1ed 100644 >--- a/Source/WebCore/html/track/BufferedLineReader.cpp >+++ b/Source/WebCore/html/track/BufferedLineReader.cpp >@@ -35,7 +35,7 @@ > > namespace WebCore { > >-std::optional<String> BufferedLineReader::nextLine() >+Optional<String> BufferedLineReader::nextLine() > { > if (m_maybeSkipLF) { > // We ran out of data after a CR (U+000D), which means that we may be >@@ -98,7 +98,7 @@ std::optional<String> BufferedLineReader::nextLine() > } > > ASSERT(m_buffer.isEmpty()); >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WebCore >diff --git a/Source/WebCore/html/track/BufferedLineReader.h b/Source/WebCore/html/track/BufferedLineReader.h >index 9334ae73efe9b329a98ffdfc88d22ee220d445e6..1a211c954ffa40f175be0753edf9fadf721162d5 100644 >--- a/Source/WebCore/html/track/BufferedLineReader.h >+++ b/Source/WebCore/html/track/BufferedLineReader.h >@@ -56,7 +56,7 @@ public: > void appendEndOfStream() { m_endOfStream = true; } > bool isAtEndOfStream() const { return m_endOfStream && m_buffer.isEmpty(); } > >- std::optional<String> nextLine(); >+ Optional<String> nextLine(); > > private: > SegmentedString m_buffer; >diff --git a/Source/WebCore/html/track/TextTrack.cpp b/Source/WebCore/html/track/TextTrack.cpp >index cb14e49f38b106a4a0f1b8dbc40ae0d4d1dea03b..bcc59876f648ab466b3c64f37b94281f4a0c717d 100644 >--- a/Source/WebCore/html/track/TextTrack.cpp >+++ b/Source/WebCore/html/track/TextTrack.cpp >@@ -446,8 +446,8 @@ int TextTrack::trackIndex() > > void TextTrack::invalidateTrackIndex() > { >- m_trackIndex = std::nullopt; >- m_renderedTrackIndex = std::nullopt; >+ m_trackIndex = WTF::nullopt; >+ m_renderedTrackIndex = WTF::nullopt; > } > > bool TextTrack::isRendered() >diff --git a/Source/WebCore/html/track/TextTrack.h b/Source/WebCore/html/track/TextTrack.h >index 003a247db4d40feaf23f89f165a0cba2e50ee1dd..deb80ad10d40880d6862b1f16f056e157c4982ca 100644 >--- a/Source/WebCore/html/track/TextTrack.h >+++ b/Source/WebCore/html/track/TextTrack.h >@@ -144,7 +144,7 @@ public: > using RefCounted<TrackBase>::ref; > using RefCounted<TrackBase>::deref; > >- const std::optional<Vector<String>>& styleSheets() const { return m_styleSheets; } >+ const Optional<Vector<String>>& styleSheets() const { return m_styleSheets; } > > protected: > TextTrack(ScriptExecutionContext*, TextTrackClient*, const AtomicString& kind, const AtomicString& id, const AtomicString& label, const AtomicString& language, TextTrackType); >@@ -154,7 +154,7 @@ protected: > #endif > > RefPtr<TextTrackCueList> m_cues; >- std::optional<Vector<String>> m_styleSheets; >+ Optional<Vector<String>> m_styleSheets; > > private: > bool enabled() const override; >@@ -172,8 +172,8 @@ private: > TextTrackClient* m_client; > TextTrackType m_trackType; > ReadinessState m_readinessState { NotLoaded }; >- std::optional<int> m_trackIndex; >- std::optional<int> m_renderedTrackIndex; >+ Optional<int> m_trackIndex; >+ Optional<int> m_renderedTrackIndex; > bool m_hasBeenConfigured { false }; > }; > >diff --git a/Source/WebCore/html/track/TrackEvent.cpp b/Source/WebCore/html/track/TrackEvent.cpp >index 15404ac504f128aed4d0b6800a4347bcd3f9b547..b9a90da3fd6fe124b5e4084122a8e0365abc1561 100644 >--- a/Source/WebCore/html/track/TrackEvent.cpp >+++ b/Source/WebCore/html/track/TrackEvent.cpp >@@ -31,11 +31,11 @@ > > namespace WebCore { > >-static inline std::optional<TrackEvent::TrackEventTrack> convertToTrackEventTrack(Ref<TrackBase>&& track) >+static inline Optional<TrackEvent::TrackEventTrack> convertToTrackEventTrack(Ref<TrackBase>&& track) > { > switch (track->type()) { > case TrackBase::BaseTrack: >- return std::nullopt; >+ return WTF::nullopt; > case TrackBase::TextTrack: > return TrackEvent::TrackEventTrack { RefPtr<TextTrack>(&downcast<TextTrack>(track.get())) }; > case TrackBase::AudioTrack: >@@ -45,7 +45,7 @@ static inline std::optional<TrackEvent::TrackEventTrack> convertToTrackEventTrac > } > > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > > TrackEvent::TrackEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, Ref<TrackBase>&& track) >diff --git a/Source/WebCore/html/track/TrackEvent.h b/Source/WebCore/html/track/TrackEvent.h >index 61e7ed626a49164d44cd9d080fdc8f5f07dc0a49..a8ec68c4d00c1df92d12d9973ddcdfb480a1d1cc 100644 >--- a/Source/WebCore/html/track/TrackEvent.h >+++ b/Source/WebCore/html/track/TrackEvent.h >@@ -46,7 +46,7 @@ public: > using TrackEventTrack = Variant<RefPtr<VideoTrack>, RefPtr<AudioTrack>, RefPtr<TextTrack>>; > > struct Init : public EventInit { >- std::optional<TrackEventTrack> track; >+ Optional<TrackEventTrack> track; > }; > > static Ref<TrackEvent> create(const AtomicString& type, Init&& initializer, IsTrusted isTrusted = IsTrusted::No) >@@ -54,7 +54,7 @@ public: > return adoptRef(*new TrackEvent(type, WTFMove(initializer), isTrusted)); > } > >- std::optional<TrackEventTrack> track() const { return m_track; } >+ Optional<TrackEventTrack> track() const { return m_track; } > > private: > TrackEvent(const AtomicString& type, CanBubble, IsCancelable, Ref<TrackBase>&&); >@@ -62,7 +62,7 @@ private: > > EventInterface eventInterface() const override; > >- std::optional<TrackEventTrack> m_track; >+ Optional<TrackEventTrack> m_track; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/inspector/InspectorCanvas.cpp b/Source/WebCore/inspector/InspectorCanvas.cpp >index 1f38aa2004b2573488b160d739cfe9633efc6ec5..9b68c4b05c3b63ea1eff71b01ae9b159fbce67d3 100644 >--- a/Source/WebCore/inspector/InspectorCanvas.cpp >+++ b/Source/WebCore/inspector/InspectorCanvas.cpp >@@ -103,7 +103,7 @@ void InspectorCanvas::resetRecordingData() > m_recordingName = { }; > m_bufferLimit = 100 * 1024 * 1024; > m_bufferUsed = 0; >- m_frameCount = std::nullopt; >+ m_frameCount = WTF::nullopt; > m_framesCaptured = 0; > > m_context.setCallTracingActive(false); >@@ -221,7 +221,7 @@ void InspectorCanvas::setFrameCount(long frameCount) > if (frameCount > 0) > m_frameCount = std::min<long>(frameCount, std::numeric_limits<int>::max()); > else >- m_frameCount = std::nullopt; >+ m_frameCount = WTF::nullopt; > } > > bool InspectorCanvas::overFrameCount() const >@@ -274,7 +274,7 @@ Ref<Inspector::Protocol::Canvas::Canvas> InspectorCanvas::buildObjectForCanvas(b > } > #if ENABLE(WEBGL) > else if (is<WebGLRenderingContextBase>(m_context)) { >- if (std::optional<WebGLContextAttributes> attributes = downcast<WebGLRenderingContextBase>(m_context).getContextAttributes()) { >+ if (Optional<WebGLContextAttributes> attributes = downcast<WebGLRenderingContextBase>(m_context).getContextAttributes()) { > auto contextAttributes = Inspector::Protocol::Canvas::ContextAttributes::create() > .release(); > contextAttributes->setAlpha(attributes->alpha); >@@ -532,7 +532,7 @@ Ref<Inspector::Protocol::Recording::InitialState> InspectorCanvas::buildInitialS > #if ENABLE(WEBGL) > else if (is<WebGLRenderingContextBase>(m_context)) { > WebGLRenderingContextBase& contextWebGLBase = downcast<WebGLRenderingContextBase>(m_context); >- if (std::optional<WebGLContextAttributes> webGLContextAttributes = contextWebGLBase.getContextAttributes()) { >+ if (Optional<WebGLContextAttributes> webGLContextAttributes = contextWebGLBase.getContextAttributes()) { > RefPtr<JSON::Object> webGLContextAttributesPayload = JSON::Object::create(); > webGLContextAttributesPayload->setBoolean("alpha"_s, webGLContextAttributes->alpha); > webGLContextAttributesPayload->setBoolean("depth"_s, webGLContextAttributes->depth); >diff --git a/Source/WebCore/inspector/InspectorCanvas.h b/Source/WebCore/inspector/InspectorCanvas.h >index dbab6433319713601217942ecd7e65b24dd6ef5a..b4b66d0b3d11cc929dfd507e15885357fb7c37d5 100644 >--- a/Source/WebCore/inspector/InspectorCanvas.h >+++ b/Source/WebCore/inspector/InspectorCanvas.h >@@ -119,7 +119,7 @@ private: > MonotonicTime m_currentFrameStartTime { MonotonicTime::nan() }; > size_t m_bufferLimit { 100 * 1024 * 1024 }; > size_t m_bufferUsed { 0 }; >- std::optional<size_t> m_frameCount; >+ Optional<size_t> m_frameCount; > size_t m_framesCaptured { 0 }; > }; > >diff --git a/Source/WebCore/inspector/InspectorFrontendHost.h b/Source/WebCore/inspector/InspectorFrontendHost.h >index 8078f5c0d5d13d5f9312b4605c3d589a4c23bd3b..9c04425e03e8b8133c9194f1eec7b94bedf00bc6 100644 >--- a/Source/WebCore/inspector/InspectorFrontendHost.h >+++ b/Source/WebCore/inspector/InspectorFrontendHost.h >@@ -94,10 +94,10 @@ public: > struct ContextMenuItem { > String type; > String label; >- std::optional<int> id; >- std::optional<bool> enabled; >- std::optional<bool> checked; >- std::optional<Vector<ContextMenuItem>> subItems; >+ Optional<int> id; >+ Optional<bool> enabled; >+ Optional<bool> checked; >+ Optional<Vector<ContextMenuItem>> subItems; > }; > void showContextMenu(Event&, Vector<ContextMenuItem>&&); > >diff --git a/Source/WebCore/inspector/InspectorStyleSheet.cpp b/Source/WebCore/inspector/InspectorStyleSheet.cpp >index 3cdec85051ed0c314e7e42c49bfba085555377c7..d19f2ac8576b292cccc7ac9ec3083344198ee0e1 100644 >--- a/Source/WebCore/inspector/InspectorStyleSheet.cpp >+++ b/Source/WebCore/inspector/InspectorStyleSheet.cpp >@@ -923,7 +923,7 @@ ExceptionOr<CSSStyleRule*> InspectorStyleSheet::addRule(const String& selector) > if (text.hasException()) > return text.releaseException(); > >- auto addRuleResult = m_pageStyleSheet->addRule(selector, emptyString(), std::nullopt); >+ auto addRuleResult = m_pageStyleSheet->addRule(selector, emptyString(), WTF::nullopt); > if (addRuleResult.hasException()) > return addRuleResult.releaseException(); > >diff --git a/Source/WebCore/inspector/NetworkResourcesData.cpp b/Source/WebCore/inspector/NetworkResourcesData.cpp >index 90520f3e5e36369d427a7a954550f31959312d7f..289114e6550273e362efaab8252eba36cd2d1047 100644 >--- a/Source/WebCore/inspector/NetworkResourcesData.cpp >+++ b/Source/WebCore/inspector/NetworkResourcesData.cpp >@@ -296,7 +296,7 @@ Vector<String> NetworkResourcesData::removeCachedResource(CachedResource* cached > return result; > } > >-void NetworkResourcesData::clear(std::optional<String> preservedLoaderId) >+void NetworkResourcesData::clear(Optional<String> preservedLoaderId) > { > m_requestIdsDeque.clear(); > m_contentSize = 0; >diff --git a/Source/WebCore/inspector/NetworkResourcesData.h b/Source/WebCore/inspector/NetworkResourcesData.h >index 9a5fc2dac76e674071c3186a843f49163c24cf8f..8c428fccd5062ca33772009ed4c991da31ce9afd 100644 >--- a/Source/WebCore/inspector/NetworkResourcesData.h >+++ b/Source/WebCore/inspector/NetworkResourcesData.h >@@ -84,8 +84,8 @@ public: > RefPtr<SharedBuffer> buffer() const { return m_buffer.copyRef(); } > void setBuffer(RefPtr<SharedBuffer>&& buffer) { m_buffer = WTFMove(buffer); } > >- const std::optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; } >- void setCertificateInfo(const std::optional<CertificateInfo>& certificateInfo) { m_certificateInfo = certificateInfo; } >+ const Optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; } >+ void setCertificateInfo(const Optional<CertificateInfo>& certificateInfo) { m_certificateInfo = certificateInfo; } > > CachedResource* cachedResource() const { return m_cachedResource; } > void setCachedResource(CachedResource* cachedResource) { m_cachedResource = cachedResource; } >@@ -110,7 +110,7 @@ public: > RefPtr<TextResourceDecoder> m_decoder; > RefPtr<SharedBuffer> m_dataBuffer; > RefPtr<SharedBuffer> m_buffer; >- std::optional<CertificateInfo> m_certificateInfo; >+ Optional<CertificateInfo> m_certificateInfo; > CachedResource* m_cachedResource { nullptr }; > InspectorPageAgent::ResourceType m_type { InspectorPageAgent::OtherResource }; > int m_httpStatusCode { 0 }; >@@ -134,7 +134,7 @@ public: > void addResourceSharedBuffer(const String& requestId, RefPtr<SharedBuffer>&&, const String& textEncodingName); > ResourceData const* data(const String& requestId); > Vector<String> removeCachedResource(CachedResource*); >- void clear(std::optional<String> preservedLoaderId = std::nullopt); >+ void clear(Optional<String> preservedLoaderId = WTF::nullopt); > Vector<ResourceData*> resources(); > > private: >diff --git a/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp b/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp >index f2ed5ef8766d0479ae47d0d2334dd97a49030e9d..fdd5c7e05521a916e443990221e0cac2d6554900 100644 >--- a/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp >@@ -95,7 +95,7 @@ void InspectorCanvasAgent::enable(ErrorString&) > if (m_enabled) > return; > >- m_recordingAutoCaptureFrameCount = std::nullopt; >+ m_recordingAutoCaptureFrameCount = WTF::nullopt; > > m_enabled = true; > >@@ -106,7 +106,7 @@ void InspectorCanvasAgent::enable(ErrorString&) > #if ENABLE(WEBGL) > if (is<WebGLRenderingContextBase>(inspectorCanvas->context())) { > WebGLRenderingContextBase& contextWebGL = downcast<WebGLRenderingContextBase>(inspectorCanvas->context()); >- if (std::optional<Vector<String>> extensions = contextWebGL.getSupportedExtensions()) { >+ if (Optional<Vector<String>> extensions = contextWebGL.getSupportedExtensions()) { > for (const String& extension : *extensions) { > if (contextWebGL.extensionIsEnabled(extension)) > m_frontendDispatcher->extensionEnabled(inspectorCanvas->identifier(), extension); >@@ -140,7 +140,7 @@ void InspectorCanvasAgent::disable(ErrorString&) > for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values()) > inspectorCanvas->resetRecordingData(); > >- m_recordingAutoCaptureFrameCount = std::nullopt; >+ m_recordingAutoCaptureFrameCount = WTF::nullopt; > > m_enabled = false; > } >@@ -270,7 +270,7 @@ void InspectorCanvasAgent::setRecordingAutoCaptureFrameCount(ErrorString&, int c > if (count > 0) > m_recordingAutoCaptureFrameCount = count; > else >- m_recordingAutoCaptureFrameCount = std::nullopt; >+ m_recordingAutoCaptureFrameCount = WTF::nullopt; > } > > void InspectorCanvasAgent::startRecording(ErrorString& errorString, const String& canvasId, const int* frameCount, const int* memoryLimit) >diff --git a/Source/WebCore/inspector/agents/InspectorCanvasAgent.h b/Source/WebCore/inspector/agents/InspectorCanvasAgent.h >index 6a32ff9efada09b58f2eecb1ce1d7c6a361ee901..fa3ff7964be31c72b32ce46b8a43cf4ac464507b 100644 >--- a/Source/WebCore/inspector/agents/InspectorCanvasAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorCanvasAgent.h >@@ -105,9 +105,9 @@ public: > > private: > struct RecordingOptions { >- std::optional<long> frameCount; >- std::optional<long> memoryLimit; >- std::optional<String> name; >+ Optional<long> frameCount; >+ Optional<long> memoryLimit; >+ Optional<String> name; > }; > void startRecording(InspectorCanvas&, Inspector::Protocol::Recording::Initiator, RecordingOptions&& = { }); > >@@ -132,7 +132,7 @@ private: > Vector<String> m_removedCanvasIdentifiers; > Timer m_canvasDestroyedTimer; > Timer m_canvasRecordingTimer; >- std::optional<size_t> m_recordingAutoCaptureFrameCount; >+ Optional<size_t> m_recordingAutoCaptureFrameCount; > > bool m_enabled { false }; > }; >diff --git a/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp b/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp >index 8064affe6a7403a323db0eaf847ac72f0ec02ad7..3f077a99e9e372ceb29ea10f1b9ab54bc8da5f7a 100644 >--- a/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp >@@ -161,7 +161,7 @@ void ExecutableWithDatabase::start(IDBFactory* idbFactory, SecurityOrigin*, cons > return; > } > >- auto result = idbFactory->open(*context(), databaseName, std::nullopt); >+ auto result = idbFactory->open(*context(), databaseName, WTF::nullopt); > if (result.hasException()) { > requestCallback().sendFailure("Could not open database."); > return; >@@ -171,7 +171,7 @@ void ExecutableWithDatabase::start(IDBFactory* idbFactory, SecurityOrigin*, cons > } > > >-static RefPtr<KeyPath> keyPathFromIDBKeyPath(const std::optional<IDBKeyPath>& idbKeyPath) >+static RefPtr<KeyPath> keyPathFromIDBKeyPath(const Optional<IDBKeyPath>& idbKeyPath) > { > if (!idbKeyPath) > return KeyPath::create().setType(KeyPath::Type::Null).release(); >diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >index 2230993d232ddd55472e6d9c8185100e885059b8..ee986e0b08481e098d67a2170e47d179d75b4e65 100644 >--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp >@@ -474,7 +474,7 @@ void InspectorNetworkAgent::didReceiveResponse(unsigned long identifier, Documen > > String requestId = IdentifiersFactory::requestId(identifier); > >- std::optional<ResourceResponse> realResponse; >+ Optional<ResourceResponse> realResponse; > if (platformStrategies()->loaderStrategy()->havePerformedSecurityChecks(response)) { > callOnMainThreadAndWait([&] { > // We do not need to isolate response since it comes straight from IPC, but we might want to isolate it for extra safety. >@@ -566,7 +566,7 @@ void InspectorNetworkAgent::didFinishLoading(unsigned long identifier, DocumentL > if (resourceData && resourceData->cachedResource()) > sourceMappingURL = InspectorPageAgent::sourceMapURLForResource(resourceData->cachedResource()); > >- std::optional<NetworkLoadMetrics> realMetrics; >+ Optional<NetworkLoadMetrics> realMetrics; > if (platformStrategies()->loaderStrategy()->shouldPerformSecurityChecks() && !networkLoadMetrics.isComplete()) { > callOnMainThreadAndWait([&] { > realMetrics = platformStrategies()->loaderStrategy()->networkMetricsFromResourceLoadIdentifier(identifier).isolatedCopy(); >@@ -680,7 +680,7 @@ void InspectorNetworkAgent::didScheduleStyleRecalculation(Document& document) > m_styleRecalculationInitiator = buildInitiatorObject(&document); > } > >-RefPtr<Inspector::Protocol::Network::Initiator> InspectorNetworkAgent::buildInitiatorObject(Document* document, std::optional<const ResourceRequest&> resourceRequest) >+RefPtr<Inspector::Protocol::Network::Initiator> InspectorNetworkAgent::buildInitiatorObject(Document* document, Optional<const ResourceRequest&> resourceRequest) > { > // FIXME: Worker support. > if (!isMainThread()) { >@@ -997,10 +997,10 @@ Ref<TextResourceDecoder> InspectorNetworkAgent::createTextDecoder(const String& > return TextResourceDecoder::create("text/plain"_s, "UTF-8"); > } > >-std::optional<String> InspectorNetworkAgent::textContentForCachedResource(CachedResource& cachedResource) >+Optional<String> InspectorNetworkAgent::textContentForCachedResource(CachedResource& cachedResource) > { > if (!InspectorNetworkAgent::shouldTreatAsText(cachedResource.mimeType())) >- return std::nullopt; >+ return WTF::nullopt; > > String result; > bool base64Encoded; >@@ -1009,7 +1009,7 @@ std::optional<String> InspectorNetworkAgent::textContentForCachedResource(Cached > return result; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > bool InspectorNetworkAgent::cachedResourceContent(CachedResource& resource, String* result, bool* base64Encoded) >@@ -1062,7 +1062,7 @@ static Ref<Inspector::Protocol::Page::SearchResult> buildObjectForSearchResult(c > return searchResult; > } > >-static std::optional<String> textContentForResourceData(const NetworkResourcesData::ResourceData& resourceData) >+static Optional<String> textContentForResourceData(const NetworkResourcesData::ResourceData& resourceData) > { > if (resourceData.hasContent() && !resourceData.base64Encoded()) > return resourceData.content(); >@@ -1070,7 +1070,7 @@ static std::optional<String> textContentForResourceData(const NetworkResourcesDa > if (resourceData.cachedResource()) > return InspectorNetworkAgent::textContentForCachedResource(*resourceData.cachedResource()); > >- return std::nullopt; >+ return WTF::nullopt; > } > > void InspectorNetworkAgent::searchOtherRequests(const JSC::Yarr::RegularExpression& regex, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::SearchResult>>& result) >diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h >index 65735fe209476269daf3ad2cb4fd9f32664daacc..58d8cdef1b8df356489eec7f3f61b48478ebd5a7 100644 >--- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h >@@ -73,7 +73,7 @@ public: > > static bool shouldTreatAsText(const String& mimeType); > static Ref<TextResourceDecoder> createTextDecoder(const String& mimeType, const String& textEncodingName); >- static std::optional<String> textContentForCachedResource(CachedResource&); >+ static Optional<String> textContentForCachedResource(CachedResource&); > static bool cachedResourceContent(CachedResource&, String* result, bool* base64Encoded); > > void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; >@@ -132,7 +132,7 @@ private: > > WebSocket* webSocketForRequestId(const String& requestId); > >- RefPtr<Inspector::Protocol::Network::Initiator> buildInitiatorObject(Document*, std::optional<const ResourceRequest&> = std::nullopt); >+ RefPtr<Inspector::Protocol::Network::Initiator> buildInitiatorObject(Document*, Optional<const ResourceRequest&> = WTF::nullopt); > Ref<Inspector::Protocol::Network::ResourceTiming> buildObjectForTiming(const NetworkLoadMetrics&, ResourceLoader&); > Ref<Inspector::Protocol::Network::Metrics> buildObjectForMetrics(const NetworkLoadMetrics&); > RefPtr<Inspector::Protocol::Network::Response> buildObjectForResourceResponse(const ResourceResponse&, ResourceLoader*); >diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >index ee44eacabde5aa1073245594825ca76dd23117d5..2b60c45b788598a0659b8fadc8576b391b84e5d1 100644 >--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp >@@ -830,7 +830,7 @@ void InspectorPageAgent::setForcedAppearance(ErrorString&, const String& appeara > else if (appearance == "Dark"_s) > m_page.setUseDarkAppearanceOverride(true); > else >- m_page.setUseDarkAppearanceOverride(std::nullopt); >+ m_page.setUseDarkAppearanceOverride(WTF::nullopt); > } > > void InspectorPageAgent::applyEmulatedMedia(String& media) >@@ -866,7 +866,7 @@ void InspectorPageAgent::snapshotNode(ErrorString& errorString, int nodeId, Stri > return; > } > >- *outDataURL = snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); >+ *outDataURL = snapshot->toDataURL("image/png"_s, WTF::nullopt, PreserveResolution::Yes); > } > > void InspectorPageAgent::snapshotRect(ErrorString& errorString, int x, int y, int width, int height, const String& coordinateSystem, String* outDataURL) >@@ -885,7 +885,7 @@ void InspectorPageAgent::snapshotRect(ErrorString& errorString, int x, int y, in > return; > } > >- *outDataURL = snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); >+ *outDataURL = snapshot->toDataURL("image/png"_s, WTF::nullopt, PreserveResolution::Yes); > } > > void InspectorPageAgent::archive(ErrorString& errorString, String* data) >diff --git a/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >index 9732ec01ace618a24cf86a0d005bf4344c3fe7b3..b8c013ec24ed4031567ac5d5dc07009d8e701129 100644 >--- a/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >@@ -141,7 +141,7 @@ void InspectorTimelineAgent::setInstruments(ErrorString& errorString, const JSON > return; > } > >- std::optional<Protocol::Timeline::Instrument> instrumentType = Protocol::InspectorHelpers::parseEnumValueFromString<Protocol::Timeline::Instrument>(enumValueString); >+ Optional<Protocol::Timeline::Instrument> instrumentType = Protocol::InspectorHelpers::parseEnumValueFromString<Protocol::Timeline::Instrument>(enumValueString); > if (!instrumentType) { > errorString = makeString("Unexpected enum value: ", enumValueString); > return; >diff --git a/Source/WebCore/inspector/agents/WebConsoleAgent.cpp b/Source/WebCore/inspector/agents/WebConsoleAgent.cpp >index f5dbdf8b2017cf2dd3d12e5f6ae1d857ae80b8e7..d3d43b6f6fe3e29d94a130a322de532ab9f1b5c1 100644 >--- a/Source/WebCore/inspector/agents/WebConsoleAgent.cpp >+++ b/Source/WebCore/inspector/agents/WebConsoleAgent.cpp >@@ -89,7 +89,7 @@ void WebConsoleAgent::getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Insp > } > } > >-static std::optional<std::pair<WTFLogChannelState, WTFLogLevel>> channelConfigurationForString(const String& levelString) >+static Optional<std::pair<WTFLogChannelState, WTFLogLevel>> channelConfigurationForString(const String& levelString) > { > WTFLogChannelState state; > WTFLogLevel level; >@@ -104,7 +104,7 @@ static std::optional<std::pair<WTFLogChannelState, WTFLogLevel>> channelConfigur > else if (equalIgnoringASCIICase(levelString, "verbose")) > level = WTFLogLevelDebug; > else >- return std::nullopt; >+ return WTF::nullopt; > } > > return { { state, level } }; >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index cd8d5c6b3552e6ae5f9d4c0733246438f01e4274..b3c57624eb15f6f2d03847e8184c7d0eb8767b99 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -67,7 +67,7 @@ void FormattingContext::computeOutOfFlowHorizontalGeometry(const Box& layoutBox) > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](std::optional<LayoutUnit> usedWidth) { >+ auto compute = [&](Optional<LayoutUnit> usedWidth) { > return Geometry::outOfFlowHorizontalGeometry(layoutState, layoutBox, usedWidth); > }; > >@@ -97,7 +97,7 @@ void FormattingContext::computeOutOfFlowVerticalGeometry(const Box& layoutBox) c > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](std::optional<LayoutUnit> usedHeight) { >+ auto compute = [&](Optional<LayoutUnit> usedHeight) { > return Geometry::outOfFlowVerticalGeometry(layoutState, layoutBox, usedHeight); > }; > >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 3216302ec9df2f66da3ead4760065834232f0a9e..7f743cb2c62041e5669ea88b722811e110d2ad7a 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -78,48 +78,48 @@ protected: > // This class implements generic positioning and sizing. > class Geometry { > public: >- static VerticalGeometry outOfFlowVerticalGeometry(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static VerticalGeometry outOfFlowVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static HorizontalGeometry outOfFlowHorizontalGeometry(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > >- static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin floatingWidthAndMargin(LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin floatingHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin floatingWidthAndMargin(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > >- static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }, >- std::optional<LayoutUnit> precomputedMarginStart = { }, std::optional<LayoutUnit> precomputedMarginEnd = { }); >+ static HeightAndMargin inlineReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin inlineReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }, >+ Optional<LayoutUnit> precomputedMarginStart = { }, Optional<LayoutUnit> precomputedMarginEnd = { }); > > static LayoutSize inFlowPositionedPositionOffset(const LayoutState&, const Box&); > >- static HeightAndMargin complicatedCases(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >+ static HeightAndMargin complicatedCases(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); > static LayoutUnit shrinkToFitWidth(LayoutState&, const Box&); > > static Edges computedBorder(const LayoutState&, const Box&); >- static std::optional<Edges> computedPadding(const LayoutState&, const Box&); >+ static Optional<Edges> computedPadding(const LayoutState&, const Box&); > > static HorizontalMargin computedNonCollapsedHorizontalMarginValue(const LayoutState&, const Box&); > static VerticalMargin::ComputedValues computedNonCollapsedVerticalMarginValue(const LayoutState&, const Box&); > >- static std::optional<LayoutUnit> computedValueIfNotAuto(const Length& geometryProperty, LayoutUnit containingBlockWidth); >- static std::optional<LayoutUnit> fixedValue(const Length& geometryProperty); >+ static Optional<LayoutUnit> computedValueIfNotAuto(const Length& geometryProperty, LayoutUnit containingBlockWidth); >+ static Optional<LayoutUnit> fixedValue(const Length& geometryProperty); > >- static std::optional<LayoutUnit> computedMinHeight(const LayoutState&, const Box&); >- static std::optional<LayoutUnit> computedMaxHeight(const LayoutState&, const Box&); >+ static Optional<LayoutUnit> computedMinHeight(const LayoutState&, const Box&); >+ static Optional<LayoutUnit> computedMaxHeight(const LayoutState&, const Box&); > > protected: > enum class HeightType { Min, Max, Normal }; >- static std::optional<LayoutUnit> computedHeightValue(const LayoutState&, const Box&, HeightType); >+ static Optional<LayoutUnit> computedHeightValue(const LayoutState&, const Box&, HeightType); > > private: >- static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static VerticalGeometry outOfFlowReplacedVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static HorizontalGeometry outOfFlowReplacedHorizontalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > >- static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static VerticalGeometry outOfFlowNonReplacedVerticalGeometry(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static HorizontalGeometry outOfFlowNonReplacedHorizontalGeometry(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > >- static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin floatingReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin floatingReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > >- static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static WidthAndMargin floatingNonReplacedWidthAndMargin(LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > }; > > class Quirks { >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index 14bba1eb34055bedb4b4b4868506f01ed15a1214..e03d83d073880f592629c54966576e1b36c212c8 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -57,7 +57,7 @@ static inline bool isHeightAuto(const Box& layoutBox) > return false; > } > >-std::optional<LayoutUnit> FormattingContext::Geometry::computedHeightValue(const LayoutState& layoutState, const Box& layoutBox, HeightType heightType) >+Optional<LayoutUnit> FormattingContext::Geometry::computedHeightValue(const LayoutState& layoutState, const Box& layoutBox, HeightType heightType) > { > auto& style = layoutBox.style(); > auto height = heightType == HeightType::Normal ? style.logicalHeight() : heightType == HeightType::Min ? style.logicalMinHeight() : style.logicalMaxHeight(); >@@ -67,7 +67,7 @@ std::optional<LayoutUnit> FormattingContext::Geometry::computedHeightValue(const > if (height.isFixed()) > return { height.value() }; > >- std::optional<LayoutUnit> containingBlockHeightValue; >+ Optional<LayoutUnit> containingBlockHeightValue; > if (layoutBox.isOutOfFlowPositioned()) { > // Containing block's height is already computed since we layout the out-of-flow boxes as the last step. > containingBlockHeightValue = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).height(); >@@ -136,21 +136,21 @@ static LayoutUnit contentHeightForFormattingContextRoot(const LayoutState& layou > return computedHeight; > } > >-std::optional<LayoutUnit> FormattingContext::Geometry::computedValueIfNotAuto(const Length& geometryProperty, LayoutUnit containingBlockWidth) >+Optional<LayoutUnit> FormattingContext::Geometry::computedValueIfNotAuto(const Length& geometryProperty, LayoutUnit containingBlockWidth) > { > if (geometryProperty.isUndefined()) >- return std::nullopt; >+ return WTF::nullopt; > > if (geometryProperty.isAuto()) >- return std::nullopt; >+ return WTF::nullopt; > > return valueForLength(geometryProperty, containingBlockWidth); > } > >-std::optional<LayoutUnit> FormattingContext::Geometry::fixedValue(const Length& geometryProperty) >+Optional<LayoutUnit> FormattingContext::Geometry::fixedValue(const Length& geometryProperty) > { > if (!geometryProperty.isFixed()) >- return std::nullopt; >+ return WTF::nullopt; > return { geometryProperty.value() }; > } > >@@ -158,12 +158,12 @@ std::optional<LayoutUnit> FormattingContext::Geometry::fixedValue(const Length& > // Specifies a percentage for determining the used value. The percentage is calculated with respect to the height of the generated box's containing block. > // If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, > // the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height'). >-std::optional<LayoutUnit> FormattingContext::Geometry::computedMaxHeight(const LayoutState& layoutState, const Box& layoutBox) >+Optional<LayoutUnit> FormattingContext::Geometry::computedMaxHeight(const LayoutState& layoutState, const Box& layoutBox) > { > return computedHeightValue(layoutState, layoutBox, HeightType::Max); > } > >-std::optional<LayoutUnit> FormattingContext::Geometry::computedMinHeight(const LayoutState& layoutState, const Box& layoutBox) >+Optional<LayoutUnit> FormattingContext::Geometry::computedMinHeight(const LayoutState& layoutState, const Box& layoutBox) > { > if (auto minHeightValue = computedHeightValue(layoutState, layoutBox, HeightType::Min)) > return minHeightValue; >@@ -243,7 +243,7 @@ LayoutUnit FormattingContext::Geometry::shrinkToFitWidth(LayoutState& layoutStat > return std::min(std::max(instrinsicWidthConstraints.minimum, availableWidth), instrinsicWidthConstraints.maximum); > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced()); > >@@ -359,7 +359,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet > return { *top, *bottom, { *height, { { *marginBefore, *marginAfter }, { } } } }; > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced()); > >@@ -505,7 +505,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe > return { *left, *right, { *width, { *marginStart, *marginEnd }, { nonComputedMarginStart, nonComputedMarginEnd } } }; > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced()); > >@@ -574,7 +574,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry( > return { *top, *bottom, { height, { { *marginBefore, *marginAfter }, { } } } }; > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isOutOfFlowPositioned() && layoutBox.replaced()); > >@@ -672,7 +672,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > return { *left, *right, { width, { *marginStart, *marginEnd }, { nonComputedMarginStart, nonComputedMarginEnd } } }; > } > >-HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(!layoutBox.replaced()); > // TODO: Use complicated-case for document renderer for now (see BlockFormattingContext::Geometry::inFlowHeightAndMargin). >@@ -713,7 +713,7 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& > return HeightAndMargin { *height, { { *marginBefore, *marginAfter }, { } } }; > } > >-WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced()); > >@@ -736,7 +736,7 @@ WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(La > return WidthAndMargin { *width, margin, margin }; > } > >-HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isFloatingPositioned() && layoutBox.replaced()); > >@@ -746,7 +746,7 @@ HeightAndMargin FormattingContext::Geometry::floatingReplacedHeightAndMargin(con > return inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight); > } > >-WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isFloatingPositioned() && layoutBox.replaced()); > >@@ -760,7 +760,7 @@ WidthAndMargin FormattingContext::Geometry::floatingReplacedWidthAndMargin(const > return inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth, margin.start, margin.end); > } > >-VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isOutOfFlowPositioned()); > >@@ -769,7 +769,7 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowVerticalGeometry(const La > return outOfFlowReplacedVerticalGeometry(layoutState, layoutBox, usedHeight); > } > >-HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isOutOfFlowPositioned()); > >@@ -778,7 +778,7 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowHorizontalGeometry(Layo > return outOfFlowReplacedHorizontalGeometry(layoutState, layoutBox, usedWidth); > } > >-HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isFloatingPositioned()); > >@@ -787,7 +787,7 @@ HeightAndMargin FormattingContext::Geometry::floatingHeightAndMargin(const Layou > return floatingReplacedHeightAndMargin(layoutState, layoutBox, usedHeight); > } > >-WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isFloatingPositioned()); > >@@ -796,7 +796,7 @@ WidthAndMargin FormattingContext::Geometry::floatingWidthAndMargin(LayoutState& > return floatingReplacedWidthAndMargin(layoutState, layoutBox, usedWidth); > } > >-HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced()); > >@@ -842,7 +842,7 @@ HeightAndMargin FormattingContext::Geometry::inlineReplacedHeightAndMargin(const > } > > WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, >- std::optional<LayoutUnit> usedWidth, std::optional<LayoutUnit> precomputedMarginStart, std::optional<LayoutUnit> precomputedMarginEnd) >+ Optional<LayoutUnit> usedWidth, Optional<LayoutUnit> precomputedMarginStart, Optional<LayoutUnit> precomputedMarginEnd) > { > ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced()); > >@@ -951,7 +951,7 @@ LayoutSize FormattingContext::Geometry::inFlowPositionedPositionOffset(const Lay > bottom = -*top; > } else { > // #4 >- bottom = std::nullopt; >+ bottom = WTF::nullopt; > } > > // For relatively positioned elements, 'left' and 'right' move the box(es) horizontally, without changing their size. >@@ -983,7 +983,7 @@ LayoutSize FormattingContext::Geometry::inFlowPositionedPositionOffset(const Lay > if (isLeftToRightDirection) > right = -*left; > else >- left = std::nullopt; >+ left = WTF::nullopt; > } > > ASSERT(!bottom || *top == -*bottom); >@@ -1006,10 +1006,10 @@ Edges FormattingContext::Geometry::computedBorder(const LayoutState&, const Box& > }; > } > >-std::optional<Edges> FormattingContext::Geometry::computedPadding(const LayoutState& layoutState, const Box& layoutBox) >+Optional<Edges> FormattingContext::Geometry::computedPadding(const LayoutState& layoutState, const Box& layoutBox) > { > if (!layoutBox.isPaddingApplicable()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& style = layoutBox.style(); > auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth(); >diff --git a/Source/WebCore/layout/FormattingState.h b/Source/WebCore/layout/FormattingState.h >index 0e91e6959c59d4136a945ba0089422d4836b60e7..4a839769f1aa1641d6780d2cbb47af4f19ec250f 100644 >--- a/Source/WebCore/layout/FormattingState.h >+++ b/Source/WebCore/layout/FormattingState.h >@@ -55,7 +55,7 @@ public: > > void setInstrinsicWidthConstraints(const Box&, FormattingContext::InstrinsicWidthConstraints); > void clearInstrinsicWidthConstraints(const Box&); >- std::optional<FormattingContext::InstrinsicWidthConstraints> instrinsicWidthConstraints(const Box&) const; >+ Optional<FormattingContext::InstrinsicWidthConstraints> instrinsicWidthConstraints(const Box&) const; > > bool isBlockFormattingState() const { return m_type == Type::Block; } > bool isInlineFormattingState() const { return m_type == Type::Inline; } >@@ -85,7 +85,7 @@ inline void FormattingState::clearInstrinsicWidthConstraints(const Box& layoutBo > m_instrinsicWidthConstraints.remove(&layoutBox); > } > >-inline std::optional<FormattingContext::InstrinsicWidthConstraints> FormattingState::instrinsicWidthConstraints(const Box& layoutBox) const >+inline Optional<FormattingContext::InstrinsicWidthConstraints> FormattingState::instrinsicWidthConstraints(const Box& layoutBox) const > { > ASSERT(&m_layoutState.formattingStateForBox(layoutBox) == this); > auto iterator = m_instrinsicWidthConstraints.find(&layoutBox); >diff --git a/Source/WebCore/layout/MarginTypes.h b/Source/WebCore/layout/MarginTypes.h >index 6e53f8879ac999e5ddee6bad70a07eacdc36ebe6..fe68f2979a581031cffa4ee8d0782f9303f00d6e 100644 >--- a/Source/WebCore/layout/MarginTypes.h >+++ b/Source/WebCore/layout/MarginTypes.h >@@ -41,19 +41,19 @@ struct VerticalMargin { > ComputedValues nonCollapsedValues() const { return m_nonCollapsed; } > > struct CollapsedValues { >- std::optional<LayoutUnit> before; >- std::optional<LayoutUnit> after; >+ Optional<LayoutUnit> before; >+ Optional<LayoutUnit> after; > }; >- std::optional<CollapsedValues> collapsedValues() const { return m_collapsed; } >+ Optional<CollapsedValues> collapsedValues() const { return m_collapsed; } > void setCollapsedValues(CollapsedValues collapsedValues) { m_collapsed = collapsedValues; } > >- VerticalMargin(ComputedValues nonCollapsed, std::optional<CollapsedValues>); >+ VerticalMargin(ComputedValues nonCollapsed, Optional<CollapsedValues>); > > VerticalMargin() = default; > ~VerticalMargin() = default; > private: > ComputedValues m_nonCollapsed; >- std::optional<CollapsedValues> m_collapsed; >+ Optional<CollapsedValues> m_collapsed; > }; > > struct HorizontalMargin { >@@ -63,14 +63,14 @@ struct HorizontalMargin { > > struct PositiveAndNegativeVerticalMargin { > struct Values { >- std::optional<LayoutUnit> positive; >- std::optional<LayoutUnit> negative; >+ Optional<LayoutUnit> positive; >+ Optional<LayoutUnit> negative; > }; > Values before; > Values after; > }; > >-inline VerticalMargin::VerticalMargin(VerticalMargin::ComputedValues nonCollapsed, std::optional<VerticalMargin::CollapsedValues> collapsed) >+inline VerticalMargin::VerticalMargin(VerticalMargin::ComputedValues nonCollapsed, Optional<VerticalMargin::CollapsedValues> collapsed) > : m_nonCollapsed(nonCollapsed) > , m_collapsed(collapsed) > { >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 6afad42102c8d75b6b836852887122a28b23d5f0..429c0a9811a48dbf4551a4be92130f250143a38b 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -302,7 +302,7 @@ void BlockFormattingContext::computeWidthAndMargin(const Box& layoutBox) const > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](std::optional<LayoutUnit> usedWidth) -> WidthAndMargin { >+ auto compute = [&](Optional<LayoutUnit> usedWidth) -> WidthAndMargin { > > if (layoutBox.isInFlow()) > return Geometry::inFlowWidthAndMargin(layoutState, layoutBox, usedWidth); >@@ -340,7 +340,7 @@ void BlockFormattingContext::computeHeightAndMargin(const Box& layoutBox) const > { > auto& layoutState = this->layoutState(); > >- auto compute = [&](std::optional<LayoutUnit> usedHeight) -> HeightAndMargin { >+ auto compute = [&](Optional<LayoutUnit> usedHeight) -> HeightAndMargin { > > if (layoutBox.isInFlow()) > return Geometry::inFlowHeightAndMargin(layoutState, layoutBox, usedHeight); >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index b1e08b28349cc31b056525a65003acb672478959..2f82d3e9d51056aa8bc0f426bb7d2e9f97ff680e 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -71,8 +71,8 @@ private: > // This class implements positioning and sizing for boxes participating in a block formatting context. > class Geometry : public FormattingContext::Geometry { > public: >- static HeightAndMargin inFlowHeightAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin inFlowWidthAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin inFlowHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin inFlowWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > > static Point staticPosition(const LayoutState&, const Box&); > >@@ -108,9 +108,9 @@ private: > static bool marginsCollapseThrough(const Box&); > }; > >- static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedHeight = { }); >- static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >- static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutState&, const Box&, std::optional<LayoutUnit> usedWidth = { }); >+ static HeightAndMargin inFlowNonReplacedHeightAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedHeight = { }); >+ static WidthAndMargin inFlowNonReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); >+ static WidthAndMargin inFlowReplacedWidthAndMargin(const LayoutState&, const Box&, Optional<LayoutUnit> usedWidth = { }); > static Point staticPositionForOutOfFlowPositioned(const LayoutState&, const Box&); > }; > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index d5158a0964ac153742fac0f58e6f63d45a8d15c2..621ba4b348ca2facc9fadac72573dbd1c62655c3 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -37,7 +37,7 @@ > namespace WebCore { > namespace Layout { > >-HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isInFlow() && !layoutBox.replaced()); > ASSERT(layoutBox.isOverflowVisible()); >@@ -108,7 +108,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > return heightAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isInFlow() && !layoutBox.replaced()); > >@@ -200,7 +200,7 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin > return widthAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isInFlow() && layoutBox.replaced()); > >@@ -239,7 +239,7 @@ Point BlockFormattingContext::Geometry::staticPosition(const LayoutState& layout > return { left, top }; > } > >-HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedHeight) >+HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) > { > ASSERT(layoutBox.isInFlow()); > >@@ -267,7 +267,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(const La > return heightAndMargin; > } > >-WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, std::optional<LayoutUnit> usedWidth) >+WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedWidth) > { > ASSERT(layoutBox.isInFlow()); > >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index 9f5590ff37457e08d5305ec275c61a6e610591d2..fde094b3c58a85823b0d20b9f60a879bf831b21a 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -149,17 +149,17 @@ public: > LayoutUnit nonComputedMarginStart() const; > LayoutUnit nonComputedMarginEnd() const; > >- std::optional<LayoutUnit> estimatedMarginBefore() const { return m_estimatedMarginBefore; } >+ Optional<LayoutUnit> estimatedMarginBefore() const { return m_estimatedMarginBefore; } > > LayoutUnit borderTop() const; > LayoutUnit borderLeft() const; > LayoutUnit borderBottom() const; > LayoutUnit borderRight() const; > >- std::optional<LayoutUnit> paddingTop() const; >- std::optional<LayoutUnit> paddingLeft() const; >- std::optional<LayoutUnit> paddingBottom() const; >- std::optional<LayoutUnit> paddingRight() const; >+ Optional<LayoutUnit> paddingTop() const; >+ Optional<LayoutUnit> paddingLeft() const; >+ Optional<LayoutUnit> paddingBottom() const; >+ Optional<LayoutUnit> paddingRight() const; > > LayoutUnit contentBoxTop() const { return borderTop() + paddingTop().value_or(0); } > LayoutUnit contentBoxLeft() const { return borderLeft() + paddingLeft().value_or(0); } >@@ -197,7 +197,7 @@ private: > void setEstimatedMarginBefore(LayoutUnit marginBefore) { m_estimatedMarginBefore = marginBefore; } > > void setBorder(Layout::Edges); >- void setPadding(std::optional<Layout::Edges>); >+ void setPadding(Optional<Layout::Edges>); > > #if !ASSERT_DISABLED > void invalidateMargin(); >@@ -227,10 +227,10 @@ private: > Layout::HorizontalMargin m_horizontalMargin; > Layout::VerticalMargin m_verticalMargin; > Layout::HorizontalMargin m_horizontalNonComputedMargin; >- std::optional<LayoutUnit> m_estimatedMarginBefore; >+ Optional<LayoutUnit> m_estimatedMarginBefore; > > Layout::Edges m_border; >- std::optional<Layout::Edges> m_padding; >+ Optional<Layout::Edges> m_padding; > > #if !ASSERT_DISABLED > bool m_hasValidTop { false }; >@@ -541,7 +541,7 @@ inline void Box::setBorder(Layout::Edges border) > m_border = border; > } > >-inline void Box::setPadding(std::optional<Layout::Edges> padding) >+inline void Box::setPadding(Optional<Layout::Edges> padding) > { > #if !ASSERT_DISABLED > setHasValidPadding(); >@@ -603,7 +603,7 @@ inline LayoutUnit Box::nonComputedMarginEnd() const > return m_horizontalNonComputedMargin.end; > } > >-inline std::optional<LayoutUnit> Box::paddingTop() const >+inline Optional<LayoutUnit> Box::paddingTop() const > { > ASSERT(m_hasValidPadding); > if (!m_padding) >@@ -611,7 +611,7 @@ inline std::optional<LayoutUnit> Box::paddingTop() const > return m_padding->vertical.top; > } > >-inline std::optional<LayoutUnit> Box::paddingLeft() const >+inline Optional<LayoutUnit> Box::paddingLeft() const > { > ASSERT(m_hasValidPadding); > if (!m_padding) >@@ -619,7 +619,7 @@ inline std::optional<LayoutUnit> Box::paddingLeft() const > return m_padding->horizontal.left; > } > >-inline std::optional<LayoutUnit> Box::paddingBottom() const >+inline Optional<LayoutUnit> Box::paddingBottom() const > { > ASSERT(m_hasValidPadding); > if (!m_padding) >@@ -627,7 +627,7 @@ inline std::optional<LayoutUnit> Box::paddingBottom() const > return m_padding->vertical.bottom; > } > >-inline std::optional<LayoutUnit> Box::paddingRight() const >+inline Optional<LayoutUnit> Box::paddingRight() const > { > ASSERT(m_hasValidPadding); > if (!m_padding) >diff --git a/Source/WebCore/layout/floats/FloatAvoider.h b/Source/WebCore/layout/floats/FloatAvoider.h >index 7ad37a148dec9ecc5715311650e818364c70bc94..7d46690494d4ee6b81c183c28a2de3b4b2fda662 100644 >--- a/Source/WebCore/layout/floats/FloatAvoider.h >+++ b/Source/WebCore/layout/floats/FloatAvoider.h >@@ -50,8 +50,8 @@ public: > Display::Box::Rect rectInContainingBlock() const; > > struct HorizontalConstraints { >- std::optional<PositionInContextRoot> left; >- std::optional<PositionInContextRoot> right; >+ Optional<PositionInContextRoot> left; >+ Optional<PositionInContextRoot> right; > }; > void setHorizontalConstraints(HorizontalConstraints); > void setVerticalConstraint(PositionInContextRoot); >diff --git a/Source/WebCore/layout/floats/FloatingContext.cpp b/Source/WebCore/layout/floats/FloatingContext.cpp >index 1314a178c8e768f792e303d680172c086ef0a2eb..d9dc8e6c3da511cfafa4f294fac844b84738e9ec 100644 >--- a/Source/WebCore/layout/floats/FloatingContext.cpp >+++ b/Source/WebCore/layout/floats/FloatingContext.cpp >@@ -79,14 +79,14 @@ private: > > const FloatingState::FloatList& m_floats; > >- std::optional<unsigned> m_leftIndex; >- std::optional<unsigned> m_rightIndex; >+ Optional<unsigned> m_leftIndex; >+ Optional<unsigned> m_rightIndex; > PositionInContextRoot m_verticalPosition; > }; > > class Iterator { > public: >- Iterator(const FloatingState::FloatList&, std::optional<PositionInContextRoot> verticalPosition); >+ Iterator(const FloatingState::FloatList&, Optional<PositionInContextRoot> verticalPosition); > > const FloatingPair& operator*() const { return m_current; } > Iterator& operator++(); >@@ -108,7 +108,7 @@ static Iterator begin(const FloatingState& floatingState, PositionInContextRoot > > static Iterator end(const FloatingState& floatingState) > { >- return Iterator(floatingState.floats(), std::nullopt); >+ return Iterator(floatingState.floats(), WTF::nullopt); > } > > FloatingContext::FloatingContext(FloatingState& floatingState) >@@ -143,7 +143,7 @@ Point FloatingContext::positionForFloat(const Box& layoutBox) const > return floatBox.rectInContainingBlock().topLeft(); > } > >-std::optional<Point> FloatingContext::positionForFloatAvoiding(const Box& layoutBox) const >+Optional<Point> FloatingContext::positionForFloatAvoiding(const Box& layoutBox) const > { > ASSERT(layoutBox.establishesBlockFormattingContext()); > ASSERT(!layoutBox.isFloatingPositioned()); >@@ -157,7 +157,7 @@ std::optional<Point> FloatingContext::positionForFloatAvoiding(const Box& layout > return { floatAvoider.rectInContainingBlock().topLeft() }; > } > >-std::optional<Position> FloatingContext::verticalPositionWithClearance(const Box& layoutBox) const >+Optional<Position> FloatingContext::verticalPositionWithClearance(const Box& layoutBox) const > { > ASSERT(layoutBox.hasFloatClear()); > ASSERT(layoutBox.isBlockLevelBox()); >@@ -165,7 +165,7 @@ std::optional<Position> FloatingContext::verticalPositionWithClearance(const Box > if (m_floatingState.isEmpty()) > return { }; > >- auto bottom = [&](std::optional<PositionInContextRoot> floatBottom) -> std::optional<Position> { >+ auto bottom = [&](Optional<PositionInContextRoot> floatBottom) -> Optional<Position> { > // 'bottom' is in the formatting root's coordinate system. > if (!floatBottom) > return { }; >@@ -242,7 +242,7 @@ void FloatingContext::floatingPosition(FloatAvoider& floatAvoider) const > // Ensure the float avoider starts with no constraints. > floatAvoider.resetPosition(); > >- std::optional<PositionInContextRoot> bottomMost; >+ Optional<PositionInContextRoot> bottomMost; > auto end = Layout::end(m_floatingState); > for (auto iterator = begin(m_floatingState, { floatAvoider.rect().top() }); iterator != end; ++iterator) { > ASSERT(!(*iterator).isEmpty()); >@@ -332,8 +332,8 @@ bool FloatingPair::operator ==(const FloatingPair& other) const > > FloatAvoider::HorizontalConstraints FloatingPair::horizontalConstraints() const > { >- std::optional<PositionInContextRoot> leftEdge; >- std::optional<PositionInContextRoot> rightEdge; >+ Optional<PositionInContextRoot> leftEdge; >+ Optional<PositionInContextRoot> rightEdge; > > if (left()) > leftEdge = PositionInContextRoot { left()->rectWithMargin().right() }; >@@ -350,8 +350,8 @@ PositionInContextRoot FloatingPair::bottom() const > auto* right = this->right(); > ASSERT(left || right); > >- auto leftBottom = left ? std::optional<PositionInContextRoot>(PositionInContextRoot { left->rectWithMargin().bottom() }) : std::nullopt; >- auto rightBottom = right ? std::optional<PositionInContextRoot>(PositionInContextRoot { right->rectWithMargin().bottom() }) : std::nullopt; >+ auto leftBottom = left ? Optional<PositionInContextRoot>(PositionInContextRoot { left->rectWithMargin().bottom() }) : WTF::nullopt; >+ auto rightBottom = right ? Optional<PositionInContextRoot>(PositionInContextRoot { right->rectWithMargin().bottom() }) : WTF::nullopt; > > if (leftBottom && rightBottom) > return std::max(*leftBottom, *rightBottom); >@@ -362,7 +362,7 @@ PositionInContextRoot FloatingPair::bottom() const > return *rightBottom; > } > >-Iterator::Iterator(const FloatingState::FloatList& floats, std::optional<PositionInContextRoot> verticalPosition) >+Iterator::Iterator(const FloatingState::FloatList& floats, Optional<PositionInContextRoot> verticalPosition) > : m_floats(floats) > , m_current(floats) > { >@@ -370,7 +370,7 @@ Iterator::Iterator(const FloatingState::FloatList& floats, std::optional<Positio > set(*verticalPosition); > } > >-inline static std::optional<unsigned> previousFloatingIndex(Float floatingType, const FloatingState::FloatList& floats, unsigned currentIndex) >+inline static Optional<unsigned> previousFloatingIndex(Float floatingType, const FloatingState::FloatList& floats, unsigned currentIndex) > { > RELEASE_ASSERT(currentIndex <= floats.size()); > >@@ -390,7 +390,7 @@ Iterator& Iterator::operator++() > return *this; > } > >- auto findPreviousFloatingWithLowerBottom = [&](Float floatingType, unsigned currentIndex) -> std::optional<unsigned> { >+ auto findPreviousFloatingWithLowerBottom = [&](Float floatingType, unsigned currentIndex) -> Optional<unsigned> { > > RELEASE_ASSERT(currentIndex < m_floats.size()); > >@@ -400,7 +400,7 @@ Iterator& Iterator::operator++() > > auto currentBottom = m_floats[currentIndex].rectWithMargin().bottom(); > >- std::optional<unsigned> index = currentIndex; >+ Optional<unsigned> index = currentIndex; > while (true) { > index = previousFloatingIndex(floatingType, m_floats, *index); > if (!index) >@@ -420,8 +420,8 @@ Iterator& Iterator::operator++() > // Ensure that the new floating's bottom edge is positioned lower than the current one -which essentially means skipping in-between floats that are positioned higher). > // 3. Reset the vertical position and align it with the new left-right pair. These floats are now the inner-most boxes for the current vertical position. > // As the result we have more horizontal space on the current vertical position. >- auto leftBottom = m_current.left() ? std::optional<PositionInContextRoot>(m_current.left()->bottom()) : std::nullopt; >- auto rightBottom = m_current.right() ? std::optional<PositionInContextRoot>(m_current.right()->bottom()) : std::nullopt; >+ auto leftBottom = m_current.left() ? Optional<PositionInContextRoot>(m_current.left()->bottom()) : WTF::nullopt; >+ auto rightBottom = m_current.right() ? Optional<PositionInContextRoot>(m_current.right()->bottom()) : WTF::nullopt; > > auto updateLeft = (leftBottom == rightBottom) || (!rightBottom || (leftBottom && leftBottom < rightBottom)); > auto updateRight = (leftBottom == rightBottom) || (!leftBottom || (rightBottom && leftBottom > rightBottom)); >@@ -458,7 +458,7 @@ void Iterator::set(PositionInContextRoot verticalPosition) > return; > } > >- auto findFloatingBelow = [&](Float floatingType) -> std::optional<unsigned> { >+ auto findFloatingBelow = [&](Float floatingType) -> Optional<unsigned> { > > ASSERT(!m_floats.isEmpty()); > >diff --git a/Source/WebCore/layout/floats/FloatingContext.h b/Source/WebCore/layout/floats/FloatingContext.h >index 42eea7a3cb7d62c51e16f551efcdf53139d438d3..ea8ede04e2af5f13e067dc4c692b3eb8a31c5b79 100644 >--- a/Source/WebCore/layout/floats/FloatingContext.h >+++ b/Source/WebCore/layout/floats/FloatingContext.h >@@ -51,8 +51,8 @@ public: > FloatingState& floatingState() const { return m_floatingState; } > > Point positionForFloat(const Box&) const; >- std::optional<Point> positionForFloatAvoiding(const Box&) const; >- std::optional<Position> verticalPositionWithClearance(const Box&) const; >+ Optional<Point> positionForFloatAvoiding(const Box&) const; >+ Optional<Position> verticalPositionWithClearance(const Box&) const; > > private: > LayoutState& layoutState() const { return m_floatingState.layoutState(); } >diff --git a/Source/WebCore/layout/floats/FloatingState.cpp b/Source/WebCore/layout/floats/FloatingState.cpp >index 91634968d82c71555834981956c2f09137e5795d..ba63588ec8eb1dccbffd07b4fc343a67e7b96749 100644 >--- a/Source/WebCore/layout/floats/FloatingState.cpp >+++ b/Source/WebCore/layout/floats/FloatingState.cpp >@@ -134,14 +134,14 @@ FloatingState::Constraints FloatingState::constraints(PositionInContextRoot vert > return constraints; > } > >-std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const >+Optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const > { > if (m_floats.isEmpty()) > return { }; > > // TODO: Currently this is only called once for each formatting context root with floats per layout. > // Cache the value if we end up calling it more frequently (and update it at append/remove). >- std::optional<PositionInContextRoot> bottom; >+ Optional<PositionInContextRoot> bottom; > for (auto& floatItem : m_floats) { > // Ignore floats from other formatting contexts when the floating state is inherited. > if (!floatItem.inFormattingContext(formattingContextRoot)) >diff --git a/Source/WebCore/layout/floats/FloatingState.h b/Source/WebCore/layout/floats/FloatingState.h >index 8678277dd1b6d15984d35a056fe6d6ac2b75c666..0335e05bfe5b7bb530a39dd4d046e5f3fc893391 100644 >--- a/Source/WebCore/layout/floats/FloatingState.h >+++ b/Source/WebCore/layout/floats/FloatingState.h >@@ -54,13 +54,13 @@ public: > > const Box& root() const { return *m_formattingContextRoot; } > >- std::optional<PositionInContextRoot> leftBottom(const Box& formattingContextRoot) const; >- std::optional<PositionInContextRoot> rightBottom(const Box& formattingContextRoot) const; >- std::optional<PositionInContextRoot> bottom(const Box& formattingContextRoot) const; >+ Optional<PositionInContextRoot> leftBottom(const Box& formattingContextRoot) const; >+ Optional<PositionInContextRoot> rightBottom(const Box& formattingContextRoot) const; >+ Optional<PositionInContextRoot> bottom(const Box& formattingContextRoot) const; > > struct Constraints { >- std::optional<PositionInContextRoot> left; >- std::optional<PositionInContextRoot> right; >+ Optional<PositionInContextRoot> left; >+ Optional<PositionInContextRoot> right; > }; > Constraints constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) const; > >@@ -90,26 +90,26 @@ private: > > LayoutState& layoutState() const { return m_layoutState; } > >- std::optional<PositionInContextRoot> bottom(const Box& formattingContextRoot, Clear) const; >+ Optional<PositionInContextRoot> bottom(const Box& formattingContextRoot, Clear) const; > > LayoutState& m_layoutState; > WeakPtr<const Box> m_formattingContextRoot; > FloatList m_floats; > }; > >-inline std::optional<PositionInContextRoot> FloatingState::leftBottom(const Box& formattingContextRoot) const >+inline Optional<PositionInContextRoot> FloatingState::leftBottom(const Box& formattingContextRoot) const > { > ASSERT(formattingContextRoot.establishesFormattingContext()); > return bottom(formattingContextRoot, Clear::Left); > } > >-inline std::optional<PositionInContextRoot> FloatingState::rightBottom(const Box& formattingContextRoot) const >+inline Optional<PositionInContextRoot> FloatingState::rightBottom(const Box& formattingContextRoot) const > { > ASSERT(formattingContextRoot.establishesFormattingContext()); > return bottom(formattingContextRoot, Clear::Right); > } > >-inline std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot) const >+inline Optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot) const > { > ASSERT(formattingContextRoot.establishesFormattingContext()); > return bottom(formattingContextRoot, Clear::Both); >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index fb554ff15d796389126ba7a8017cdb1e3acfd4e1..6f86264efefd031712c009fb28eb498b43fd3b0c 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -143,7 +143,7 @@ void InlineFormattingContext::splitInlineRunIfNeeded(const InlineRun& inlineRun, > const InlineItem* lastInlineItem { nullptr }; > unsigned length { 0 }; > }; >- std::optional<Uncommitted> uncommitted; >+ Optional<Uncommitted> uncommitted; > > auto commit = [&] { > if (!uncommitted) >@@ -411,7 +411,7 @@ void InlineFormattingContext::placeInFlowPositionedChildren(unsigned fistRunInde > > auto positionOffset = [&](auto& layoutBox) { > // FIXME: Need to figure out whether in-flow offset should stick. This might very well be temporary. >- std::optional<LayoutSize> offset; >+ Optional<LayoutSize> offset; > for (auto* box = &layoutBox; box != &root(); box = box->parent()) { > if (!box->isInFlowPositioned()) > continue; >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >index f0aed35de5c077723d13cfb37dd5783fa5cbdc8d..4010ffd04e6a6848d8d8e7e975862d8ec976723c 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >@@ -66,7 +66,7 @@ private: > LayoutUnit contentLogicalRight() const; > LayoutUnit contentLogicalLeft() const { return m_logicalRect.left(); } > LayoutUnit availableWidth() const { return m_availableWidth; } >- std::optional<InlineRunProvider::Run::Type> lastRunType() const { return m_lastRunType; } >+ Optional<InlineRunProvider::Run::Type> lastRunType() const { return m_lastRunType; } > > LayoutUnit logicalTop() const { return m_logicalRect.top(); } > LayoutUnit logicalBottom() const { return m_logicalRect.bottom(); } >@@ -77,8 +77,8 @@ private: > LayoutUnit width; > unsigned length; > }; >- std::optional<TrailingTrimmableContent> m_trailingTrimmableContent; >- std::optional<InlineRunProvider::Run::Type> m_lastRunType; >+ Optional<TrailingTrimmableContent> m_trailingTrimmableContent; >+ Optional<InlineRunProvider::Run::Type> m_lastRunType; > bool m_lastRunCanExpand { false }; > > Display::Box::Rect m_logicalRect; >diff --git a/Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp b/Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp >index 4096e42d7275d94a124a695e726206116c74602a..576a0bb795437e013742a7286943af2481004fec 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp >@@ -46,16 +46,16 @@ InlineLineBreaker::InlineLineBreaker(const LayoutState& layoutState, const Inlin > { > } > >-std::optional<InlineLineBreaker::Run> InlineLineBreaker::nextRun(LayoutUnit contentLogicalLeft, LayoutUnit availableWidth, bool lineIsEmpty) >+Optional<InlineLineBreaker::Run> InlineLineBreaker::nextRun(LayoutUnit contentLogicalLeft, LayoutUnit availableWidth, bool lineIsEmpty) > { > if (isAtContentEnd()) >- return std::nullopt; >+ return WTF::nullopt; > > InlineRunProvider::Run currentInlineRun = m_inlineRuns[m_currentRunIndex]; > // Adjust the current run if it is split midword. > if (m_splitPosition) { > ASSERT(currentInlineRun.isText()); >- m_splitPosition = std::nullopt; >+ m_splitPosition = WTF::nullopt; > } > > if (currentInlineRun.isLineBreak()) { >@@ -190,7 +190,7 @@ InlineLineBreaker::Run InlineLineBreaker::splitRun(const InlineRunProvider::Run& > return { Run::Position::Undetermined, { }, inlineRun }; > } > >-std::optional<ItemPosition> InlineLineBreaker::adjustSplitPositionWithHyphenation(const InlineRunProvider::Run&, ItemPosition, LayoutUnit, LayoutUnit, bool) const >+Optional<ItemPosition> InlineLineBreaker::adjustSplitPositionWithHyphenation(const InlineRunProvider::Run&, ItemPosition, LayoutUnit, LayoutUnit, bool) const > { > return { }; > } >diff --git a/Source/WebCore/layout/inlineformatting/InlineLineBreaker.h b/Source/WebCore/layout/inlineformatting/InlineLineBreaker.h >index 438af65d44cad8a2abed34ac37256a2fd6aa5a02..387b0fcf35f6568150af5b036ca0aec8bc1b7989 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLineBreaker.h >+++ b/Source/WebCore/layout/inlineformatting/InlineLineBreaker.h >@@ -44,7 +44,7 @@ public: > LayoutUnit width; > InlineRunProvider::Run content; > }; >- std::optional<Run> nextRun(LayoutUnit contentLogicalLeft, LayoutUnit availableWidth, bool lineIsEmpty); >+ Optional<Run> nextRun(LayoutUnit contentLogicalLeft, LayoutUnit availableWidth, bool lineIsEmpty); > > private: > enum class LineBreakingBehavior { Keep, Break, WrapToNextLine }; >@@ -53,14 +53,14 @@ private: > Run splitRun(const InlineRunProvider::Run&, LayoutUnit contentLogicalLeft, LayoutUnit availableWidth, bool lineIsEmpty); > LayoutUnit runWidth(const InlineRunProvider::Run&, LayoutUnit contentLogicalLeft) const; > LayoutUnit textWidth(const InlineRunProvider::Run&, LayoutUnit contentLogicalLeft) const; >- std::optional<ItemPosition> adjustSplitPositionWithHyphenation(const InlineRunProvider::Run&, ItemPosition splitPosition, LayoutUnit contentLogicalLeft, LayoutUnit availableWidth, bool isLineEmpty) const; >+ Optional<ItemPosition> adjustSplitPositionWithHyphenation(const InlineRunProvider::Run&, ItemPosition splitPosition, LayoutUnit contentLogicalLeft, LayoutUnit availableWidth, bool isLineEmpty) const; > > const LayoutState& m_layoutState; > const InlineContent& m_inlineContent; > const Vector<InlineRunProvider::Run>& m_inlineRuns; > > unsigned m_currentRunIndex { 0 }; >- std::optional<ItemPosition> m_splitPosition; >+ Optional<ItemPosition> m_splitPosition; > bool m_hyphenationIsDisabled { false }; > }; > >diff --git a/Source/WebCore/layout/inlineformatting/InlineRun.h b/Source/WebCore/layout/inlineformatting/InlineRun.h >index 7ef3854c12e852671965d61c063098fa5408105e..d6554416aa5115029f5d53f6a0471bedd1ee115e 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineRun.h >+++ b/Source/WebCore/layout/inlineformatting/InlineRun.h >@@ -73,8 +73,8 @@ struct InlineRun { > unsigned m_length; > }; > void setTextContext(TextContext textContext) { m_textContext.emplace(textContext); } >- std::optional<TextContext>& textContext() { return m_textContext; } >- std::optional<TextContext> textContext() const { return m_textContext; } >+ Optional<TextContext>& textContext() { return m_textContext; } >+ Optional<TextContext> textContext() const { return m_textContext; } > > const InlineItem& inlineItem() const { return m_inlineItem; } > >@@ -83,7 +83,7 @@ private: > ExpansionOpportunity m_expansionOpportunity; > > const InlineItem& m_inlineItem; >- std::optional<TextContext> m_textContext; >+ Optional<TextContext> m_textContext; > }; > > using InlineRuns = Vector<InlineRun>; >diff --git a/Source/WebCore/layout/inlineformatting/InlineRunProvider.h b/Source/WebCore/layout/inlineformatting/InlineRunProvider.h >index 4cdfe33cda86c18ca005594f789d7a06f1a55483..d77c148eeee0cada245661efeb8fc567deed8608 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineRunProvider.h >+++ b/Source/WebCore/layout/inlineformatting/InlineRunProvider.h >@@ -89,7 +89,7 @@ public: > unsigned m_length { 0 }; > IsCollapsed m_isCollapsed { IsCollapsed::No }; > }; >- std::optional<TextContext> textContext() const { return m_textContext; } >+ Optional<TextContext> textContext() const { return m_textContext; } > // Note that style() and inlineItem() always returns the first InlineItem for a run. > const RenderStyle& style() const { return m_inlineItem.style(); } > const InlineItem& inlineItem() const { return m_inlineItem; } >@@ -97,12 +97,12 @@ public: > private: > friend class InlineRunProvider; > >- Run(const InlineItem&, Type, std::optional<TextContext>); >- std::optional<TextContext>& textContext() { return m_textContext; } >+ Run(const InlineItem&, Type, Optional<TextContext>); >+ Optional<TextContext>& textContext() { return m_textContext; } > > const Type m_type; > const InlineItem& m_inlineItem; >- std::optional<TextContext> m_textContext; >+ Optional<TextContext> m_textContext; > }; > const Vector<InlineRunProvider::Run>& runs() const { return m_inlineRuns; } > >@@ -120,22 +120,22 @@ private: > > inline InlineRunProvider::Run InlineRunProvider::Run::createBoxRun(const InlineItem& inlineItem) > { >- return { inlineItem, Type::Box, std::nullopt }; >+ return { inlineItem, Type::Box, WTF::nullopt }; > } > > inline InlineRunProvider::Run InlineRunProvider::Run::createFloatRun(const InlineItem& inlineItem) > { >- return { inlineItem, Type::Float, std::nullopt }; >+ return { inlineItem, Type::Float, WTF::nullopt }; > } > > inline InlineRunProvider::Run InlineRunProvider::Run::createSoftLineBreakRun(const InlineItem& inlineItem) > { >- return { inlineItem, Type::SoftLineBreak, std::nullopt }; >+ return { inlineItem, Type::SoftLineBreak, WTF::nullopt }; > } > > inline InlineRunProvider::Run InlineRunProvider::Run::createHardLineBreakRun(const InlineItem& inlineItem) > { >- return { inlineItem, Type::HardLineBreak, std::nullopt }; >+ return { inlineItem, Type::HardLineBreak, WTF::nullopt }; > } > > inline InlineRunProvider::Run InlineRunProvider::Run::createWhitespaceRun(const InlineItem& inlineItem, ItemPosition start, unsigned length, bool isCollapsible) >@@ -150,7 +150,7 @@ inline InlineRunProvider::Run InlineRunProvider::Run::createNonWhitespaceRun(con > return { inlineItem, Type::NonWhitespace, TextContext(start, length, TextContext::IsCollapsed::No) }; > } > >-inline InlineRunProvider::Run::Run(const InlineItem& inlineItem, Type type, std::optional<TextContext> textContext) >+inline InlineRunProvider::Run::Run(const InlineItem& inlineItem, Type type, Optional<TextContext> textContext) > : m_type(type) > , m_inlineItem(inlineItem) > , m_textContext(textContext) >diff --git a/Source/WebCore/layout/inlineformatting/Line.cpp b/Source/WebCore/layout/inlineformatting/Line.cpp >index 33b4e3489c89d814327c6086873e1c4fd64541b2..b1273d1b1c5fc69ff9abe08059ec465777255622 100644 >--- a/Source/WebCore/layout/inlineformatting/Line.cpp >+++ b/Source/WebCore/layout/inlineformatting/Line.cpp >@@ -83,7 +83,7 @@ void InlineFormattingContext::Line::appendContent(const InlineRunProvider::Run& > ASSERT(!isClosed()); > > // Append this text run to the end of the last text run, if the last run is continuous. >- std::optional<InlineRun::TextContext> textRun; >+ Optional<InlineRun::TextContext> textRun; > if (run.isText()) { > auto textContext = run.textContext(); > auto runLength = textContext->isCollapsed() ? 1 : textContext->length(); >diff --git a/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp b/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp >index 4888d6c4ec925e25fa337874d276f1a0ad93d027..375ed723cd2b2984df73e0e73211ba028418fe08 100644 >--- a/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp >+++ b/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp >@@ -34,9 +34,9 @@ > namespace WebCore { > namespace Layout { > >-std::optional<ItemPosition> TextUtil::hyphenPositionBefore(const InlineItem&, ItemPosition, unsigned) >+Optional<ItemPosition> TextUtil::hyphenPositionBefore(const InlineItem&, ItemPosition, unsigned) > { >- return std::nullopt; >+ return WTF::nullopt; > } > > LayoutUnit TextUtil::width(const InlineItem& inlineTextItem, ItemPosition from, ItemPosition to, LayoutUnit contentLogicalLeft) >diff --git a/Source/WebCore/layout/inlineformatting/text/TextUtil.h b/Source/WebCore/layout/inlineformatting/text/TextUtil.h >index 888d5e3b22b03f9a4b78733c8b21947656eeb815..836a9ec40d3a72eb92674a53b372e50d2f3dacb7 100644 >--- a/Source/WebCore/layout/inlineformatting/text/TextUtil.h >+++ b/Source/WebCore/layout/inlineformatting/text/TextUtil.h >@@ -36,7 +36,7 @@ namespace Layout { > class TextUtil { > public: > static LayoutUnit width(const InlineItem&, ItemPosition from, ItemPosition to, LayoutUnit contentLogicalLeft); >- static std::optional<ItemPosition> hyphenPositionBefore(const InlineItem&, ItemPosition from, unsigned length); >+ static Optional<ItemPosition> hyphenPositionBefore(const InlineItem&, ItemPosition from, unsigned length); > > private: > static LayoutUnit fixedPitchWidth(String, const RenderStyle&, ItemPosition from, ItemPosition to, LayoutUnit contentLogicalLeft); >diff --git a/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp b/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp >index 881aa2a3562fd93435e07774e58668a4bcea29fb..4cb28472e2ad05dcc691b427acf61d63798865b1 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutBlockContainer.cpp >@@ -36,7 +36,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(BlockContainer); > >-BlockContainer::BlockContainer(std::optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) >+BlockContainer::BlockContainer(Optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) > : Container(attributes, WTFMove(style), baseTypeFlags | BlockContainerFlag) > { > } >diff --git a/Source/WebCore/layout/layouttree/LayoutBlockContainer.h b/Source/WebCore/layout/layouttree/LayoutBlockContainer.h >index 2f74b3faec24faf5dff214289cbe1f8f50fb7d72..612a951a602b14b4371447f49cce3806481c0a19 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBlockContainer.h >+++ b/Source/WebCore/layout/layouttree/LayoutBlockContainer.h >@@ -39,7 +39,7 @@ namespace Layout { > class BlockContainer : public Container { > WTF_MAKE_ISO_ALLOCATED(BlockContainer); > public: >- BlockContainer(std::optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = BlockContainerFlag); >+ BlockContainer(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = BlockContainerFlag); > > bool establishesInlineFormattingContext() const final; > >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.cpp b/Source/WebCore/layout/layouttree/LayoutBox.cpp >index bf5b38a1f5ccc52a93d8b13290fc89fac41c2314..b82888928a06ceaaf8f1dd2f1ca247f6feddb05c 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutBox.cpp >@@ -37,7 +37,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(Box); > >-Box::Box(std::optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) >+Box::Box(Optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) > : m_style(WTFMove(style)) > , m_elementAttributes(attributes) > , m_baseTypeFlags(baseTypeFlags) >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.h b/Source/WebCore/layout/layouttree/LayoutBox.h >index 2e73cec4fdbca625a6d1a4292de082314fb246cf..52f7406ccf10b70d1f9ea302e3de72c2fa391cbb 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.h >+++ b/Source/WebCore/layout/layouttree/LayoutBox.h >@@ -69,7 +69,7 @@ public: > }; > typedef unsigned BaseTypeFlags; > >- Box(std::optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags); >+ Box(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags); > virtual ~Box(); > > bool establishesFormattingContext() const; >@@ -137,7 +137,7 @@ public: > > private: > RenderStyle m_style; >- std::optional<ElementAttributes> m_elementAttributes; >+ Optional<ElementAttributes> m_elementAttributes; > > Container* m_parent { nullptr }; > Box* m_previousSibling { nullptr }; >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.cpp b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >index 252fc8e39e5d433b7d595da08f6370532ef5f0ba..250dd5f50b43171492ee66d37c6018b065e74d72 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >@@ -36,7 +36,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(Container); > >-Container::Container(std::optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) >+Container::Container(Optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) > : Box(attributes, WTFMove(style), baseTypeFlags | ContainerFlag) > { > } >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.h b/Source/WebCore/layout/layouttree/LayoutContainer.h >index 480c7c582f2a2508250515db3456864e09129b8a..a641c886f989b625e895545366d9895577c07190 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.h >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.h >@@ -40,7 +40,7 @@ namespace Layout { > class Container : public Box { > WTF_MAKE_ISO_ALLOCATED(Container); > public: >- Container(std::optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags); >+ Container(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags); > > const Box* firstChild() const { return m_firstChild; } > const Box* firstInFlowChild() const; >diff --git a/Source/WebCore/layout/layouttree/LayoutInlineBox.cpp b/Source/WebCore/layout/layouttree/LayoutInlineBox.cpp >index fb134f72e76b817cd14e9bfc115ffcc1c21bd588..3c9de8b9909876475e6b8545f774cb0fc1b0f91c 100644 >--- a/Source/WebCore/layout/layouttree/LayoutInlineBox.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutInlineBox.cpp >@@ -36,7 +36,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(InlineBox); > >-InlineBox::InlineBox(std::optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) >+InlineBox::InlineBox(Optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) > : Box(attributes, WTFMove(style), baseTypeFlags | InlineBoxFlag) > { > } >diff --git a/Source/WebCore/layout/layouttree/LayoutInlineBox.h b/Source/WebCore/layout/layouttree/LayoutInlineBox.h >index 88f5cd34b42060af35bef34ad0653cee967604ea..d9b009ce8e394320c0708534996deb3dd30dc2b5 100644 >--- a/Source/WebCore/layout/layouttree/LayoutInlineBox.h >+++ b/Source/WebCore/layout/layouttree/LayoutInlineBox.h >@@ -39,7 +39,7 @@ namespace Layout { > class InlineBox : public Box { > WTF_MAKE_ISO_ALLOCATED(InlineBox); > public: >- InlineBox(std::optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = InlineBoxFlag); >+ InlineBox(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = InlineBoxFlag); > > void setTextContent(String text) { m_textContent = text; } > bool hasTextContent() const { return !m_textContent.isNull(); } >diff --git a/Source/WebCore/layout/layouttree/LayoutInlineContainer.cpp b/Source/WebCore/layout/layouttree/LayoutInlineContainer.cpp >index 5ed09f3611f80f977fc63f85a25fa104531497de..bc985bba0931c6723d9daef34a243d42fe07074c 100644 >--- a/Source/WebCore/layout/layouttree/LayoutInlineContainer.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutInlineContainer.cpp >@@ -36,7 +36,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(InlineContainer); > >-InlineContainer::InlineContainer(std::optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) >+InlineContainer::InlineContainer(Optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags) > : Container(attributes, WTFMove(style), baseTypeFlags | InlineContainerFlag) > { > } >diff --git a/Source/WebCore/layout/layouttree/LayoutInlineContainer.h b/Source/WebCore/layout/layouttree/LayoutInlineContainer.h >index 12333ac66910ecdd90f3d17eda88c54a2aa8ba6a..5bde45d7bf79c81d70d25c1a89d4c321c6f05193 100644 >--- a/Source/WebCore/layout/layouttree/LayoutInlineContainer.h >+++ b/Source/WebCore/layout/layouttree/LayoutInlineContainer.h >@@ -39,7 +39,7 @@ namespace Layout { > class InlineContainer : public Container { > WTF_MAKE_ISO_ALLOCATED(InlineContainer); > public: >- InlineContainer(std::optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = InlineContainerFlag); >+ InlineContainer(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = InlineContainerFlag); > > bool establishesInlineFormattingContext() const final; > }; >diff --git a/Source/WebCore/layout/layouttree/LayoutLineBreakBox.cpp b/Source/WebCore/layout/layouttree/LayoutLineBreakBox.cpp >index 6a1d2154ed355a180a79573dd81f57a395dec86e..fbe20a9d5a9a24126461f95c86a1fdfad6d65185 100644 >--- a/Source/WebCore/layout/layouttree/LayoutLineBreakBox.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutLineBreakBox.cpp >@@ -36,7 +36,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(LineBreakBox); > >-LineBreakBox::LineBreakBox(std::optional<ElementAttributes> attributes, RenderStyle&& style) >+LineBreakBox::LineBreakBox(Optional<ElementAttributes> attributes, RenderStyle&& style) > : InlineBox(attributes, WTFMove(style), LineBreakBoxFlag) > { > } >diff --git a/Source/WebCore/layout/layouttree/LayoutLineBreakBox.h b/Source/WebCore/layout/layouttree/LayoutLineBreakBox.h >index 0be528aeab5d7feb7bd8c5a29da3609091ab6aac..aad090ae97dadaa63109c1071b8811c983076175 100644 >--- a/Source/WebCore/layout/layouttree/LayoutLineBreakBox.h >+++ b/Source/WebCore/layout/layouttree/LayoutLineBreakBox.h >@@ -39,7 +39,7 @@ namespace Layout { > class LineBreakBox : public InlineBox { > WTF_MAKE_ISO_ALLOCATED(LineBreakBox); > public: >- LineBreakBox(std::optional<ElementAttributes>, RenderStyle&&); >+ LineBreakBox(Optional<ElementAttributes>, RenderStyle&&); > }; > > } >diff --git a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >index d40307575eb40aab0ef600c8567ed5fa00ed24d2..800629b5143ae97e771c2e9d27831a46b3dde4b7 100644 >--- a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >@@ -50,14 +50,14 @@ namespace Layout { > > std::unique_ptr<Container> TreeBuilder::createLayoutTree(const RenderView& renderView) > { >- std::unique_ptr<Container> initialContainingBlock(new BlockContainer(std::nullopt, RenderStyle::clone(renderView.style()))); >+ std::unique_ptr<Container> initialContainingBlock(new BlockContainer(WTF::nullopt, RenderStyle::clone(renderView.style()))); > TreeBuilder::createSubTree(renderView, *initialContainingBlock); > return initialContainingBlock; > } > > void TreeBuilder::createSubTree(const RenderElement& rootRenderer, Container& rootContainer) > { >- auto elementAttributes = [] (const RenderElement& renderer) -> std::optional<Box::ElementAttributes> { >+ auto elementAttributes = [] (const RenderElement& renderer) -> Optional<Box::ElementAttributes> { > if (renderer.isDocumentElementRenderer()) > return Box::ElementAttributes { Box::ElementType::Document }; > if (auto* element = renderer.element()) { >@@ -81,14 +81,14 @@ void TreeBuilder::createSubTree(const RenderElement& rootRenderer, Container& ro > return Box::ElementAttributes { Box::ElementType::Replaced }; > return Box::ElementAttributes { Box::ElementType::GenericElement }; > } >- return std::nullopt; >+ return WTF::nullopt; > }; > > for (auto& child : childrenOfType<RenderObject>(rootRenderer)) { > std::unique_ptr<Box> box; > > if (is<RenderText>(child)) { >- box = std::make_unique<InlineBox>(std::optional<Box::ElementAttributes>(), RenderStyle::createAnonymousStyleWithDisplay(rootRenderer.style(), DisplayType::Inline)); >+ box = std::make_unique<InlineBox>(Optional<Box::ElementAttributes>(), RenderStyle::createAnonymousStyleWithDisplay(rootRenderer.style(), DisplayType::Inline)); > downcast<InlineBox>(*box).setTextContent(downcast<RenderText>(child).originalText()); > } else if (is<RenderReplaced>(child)) { > auto& renderer = downcast<RenderReplaced>(child); >diff --git a/Source/WebCore/loader/ApplicationManifestLoader.cpp b/Source/WebCore/loader/ApplicationManifestLoader.cpp >index fbb3f8646eb56d922b46ccff7712f9d54699f50b..bbbf7bad790c5ff2d683ade956cc895b52fc0705 100644 >--- a/Source/WebCore/loader/ApplicationManifestLoader.cpp >+++ b/Source/WebCore/loader/ApplicationManifestLoader.cpp >@@ -102,7 +102,7 @@ void ApplicationManifestLoader::stopLoading() > } > } > >-std::optional<ApplicationManifest>& ApplicationManifestLoader::processManifest() >+Optional<ApplicationManifest>& ApplicationManifestLoader::processManifest() > { > if (!m_processedManifest && m_resource) { > auto manifestURL = m_url; >diff --git a/Source/WebCore/loader/ApplicationManifestLoader.h b/Source/WebCore/loader/ApplicationManifestLoader.h >index 1b0f760d2ecebd5c28ef5c2ec42eda12f03f3beb..1264ecd17df80514fc4db0991af274575da1ad7d 100644 >--- a/Source/WebCore/loader/ApplicationManifestLoader.h >+++ b/Source/WebCore/loader/ApplicationManifestLoader.h >@@ -49,13 +49,13 @@ public: > bool startLoading(); > void stopLoading(); > >- std::optional<ApplicationManifest>& processManifest(); >+ Optional<ApplicationManifest>& processManifest(); > > private: > void notifyFinished(CachedResource&); > > DocumentLoader& m_documentLoader; >- std::optional<ApplicationManifest> m_processedManifest; >+ Optional<ApplicationManifest> m_processedManifest; > URL m_url; > bool m_useCredentials; > CachedResourceHandle<CachedApplicationManifest> m_resource; >diff --git a/Source/WebCore/loader/CookieJar.cpp b/Source/WebCore/loader/CookieJar.cpp >index 068306744af814bd2760a5e1865a5a9ab4352b13..397f0db4b27d983ba396352e9437b32f64dc2233 100644 >--- a/Source/WebCore/loader/CookieJar.cpp >+++ b/Source/WebCore/loader/CookieJar.cpp >@@ -80,7 +80,7 @@ String cookies(Document& document, const URL& url) > if (frame) > result = platformStrategies()->cookiesStrategy()->cookiesForDOM(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, frame->loader().client().frameID(), frame->loader().client().pageID(), includeSecureCookies); > else >- result = platformStrategies()->cookiesStrategy()->cookiesForDOM(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, std::nullopt, std::nullopt, includeSecureCookies); >+ result = platformStrategies()->cookiesStrategy()->cookiesForDOM(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, WTF::nullopt, WTF::nullopt, includeSecureCookies); > > if (result.second) > document.setSecureCookiesAccessed(); >@@ -111,7 +111,7 @@ void setCookies(Document& document, const URL& url, const String& cookieString) > if (frame) > platformStrategies()->cookiesStrategy()->setCookiesFromDOM(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, frame->loader().client().frameID(), frame->loader().client().pageID(), cookieString); > else >- platformStrategies()->cookiesStrategy()->setCookiesFromDOM(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, std::nullopt, std::nullopt, cookieString); >+ platformStrategies()->cookiesStrategy()->setCookiesFromDOM(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, WTF::nullopt, WTF::nullopt, cookieString); > } > > bool cookiesEnabled(const Document& document) >@@ -128,7 +128,7 @@ String cookieRequestHeaderFieldValue(Document& document, const URL& url) > if (frame) > result = platformStrategies()->cookiesStrategy()->cookieRequestHeaderFieldValue(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, frame->loader().client().frameID(), frame->loader().client().pageID(), includeSecureCookies); > else >- result = platformStrategies()->cookiesStrategy()->cookieRequestHeaderFieldValue(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, std::nullopt, std::nullopt, includeSecureCookies); >+ result = platformStrategies()->cookiesStrategy()->cookieRequestHeaderFieldValue(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, WTF::nullopt, WTF::nullopt, includeSecureCookies); > > if (result.second) > document.setSecureCookiesAccessed(); >@@ -142,7 +142,7 @@ bool getRawCookies(const Document& document, const URL& url, Vector<Cookie>& coo > if (frame) > return platformStrategies()->cookiesStrategy()->getRawCookies(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, frame->loader().client().frameID(), frame->loader().client().pageID(), cookies); > >- return platformStrategies()->cookiesStrategy()->getRawCookies(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, std::nullopt, std::nullopt, cookies); >+ return platformStrategies()->cookiesStrategy()->getRawCookies(storageSession(document), document.firstPartyForCookies(), sameSiteInfo(document), url, WTF::nullopt, WTF::nullopt, cookies); > } > > void deleteCookie(const Document& document, const URL& url, const String& cookieName) >diff --git a/Source/WebCore/loader/CrossOriginAccessControl.cpp b/Source/WebCore/loader/CrossOriginAccessControl.cpp >index effbb5731f54300a7908c04f52d5ae6d1d833620..48c741a71d6d5531c37b0ac09d21fd6725347b26 100644 >--- a/Source/WebCore/loader/CrossOriginAccessControl.cpp >+++ b/Source/WebCore/loader/CrossOriginAccessControl.cpp >@@ -240,11 +240,11 @@ static inline bool shouldCrossOriginResourcePolicyCancelLoad(const SecurityOrigi > return false; > } > >-std::optional<ResourceError> validateCrossOriginResourcePolicy(const SecurityOrigin& origin, const URL& requestURL, const ResourceResponse& response) >+Optional<ResourceError> validateCrossOriginResourcePolicy(const SecurityOrigin& origin, const URL& requestURL, const ResourceResponse& response) > { > if (shouldCrossOriginResourcePolicyCancelLoad(origin, response)) > return ResourceError { errorDomainWebKitInternal, 0, requestURL, makeString("Cancelled load to ", response.url().stringCenterEllipsizedToLength(), " because it violates the resource's Cross-Origin-Resource-Policy response header."), ResourceError::Type::AccessControl }; >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WebCore >diff --git a/Source/WebCore/loader/CrossOriginAccessControl.h b/Source/WebCore/loader/CrossOriginAccessControl.h >index 2af3d4a1c52091293de1c483a2fc173ac66ea276..bfd5cafc5eb93b288020ad33f719cdb8814701b7 100644 >--- a/Source/WebCore/loader/CrossOriginAccessControl.h >+++ b/Source/WebCore/loader/CrossOriginAccessControl.h >@@ -62,6 +62,6 @@ WEBCORE_EXPORT void cleanHTTPRequestHeadersForAccessControl(ResourceRequest&, co > WEBCORE_EXPORT bool passesAccessControlCheck(const ResourceResponse&, StoredCredentialsPolicy, SecurityOrigin&, String& errorDescription); > WEBCORE_EXPORT bool validatePreflightResponse(const ResourceRequest&, const ResourceResponse&, StoredCredentialsPolicy, SecurityOrigin&, String& errorDescription); > >-WEBCORE_EXPORT std::optional<ResourceError> validateCrossOriginResourcePolicy(const SecurityOrigin&, const URL&, const ResourceResponse&); >+WEBCORE_EXPORT Optional<ResourceError> validateCrossOriginResourcePolicy(const SecurityOrigin&, const URL&, const ResourceResponse&); > > } // namespace WebCore >diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp >index 2f508ebc63b71718b81e3627ff28cc46712cfbdb..22d024354b0179cf338c001e7e36a92943590e92 100644 >--- a/Source/WebCore/loader/DocumentLoader.cpp >+++ b/Source/WebCore/loader/DocumentLoader.cpp >@@ -294,7 +294,7 @@ void DocumentLoader::stopLoading() > > #if ENABLE(APPLICATION_MANIFEST) > for (auto callbackIdentifier : m_applicationManifestLoaders.values()) >- notifyFinishedLoadingApplicationManifest(callbackIdentifier, std::nullopt); >+ notifyFinishedLoadingApplicationManifest(callbackIdentifier, WTF::nullopt); > m_applicationManifestLoaders.clear(); > #endif > >@@ -484,7 +484,7 @@ void DocumentLoader::matchRegistration(const URL& url, SWClientConnection::Regis > { > auto shouldTryLoadingThroughServiceWorker = !frameLoader()->isReloadingFromOrigin() && m_frame->page() && RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled() && SchemeRegistry::canServiceWorkersHandleURLScheme(url.protocol().toStringWithoutCopying()); > if (!shouldTryLoadingThroughServiceWorker) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -492,7 +492,7 @@ void DocumentLoader::matchRegistration(const URL& url, SWClientConnection::Regis > auto sessionID = m_frame->page()->sessionID(); > auto& provider = ServiceWorkerProvider::singleton(); > if (!provider.mayHaveServiceWorkerRegisteredForOrigin(sessionID, origin)) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -500,7 +500,7 @@ void DocumentLoader::matchRegistration(const URL& url, SWClientConnection::Regis > connection.matchRegistration(WTFMove(origin), url, WTFMove(callback)); > } > >-static inline bool areRegistrationsEqual(const std::optional<ServiceWorkerRegistrationData>& a, const std::optional<ServiceWorkerRegistrationData>& b) >+static inline bool areRegistrationsEqual(const Optional<ServiceWorkerRegistrationData>& a, const Optional<ServiceWorkerRegistrationData>& b) > { > if (!a) > return !b; >@@ -702,7 +702,7 @@ bool DocumentLoader::tryLoadingRedirectRequestFromApplicationCache(const Resourc > } > > #if ENABLE(SERVICE_WORKER) >-void DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange(ResourceRequest&& request, std::optional<ServiceWorkerRegistrationData>&& registrationData) >+void DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange(ResourceRequest&& request, Optional<ServiceWorkerRegistrationData>&& registrationData) > { > clearMainResource(); > >@@ -1263,7 +1263,7 @@ void DocumentLoader::finishedLoadingApplicationManifest(ApplicationManifestLoade > m_applicationManifestLoaders.remove(&loader); > } > >-void DocumentLoader::notifyFinishedLoadingApplicationManifest(uint64_t callbackIdentifier, std::optional<ApplicationManifest> manifest) >+void DocumentLoader::notifyFinishedLoadingApplicationManifest(uint64_t callbackIdentifier, Optional<ApplicationManifest> manifest) > { > RELEASE_ASSERT(callbackIdentifier); > RELEASE_ASSERT(m_frame); >@@ -1780,7 +1780,7 @@ void DocumentLoader::unregisterTemporaryServiceWorkerClient() > return; > > m_temporaryServiceWorkerClient->serviceWorkerConnection->unregisterServiceWorkerClient(m_temporaryServiceWorkerClient->documentIdentifier); >- m_temporaryServiceWorkerClient = std::nullopt; >+ m_temporaryServiceWorkerClient = WTF::nullopt; > #endif > } > >@@ -1964,7 +1964,7 @@ void DocumentLoader::startIconLoading() > > auto findResult = m_linkIcons.findMatching([](auto& icon) { return icon.type == LinkIconType::Favicon; }); > if (findResult == notFound) >- m_linkIcons.append({ document->completeURL("/favicon.ico"_s), LinkIconType::Favicon, String(), std::nullopt, { } }); >+ m_linkIcons.append({ document->completeURL("/favicon.ico"_s), LinkIconType::Favicon, String(), WTF::nullopt, { } }); > > if (!m_linkIcons.size()) > return; >diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h >index feac90020b78a74ebdd77248041d91ab085bcc25..ee293646aa0a7fa62f9d3d0e0e4a864b1d323d59 100644 >--- a/Source/WebCore/loader/DocumentLoader.h >+++ b/Source/WebCore/loader/DocumentLoader.h >@@ -345,7 +345,7 @@ private: > Document* document() const; > > #if ENABLE(SERVICE_WORKER) >- void matchRegistration(const URL&, CompletionHandler<void(std::optional<ServiceWorkerRegistrationData>&&)>&&); >+ void matchRegistration(const URL&, CompletionHandler<void(Optional<ServiceWorkerRegistrationData>&&)>&&); > #endif > void registerTemporaryServiceWorkerClient(const URL&); > void unregisterTemporaryServiceWorkerClient(); >@@ -387,7 +387,7 @@ private: > bool tryLoadingSubstituteData(); > bool tryLoadingRedirectRequestFromApplicationCache(const ResourceRequest&); > #if ENABLE(SERVICE_WORKER) >- void restartLoadingDueToServiceWorkerRegistrationChange(ResourceRequest&&, std::optional<ServiceWorkerRegistrationData>&&); >+ void restartLoadingDueToServiceWorkerRegistrationChange(ResourceRequest&&, Optional<ServiceWorkerRegistrationData>&&); > #endif > void continueAfterContentPolicy(PolicyAction); > >@@ -413,7 +413,7 @@ private: > void notifyFinishedLoadingIcon(uint64_t callbackIdentifier, SharedBuffer*); > > #if ENABLE(APPLICATION_MANIFEST) >- void notifyFinishedLoadingApplicationManifest(uint64_t callbackIdentifier, std::optional<ApplicationManifest>); >+ void notifyFinishedLoadingApplicationManifest(uint64_t callbackIdentifier, Optional<ApplicationManifest>); > #endif > > // ContentSecurityPolicyClient >@@ -542,12 +542,12 @@ private: > PopUpPolicy m_popUpPolicy { PopUpPolicy::Default }; > > #if ENABLE(SERVICE_WORKER) >- std::optional<ServiceWorkerRegistrationData> m_serviceWorkerRegistrationData; >+ Optional<ServiceWorkerRegistrationData> m_serviceWorkerRegistrationData; > struct TemporaryServiceWorkerClient { > DocumentIdentifier documentIdentifier; > Ref<SWClientConnection> serviceWorkerConnection; > }; >- std::optional<TemporaryServiceWorkerClient> m_temporaryServiceWorkerClient; >+ Optional<TemporaryServiceWorkerClient> m_temporaryServiceWorkerClient; > #endif > > #ifndef NDEBUG >diff --git a/Source/WebCore/loader/DocumentThreadableLoader.cpp b/Source/WebCore/loader/DocumentThreadableLoader.cpp >index 9b1e5b35ab24eef8d45d50990cd05b51730db8e1..614b4e45a650a4411901875d41aa705b0fd76f3a 100644 >--- a/Source/WebCore/loader/DocumentThreadableLoader.cpp >+++ b/Source/WebCore/loader/DocumentThreadableLoader.cpp >@@ -275,7 +275,7 @@ void DocumentThreadableLoader::clearResource() > resource->removeClient(*this); > } > if (m_preflightChecker) >- m_preflightChecker = std::nullopt; >+ m_preflightChecker = WTF::nullopt; > } > > void DocumentThreadableLoader::redirectReceived(CachedResource& resource, ResourceRequest&& request, const ResourceResponse& redirectResponse, CompletionHandler<void(ResourceRequest&&)>&& completionHandler) >@@ -474,7 +474,7 @@ void DocumentThreadableLoader::didFail(unsigned long, const ResourceError& error > m_options.serviceWorkersMode = ServiceWorkersMode::None; > makeCrossOriginAccessRequestWithPreflight(WTFMove(m_bypassingPreflightForServiceWorkerRequest.value())); > ASSERT(m_bypassingPreflightForServiceWorkerRequest->isNull()); >- m_bypassingPreflightForServiceWorkerRequest = std::nullopt; >+ m_bypassingPreflightForServiceWorkerRequest = WTF::nullopt; > return; > } > #endif >@@ -490,7 +490,7 @@ void DocumentThreadableLoader::preflightSuccess(ResourceRequest&& request) > ResourceRequest actualRequest(WTFMove(request)); > updateRequestForAccessControl(actualRequest, securityOrigin(), m_options.storedCredentialsPolicy); > >- m_preflightChecker = std::nullopt; >+ m_preflightChecker = WTF::nullopt; > > // It should be ok to skip the security check since we already asked about the preflight request. > loadRequest(WTFMove(actualRequest), SecurityCheckPolicy::SkipSecurityCheck); >@@ -498,7 +498,7 @@ void DocumentThreadableLoader::preflightSuccess(ResourceRequest&& request) > > void DocumentThreadableLoader::preflightFailure(unsigned long identifier, const ResourceError& error) > { >- m_preflightChecker = std::nullopt; >+ m_preflightChecker = WTF::nullopt; > > InspectorInstrumentation::didFailLoading(m_document.frame(), m_document.frame()->loader().documentLoader(), identifier, error); > >diff --git a/Source/WebCore/loader/DocumentThreadableLoader.h b/Source/WebCore/loader/DocumentThreadableLoader.h >index 38382edf4cdd31ea21f546bd7da6481acb17eb19..ca25ec5bd71dc9a89e1855fb6f0a6fbb33d9e293 100644 >--- a/Source/WebCore/loader/DocumentThreadableLoader.h >+++ b/Source/WebCore/loader/DocumentThreadableLoader.h >@@ -132,12 +132,12 @@ namespace WebCore { > bool m_async; > bool m_delayCallbacksForIntegrityCheck; > std::unique_ptr<ContentSecurityPolicy> m_contentSecurityPolicy; >- std::optional<CrossOriginPreflightChecker> m_preflightChecker; >- std::optional<HTTPHeaderMap> m_originalHeaders; >+ Optional<CrossOriginPreflightChecker> m_preflightChecker; >+ Optional<HTTPHeaderMap> m_originalHeaders; > > ShouldLogError m_shouldLogError; > #if ENABLE(SERVICE_WORKER) >- std::optional<ResourceRequest> m_bypassingPreflightForServiceWorkerRequest; >+ Optional<ResourceRequest> m_bypassingPreflightForServiceWorkerRequest; > #endif > }; > >diff --git a/Source/WebCore/loader/EmptyClients.cpp b/Source/WebCore/loader/EmptyClients.cpp >index 9f65aebc9df6a65bd2ff487dfa367b7c3edfb962..17aad4db2f2a2e3b0535db6fda6103ca91d94c74 100644 >--- a/Source/WebCore/loader/EmptyClients.cpp >+++ b/Source/WebCore/loader/EmptyClients.cpp >@@ -311,16 +311,16 @@ class EmptyInspectorClient final : public InspectorClient { > > class EmptyPaymentCoordinatorClient final : public PaymentCoordinatorClient { > bool supportsVersion(unsigned) final { return false; } >- std::optional<String> validatedPaymentNetwork(const String&) final { return std::nullopt; } >+ Optional<String> validatedPaymentNetwork(const String&) final { return WTF::nullopt; } > bool canMakePayments() final { return false; } > void canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void(bool)>&& completionHandler) final { callOnMainThread([completionHandler = WTFMove(completionHandler)] { completionHandler(false); }); } > void openPaymentSetup(const String&, const String&, WTF::Function<void(bool)>&& completionHandler) final { callOnMainThread([completionHandler = WTFMove(completionHandler)] { completionHandler(false); }); } > bool showPaymentUI(const URL&, const Vector<URL>&, const ApplePaySessionPaymentRequest&) final { return false; } > void completeMerchantValidation(const PaymentMerchantSession&) final { } >- void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&) final { } >- void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&) final { } >- void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&) final { } >- void completePaymentSession(std::optional<PaymentAuthorizationResult>&&) final { } >+ void completeShippingMethodSelection(Optional<ShippingMethodUpdate>&&) final { } >+ void completeShippingContactSelection(Optional<ShippingContactUpdate>&&) final { } >+ void completePaymentMethodSelection(Optional<PaymentMethodUpdate>&&) final { } >+ void completePaymentSession(Optional<PaymentAuthorizationResult>&&) final { } > void cancelPaymentSession() final { } > void abortPaymentSession() final { } > void paymentCoordinatorDestroyed() final { } >@@ -330,7 +330,7 @@ class EmptyPaymentCoordinatorClient final : public PaymentCoordinatorClient { > > class EmptyPluginInfoProvider final : public PluginInfoProvider { > void refreshPlugins() final { }; >- Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginIdentifier>>&) final { return { }; } >+ Vector<PluginInfo> pluginInfo(Page&, Optional<Vector<SupportedPluginIdentifier>>&) final { return { }; } > Vector<PluginInfo> webVisiblePluginInfo(Page&, const URL&) final { return { }; } > }; > >diff --git a/Source/WebCore/loader/EmptyFrameLoaderClient.h b/Source/WebCore/loader/EmptyFrameLoaderClient.h >index 4ff8df13ed5516ea8f254e0dbb787b45869291e6..a43e20ba09c1b9af65e7e203bf483e69ef2fda42 100644 >--- a/Source/WebCore/loader/EmptyFrameLoaderClient.h >+++ b/Source/WebCore/loader/EmptyFrameLoaderClient.h >@@ -32,8 +32,8 @@ class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient { > > void frameLoaderDestroyed() override { } > >- std::optional<uint64_t> frameID() const override { return std::nullopt; } >- std::optional<uint64_t> pageID() const override { return std::nullopt; } >+ Optional<uint64_t> frameID() const override { return WTF::nullopt; } >+ Optional<uint64_t> pageID() const override { return WTF::nullopt; } > PAL::SessionID sessionID() const override; > > bool hasWebView() const final { return true; } // mainly for assertions >@@ -83,7 +83,7 @@ class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient { > void dispatchWillClose() final { } > void dispatchDidStartProvisionalLoad(CompletionHandler<void()>&& completionHandler) final { completionHandler(); } > void dispatchDidReceiveTitle(const StringWithDirection&) final { } >- void dispatchDidCommitLoad(std::optional<HasInsecureContent>) final { } >+ void dispatchDidCommitLoad(Optional<HasInsecureContent>) final { } > void dispatchDidFailProvisionalLoad(const ResourceError&) final { } > void dispatchDidFailLoad(const ResourceError&) final { } > void dispatchDidFinishDocumentLoad() final { } >diff --git a/Source/WebCore/loader/FetchOptions.h b/Source/WebCore/loader/FetchOptions.h >index bff16acc83aafa191f7df98676f87fcb73dfa051..d096078c392e449e43df0ecbceda6ee850b45f6e 100644 >--- a/Source/WebCore/loader/FetchOptions.h >+++ b/Source/WebCore/loader/FetchOptions.h >@@ -48,7 +48,7 @@ struct FetchOptions { > template<class Encoder> void encodePersistent(Encoder&) const; > template<class Decoder> static bool decodePersistent(Decoder&, FetchOptions&); > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<FetchOptions> decode(Decoder&); >+ template<class Decoder> static Optional<FetchOptions> decode(Decoder&); > > Destination destination { Destination::EmptyString }; > Mode mode { Mode::NoCors }; >@@ -58,7 +58,7 @@ struct FetchOptions { > ReferrerPolicy referrerPolicy { ReferrerPolicy::EmptyString }; > bool keepAlive { false }; > String integrity; >- std::optional<DocumentIdentifier> clientIdentifier; >+ Optional<DocumentIdentifier> clientIdentifier; > }; > > inline FetchOptions::FetchOptions(Destination destination, Mode mode, Credentials credentials, Cache cache, Redirect redirect, ReferrerPolicy referrerPolicy, String&& integrity, bool keepAlive) >@@ -231,16 +231,16 @@ template<class Encoder> inline void FetchOptions::encode(Encoder& encoder) const > encoder << clientIdentifier; > } > >-template<class Decoder> inline std::optional<FetchOptions> FetchOptions::decode(Decoder& decoder) >+template<class Decoder> inline Optional<FetchOptions> FetchOptions::decode(Decoder& decoder) > { > FetchOptions options; > if (!decodePersistent(decoder, options)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<DocumentIdentifier>> clientIdentifier; >+ Optional<Optional<DocumentIdentifier>> clientIdentifier; > decoder >> clientIdentifier; > if (!clientIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > options.clientIdentifier = WTFMove(clientIdentifier.value()); > > return WTFMove(options); >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 55354791147e588a094eb6cbac1b427a17efddae..4baa346b24ee5165b96e8767d4d3a3d19f93f1ee 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -379,7 +379,7 @@ void FrameLoader::changeLocation(FrameLoadRequest&& request) > urlSelected(WTFMove(request), nullptr); > } > >-void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute, const SystemPreviewInfo& systemPreviewInfo) >+void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute, const SystemPreviewInfo& systemPreviewInfo) > { > auto* frame = lexicalFrameFromCommonVM(); > auto initiatedByMainFrame = frame && frame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown; >@@ -679,7 +679,7 @@ void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool > > void FrameLoader::receivedFirstData() > { >- dispatchDidCommitLoad(std::nullopt); >+ dispatchDidCommitLoad(WTF::nullopt); > dispatchDidClearWindowObjectsInAllWorlds(); > dispatchGlobalObjectAvailableInAllWorlds(); > >@@ -2003,7 +2003,7 @@ void FrameLoader::commitProvisionalLoad() > requestFromDelegate(mainResourceRequest, mainResourceIdentifier, mainResouceError); > notifier().dispatchDidReceiveResponse(cachedPage->documentLoader(), mainResourceIdentifier, cachedPage->documentLoader()->response()); > >- std::optional<HasInsecureContent> hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent(); >+ Optional<HasInsecureContent> hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent(); > > // FIXME: This API should be turned around so that we ground CachedPage into the Page. > cachedPage->restore(*m_frame.page()); >@@ -2277,7 +2277,7 @@ void FrameLoader::open(CachedFrameBase& cachedFrame) > ASSERT(view); > view->setWasScrolledByUser(false); > >- std::optional<IntRect> previousViewFrameRect = m_frame.view() ? m_frame.view()->frameRect() : std::optional<IntRect>(std::nullopt); >+ Optional<IntRect> previousViewFrameRect = m_frame.view() ? m_frame.view()->frameRect() : Optional<IntRect>(WTF::nullopt); > m_frame.setView(view); > > // Use the previous ScrollView's frame rect. >@@ -3840,7 +3840,7 @@ void FrameLoader::didChangeTitle(DocumentLoader* loader) > #endif > } > >-void FrameLoader::dispatchDidCommitLoad(std::optional<HasInsecureContent> initialHasInsecureContent) >+void FrameLoader::dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent) > { > if (m_stateMachine.creatingInitialEmptyDocument()) > return; >@@ -3904,8 +3904,8 @@ void FrameLoader::forcePageTransitionIfNeeded() > > void FrameLoader::clearTestingOverrides() > { >- m_overrideCachePolicyForTesting = std::nullopt; >- m_overrideResourceLoadPriorityForTesting = std::nullopt; >+ m_overrideCachePolicyForTesting = WTF::nullopt; >+ m_overrideResourceLoadPriorityForTesting = WTF::nullopt; > m_isStrictRawResourceValidationPolicyDisabledForTesting = false; > } > >diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h >index 2d8295532da1ff34ff5e1ce1316642611a0fc01e..e033249c10a72a1d66d972c28802c6e8a8139717 100644 >--- a/Source/WebCore/loader/FrameLoader.h >+++ b/Source/WebCore/loader/FrameLoader.h >@@ -124,7 +124,7 @@ public: > unsigned long loadResourceSynchronously(const ResourceRequest&, ClientCredentialPolicy, const FetchOptions&, const HTTPHeaderMap&, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>& data); > > void changeLocation(FrameLoadRequest&&); >- WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomicString& downloadAttribute = nullAtom(), const SystemPreviewInfo& = { }); >+ WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> = WTF::nullopt, const AtomicString& downloadAttribute = nullAtom(), const SystemPreviewInfo& = { }); > void submitForm(Ref<FormSubmission>&&); > > WEBCORE_EXPORT void reload(OptionSet<ReloadOption> = { }); >@@ -366,7 +366,7 @@ private: > > bool shouldReloadToHandleUnreachableURL(DocumentLoader&); > >- void dispatchDidCommitLoad(std::optional<HasInsecureContent> initialHasInsecureContent); >+ void dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent); > > void urlSelected(FrameLoadRequest&&, Event*); > >@@ -469,8 +469,8 @@ private: > > RefPtr<FrameNetworkingContext> m_networkingContext; > >- std::optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting; >- std::optional<ResourceLoadPriority> m_overrideResourceLoadPriorityForTesting; >+ Optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting; >+ Optional<ResourceLoadPriority> m_overrideResourceLoadPriorityForTesting; > bool m_isStrictRawResourceValidationPolicyDisabledForTesting { false }; > bool m_currentLoadShouldBeTreatedAsContinuingLoad { false }; > >diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h >index 688c6b2528c9d225c6bf8537c0127e67e2e77aba..6b0023fca3232a6bc7451820fa4b6de2ac07825e 100644 >--- a/Source/WebCore/loader/FrameLoaderClient.h >+++ b/Source/WebCore/loader/FrameLoaderClient.h >@@ -125,8 +125,8 @@ public: > > virtual void makeRepresentation(DocumentLoader*) = 0; > >- virtual std::optional<uint64_t> pageID() const = 0; >- virtual std::optional<uint64_t> frameID() const = 0; >+ virtual Optional<uint64_t> pageID() const = 0; >+ virtual Optional<uint64_t> frameID() const = 0; > virtual PAL::SessionID sessionID() const = 0; > > #if PLATFORM(IOS_FAMILY) >@@ -175,7 +175,7 @@ public: > virtual void dispatchDidReceiveIcon() { } > virtual void dispatchDidStartProvisionalLoad(CompletionHandler<void()>&&) = 0; > virtual void dispatchDidReceiveTitle(const StringWithDirection&) = 0; >- virtual void dispatchDidCommitLoad(std::optional<HasInsecureContent>) = 0; >+ virtual void dispatchDidCommitLoad(Optional<HasInsecureContent>) = 0; > virtual void dispatchDidFailProvisionalLoad(const ResourceError&) = 0; > virtual void dispatchDidFailLoad(const ResourceError&) = 0; > virtual void dispatchDidFinishDocumentLoad() = 0; >@@ -370,7 +370,7 @@ public: > virtual void didCreateWindow(DOMWindow&) { } > > #if ENABLE(APPLICATION_MANIFEST) >- virtual void finishedLoadingApplicationManifest(uint64_t, const std::optional<ApplicationManifest>&) { } >+ virtual void finishedLoadingApplicationManifest(uint64_t, const Optional<ApplicationManifest>&) { } > #endif > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >diff --git a/Source/WebCore/loader/HTTPHeaderField.cpp b/Source/WebCore/loader/HTTPHeaderField.cpp >index 4fe16f130b8d329d3f83f52540437f11eb6a00c5..976e074015164dfce7920e25c25385d7acc12ea5 100644 >--- a/Source/WebCore/loader/HTTPHeaderField.cpp >+++ b/Source/WebCore/loader/HTTPHeaderField.cpp >@@ -202,12 +202,12 @@ static bool isValidValue(StringView value) > > } // namespace RFC7230 > >-std::optional<HTTPHeaderField> HTTPHeaderField::create(String&& unparsedName, String&& unparsedValue) >+Optional<HTTPHeaderField> HTTPHeaderField::create(String&& unparsedName, String&& unparsedValue) > { > StringView strippedName = StringView(unparsedName).stripLeadingAndTrailingMatchedCharacters(RFC7230::isWhitespace); > StringView strippedValue = StringView(unparsedValue).stripLeadingAndTrailingMatchedCharacters(RFC7230::isWhitespace); > if (!RFC7230::isValidName(strippedName) || !RFC7230::isValidValue(strippedValue)) >- return std::nullopt; >+ return WTF::nullopt; > > String name = strippedName.length() == unparsedName.length() ? WTFMove(unparsedName) : strippedName.toString(); > String value = strippedValue.length() == unparsedValue.length() ? WTFMove(unparsedValue) : strippedValue.toString(); >diff --git a/Source/WebCore/loader/HTTPHeaderField.h b/Source/WebCore/loader/HTTPHeaderField.h >index 7ce12230fdeee053507be2ef399a146d65c063f1..e88a0d18ec16abbdb55d6cf0a24167f36deb6344 100644 >--- a/Source/WebCore/loader/HTTPHeaderField.h >+++ b/Source/WebCore/loader/HTTPHeaderField.h >@@ -31,13 +31,13 @@ namespace WebCore { > > class WEBCORE_EXPORT HTTPHeaderField { > public: >- static std::optional<HTTPHeaderField> create(String&& name, String&& value); >+ static Optional<HTTPHeaderField> create(String&& name, String&& value); > > const String& name() const { return m_name; } > const String& value() const { return m_value; } > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<HTTPHeaderField> decode(Decoder&); >+ template<class Decoder> static Optional<HTTPHeaderField> decode(Decoder&); > > private: > HTTPHeaderField(String&& name, String&& value) >@@ -56,17 +56,17 @@ void HTTPHeaderField::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<HTTPHeaderField> HTTPHeaderField::decode(Decoder& decoder) >+Optional<HTTPHeaderField> HTTPHeaderField::decode(Decoder& decoder) > { >- std::optional<String> name; >+ Optional<String> name; > decoder >> name; > if (!name) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> value; >+ Optional<String> value; > decoder >> value; > if (!value) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*name), WTFMove(*value) }}; > } >diff --git a/Source/WebCore/loader/LinkHeader.cpp b/Source/WebCore/loader/LinkHeader.cpp >index bc0ff6420d1621d924e24b6731634c79b0f7456e..0c7e766c41fb6b398ec4a88375ffe23034f0cc03 100644 >--- a/Source/WebCore/loader/LinkHeader.cpp >+++ b/Source/WebCore/loader/LinkHeader.cpp >@@ -86,12 +86,12 @@ static bool isExtensionParameter(LinkHeader::LinkParameterName name) > // ^ ^ > // position end > template <typename CharacterType> >-static std::optional<String> findURLBoundaries(CharacterType*& position, CharacterType* const end) >+static Optional<String> findURLBoundaries(CharacterType*& position, CharacterType* const end) > { > ASSERT(position <= end); > skipWhile<CharacterType, isSpaceOrTab>(position, end); > if (!skipExactly<CharacterType>(position, end, '<')) >- return std::nullopt; >+ return WTF::nullopt; > skipWhile<CharacterType, isSpaceOrTab>(position, end); > > CharacterType* urlStart = position; >@@ -99,7 +99,7 @@ static std::optional<String> findURLBoundaries(CharacterType*& position, Charact > CharacterType* urlEnd = position; > skipUntil<CharacterType>(position, end, '>'); > if (!skipExactly<CharacterType>(position, end, '>')) >- return std::nullopt; >+ return WTF::nullopt; > > return String(urlStart, urlEnd - urlStart); > } >@@ -309,7 +309,7 @@ LinkHeader::LinkHeader(CharacterType*& position, CharacterType* const end) > { > ASSERT(position <= end); > auto urlResult = findURLBoundaries(position, end); >- if (urlResult == std::nullopt) { >+ if (urlResult == WTF::nullopt) { > m_isValid = false; > findNextHeader(position, end); > return; >diff --git a/Source/WebCore/loader/LinkLoader.cpp b/Source/WebCore/loader/LinkLoader.cpp >index 62be7b92a141bedc2817d03135264a615f5656ce..9f55ae8a325b7e3ff315a4616a5415e91b716477 100644 >--- a/Source/WebCore/loader/LinkLoader.cpp >+++ b/Source/WebCore/loader/LinkLoader.cpp >@@ -112,7 +112,7 @@ void LinkLoader::loadLinksFromHeader(const String& headerValue, const URL& baseU > } > } > >-std::optional<CachedResource::Type> LinkLoader::resourceTypeFromAsAttribute(const String& as) >+Optional<CachedResource::Type> LinkLoader::resourceTypeFromAsAttribute(const String& as) > { > if (equalLettersIgnoringASCIICase(as, "fetch")) > return CachedResource::Type::RawResource; >@@ -130,7 +130,7 @@ std::optional<CachedResource::Type> LinkLoader::resourceTypeFromAsAttribute(cons > if (equalLettersIgnoringASCIICase(as, "track")) > return CachedResource::Type::TextTrackResource; > #endif >- return std::nullopt; >+ return WTF::nullopt; > } > > static std::unique_ptr<LinkPreloadResourceClient> createLinkPreloadResourceClient(CachedResource& resource, LinkLoader& loader) >@@ -269,7 +269,7 @@ void LinkLoader::prefetchIfNeeded(const LinkRelAttribute& relAttribute, const UR > return; > > ASSERT(RuntimeEnabledFeatures::sharedFeatures().linkPrefetchEnabled()); >- std::optional<ResourceLoadPriority> priority; >+ Optional<ResourceLoadPriority> priority; > CachedResource::Type type = CachedResource::Type::LinkPrefetch; > > if (m_cachedLinkResource) { >diff --git a/Source/WebCore/loader/LinkLoader.h b/Source/WebCore/loader/LinkLoader.h >index 54d722310d8dff921f1e9de0545bd9e1c620947c..78606c213992708fcdcdd6f235eeca9508ca4d80 100644 >--- a/Source/WebCore/loader/LinkLoader.h >+++ b/Source/WebCore/loader/LinkLoader.h >@@ -51,7 +51,7 @@ public: > virtual ~LinkLoader(); > > bool loadLink(const LinkRelAttribute&, const URL&, const String& as, const String& media, const String& type, const String& crossOrigin, Document&); >- static std::optional<CachedResource::Type> resourceTypeFromAsAttribute(const String& as); >+ static Optional<CachedResource::Type> resourceTypeFromAsAttribute(const String& as); > > enum class MediaAttributeCheck { MediaAttributeEmpty, MediaAttributeNotEmpty, SkipMediaAttributeCheck }; > static void loadLinksFromHeader(const String& headerValue, const URL& baseURL, Document&, MediaAttributeCheck); >diff --git a/Source/WebCore/loader/NavigationAction.cpp b/Source/WebCore/loader/NavigationAction.cpp >index e6a490b1d6daaced5682588d0c80f7d2df98006c..ba157991414528bdfdd460b6e337bedef5df61de 100644 >--- a/Source/WebCore/loader/NavigationAction.cpp >+++ b/Source/WebCore/loader/NavigationAction.cpp >@@ -77,20 +77,20 @@ static bool shouldTreatAsSameOriginNavigation(const Document& document, const UR > return url.protocolIsAbout() || url.protocolIsData() || (url.protocolIsBlob() && document.securityOrigin().canRequest(url)); > } > >-static std::optional<NavigationAction::UIEventWithKeyStateData> keyStateDataForFirstEventWithKeyState(Event* event) >+static Optional<NavigationAction::UIEventWithKeyStateData> keyStateDataForFirstEventWithKeyState(Event* event) > { > if (UIEventWithKeyState* uiEvent = findEventWithKeyState(event)) > return NavigationAction::UIEventWithKeyStateData { *uiEvent }; >- return std::nullopt; >+ return WTF::nullopt; > } > >-static std::optional<NavigationAction::MouseEventData> mouseEventDataForFirstMouseEvent(Event* event) >+static Optional<NavigationAction::MouseEventData> mouseEventDataForFirstMouseEvent(Event* event) > { > for (Event* e = event; e; e = e->underlyingEvent()) { > if (e->isMouseEvent()) > return NavigationAction::MouseEventData { static_cast<const MouseEvent&>(*e) }; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > NavigationAction::NavigationAction(Document& requester, const ResourceRequest& resourceRequest, InitiatedByMainFrame initiatedByMainFrame, NavigationType type, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, Event* event, const AtomicString& downloadAttribute) >diff --git a/Source/WebCore/loader/NavigationAction.h b/Source/WebCore/loader/NavigationAction.h >index 1e636ac74b50d90fd98ace4066246dce5dd24f11..d3fbf7f4fdef9866b7924fedad4fc05dbac55cdb 100644 >--- a/Source/WebCore/loader/NavigationAction.h >+++ b/Source/WebCore/loader/NavigationAction.h >@@ -75,7 +75,7 @@ public: > RefPtr<SecurityOrigin> m_origin; > PageIDAndFrameIDPair m_pageIDAndFrameIDPair; > }; >- const std::optional<Requester>& requester() const { return m_requester; } >+ const Optional<Requester>& requester() const { return m_requester; } > > struct UIEventWithKeyStateData { > UIEventWithKeyStateData(const UIEventWithKeyState&); >@@ -95,8 +95,8 @@ public: > unsigned short syntheticClickType; > bool buttonDown; > }; >- const std::optional<UIEventWithKeyStateData>& keyStateEventData() const { return m_keyStateEventData; } >- const std::optional<MouseEventData>& mouseEventData() const { return m_mouseEventData; } >+ const Optional<UIEventWithKeyStateData>& keyStateEventData() const { return m_keyStateEventData; } >+ const Optional<MouseEventData>& mouseEventData() const { return m_mouseEventData; } > > NavigationAction copyWithShouldOpenExternalURLsPolicy(ShouldOpenExternalURLsPolicy) const; > >@@ -125,7 +125,7 @@ public: > void setOpenedByDOMWithOpener() { m_openedByDOMWithOpener = true; } > > void setTargetBackForwardItem(HistoryItem&); >- const std::optional<BackForwardItemIdentifier>& targetBackForwardItemIdentifier() const { return m_targetBackForwardItemIdentifier; } >+ const Optional<BackForwardItemIdentifier>& targetBackForwardItemIdentifier() const { return m_targetBackForwardItemIdentifier; } > > LockHistory lockHistory() const { return m_lockHistory; } > void setLockHistory(LockHistory lockHistory) { m_lockHistory = lockHistory; } >@@ -136,19 +136,19 @@ public: > private: > // Do not add a strong reference to the originating document or a subobject that holds the > // originating document. See comment above the class for more details. >- std::optional<Requester> m_requester; >+ Optional<Requester> m_requester; > ResourceRequest m_resourceRequest; > NavigationType m_type; > ShouldOpenExternalURLsPolicy m_shouldOpenExternalURLsPolicy; > InitiatedByMainFrame m_initiatedByMainFrame; >- std::optional<UIEventWithKeyStateData> m_keyStateEventData; >- std::optional<MouseEventData> m_mouseEventData; >+ Optional<UIEventWithKeyStateData> m_keyStateEventData; >+ Optional<MouseEventData> m_mouseEventData; > RefPtr<UserGestureToken> m_userGestureToken { UserGestureIndicator::currentUserGesture() }; > AtomicString m_downloadAttribute; > bool m_treatAsSameOriginNavigation; > bool m_hasOpenedFrames { false }; > bool m_openedByDOMWithOpener { false }; >- std::optional<BackForwardItemIdentifier> m_targetBackForwardItemIdentifier; >+ Optional<BackForwardItemIdentifier> m_targetBackForwardItemIdentifier; > LockHistory m_lockHistory { LockHistory::No }; > LockBackForwardList m_lockBackForwardList { LockBackForwardList::No }; > }; >diff --git a/Source/WebCore/loader/ResourceCryptographicDigest.cpp b/Source/WebCore/loader/ResourceCryptographicDigest.cpp >index 158323afa4604c60ed573f51b928799aa326becb..af701d7b9dc35a89fa33f94ef0cbd96fbec4f56c 100644 >--- a/Source/WebCore/loader/ResourceCryptographicDigest.cpp >+++ b/Source/WebCore/loader/ResourceCryptographicDigest.cpp >@@ -55,17 +55,17 @@ static bool parseHashAlgorithmAdvancingPosition(const CharacterType*& position, > } > > template<typename CharacterType> >-static std::optional<ResourceCryptographicDigest> parseCryptographicDigestImpl(const CharacterType*& position, const CharacterType* end) >+static Optional<ResourceCryptographicDigest> parseCryptographicDigestImpl(const CharacterType*& position, const CharacterType* end) > { > if (position == end) >- return std::nullopt; >+ return WTF::nullopt; > > ResourceCryptographicDigest::Algorithm algorithm; > if (!parseHashAlgorithmAdvancingPosition(position, end, algorithm)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!skipExactly<CharacterType>(position, end, '-')) >- return std::nullopt; >+ return WTF::nullopt; > > const CharacterType* beginHashValue = position; > skipWhile<CharacterType, isBase64OrBase64URLCharacter>(position, end); >@@ -73,40 +73,40 @@ static std::optional<ResourceCryptographicDigest> parseCryptographicDigestImpl(c > skipExactly<CharacterType>(position, end, '='); > > if (position == beginHashValue) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<uint8_t> digest; > StringView hashValue(beginHashValue, position - beginHashValue); > if (!base64Decode(hashValue, digest, Base64ValidatePadding)) { > if (!base64URLDecode(hashValue, digest)) >- return std::nullopt; >+ return WTF::nullopt; > } > > return ResourceCryptographicDigest { algorithm, WTFMove(digest) }; > } > >-std::optional<ResourceCryptographicDigest> parseCryptographicDigest(const UChar*& begin, const UChar* end) >+Optional<ResourceCryptographicDigest> parseCryptographicDigest(const UChar*& begin, const UChar* end) > { > return parseCryptographicDigestImpl(begin, end); > } > >-std::optional<ResourceCryptographicDigest> parseCryptographicDigest(const LChar*& begin, const LChar* end) >+Optional<ResourceCryptographicDigest> parseCryptographicDigest(const LChar*& begin, const LChar* end) > { > return parseCryptographicDigestImpl(begin, end); > } > > template<typename CharacterType> >-static std::optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigestImpl(const CharacterType*& position, const CharacterType* end) >+static Optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigestImpl(const CharacterType*& position, const CharacterType* end) > { > if (position == end) >- return std::nullopt; >+ return WTF::nullopt; > > EncodedResourceCryptographicDigest::Algorithm algorithm; > if (!parseHashAlgorithmAdvancingPosition(position, end, algorithm)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!skipExactly<CharacterType>(position, end, '-')) >- return std::nullopt; >+ return WTF::nullopt; > > const CharacterType* beginHashValue = position; > skipWhile<CharacterType, isBase64OrBase64URLCharacter>(position, end); >@@ -114,27 +114,27 @@ static std::optional<EncodedResourceCryptographicDigest> parseEncodedCryptograph > skipExactly<CharacterType>(position, end, '='); > > if (position == beginHashValue) >- return std::nullopt; >+ return WTF::nullopt; > > return EncodedResourceCryptographicDigest { algorithm, String(beginHashValue, position - beginHashValue) }; > } > >-std::optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const UChar*& begin, const UChar* end) >+Optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const UChar*& begin, const UChar* end) > { > return parseEncodedCryptographicDigestImpl(begin, end); > } > >-std::optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const LChar*& begin, const LChar* end) >+Optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const LChar*& begin, const LChar* end) > { > return parseEncodedCryptographicDigestImpl(begin, end); > } > >-std::optional<ResourceCryptographicDigest> decodeEncodedResourceCryptographicDigest(const EncodedResourceCryptographicDigest& encodedDigest) >+Optional<ResourceCryptographicDigest> decodeEncodedResourceCryptographicDigest(const EncodedResourceCryptographicDigest& encodedDigest) > { > Vector<uint8_t> digest; > if (!base64Decode(encodedDigest.digest, digest, Base64ValidatePadding)) { > if (!base64URLDecode(encodedDigest.digest, digest)) >- return std::nullopt; >+ return WTF::nullopt; > } > > return ResourceCryptographicDigest { encodedDigest.algorithm, WTFMove(digest) }; >diff --git a/Source/WebCore/loader/ResourceCryptographicDigest.h b/Source/WebCore/loader/ResourceCryptographicDigest.h >index e4a82ae74658156c776b57fef1a8fd97d4491ba4..b7361bb87135d6b9e55c508803262987d683263d 100644 >--- a/Source/WebCore/loader/ResourceCryptographicDigest.h >+++ b/Source/WebCore/loader/ResourceCryptographicDigest.h >@@ -68,13 +68,13 @@ struct EncodedResourceCryptographicDigest { > String digest; > }; > >-std::optional<ResourceCryptographicDigest> parseCryptographicDigest(const UChar*& begin, const UChar* end); >-std::optional<ResourceCryptographicDigest> parseCryptographicDigest(const LChar*& begin, const LChar* end); >+Optional<ResourceCryptographicDigest> parseCryptographicDigest(const UChar*& begin, const UChar* end); >+Optional<ResourceCryptographicDigest> parseCryptographicDigest(const LChar*& begin, const LChar* end); > >-std::optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const UChar*& begin, const UChar* end); >-std::optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const LChar*& begin, const LChar* end); >+Optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const UChar*& begin, const UChar* end); >+Optional<EncodedResourceCryptographicDigest> parseEncodedCryptographicDigest(const LChar*& begin, const LChar* end); > >-std::optional<ResourceCryptographicDigest> decodeEncodedResourceCryptographicDigest(const EncodedResourceCryptographicDigest&); >+Optional<ResourceCryptographicDigest> decodeEncodedResourceCryptographicDigest(const EncodedResourceCryptographicDigest&); > > ResourceCryptographicDigest cryptographicDigestForBytes(ResourceCryptographicDigest::Algorithm, const void* bytes, size_t length); > >diff --git a/Source/WebCore/loader/ResourceLoaderOptions.h b/Source/WebCore/loader/ResourceLoaderOptions.h >index fa79be2072cb5bad24f01a8d62badfe03eb7de2f..9e3074da3211d0ee97b8eb2edf49169ec5df2a4a 100644 >--- a/Source/WebCore/loader/ResourceLoaderOptions.h >+++ b/Source/WebCore/loader/ResourceLoaderOptions.h >@@ -149,10 +149,10 @@ struct ResourceLoaderOptions : public FetchOptions { > } > > #if ENABLE(SERVICE_WORKER) >- std::optional<ServiceWorkerRegistrationIdentifier> serviceWorkerRegistrationIdentifier; >+ Optional<ServiceWorkerRegistrationIdentifier> serviceWorkerRegistrationIdentifier; > #endif > HashSet<HTTPHeaderName, WTF::IntHash<HTTPHeaderName>, WTF::StrongEnumHashTraits<HTTPHeaderName>> httpHeadersToKeep; >- std::optional<ContentSecurityPolicyResponseHeaders> cspResponseHeaders; >+ Optional<ContentSecurityPolicyResponseHeaders> cspResponseHeaders; > unsigned maxRedirectCount { 20 }; > > SendCallbackPolicy sendLoadCallbacks { SendCallbackPolicy::DoNotSendCallbacks }; >diff --git a/Source/WebCore/loader/SubresourceIntegrity.cpp b/Source/WebCore/loader/SubresourceIntegrity.cpp >index cb97072bef6fc3b2378bc90b83c95ef5dbea1396..b2a7bbb2a497f6246de2aea5a2885c4c34044f71 100644 >--- a/Source/WebCore/loader/SubresourceIntegrity.cpp >+++ b/Source/WebCore/loader/SubresourceIntegrity.cpp >@@ -45,14 +45,14 @@ static bool isVCHAR(CharacterType c) > template<typename CharacterType> > struct IntegrityMetadataParser { > public: >- IntegrityMetadataParser(std::optional<Vector<EncodedResourceCryptographicDigest>>& digests) >+ IntegrityMetadataParser(Optional<Vector<EncodedResourceCryptographicDigest>>& digests) > : m_digests(digests) > { > } > > bool operator()(const CharacterType*& position, const CharacterType* end) > { >- // Initialize hashes to be something other std::nullopt, to indicate >+ // Initialize hashes to be something other WTF::nullopt, to indicate > // that at least one token was seen, and thus setting the empty flag > // from section 3.3.3 Parse metadata, to false. > if (!m_digests) >@@ -78,7 +78,7 @@ public: > } > > private: >- std::optional<Vector<EncodedResourceCryptographicDigest>>& m_digests; >+ Optional<Vector<EncodedResourceCryptographicDigest>>& m_digests; > }; > > } >@@ -98,12 +98,12 @@ static inline void splitOnSpaces(const CharacterType* begin, const CharacterType > } > } > >-static std::optional<Vector<EncodedResourceCryptographicDigest>> parseIntegrityMetadata(const String& integrityMetadata) >+static Optional<Vector<EncodedResourceCryptographicDigest>> parseIntegrityMetadata(const String& integrityMetadata) > { > if (integrityMetadata.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<EncodedResourceCryptographicDigest>> result; >+ Optional<Vector<EncodedResourceCryptographicDigest>> result; > > const StringImpl& stringImpl = *integrityMetadata.impl(); > if (stringImpl.is8Bit()) >@@ -120,10 +120,10 @@ static bool isResponseEligible(const CachedResource& resource) > return resource.isCORSSameOrigin(); > } > >-static std::optional<EncodedResourceCryptographicDigest::Algorithm> prioritizedHashFunction(EncodedResourceCryptographicDigest::Algorithm a, EncodedResourceCryptographicDigest::Algorithm b) >+static Optional<EncodedResourceCryptographicDigest::Algorithm> prioritizedHashFunction(EncodedResourceCryptographicDigest::Algorithm a, EncodedResourceCryptographicDigest::Algorithm b) > { > if (a == b) >- return std::nullopt; >+ return WTF::nullopt; > return (a > b) ? a : b; > } > >diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp >index 5fdfda93b17129b6f8cf521618289ac7f469e97a..7b98e8b57e436a343e6eeaddeda4ddf366d3c51a 100644 >--- a/Source/WebCore/loader/SubresourceLoader.cpp >+++ b/Source/WebCore/loader/SubresourceLoader.cpp >@@ -377,7 +377,7 @@ void SubresourceLoader::didReceiveResponse(const ResourceResponse& response, Com > m_loadingMultipartContent = true; > > // We don't count multiParts in a CachedResourceLoader's request count >- m_requestCountTracker = std::nullopt; >+ m_requestCountTracker = WTF::nullopt; > if (!m_resource->isImage()) { > cancel(); > return; >@@ -726,7 +726,7 @@ void SubresourceLoader::notifyDone(LoadCompletionType type) > if (reachedTerminalState()) > return; > >- m_requestCountTracker = std::nullopt; >+ m_requestCountTracker = WTF::nullopt; > bool shouldPerformPostLoadActions = true; > #if PLATFORM(IOS_FAMILY) > if (m_state == CancelledWhileInitializing) >diff --git a/Source/WebCore/loader/SubresourceLoader.h b/Source/WebCore/loader/SubresourceLoader.h >index ab2f685e993beb28ac166a93f7e51382294a96cf..71fe39207eccb7fe2aa62476790331a79f588851 100644 >--- a/Source/WebCore/loader/SubresourceLoader.h >+++ b/Source/WebCore/loader/SubresourceLoader.h >@@ -128,7 +128,7 @@ private: > #endif > CachedResource* m_resource; > SubresourceLoaderState m_state; >- std::optional<RequestCountTracker> m_requestCountTracker; >+ Optional<RequestCountTracker> m_requestCountTracker; > RefPtr<SecurityOrigin> m_origin; > CompletionHandler<void()> m_policyForResponseCompletionHandler; > unsigned m_redirectCount { 0 }; >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >index 040d8b7ad6a091eb1c9e435b5e0c3401f93ae252..e81483c3623cd034244484cd0f5fdc924955ae32 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >+++ b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >@@ -1308,18 +1308,18 @@ bool ApplicationCacheStorage::writeDataToUniqueFileInDirectory(SharedBuffer& dat > return true; > } > >-std::optional<Vector<URL>> ApplicationCacheStorage::manifestURLs() >+Optional<Vector<URL>> ApplicationCacheStorage::manifestURLs() > { > SQLiteTransactionInProgressAutoCounter transactionCounter; > > openDatabase(false); > if (!m_database.isOpen()) >- return std::nullopt; >+ return WTF::nullopt; > > SQLiteStatement selectURLs(m_database, "SELECT manifestURL FROM CacheGroups"); > > if (selectURLs.prepare() != SQLITE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<URL> urls; > while (selectURLs.step() == SQLITE_ROW) >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheStorage.h b/Source/WebCore/loader/appcache/ApplicationCacheStorage.h >index 68c361e52b42d91d361e9cc8290ef35c350152b5..8b00aa65e4635c0a816535076a480da0144ead1a 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheStorage.h >+++ b/Source/WebCore/loader/appcache/ApplicationCacheStorage.h >@@ -106,7 +106,7 @@ private: > > RefPtr<ApplicationCache> loadCache(unsigned storageID); > ApplicationCacheGroup* loadCacheGroup(const URL& manifestURL); >- std::optional<Vector<URL>> manifestURLs(); >+ Optional<Vector<URL>> manifestURLs(); > ApplicationCacheGroup* findInMemoryCacheGroup(const URL& manifestURL) const; > bool deleteCacheGroup(const String& manifestURL); > void vacuumDatabaseFile(); >diff --git a/Source/WebCore/loader/cache/CachedApplicationManifest.cpp b/Source/WebCore/loader/cache/CachedApplicationManifest.cpp >index 860171da30b14d49f134a95616c2b2f4e39dd94f..f68bc7c55b1a33f3c823168176750c91a4f2aedf 100644 >--- a/Source/WebCore/loader/cache/CachedApplicationManifest.cpp >+++ b/Source/WebCore/loader/cache/CachedApplicationManifest.cpp >@@ -59,10 +59,10 @@ String CachedApplicationManifest::encoding() const > return m_decoder->encoding().name(); > } > >-std::optional<ApplicationManifest> CachedApplicationManifest::process(const URL& manifestURL, const URL& documentURL, RefPtr<ScriptExecutionContext> scriptExecutionContext) >+Optional<ApplicationManifest> CachedApplicationManifest::process(const URL& manifestURL, const URL& documentURL, RefPtr<ScriptExecutionContext> scriptExecutionContext) > { > if (!m_text) >- return std::nullopt; >+ return WTF::nullopt; > if (scriptExecutionContext) > return ApplicationManifestParser::parse(*scriptExecutionContext, *m_text, manifestURL, documentURL); > return ApplicationManifestParser::parse(*m_text, manifestURL, documentURL); >diff --git a/Source/WebCore/loader/cache/CachedApplicationManifest.h b/Source/WebCore/loader/cache/CachedApplicationManifest.h >index 95458351d3bae794f1953ab3ff7a4be13f879e04..03971cdd3d60fde65d0455407e06f8ee6526c935 100644 >--- a/Source/WebCore/loader/cache/CachedApplicationManifest.h >+++ b/Source/WebCore/loader/cache/CachedApplicationManifest.h >@@ -40,7 +40,7 @@ class CachedApplicationManifest final : public CachedResource { > public: > CachedApplicationManifest(CachedResourceRequest&&, PAL::SessionID); > >- std::optional<struct ApplicationManifest> process(const URL& manifestURL, const URL& documentURL, RefPtr<ScriptExecutionContext> = nullptr); >+ Optional<struct ApplicationManifest> process(const URL& manifestURL, const URL& documentURL, RefPtr<ScriptExecutionContext> = nullptr); > > private: > void finishLoading(SharedBuffer*) override; >@@ -49,7 +49,7 @@ private: > String encoding() const override; > > Ref<TextResourceDecoder> m_decoder; >- std::optional<String> m_text; >+ Optional<String> m_text; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/loader/cache/CachedRawResource.cpp b/Source/WebCore/loader/cache/CachedRawResource.cpp >index 32540d08c5bc2f755b4097552764d76df0853f6f..37f5625d309c76944f379c5c4fe17056463386d1 100644 >--- a/Source/WebCore/loader/cache/CachedRawResource.cpp >+++ b/Source/WebCore/loader/cache/CachedRawResource.cpp >@@ -46,11 +46,11 @@ CachedRawResource::CachedRawResource(CachedResourceRequest&& request, Type type, > ASSERT(isMainOrMediaOrIconOrRawResource()); > } > >-std::optional<SharedBufferDataView> CachedRawResource::calculateIncrementalDataChunk(const SharedBuffer* data) const >+Optional<SharedBufferDataView> CachedRawResource::calculateIncrementalDataChunk(const SharedBuffer* data) const > { > size_t previousDataLength = encodedSize(); > if (!data || data->size() <= previousDataLength) >- return std::nullopt; >+ return WTF::nullopt; > return data->getSomeData(previousDataLength); > } > >@@ -82,7 +82,7 @@ void CachedRawResource::updateBuffer(SharedBuffer& data) > CachedResource::updateBuffer(data); > > if (m_delayedFinishLoading) { >- auto delayedFinishLoading = std::exchange(m_delayedFinishLoading, std::nullopt); >+ auto delayedFinishLoading = std::exchange(m_delayedFinishLoading, WTF::nullopt); > finishLoading(delayedFinishLoading->buffer.get()); > } > } >@@ -99,7 +99,7 @@ void CachedRawResource::finishLoading(SharedBuffer* data) > if (m_inIncrementalDataNotify) { > // We may get here synchronously from updateBuffer() if the callback there ends up spinning a runloop. > // In that case delay the call. >- m_delayedFinishLoading = std::make_optional(DelayedFinishLoading { data }); >+ m_delayedFinishLoading = makeOptional(DelayedFinishLoading { data }); > return; > }; > CachedResourceHandle<CachedRawResource> protectedThis(this); >diff --git a/Source/WebCore/loader/cache/CachedRawResource.h b/Source/WebCore/loader/cache/CachedRawResource.h >index cf29c30f2a90cbbb5281b4ac9167ebf59c34a1cf..2a21ca92ccc9f1cb8b109c865706d886e2806beb 100644 >--- a/Source/WebCore/loader/cache/CachedRawResource.h >+++ b/Source/WebCore/loader/cache/CachedRawResource.h >@@ -66,7 +66,7 @@ private: > void switchClientsToRevalidatedResource() override; > bool mayTryReplaceEncodedData() const override { return m_allowEncodedDataReplacement; } > >- std::optional<SharedBufferDataView> calculateIncrementalDataChunk(const SharedBuffer*) const; >+ Optional<SharedBufferDataView> calculateIncrementalDataChunk(const SharedBuffer*) const; > void notifyClientsDataWasReceived(const char* data, unsigned length); > > unsigned long m_identifier; >@@ -90,7 +90,7 @@ private: > struct DelayedFinishLoading { > RefPtr<SharedBuffer> buffer; > }; >- std::optional<DelayedFinishLoading> m_delayedFinishLoading; >+ Optional<DelayedFinishLoading> m_delayedFinishLoading; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp >index 8f5dd206174ff486f412cedf812a980dd63dc52d..0c63005009c558588ed99327a059ff368dd52458 100644 >--- a/Source/WebCore/loader/cache/CachedResource.cpp >+++ b/Source/WebCore/loader/cache/CachedResource.cpp >@@ -873,7 +873,7 @@ bool CachedResource::areAllClientsXMLHttpRequests() const > return true; > } > >-void CachedResource::setLoadPriority(const std::optional<ResourceLoadPriority>& loadPriority) >+void CachedResource::setLoadPriority(const Optional<ResourceLoadPriority>& loadPriority) > { > if (loadPriority) > m_loadPriority = loadPriority.value(); >diff --git a/Source/WebCore/loader/cache/CachedResource.h b/Source/WebCore/loader/cache/CachedResource.h >index b3a67ceecf6330d033bd97aca6952c54201e2a9d..a10e02f1d6d835f0bc422db3efde5bbd9a97626d 100644 >--- a/Source/WebCore/loader/cache/CachedResource.h >+++ b/Source/WebCore/loader/cache/CachedResource.h >@@ -123,7 +123,7 @@ public: > static bool shouldUsePingLoad(Type type) { return type == Type::Beacon; } > > ResourceLoadPriority loadPriority() const { return m_loadPriority; } >- void setLoadPriority(const std::optional<ResourceLoadPriority>&); >+ void setLoadPriority(const Optional<ResourceLoadPriority>&); > > WEBCORE_EXPORT void addClient(CachedResourceClient&); > WEBCORE_EXPORT void removeClient(CachedResourceClient&); >diff --git a/Source/WebCore/loader/cache/CachedResourceRequest.cpp b/Source/WebCore/loader/cache/CachedResourceRequest.cpp >index 720ead197ec99f353382751f1fb5cfde59c8ffe7..49f45193dcc3009e9886993418bb60accf930469 100644 >--- a/Source/WebCore/loader/cache/CachedResourceRequest.cpp >+++ b/Source/WebCore/loader/cache/CachedResourceRequest.cpp >@@ -40,7 +40,7 @@ > > namespace WebCore { > >-CachedResourceRequest::CachedResourceRequest(ResourceRequest&& resourceRequest, const ResourceLoaderOptions& options, std::optional<ResourceLoadPriority> priority, String&& charset) >+CachedResourceRequest::CachedResourceRequest(ResourceRequest&& resourceRequest, const ResourceLoaderOptions& options, Optional<ResourceLoadPriority> priority, String&& charset) > : m_resourceRequest(WTFMove(resourceRequest)) > , m_charset(WTFMove(charset)) > , m_options(options) >@@ -300,7 +300,7 @@ void CachedResourceRequest::setSelectedServiceWorkerRegistrationIdentifierIfNeed > m_options.serviceWorkerRegistrationIdentifier = identifier; > } > >-void CachedResourceRequest::setNavigationServiceWorkerRegistrationData(const std::optional<ServiceWorkerRegistrationData>& data) >+void CachedResourceRequest::setNavigationServiceWorkerRegistrationData(const Optional<ServiceWorkerRegistrationData>& data) > { > if (!data || !data->activeWorker) { > m_options.serviceWorkersMode = ServiceWorkersMode::None; >diff --git a/Source/WebCore/loader/cache/CachedResourceRequest.h b/Source/WebCore/loader/cache/CachedResourceRequest.h >index 89cca69bc71ef42e8fb6d542d06e0437844e5006..b6643d11e13569ee4bb845ec9c5016e4182f2619 100644 >--- a/Source/WebCore/loader/cache/CachedResourceRequest.h >+++ b/Source/WebCore/loader/cache/CachedResourceRequest.h >@@ -50,7 +50,7 @@ bool isRequestCrossOrigin(SecurityOrigin*, const URL& requestURL, const Resource > > class CachedResourceRequest { > public: >- CachedResourceRequest(ResourceRequest&&, const ResourceLoaderOptions&, std::optional<ResourceLoadPriority> = std::nullopt, String&& charset = String()); >+ CachedResourceRequest(ResourceRequest&&, const ResourceLoaderOptions&, Optional<ResourceLoadPriority> = WTF::nullopt, String&& charset = String()); > > ResourceRequest&& releaseResourceRequest() { return WTFMove(m_resourceRequest); } > const ResourceRequest& resourceRequest() const { return m_resourceRequest; } >@@ -62,8 +62,8 @@ public: > const ResourceLoaderOptions& options() const { return m_options; } > void setOptions(const ResourceLoaderOptions& options) { m_options = options; } > >- const std::optional<ResourceLoadPriority>& priority() const { return m_priority; } >- void setPriority(std::optional<ResourceLoadPriority>&& priority) { m_priority = WTFMove(priority); } >+ const Optional<ResourceLoadPriority>& priority() const { return m_priority; } >+ void setPriority(Optional<ResourceLoadPriority>&& priority) { m_priority = WTFMove(priority); } > > void setInitiator(Element&); > void setInitiator(const AtomicString& name); >@@ -110,14 +110,14 @@ public: > #if ENABLE(SERVICE_WORKER) > void setClientIdentifierIfNeeded(DocumentIdentifier); > void setSelectedServiceWorkerRegistrationIdentifierIfNeeded(ServiceWorkerRegistrationIdentifier); >- void setNavigationServiceWorkerRegistrationData(const std::optional<ServiceWorkerRegistrationData>&); >+ void setNavigationServiceWorkerRegistrationData(const Optional<ServiceWorkerRegistrationData>&); > #endif > > private: > ResourceRequest m_resourceRequest; > String m_charset; > ResourceLoaderOptions m_options; >- std::optional<ResourceLoadPriority> m_priority; >+ Optional<ResourceLoadPriority> m_priority; > RefPtr<Element> m_initiatorElement; > AtomicString m_initiatorName; > RefPtr<SecurityOrigin> m_origin; >diff --git a/Source/WebCore/mathml/MathMLElement.h b/Source/WebCore/mathml/MathMLElement.h >index f1ed867228ba5f1b6141b10d8b970163328e965b..b35f0165c687ad429430c3e7ad60ab7e35e2ed74 100644 >--- a/Source/WebCore/mathml/MathMLElement.h >+++ b/Source/WebCore/mathml/MathMLElement.h >@@ -85,8 +85,8 @@ public: > Stretched = 18 > }; > >- virtual std::optional<bool> specifiedDisplayStyle() { return std::nullopt; } >- virtual std::optional<MathVariant> specifiedMathVariant() { return std::nullopt; } >+ virtual Optional<bool> specifiedDisplayStyle() { return WTF::nullopt; } >+ virtual Optional<MathVariant> specifiedMathVariant() { return WTF::nullopt; } > > virtual void updateSelectedChild() { } > >diff --git a/Source/WebCore/mathml/MathMLFractionElement.cpp b/Source/WebCore/mathml/MathMLFractionElement.cpp >index c3484223ee7178978bbc140a264a5d0377890715..77988d5fbd99907cd01b13e9bc3b1ee08494fc3b 100644 >--- a/Source/WebCore/mathml/MathMLFractionElement.cpp >+++ b/Source/WebCore/mathml/MathMLFractionElement.cpp >@@ -72,7 +72,7 @@ const MathMLElement::Length& MathMLFractionElement::lineThickness() > return m_lineThickness.value(); > } > >-MathMLFractionElement::FractionAlignment MathMLFractionElement::cachedFractionAlignment(const QualifiedName& name, std::optional<FractionAlignment>& alignment) >+MathMLFractionElement::FractionAlignment MathMLFractionElement::cachedFractionAlignment(const QualifiedName& name, Optional<FractionAlignment>& alignment) > { > if (alignment) > return alignment.value(); >@@ -100,11 +100,11 @@ MathMLFractionElement::FractionAlignment MathMLFractionElement::denominatorAlign > void MathMLFractionElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == linethicknessAttr) >- m_lineThickness = std::nullopt; >+ m_lineThickness = WTF::nullopt; > else if (name == numalignAttr) >- m_numeratorAlignment = std::nullopt; >+ m_numeratorAlignment = WTF::nullopt; > else if (name == denomalignAttr) >- m_denominatorAlignment = std::nullopt; >+ m_denominatorAlignment = WTF::nullopt; > > MathMLElement::parseAttribute(name, value); > } >diff --git a/Source/WebCore/mathml/MathMLFractionElement.h b/Source/WebCore/mathml/MathMLFractionElement.h >index f73fa24192760d1ea2d05c75e2a4c2f753f23419..e20680648cb73dca4514ac52edb72852349a82a3 100644 >--- a/Source/WebCore/mathml/MathMLFractionElement.h >+++ b/Source/WebCore/mathml/MathMLFractionElement.h >@@ -49,11 +49,11 @@ private: > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > void parseAttribute(const QualifiedName&, const AtomicString&) final; > >- FractionAlignment cachedFractionAlignment(const QualifiedName&, std::optional<FractionAlignment>&); >+ FractionAlignment cachedFractionAlignment(const QualifiedName&, Optional<FractionAlignment>&); > >- std::optional<Length> m_lineThickness; >- std::optional<FractionAlignment> m_numeratorAlignment; >- std::optional<FractionAlignment> m_denominatorAlignment; >+ Optional<Length> m_lineThickness; >+ Optional<FractionAlignment> m_numeratorAlignment; >+ Optional<FractionAlignment> m_denominatorAlignment; > }; > > } >diff --git a/Source/WebCore/mathml/MathMLMathElement.cpp b/Source/WebCore/mathml/MathMLMathElement.cpp >index a1f6dbd507b746615a549c951c1fdb2c9fce3c73..aeb28dffe4c95cf596f6c88011177eba0e5f013d 100644 >--- a/Source/WebCore/mathml/MathMLMathElement.cpp >+++ b/Source/WebCore/mathml/MathMLMathElement.cpp >@@ -56,7 +56,7 @@ RenderPtr<RenderElement> MathMLMathElement::createElementRenderer(RenderStyle&& > return createRenderer<RenderMathMLMath>(*this, WTFMove(style)); > } > >-std::optional<bool> MathMLMathElement::specifiedDisplayStyle() >+Optional<bool> MathMLMathElement::specifiedDisplayStyle() > { > if (cachedBooleanAttribute(displaystyleAttr, m_displayStyle) == BooleanValue::Default) { > // The default displaystyle value of the <math> depends on the display attribute, so we parse it here. >@@ -74,9 +74,9 @@ void MathMLMathElement::parseAttribute(const QualifiedName& name, const AtomicSt > bool displayStyleAttribute = (name == displaystyleAttr || name == displayAttr); > bool mathVariantAttribute = name == mathvariantAttr; > if (displayStyleAttribute) >- m_displayStyle = std::nullopt; >+ m_displayStyle = WTF::nullopt; > if (mathVariantAttribute) >- m_mathVariant = std::nullopt; >+ m_mathVariant = WTF::nullopt; > if ((displayStyleAttribute || mathVariantAttribute) && renderer()) > MathMLStyle::resolveMathMLStyleTree(renderer()); > >diff --git a/Source/WebCore/mathml/MathMLMathElement.h b/Source/WebCore/mathml/MathMLMathElement.h >index 57ab272bb38443704b78251c5d783ee50468c136..d7d0a69732013b563dc934839e04d1799c3d2099 100644 >--- a/Source/WebCore/mathml/MathMLMathElement.h >+++ b/Source/WebCore/mathml/MathMLMathElement.h >@@ -45,7 +45,7 @@ private: > > bool acceptsDisplayStyleAttribute() final { return true; } > bool acceptsMathVariantAttribute() final { return true; } >- std::optional<bool> specifiedDisplayStyle() final; >+ Optional<bool> specifiedDisplayStyle() final; > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > }; >diff --git a/Source/WebCore/mathml/MathMLMencloseElement.cpp b/Source/WebCore/mathml/MathMLMencloseElement.cpp >index 3619ad56564d18b32ae443b4de5e0aaa1a8ee612..f6444f8a10873300761908c33674d50abcfd734a 100644 >--- a/Source/WebCore/mathml/MathMLMencloseElement.cpp >+++ b/Source/WebCore/mathml/MathMLMencloseElement.cpp >@@ -135,7 +135,7 @@ bool MathMLMencloseElement::hasNotation(MencloseNotationFlag notationFlag) > void MathMLMencloseElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == notationAttr) >- m_notationFlags = std::nullopt; >+ m_notationFlags = WTF::nullopt; > > MathMLRowElement::parseAttribute(name, value); > } >diff --git a/Source/WebCore/mathml/MathMLMencloseElement.h b/Source/WebCore/mathml/MathMLMencloseElement.h >index c51a6e64f346c5b9caaaaf5b3057d3941ee66b45..57e0de6ecee80b0417ff8018eb70fe2fb2c63ed8 100644 >--- a/Source/WebCore/mathml/MathMLMencloseElement.h >+++ b/Source/WebCore/mathml/MathMLMencloseElement.h >@@ -64,7 +64,7 @@ private: > void clearNotations() { m_notationFlags = 0; } > void addNotation(MencloseNotationFlag notationFlag) { m_notationFlags.value() |= notationFlag; } > void addNotationFlags(StringView notation); >- std::optional<uint16_t> m_notationFlags; >+ Optional<uint16_t> m_notationFlags; > }; > > } >diff --git a/Source/WebCore/mathml/MathMLOperatorDictionary.cpp b/Source/WebCore/mathml/MathMLOperatorDictionary.cpp >index 6854f0dad7d9f779bf49a6f94987378f48034a17..4fa80627388089e7adb1366977bd850e900afef6 100644 >--- a/Source/WebCore/mathml/MathMLOperatorDictionary.cpp >+++ b/Source/WebCore/mathml/MathMLOperatorDictionary.cpp >@@ -1107,17 +1107,17 @@ static const UChar32 horizontalOperators[] = { > 0x003D, 0x005E, 0x005F, 0x007E, 0x00AF, 0x02C6, 0x02C7, 0x02C9, 0x02CD, 0x02DC, 0x02F7, 0x0302, 0x0332, 0x203E, 0x20D0, 0x20D1, 0x20D6, 0x20D7, 0x20E1, 0x2190, 0x2192, 0x2194, 0x2198, 0x2199, 0x219C, 0x219D, 0x219E, 0x21A0, 0x21A2, 0x21A3, 0x21A4, 0x21A6, 0x21A9, 0x21AA, 0x21AB, 0x21AC, 0x21AD, 0x21B4, 0x21B9, 0x21BC, 0x21BD, 0x21C0, 0x21C1, 0x21C4, 0x21C6, 0x21C7, 0x21C9, 0x21CB, 0x21CC, 0x21D0, 0x21D2, 0x21D4, 0x21DA, 0x21DB, 0x21DC, 0x21DD, 0x21E0, 0x21E2, 0x21E4, 0x21E5, 0x21E6, 0x21E8, 0x21F0, 0x21F6, 0x21FD, 0x21FE, 0x21FF, 0x23B4, 0x23B5, 0x23DC, 0x23DD, 0x23DE, 0x23DF, 0x23E0, 0x23E1, 0x2500, 0x27F5, 0x27F6, 0x27F7, 0x27F8, 0x27F9, 0x27FA, 0x27FB, 0x27FC, 0x27FD, 0x27FE, 0x27FF, 0x290C, 0x290D, 0x290E, 0x290F, 0x2910, 0x294E, 0x2950, 0x2952, 0x2953, 0x2956, 0x2957, 0x295A, 0x295B, 0x295E, 0x295F, 0x2B45, 0x2B46, 0xFE35, 0xFE36, 0xFE37, 0xFE38, 0x1EEF0, 0x1EEF1 > }; > >-std::optional<Property> MathMLOperatorDictionary::search(UChar32 character, Form form, bool explicitForm) >+Optional<Property> MathMLOperatorDictionary::search(UChar32 character, Form form, bool explicitForm) > { > if (!character) >- return std::nullopt; >+ return WTF::nullopt; > > // We try and find the default values from the operator dictionary. > if (auto* entry = tryBinarySearch<const Entry, Key>(dictionary, dictionarySize, Key(character, form), ExtractKey)) > return ExtractProperty(*entry); > > if (explicitForm) >- return std::nullopt; >+ return WTF::nullopt; > > // If we did not find the desired operator form and if it was not set explicitely, we use the first one in the following order: Infix, Prefix, Postfix. > // This is to handle bad MathML markup without explicit <mrow> delimiters like "<mo>(</mo><mi>a</mi><mo>)</mo><mo>(</mo><mi>b</mi><mo>)</mo>" where innerfences should not be considered infix. >@@ -1130,7 +1130,7 @@ std::optional<Property> MathMLOperatorDictionary::search(UChar32 character, Form > return ExtractProperty(*entry); > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > bool MathMLOperatorDictionary::isVertical(UChar32 textContent) >diff --git a/Source/WebCore/mathml/MathMLOperatorDictionary.h b/Source/WebCore/mathml/MathMLOperatorDictionary.h >index e0316d71450f2b277ab2f7440d27d823cba09237..00ef50d68c7ed34c32126327ab69f9fac9f4de1b 100644 >--- a/Source/WebCore/mathml/MathMLOperatorDictionary.h >+++ b/Source/WebCore/mathml/MathMLOperatorDictionary.h >@@ -52,7 +52,7 @@ struct Property { > // Default operator properties are all set to "false". > unsigned short flags { 0 }; > }; >-std::optional<Property> search(UChar32, Form, bool explicitForm); >+Optional<Property> search(UChar32, Form, bool explicitForm); > bool isVertical(UChar32); > } > >diff --git a/Source/WebCore/mathml/MathMLOperatorElement.cpp b/Source/WebCore/mathml/MathMLOperatorElement.cpp >index 120bf0a75e79e353f93e4339d029cc6a82afcbf3..7f00dadf487172ab08688b735ee74487a07603ee 100644 >--- a/Source/WebCore/mathml/MathMLOperatorElement.cpp >+++ b/Source/WebCore/mathml/MathMLOperatorElement.cpp >@@ -136,7 +136,7 @@ void MathMLOperatorElement::computeOperatorFlag(MathMLOperatorDictionary::Flag f > { > ASSERT(m_properties.dirtyFlags & flag); > >- std::optional<BooleanValue> property; >+ Optional<BooleanValue> property; > const auto& name = propertyFlagToAttributeName(flag); > const BooleanValue& value = cachedBooleanAttribute(name, property); > switch (value) { >@@ -214,13 +214,13 @@ const MathMLElement::Length& MathMLOperatorElement::maxSize() > > void MathMLOperatorElement::childrenChanged(const ChildChange& change) > { >- m_operatorChar = std::nullopt; >- m_dictionaryProperty = std::nullopt; >+ m_operatorChar = WTF::nullopt; >+ m_dictionaryProperty = WTF::nullopt; > m_properties.dirtyFlags = MathMLOperatorDictionary::allFlags; > MathMLTokenElement::childrenChanged(change); > } > >-static std::optional<MathMLOperatorDictionary::Flag> attributeNameToPropertyFlag(const QualifiedName& name) >+static Optional<MathMLOperatorDictionary::Flag> attributeNameToPropertyFlag(const QualifiedName& name) > { > if (name == accentAttr) > return Accent; >@@ -236,24 +236,24 @@ static std::optional<MathMLOperatorDictionary::Flag> attributeNameToPropertyFlag > return Stretchy; > if (name == symmetricAttr) > return Symmetric; >- return std::nullopt; >+ return WTF::nullopt; > } > > void MathMLOperatorElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == formAttr) { >- m_dictionaryProperty = std::nullopt; >+ m_dictionaryProperty = WTF::nullopt; > m_properties.dirtyFlags = MathMLOperatorDictionary::allFlags; > } else if (auto flag = attributeNameToPropertyFlag(name)) > m_properties.dirtyFlags |= flag.value(); > else if (name == lspaceAttr) >- m_leadingSpace = std::nullopt; >+ m_leadingSpace = WTF::nullopt; > else if (name == rspaceAttr) >- m_trailingSpace = std::nullopt; >+ m_trailingSpace = WTF::nullopt; > else if (name == minsizeAttr) >- m_minSize = std::nullopt; >+ m_minSize = WTF::nullopt; > else if (name == maxsizeAttr) >- m_maxSize = std::nullopt; >+ m_maxSize = WTF::nullopt; > > if ((name == stretchyAttr || name == lspaceAttr || name == rspaceAttr || name == movablelimitsAttr) && renderer()) { > downcast<RenderMathMLOperator>(*renderer()).updateFromElement(); >diff --git a/Source/WebCore/mathml/MathMLOperatorElement.h b/Source/WebCore/mathml/MathMLOperatorElement.h >index b076bd5f40f590afedc5337780639e280824f6f3..e20ded871cc374c31e8672060103c7a4fb62718c 100644 >--- a/Source/WebCore/mathml/MathMLOperatorElement.h >+++ b/Source/WebCore/mathml/MathMLOperatorElement.h >@@ -42,7 +42,7 @@ public: > }; > static OperatorChar parseOperatorChar(const String&); > const OperatorChar& operatorChar(); >- void setOperatorFormDirty() { m_dictionaryProperty = std::nullopt; } >+ void setOperatorFormDirty() { m_dictionaryProperty = WTF::nullopt; } > MathMLOperatorDictionary::Form form() { return dictionaryProperty().form; } > bool hasProperty(MathMLOperatorDictionary::Flag); > Length defaultLeadingSpace(); >@@ -58,9 +58,9 @@ private: > void childrenChanged(const ChildChange&) final; > void parseAttribute(const QualifiedName&, const AtomicString&) final; > >- std::optional<OperatorChar> m_operatorChar; >+ Optional<OperatorChar> m_operatorChar; > >- std::optional<MathMLOperatorDictionary::Property> m_dictionaryProperty; >+ Optional<MathMLOperatorDictionary::Property> m_dictionaryProperty; > MathMLOperatorDictionary::Property computeDictionaryProperty(); > const MathMLOperatorDictionary::Property& dictionaryProperty(); > >@@ -71,10 +71,10 @@ private: > OperatorProperties m_properties; > void computeOperatorFlag(MathMLOperatorDictionary::Flag); > >- std::optional<Length> m_leadingSpace; >- std::optional<Length> m_trailingSpace; >- std::optional<Length> m_minSize; >- std::optional<Length> m_maxSize; >+ Optional<Length> m_leadingSpace; >+ Optional<Length> m_trailingSpace; >+ Optional<Length> m_minSize; >+ Optional<Length> m_maxSize; > }; > > } >diff --git a/Source/WebCore/mathml/MathMLPaddedElement.cpp b/Source/WebCore/mathml/MathMLPaddedElement.cpp >index 44e8fe1ced13eda2053f24234dda3e123c94ed55..6e42866bb07dcc9ad26271b32d38a1a289fadcf3 100644 >--- a/Source/WebCore/mathml/MathMLPaddedElement.cpp >+++ b/Source/WebCore/mathml/MathMLPaddedElement.cpp >@@ -76,15 +76,15 @@ const MathMLElement::Length& MathMLPaddedElement::voffset() > void MathMLPaddedElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == widthAttr) >- m_width = std::nullopt; >+ m_width = WTF::nullopt; > else if (name == heightAttr) >- m_height = std::nullopt; >+ m_height = WTF::nullopt; > else if (name == depthAttr) >- m_depth = std::nullopt; >+ m_depth = WTF::nullopt; > else if (name == lspaceAttr) >- m_lspace = std::nullopt; >+ m_lspace = WTF::nullopt; > else if (name == voffsetAttr) >- m_voffset = std::nullopt; >+ m_voffset = WTF::nullopt; > > MathMLElement::parseAttribute(name, value); > } >diff --git a/Source/WebCore/mathml/MathMLPaddedElement.h b/Source/WebCore/mathml/MathMLPaddedElement.h >index 22222da4dff865c74b7390904aadeb81a59cfcc1..e1c23ba48d400bbebdcdaa2b409573d44c2130f6 100644 >--- a/Source/WebCore/mathml/MathMLPaddedElement.h >+++ b/Source/WebCore/mathml/MathMLPaddedElement.h >@@ -46,11 +46,11 @@ private: > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > void parseAttribute(const QualifiedName&, const AtomicString&) final; > >- std::optional<Length> m_width; >- std::optional<Length> m_height; >- std::optional<Length> m_depth; >- std::optional<Length> m_lspace; >- std::optional<Length> m_voffset; >+ Optional<Length> m_width; >+ Optional<Length> m_height; >+ Optional<Length> m_depth; >+ Optional<Length> m_lspace; >+ Optional<Length> m_voffset; > }; > > } >diff --git a/Source/WebCore/mathml/MathMLPresentationElement.cpp b/Source/WebCore/mathml/MathMLPresentationElement.cpp >index ba004e927fde624d54678da9235c99b61841d4ba..84b7d2088a3ac1d083c38afaf32b35490354cfb2 100644 >--- a/Source/WebCore/mathml/MathMLPresentationElement.cpp >+++ b/Source/WebCore/mathml/MathMLPresentationElement.cpp >@@ -184,7 +184,7 @@ bool MathMLPresentationElement::isFlowContent(const Node& node) > || htmlElement.hasTagName(HTMLNames::ulTag); > } > >-const MathMLElement::BooleanValue& MathMLPresentationElement::cachedBooleanAttribute(const QualifiedName& name, std::optional<BooleanValue>& attribute) >+const MathMLElement::BooleanValue& MathMLPresentationElement::cachedBooleanAttribute(const QualifiedName& name, Optional<BooleanValue>& attribute) > { > if (attribute) > return attribute.value(); >@@ -308,7 +308,7 @@ MathMLElement::Length MathMLPresentationElement::parseMathMLLength(const String& > return parseNamedSpace(stringView); > } > >-const MathMLElement::Length& MathMLPresentationElement::cachedMathMLLength(const QualifiedName& name, std::optional<Length>& length) >+const MathMLElement::Length& MathMLPresentationElement::cachedMathMLLength(const QualifiedName& name, Optional<Length>& length) > { > if (length) > return length.value(); >@@ -321,10 +321,10 @@ bool MathMLPresentationElement::acceptsDisplayStyleAttribute() > return hasTagName(mtableTag); > } > >-std::optional<bool> MathMLPresentationElement::specifiedDisplayStyle() >+Optional<bool> MathMLPresentationElement::specifiedDisplayStyle() > { > if (!acceptsDisplayStyleAttribute()) >- return std::nullopt; >+ return WTF::nullopt; > const MathMLElement::BooleanValue& specifiedDisplayStyle = cachedBooleanAttribute(displaystyleAttr, m_displayStyle); > return toOptionalBool(specifiedDisplayStyle); > } >@@ -371,13 +371,13 @@ MathMLElement::MathVariant MathMLPresentationElement::parseMathVariantAttribute( > return MathVariant::None; > } > >-std::optional<MathMLElement::MathVariant> MathMLPresentationElement::specifiedMathVariant() >+Optional<MathMLElement::MathVariant> MathMLPresentationElement::specifiedMathVariant() > { > if (!acceptsMathVariantAttribute()) >- return std::nullopt; >+ return WTF::nullopt; > if (!m_mathVariant) > m_mathVariant = parseMathVariantAttribute(attributeWithoutSynchronization(mathvariantAttr)); >- return m_mathVariant.value() == MathVariant::None ? std::nullopt : m_mathVariant; >+ return m_mathVariant.value() == MathVariant::None ? WTF::nullopt : m_mathVariant; > } > > void MathMLPresentationElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -385,9 +385,9 @@ void MathMLPresentationElement::parseAttribute(const QualifiedName& name, const > bool displayStyleAttribute = name == displaystyleAttr && acceptsDisplayStyleAttribute(); > bool mathVariantAttribute = name == mathvariantAttr && acceptsMathVariantAttribute(); > if (displayStyleAttribute) >- m_displayStyle = std::nullopt; >+ m_displayStyle = WTF::nullopt; > if (mathVariantAttribute) >- m_mathVariant = std::nullopt; >+ m_mathVariant = WTF::nullopt; > if ((displayStyleAttribute || mathVariantAttribute) && renderer()) > MathMLStyle::resolveMathMLStyleTree(renderer()); > >diff --git a/Source/WebCore/mathml/MathMLPresentationElement.h b/Source/WebCore/mathml/MathMLPresentationElement.h >index 576d79a70d2d4675045fbcfa14c89afe6d6b6b14..c538a1e8b63501f665559cb7bb44e38e4f53392e 100644 >--- a/Source/WebCore/mathml/MathMLPresentationElement.h >+++ b/Source/WebCore/mathml/MathMLPresentationElement.h >@@ -45,20 +45,20 @@ protected: > static bool isPhrasingContent(const Node&); > static bool isFlowContent(const Node&); > >- static std::optional<bool> toOptionalBool(const BooleanValue& value) { return value == BooleanValue::Default ? std::nullopt : std::optional<bool>(value == BooleanValue::True); } >- const BooleanValue& cachedBooleanAttribute(const QualifiedName&, std::optional<BooleanValue>&); >+ static Optional<bool> toOptionalBool(const BooleanValue& value) { return value == BooleanValue::Default ? WTF::nullopt : Optional<bool>(value == BooleanValue::True); } >+ const BooleanValue& cachedBooleanAttribute(const QualifiedName&, Optional<BooleanValue>&); > > static Length parseMathMLLength(const String&); >- const Length& cachedMathMLLength(const QualifiedName&, std::optional<Length>&); >+ const Length& cachedMathMLLength(const QualifiedName&, Optional<Length>&); > > virtual bool acceptsDisplayStyleAttribute(); >- std::optional<bool> specifiedDisplayStyle() override; >+ Optional<bool> specifiedDisplayStyle() override; > > virtual bool acceptsMathVariantAttribute() { return false; } >- std::optional<MathVariant> specifiedMathVariant() final; >+ Optional<MathVariant> specifiedMathVariant() final; > >- std::optional<BooleanValue> m_displayStyle; >- std::optional<MathVariant> m_mathVariant; >+ Optional<BooleanValue> m_displayStyle; >+ Optional<MathVariant> m_mathVariant; > > private: > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; >diff --git a/Source/WebCore/mathml/MathMLScriptsElement.cpp b/Source/WebCore/mathml/MathMLScriptsElement.cpp >index 2dca2f5466463f0ba2d53856cf2651999bd33027..b11977d3ec3da6ce90bcef6cb4af1cecb51ef937 100644 >--- a/Source/WebCore/mathml/MathMLScriptsElement.cpp >+++ b/Source/WebCore/mathml/MathMLScriptsElement.cpp >@@ -80,9 +80,9 @@ const MathMLElement::Length& MathMLScriptsElement::superscriptShift() > void MathMLScriptsElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == subscriptshiftAttr) >- m_subscriptShift = std::nullopt; >+ m_subscriptShift = WTF::nullopt; > else if (name == superscriptshiftAttr) >- m_superscriptShift = std::nullopt; >+ m_superscriptShift = WTF::nullopt; > > MathMLElement::parseAttribute(name, value); > } >diff --git a/Source/WebCore/mathml/MathMLScriptsElement.h b/Source/WebCore/mathml/MathMLScriptsElement.h >index a14b569b57a8e7851edcdc37e94691cbcafeaa29..d2bc651cfc1e8f67e6773f3708e9d5f4a1b6cfc1 100644 >--- a/Source/WebCore/mathml/MathMLScriptsElement.h >+++ b/Source/WebCore/mathml/MathMLScriptsElement.h >@@ -49,8 +49,8 @@ private: > void parseAttribute(const QualifiedName&, const AtomicString&) override; > > const ScriptType m_scriptType; >- std::optional<Length> m_subscriptShift; >- std::optional<Length> m_superscriptShift; >+ Optional<Length> m_subscriptShift; >+ Optional<Length> m_superscriptShift; > }; > > } >diff --git a/Source/WebCore/mathml/MathMLSpaceElement.cpp b/Source/WebCore/mathml/MathMLSpaceElement.cpp >index c06b5d212101745d0eae8db01572f6553f134d99..4ab1a0556db8fe4523abf58ae3aec0ba2462b65a 100644 >--- a/Source/WebCore/mathml/MathMLSpaceElement.cpp >+++ b/Source/WebCore/mathml/MathMLSpaceElement.cpp >@@ -66,11 +66,11 @@ const MathMLElement::Length& MathMLSpaceElement::depth() > void MathMLSpaceElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == widthAttr) >- m_width = std::nullopt; >+ m_width = WTF::nullopt; > else if (name == heightAttr) >- m_height = std::nullopt; >+ m_height = WTF::nullopt; > else if (name == depthAttr) >- m_depth = std::nullopt; >+ m_depth = WTF::nullopt; > > MathMLPresentationElement::parseAttribute(name, value); > } >diff --git a/Source/WebCore/mathml/MathMLSpaceElement.h b/Source/WebCore/mathml/MathMLSpaceElement.h >index f42cf9a99243baa6ff657b04e5bd322f46c869f5..8a85acb4baf392b74fd1af962fbbd4ec86af3f1d 100644 >--- a/Source/WebCore/mathml/MathMLSpaceElement.h >+++ b/Source/WebCore/mathml/MathMLSpaceElement.h >@@ -45,9 +45,9 @@ private: > > bool acceptsDisplayStyleAttribute() final { return false; } > >- std::optional<Length> m_width; >- std::optional<Length> m_height; >- std::optional<Length> m_depth; >+ Optional<Length> m_width; >+ Optional<Length> m_height; >+ Optional<Length> m_depth; > }; > > } >diff --git a/Source/WebCore/mathml/MathMLTokenElement.cpp b/Source/WebCore/mathml/MathMLTokenElement.cpp >index 4db3575409c2bd529d6c885b2cf251159e165eb0..9352393665a814e060220e0f146eecd9b1cb2d73 100644 >--- a/Source/WebCore/mathml/MathMLTokenElement.cpp >+++ b/Source/WebCore/mathml/MathMLTokenElement.cpp >@@ -80,15 +80,15 @@ bool MathMLTokenElement::childShouldCreateRenderer(const Node& child) const > return isPhrasingContent(child) && StyledElement::childShouldCreateRenderer(child); > } > >-std::optional<UChar32> MathMLTokenElement::convertToSingleCodePoint(StringView string) >+Optional<UChar32> MathMLTokenElement::convertToSingleCodePoint(StringView string) > { > auto codePoints = stripLeadingAndTrailingWhitespace(string).codePoints(); > auto iterator = codePoints.begin(); > if (iterator == codePoints.end()) >- return std::nullopt; >- std::optional<UChar32> character = *iterator; >+ return WTF::nullopt; >+ Optional<UChar32> character = *iterator; > ++iterator; >- return iterator == codePoints.end() ? character : std::nullopt; >+ return iterator == codePoints.end() ? character : WTF::nullopt; > } > > } >diff --git a/Source/WebCore/mathml/MathMLTokenElement.h b/Source/WebCore/mathml/MathMLTokenElement.h >index 693132283642efe613ddc5d420cefda8560e8742..c0eb33355ccb9cf53641df97b405481281e0fefb 100644 >--- a/Source/WebCore/mathml/MathMLTokenElement.h >+++ b/Source/WebCore/mathml/MathMLTokenElement.h >@@ -38,7 +38,7 @@ class MathMLTokenElement : public MathMLPresentationElement { > public: > static Ref<MathMLTokenElement> create(const QualifiedName& tagName, Document&); > >- static std::optional<UChar32> convertToSingleCodePoint(StringView); >+ static Optional<UChar32> convertToSingleCodePoint(StringView); > > protected: > MathMLTokenElement(const QualifiedName& tagName, Document&); >diff --git a/Source/WebCore/mathml/MathMLUnderOverElement.cpp b/Source/WebCore/mathml/MathMLUnderOverElement.cpp >index 30bafddc0b00ecbd824c8fc9a01e4a052efcaf8c..0c1dfeab957a9968e3ebbe3d967ff90f0654608f 100644 >--- a/Source/WebCore/mathml/MathMLUnderOverElement.cpp >+++ b/Source/WebCore/mathml/MathMLUnderOverElement.cpp >@@ -61,9 +61,9 @@ const MathMLElement::BooleanValue& MathMLUnderOverElement::accentUnder() > void MathMLUnderOverElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == accentAttr) >- m_accent = std::nullopt; >+ m_accent = WTF::nullopt; > else if (name == accentunderAttr) >- m_accentUnder = std::nullopt; >+ m_accentUnder = WTF::nullopt; > > MathMLElement::parseAttribute(name, value); > } >diff --git a/Source/WebCore/mathml/MathMLUnderOverElement.h b/Source/WebCore/mathml/MathMLUnderOverElement.h >index 0b6200827c910ef6e25395101db1f48b3bc9059a..bd64fa4c9581559207dee07c49987f46c7dfc54b 100644 >--- a/Source/WebCore/mathml/MathMLUnderOverElement.h >+++ b/Source/WebCore/mathml/MathMLUnderOverElement.h >@@ -43,8 +43,8 @@ private: > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > void parseAttribute(const QualifiedName&, const AtomicString&) final; > >- std::optional<BooleanValue> m_accent; >- std::optional<BooleanValue> m_accentUnder; >+ Optional<BooleanValue> m_accent; >+ Optional<BooleanValue> m_accentUnder; > }; > > } >diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h >index 08f583e2ece9606d6e4e0f019f8416b4f8994ff1..08b5acc7765809e241fd8bc9115bf1ce5473b289 100644 >--- a/Source/WebCore/page/ChromeClient.h >+++ b/Source/WebCore/page/ChromeClient.h >@@ -403,7 +403,7 @@ public: > virtual void notifyScrollerThumbIsVisibleInRect(const IntRect&) { } > virtual void recommendedScrollbarStyleDidChange(ScrollbarStyle) { } > >- virtual std::optional<ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() { return ScrollbarOverlayStyleDefault; } >+ virtual Optional<ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() { return ScrollbarOverlayStyleDefault; } > > virtual void wheelEventHandlersChanged(bool hasHandlers) = 0; > >diff --git a/Source/WebCore/page/ClientOrigin.h b/Source/WebCore/page/ClientOrigin.h >index b87505a050579e3bf138502a5eff4a4552ed1c0c..f44b5c116d2cb069051f16a22898302f0ada1988 100644 >--- a/Source/WebCore/page/ClientOrigin.h >+++ b/Source/WebCore/page/ClientOrigin.h >@@ -37,7 +37,7 @@ struct ClientOrigin { > bool operator==(const ClientOrigin&) const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ClientOrigin> decode(Decoder&); >+ template<class Decoder> static Optional<ClientOrigin> decode(Decoder&); > > ClientOrigin isolatedCopy() const; > >@@ -70,16 +70,16 @@ template<class Encoder> inline void ClientOrigin::encode(Encoder& encoder) const > encoder << clientOrigin; > } > >-template<class Decoder> inline std::optional<ClientOrigin> ClientOrigin::decode(Decoder& decoder) >+template<class Decoder> inline Optional<ClientOrigin> ClientOrigin::decode(Decoder& decoder) > { >- std::optional<SecurityOriginData> topOrigin; >- std::optional<SecurityOriginData> clientOrigin; >+ Optional<SecurityOriginData> topOrigin; >+ Optional<SecurityOriginData> clientOrigin; > decoder >> topOrigin; > if (!topOrigin) >- return std::nullopt; >+ return WTF::nullopt; > decoder >> clientOrigin; > if (!clientOrigin) >- return std::nullopt; >+ return WTF::nullopt; > > return ClientOrigin { WTFMove(*topOrigin), WTFMove(*clientOrigin) }; > } >diff --git a/Source/WebCore/page/DOMTimer.cpp b/Source/WebCore/page/DOMTimer.cpp >index f8bcd90df32556709b7c7ae866275ef3ca5242ee..e61f7cb4686859ee3075b3e014f7be919d502cf4 100644 >--- a/Source/WebCore/page/DOMTimer.cpp >+++ b/Source/WebCore/page/DOMTimer.cpp >@@ -444,11 +444,11 @@ Seconds DOMTimer::intervalClampedToMinimum() const > return interval; > } > >-std::optional<MonotonicTime> DOMTimer::alignedFireTime(MonotonicTime fireTime) const >+Optional<MonotonicTime> DOMTimer::alignedFireTime(MonotonicTime fireTime) const > { > Seconds alignmentInterval = scriptExecutionContext()->domTimerAlignmentInterval(m_nestingLevel >= maxTimerNestingLevel); > if (!alignmentInterval) >- return std::nullopt; >+ return WTF::nullopt; > > static const double randomizedProportion = randomNumber(); > >diff --git a/Source/WebCore/page/DOMTimer.h b/Source/WebCore/page/DOMTimer.h >index 0d76539fdda8792cba5dc5cfc8e2eb7b4592b688..943865763da0a42948caaedcfe4badafc4d877d5 100644 >--- a/Source/WebCore/page/DOMTimer.h >+++ b/Source/WebCore/page/DOMTimer.h >@@ -75,7 +75,7 @@ private: > // SuspendableTimer > void fired() override; > void didStop() override; >- WEBCORE_EXPORT std::optional<MonotonicTime> alignedFireTime(MonotonicTime) const override; >+ WEBCORE_EXPORT Optional<MonotonicTime> alignedFireTime(MonotonicTime) const override; > > // ActiveDOMObject API. > const char* activeDOMObjectName() const override; >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index 2772950454b30b852284d6ceb5156227b6a97de2..5fac87a5cfc8a7aaf02802d8efa51a5ab0d8296c 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -162,7 +162,7 @@ public: > > Ref<MessageEvent> event(ScriptExecutionContext& context) > { >- return MessageEvent::create(MessagePort::entanglePorts(context, WTFMove(m_message.transferredPorts)), m_message.message.releaseNonNull(), m_origin, { }, m_source ? std::make_optional(MessageEventSource(WTFMove(m_source))) : std::nullopt); >+ return MessageEvent::create(MessagePort::entanglePorts(context, WTFMove(m_message.transferredPorts)), m_message.message.releaseNonNull(), m_origin, { }, m_source ? makeOptional(MessageEventSource(WTFMove(m_source))) : WTF::nullopt); > } > > SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } >diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h >index fd8a5093f3cd06da6bca45722f8402a8db9eb485..effd3f7ecaeedf5081964212a05c422215c3f5c8 100644 >--- a/Source/WebCore/page/DOMWindow.h >+++ b/Source/WebCore/page/DOMWindow.h >@@ -362,7 +362,7 @@ private: > > bool m_shouldPrintWhenFinishedLoading { false }; > bool m_suspendedForDocumentSuspension { false }; >- std::optional<bool> m_canShowModalDialogOverride; >+ Optional<bool> m_canShowModalDialogOverride; > > HashSet<DOMWindowProperty*> m_properties; > >diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp >index 4bb304448b67ebc88387d916f49e1c1ce3e15209..b02a507bf7c0f65be75b359b12d906eaa3693237 100644 >--- a/Source/WebCore/page/DragController.cpp >+++ b/Source/WebCore/page/DragController.cpp >@@ -245,7 +245,7 @@ inline static bool dragIsHandledByDocument(DragHandlingMethod dragHandlingMethod > bool DragController::performDragOperation(const DragData& dragData) > { > SetForScope<bool> isPerformingDrop(m_isPerformingDrop, true); >- TemporarySelectionChange ignoreSelectionChanges(m_page.focusController().focusedOrMainFrame(), std::nullopt, TemporarySelectionOption::IgnoreSelectionChanges); >+ TemporarySelectionChange ignoreSelectionChanges(m_page.focusController().focusedOrMainFrame(), WTF::nullopt, TemporarySelectionOption::IgnoreSelectionChanges); > > m_documentUnderMouse = m_page.mainFrame().documentAtPoint(dragData.clientPosition()); > >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 6d141eafdafaca72378a1e34cc9b8eeb2531c1d3..7942a0dbe0ba67e412731642cce07703c64ab109 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -1405,17 +1405,17 @@ void EventHandler::updateCursor(FrameView& view, const HitTestResult& result, bo > } > } > >-std::optional<Cursor> EventHandler::selectCursor(const HitTestResult& result, bool shiftKey) >+Optional<Cursor> EventHandler::selectCursor(const HitTestResult& result, bool shiftKey) > { > if (m_resizeLayer && m_resizeLayer->inResizeMode()) >- return std::nullopt; >+ return WTF::nullopt; > > if (!m_frame.page()) >- return std::nullopt; >+ return WTF::nullopt; > > #if ENABLE(PAN_SCROLLING) > if (m_frame.mainFrame().eventHandler().panScrollInProgress()) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > Ref<Frame> protectedFrame(m_frame); >@@ -1430,7 +1430,7 @@ std::optional<Cursor> EventHandler::selectCursor(const HitTestResult& result, bo > > Node* node = result.targetNode(); > if (!node) >- return std::nullopt; >+ return WTF::nullopt; > > auto renderer = node->renderer(); > auto* style = renderer ? &renderer->style() : nullptr; >@@ -1452,7 +1452,7 @@ std::optional<Cursor> EventHandler::selectCursor(const HitTestResult& result, bo > case SetCursor: > return overrideCursor; > case DoNotSetCursor: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -2330,7 +2330,7 @@ EventHandler::DragTargetResponse EventHandler::dispatchDragEnterOrDragOverEvent( > dataTransfer->makeInvalidForSecurity(); > if (accept && !dataTransfer->dropEffectIsUninitialized()) > return { true, dataTransfer->destinationOperation() }; >- return { accept, std::nullopt }; >+ return { accept, WTF::nullopt }; > } > > EventHandler::DragTargetResponse EventHandler::updateDragAndDrop(const PlatformMouseEvent& event, const std::function<std::unique_ptr<Pasteboard>()>& makePasteboard, DragOperation sourceOperation, bool draggingFiles) >diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h >index 92fbc5afcf88eb204440492012cc9da8406bb429..563496122de1eb5d0bf1dc8e6f89ea926cb267e7 100644 >--- a/Source/WebCore/page/EventHandler.h >+++ b/Source/WebCore/page/EventHandler.h >@@ -162,7 +162,7 @@ public: > #if ENABLE(DRAG_SUPPORT) > struct DragTargetResponse { > bool accept { false }; >- std::optional<DragOperation> operation; >+ Optional<DragOperation> operation; > }; > DragTargetResponse updateDragAndDrop(const PlatformMouseEvent&, const std::function<std::unique_ptr<Pasteboard>()>&, DragOperation sourceOperation, bool draggingFiles); > void cancelDragAndDrop(const PlatformMouseEvent&, std::unique_ptr<Pasteboard>&&, DragOperation, bool draggingFiles); >@@ -369,7 +369,7 @@ private: > > bool internalKeyEvent(const PlatformKeyboardEvent&); > >- std::optional<Cursor> selectCursor(const HitTestResult&, bool shiftKey); >+ Optional<Cursor> selectCursor(const HitTestResult&, bool shiftKey); > void updateCursor(FrameView&, const HitTestResult&, bool shiftKey); > > void hoverTimerFired(); >diff --git a/Source/WebCore/page/EventSource.cpp b/Source/WebCore/page/EventSource.cpp >index 30859ebb0572a30a15e337f602add023853b3a06..d1325135322eaab3ada81e7b7b6e772257c4cfc1 100644 >--- a/Source/WebCore/page/EventSource.cpp >+++ b/Source/WebCore/page/EventSource.cpp >@@ -278,8 +278,8 @@ void EventSource::parseEventStream() > m_discardTrailingNewline = false; > } > >- std::optional<unsigned> lineLength; >- std::optional<unsigned> fieldLength; >+ Optional<unsigned> lineLength; >+ Optional<unsigned> fieldLength; > for (unsigned i = position; !lineLength && i < size; ++i) { > switch (m_receiveBuffer[i]) { > case ':': >@@ -315,7 +315,7 @@ void EventSource::parseEventStream() > m_receiveBuffer.remove(0, position); > } > >-void EventSource::parseEventStreamLine(unsigned position, std::optional<unsigned> fieldLength, unsigned lineLength) >+void EventSource::parseEventStreamLine(unsigned position, Optional<unsigned> fieldLength, unsigned lineLength) > { > if (!lineLength) { > if (!m_data.isEmpty()) >diff --git a/Source/WebCore/page/EventSource.h b/Source/WebCore/page/EventSource.h >index 58a4c38749e950b478cf87068a2639310adef09a..95602b703bc1ffb030b8ca30e7d495fd676e9683 100644 >--- a/Source/WebCore/page/EventSource.h >+++ b/Source/WebCore/page/EventSource.h >@@ -94,7 +94,7 @@ private: > void scheduleReconnect(); > void abortConnectionAttempt(); > void parseEventStream(); >- void parseEventStreamLine(unsigned position, std::optional<unsigned> fieldLength, unsigned lineLength); >+ void parseEventStreamLine(unsigned position, Optional<unsigned> fieldLength, unsigned lineLength); > void dispatchMessageEvent(); > > bool responseIsValid(const ResourceResponse&) const; >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index edd1ceb2144d055e52e42ea2f3bd628dc5d1f83d..4542f0bf7549562700a6b62c1bcd51f6dde414db 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -390,7 +390,7 @@ void FrameView::detachCustomScrollbars() > void FrameView::recalculateScrollbarOverlayStyle() > { > ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); >- std::optional<ScrollbarOverlayStyle> clientOverlayStyle = frame().page() ? frame().page()->chrome().client().preferredScrollbarOverlayStyle() : ScrollbarOverlayStyleDefault; >+ Optional<ScrollbarOverlayStyle> clientOverlayStyle = frame().page() ? frame().page()->chrome().client().preferredScrollbarOverlayStyle() : ScrollbarOverlayStyleDefault; > if (clientOverlayStyle) { > if (clientOverlayStyle.value() != oldOverlayStyle) > setScrollbarOverlayStyle(clientOverlayStyle.value()); >@@ -1659,7 +1659,7 @@ void FrameView::setBaseLayoutViewportOrigin(LayoutPoint origin, TriggerLayoutOrN > } > } > >-void FrameView::setLayoutViewportOverrideRect(std::optional<LayoutRect> rect, TriggerLayoutOrNot layoutTriggering) >+void FrameView::setLayoutViewportOverrideRect(Optional<LayoutRect> rect, TriggerLayoutOrNot layoutTriggering) > { > if (rect == m_layoutViewportOverrideRect) > return; >@@ -1677,7 +1677,7 @@ void FrameView::setLayoutViewportOverrideRect(std::optional<LayoutRect> rect, Tr > setViewportConstrainedObjectsNeedLayout(); > } > >-void FrameView::setVisualViewportOverrideRect(std::optional<LayoutRect> rect) >+void FrameView::setVisualViewportOverrideRect(Optional<LayoutRect> rect) > { > m_visualViewportOverrideRect = rect; > } >@@ -4566,7 +4566,7 @@ void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const In > setNeedsLayout(); > layoutContext().scheduleLayout(); > if (m_shouldAutoSize) { >- overrideViewportSizeForCSSViewportUnits({ minSize.width(), m_overrideViewportSize ? m_overrideViewportSize->height : std::nullopt }); >+ overrideViewportSizeForCSSViewportUnits({ minSize.width(), m_overrideViewportSize ? m_overrideViewportSize->height : WTF::nullopt }); > return; > } > >@@ -4820,30 +4820,30 @@ IntPoint FrameView::convertFromContainingView(const IntPoint& parentPoint) const > return parentPoint; > } > >-float FrameView::documentToAbsoluteScaleFactor(std::optional<float> effectiveZoom) const >+float FrameView::documentToAbsoluteScaleFactor(Optional<float> effectiveZoom) const > { > // If effectiveZoom is passed, it already factors in pageZoomFactor(). > return effectiveZoom.value_or(frame().pageZoomFactor()) * frame().frameScaleFactor(); > } > >-float FrameView::absoluteToDocumentScaleFactor(std::optional<float> effectiveZoom) const >+float FrameView::absoluteToDocumentScaleFactor(Optional<float> effectiveZoom) const > { > // If effectiveZoom is passed, it already factors in pageZoomFactor(). > return 1 / documentToAbsoluteScaleFactor(effectiveZoom); > } > >-FloatRect FrameView::absoluteToDocumentRect(FloatRect rect, std::optional<float> effectiveZoom) const >+FloatRect FrameView::absoluteToDocumentRect(FloatRect rect, Optional<float> effectiveZoom) const > { > rect.scale(absoluteToDocumentScaleFactor(effectiveZoom)); > return rect; > } > >-FloatPoint FrameView::absoluteToDocumentPoint(FloatPoint p, std::optional<float> effectiveZoom) const >+FloatPoint FrameView::absoluteToDocumentPoint(FloatPoint p, Optional<float> effectiveZoom) const > { > return p.scaled(absoluteToDocumentScaleFactor(effectiveZoom)); > } > >-FloatRect FrameView::absoluteToClientRect(FloatRect rect, std::optional<float> effectiveZoom) const >+FloatRect FrameView::absoluteToClientRect(FloatRect rect, Optional<float> effectiveZoom) const > { > return documentToClientRect(absoluteToDocumentRect(rect, effectiveZoom)); > } >@@ -5303,7 +5303,7 @@ void FrameView::notifyWidgets(WidgetNotification notification) > widget->notifyWidget(notification); > } > >-void FrameView::setViewExposedRect(std::optional<FloatRect> viewExposedRect) >+void FrameView::setViewExposedRect(Optional<FloatRect> viewExposedRect) > { > if (m_viewExposedRect == viewExposedRect) > return; >@@ -5336,7 +5336,7 @@ void FrameView::clearViewportSizeOverrideForCSSViewportUnits() > if (!m_overrideViewportSize) > return; > >- m_overrideViewportSize = std::nullopt; >+ m_overrideViewportSize = WTF::nullopt; > if (auto* document = frame().document()) > document->styleScope().didChangeStyleSheetEnvironment(); > } >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index bc993a8ec6c284863880fdd29a27f01c315a5eb0..4f980094c08642fe8b2fe9e6b7bbacac4ae92bad 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -257,9 +257,9 @@ public: > > // If set, overrides the default "m_layoutViewportOrigin, size of initial containing block" rect. > // Used with delegated scrolling (i.e. iOS). >- WEBCORE_EXPORT void setLayoutViewportOverrideRect(std::optional<LayoutRect>, TriggerLayoutOrNot = TriggerLayoutOrNot::Yes); >+ WEBCORE_EXPORT void setLayoutViewportOverrideRect(Optional<LayoutRect>, TriggerLayoutOrNot = TriggerLayoutOrNot::Yes); > >- WEBCORE_EXPORT void setVisualViewportOverrideRect(std::optional<LayoutRect>); >+ WEBCORE_EXPORT void setVisualViewportOverrideRect(Optional<LayoutRect>); > > // These are in document coordinates, unaffected by page scale (but affected by zooming). > WEBCORE_EXPORT LayoutRect layoutViewportRect() const; >@@ -470,13 +470,13 @@ public: > IntPoint convertToContainingView(const IntPoint&) const final; > IntPoint convertFromContainingView(const IntPoint&) const final; > >- float documentToAbsoluteScaleFactor(std::optional<float> effectiveZoom = std::nullopt) const; >- float absoluteToDocumentScaleFactor(std::optional<float> effectiveZoom = std::nullopt) const; >+ float documentToAbsoluteScaleFactor(Optional<float> effectiveZoom = WTF::nullopt) const; >+ float absoluteToDocumentScaleFactor(Optional<float> effectiveZoom = WTF::nullopt) const; > >- FloatRect absoluteToDocumentRect(FloatRect, std::optional<float> effectiveZoom = std::nullopt) const; >- FloatPoint absoluteToDocumentPoint(FloatPoint, std::optional<float> effectiveZoom = std::nullopt) const; >+ FloatRect absoluteToDocumentRect(FloatRect, Optional<float> effectiveZoom = WTF::nullopt) const; >+ FloatPoint absoluteToDocumentPoint(FloatPoint, Optional<float> effectiveZoom = WTF::nullopt) const; > >- FloatRect absoluteToClientRect(FloatRect, std::optional<float> effectiveZoom = std::nullopt) const; >+ FloatRect absoluteToClientRect(FloatRect, Optional<float> effectiveZoom = WTF::nullopt) const; > > FloatSize documentToClientOffset() const; > FloatRect documentToClientRect(FloatRect) const; >@@ -622,8 +622,8 @@ public: > // of the view is actually exposed on screen (taking into account > // clipping by other UI elements), whereas visibleContentRect is > // internal to WebCore and doesn't respect those things. >- WEBCORE_EXPORT void setViewExposedRect(std::optional<FloatRect>); >- std::optional<FloatRect> viewExposedRect() const { return m_viewExposedRect; } >+ WEBCORE_EXPORT void setViewExposedRect(Optional<FloatRect>); >+ Optional<FloatRect> viewExposedRect() const { return m_viewExposedRect; } > > #if ENABLE(CSS_SCROLL_SNAP) > void updateSnapOffsets() final; >@@ -801,8 +801,8 @@ private: > void didLayout(WeakPtr<RenderElement> layoutRoot); > > struct OverrideViewportSize { >- std::optional<int> width; >- std::optional<int> height; >+ Optional<int> width; >+ Optional<int> height; > > bool operator==(const OverrideViewportSize& rhs) const { return rhs.width == width && rhs.height == height; } > }; >@@ -863,11 +863,11 @@ private: > > bool m_shouldUpdateWhileOffscreen; > >- std::optional<FloatRect> m_viewExposedRect; >+ Optional<FloatRect> m_viewExposedRect; > > LayoutPoint m_layoutViewportOrigin; >- std::optional<LayoutRect> m_layoutViewportOverrideRect; >- std::optional<LayoutRect> m_visualViewportOverrideRect; // Used when the iOS keyboard is showing. >+ Optional<LayoutRect> m_layoutViewportOverrideRect; >+ Optional<LayoutRect> m_visualViewportOverrideRect; // Used when the iOS keyboard is showing. > > RefPtr<Node> m_nodeToDraw; > OptionSet<PaintBehavior> m_paintBehavior; >@@ -900,7 +900,7 @@ private: > IntSize m_customSizeForResizeEvent; > #endif > >- std::optional<OverrideViewportSize> m_overrideViewportSize; >+ Optional<OverrideViewportSize> m_overrideViewportSize; > > // If true, automatically resize the frame view around its content. > bool m_shouldAutoSize; >diff --git a/Source/WebCore/page/GlobalFrameIdentifier.h b/Source/WebCore/page/GlobalFrameIdentifier.h >index 536ee37dfca6354244a586a3461294d4c2c35799..156c9cd205d4cf324d681f976132c16ce2f174d4 100644 >--- a/Source/WebCore/page/GlobalFrameIdentifier.h >+++ b/Source/WebCore/page/GlobalFrameIdentifier.h >@@ -35,7 +35,7 @@ struct GlobalFrameIdentifier { > uint64_t frameID; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<GlobalFrameIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<GlobalFrameIdentifier> decode(Decoder&); > }; > > template<class Encoder> >@@ -45,17 +45,17 @@ void GlobalFrameIdentifier::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<GlobalFrameIdentifier> GlobalFrameIdentifier::decode(Decoder& decoder) >+Optional<GlobalFrameIdentifier> GlobalFrameIdentifier::decode(Decoder& decoder) > { >- std::optional<uint64_t> pageID; >+ Optional<uint64_t> pageID; > decoder >> pageID; > if (!pageID) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> frameID; >+ Optional<uint64_t> frameID; > decoder >> frameID; > if (!frameID) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*pageID), WTFMove(*frameID) } }; > } >diff --git a/Source/WebCore/page/GlobalWindowIdentifier.h b/Source/WebCore/page/GlobalWindowIdentifier.h >index 215a74616cc6ff64a17da01de9e1de3a8678f4f1..2a56b490b3f24554acb0795a61ab1166108d50e9 100644 >--- a/Source/WebCore/page/GlobalWindowIdentifier.h >+++ b/Source/WebCore/page/GlobalWindowIdentifier.h >@@ -42,7 +42,7 @@ struct GlobalWindowIdentifier { > unsigned hash() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<GlobalWindowIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<GlobalWindowIdentifier> decode(Decoder&); > }; > > inline bool operator==(const GlobalWindowIdentifier& a, const GlobalWindowIdentifier& b) >@@ -66,17 +66,17 @@ void GlobalWindowIdentifier::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<GlobalWindowIdentifier> GlobalWindowIdentifier::decode(Decoder& decoder) >+Optional<GlobalWindowIdentifier> GlobalWindowIdentifier::decode(Decoder& decoder) > { >- std::optional<ProcessIdentifier> processIdentifier; >+ Optional<ProcessIdentifier> processIdentifier; > decoder >> processIdentifier; > if (!processIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WindowIdentifier> windowIdentifier; >+ Optional<WindowIdentifier> windowIdentifier; > decoder >> windowIdentifier; > if (!windowIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*processIdentifier), WTFMove(*windowIdentifier) } }; > } >diff --git a/Source/WebCore/page/IntersectionObserver.cpp b/Source/WebCore/page/IntersectionObserver.cpp >index 0b4ef288b36f9b71cd66c3bf6a0515e3911bccb5..4313beaf08093c31ce24e91cad7830397d9a4852 100644 >--- a/Source/WebCore/page/IntersectionObserver.cpp >+++ b/Source/WebCore/page/IntersectionObserver.cpp >@@ -150,7 +150,7 @@ void IntersectionObserver::observe(Element& target) > if (!trackingDocument() || !m_callback || m_observationTargets.contains(&target)) > return; > >- target.ensureIntersectionObserverData().registrations.append({ makeWeakPtr(this), std::nullopt }); >+ target.ensureIntersectionObserverData().registrations.append({ makeWeakPtr(this), WTF::nullopt }); > bool hadObservationTargets = hasObservationTargets(); > m_observationTargets.append(&target); > auto* document = trackingDocument(); >diff --git a/Source/WebCore/page/IntersectionObserver.h b/Source/WebCore/page/IntersectionObserver.h >index faf30fda0bccecb17ab0a5423bf1790ce974c621..570227c5d20b974415349e0e50c60435df56a395 100644 >--- a/Source/WebCore/page/IntersectionObserver.h >+++ b/Source/WebCore/page/IntersectionObserver.h >@@ -44,7 +44,7 @@ class Element; > > struct IntersectionObserverRegistration { > WeakPtr<IntersectionObserver> observer; >- std::optional<size_t> previousThresholdIndex; >+ Optional<size_t> previousThresholdIndex; > }; > > struct IntersectionObserverData { >diff --git a/Source/WebCore/page/IntersectionObserverEntry.h b/Source/WebCore/page/IntersectionObserverEntry.h >index b799642684c4719628614145bc7a83ca3e9db5d3..f703b2f9b21c1dc91af96095cb9d4d4cb5bf0478 100644 >--- a/Source/WebCore/page/IntersectionObserverEntry.h >+++ b/Source/WebCore/page/IntersectionObserverEntry.h >@@ -43,7 +43,7 @@ public: > > struct Init { > double time; >- std::optional<DOMRectInit> rootBounds; >+ Optional<DOMRectInit> rootBounds; > DOMRectInit boundingClientRect; > DOMRectInit intersectionRect; > double intersectionRatio; >diff --git a/Source/WebCore/page/Navigator.cpp b/Source/WebCore/page/Navigator.cpp >index a40fd22670f3f64197aabe7b4c375716b7404804..e184f80658aa039cca92750a3c0666d73e5a05d3 100644 >--- a/Source/WebCore/page/Navigator.cpp >+++ b/Source/WebCore/page/Navigator.cpp >@@ -119,7 +119,7 @@ void Navigator::share(ScriptExecutionContext& context, ShareData data, Ref<Defer > return; > } > >- std::optional<URL> url; >+ Optional<URL> url; > if (!data.url.isEmpty()) { > url = context.completeURL(data.url); > if (!url->isValid()) { >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index ac40b80e2c958a7f6fa7be563b9807ce1e23ac09..e7251ee1a15fe2e1d803fece598e4c3bf2c63ba6 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -602,7 +602,7 @@ bool Page::showAllPlugins() const > return false; > } > >-inline std::optional<std::pair<MediaCanStartListener&, Document&>> Page::takeAnyMediaCanStartListener() >+inline Optional<std::pair<MediaCanStartListener&, Document&>> Page::takeAnyMediaCanStartListener() > { > for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { > if (!frame->document()) >@@ -610,7 +610,7 @@ inline std::optional<std::pair<MediaCanStartListener&, Document&>> Page::takeAn > if (MediaCanStartListener* listener = frame->document()->takeAnyMediaCanStartListener()) > return { { *listener, *frame->document() } }; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > void Page::setCanStartMedia(bool canStartMedia) >@@ -1125,7 +1125,7 @@ bool Page::isLowPowerModeEnabled() const > return m_lowPowerModeNotifier->isLowPowerModeEnabled(); > } > >-void Page::setLowPowerModeEnabledOverrideForTesting(std::optional<bool> isEnabled) >+void Page::setLowPowerModeEnabledOverrideForTesting(Optional<bool> isEnabled) > { > m_lowPowerModeEnabledOverrideForTesting = isEnabled; > handleLowModePowerChange(m_lowPowerModeEnabledOverrideForTesting.value_or(false)); >@@ -1347,7 +1347,7 @@ void Page::userStyleSheetLocationChanged() > > m_didLoadUserStyleSheet = false; > m_userStyleSheet = String(); >- m_userStyleSheetModificationTime = std::nullopt; >+ m_userStyleSheetModificationTime = WTF::nullopt; > > // Data URLs with base64-encoded UTF-8 style sheets are common. We can process them > // synchronously and avoid using a loader. >@@ -1871,7 +1871,7 @@ void Page::setIsVisibleInternal(bool isVisible) > > if (m_navigationToLogWhenVisible) { > logNavigation(m_navigationToLogWhenVisible.value()); >- m_navigationToLogWhenVisible = std::nullopt; >+ m_navigationToLogWhenVisible = WTF::nullopt; > } > } > >@@ -2337,7 +2337,7 @@ void Page::mainFrameLoadStarted(const URL& destinationURL, FrameLoadType type) > return; > } > >- m_navigationToLogWhenVisible = std::nullopt; >+ m_navigationToLogWhenVisible = WTF::nullopt; > logNavigation(navigation); > } > >@@ -2645,7 +2645,7 @@ bool Page::useDarkAppearance() const > return m_useDarkAppearance; > } > >-void Page::setUseDarkAppearanceOverride(std::optional<bool> valueOverride) >+void Page::setUseDarkAppearanceOverride(Optional<bool> valueOverride) > { > if (valueOverride == m_useDarkAppearanceOverride) > return; >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index d656f1e83effa14c58d572a18bbafbf7197d0e45..b5b7f59f8a1be222547835592fa9cc069a3b36a0 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -360,7 +360,7 @@ public: > WEBCORE_EXPORT bool useDarkAppearance() const; > WEBCORE_EXPORT void setUseDarkAppearance(bool); > bool defaultUseDarkAppearance() const { return m_useDarkAppearance; } >- void setUseDarkAppearanceOverride(std::optional<bool>); >+ void setUseDarkAppearanceOverride(Optional<bool>); > > #if ENABLE(TEXT_AUTOSIZING) > float textAutosizingWidth() const { return m_textAutosizingWidth; } >@@ -426,7 +426,7 @@ public: > #endif > > #if ENABLE(APPLICATION_MANIFEST) >- const std::optional<ApplicationManifest>& applicationManifest() const { return m_applicationManifest; } >+ const Optional<ApplicationManifest>& applicationManifest() const { return m_applicationManifest; } > #endif > > // Notifications when the Page starts and stops being presented via a native window. >@@ -656,11 +656,11 @@ public: > // Web Inspector can override whatever value is set via WebKit SPI, but only while it is open. > void setResourceCachingDisabledOverride(bool disabled) { m_resourceCachingDisabledOverride = disabled; } > >- std::optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const { return m_eventThrottlingBehaviorOverride; } >- void setEventThrottlingBehaviorOverride(std::optional<EventThrottlingBehavior> throttling) { m_eventThrottlingBehaviorOverride = throttling; } >+ Optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const { return m_eventThrottlingBehaviorOverride; } >+ void setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior> throttling) { m_eventThrottlingBehaviorOverride = throttling; } > >- std::optional<CompositingPolicy> compositingPolicyOverride() const { return m_compositingPolicyOverride; } >- void setCompositingPolicyOverride(std::optional<CompositingPolicy> policy) { m_compositingPolicyOverride = policy; } >+ Optional<CompositingPolicy> compositingPolicyOverride() const { return m_compositingPolicyOverride; } >+ void setCompositingPolicyOverride(Optional<CompositingPolicy> policy) { m_compositingPolicyOverride = policy; } > > WebGLStateTracker* webGLStateTracker() const { return m_webGLStateTracker.get(); } > >@@ -672,7 +672,7 @@ public: > #endif > > bool isLowPowerModeEnabled() const; >- WEBCORE_EXPORT void setLowPowerModeEnabledOverrideForTesting(std::optional<bool>); >+ WEBCORE_EXPORT void setLowPowerModeEnabledOverrideForTesting(Optional<bool>); > > WEBCORE_EXPORT void applicationWillResignActive(); > WEBCORE_EXPORT void applicationDidEnterBackground(); >@@ -705,7 +705,7 @@ private: > > unsigned findMatchesForText(const String&, FindOptions, unsigned maxMatchCount, ShouldHighlightMatches, ShouldMarkMatches); > >- std::optional<std::pair<MediaCanStartListener&, Document&>> takeAnyMediaCanStartListener(); >+ Optional<std::pair<MediaCanStartListener&, Document&>> takeAnyMediaCanStartListener(); > > #if ENABLE(VIDEO) > void playbackControlsManagerUpdateTimerFired(); >@@ -794,7 +794,7 @@ private: > > bool m_useSystemAppearance { false }; > bool m_useDarkAppearance { false }; >- std::optional<bool> m_useDarkAppearanceOverride; >+ Optional<bool> m_useDarkAppearanceOverride; > > #if ENABLE(TEXT_AUTOSIZING) > float m_textAutosizingWidth { 0 }; >@@ -811,7 +811,7 @@ private: > String m_userStyleSheetPath; > mutable String m_userStyleSheet; > mutable bool m_didLoadUserStyleSheet { false }; >- mutable std::optional<WallTime> m_userStyleSheetModificationTime; >+ mutable Optional<WallTime> m_userStyleSheetModificationTime; > > String m_captionUserPreferencesStyleSheet; > >@@ -912,14 +912,14 @@ private: > UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { UserInterfaceLayoutDirection::LTR }; > > // For testing. >- std::optional<EventThrottlingBehavior> m_eventThrottlingBehaviorOverride; >- std::optional<CompositingPolicy> m_compositingPolicyOverride; >+ Optional<EventThrottlingBehavior> m_eventThrottlingBehaviorOverride; >+ Optional<CompositingPolicy> m_compositingPolicyOverride; > > std::unique_ptr<PerformanceMonitor> m_performanceMonitor; > std::unique_ptr<LowPowerModeNotifier> m_lowPowerModeNotifier; >- std::optional<bool> m_lowPowerModeEnabledOverrideForTesting; >+ Optional<bool> m_lowPowerModeEnabledOverrideForTesting; > >- std::optional<Navigation> m_navigationToLogWhenVisible; >+ Optional<Navigation> m_navigationToLogWhenVisible; > > std::unique_ptr<PerformanceLogging> m_performanceLogging; > #if PLATFORM(MAC) >@@ -941,7 +941,7 @@ private: > #endif > > #if ENABLE(APPLICATION_MANIFEST) >- std::optional<ApplicationManifest> m_applicationManifest; >+ Optional<ApplicationManifest> m_applicationManifest; > #endif > > bool m_shouldEnableICECandidateFilteringByDefault { true }; >diff --git a/Source/WebCore/page/PageConfiguration.h b/Source/WebCore/page/PageConfiguration.h >index 18a7723310055915ce8e06414298ae648f2cd176..f160f97e5508b2cf8427833502eddfe8f320d025 100644 >--- a/Source/WebCore/page/PageConfiguration.h >+++ b/Source/WebCore/page/PageConfiguration.h >@@ -87,7 +87,7 @@ public: > #endif > > #if ENABLE(APPLICATION_MANIFEST) >- std::optional<ApplicationManifest> applicationManifest; >+ Optional<ApplicationManifest> applicationManifest; > #endif > > UniqueRef<LibWebRTCProvider> libWebRTCProvider; >diff --git a/Source/WebCore/page/PerformanceEntry.cpp b/Source/WebCore/page/PerformanceEntry.cpp >index 7fc81ab1be9f8d68395ddb16cc0a27680a20a42a..1c601b7ab8ae6bcc268fba27df64459da3c93e77 100644 >--- a/Source/WebCore/page/PerformanceEntry.cpp >+++ b/Source/WebCore/page/PerformanceEntry.cpp >@@ -46,24 +46,24 @@ PerformanceEntry::PerformanceEntry(Type type, const String& name, const String& > > PerformanceEntry::~PerformanceEntry() = default; > >-std::optional<PerformanceEntry::Type> PerformanceEntry::parseEntryTypeString(const String& entryType) >+Optional<PerformanceEntry::Type> PerformanceEntry::parseEntryTypeString(const String& entryType) > { > if (entryType == "navigation") >- return std::optional<Type>(Type::Navigation); >+ return Optional<Type>(Type::Navigation); > > if (RuntimeEnabledFeatures::sharedFeatures().userTimingEnabled()) { > if (entryType == "mark") >- return std::optional<Type>(Type::Mark); >+ return Optional<Type>(Type::Mark); > if (entryType == "measure") >- return std::optional<Type>(Type::Measure); >+ return Optional<Type>(Type::Measure); > } > > if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) { > if (entryType == "resource") >- return std::optional<Type>(Type::Resource); >+ return Optional<Type>(Type::Resource); > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WebCore >diff --git a/Source/WebCore/page/PerformanceEntry.h b/Source/WebCore/page/PerformanceEntry.h >index 918aa18f591d6b43077872c0ce73d3f3c45e93d2..79db42053eff8d7a2da9fc9921694b5cac8cc0c2 100644 >--- a/Source/WebCore/page/PerformanceEntry.h >+++ b/Source/WebCore/page/PerformanceEntry.h >@@ -56,7 +56,7 @@ public: > > Type type() const { return m_type; } > >- static std::optional<Type> parseEntryTypeString(const String& entryType); >+ static Optional<Type> parseEntryTypeString(const String& entryType); > > bool isResource() const { return m_type == Type::Resource; } > bool isMark() const { return m_type == Type::Mark; } >diff --git a/Source/WebCore/page/PerformanceLogging.cpp b/Source/WebCore/page/PerformanceLogging.cpp >index a875fdb71ddee87149efc886a520667e57793dcf..b904c23edbeac7412f09b0c33b59ca1fcb27017d 100644 >--- a/Source/WebCore/page/PerformanceLogging.cpp >+++ b/Source/WebCore/page/PerformanceLogging.cpp >@@ -105,7 +105,7 @@ void PerformanceLogging::didReachPointOfInterest(PointOfInterest poi) > > #if !PLATFORM(COCOA) > void PerformanceLogging::getPlatformMemoryUsageStatistics(HashMap<const char*, size_t>&) { } >-std::optional<uint64_t> PerformanceLogging::physicalFootprint() { return std::nullopt; } >+Optional<uint64_t> PerformanceLogging::physicalFootprint() { return WTF::nullopt; } > #endif > > } >diff --git a/Source/WebCore/page/PerformanceLogging.h b/Source/WebCore/page/PerformanceLogging.h >index 32b4c0e9a1e121829dab6fbcec089cabdd699904..6a85c13af8d918916b21eb5f5151b7069d25b8b1 100644 >--- a/Source/WebCore/page/PerformanceLogging.h >+++ b/Source/WebCore/page/PerformanceLogging.h >@@ -49,7 +49,7 @@ public: > > WEBCORE_EXPORT static HashCountedSet<const char*> javaScriptObjectCounts(); > WEBCORE_EXPORT static HashMap<const char*, size_t> memoryUsageStatistics(ShouldIncludeExpensiveComputations); >- WEBCORE_EXPORT static std::optional<uint64_t> physicalFootprint(); >+ WEBCORE_EXPORT static Optional<uint64_t> physicalFootprint(); > > private: > static void getPlatformMemoryUsageStatistics(HashMap<const char*, size_t>&); >diff --git a/Source/WebCore/page/PerformanceMonitor.cpp b/Source/WebCore/page/PerformanceMonitor.cpp >index ab5c35039d83303e657d31f432f92ba6618abd84..5ec505f71899cbb43518403225d26f126dd5ed03 100644 >--- a/Source/WebCore/page/PerformanceMonitor.cpp >+++ b/Source/WebCore/page/PerformanceMonitor.cpp >@@ -83,7 +83,7 @@ PerformanceMonitor::PerformanceMonitor(Page& page) > > void PerformanceMonitor::didStartProvisionalLoad() > { >- m_postLoadCPUTime = std::nullopt; >+ m_postLoadCPUTime = WTF::nullopt; > m_postPageLoadCPUUsageTimer.stop(); > m_postPageLoadMemoryUsageTimer.stop(); > } >@@ -92,7 +92,7 @@ void PerformanceMonitor::didFinishLoad() > { > // Only do post-load CPU usage measurement if there is a single Page in the process in order to reduce noise. > if (DeprecatedGlobalSettings::isPostLoadCPUUsageMeasurementEnabled() && m_page.isOnlyNonUtilityPage()) { >- m_postLoadCPUTime = std::nullopt; >+ m_postLoadCPUTime = WTF::nullopt; > m_postPageLoadCPUUsageTimer.startOneShot(cpuUsageMeasurementDelay); > } > >@@ -108,7 +108,7 @@ void PerformanceMonitor::activityStateChanged(OptionSet<ActivityState::Flag> old > > // Measure CPU usage of pages when they are no longer visible. > if (DeprecatedGlobalSettings::isPostBackgroundingCPUUsageMeasurementEnabled() && visibilityChanged) { >- m_postBackgroundingCPUTime = std::nullopt; >+ m_postBackgroundingCPUTime = WTF::nullopt; > if (newState & ActivityState::IsVisible) > m_postBackgroundingCPUUsageTimer.stop(); > else if (m_page.isOnlyNonUtilityPage()) >@@ -169,7 +169,7 @@ static void reportPageOverPostLoadResourceThreshold(Page& page, ReportingReason > void PerformanceMonitor::measurePostLoadCPUUsage() > { > if (!m_page.isOnlyNonUtilityPage()) { >- m_postLoadCPUTime = std::nullopt; >+ m_postLoadCPUTime = WTF::nullopt; > return; > } > >@@ -179,7 +179,7 @@ void PerformanceMonitor::measurePostLoadCPUUsage() > m_postPageLoadCPUUsageTimer.startOneShot(postLoadCPUUsageMeasurementDuration); > return; > } >- std::optional<CPUTime> cpuTime = CPUTime::get(); >+ Optional<CPUTime> cpuTime = CPUTime::get(); > if (!cpuTime) > return; > >@@ -196,7 +196,7 @@ void PerformanceMonitor::measurePostLoadMemoryUsage() > if (!m_page.isOnlyNonUtilityPage()) > return; > >- std::optional<uint64_t> memoryUsage = PerformanceLogging::physicalFootprint(); >+ Optional<uint64_t> memoryUsage = PerformanceLogging::physicalFootprint(); > if (!memoryUsage) > return; > >@@ -215,7 +215,7 @@ void PerformanceMonitor::measurePostBackgroundingMemoryUsage() > if (!m_page.isOnlyNonUtilityPage()) > return; > >- std::optional<uint64_t> memoryUsage = PerformanceLogging::physicalFootprint(); >+ Optional<uint64_t> memoryUsage = PerformanceLogging::physicalFootprint(); > if (!memoryUsage) > return; > >@@ -226,7 +226,7 @@ void PerformanceMonitor::measurePostBackgroundingMemoryUsage() > void PerformanceMonitor::measurePostBackgroundingCPUUsage() > { > if (!m_page.isOnlyNonUtilityPage()) { >- m_postBackgroundingCPUTime = std::nullopt; >+ m_postBackgroundingCPUTime = WTF::nullopt; > return; > } > >@@ -236,7 +236,7 @@ void PerformanceMonitor::measurePostBackgroundingCPUUsage() > m_postBackgroundingCPUUsageTimer.startOneShot(backgroundCPUUsageMeasurementDuration); > return; > } >- std::optional<CPUTime> cpuTime = CPUTime::get(); >+ Optional<CPUTime> cpuTime = CPUTime::get(); > if (!cpuTime) > return; > >@@ -269,7 +269,7 @@ static inline const char* stringForCPUSamplingActivityState(ActivityStateForCPUS > void PerformanceMonitor::measureCPUUsageInActivityState(ActivityStateForCPUSampling activityState) > { > if (!m_page.isOnlyNonUtilityPage()) { >- m_perActivityStateCPUTime = std::nullopt; >+ m_perActivityStateCPUTime = WTF::nullopt; > return; > } > >@@ -278,9 +278,9 @@ void PerformanceMonitor::measureCPUUsageInActivityState(ActivityStateForCPUSampl > return; > } > >- std::optional<CPUTime> cpuTime = CPUTime::get(); >+ Optional<CPUTime> cpuTime = CPUTime::get(); > if (!cpuTime) { >- m_perActivityStateCPUTime = std::nullopt; >+ m_perActivityStateCPUTime = WTF::nullopt; > return; > } > >diff --git a/Source/WebCore/page/PerformanceMonitor.h b/Source/WebCore/page/PerformanceMonitor.h >index 29c81c72290b832269113f65d364fa30c8403254..64fd856629dc21c4494861093ccaac0be97e6f78 100644 >--- a/Source/WebCore/page/PerformanceMonitor.h >+++ b/Source/WebCore/page/PerformanceMonitor.h >@@ -55,11 +55,11 @@ private: > Page& m_page; > > Timer m_postPageLoadCPUUsageTimer; >- std::optional<CPUTime> m_postLoadCPUTime; >+ Optional<CPUTime> m_postLoadCPUTime; > Timer m_postBackgroundingCPUUsageTimer; >- std::optional<CPUTime> m_postBackgroundingCPUTime; >+ Optional<CPUTime> m_postBackgroundingCPUTime; > Timer m_perActivityStateCPUUsageTimer; >- std::optional<CPUTime> m_perActivityStateCPUTime; >+ Optional<CPUTime> m_perActivityStateCPUTime; > > Timer m_postPageLoadMemoryUsageTimer; > Timer m_postBackgroundingMemoryUsageTimer; >diff --git a/Source/WebCore/page/PerformanceObserverEntryList.cpp b/Source/WebCore/page/PerformanceObserverEntryList.cpp >index 238634db6abb59e6e2a0aa1fea34a845474cf89d..e03665aacb70bb8f8639af4bc7ae1d060dbb1e46 100644 >--- a/Source/WebCore/page/PerformanceObserverEntryList.cpp >+++ b/Source/WebCore/page/PerformanceObserverEntryList.cpp >@@ -54,7 +54,7 @@ Vector<RefPtr<PerformanceEntry>> PerformanceObserverEntryList::getEntriesByName( > > // PerformanceObservers can only be registered for valid types. > // So if the incoming entryType is an unknown type, there will be no matches. >- std::optional<PerformanceEntry::Type> type; >+ Optional<PerformanceEntry::Type> type; > if (!entryType.isNull()) { > type = PerformanceEntry::parseEntryTypeString(entryType); > if (!type) >diff --git a/Source/WebCore/page/PrewarmInformation.h b/Source/WebCore/page/PrewarmInformation.h >index 1ba98922853ca7e94f4d03762e5deee881d3b45b..99a4372e54d84029bafbf9b8f7a582001fa63a1b 100644 >--- a/Source/WebCore/page/PrewarmInformation.h >+++ b/Source/WebCore/page/PrewarmInformation.h >@@ -35,7 +35,7 @@ struct WEBCORE_EXPORT PrewarmInformation { > FontCache::PrewarmInformation fontCache; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<PrewarmInformation> decode(Decoder&); >+ template<class Decoder> static Optional<PrewarmInformation> decode(Decoder&); > }; > > template<class Encoder> >@@ -45,9 +45,9 @@ void PrewarmInformation::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<PrewarmInformation> PrewarmInformation::decode(Decoder& decoder) >+Optional<PrewarmInformation> PrewarmInformation::decode(Decoder& decoder) > { >- std::optional<FontCache::PrewarmInformation> fontCachePrewarmInformation; >+ Optional<FontCache::PrewarmInformation> fontCachePrewarmInformation; > decoder >> fontCachePrewarmInformation; > if (!fontCachePrewarmInformation) > return { }; >diff --git a/Source/WebCore/page/Quirks.h b/Source/WebCore/page/Quirks.h >index d95bf095105bfec498eefaf805da7b98070b77ad..7f3cbf30203ba1a8740a4068e08abe753b57e9cf 100644 >--- a/Source/WebCore/page/Quirks.h >+++ b/Source/WebCore/page/Quirks.h >@@ -42,7 +42,7 @@ public: > private: > WeakPtr<Document> m_document; > >- mutable std::optional<bool> m_hasBrokenEncryptedMediaAPISupportQuirk; >+ mutable Optional<bool> m_hasBrokenEncryptedMediaAPISupportQuirk; > }; > > } >diff --git a/Source/WebCore/page/ScrollIntoViewOptions.h b/Source/WebCore/page/ScrollIntoViewOptions.h >index 328d2ec3cf2df587706df2991c7244534ca38d44..939cd73425ac7c3290c42d25d5e99d08aa14c00b 100644 >--- a/Source/WebCore/page/ScrollIntoViewOptions.h >+++ b/Source/WebCore/page/ScrollIntoViewOptions.h >@@ -26,8 +26,8 @@ namespace WebCore { > class Element; > > struct ScrollIntoViewOptions { >- std::optional<ScrollLogicalPosition> blockPosition { ScrollLogicalPosition::Start }; >- std::optional<ScrollLogicalPosition> inlinePosition { ScrollLogicalPosition::Nearest }; >+ Optional<ScrollLogicalPosition> blockPosition { ScrollLogicalPosition::Start }; >+ Optional<ScrollLogicalPosition> inlinePosition { ScrollLogicalPosition::Nearest }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/page/ScrollToOptions.h b/Source/WebCore/page/ScrollToOptions.h >index 87eeaa9cca9527681f383fc2b4d449f0d480e24f..ce1cba1c7c010403bdb3e99446f656f604416d7f 100644 >--- a/Source/WebCore/page/ScrollToOptions.h >+++ b/Source/WebCore/page/ScrollToOptions.h >@@ -34,11 +34,11 @@ > namespace WebCore { > > struct ScrollToOptions { >- std::optional<double> left; >- std::optional<double> top; >+ Optional<double> left; >+ Optional<double> top; > }; > >-inline double normalizeNonFiniteValueOrFallBackTo(std::optional<double> value, double fallbackValue) >+inline double normalizeNonFiniteValueOrFallBackTo(Optional<double> value, double fallbackValue) > { > // Normalize non-finite values (https://drafts.csswg.org/cssom-view/#normalize-non-finite-values). > return value ? (std::isfinite(*value) ? *value : 0) : fallbackValue; >diff --git a/Source/WebCore/page/SecurityOrigin.cpp b/Source/WebCore/page/SecurityOrigin.cpp >index d98a061e552222a406faae0f1c113c12c65954f3..b58faaa167a96726aa211fe1f0274bc66e96165b 100644 >--- a/Source/WebCore/page/SecurityOrigin.cpp >+++ b/Source/WebCore/page/SecurityOrigin.cpp >@@ -149,7 +149,7 @@ SecurityOrigin::SecurityOrigin(const URL& url) > m_domain = m_data.host; > > if (m_data.port && WTF::isDefaultPortForProtocol(m_data.port.value(), m_data.protocol)) >- m_data.port = std::nullopt; >+ m_data.port = WTF::nullopt; > > // By default, only local SecurityOrigins can load local resources. > m_canLoadLocalResources = isLocal(); >@@ -161,7 +161,7 @@ SecurityOrigin::SecurityOrigin(const URL& url) > } > > SecurityOrigin::SecurityOrigin() >- : m_data { emptyString(), emptyString(), std::nullopt } >+ : m_data { emptyString(), emptyString(), WTF::nullopt } > , m_domain { emptyString() } > , m_isUnique { true } > , m_isPotentiallyTrustworthy { true } >@@ -512,7 +512,7 @@ Ref<SecurityOrigin> SecurityOrigin::createFromString(const String& originString) > return SecurityOrigin::create(URL(URL(), originString)); > } > >-Ref<SecurityOrigin> SecurityOrigin::create(const String& protocol, const String& host, std::optional<uint16_t> port) >+Ref<SecurityOrigin> SecurityOrigin::create(const String& protocol, const String& host, Optional<uint16_t> port) > { > String decodedHost = decodeURLEscapeSequences(host); > auto origin = create(URL(URL(), protocol + "://" + host + "/")); >diff --git a/Source/WebCore/page/SecurityOrigin.h b/Source/WebCore/page/SecurityOrigin.h >index ba78b6cdef31e242d8d0332de6f302d2f00e804c..ed2d9fbe4ad5898926897783b2cd99e9d84b0737 100644 >--- a/Source/WebCore/page/SecurityOrigin.h >+++ b/Source/WebCore/page/SecurityOrigin.h >@@ -52,7 +52,7 @@ public: > WEBCORE_EXPORT static Ref<SecurityOrigin> createUnique(); > > WEBCORE_EXPORT static Ref<SecurityOrigin> createFromString(const String&); >- WEBCORE_EXPORT static Ref<SecurityOrigin> create(const String& protocol, const String& host, std::optional<uint16_t> port); >+ WEBCORE_EXPORT static Ref<SecurityOrigin> create(const String& protocol, const String& host, Optional<uint16_t> port); > > // Some URL schemes use nested URLs for their security context. For example, > // filesystem URLs look like the following: >@@ -80,7 +80,7 @@ public: > const String& protocol() const { return m_data.protocol; } > const String& host() const { return m_data.host; } > const String& domain() const { return m_domain; } >- std::optional<uint16_t> port() const { return m_data.port; } >+ Optional<uint16_t> port() const { return m_data.port; } > > // Returns true if a given URL is secure, based either directly on its > // own protocol, or, when relevant, on the protocol of its "inner URL" >@@ -261,7 +261,7 @@ template<class Encoder> inline void SecurityOrigin::encode(Encoder& encoder) con > > template<class Decoder> inline RefPtr<SecurityOrigin> SecurityOrigin::decode(Decoder& decoder) > { >- std::optional<SecurityOriginData> data; >+ Optional<SecurityOriginData> data; > decoder >> data; > if (!data) > return nullptr; >diff --git a/Source/WebCore/page/SecurityOriginData.cpp b/Source/WebCore/page/SecurityOriginData.cpp >index b7f83cee2674d55acfcc98e9e1139a407151a0a6..12364424527962b89f4780c51bc6baa3a3704456 100644 >--- a/Source/WebCore/page/SecurityOriginData.cpp >+++ b/Source/WebCore/page/SecurityOriginData.cpp >@@ -85,37 +85,37 @@ String SecurityOriginData::databaseIdentifier() const > return stringBuilder.toString(); > } > >-std::optional<SecurityOriginData> SecurityOriginData::fromDatabaseIdentifier(const String& databaseIdentifier) >+Optional<SecurityOriginData> SecurityOriginData::fromDatabaseIdentifier(const String& databaseIdentifier) > { > // Make sure there's a first separator > size_t separator1 = databaseIdentifier.find(separatorCharacter); > if (separator1 == notFound) >- return std::nullopt; >+ return WTF::nullopt; > > // Make sure there's a second separator > size_t separator2 = databaseIdentifier.reverseFind(separatorCharacter); > if (separator2 == notFound) >- return std::nullopt; >+ return WTF::nullopt; > > // Ensure there were at least 2 separator characters. Some hostnames on intranets have > // underscores in them, so we'll assume that any additional underscores are part of the host. > if (separator1 == separator2) >- return std::nullopt; >+ return WTF::nullopt; > > // Make sure the port section is a valid port number or doesn't exist > bool portOkay; > int port = databaseIdentifier.right(databaseIdentifier.length() - separator2 - 1).toInt(&portOkay); > bool portAbsent = (separator2 == databaseIdentifier.length() - 1); > if (!(portOkay || portAbsent)) >- return std::nullopt; >+ return WTF::nullopt; > > if (port < 0 || port > std::numeric_limits<uint16_t>::max()) >- return std::nullopt; >+ return WTF::nullopt; > > auto protocol = databaseIdentifier.substring(0, separator1); > auto host = databaseIdentifier.substring(separator1 + 1, separator2 - separator1 - 1); > if (!port) >- return SecurityOriginData { protocol, host, std::nullopt }; >+ return SecurityOriginData { protocol, host, WTF::nullopt }; > > return SecurityOriginData { protocol, host, static_cast<uint16_t>(port) }; > } >diff --git a/Source/WebCore/page/SecurityOriginData.h b/Source/WebCore/page/SecurityOriginData.h >index 27762ea21d6d2065e9dd0146db979b332ec456c0..59251022aa28ac50dd8ee2b3669707d0894cc543 100644 >--- a/Source/WebCore/page/SecurityOriginData.h >+++ b/Source/WebCore/page/SecurityOriginData.h >@@ -34,7 +34,7 @@ class SecurityOrigin; > > struct SecurityOriginData { > SecurityOriginData() = default; >- SecurityOriginData(const String& protocol, const String& host, std::optional<uint16_t> port) >+ SecurityOriginData(const String& protocol, const String& host, Optional<uint16_t> port) > : protocol(protocol) > , host(host) > , port(port) >@@ -62,21 +62,21 @@ struct SecurityOriginData { > > String protocol; > String host; >- std::optional<uint16_t> port; >+ Optional<uint16_t> port; > > WEBCORE_EXPORT SecurityOriginData isolatedCopy() const; > > // Serialize the security origin to a string that could be used as part of > // file names. This format should be used in storage APIs only. > WEBCORE_EXPORT String databaseIdentifier() const; >- WEBCORE_EXPORT static std::optional<SecurityOriginData> fromDatabaseIdentifier(const String&); >+ WEBCORE_EXPORT static Optional<SecurityOriginData> fromDatabaseIdentifier(const String&); > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<SecurityOriginData> decode(Decoder&); >+ template<class Decoder> static Optional<SecurityOriginData> decode(Decoder&); > > bool isEmpty() const > { >- return protocol.isNull() && host.isNull() && port == std::nullopt; >+ return protocol.isNull() && host.isNull() && port == WTF::nullopt; > } > > bool isHashTableDeletedValue() const >@@ -103,21 +103,21 @@ void SecurityOriginData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<SecurityOriginData> SecurityOriginData::decode(Decoder& decoder) >+Optional<SecurityOriginData> SecurityOriginData::decode(Decoder& decoder) > { >- std::optional<String> protocol; >+ Optional<String> protocol; > decoder >> protocol; > if (!protocol) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> host; >+ Optional<String> host; > decoder >> host; > if (!host) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint16_t> port; >+ Optional<uint16_t> port; > if (!decoder.decode(port)) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*protocol), WTFMove(*host), WTFMove(port) }}; > } >diff --git a/Source/WebCore/page/ShareData.h b/Source/WebCore/page/ShareData.h >index 44d0a33f393c83a85a7e36a24d886e3efb57a1a3..7b4ab164416c2088e7ef2334671798ce04e1ca18 100644 >--- a/Source/WebCore/page/ShareData.h >+++ b/Source/WebCore/page/ShareData.h >@@ -36,7 +36,7 @@ struct ShareData { > > struct ShareDataWithParsedURL { > ShareData shareData; >- std::optional<URL> url; >+ Optional<URL> url; > }; > > } >diff --git a/Source/WebCore/page/ViewportConfiguration.cpp b/Source/WebCore/page/ViewportConfiguration.cpp >index d4bf6c2bcf99da41d4974d61631f46a895b0fe0a..1d36b8eeb0bec052e6100d0edeb311326326e711 100644 >--- a/Source/WebCore/page/ViewportConfiguration.cpp >+++ b/Source/WebCore/page/ViewportConfiguration.cpp >@@ -114,7 +114,7 @@ bool ViewportConfiguration::setContentsSize(const IntSize& contentSize) > return true; > } > >-bool ViewportConfiguration::setViewLayoutSize(const FloatSize& viewLayoutSize, std::optional<double>&& scaleFactor, std::optional<double>&& minimumEffectiveDeviceWidth) >+bool ViewportConfiguration::setViewLayoutSize(const FloatSize& viewLayoutSize, Optional<double>&& scaleFactor, Optional<double>&& minimumEffectiveDeviceWidth) > { > double newScaleFactor = scaleFactor.value_or(m_layoutSizeScaleFactor); > double newEffectiveWidth = minimumEffectiveDeviceWidth.value_or(m_minimumEffectiveDeviceWidth); >diff --git a/Source/WebCore/page/ViewportConfiguration.h b/Source/WebCore/page/ViewportConfiguration.h >index 4da765af20aa9ebffb595919d4db5a75951e0ec5..63766df72f13461fd8f7907db639aa6039060d25 100644 >--- a/Source/WebCore/page/ViewportConfiguration.h >+++ b/Source/WebCore/page/ViewportConfiguration.h >@@ -77,7 +77,7 @@ public: > const FloatSize& viewLayoutSize() const { return m_viewLayoutSize; } > > const FloatSize& minimumLayoutSize() const { return m_minimumLayoutSize; } >- WEBCORE_EXPORT bool setViewLayoutSize(const FloatSize&, std::optional<double>&& scaleFactor = std::nullopt, std::optional<double>&& effectiveWidth = std::nullopt); >+ WEBCORE_EXPORT bool setViewLayoutSize(const FloatSize&, Optional<double>&& scaleFactor = WTF::nullopt, Optional<double>&& effectiveWidth = WTF::nullopt); > > const OptionSet<DisabledAdaptations>& disabledAdaptations() const { return m_disabledAdaptations; } > WEBCORE_EXPORT bool setDisabledAdaptations(const OptionSet<DisabledAdaptations>&); >diff --git a/Source/WebCore/page/WindowFeatures.cpp b/Source/WebCore/page/WindowFeatures.cpp >index 067645c7251e25718004bea58202f51554138d15..1dbbd56cdfdf6e51ae0b71c6b11cb8e115c94f55 100644 >--- a/Source/WebCore/page/WindowFeatures.cpp >+++ b/Source/WebCore/page/WindowFeatures.cpp >@@ -37,8 +37,8 @@ typedef HashMap<String, String, ASCIICaseInsensitiveHash> DialogFeaturesMap; > static void setWindowFeature(WindowFeatures&, StringView key, StringView value); > > static DialogFeaturesMap parseDialogFeaturesMap(const String&); >-static std::optional<bool> boolFeature(const DialogFeaturesMap&, const char* key); >-static std::optional<float> floatFeature(const DialogFeaturesMap&, const char* key, float min, float max); >+static Optional<bool> boolFeature(const DialogFeaturesMap&, const char* key); >+static Optional<float> floatFeature(const DialogFeaturesMap&, const char* key, float min, float max); > > // https://html.spec.whatwg.org/#feature-separator > static bool isSeparator(UChar character, FeatureMode mode) >@@ -205,11 +205,11 @@ WindowFeatures parseDialogFeatures(const String& dialogFeaturesString, const Flo > return features; > } > >-static std::optional<bool> boolFeature(const DialogFeaturesMap& features, const char* key) >+static Optional<bool> boolFeature(const DialogFeaturesMap& features, const char* key) > { > auto it = features.find(key); > if (it == features.end()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& value = it->value; > return value.isNull() >@@ -218,18 +218,18 @@ static std::optional<bool> boolFeature(const DialogFeaturesMap& features, const > || equalLettersIgnoringASCIICase(value, "on"); > } > >-static std::optional<float> floatFeature(const DialogFeaturesMap& features, const char* key, float min, float max) >+static Optional<float> floatFeature(const DialogFeaturesMap& features, const char* key, float min, float max) > { > auto it = features.find(key); > if (it == features.end()) >- return std::nullopt; >+ return WTF::nullopt; > > // FIXME: The toDouble function does not offer a way to tell "0q" from string with no digits in it: Both > // return the number 0 and false for ok. But "0q" should yield the minimum rather than the default. > bool ok; > double parsedNumber = it->value.toDouble(&ok); > if ((!parsedNumber && !ok) || std::isnan(parsedNumber)) >- return std::nullopt; >+ return WTF::nullopt; > if (parsedNumber < min || max <= min) > return min; > if (parsedNumber > max) >diff --git a/Source/WebCore/page/WindowFeatures.h b/Source/WebCore/page/WindowFeatures.h >index fec577caa2273361114c93c9483e7e400cdd87e1..c23aab88227067dc57501300b795466015306ef5 100644 >--- a/Source/WebCore/page/WindowFeatures.h >+++ b/Source/WebCore/page/WindowFeatures.h >@@ -40,10 +40,10 @@ namespace WebCore { > class FloatRect; > > struct WindowFeatures { >- std::optional<float> x; >- std::optional<float> y; >- std::optional<float> width; >- std::optional<float> height; >+ Optional<float> x; >+ Optional<float> y; >+ Optional<float> width; >+ Optional<float> height; > > bool menuBarVisible { true }; > bool statusBarVisible { true }; >diff --git a/Source/WebCore/page/animation/AnimationBase.cpp b/Source/WebCore/page/animation/AnimationBase.cpp >index d4b56cf24ece83a214ad801967fede953253be4a..90be9840ecc7709d81fe19263bd906f982988bf2 100644 >--- a/Source/WebCore/page/animation/AnimationBase.cpp >+++ b/Source/WebCore/page/animation/AnimationBase.cpp >@@ -161,10 +161,10 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param) > m_compositeAnimation->animationController().removeFromAnimationsWaitingForStyle(this); > LOG(Animations, "%p AnimationState %s -> New", this, nameForState(m_animationState)); > m_animationState = AnimationState::New; >- m_startTime = std::nullopt; >- m_pauseTime = std::nullopt; >+ m_startTime = WTF::nullopt; >+ m_pauseTime = WTF::nullopt; > m_requestedStartTime = 0; >- m_nextIterationDuration = std::nullopt; >+ m_nextIterationDuration = WTF::nullopt; > endAnimation(); > return; > } >@@ -174,10 +174,10 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param) > m_compositeAnimation->animationController().removeFromAnimationsWaitingForStyle(this); > LOG(Animations, "%p AnimationState %s -> New", this, nameForState(m_animationState)); > m_animationState = AnimationState::New; >- m_startTime = std::nullopt; >- m_pauseTime = std::nullopt; >+ m_startTime = WTF::nullopt; >+ m_pauseTime = WTF::nullopt; > m_requestedStartTime = 0; >- m_nextIterationDuration = std::nullopt; >+ m_nextIterationDuration = WTF::nullopt; > endAnimation(); > > if (!paused()) >@@ -225,7 +225,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param) > // We are pausing before we even started. > LOG(Animations, "%p AnimationState %s -> AnimationState::PausedNew", this, nameForState(m_animationState)); > m_animationState = AnimationState::PausedNew; >- m_pauseTime = std::nullopt; >+ m_pauseTime = WTF::nullopt; > } > > break; >@@ -376,7 +376,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param) > ASSERT(paused()); > // Update the times > m_startTime = m_startTime.value_or(0) + beginAnimationUpdateTime() - m_pauseTime.value_or(0); >- m_pauseTime = std::nullopt; >+ m_pauseTime = WTF::nullopt; > > // we were waiting for the start timer to fire, go back and wait again > LOG(Animations, "%p AnimationState %s -> New", this, nameForState(m_animationState)); >@@ -400,7 +400,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param) > // to start, so jump back to the New state and reset. > LOG(Animations, "%p AnimationState %s -> AnimationState::New", this, nameForState(m_animationState)); > m_animationState = AnimationState::New; >- m_pauseTime = std::nullopt; >+ m_pauseTime = WTF::nullopt; > updateStateMachine(input, param); > break; > } >@@ -411,7 +411,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param) > else > m_startTime = 0; > >- m_pauseTime = std::nullopt; >+ m_pauseTime = WTF::nullopt; > > if (m_animationState == AnimationState::PausedWaitStyleAvailable) { > LOG(Animations, "%p AnimationState %s -> StartWaitStyleAvailable", this, nameForState(m_animationState)); >@@ -546,12 +546,12 @@ void AnimationBase::updatePlayState(AnimationPlayState playState) > updateStateMachine(pause ? AnimationStateInput::PlayStatePaused : AnimationStateInput::PlayStateRunning, -1); > } > >-std::optional<Seconds> AnimationBase::timeToNextService() >+Optional<Seconds> AnimationBase::timeToNextService() > { >- // Returns the time at which next service is required. std::nullopt means no service is required. 0 means >+ // Returns the time at which next service is required. WTF::nullopt means no service is required. 0 means > // service is required now, and > 0 means service is required that many seconds in the future. > if (paused() || isNew() || postActive() || fillingForwards()) >- return std::nullopt; >+ return WTF::nullopt; > > if (m_animationState == AnimationState::StartWaitTimer) { > double timeFromNow = m_animation->delay() - (beginAnimationUpdateTime() - m_requestedStartTime); >diff --git a/Source/WebCore/page/animation/AnimationBase.h b/Source/WebCore/page/animation/AnimationBase.h >index b6ccec2138ee7e2103e42e07a92f1deb2f7a5681..0631ee676c5e1977ac8a71166a9ffd35272ce6f4 100644 >--- a/Source/WebCore/page/animation/AnimationBase.h >+++ b/Source/WebCore/page/animation/AnimationBase.h >@@ -129,7 +129,7 @@ public: > > bool isAccelerated() const override { return m_isAccelerated; } > >- virtual std::optional<Seconds> timeToNextService(); >+ virtual Optional<Seconds> timeToNextService(); > > double progress(double scale = 1, double offset = 0, const TimingFunction* = nullptr) const; > >@@ -256,11 +256,11 @@ protected: > CompositeAnimation* m_compositeAnimation; // Ideally this would be a reference, but it has to be cleared if an animation is destroyed inside an event callback. > Ref<Animation> m_animation; > >- std::optional<double> m_startTime; >- std::optional<double> m_pauseTime; >+ Optional<double> m_startTime; >+ Optional<double> m_pauseTime; > double m_requestedStartTime { 0 }; >- std::optional<double> m_totalDuration; >- std::optional<double> m_nextIterationDuration; >+ Optional<double> m_totalDuration; >+ Optional<double> m_nextIterationDuration; > > AnimationState m_animationState { AnimationState::New }; > bool m_colorFilterFunctionListsMatch { false }; >diff --git a/Source/WebCore/page/animation/CSSAnimationController.cpp b/Source/WebCore/page/animation/CSSAnimationController.cpp >index 5d56afc6682667def2bc57f8029ae5c0a84ffa1b..250e6d68028eef91811225e3956b8f9fcbc644e8 100644 >--- a/Source/WebCore/page/animation/CSSAnimationController.cpp >+++ b/Source/WebCore/page/animation/CSSAnimationController.cpp >@@ -128,16 +128,16 @@ bool CSSAnimationControllerPrivate::clear(Element& element) > return result; > } > >-std::optional<Seconds> CSSAnimationControllerPrivate::updateAnimations(SetChanged callSetChanged/* = DoNotCallSetChanged*/) >+Optional<Seconds> CSSAnimationControllerPrivate::updateAnimations(SetChanged callSetChanged/* = DoNotCallSetChanged*/) > { > AnimationPrivateUpdateBlock updateBlock(*this); >- std::optional<Seconds> timeToNextService; >+ Optional<Seconds> timeToNextService; > bool calledSetChanged = false; > > for (auto& compositeAnimation : m_compositeAnimations) { > CompositeAnimation& animation = *compositeAnimation.value; > if (!animation.isSuspended() && animation.hasAnimations()) { >- std::optional<Seconds> t = animation.timeToNextService(); >+ Optional<Seconds> t = animation.timeToNextService(); > if (t && (!timeToNextService || t.value() < timeToNextService.value())) > timeToNextService = t.value(); > if (timeToNextService && timeToNextService.value() == 0_s) { >@@ -159,7 +159,7 @@ std::optional<Seconds> CSSAnimationControllerPrivate::updateAnimations(SetChange > > void CSSAnimationControllerPrivate::updateAnimationTimerForElement(Element& element) > { >- std::optional<Seconds> timeToNextService; >+ Optional<Seconds> timeToNextService; > > const CompositeAnimation* compositeAnimation = m_compositeAnimations.get(&element); > if (!compositeAnimation->isSuspended() && compositeAnimation->hasAnimations()) >@@ -176,7 +176,7 @@ void CSSAnimationControllerPrivate::updateAnimationTimerForElement(Element& elem > > void CSSAnimationControllerPrivate::updateAnimationTimer(SetChanged callSetChanged/* = DoNotCallSetChanged*/) > { >- std::optional<Seconds> timeToNextService = updateAnimations(callSetChanged); >+ Optional<Seconds> timeToNextService = updateAnimations(callSetChanged); > > LOG(Animations, "updateAnimationTimer: timeToNextService is %.2f", timeToNextService.value_or(Seconds { -1 }).value()); > >@@ -254,7 +254,7 @@ void CSSAnimationControllerPrivate::addElementChangeToDispatch(Element& element) > > void CSSAnimationControllerPrivate::animationFrameCallbackFired() > { >- std::optional<Seconds> timeToNextService = updateAnimations(CallSetChanged); >+ Optional<Seconds> timeToNextService = updateAnimations(CallSetChanged); > > if (timeToNextService) > m_frame.document()->view()->scheduleAnimation(); >@@ -444,7 +444,7 @@ MonotonicTime CSSAnimationControllerPrivate::beginAnimationUpdateTime() > void CSSAnimationControllerPrivate::beginAnimationUpdate() > { > if (!m_beginAnimationUpdateCount) >- m_beginAnimationUpdateTime = std::nullopt; >+ m_beginAnimationUpdateTime = WTF::nullopt; > ++m_beginAnimationUpdateCount; > } > >diff --git a/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h b/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h >index baeea46107c7848b63005ff87a2c990f6f3e0df0..4c763d530f830812202567efb5c2e574f3637350 100644 >--- a/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h >+++ b/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h >@@ -49,7 +49,7 @@ public: > ~CSSAnimationControllerPrivate(); > > // Returns the time until the next animation needs to be serviced, or -1 if there are none. >- std::optional<Seconds> updateAnimations(SetChanged callSetChanged = DoNotCallSetChanged); >+ Optional<Seconds> updateAnimations(SetChanged callSetChanged = DoNotCallSetChanged); > void updateAnimationTimer(SetChanged callSetChanged = DoNotCallSetChanged); > > CompositeAnimation& ensureCompositeAnimation(Element&); >@@ -130,7 +130,7 @@ private: > Vector<Ref<Element>> m_elementChangesToDispatch; > HashSet<Document*> m_suspendedDocuments; > >- std::optional<MonotonicTime> m_beginAnimationUpdateTime; >+ Optional<MonotonicTime> m_beginAnimationUpdateTime; > > using AnimationsSet = HashSet<RefPtr<AnimationBase>>; > AnimationsSet m_animationsWaitingForStyle; >diff --git a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp >index b462b9f55fa63fb2b39338d2037769db2fd90f44..90055160699553583bee023bec638b92d0159496 100644 >--- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp >+++ b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp >@@ -429,7 +429,7 @@ static inline FontSelectionValue blendFunc(const CSSPropertyBlendingClient* anim > return FontSelectionValue(blendFunc(anim, static_cast<float>(from), static_cast<float>(to), progress)); > } > >-static inline std::optional<FontSelectionValue> blendFunc(const CSSPropertyBlendingClient* anim, std::optional<FontSelectionValue> from, std::optional<FontSelectionValue> to, double progress) >+static inline Optional<FontSelectionValue> blendFunc(const CSSPropertyBlendingClient* anim, Optional<FontSelectionValue> from, Optional<FontSelectionValue> to, double progress) > { > return FontSelectionValue(blendFunc(anim, static_cast<float>(from.value()), static_cast<float>(to.value()), progress)); > } >@@ -1459,11 +1459,11 @@ private: > void (RenderStyle::*m_setter)(const Color&); > }; > >-class PropertyWrapperFontStyle : public PropertyWrapper<std::optional<FontSelectionValue>> { >+class PropertyWrapperFontStyle : public PropertyWrapper<Optional<FontSelectionValue>> { > WTF_MAKE_FAST_ALLOCATED; > public: > PropertyWrapperFontStyle() >- : PropertyWrapper<std::optional<FontSelectionValue>>(CSSPropertyFontStyle, &RenderStyle::fontItalic, &RenderStyle::setFontItalic) >+ : PropertyWrapper<Optional<FontSelectionValue>>(CSSPropertyFontStyle, &RenderStyle::fontItalic, &RenderStyle::setFontItalic) > { > } > >@@ -1848,7 +1848,7 @@ bool CSSPropertyAnimation::canPropertyBeInterpolated(CSSPropertyID prop, const R > return false; > } > >-CSSPropertyID CSSPropertyAnimation::getPropertyAtIndex(int i, std::optional<bool>& isShorthand) >+CSSPropertyID CSSPropertyAnimation::getPropertyAtIndex(int i, Optional<bool>& isShorthand) > { > CSSPropertyAnimationWrapperMap& map = CSSPropertyAnimationWrapperMap::singleton(); > >diff --git a/Source/WebCore/page/animation/CSSPropertyAnimation.h b/Source/WebCore/page/animation/CSSPropertyAnimation.h >index acb24fe80029a8e325a4eb12901e6173aff7bc31..32003a065615f0ed1cffb6517553f30ecafc7974 100644 >--- a/Source/WebCore/page/animation/CSSPropertyAnimation.h >+++ b/Source/WebCore/page/animation/CSSPropertyAnimation.h >@@ -42,7 +42,7 @@ public: > static bool animationOfPropertyIsAccelerated(CSSPropertyID); > static bool propertiesEqual(CSSPropertyID, const RenderStyle* a, const RenderStyle* b); > static bool canPropertyBeInterpolated(CSSPropertyID, const RenderStyle* a, const RenderStyle* b); >- static CSSPropertyID getPropertyAtIndex(int, std::optional<bool>& isShorthand); >+ static CSSPropertyID getPropertyAtIndex(int, Optional<bool>& isShorthand); > static int getNumProperties(); > > static HashSet<CSSPropertyID> animatableShorthandsAffectingProperty(CSSPropertyID); >diff --git a/Source/WebCore/page/animation/CompositeAnimation.cpp b/Source/WebCore/page/animation/CompositeAnimation.cpp >index dcebf08eb5b4532b6cc25100a5af871161d694d7..f9d9968fafa956b5391a6fd22d1195c2ad85febe 100644 >--- a/Source/WebCore/page/animation/CompositeAnimation.cpp >+++ b/Source/WebCore/page/animation/CompositeAnimation.cpp >@@ -109,7 +109,7 @@ void CompositeAnimation::updateTransitions(Element& element, const RenderStyle* > for (int propertyIndex = 0; propertyIndex < CSSPropertyAnimation::getNumProperties(); ++propertyIndex) { > if (all) { > // Get the next property which is not a shorthand. >- std::optional<bool> isShorthand; >+ Optional<bool> isShorthand; > prop = CSSPropertyAnimation::getPropertyAtIndex(propertyIndex, isShorthand); > if (isShorthand && *isShorthand) > continue; >@@ -364,15 +364,15 @@ std::unique_ptr<RenderStyle> CompositeAnimation::getAnimatedStyle() const > return resultStyle; > } > >-std::optional<Seconds> CompositeAnimation::timeToNextService() const >+Optional<Seconds> CompositeAnimation::timeToNextService() const > { >- // Returns the time at which next service is required. std::nullopt means no service is required. 0 means >+ // Returns the time at which next service is required. WTF::nullopt means no service is required. 0 means > // service is required now, and > 0 means service is required that many seconds in the future. >- std::optional<Seconds> minT; >+ Optional<Seconds> minT; > > if (!m_transitions.isEmpty()) { > for (auto& transition : m_transitions.values()) { >- std::optional<Seconds> t = transition->timeToNextService(); >+ Optional<Seconds> t = transition->timeToNextService(); > if (!t) > continue; > if (!minT || t.value() < minT.value()) >@@ -384,7 +384,7 @@ std::optional<Seconds> CompositeAnimation::timeToNextService() const > if (!m_keyframeAnimations.isEmpty()) { > m_keyframeAnimations.checkConsistency(); > for (auto& animation : m_keyframeAnimations.values()) { >- std::optional<Seconds> t = animation->timeToNextService(); >+ Optional<Seconds> t = animation->timeToNextService(); > if (!t) > continue; > if (!minT || t.value() < minT.value()) >diff --git a/Source/WebCore/page/animation/CompositeAnimation.h b/Source/WebCore/page/animation/CompositeAnimation.h >index cf754c7274c4ee3095e7c5a9ed584106a98b56a7..3ec2c5545ee452f6c92136876a8f1e946b98cff4 100644 >--- a/Source/WebCore/page/animation/CompositeAnimation.h >+++ b/Source/WebCore/page/animation/CompositeAnimation.h >@@ -59,7 +59,7 @@ public: > std::unique_ptr<RenderStyle> getAnimatedStyle() const; > bool computeExtentOfTransformAnimation(LayoutRect&) const; > >- std::optional<Seconds> timeToNextService() const; >+ Optional<Seconds> timeToNextService() const; > > CSSAnimationControllerPrivate& animationController() const { return m_animationController; } > >diff --git a/Source/WebCore/page/animation/ImplicitAnimation.cpp b/Source/WebCore/page/animation/ImplicitAnimation.cpp >index c4125d5af5275ffd442358f61ed400b5e13146b4..a4992f8bad0549e9f540356cf11beb9ecc37badf 100644 >--- a/Source/WebCore/page/animation/ImplicitAnimation.cpp >+++ b/Source/WebCore/page/animation/ImplicitAnimation.cpp >@@ -322,9 +322,9 @@ void ImplicitAnimation::checkForMatchingColorFilterFunctionLists() > m_colorFilterFunctionListsMatch = filterOperationsMatch(&m_fromStyle->appleColorFilter(), m_toStyle->appleColorFilter()); > } > >-std::optional<Seconds> ImplicitAnimation::timeToNextService() >+Optional<Seconds> ImplicitAnimation::timeToNextService() > { >- std::optional<Seconds> t = AnimationBase::timeToNextService(); >+ Optional<Seconds> t = AnimationBase::timeToNextService(); > if (!t || t.value() != 0_s || preActive()) > return t; > >diff --git a/Source/WebCore/page/animation/ImplicitAnimation.h b/Source/WebCore/page/animation/ImplicitAnimation.h >index 4b0a28e14a7a9b473e69d73dc1d23fab42d86d32..6cb6c45216a5dca93daafa43175e42622cb75176 100644 >--- a/Source/WebCore/page/animation/ImplicitAnimation.h >+++ b/Source/WebCore/page/animation/ImplicitAnimation.h >@@ -70,7 +70,7 @@ public: > > void blendPropertyValueInStyle(CSSPropertyID, RenderStyle*); > >- std::optional<Seconds> timeToNextService() override; >+ Optional<Seconds> timeToNextService() override; > > bool active() const { return m_active; } > void setActive(bool b) { m_active = b; } >diff --git a/Source/WebCore/page/animation/KeyframeAnimation.cpp b/Source/WebCore/page/animation/KeyframeAnimation.cpp >index e4ab857053a3fb87c6ca1f80199e71b0b0f9e9bf..0f9650882943c54940ed39979a16bf480ea26b8e 100644 >--- a/Source/WebCore/page/animation/KeyframeAnimation.cpp >+++ b/Source/WebCore/page/animation/KeyframeAnimation.cpp >@@ -506,9 +506,9 @@ void KeyframeAnimation::checkForMatchingColorFilterFunctionLists() > }); > } > >-std::optional<Seconds> KeyframeAnimation::timeToNextService() >+Optional<Seconds> KeyframeAnimation::timeToNextService() > { >- std::optional<Seconds> t = AnimationBase::timeToNextService(); >+ Optional<Seconds> t = AnimationBase::timeToNextService(); > if (!t || t.value() != 0_s || preActive()) > return t; > >diff --git a/Source/WebCore/page/animation/KeyframeAnimation.h b/Source/WebCore/page/animation/KeyframeAnimation.h >index 837dd397174994acafee80b2dc09ad6e43ed42e6..2c807318625ef17263166999e9689d3a9a26917e 100644 >--- a/Source/WebCore/page/animation/KeyframeAnimation.h >+++ b/Source/WebCore/page/animation/KeyframeAnimation.h >@@ -62,7 +62,7 @@ public: > void setUnanimatedStyle(std::unique_ptr<RenderStyle> style) { m_unanimatedStyle = WTFMove(style); } > const RenderStyle& unanimatedStyle() const override { return *m_unanimatedStyle; } > >- std::optional<Seconds> timeToNextService() override; >+ Optional<Seconds> timeToNextService() override; > > protected: > void onAnimationStart(double elapsedTime) override; >diff --git a/Source/WebCore/page/cocoa/PerformanceLoggingCocoa.mm b/Source/WebCore/page/cocoa/PerformanceLoggingCocoa.mm >index 2896fe1976ffb18adfa79666fe68e1637ab250fc..21115732f546e0eb1d8271014c15671a082c3837 100644 >--- a/Source/WebCore/page/cocoa/PerformanceLoggingCocoa.mm >+++ b/Source/WebCore/page/cocoa/PerformanceLoggingCocoa.mm >@@ -31,13 +31,13 @@ > > namespace WebCore { > >-std::optional<uint64_t> PerformanceLogging::physicalFootprint() >+Optional<uint64_t> PerformanceLogging::physicalFootprint() > { > task_vm_info_data_t vmInfo; > mach_msg_type_number_t count = TASK_VM_INFO_COUNT; > kern_return_t result = task_info(mach_task_self(), TASK_VM_INFO, (task_info_t) &vmInfo, &count); > if (result != KERN_SUCCESS) >- return std::nullopt; >+ return WTF::nullopt; > return vmInfo.phys_footprint; > } > >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp >index 751fd70ddbdd9f552068ff959d0acc0ef95db432..403dc60284b3aafc467af1919c65783c38e034b5 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp >+++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp >@@ -208,7 +208,7 @@ void ContentSecurityPolicy::didReceiveHeader(const String& header, ContentSecuri > m_hasAPIPolicy = true; > } > >- m_cachedResponseHeaders = std::nullopt; >+ m_cachedResponseHeaders = WTF::nullopt; > > // RFC2616, section 4.2 specifies that headers appearing multiple times can > // be combined with a comma. Walk the header string, and parse each comma >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.h b/Source/WebCore/page/csp/ContentSecurityPolicy.h >index e02a7ab6c59bfcf5b99e648ffc6c7e2544cffe35..17f77c26a0fdba93af3836ac839cf9d7b6f9287a 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicy.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicy.h >@@ -229,7 +229,7 @@ private: > OptionSet<ContentSecurityPolicyHashAlgorithm> m_hashAlgorithmsForInlineScripts; > OptionSet<ContentSecurityPolicyHashAlgorithm> m_hashAlgorithmsForInlineStylesheets; > HashSet<SecurityOriginData> m_insecureNavigationRequestsToUpgrade; >- mutable std::optional<ContentSecurityPolicyResponseHeaders> m_cachedResponseHeaders; >+ mutable Optional<ContentSecurityPolicyResponseHeaders> m_cachedResponseHeaders; > }; > > } >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp b/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp >index c82f856c2c7822dd645e32b171cf343798154ad4..248aa560777966413ef4cc9f336a8a87a0a2798f 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp >@@ -34,7 +34,7 @@ > > namespace WebCore { > >-ContentSecurityPolicySource::ContentSecurityPolicySource(const ContentSecurityPolicy& policy, const String& scheme, const String& host, std::optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard) >+ContentSecurityPolicySource::ContentSecurityPolicySource(const ContentSecurityPolicy& policy, const String& scheme, const String& host, Optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard) > : m_policy(policy) > , m_scheme(scheme) > , m_host(host) >@@ -96,7 +96,7 @@ bool ContentSecurityPolicySource::portMatches(const URL& url) const > if (m_portHasWildcard) > return true; > >- std::optional<uint16_t> port = url.port(); >+ Optional<uint16_t> port = url.port(); > > if (port == m_port) > return true; >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySource.h b/Source/WebCore/page/csp/ContentSecurityPolicySource.h >index a2db5043898f2e6947bc7b0a2dd6443ab51438d0..8aff1d9ef97b19b1979c2b6f75c9abe654a98e91 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySource.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySource.h >@@ -36,7 +36,7 @@ struct SecurityOriginData; > class ContentSecurityPolicySource { > WTF_MAKE_FAST_ALLOCATED; > public: >- ContentSecurityPolicySource(const ContentSecurityPolicy&, const String& scheme, const String& host, std::optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard); >+ ContentSecurityPolicySource(const ContentSecurityPolicy&, const String& scheme, const String& host, Optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard); > > bool matches(const URL&, bool didReceiveRedirectResponse = false) const; > >@@ -53,7 +53,7 @@ private: > String m_scheme; > String m_host; > String m_path; >- std::optional<uint16_t> m_port; >+ Optional<uint16_t> m_port; > > bool m_hostHasWildcard; > bool m_portHasWildcard; >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp >index 26da91153764aff7048678e627f72fc4c7981d5c..b8af12ea2e9349ab11e08ff481ad7b6570312ff1 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp >@@ -173,7 +173,7 @@ void ContentSecurityPolicySourceList::parse(const UChar* begin, const UChar* end > skipWhile<UChar, isSourceCharacter>(position, end); > > String scheme, host, path; >- std::optional<uint16_t> port; >+ Optional<uint16_t> port; > bool hostHasWildcard = false; > bool portHasWildcard = false; > >@@ -205,7 +205,7 @@ void ContentSecurityPolicySourceList::parse(const UChar* begin, const UChar* end > // / ( [ scheme "://" ] host [ port ] [ path ] ) > // / "'self'" > // >-bool ContentSecurityPolicySourceList::parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, std::optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard) >+bool ContentSecurityPolicySourceList::parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, Optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard) > { > if (begin == end) > return false; >@@ -294,7 +294,7 @@ bool ContentSecurityPolicySourceList::parseSource(const UChar* begin, const UCha > return false; > > if (!beginPort) >- port = std::nullopt; >+ port = WTF::nullopt; > else { > if (!parsePort(beginPort, beginPath, port, portHasWildcard)) > return false; >@@ -396,7 +396,7 @@ bool ContentSecurityPolicySourceList::parsePath(const UChar* begin, const UChar* > > // port = ":" ( 1*DIGIT / "*" ) > // >-bool ContentSecurityPolicySourceList::parsePort(const UChar* begin, const UChar* end, std::optional<uint16_t>& port, bool& portHasWildcard) >+bool ContentSecurityPolicySourceList::parsePort(const UChar* begin, const UChar* end, Optional<uint16_t>& port, bool& portHasWildcard) > { > ASSERT(begin <= end); > ASSERT(!port); >@@ -409,7 +409,7 @@ bool ContentSecurityPolicySourceList::parsePort(const UChar* begin, const UChar* > return false; > > if (end - begin == 1 && *begin == '*') { >- port = std::nullopt; >+ port = WTF::nullopt; > portHasWildcard = true; > return true; > } >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h >index 5fcf3b2eae4a9e5f84810bd53c455524407726fd..04f64e422604997abe798b3d3b4fd92fd21825fb 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h >@@ -57,10 +57,10 @@ public: > private: > void parse(const UChar* begin, const UChar* end); > >- bool parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, std::optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); >+ bool parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, Optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard); > bool parseScheme(const UChar* begin, const UChar* end, String& scheme); > bool parseHost(const UChar* begin, const UChar* end, String& host, bool& hostHasWildcard); >- bool parsePort(const UChar* begin, const UChar* end, std::optional<uint16_t>& port, bool& portHasWildcard); >+ bool parsePort(const UChar* begin, const UChar* end, Optional<uint16_t>& port, bool& portHasWildcard); > bool parsePath(const UChar* begin, const UChar* end, String& path); > > bool parseNonceSource(const UChar* begin, const UChar* end); >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >index 76e4268a076bbd16784f5c499dff01137300d084..fdfe315af6c2942e129dc0d77527438d614d703f 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >@@ -240,7 +240,7 @@ bool AsyncScrollingCoordinator::requestScrollPositionUpdate(FrameView& frameView > > bool isProgrammaticScroll = frameView.inProgrammaticScroll(); > if (isProgrammaticScroll || frameView.frame().document()->pageCacheState() != Document::NotInPageCache) >- updateScrollPositionAfterAsyncScroll(frameView.scrollLayerID(), scrollPosition, std::nullopt, isProgrammaticScroll, ScrollingLayerPositionAction::Set); >+ updateScrollPositionAfterAsyncScroll(frameView.scrollLayerID(), scrollPosition, WTF::nullopt, isProgrammaticScroll, ScrollingLayerPositionAction::Set); > > // If this frame view's document is being put into the page cache, we don't want to update our > // main frame scroll position. Just let the FrameView think that we did. >@@ -255,7 +255,7 @@ bool AsyncScrollingCoordinator::requestScrollPositionUpdate(FrameView& frameView > return true; > } > >-void AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction) >+void AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction) > { > ScheduledScrollUpdate scrollUpdate(nodeID, scrollPosition, layoutViewportOrigin, programmaticScroll, scrollingLayerPositionAction); > >@@ -318,7 +318,7 @@ FrameView* AsyncScrollingCoordinator::frameViewForScrollingNode(ScrollingNodeID > return nullptr; > } > >-void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNodeID scrollingNodeID, const FloatPoint& scrollPosition, std::optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction) >+void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNodeID scrollingNodeID, const FloatPoint& scrollPosition, Optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction) > { > ASSERT(isMainThread()); > >@@ -372,13 +372,13 @@ void AsyncScrollingCoordinator::reconcileScrollingState(FrameView& frameView, co > > LOG_WITH_STREAM(Scrolling, stream << getCurrentProcessID() << " AsyncScrollingCoordinator " << this << " reconcileScrollingState scrollPosition " << scrollPosition << " programmaticScroll " << programmaticScroll << " stability " << viewportRectStability << " " << scrollingLayerPositionAction); > >- std::optional<FloatRect> layoutViewportRect; >+ Optional<FloatRect> layoutViewportRect; > > WTF::switchOn(layoutViewportOriginOrOverrideRect, >- [&frameView](std::optional<FloatPoint> origin) { >+ [&frameView](Optional<FloatPoint> origin) { > if (origin) > frameView.setBaseLayoutViewportOrigin(LayoutPoint(origin.value()), FrameView::TriggerLayoutOrNot::No); >- }, [&frameView, &layoutViewportRect, viewportRectStability, visualViewportEnabled = visualViewportEnabled()](std::optional<FloatRect> overrideRect) { >+ }, [&frameView, &layoutViewportRect, viewportRectStability, visualViewportEnabled = visualViewportEnabled()](Optional<FloatRect> overrideRect) { > if (!overrideRect) > return; > >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >index 03ae58aa66e06e82046c4e2e813385030f4c2b0b..8eee100343e5955abbc9eeae84b2ea91d369938a 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >@@ -51,7 +51,7 @@ public: > > void scrollingStateTreePropertiesChanged(); > >- WEBCORE_EXPORT void scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, const std::optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction); >+ WEBCORE_EXPORT void scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, const Optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction); > > #if PLATFORM(COCOA) > WEBCORE_EXPORT void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex); >@@ -77,7 +77,7 @@ protected: > > RefPtr<ScrollingTree> releaseScrollingTree() { return WTFMove(m_scrollingTree); } > >- void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, std::optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction); >+ void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, Optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction); > > WEBCORE_EXPORT String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const override; > WEBCORE_EXPORT void willCommitTree() override; >@@ -136,7 +136,7 @@ private: > > struct ScheduledScrollUpdate { > ScheduledScrollUpdate() = default; >- ScheduledScrollUpdate(ScrollingNodeID scrollingNodeID, FloatPoint point, std::optional<FloatPoint> viewportOrigin, bool isProgrammatic, ScrollingLayerPositionAction udpateAction) >+ ScheduledScrollUpdate(ScrollingNodeID scrollingNodeID, FloatPoint point, Optional<FloatPoint> viewportOrigin, bool isProgrammatic, ScrollingLayerPositionAction udpateAction) > : nodeID(scrollingNodeID) > , scrollPosition(point) > , layoutViewportOrigin(viewportOrigin) >@@ -146,7 +146,7 @@ private: > > ScrollingNodeID nodeID { 0 }; > FloatPoint scrollPosition; >- std::optional<FloatPoint> layoutViewportOrigin; >+ Optional<FloatPoint> layoutViewportOrigin; > bool isProgrammaticScroll { false }; > ScrollingLayerPositionAction updateLayerPositionAction { ScrollingLayerPositionAction::Sync }; > >diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >index aa64e95bbc8b47d58c59fffd3dac6a430b5ef04d..fc723b0854621c5c498122051427ce4ba1f53861 100644 >--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >@@ -137,7 +137,7 @@ public: > // Should be called whenever the given frame view has been laid out. > virtual void frameViewLayoutUpdated(FrameView&) { } > >- using LayoutViewportOriginOrOverrideRect = WTF::Variant<std::optional<FloatPoint>, std::optional<FloatRect>>; >+ using LayoutViewportOriginOrOverrideRect = WTF::Variant<Optional<FloatPoint>, Optional<FloatRect>>; > virtual void reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool /* programmaticScroll */, ViewportRectStability, ScrollingLayerPositionAction) { } > > // Should be called whenever the slow repaint objects counter changes between zero and one. >diff --git a/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.h b/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.h >index 1d3d8395e3993f13353a9ab2836d4092e3385d23..be99d0ee6a3f0789fc4d7dc692885b5240043802 100644 >--- a/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.h >+++ b/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.h >@@ -61,7 +61,7 @@ protected: > FloatSize m_contentSize; > > private: >- std::optional<FloatSize> m_retargetedScrollOffset; >+ Optional<FloatSize> m_retargetedScrollOffset; > }; > > class BasicScrollingMomentumCalculator final : public ScrollingMomentumCalculator { >@@ -82,7 +82,7 @@ private: > FloatSize m_snapAnimationCurveCoefficients[4] { }; > bool m_forceLinearAnimationCurve { false }; > bool m_momentumCalculatorRequiresInitialization { true }; >- std::optional<FloatSize> m_predictedDestinationOffset; >+ Optional<FloatSize> m_predictedDestinationOffset; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/ScrollingTree.cpp b/Source/WebCore/page/scrolling/ScrollingTree.cpp >index 03dfbe49fc98be8703a046c7a816be600e3c993d..524393dd16aa637ff161d675b80ffd94e7aa1500 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTree.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTree.cpp >@@ -108,7 +108,7 @@ void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID n > downcast<ScrollingTreeScrollingNode>(*node).updateLayersAfterDelegatedScroll(scrollPosition); > > // Update GraphicsLayers and scroll state. >- scrollingTreeNodeDidScroll(nodeID, scrollPosition, std::nullopt, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set); >+ scrollingTreeNodeDidScroll(nodeID, scrollPosition, WTF::nullopt, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set); > } > > void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree> scrollingStateTree) >diff --git a/Source/WebCore/page/scrolling/ScrollingTree.h b/Source/WebCore/page/scrolling/ScrollingTree.h >index f87f055375d28bff9802890f52f7f1f5ad026968..efc68415c39430df7f27043fe982332775567632 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ScrollingTree.h >@@ -78,7 +78,7 @@ public: > > // Called after a scrolling tree node has handled a scroll and updated its layers. > // Updates FrameView/RenderLayer scrolling state and GraphicsLayers. >- virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) = 0; >+ virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) = 0; > > // Called for requested scroll position updates. > virtual void scrollingTreeNodeRequestsScroll(ScrollingNodeID, const FloatPoint& /*scrollPosition*/, bool /*representsProgrammaticScroll*/) { } >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >index 74a873dde40cf5447c9988e84fc57c1325fc209b..b41f7e1a529ab26dcffd45867760baa15fa5664f 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >@@ -118,7 +118,7 @@ void ScrollingTreeScrollingNode::setScrollPosition(const FloatPoint& scrollPosit > void ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition) > { > setScrollLayerPosition(scrollPosition, { }); >- scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, std::nullopt); >+ scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, WTF::nullopt); > } > > FloatPoint ScrollingTreeScrollingNode::minimumScrollPosition() const >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >index 5c7ba803b6f98c1ba7c1f5f4a1b5d65e6c0f5865..06b319609ea99223f00e11a9a81c1c64afa24c3c 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >@@ -90,7 +90,7 @@ void ThreadedScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree> > ScrollingTree::commitTreeState(WTFMove(scrollingStateTree)); > } > >-void ThreadedScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) >+void ThreadedScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) > { > if (!m_scrollingCoordinator) > return; >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >index db3c3d5cfb9e908b3f7d23dd168f920d1c7a3481..402c2d92b2a2e8520b6d71c53d4e5ab368772188 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >@@ -57,7 +57,7 @@ public: > protected: > explicit ThreadedScrollingTree(AsyncScrollingCoordinator&); > >- void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override; >+ void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override; > #if PLATFORM(MAC) > void handleWheelEventPhase(PlatformWheelEventPhase) override; > void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex) override; >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >index 0d202abd5165f17d34fbe6763465334b58de6f19..14f6ce7a56dca96552dd05d51fe9f2c6d73834aa 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >@@ -108,13 +108,13 @@ void ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeCons > { > if (shouldUpdateScrollLayerPositionSynchronously()) { > m_probableMainThreadScrollPosition = scrollPosition; >- scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, std::nullopt, ScrollingLayerPositionAction::Set); >+ scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, WTF::nullopt, ScrollingLayerPositionAction::Set); > return; > } > > FloatRect layoutViewport; // FIXME: implement for iOS WK1. > setScrollLayerPosition(scrollPosition, layoutViewport); >- scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, std::nullopt); >+ scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, WTF::nullopt); > } > > void ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect&) >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp >index 598715438f5b807244527e806817dd35c6dc3f99..af56d790cff67d99e43ed968eb8ea24c5ae006a9 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp >@@ -70,7 +70,7 @@ void ScrollingTreeIOS::invalidate() > }); > } > >-void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) >+void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) > { > if (!m_scrollingCoordinator) > return; >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h >index f2a96cf5018c687a230dbac15897a8818579cf02..fcc7ee2071301fb01d81153df391056d1ac119c4 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h >@@ -51,7 +51,7 @@ private: > void invalidate() final; > > Ref<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) final; >- void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) final; >+ void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) final; > void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) final; > FloatRect fixedPositionRect() final; > >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h >index 89f336b6e9c605c2f9448cdf1ace22e748d6521a..eb108f64c532b95a7f07db1e9530e2ddb63adc11 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h >+++ b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h >@@ -45,7 +45,7 @@ private: > bool requiresMomentumScrolling(); > > RetainPtr<_NSScrollingMomentumCalculator> m_platformMomentumCalculator; >- std::optional<bool> m_requiresMomentumScrolling; >+ Optional<bool> m_requiresMomentumScrolling; > FloatPoint m_initialDestinationOrigin; > }; > >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm >index 3c4ca5f89fece01a97dc945124da16155a78535a..1c7ab76a151e6350d8b614c36d05bce65c6c9584 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm >@@ -83,7 +83,7 @@ Seconds ScrollingMomentumCalculatorMac::animationDuration() > > bool ScrollingMomentumCalculatorMac::requiresMomentumScrolling() > { >- if (m_requiresMomentumScrolling == std::nullopt) >+ if (m_requiresMomentumScrolling == WTF::nullopt) > m_requiresMomentumScrolling = m_initialScrollOffset != retargetedScrollOffset() || m_initialVelocity.area(); > return m_requiresMomentumScrolling.value(); > } >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >index 243196cc928d8fb28de514269b70261bbe5c4af7..034563d4ea5e16ef9a7ea31490af0bc0f6972f64 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >@@ -396,7 +396,7 @@ void ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeCons > { > updateMainFramePinState(scrollPosition); > >- std::optional<FloatPoint> layoutViewportOrigin; >+ Optional<FloatPoint> layoutViewportOrigin; > if (scrollingTree().visualViewportEnabled()) { > FloatPoint visibleContentOrigin = scrollPosition; > FloatRect newLayoutViewport = layoutViewportForScrollPosition(visibleContentOrigin, frameScaleFactor()); >diff --git a/Source/WebCore/platform/AbortableTaskQueue.h b/Source/WebCore/platform/AbortableTaskQueue.h >index a669d9415cdefa41dedb82eba29a16cbbb2c1cab..74c7e0e8532e14e379d2cf9622c521c9f8783ded 100644 >--- a/Source/WebCore/platform/AbortableTaskQueue.h >+++ b/Source/WebCore/platform/AbortableTaskQueue.h >@@ -138,16 +138,16 @@ public: > // It is allowed for the main thread task handler to abort the AbortableTaskQueue. In that case, the return > // value is discarded and the caller receives an empty optional. > template<typename R> >- std::optional<R> enqueueTaskAndWait(WTF::Function<R()>&& mainThreadTaskHandler) >+ Optional<R> enqueueTaskAndWait(WTF::Function<R()>&& mainThreadTaskHandler) > { > // Don't deadlock the main thread with itself. > ASSERT(!isMainThread()); > > LockHolder lockHolder(m_mutex); > if (m_aborting) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<R> response = std::nullopt; >+ Optional<R> response = WTF::nullopt; > postTask([this, &response, &mainThreadTaskHandler]() { > R responseValue = mainThreadTaskHandler(); > LockHolder lockHolder(m_mutex); >diff --git a/Source/WebCore/platform/CPUMonitor.cpp b/Source/WebCore/platform/CPUMonitor.cpp >index 5faaf66e602e77e1d9b21765390e14f37ac8a7fb..4ab7a5f6491f293f2f6dd206c4837f18c6544866 100644 >--- a/Source/WebCore/platform/CPUMonitor.cpp >+++ b/Source/WebCore/platform/CPUMonitor.cpp >@@ -35,7 +35,7 @@ CPUMonitor::CPUMonitor(Seconds checkInterval, ExceededCPULimitHandler&& exceeded > { > } > >-void CPUMonitor::setCPULimit(std::optional<double> cpuLimit) >+void CPUMonitor::setCPULimit(Optional<double> cpuLimit) > { > if (m_cpuLimit == cpuLimit) > return; >diff --git a/Source/WebCore/platform/CPUMonitor.h b/Source/WebCore/platform/CPUMonitor.h >index d4ddb778d6d4e6afd8d2e2ff4bab92958a568447..77842573a875daa821bbeca340ed540dbedfc39f 100644 >--- a/Source/WebCore/platform/CPUMonitor.h >+++ b/Source/WebCore/platform/CPUMonitor.h >@@ -37,7 +37,7 @@ public: > using ExceededCPULimitHandler = WTF::Function<void(double)>; > WEBCORE_EXPORT CPUMonitor(Seconds checkInterval, ExceededCPULimitHandler&&); > >- WEBCORE_EXPORT void setCPULimit(std::optional<double>); >+ WEBCORE_EXPORT void setCPULimit(Optional<double>); > > private: > void timerFired(); >@@ -45,8 +45,8 @@ private: > Seconds m_checkInterval; > ExceededCPULimitHandler m_exceededCPULimitHandler; > Timer m_timer; >- std::optional<double> m_cpuLimit; >- std::optional<CPUTime> m_lastCPUTime; >+ Optional<double> m_cpuLimit; >+ Optional<CPUTime> m_lastCPUTime; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/Cookie.h b/Source/WebCore/platform/Cookie.h >index b1517db6c3f668df2ded9aa363ed5d06b9e2ffae..1e05fcb362724c27fdabd8e2fb509490388c8dbe 100644 >--- a/Source/WebCore/platform/Cookie.h >+++ b/Source/WebCore/platform/Cookie.h >@@ -48,7 +48,7 @@ struct Cookie { > } > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<Cookie> decode(Decoder&); >+ template<class Decoder> static Optional<Cookie> decode(Decoder&); > > WEBCORE_EXPORT bool operator==(const Cookie&) const; > WEBCORE_EXPORT unsigned hash() const; >@@ -126,35 +126,35 @@ void Cookie::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<Cookie> Cookie::decode(Decoder& decoder) >+Optional<Cookie> Cookie::decode(Decoder& decoder) > { > Cookie cookie; > if (!decoder.decode(cookie.name)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.value)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.domain)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.path)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.created)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.expires)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.httpOnly)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.secure)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.session)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.comment)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.commentURL)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.ports)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(cookie.sameSite)) >- return std::nullopt; >+ return WTF::nullopt; > return cookie; > } > >diff --git a/Source/WebCore/platform/CookiesStrategy.h b/Source/WebCore/platform/CookiesStrategy.h >index 8a5c594830c07d61c900bb2ea784878141770abf..faa2ec2d086db1c86649775dcb415a01ead39748 100644 >--- a/Source/WebCore/platform/CookiesStrategy.h >+++ b/Source/WebCore/platform/CookiesStrategy.h >@@ -40,12 +40,12 @@ enum class IncludeSecureCookies : bool { No, Yes }; > > class CookiesStrategy { > public: >- virtual std::pair<String, bool> cookiesForDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) = 0; >- virtual void setCookiesFromDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& cookieString) = 0; >+ virtual std::pair<String, bool> cookiesForDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) = 0; >+ virtual void setCookiesFromDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& cookieString) = 0; > virtual bool cookiesEnabled(const NetworkStorageSession&) = 0; >- virtual std::pair<String, bool> cookieRequestHeaderFieldValue(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) = 0; >- virtual std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) = 0; >- virtual bool getRawCookies(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>&) = 0; >+ virtual std::pair<String, bool> cookieRequestHeaderFieldValue(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) = 0; >+ virtual std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) = 0; >+ virtual bool getRawCookies(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>&) = 0; > virtual void deleteCookie(const NetworkStorageSession&, const URL&, const String& cookieName) = 0; > > protected: >diff --git a/Source/WebCore/platform/DragImage.cpp b/Source/WebCore/platform/DragImage.cpp >index 27b721688dd358e5f19ab9a0e8a4ecdc642e278b..112b789f3db363306590dc27da2f2077c9e14987 100644 >--- a/Source/WebCore/platform/DragImage.cpp >+++ b/Source/WebCore/platform/DragImage.cpp >@@ -155,7 +155,7 @@ struct ScopedFrameSelectionState { > } > > const Frame& frame; >- std::optional<SelectionRangeData::Context> selection; >+ Optional<SelectionRangeData::Context> selection; > }; > > #if !PLATFORM(IOS_FAMILY) >diff --git a/Source/WebCore/platform/DragImage.h b/Source/WebCore/platform/DragImage.h >index b28c5e04f46c3d3a682acc5a4dc2f2698231d20b..c9cfe644d0116dae423530852e5583955c671496 100644 >--- a/Source/WebCore/platform/DragImage.h >+++ b/Source/WebCore/platform/DragImage.h >@@ -109,19 +109,19 @@ public: > > void setIndicatorData(const TextIndicatorData& data) { m_indicatorData = data; } > bool hasIndicatorData() const { return !!m_indicatorData; } >- std::optional<TextIndicatorData> indicatorData() const { return m_indicatorData; } >+ Optional<TextIndicatorData> indicatorData() const { return m_indicatorData; } > > void setVisiblePath(const Path& path) { m_visiblePath = path; } > bool hasVisiblePath() const { return !!m_visiblePath; } >- std::optional<Path> visiblePath() const { return m_visiblePath; } >+ Optional<Path> visiblePath() const { return m_visiblePath; } > > explicit operator bool() const { return !!m_dragImageRef; } > DragImageRef get() const { return m_dragImageRef; } > > private: > DragImageRef m_dragImageRef; >- std::optional<TextIndicatorData> m_indicatorData; >- std::optional<Path> m_visiblePath; >+ Optional<TextIndicatorData> m_indicatorData; >+ Optional<Path> m_visiblePath; > }; > > } >diff --git a/Source/WebCore/platform/DragItem.h b/Source/WebCore/platform/DragItem.h >index 5992bea18bb360d283a2e7c919fcf8c505e3bc91..774b15ef3beaca791061805fa83c34f8bb7f243e 100644 >--- a/Source/WebCore/platform/DragItem.h >+++ b/Source/WebCore/platform/DragItem.h >@@ -97,7 +97,7 @@ bool DragItem::decode(Decoder& decoder, DragItem& result) > if (!decoder.decode(hasIndicatorData)) > return false; > if (hasIndicatorData) { >- std::optional<TextIndicatorData> indicatorData; >+ Optional<TextIndicatorData> indicatorData; > decoder >> indicatorData; > if (!indicatorData) > return false; >@@ -107,7 +107,7 @@ bool DragItem::decode(Decoder& decoder, DragItem& result) > if (!decoder.decode(hasVisiblePath)) > return false; > if (hasVisiblePath) { >- std::optional<Path> visiblePath; >+ Optional<Path> visiblePath; > decoder >> visiblePath; > if (!visiblePath) > return false; >diff --git a/Source/WebCore/platform/FileStream.cpp b/Source/WebCore/platform/FileStream.cpp >index a2190aa84baf875869e157dc00ede0dd655e5769..ea917374b4c8b4a4ea043c29abf54315922a89e2 100644 >--- a/Source/WebCore/platform/FileStream.cpp >+++ b/Source/WebCore/platform/FileStream.cpp >@@ -49,7 +49,7 @@ FileStream::~FileStream() > close(); > } > >-long long FileStream::getSize(const String& path, std::optional<WallTime> expectedModificationTime) >+long long FileStream::getSize(const String& path, Optional<WallTime> expectedModificationTime) > { > // Check the modification time for the possible file change. > auto modificationTime = FileSystem::getFileModificationTime(path); >diff --git a/Source/WebCore/platform/FileStream.h b/Source/WebCore/platform/FileStream.h >index 7a681b49d50de23214acd20ca9ed9c917e33f2ab..aa011ea23e1854c4b90205962537613a1ab6e12b 100644 >--- a/Source/WebCore/platform/FileStream.h >+++ b/Source/WebCore/platform/FileStream.h >@@ -43,7 +43,7 @@ public: > > // Gets the size of a file. Also validates if the file has been changed or not if the expected modification time is provided, i.e. non-zero. > // Returns total number of bytes if successful. -1 otherwise. >- long long getSize(const String& path, std::optional<WallTime> expectedModificationTime); >+ long long getSize(const String& path, Optional<WallTime> expectedModificationTime); > > // Opens a file for reading. The reading starts at the specified offset and lasts till the specified length. > // Returns true on success. False otherwise. >diff --git a/Source/WebCore/platform/FileSystem.h b/Source/WebCore/platform/FileSystem.h >index 8018935c386a0d999821cbcaf2d95a47100b3522..3cebcaa0539b59d93e72e09840b23b1dac63811b 100644 >--- a/Source/WebCore/platform/FileSystem.h >+++ b/Source/WebCore/platform/FileSystem.h >@@ -104,10 +104,10 @@ WEBCORE_EXPORT bool deleteEmptyDirectory(const String&); > WEBCORE_EXPORT bool moveFile(const String& oldPath, const String& newPath); > WEBCORE_EXPORT bool getFileSize(const String&, long long& result); > WEBCORE_EXPORT bool getFileSize(PlatformFileHandle, long long& result); >-WEBCORE_EXPORT std::optional<WallTime> getFileModificationTime(const String&); >-WEBCORE_EXPORT std::optional<WallTime> getFileCreationTime(const String&); // Not all platforms store file creation time. >-WEBCORE_EXPORT std::optional<FileMetadata> fileMetadata(const String& path); >-WEBCORE_EXPORT std::optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path); >+WEBCORE_EXPORT Optional<WallTime> getFileModificationTime(const String&); >+WEBCORE_EXPORT Optional<WallTime> getFileCreationTime(const String&); // Not all platforms store file creation time. >+WEBCORE_EXPORT Optional<FileMetadata> fileMetadata(const String& path); >+WEBCORE_EXPORT Optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path); > WEBCORE_EXPORT bool fileIsDirectory(const String&, ShouldFollowSymbolicLinks); > WEBCORE_EXPORT String pathByAppendingComponent(const String& path, const String& component); > String pathByAppendingComponents(StringView path, const Vector<StringView>& components); >@@ -117,7 +117,7 @@ String homeDirectoryPath(); > WEBCORE_EXPORT String pathGetFileName(const String&); > WEBCORE_EXPORT String directoryName(const String&); > WEBCORE_EXPORT bool getVolumeFreeSpace(const String&, uint64_t&); >-WEBCORE_EXPORT std::optional<int32_t> getFileDeviceId(const CString&); >+WEBCORE_EXPORT Optional<int32_t> getFileDeviceId(const CString&); > WEBCORE_EXPORT bool createSymbolicLink(const String& targetPath, const String& symbolicLinkPath); > > WEBCORE_EXPORT void setMetadataURL(const String& path, const String& urlString, const String& referrer = { }); >diff --git a/Source/WebCore/platform/LinkIcon.h b/Source/WebCore/platform/LinkIcon.h >index 89e2f8969bb526a364db6b90e30a9b771cde586a..ff29696ab6f50731ec986d44d80b2fad5e266e87 100644 >--- a/Source/WebCore/platform/LinkIcon.h >+++ b/Source/WebCore/platform/LinkIcon.h >@@ -37,7 +37,7 @@ struct LinkIcon { > URL url; > LinkIconType type; > String mimeType; >- std::optional<unsigned> size; >+ Optional<unsigned> size; > Vector<std::pair<String, String>> attributes; > > template<class Encoder> void encode(Encoder&) const; >diff --git a/Source/WebCore/platform/LogInitialization.h b/Source/WebCore/platform/LogInitialization.h >index 2ca770addf4938fb9ab3aa4bead4c7d5ad1d4376..999160d0817287a918e2d310f8f36129454987be 100644 >--- a/Source/WebCore/platform/LogInitialization.h >+++ b/Source/WebCore/platform/LogInitialization.h >@@ -37,7 +37,7 @@ namespace WebCore { > String logLevelString(); > bool isLogChannelEnabled(const String& name); > WEBCORE_EXPORT void setLogChannelToAccumulate(const String& name); >-WEBCORE_EXPORT void initializeLogChannelsIfNecessary(std::optional<String> = std::nullopt); >+WEBCORE_EXPORT void initializeLogChannelsIfNecessary(Optional<String> = WTF::nullopt); > > #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED > >diff --git a/Source/WebCore/platform/Logging.cpp b/Source/WebCore/platform/Logging.cpp >index f74514c6c84e2e3ff1b11d5edcd3564f9420ace9..aec586696fb5eee1931b7fb815e1465d444e1022 100644 >--- a/Source/WebCore/platform/Logging.cpp >+++ b/Source/WebCore/platform/Logging.cpp >@@ -69,7 +69,7 @@ void setLogChannelToAccumulate(const String& name) > logChannelsNeedInitialization = true; > } > >-void initializeLogChannelsIfNecessary(std::optional<String> logChannelString) >+void initializeLogChannelsIfNecessary(Optional<String> logChannelString) > { > if (!logChannelsNeedInitialization && !logChannelString) > return; >diff --git a/Source/WebCore/platform/PODIntervalTree.h b/Source/WebCore/platform/PODIntervalTree.h >index 7f2b70774b6b60048ad64bd56168ccee00f4341c..7a0c8b99cbf4d11b4ec175d7812c41116ceb226d 100644 >--- a/Source/WebCore/platform/PODIntervalTree.h >+++ b/Source/WebCore/platform/PODIntervalTree.h >@@ -116,11 +116,11 @@ public: > return IntervalType(low, high, data); > } > >- std::optional<IntervalType> nextIntervalAfter(const IntervalType& interval) >+ Optional<IntervalType> nextIntervalAfter(const IntervalType& interval) > { > auto next = smallestNodeGreaterThanFrom(interval, this->root()); > if (!next) >- return std::nullopt; >+ return WTF::nullopt; > > return next->data(); > } >diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h >index 79d819beaf39e8c27a96e5ec59f4d3ebf30ba27e..7d2715cd3303a1739d4d3bfb157154b36cb8fbe5 100644 >--- a/Source/WebCore/platform/Pasteboard.h >+++ b/Source/WebCore/platform/Pasteboard.h >@@ -317,7 +317,7 @@ private: > #if PLATFORM(COCOA) > String m_pasteboardName; > long m_changeCount; >- std::optional<PasteboardCustomData> m_customDataCache; >+ Optional<PasteboardCustomData> m_customDataCache; > #endif > > #if PLATFORM(MAC) >diff --git a/Source/WebCore/platform/PasteboardItemInfo.h b/Source/WebCore/platform/PasteboardItemInfo.h >index d627df45e4121cd572f7e96cd081f209fc49eebe..22a098a4418ac37c467e571c216bd73a7d988b32 100644 >--- a/Source/WebCore/platform/PasteboardItemInfo.h >+++ b/Source/WebCore/platform/PasteboardItemInfo.h >@@ -65,7 +65,7 @@ struct PasteboardItemInfo { > } > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<PasteboardItemInfo> decode(Decoder&); >+ template<class Decoder> static Optional<PasteboardItemInfo> decode(Decoder&); > }; > > template<class Encoder> >@@ -76,26 +76,26 @@ void PasteboardItemInfo::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<PasteboardItemInfo> PasteboardItemInfo::decode(Decoder& decoder) >+Optional<PasteboardItemInfo> PasteboardItemInfo::decode(Decoder& decoder) > { > PasteboardItemInfo result; > if (!decoder.decode(result.pathsForFileUpload)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.contentTypesForFileUpload)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.suggestedFileName)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.isNonTextType)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.containsFileURLAndFileUploadContent)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(result.preferredPresentationStyle)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >diff --git a/Source/WebCore/platform/PasteboardWriterData.h b/Source/WebCore/platform/PasteboardWriterData.h >index 5f47592b1019511911797688e78550f48bbed56f..d45fe5013ab67055b49175692af410b8590fa17d 100644 >--- a/Source/WebCore/platform/PasteboardWriterData.h >+++ b/Source/WebCore/platform/PasteboardWriterData.h >@@ -63,7 +63,7 @@ public: > #endif > }; > >- const std::optional<PlainText>& plainText() const { return m_plainText; } >+ const Optional<PlainText>& plainText() const { return m_plainText; } > void setPlainText(PlainText); > > struct URLData { >@@ -76,16 +76,16 @@ public: > #endif > }; > >- const std::optional<URLData>& urlData() const { return m_url; } >+ const Optional<URLData>& urlData() const { return m_url; } > void setURLData(URLData); > >- const std::optional<WebContent>& webContent() const { return m_webContent; } >+ const Optional<WebContent>& webContent() const { return m_webContent; } > void setWebContent(WebContent); > > private: >- std::optional<PlainText> m_plainText; >- std::optional<URLData> m_url; >- std::optional<WebContent> m_webContent; >+ Optional<PlainText> m_plainText; >+ Optional<URLData> m_url; >+ Optional<WebContent> m_webContent; > }; > > } >diff --git a/Source/WebCore/platform/PlatformKeyboardEvent.cpp b/Source/WebCore/platform/PlatformKeyboardEvent.cpp >index c1799cc67c57914cc026ebf2301f641d52c582b2..5aa9fc85206ff1671914af226f58e872e58ed4eb 100644 >--- a/Source/WebCore/platform/PlatformKeyboardEvent.cpp >+++ b/Source/WebCore/platform/PlatformKeyboardEvent.cpp >@@ -30,7 +30,7 @@ > > namespace WebCore { > >-std::optional<OptionSet<PlatformEvent::Modifier>> PlatformKeyboardEvent::s_currentModifiers; >+Optional<OptionSet<PlatformEvent::Modifier>> PlatformKeyboardEvent::s_currentModifiers; > > void PlatformKeyboardEvent::setCurrentModifierState(OptionSet<Modifier> modifiers) > { >diff --git a/Source/WebCore/platform/PlatformKeyboardEvent.h b/Source/WebCore/platform/PlatformKeyboardEvent.h >index dc994f689f4ece228a0856523c5d4a36513cf671..519b6cd77e8970a7e17918deb2c7769c278b7801 100644 >--- a/Source/WebCore/platform/PlatformKeyboardEvent.h >+++ b/Source/WebCore/platform/PlatformKeyboardEvent.h >@@ -210,7 +210,7 @@ namespace WebCore { > #endif > > // The modifier state is optional, since it is not needed in the UI process or in legacy WebKit. >- static std::optional<OptionSet<Modifier>> s_currentModifiers; >+ static Optional<OptionSet<Modifier>> s_currentModifiers; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/Process.cpp b/Source/WebCore/platform/Process.cpp >index c24d9e55c009caa124a59b862615c3659b4204dc..8fcfe3af4a6e3e7b059be857304290ea43436d25 100644 >--- a/Source/WebCore/platform/Process.cpp >+++ b/Source/WebCore/platform/Process.cpp >@@ -31,7 +31,7 @@ > namespace WebCore { > namespace Process { > >-static std::optional<ProcessIdentifier> globalIdentifier; >+static Optional<ProcessIdentifier> globalIdentifier; > > void setIdentifier(ProcessIdentifier processIdentifier) > { >diff --git a/Source/WebCore/platform/ReferrerPolicy.cpp b/Source/WebCore/platform/ReferrerPolicy.cpp >index c509363a851218b9d857769a8e2c20c4fd2d8d90..eba2948624f67a2b239fa81ae0c2124092c00103 100644 >--- a/Source/WebCore/platform/ReferrerPolicy.cpp >+++ b/Source/WebCore/platform/ReferrerPolicy.cpp >@@ -31,7 +31,7 @@ namespace WebCore { > > enum class ShouldParseLegacyKeywords { No, Yes }; > >-static std::optional<ReferrerPolicy> parseReferrerPolicyToken(StringView policy, ShouldParseLegacyKeywords shouldParseLegacyKeywords) >+static Optional<ReferrerPolicy> parseReferrerPolicyToken(StringView policy, ShouldParseLegacyKeywords shouldParseLegacyKeywords) > { > // "never" / "default" / "always" are legacy keywords that we support and still defined in the HTML specification: > // https://html.spec.whatwg.org/#meta-referrer >@@ -63,15 +63,15 @@ static std::optional<ReferrerPolicy> parseReferrerPolicyToken(StringView policy, > if (!policy.isNull() && policy.isEmpty()) > return ReferrerPolicy::EmptyString; > >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<ReferrerPolicy> parseReferrerPolicy(StringView policyString, ReferrerPolicySource source) >+Optional<ReferrerPolicy> parseReferrerPolicy(StringView policyString, ReferrerPolicySource source) > { > switch (source) { > case ReferrerPolicySource::HTTPHeader: { > // Implementing https://www.w3.org/TR/2017/CR-referrer-policy-20170126/#parse-referrer-policy-from-header. >- std::optional<ReferrerPolicy> result; >+ Optional<ReferrerPolicy> result; > for (auto tokenView : policyString.split(',')) { > auto token = parseReferrerPolicyToken(stripLeadingAndTrailingHTTPSpaces(tokenView), ShouldParseLegacyKeywords::No); > if (token && token.value() != ReferrerPolicy::EmptyString) >@@ -83,7 +83,7 @@ std::optional<ReferrerPolicy> parseReferrerPolicy(StringView policyString, Refer > return parseReferrerPolicyToken(policyString, ShouldParseLegacyKeywords::Yes); > } > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/ReferrerPolicy.h b/Source/WebCore/platform/ReferrerPolicy.h >index 2a2a23c5bdb55fc565d780dc14d5aa8a75b5c192..6c535763cc79cf0aaa1d4bb027c2111ac1ab8c92 100644 >--- a/Source/WebCore/platform/ReferrerPolicy.h >+++ b/Source/WebCore/platform/ReferrerPolicy.h >@@ -50,7 +50,7 @@ enum class ReferrerPolicy : uint8_t { > }; > > enum class ReferrerPolicySource : uint8_t { MetaTag, HTTPHeader }; >-std::optional<ReferrerPolicy> parseReferrerPolicy(StringView, ReferrerPolicySource); >+Optional<ReferrerPolicy> parseReferrerPolicy(StringView, ReferrerPolicySource); > > } > >diff --git a/Source/WebCore/platform/RuntimeApplicationChecks.cpp b/Source/WebCore/platform/RuntimeApplicationChecks.cpp >index 2fe42a9f3a19e5b0b4a01b3c8dadf2766e297d41..471101064cceaa485a608a45536575d48da91f62 100644 >--- a/Source/WebCore/platform/RuntimeApplicationChecks.cpp >+++ b/Source/WebCore/platform/RuntimeApplicationChecks.cpp >@@ -37,9 +37,9 @@ namespace WebCore { > static bool presentingApplicationPIDOverrideWasQueried; > #endif > >-static std::optional<int>& presentingApplicationPIDOverride() >+static Optional<int>& presentingApplicationPIDOverride() > { >- static NeverDestroyed<std::optional<int>> pid; >+ static NeverDestroyed<Optional<int>> pid; > #if !ASSERT_MSG_DISABLED > presentingApplicationPIDOverrideWasQueried = true; > #endif >diff --git a/Source/WebCore/platform/ScreenProperties.h b/Source/WebCore/platform/ScreenProperties.h >index 39655f6147bae2fd22ed0cca80fa9c61ac7cd880..56d194fb3c22633b5bd51035ee8998f49e1b9d92 100644 >--- a/Source/WebCore/platform/ScreenProperties.h >+++ b/Source/WebCore/platform/ScreenProperties.h >@@ -55,7 +55,7 @@ struct ScreenData { > }; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ScreenData> decode(Decoder&); >+ template<class Decoder> static Optional<ScreenData> decode(Decoder&); > }; > > typedef HashMap<PlatformDisplayID, ScreenData> ScreenDataMap; >@@ -65,7 +65,7 @@ struct ScreenProperties { > ScreenDataMap screenDataMap; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ScreenProperties> decode(Decoder&); >+ template<class Decoder> static Optional<ScreenProperties> decode(Decoder&); > }; > > template<class Encoder> >@@ -76,17 +76,17 @@ void ScreenProperties::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ScreenProperties> ScreenProperties::decode(Decoder& decoder) >+Optional<ScreenProperties> ScreenProperties::decode(Decoder& decoder) > { >- std::optional<PlatformDisplayID> primaryDisplayID; >+ Optional<PlatformDisplayID> primaryDisplayID; > decoder >> primaryDisplayID; > if (!primaryDisplayID) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ScreenDataMap> screenDataMap; >+ Optional<ScreenDataMap> screenDataMap; > decoder >> screenDataMap; > if (!screenDataMap) >- return std::nullopt; >+ return WTF::nullopt; > > return { { *primaryDisplayID, WTFMove(*screenDataMap) } }; > } >@@ -121,77 +121,77 @@ void ScreenData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ScreenData> ScreenData::decode(Decoder& decoder) >+Optional<ScreenData> ScreenData::decode(Decoder& decoder) > { >- std::optional<FloatRect> screenAvailableRect; >+ Optional<FloatRect> screenAvailableRect; > decoder >> screenAvailableRect; > if (!screenAvailableRect) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<FloatRect> screenRect; >+ Optional<FloatRect> screenRect; > decoder >> screenRect; > if (!screenRect) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> screenDepth; >+ Optional<int> screenDepth; > decoder >> screenDepth; > if (!screenDepth) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> screenDepthPerComponent; >+ Optional<int> screenDepthPerComponent; > decoder >> screenDepthPerComponent; > if (!screenDepthPerComponent) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> screenSupportsExtendedColor; >+ Optional<bool> screenSupportsExtendedColor; > decoder >> screenSupportsExtendedColor; > if (!screenSupportsExtendedColor) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> screenHasInvertedColors; >+ Optional<bool> screenHasInvertedColors; > decoder >> screenHasInvertedColors; > if (!screenHasInvertedColors) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> screenIsMonochrome; >+ Optional<bool> screenIsMonochrome; > decoder >> screenIsMonochrome; > if (!screenIsMonochrome) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint32_t> displayMask; >+ Optional<uint32_t> displayMask; > decoder >> displayMask; > if (!displayMask) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<IORegistryGPUID> gpuID; >+ Optional<IORegistryGPUID> gpuID; > decoder >> gpuID; > if (!gpuID) >- return std::nullopt; >+ return WTF::nullopt; > > EncodedColorSpaceDataType dataType; > if (!decoder.decodeEnum(dataType)) >- return std::nullopt; >+ return WTF::nullopt; > > RetainPtr<CGColorSpaceRef> cgColorSpace; > switch (dataType) { > case Null: > break; > case ColorSpaceName: { >- std::optional<String> colorSpaceName; >+ Optional<String> colorSpaceName; > decoder >> colorSpaceName; > ASSERT(colorSpaceName); > if (!colorSpaceName) >- return std::nullopt; >+ return WTF::nullopt; > > cgColorSpace = adoptCF(CGColorSpaceCreateWithName(colorSpaceName->createCFString().get())); > break; > } > case ColorSpaceData: { >- std::optional<Vector<uint8_t>> iccData; >+ Optional<Vector<uint8_t>> iccData; > decoder >> iccData; > ASSERT(iccData); > if (!iccData) >- return std::nullopt; >+ return WTF::nullopt; > > auto colorSpaceData = adoptCF(CFDataCreate(kCFAllocatorDefault, iccData->data(), iccData->size())); > // FIXME: <http://webkit.org/b/184358> We should switch to CGColorSpaceCreateICCBased. >diff --git a/Source/WebCore/platform/ScrollAnimationKinetic.cpp b/Source/WebCore/platform/ScrollAnimationKinetic.cpp >index ab477937fed9ad2b1e36ee7b6184b993e06fe27c..7466ee93c4aec6cf8b9b8e57ac4233061b10deed 100644 >--- a/Source/WebCore/platform/ScrollAnimationKinetic.cpp >+++ b/Source/WebCore/platform/ScrollAnimationKinetic.cpp >@@ -114,8 +114,8 @@ ScrollAnimationKinetic::~ScrollAnimationKinetic() = default; > void ScrollAnimationKinetic::stop() > { > m_animationTimer.stop(); >- m_horizontalData = std::nullopt; >- m_verticalData = std::nullopt; >+ m_horizontalData = WTF::nullopt; >+ m_verticalData = WTF::nullopt; > } > > void ScrollAnimationKinetic::start(const FloatPoint& initialPosition, const FloatPoint& velocity, bool mayHScroll, bool mayVScroll) >@@ -148,10 +148,10 @@ void ScrollAnimationKinetic::animationTimerFired() > Seconds deltaToNextFrame = 1_s * ceil((currentTime - m_startTime).value() * frameRate) / frameRate - (currentTime - m_startTime); > > if (m_horizontalData && !m_horizontalData.value().animateScroll(deltaToNextFrame)) >- m_horizontalData = std::nullopt; >+ m_horizontalData = WTF::nullopt; > > if (m_verticalData && !m_verticalData.value().animateScroll(deltaToNextFrame)) >- m_verticalData = std::nullopt; >+ m_verticalData = WTF::nullopt; > > // If one of the axes didn't finish its animation we must continue it. > if (m_horizontalData || m_verticalData) >diff --git a/Source/WebCore/platform/ScrollAnimationKinetic.h b/Source/WebCore/platform/ScrollAnimationKinetic.h >index 5458c533075475f9e921759300d5a63ca9dd55ca..cfd33ce5b4958d42a07548416e136c4095255400 100644 >--- a/Source/WebCore/platform/ScrollAnimationKinetic.h >+++ b/Source/WebCore/platform/ScrollAnimationKinetic.h >@@ -69,8 +69,8 @@ private: > > std::function<void(FloatPoint&&)> m_notifyPositionChangedFunction; > >- std::optional<PerAxisData> m_horizontalData; >- std::optional<PerAxisData> m_verticalData; >+ Optional<PerAxisData> m_horizontalData; >+ Optional<PerAxisData> m_verticalData; > > MonotonicTime m_startTime; > Timer m_animationTimer; >diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp >index 98d4ecae887c81197bdfc4a7ff7d2c319b90554d..b19806f2635949f9165d54ddb068b223a9218b5b 100644 >--- a/Source/WebCore/platform/ScrollView.cpp >+++ b/Source/WebCore/platform/ScrollView.cpp >@@ -433,8 +433,8 @@ void ScrollView::handleDeferredScrollUpdateAfterContentSizeChange() > else if (m_deferredScrollOffsets) > scrollOffsetChangedViaPlatformWidgetImpl(m_deferredScrollOffsets.value().first, m_deferredScrollOffsets.value().second); > >- m_deferredScrollDelta = std::nullopt; >- m_deferredScrollOffsets = std::nullopt; >+ m_deferredScrollDelta = WTF::nullopt; >+ m_deferredScrollOffsets = WTF::nullopt; > } > > void ScrollView::scrollTo(const ScrollPosition& newPosition) >diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h >index a84546219723004ad4334616126fed8aaffcd943..4ce9bd8be18602cdd3a6b2a47c9d43764aeec491 100644 >--- a/Source/WebCore/platform/ScrollView.h >+++ b/Source/WebCore/platform/ScrollView.h >@@ -459,8 +459,8 @@ private: > IntSize m_fixedLayoutSize; > IntSize m_contentsSize; > >- std::optional<IntSize> m_deferredScrollDelta; // Needed for WebKit scrolling >- std::optional<std::pair<ScrollOffset, ScrollOffset>> m_deferredScrollOffsets; // Needed for platform widget scrolling >+ Optional<IntSize> m_deferredScrollDelta; // Needed for WebKit scrolling >+ Optional<std::pair<ScrollOffset, ScrollOffset>> m_deferredScrollOffsets; // Needed for platform widget scrolling > > IntPoint m_panScrollIconPoint; > >diff --git a/Source/WebCore/platform/Theme.cpp b/Source/WebCore/platform/Theme.cpp >index c0af192b1d1525b05ad3af5fc809487c7b2610e2..a7e77425142a43d39dafd7284f62a4da6b8c0657 100644 >--- a/Source/WebCore/platform/Theme.cpp >+++ b/Source/WebCore/platform/Theme.cpp >@@ -37,9 +37,9 @@ int Theme::baselinePositionAdjustment(ControlPart) const > return 0; > } > >-std::optional<FontCascadeDescription> Theme::controlFont(ControlPart, const FontCascade&, float) const >+Optional<FontCascadeDescription> Theme::controlFont(ControlPart, const FontCascade&, float) const > { >- return std::nullopt; >+ return WTF::nullopt; > } > > LengthSize Theme::controlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, float) const >diff --git a/Source/WebCore/platform/Theme.h b/Source/WebCore/platform/Theme.h >index e8cec35d5916bcdeb1de3988aa369b5be244e032..6ffda1871e3025f5400add8250ed5e890d869182 100644 >--- a/Source/WebCore/platform/Theme.h >+++ b/Source/WebCore/platform/Theme.h >@@ -52,7 +52,7 @@ public: > virtual int baselinePositionAdjustment(ControlPart) const; > > // The font description result should have a zoomed font size. >- virtual std::optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float zoomFactor) const; >+ virtual Optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float zoomFactor) const; > > // The size here is in zoomed coordinates already. If a new size is returned, it also needs to be in zoomed coordinates. > virtual LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, float zoomFactor) const; >diff --git a/Source/WebCore/platform/Timer.h b/Source/WebCore/platform/Timer.h >index 1741ab9380ddb54d07a1847cd139da6851c48c5b..98e51e3f88ead5ef5051a1339aa13e2a5f72d457 100644 >--- a/Source/WebCore/platform/Timer.h >+++ b/Source/WebCore/platform/Timer.h >@@ -73,7 +73,7 @@ public: > private: > virtual void fired() = 0; > >- virtual std::optional<MonotonicTime> alignedFireTime(MonotonicTime) const { return std::nullopt; } >+ virtual Optional<MonotonicTime> alignedFireTime(MonotonicTime) const { return WTF::nullopt; } > > void checkConsistency() const; > void checkHeapIndex() const; >diff --git a/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp >index 9a1d1979d458a3796ffa0af942362a6e2ce7335c..0210352b0d10c286e9c14105d9ef3d0dda27b3eb 100644 >--- a/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp >+++ b/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp >@@ -308,7 +308,7 @@ static void webKitWebAudioSrcGetProperty(GObject* object, guint propertyId, GVal > } > } > >-static std::optional<Vector<GRefPtr<GstBuffer>>> webKitWebAudioSrcAllocateBuffersAndRenderAudio(WebKitWebAudioSrc* src) >+static Optional<Vector<GRefPtr<GstBuffer>>> webKitWebAudioSrcAllocateBuffersAndRenderAudio(WebKitWebAudioSrc* src) > { > WebKitWebAudioSourcePrivate* priv = src->priv; > >@@ -317,7 +317,7 @@ static std::optional<Vector<GRefPtr<GstBuffer>>> webKitWebAudioSrcAllocateBuffer > if (!priv->provider || !priv->bus) { > GST_ELEMENT_ERROR(src, CORE, FAILED, ("Internal WebAudioSrc error"), ("Can't start without provider or bus")); > gst_task_stop(src->priv->task.get()); >- return std::nullopt; >+ return WTF::nullopt; > } > > ASSERT(priv->pool); >@@ -336,7 +336,7 @@ static std::optional<Vector<GRefPtr<GstBuffer>>> webKitWebAudioSrcAllocateBuffer > // FLUSHING and EOS are not errors. > if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) > GST_ELEMENT_ERROR(src, CORE, PAD, ("Internal WebAudioSrc error"), ("Failed to allocate buffer for flow: %s", gst_flow_get_name(ret))); >- return std::nullopt; >+ return WTF::nullopt; > } > > ASSERT(buffer); >@@ -352,14 +352,14 @@ static std::optional<Vector<GRefPtr<GstBuffer>>> webKitWebAudioSrcAllocateBuffer > // FIXME: Add support for local/live audio input. > priv->provider->render(nullptr, priv->bus, priv->framesToPull); > >- return std::make_optional(channelBufferList); >+ return makeOptional(channelBufferList); > } > > static void webKitWebAudioSrcLoop(WebKitWebAudioSrc* src) > { > WebKitWebAudioSourcePrivate* priv = src->priv; > >- std::optional<Vector<GRefPtr<GstBuffer>>> channelBufferList = webKitWebAudioSrcAllocateBuffersAndRenderAudio(src); >+ Optional<Vector<GRefPtr<GstBuffer>>> channelBufferList = webKitWebAudioSrcAllocateBuffersAndRenderAudio(src); > if (!channelBufferList) { > gst_task_stop(src->priv->task.get()); > return; >diff --git a/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm b/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm >index a5b97831cb58543712da5e1d76e7ec37ad389f19..c54b28833c09d06323405c8a9dd4a89ffcdfc9c0 100644 >--- a/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm >+++ b/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm >@@ -66,9 +66,9 @@ void setApplicationBundleIdentifier(const String& bundleIdentifier) > applicationBundleIdentifierOverride() = bundleIdentifier; > } > >-static std::optional<uint32_t>& applicationSDKVersionOverride() >+static Optional<uint32_t>& applicationSDKVersionOverride() > { >- static NeverDestroyed<std::optional<uint32_t>> version; >+ static NeverDestroyed<Optional<uint32_t>> version; > return version; > } > >diff --git a/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h b/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h >index c538c4efb33aec88576f041d8d8ac7e25eabb522..797a2f95dad9932cf3eb0d726f67a9045392a02d 100644 >--- a/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h >+++ b/Source/WebCore/platform/encryptedmedia/CDMInstanceSession.h >@@ -70,7 +70,7 @@ public: > > using KeyStatusVector = CDMInstanceSessionClient::KeyStatusVector; > using Message = std::pair<MessageType, Ref<SharedBuffer>>; >- using LicenseUpdateCallback = CompletionHandler<void(bool sessionWasClosed, std::optional<KeyStatusVector>&& changedKeys, std::optional<double>&& changedExpiration, std::optional<Message>&& message, SuccessValue succeeded)>; >+ using LicenseUpdateCallback = CompletionHandler<void(bool sessionWasClosed, Optional<KeyStatusVector>&& changedKeys, Optional<double>&& changedExpiration, Optional<Message>&& message, SuccessValue succeeded)>; > virtual void updateLicense(const String& sessionId, LicenseType, const SharedBuffer& response, LicenseUpdateCallback&&) = 0; > > enum class SessionLoadFailure { >@@ -81,13 +81,13 @@ public: > Other, > }; > >- using LoadSessionCallback = CompletionHandler<void(std::optional<KeyStatusVector>&&, std::optional<double>&&, std::optional<Message>&&, SuccessValue, SessionLoadFailure)>; >+ using LoadSessionCallback = CompletionHandler<void(Optional<KeyStatusVector>&&, Optional<double>&&, Optional<Message>&&, SuccessValue, SessionLoadFailure)>; > virtual void loadSession(LicenseType, const String& sessionId, const String& origin, LoadSessionCallback&&) = 0; > > using CloseSessionCallback = CompletionHandler<void()>; > virtual void closeSession(const String& sessionId, CloseSessionCallback&&) = 0; > >- using RemoveSessionDataCallback = CompletionHandler<void(KeyStatusVector&&, std::optional<Ref<SharedBuffer>>&&, SuccessValue)>; >+ using RemoveSessionDataCallback = CompletionHandler<void(KeyStatusVector&&, Optional<Ref<SharedBuffer>>&&, SuccessValue)>; > virtual void removeSessionData(const String& sessionId, LicenseType, RemoveSessionDataCallback&&) = 0; > > virtual void storeRecordOfKeyUsage(const String& sessionId) = 0; >diff --git a/Source/WebCore/platform/encryptedmedia/CDMMediaCapability.h b/Source/WebCore/platform/encryptedmedia/CDMMediaCapability.h >index 66d021148438823d6c533e0b046c38026bbd728e..901b54ff0508eda9bbb88c5c1db86538dce14282 100644 >--- a/Source/WebCore/platform/encryptedmedia/CDMMediaCapability.h >+++ b/Source/WebCore/platform/encryptedmedia/CDMMediaCapability.h >@@ -38,7 +38,7 @@ namespace WebCore { > struct CDMMediaCapability { > String contentType; > String robustness; >- std::optional<CDMEncryptionScheme> encryptionScheme; >+ Optional<CDMEncryptionScheme> encryptionScheme; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/encryptedmedia/CDMPrivate.h b/Source/WebCore/platform/encryptedmedia/CDMPrivate.h >index b6df13a90510218835768d99fb6273ccde0b09f4..e058b07712bfe84c4648e8faca37e1f81df2525c 100644 >--- a/Source/WebCore/platform/encryptedmedia/CDMPrivate.h >+++ b/Source/WebCore/platform/encryptedmedia/CDMPrivate.h >@@ -55,7 +55,7 @@ public: > virtual bool supportsSessions() const = 0; > virtual bool supportsInitData(const AtomicString&, const SharedBuffer&) const = 0; > virtual RefPtr<SharedBuffer> sanitizeResponse(const SharedBuffer&) const = 0; >- virtual std::optional<String> sanitizeSessionId(const String&) const = 0; >+ virtual Optional<String> sanitizeSessionId(const String&) const = 0; > }; > > } >diff --git a/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp b/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp >index 1a1e0ec65cd916656e23dc13c8fbe618e13dddee..be7dfcca35184bc99de4e6d14b98ccd858af582a 100644 >--- a/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp >+++ b/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp >@@ -87,18 +87,18 @@ static RefPtr<JSON::Object> parseJSONObject(const SharedBuffer& buffer) > return object; > } > >-static std::optional<Vector<CDMInstanceClearKey::Key>> parseLicenseFormat(const JSON::Object& root) >+static Optional<Vector<CDMInstanceClearKey::Key>> parseLicenseFormat(const JSON::Object& root) > { > // If the 'keys' key is present in the root object, parse the JSON further > // according to the specified 'license' format. > auto it = root.find("keys"); > if (it == root.end()) >- return std::nullopt; >+ return WTF::nullopt; > > // Retrieve the keys array. > RefPtr<JSON::Array> keysArray; > if (!it->value->asArray(keysArray)) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<CDMInstanceClearKey::Key> decodedKeys; > bool validFormat = std::all_of(keysArray->begin(), keysArray->end(), >@@ -123,7 +123,7 @@ static std::optional<Vector<CDMInstanceClearKey::Key>> parseLicenseFormat(const > return true; > }); > if (!validFormat) >- return std::nullopt; >+ return WTF::nullopt; > > return decodedKeys; > } >@@ -446,13 +446,13 @@ RefPtr<SharedBuffer> CDMPrivateClearKey::sanitizeResponse(const SharedBuffer& re > return response.copy(); > } > >-std::optional<String> CDMPrivateClearKey::sanitizeSessionId(const String& sessionId) const >+Optional<String> CDMPrivateClearKey::sanitizeSessionId(const String& sessionId) const > { > // Validate the session ID string as an 32-bit integer. > bool ok; > sessionId.toUIntStrict(&ok); > if (!ok) >- return std::nullopt; >+ return WTF::nullopt; > return sessionId; > } > >@@ -544,20 +544,20 @@ void CDMInstanceSessionClearKey::updateLicense(const String& sessionId, LicenseT > // Use a helper functor that schedules the callback dispatch, avoiding > // duplicated callOnMainThread() calls. > auto dispatchCallback = >- [this, &callback](bool sessionWasClosed, std::optional<KeyStatusVector>&& changedKeys, SuccessValue succeeded) { >+ [this, &callback](bool sessionWasClosed, Optional<KeyStatusVector>&& changedKeys, SuccessValue succeeded) { > callOnMainThread( > [weakThis = makeWeakPtr(*this), callback = WTFMove(callback), sessionWasClosed, changedKeys = WTFMove(changedKeys), succeeded] () mutable { > if (!weakThis) > return; > >- callback(sessionWasClosed, WTFMove(changedKeys), std::nullopt, std::nullopt, succeeded); >+ callback(sessionWasClosed, WTFMove(changedKeys), WTF::nullopt, WTF::nullopt, succeeded); > }); > }; > > // Parse the response buffer as an JSON object. > RefPtr<JSON::Object> root = parseJSONObject(response); > if (!root) { >- dispatchCallback(false, std::nullopt, SuccessValue::Failed); >+ dispatchCallback(false, WTF::nullopt, SuccessValue::Failed); > return; > } > >@@ -594,7 +594,7 @@ void CDMInstanceSessionClearKey::updateLicense(const String& sessionId, LicenseT > > // In case of changed keys, we have to provide a KeyStatusVector of all the keys for > // this session. >- std::optional<KeyStatusVector> changedKeys; >+ Optional<KeyStatusVector> changedKeys; > if (keysChanged) { > // First a helper Vector is constructed, cotaining pairs of SharedBuffer RefPtrs > // representint key ID data, and the corresponding key statuses. >@@ -615,7 +615,7 @@ void CDMInstanceSessionClearKey::updateLicense(const String& sessionId, LicenseT > }); > > // Finally construct the mirroring KeyStatusVector object and move it into the >- // std::optional<> object that will be passed to the callback. >+ // Optional<> object that will be passed to the callback. > KeyStatusVector keyStatusVector; > keyStatusVector.reserveInitialCapacity(keys.size()); > for (auto& it : keys) >@@ -632,25 +632,25 @@ void CDMInstanceSessionClearKey::updateLicense(const String& sessionId, LicenseT > if (parseLicenseReleaseAcknowledgementFormat(*root)) { > // FIXME: Retrieve the key ID information and use it to validate the keys for this sessionId. > ClearKeyState::singleton().keys().remove(sessionId); >- dispatchCallback(true, std::nullopt, SuccessValue::Succeeded); >+ dispatchCallback(true, WTF::nullopt, SuccessValue::Succeeded); > return; > } > > // Bail in case no format was recognized. >- dispatchCallback(false, std::nullopt, SuccessValue::Failed); >+ dispatchCallback(false, WTF::nullopt, SuccessValue::Failed); > } > > void CDMInstanceSessionClearKey::loadSession(LicenseType, const String& sessionId, const String&, LoadSessionCallback&& callback) > { > // Use a helper functor that schedules the callback dispatch, avoiding duplicated callOnMainThread() calls. > auto dispatchCallback = >- [this, &callback](std::optional<KeyStatusVector>&& existingKeys, SuccessValue success, SessionLoadFailure loadFailure) { >+ [this, &callback](Optional<KeyStatusVector>&& existingKeys, SuccessValue success, SessionLoadFailure loadFailure) { > callOnMainThread( > [weakThis = makeWeakPtr(*this), callback = WTFMove(callback), existingKeys = WTFMove(existingKeys), success, loadFailure]() mutable { > if (!weakThis) > return; > >- callback(WTFMove(existingKeys), std::nullopt, std::nullopt, success, loadFailure); >+ callback(WTFMove(existingKeys), WTF::nullopt, WTF::nullopt, success, loadFailure); > }); > }; > >@@ -660,7 +660,7 @@ void CDMInstanceSessionClearKey::loadSession(LicenseType, const String& sessionI > auto& keys = ClearKeyState::singleton().keys(); > auto it = keys.find(sessionId); > if (it == keys.end()) { >- dispatchCallback(std::nullopt, Failed, SessionLoadFailure::NoSessionData); >+ dispatchCallback(WTF::nullopt, Failed, SessionLoadFailure::NoSessionData); > return; > } > >@@ -688,7 +688,7 @@ void CDMInstanceSessionClearKey::removeSessionData(const String& sessionId, Lice > { > // Use a helper functor that schedules the callback dispatch, avoiding duplicated callOnMainThread() calls. > auto dispatchCallback = >- [this, &callback](KeyStatusVector&& keyStatusVector, std::optional<Ref<SharedBuffer>>&& message, SuccessValue success) { >+ [this, &callback](KeyStatusVector&& keyStatusVector, Optional<Ref<SharedBuffer>>&& message, SuccessValue success) { > callOnMainThread( > [weakThis = makeWeakPtr(*this), callback = WTFMove(callback), keyStatusVector = WTFMove(keyStatusVector), message = WTFMove(message), success]() mutable { > if (!weakThis) >@@ -707,7 +707,7 @@ void CDMInstanceSessionClearKey::removeSessionData(const String& sessionId, Lice > auto& keys = ClearKeyState::singleton().keys(); > auto it = keys.find(sessionId); > if (it == keys.end()) { >- dispatchCallback(KeyStatusVector { }, std::nullopt, SuccessValue::Failed); >+ dispatchCallback(KeyStatusVector { }, WTF::nullopt, SuccessValue::Failed); > return; > } > >diff --git a/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h b/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h >index f11ccdc8c421c99249d4d80c0a7f5c03534550b4..43d5b5f06af8155c3f56d5708548feefb9053184 100644 >--- a/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h >+++ b/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h >@@ -72,7 +72,7 @@ public: > bool supportsSessions() const final; > bool supportsInitData(const AtomicString&, const SharedBuffer&) const final; > RefPtr<SharedBuffer> sanitizeResponse(const SharedBuffer&) const final; >- std::optional<String> sanitizeSessionId(const String&) const final; >+ Optional<String> sanitizeSessionId(const String&) const final; > }; > > class CDMInstanceClearKey final : public CDMInstance, public CanMakeWeakPtr<CDMInstanceClearKey> { >diff --git a/Source/WebCore/platform/glib/FileSystemGlib.cpp b/Source/WebCore/platform/glib/FileSystemGlib.cpp >index b90eec66e23768c71f0a5af18cd8a98aa2fec317..6f70fd8c6025a4f05cdda71560f43d650f406249 100644 >--- a/Source/WebCore/platform/glib/FileSystemGlib.cpp >+++ b/Source/WebCore/platform/glib/FileSystemGlib.cpp >@@ -151,17 +151,17 @@ bool getFileSize(PlatformFileHandle, long long&) > return false; > } > >-std::optional<WallTime> getFileCreationTime(const String&) >+Optional<WallTime> getFileCreationTime(const String&) > { > // FIXME: Is there a way to retrieve file creation time with Gtk on platforms that support it? >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<WallTime> getFileModificationTime(const String& path) >+Optional<WallTime> getFileModificationTime(const String& path) > { > GStatBuf statResult; > if (!getFileStat(path, &statResult)) >- return std::nullopt; >+ return WTF::nullopt; > > return WallTime::fromRawSeconds(statResult.st_mtime); > } >@@ -175,11 +175,11 @@ static FileMetadata::Type toFileMetataType(GStatBuf statResult) > return FileMetadata::Type::File; > } > >-static std::optional<FileMetadata> fileMetadataUsingFunction(const String& path, bool (*statFunc)(const String&, GStatBuf*)) >+static Optional<FileMetadata> fileMetadataUsingFunction(const String& path, bool (*statFunc)(const String&, GStatBuf*)) > { > GStatBuf statResult; > if (!statFunc(path, &statResult)) >- return std::nullopt; >+ return WTF::nullopt; > > String filename = pathGetFileName(path); > bool isHidden = !filename.isEmpty() && filename[0] == '.'; >@@ -192,12 +192,12 @@ static std::optional<FileMetadata> fileMetadataUsingFunction(const String& path, > }; > } > >-std::optional<FileMetadata> fileMetadata(const String& path) >+Optional<FileMetadata> fileMetadata(const String& path) > { > return fileMetadataUsingFunction(path, &getFileLStat); > } > >-std::optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path) >+Optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path) > { > return fileMetadataUsingFunction(path, &getFileStat); > } >@@ -429,16 +429,16 @@ bool hardLinkOrCopyFile(const String& source, const String& destination) > #endif > } > >-std::optional<int32_t> getFileDeviceId(const CString& fsFile) >+Optional<int32_t> getFileDeviceId(const CString& fsFile) > { > GUniquePtr<gchar> filename = unescapedFilename(fsFile.data()); > if (!filename) >- return std::nullopt; >+ return WTF::nullopt; > > GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(filename.get())); > GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_query_filesystem_info(file.get(), G_FILE_ATTRIBUTE_UNIX_DEVICE, nullptr, nullptr)); > if (!fileInfo) >- return std::nullopt; >+ return WTF::nullopt; > > return g_file_info_get_attribute_uint32(fileInfo.get(), G_FILE_ATTRIBUTE_UNIX_DEVICE); > } >diff --git a/Source/WebCore/platform/graphics/BitmapImage.cpp b/Source/WebCore/platform/graphics/BitmapImage.cpp >index 614bc3f4774c76691c738d395865990392543848..a23e219d1a686da730c011be0d1249cce0ba45cd 100644 >--- a/Source/WebCore/platform/graphics/BitmapImage.cpp >+++ b/Source/WebCore/platform/graphics/BitmapImage.cpp >@@ -440,7 +440,7 @@ BitmapImage::StartAnimationStatus BitmapImage::internalStartAnimation() > // through the callback newFrameNativeImageAvailableAtIndex(). Otherwise, advanceAnimation() will be called > // when the timer fires and m_currentFrame will be advanced to nextFrame since it is not being decoded. > if (shouldUseAsyncDecodingForAnimatedImages()) { >- if (frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(nextFrame, m_currentSubsamplingLevel, DecodingOptions(std::optional<IntSize>()))) >+ if (frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(nextFrame, m_currentSubsamplingLevel, DecodingOptions(Optional<IntSize>()))) > LOG(Images, "BitmapImage::%s - %p - url: %s [cachedFrameCount = %ld nextFrame = %ld]", __FUNCTION__, this, sourceURL().string().utf8().data(), ++m_cachedFrameCount, nextFrame); > else { > m_source->requestFrameAsyncDecodingAtIndex(nextFrame, m_currentSubsamplingLevel); >@@ -531,25 +531,25 @@ void BitmapImage::decode(WTF::Function<void()>&& callback) > } > > // The animated image has not been displayed. In this case, either the first frame has not been decoded yet or the animation has not started yet. >- bool frameIsCompatible = frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(m_currentFrame, m_currentSubsamplingLevel, std::optional<IntSize>()); >- bool frameIsBeingDecoded = frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex(m_currentFrame, std::optional<IntSize>()); >+ bool frameIsCompatible = frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(m_currentFrame, m_currentSubsamplingLevel, Optional<IntSize>()); >+ bool frameIsBeingDecoded = frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex(m_currentFrame, Optional<IntSize>()); > > if (frameIsCompatible) > internalStartAnimation(); > else if (!frameIsBeingDecoded) { >- m_source->requestFrameAsyncDecodingAtIndex(m_currentFrame, m_currentSubsamplingLevel, std::optional<IntSize>()); >+ m_source->requestFrameAsyncDecodingAtIndex(m_currentFrame, m_currentSubsamplingLevel, Optional<IntSize>()); > m_currentFrameDecodingStatus = DecodingStatus::Decoding; > } > return; > } > >- bool frameIsCompatible = frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(m_currentFrame, m_currentSubsamplingLevel, std::optional<IntSize>()); >- bool frameIsBeingDecoded = frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex(m_currentFrame, std::optional<IntSize>()); >+ bool frameIsCompatible = frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(m_currentFrame, m_currentSubsamplingLevel, Optional<IntSize>()); >+ bool frameIsBeingDecoded = frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex(m_currentFrame, Optional<IntSize>()); > > if (frameIsCompatible) > callDecodingCallbacks(); > else if (!frameIsBeingDecoded) { >- m_source->requestFrameAsyncDecodingAtIndex(m_currentFrame, m_currentSubsamplingLevel, std::optional<IntSize>()); >+ m_source->requestFrameAsyncDecodingAtIndex(m_currentFrame, m_currentSubsamplingLevel, Optional<IntSize>()); > m_currentFrameDecodingStatus = DecodingStatus::Decoding; > } > } >@@ -595,7 +595,7 @@ void BitmapImage::imageFrameAvailableAtIndex(size_t index) > ++m_decodeCountForTesting; > > // Call m_decodingCallbacks only if the image frame was decoded with the native size. >- if (frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(m_currentFrame, m_currentSubsamplingLevel, std::optional<IntSize>())) >+ if (frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(m_currentFrame, m_currentSubsamplingLevel, Optional<IntSize>())) > callDecodingCallbacks(); > > if (imageObserver()) >diff --git a/Source/WebCore/platform/graphics/BitmapImage.h b/Source/WebCore/platform/graphics/BitmapImage.h >index ab814ea7f5a01675c4283a79e642e9e70a8ced3a..851d5bc4deea9c9aaedd9dfb1b06c6ab33fea31e 100644 >--- a/Source/WebCore/platform/graphics/BitmapImage.h >+++ b/Source/WebCore/platform/graphics/BitmapImage.h >@@ -78,7 +78,7 @@ public: > RepetitionCount repetitionCount() const { return m_source->repetitionCount(); } > String uti() const override { return m_source->uti(); } > String filenameExtension() const override { return m_source->filenameExtension(); } >- std::optional<IntPoint> hotSpot() const override { return m_source->hotSpot(); } >+ Optional<IntPoint> hotSpot() const override { return m_source->hotSpot(); } > > // FloatSize due to override. > FloatSize size() const override { return m_source->size(); } >@@ -90,7 +90,7 @@ public: > bool frameHasAlphaAtIndex(size_t index) const { return m_source->frameHasAlphaAtIndex(index); } > > bool frameHasFullSizeNativeImageAtIndex(size_t index, SubsamplingLevel subsamplingLevel) { return m_source->frameHasFullSizeNativeImageAtIndex(index, subsamplingLevel); } >- bool frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(size_t index, const std::optional<SubsamplingLevel>& subsamplingLevel, const DecodingOptions& decodingOptions) { return m_source->frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(index, subsamplingLevel, decodingOptions); } >+ bool frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(size_t index, const Optional<SubsamplingLevel>& subsamplingLevel, const DecodingOptions& decodingOptions) { return m_source->frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(index, subsamplingLevel, decodingOptions); } > > SubsamplingLevel frameSubsamplingLevelAtIndex(size_t index) const { return m_source->frameSubsamplingLevelAtIndex(index); } > >diff --git a/Source/WebCore/platform/graphics/Color.h b/Source/WebCore/platform/graphics/Color.h >index f08d00c2fc9cb20bc31acc82399a1c3a1a0bcdd3..5d039bbc20e6794f230e6140b409f338e59c71b1 100644 >--- a/Source/WebCore/platform/graphics/Color.h >+++ b/Source/WebCore/platform/graphics/Color.h >@@ -70,7 +70,7 @@ RGBA32 makePremultipliedRGBA(int r, int g, int b, int a, bool ceiling = true); > RGBA32 makeUnPremultipliedRGBA(int r, int g, int b, int a); > > WEBCORE_EXPORT RGBA32 colorWithOverrideAlpha(RGBA32 color, float overrideAlpha); >-RGBA32 colorWithOverrideAlpha(RGBA32 color, std::optional<float> overrideAlpha); >+RGBA32 colorWithOverrideAlpha(RGBA32 color, Optional<float> overrideAlpha); > > WEBCORE_EXPORT RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a); > RGBA32 makeRGBAFromHSLA(double h, double s, double l, double a); >@@ -433,7 +433,7 @@ inline uint16_t fastDivideBy255(uint16_t value) > return approximation + (remainder >> 8); > } > >-inline RGBA32 colorWithOverrideAlpha(RGBA32 color, std::optional<float> overrideAlpha) >+inline RGBA32 colorWithOverrideAlpha(RGBA32 color, Optional<float> overrideAlpha) > { > return overrideAlpha ? colorWithOverrideAlpha(color, overrideAlpha.value()) : color; > } >diff --git a/Source/WebCore/platform/graphics/ComplexTextController.cpp b/Source/WebCore/platform/graphics/ComplexTextController.cpp >index e07a72d864892c2c876be4875a0a255354dbb667..f479f9bec9ce3d62617b739ac5a78d52e60e88df 100644 >--- a/Source/WebCore/platform/graphics/ComplexTextController.cpp >+++ b/Source/WebCore/platform/graphics/ComplexTextController.cpp >@@ -316,19 +316,19 @@ static bool advanceByCombiningCharacterSequence(const UChar*& iterator, const UC > } > > // FIXME: Capitalization is language-dependent and context-dependent and should operate on grapheme clusters instead of codepoints. >-static inline std::optional<UChar32> capitalized(UChar32 baseCharacter) >+static inline Optional<UChar32> capitalized(UChar32 baseCharacter) > { > if (U_GET_GC_MASK(baseCharacter) & U_GC_M_MASK) >- return std::nullopt; >+ return WTF::nullopt; > > UChar32 uppercaseCharacter = u_toupper(baseCharacter); > ASSERT(uppercaseCharacter == baseCharacter || (U_IS_BMP(baseCharacter) == U_IS_BMP(uppercaseCharacter))); > if (uppercaseCharacter != baseCharacter) > return uppercaseCharacter; >- return std::nullopt; >+ return WTF::nullopt; > } > >-static bool shouldSynthesize(bool dontSynthesizeSmallCaps, const Font* nextFont, UChar32 baseCharacter, std::optional<UChar32> capitalizedBase, FontVariantCaps fontVariantCaps, bool engageAllSmallCapsProcessing) >+static bool shouldSynthesize(bool dontSynthesizeSmallCaps, const Font* nextFont, UChar32 baseCharacter, Optional<UChar32> capitalizedBase, FontVariantCaps fontVariantCaps, bool engageAllSmallCapsProcessing) > { > if (dontSynthesizeSmallCaps) > return false; >diff --git a/Source/WebCore/platform/graphics/DecodingOptions.h b/Source/WebCore/platform/graphics/DecodingOptions.h >index 7e993f1537b35d83dd5727a3529c1dcc89b4c5da..f3a0b479e259ced81d412320f198884b1c7932cd 100644 >--- a/Source/WebCore/platform/graphics/DecodingOptions.h >+++ b/Source/WebCore/platform/graphics/DecodingOptions.h >@@ -44,7 +44,7 @@ public: > { > } > >- DecodingOptions(const std::optional<IntSize>& sizeForDrawing) >+ DecodingOptions(const Optional<IntSize>& sizeForDrawing) > : m_decodingModeOrSize(sizeForDrawing) > { > } >@@ -107,10 +107,10 @@ public: > return hasSize() && sizeForDrawing(); > } > >- std::optional<IntSize> sizeForDrawing() const >+ Optional<IntSize> sizeForDrawing() const > { > ASSERT(hasSize()); >- return WTF::get<std::optional<IntSize>>(m_decodingModeOrSize); >+ return WTF::get<Optional<IntSize>>(m_decodingModeOrSize); > } > > static int maxDimension(const IntSize& size) >@@ -132,15 +132,15 @@ private: > > bool hasSize() const > { >- return has<std::optional<IntSize>>(); >+ return has<Optional<IntSize>>(); > } > > // Four states of the decoding: > // - Synchronous: DecodingMode::Synchronous > // - Asynchronous + anySize: DecodingMode::Asynchronous >- // - Asynchronous + intrinsicSize: an empty std::optional<IntSize>> >- // - Asynchronous + sizeForDrawing: a none empty std::optional<IntSize>> >- using DecodingModeOrSize = Variant<DecodingMode, std::optional<IntSize>>; >+ // - Asynchronous + intrinsicSize: an empty Optional<IntSize>> >+ // - Asynchronous + sizeForDrawing: a none empty Optional<IntSize>> >+ using DecodingModeOrSize = Variant<DecodingMode, Optional<IntSize>>; > DecodingModeOrSize m_decodingModeOrSize; > }; > >diff --git a/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h b/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h >index 8fa114c45144598f1e754f3e1c61aafc2dc86315..c669dcb4c0f0e2550cd71fd5ce18d765a7942f7c 100644 >--- a/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h >+++ b/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h >@@ -56,7 +56,7 @@ public: > > private: > bool m_scheduled { false }; >- std::optional<PlatformDisplayID> m_displayID; >+ Optional<PlatformDisplayID> m_displayID; > }; > > } >diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp >index 2ddc79c6d6df468272e832d11af35d920c925f9f..9fabaa07c0c83eed5965b9b76ed81cbcb06ef6cc 100644 >--- a/Source/WebCore/platform/graphics/Font.cpp >+++ b/Source/WebCore/platform/graphics/Font.cpp >@@ -148,7 +148,7 @@ static bool fillGlyphPage(GlyphPage& pageToFill, UChar* buffer, unsigned bufferL > return hasGlyphs; > } > >-static std::optional<size_t> codePointSupportIndex(UChar32 codePoint) >+static Optional<size_t> codePointSupportIndex(UChar32 codePoint) > { > // FIXME: Consider reordering these so the most common ones are at the front. > // Doing this could cause the BitVector to fit inside inline storage and therefore >@@ -157,7 +157,7 @@ static std::optional<size_t> codePointSupportIndex(UChar32 codePoint) > return codePoint; > if (codePoint >= 0x7F && codePoint < 0xA0) > return codePoint - 0x7F + 0x20; >- std::optional<size_t> result; >+ Optional<size_t> result; > switch (codePoint) { > case softHyphen: > result = 0x41; >@@ -220,7 +220,7 @@ static std::optional<size_t> codePointSupportIndex(UChar32 codePoint) > result = 0x54; > break; > default: >- result = std::nullopt; >+ result = WTF::nullopt; > } > > #ifndef NDEBUG >diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h >index cd1b9553db22d633b1ad46c3f114f8ed41de401f..bffcbb85bcacc43588c75c7e8c0947b0f54800ed 100644 >--- a/Source/WebCore/platform/graphics/Font.h >+++ b/Source/WebCore/platform/graphics/Font.h >@@ -255,7 +255,7 @@ private: > mutable HashMap<unsigned, RefPtr<GlyphPage>> m_glyphPages; > mutable std::unique_ptr<GlyphMetricsMap<FloatRect>> m_glyphToBoundsMap; > mutable GlyphMetricsMap<float> m_glyphToWidthMap; >- mutable GlyphMetricsMap<std::optional<Path>> m_glyphPathMap; >+ mutable GlyphMetricsMap<Optional<Path>> m_glyphPathMap; > mutable BitVector m_codePointSupport; > > mutable RefPtr<OpenTypeMathData> m_mathData; >@@ -283,10 +283,10 @@ private: > #if PLATFORM(COCOA) > mutable RetainPtr<CFMutableDictionaryRef> m_nonKernedCFStringAttributes; > mutable RetainPtr<CFMutableDictionaryRef> m_kernedCFStringAttributes; >- mutable std::optional<BitVector> m_glyphsSupportedBySmallCaps; >- mutable std::optional<BitVector> m_glyphsSupportedByAllSmallCaps; >- mutable std::optional<BitVector> m_glyphsSupportedByPetiteCaps; >- mutable std::optional<BitVector> m_glyphsSupportedByAllPetiteCaps; >+ mutable Optional<BitVector> m_glyphsSupportedBySmallCaps; >+ mutable Optional<BitVector> m_glyphsSupportedByAllSmallCaps; >+ mutable Optional<BitVector> m_glyphsSupportedByPetiteCaps; >+ mutable Optional<BitVector> m_glyphsSupportedByAllPetiteCaps; > #endif > > #if PLATFORM(WIN) >diff --git a/Source/WebCore/platform/graphics/FontCache.h b/Source/WebCore/platform/graphics/FontCache.h >index 396036a1fee335c15c5a56dcace7b440c5938b51..d40d3b9b23d7502bf16e240a60f4c310b28c16fd 100644 >--- a/Source/WebCore/platform/graphics/FontCache.h >+++ b/Source/WebCore/platform/graphics/FontCache.h >@@ -245,7 +245,7 @@ public: > PrewarmInformation isolatedCopy() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<PrewarmInformation> decode(Decoder&); >+ template<class Decoder> static Optional<PrewarmInformation> decode(Decoder&); > }; > PrewarmInformation collectPrewarmInformation() const; > void prewarm(const PrewarmInformation&); >@@ -314,7 +314,7 @@ void FontCache::PrewarmInformation::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<FontCache::PrewarmInformation> FontCache::PrewarmInformation::decode(Decoder& decoder) >+Optional<FontCache::PrewarmInformation> FontCache::PrewarmInformation::decode(Decoder& decoder) > { > PrewarmInformation prewarmInformation; > if (!decoder.decode(prewarmInformation.seenFamilies)) >diff --git a/Source/WebCore/platform/graphics/FontCascade.cpp b/Source/WebCore/platform/graphics/FontCascade.cpp >index e2d31b296473b57c8753063bed164f33f652e0fd..e7b2195bda2448a2c098bfdf7877465c4ffdadad 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.cpp >+++ b/Source/WebCore/platform/graphics/FontCascade.cpp >@@ -284,7 +284,7 @@ float FontCascade::glyphBufferForTextRun(CodePath codePathToUse, const TextRun& > return getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer); > } > >-float FontCascade::drawText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, unsigned from, std::optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const >+float FontCascade::drawText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, unsigned from, Optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const > { > unsigned destination = to.value_or(run.length()); > GlyphBuffer glyphBuffer; >@@ -298,7 +298,7 @@ float FontCascade::drawText(GraphicsContext& context, const TextRun& run, const > return startPoint.x() - startX; > } > >-void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, std::optional<unsigned> to) const >+void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, Optional<unsigned> to) const > { > if (isLoadingCustomFonts()) > return; >@@ -310,7 +310,7 @@ void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run > drawEmphasisMarksForComplexText(context, run, mark, point, from, destination); > } > >-std::unique_ptr<DisplayList::DisplayList> FontCascade::displayListForTextRun(GraphicsContext& context, const TextRun& run, unsigned from, std::optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const >+std::unique_ptr<DisplayList::DisplayList> FontCascade::displayListForTextRun(GraphicsContext& context, const TextRun& run, unsigned from, Optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const > { > ASSERT(!context.paintingDisabled()); > unsigned destination = to.value_or(run.length()); >@@ -543,7 +543,7 @@ bool FontCascade::fastAverageCharWidthIfAvailable(float& width) const > return success; > } > >-void FontCascade::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, unsigned from, std::optional<unsigned> to) const >+void FontCascade::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, unsigned from, Optional<unsigned> to) const > { > unsigned destination = to.value_or(run.length()); > if (codePath(run, from, to) != Complex) >@@ -605,7 +605,7 @@ FontCascade::CodePath FontCascade::codePath() > return s_codePath; > } > >-FontCascade::CodePath FontCascade::codePath(const TextRun& run, std::optional<unsigned> from, std::optional<unsigned> to) const >+FontCascade::CodePath FontCascade::codePath(const TextRun& run, Optional<unsigned> from, Optional<unsigned> to) const > { > if (s_codePath != Auto) > return s_codePath; >@@ -1300,27 +1300,27 @@ static GlyphUnderlineType computeUnderlineType(const TextRun& textRun, const Gly > > // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the > // standard emphasis marks do so. >-std::optional<GlyphData> FontCascade::getEmphasisMarkGlyphData(const AtomicString& mark) const >+Optional<GlyphData> FontCascade::getEmphasisMarkGlyphData(const AtomicString& mark) const > { > if (mark.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > UChar32 character; > if (!mark.is8Bit()) { > SurrogatePairAwareTextIterator iterator(mark.characters16(), 0, mark.length(), mark.length()); > unsigned clusterLength; > if (!iterator.consume(character, clusterLength)) >- return std::nullopt; >+ return WTF::nullopt; > } else > character = mark[0]; > >- std::optional<GlyphData> glyphData(glyphDataForCharacter(character, false, EmphasisMarkVariant)); >- return glyphData.value().isValid() ? glyphData : std::nullopt; >+ Optional<GlyphData> glyphData(glyphDataForCharacter(character, false, EmphasisMarkVariant)); >+ return glyphData.value().isValid() ? glyphData : WTF::nullopt; > } > > int FontCascade::emphasisMarkAscent(const AtomicString& mark) const > { >- std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); >+ Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); > if (!markGlyphData) > return 0; > >@@ -1334,7 +1334,7 @@ int FontCascade::emphasisMarkAscent(const AtomicString& mark) const > > int FontCascade::emphasisMarkDescent(const AtomicString& mark) const > { >- std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); >+ Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); > if (!markGlyphData) > return 0; > >@@ -1348,7 +1348,7 @@ int FontCascade::emphasisMarkDescent(const AtomicString& mark) const > > int FontCascade::emphasisMarkHeight(const AtomicString& mark) const > { >- std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); >+ Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); > if (!markGlyphData) > return 0; > >@@ -1495,7 +1495,7 @@ inline static float offsetToMiddleOfGlyphAtIndex(const GlyphBuffer& glyphBuffer, > > void FontCascade::drawEmphasisMarks(GraphicsContext& context, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const > { >- std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); >+ Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark); > if (!markGlyphData) > return; > >@@ -1674,11 +1674,11 @@ struct GlyphIterationState { > float maxX; > }; > >-static std::optional<float> findIntersectionPoint(float y, FloatPoint p1, FloatPoint p2) >+static Optional<float> findIntersectionPoint(float y, FloatPoint p1, FloatPoint p2) > { > if ((p1.y() < y && p2.y() > y) || (p1.y() > y && p2.y() < y)) > return p1.x() + (y - p1.y()) * (p2.x() - p1.x()) / (p2.y() - p1.y()); >- return std::nullopt; >+ return WTF::nullopt; > } > > static void updateX(GlyphIterationState& state, float x) >diff --git a/Source/WebCore/platform/graphics/FontCascade.h b/Source/WebCore/platform/graphics/FontCascade.h >index a792de3e5b9ac2f5f6bfe1dfcd18b6b234af33f3..dd7711abb0a16604e3eb3de64b17056eb58656ba 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.h >+++ b/Source/WebCore/platform/graphics/FontCascade.h >@@ -107,9 +107,9 @@ public: > WEBCORE_EXPORT void update(RefPtr<FontSelector>&& = nullptr) const; > > enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady }; >- WEBCORE_EXPORT float drawText(GraphicsContext&, const TextRun&, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const; >+ WEBCORE_EXPORT float drawText(GraphicsContext&, const TextRun&, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = WTF::nullopt, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const; > static void drawGlyphs(GraphicsContext&, const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, FontSmoothingMode); >- void drawEmphasisMarks(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt) const; >+ void drawEmphasisMarks(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = WTF::nullopt) const; > > DashArray dashesForIntersectionsWithRect(const TextRun&, const FloatPoint& textOrigin, const FloatRect& lineExtents) const; > >@@ -121,7 +121,7 @@ public: > static float width(TextLayout&, unsigned from, unsigned len, HashSet<const Font*>* fallbackFonts = 0); > > int offsetForPosition(const TextRun&, float position, bool includePartialGlyphs) const; >- void adjustSelectionRectForText(const TextRun&, LayoutRect& selectionRect, unsigned from = 0, std::optional<unsigned> to = std::nullopt) const; >+ void adjustSelectionRectForText(const TextRun&, LayoutRect& selectionRect, unsigned from = 0, Optional<unsigned> to = WTF::nullopt) const; > > bool isSmallCaps() const { return m_fontDescription.variantCaps() == FontVariantCaps::Small; } > >@@ -140,8 +140,8 @@ public: > unsigned familyCount() const { return m_fontDescription.familyCount(); } > const AtomicString& familyAt(unsigned i) const { return m_fontDescription.familyAt(i); } > >- // A std::nullopt return value indicates "font-style: normal". >- std::optional<FontSelectionValue> italic() const { return m_fontDescription.italic(); } >+ // A WTF::nullopt return value indicates "font-style: normal". >+ Optional<FontSelectionValue> italic() const { return m_fontDescription.italic(); } > FontSelectionValue weight() const { return m_fontDescription.weight(); } > FontWidthVariant widthVariant() const { return m_fontDescription.widthVariant(); } > >@@ -182,13 +182,13 @@ public: > WEBCORE_EXPORT static bool shouldUseSmoothing(); > > enum CodePath { Auto, Simple, Complex, SimpleWithGlyphOverflow }; >- CodePath codePath(const TextRun&, std::optional<unsigned> from = std::nullopt, std::optional<unsigned> to = std::nullopt) const; >+ CodePath codePath(const TextRun&, Optional<unsigned> from = WTF::nullopt, Optional<unsigned> to = WTF::nullopt) const; > static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simple; } > static CodePath characterRangeCodePath(const UChar*, unsigned len); > > bool primaryFontIsSystemFont() const; > >- std::unique_ptr<DisplayList::DisplayList> displayListForTextRun(GraphicsContext&, const TextRun&, unsigned from = 0, std::optional<unsigned> to = { }, CustomFontNotReadyAction = CustomFontNotReadyAction::DoNotPaintIfFontNotReady) const; >+ std::unique_ptr<DisplayList::DisplayList> displayListForTextRun(GraphicsContext&, const TextRun&, unsigned from = 0, Optional<unsigned> to = { }, CustomFontNotReadyAction = CustomFontNotReadyAction::DoNotPaintIfFontNotReady) const; > > #if PLATFORM(WIN) && USE(CG) > static void setFontSmoothingLevel(int); >@@ -211,7 +211,7 @@ private: > int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const; > void adjustSelectionRectForSimpleText(const TextRun&, LayoutRect& selectionRect, unsigned from, unsigned to) const; > >- std::optional<GlyphData> getEmphasisMarkGlyphData(const AtomicString&) const; >+ Optional<GlyphData> getEmphasisMarkGlyphData(const AtomicString&) const; > > static bool canReturnFallbackFontsForComplexText(); > static bool canExpandAroundIdeographsInComplexText(); >diff --git a/Source/WebCore/platform/graphics/FontCascadeDescription.h b/Source/WebCore/platform/graphics/FontCascadeDescription.h >index b71c354407bad429283e5bdf87b8b85d15b04300..6fa8330db44330b38f993892584c45d6ec64da91 100644 >--- a/Source/WebCore/platform/graphics/FontCascadeDescription.h >+++ b/Source/WebCore/platform/graphics/FontCascadeDescription.h >@@ -119,7 +119,7 @@ public: > #endif > > // Initial values for font properties. >- static std::optional<FontSelectionValue> initialItalic() { return std::nullopt; } >+ static Optional<FontSelectionValue> initialItalic() { return WTF::nullopt; } > static FontStyleAxis initialFontStyleAxis() { return FontStyleAxis::slnt; } > static FontSelectionValue initialWeight() { return normalWeightValue(); } > static FontSelectionValue initialStretch() { return normalStretchValue(); } >diff --git a/Source/WebCore/platform/graphics/FontDescription.h b/Source/WebCore/platform/graphics/FontDescription.h >index 5621eddcecfa7b9400b1c179b1cb6c07a57c45fe..99bd407f5fa6c960bf8b9b649c89662d22f3912a 100644 >--- a/Source/WebCore/platform/graphics/FontDescription.h >+++ b/Source/WebCore/platform/graphics/FontDescription.h >@@ -46,7 +46,7 @@ public: > > float computedSize() const { return m_computedSize; } > unsigned computedPixelSize() const { return unsigned(m_computedSize + 0.5f); } >- std::optional<FontSelectionValue> italic() const { return m_fontSelectionRequest.slope; } >+ Optional<FontSelectionValue> italic() const { return m_fontSelectionRequest.slope; } > FontSelectionValue stretch() const { return m_fontSelectionRequest.width; } > FontSelectionValue weight() const { return m_fontSelectionRequest.weight; } > FontSelectionRequest fontSelectionRequest() const { return m_fontSelectionRequest; } >@@ -99,9 +99,9 @@ public: > AllowUserInstalledFonts shouldAllowUserInstalledFonts() const { return static_cast<AllowUserInstalledFonts>(m_shouldAllowUserInstalledFonts); } > > void setComputedSize(float s) { m_computedSize = clampToFloat(s); } >- void setItalic(std::optional<FontSelectionValue> italic) { m_fontSelectionRequest.slope = italic; } >+ void setItalic(Optional<FontSelectionValue> italic) { m_fontSelectionRequest.slope = italic; } > void setStretch(FontSelectionValue stretch) { m_fontSelectionRequest.width = stretch; } >- void setIsItalic(bool isItalic) { setItalic(isItalic ? std::optional<FontSelectionValue> { italicValue() } : std::optional<FontSelectionValue> { }); } >+ void setIsItalic(bool isItalic) { setItalic(isItalic ? Optional<FontSelectionValue> { italicValue() } : Optional<FontSelectionValue> { }); } > void setWeight(FontSelectionValue weight) { m_fontSelectionRequest.weight = weight; } > void setRenderingMode(FontRenderingMode mode) { m_renderingMode = static_cast<unsigned>(mode); } > void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = static_cast<unsigned>(rendering); } >diff --git a/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp b/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp >index 33dc429ca9626a6cf233a6266ffc1693c31cae4d..357b4023ee08da0cde89682d8dcc778e1c8efe03 100644 >--- a/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp >+++ b/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp >@@ -28,7 +28,7 @@ > > namespace WebCore { > >-FontSelectionAlgorithm::FontSelectionAlgorithm(FontSelectionRequest request, const Vector<Capabilities>& capabilities, std::optional<Capabilities> bounds) >+FontSelectionAlgorithm::FontSelectionAlgorithm(FontSelectionRequest request, const Vector<Capabilities>& capabilities, Optional<Capabilities> bounds) > : m_request(request) > , m_capabilities(capabilities) > { >@@ -139,7 +139,7 @@ auto FontSelectionAlgorithm::weightDistance(Capabilities capabilities) const -> > > FontSelectionValue FontSelectionAlgorithm::bestValue(const bool eliminated[], DistanceFunction computeDistance) const > { >- std::optional<DistanceResult> smallestDistance; >+ Optional<DistanceResult> smallestDistance; > for (size_t i = 0, size = m_capabilities.size(); i < size; ++i) { > if (eliminated[i]) > continue; >diff --git a/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h b/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h >index bc8bd021729c2be25786a4c6ee8de07e6cc95aaa..ab47057a14c1779e58fb9720e39ad38a1b74d7ec 100644 >--- a/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h >+++ b/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h >@@ -171,7 +171,7 @@ constexpr FontSelectionValue italicThreshold() > return FontSelectionValue { 20 }; > } > >-constexpr bool isItalic(std::optional<FontSelectionValue> fontWeight) >+constexpr bool isItalic(Optional<FontSelectionValue> fontWeight) > { > return fontWeight && fontWeight.value() >= italicThreshold(); > } >@@ -337,9 +337,9 @@ struct FontSelectionRequest { > // "fontStyleAxis" on the FontDescription. We should come up with a tri-state member > // so that it's a lot clearer whether we're dealing with a "normal", "italic" or explicit > // "oblique" font style. See webkit.org/b/187774. >- std::optional<Value> slope; >+ Optional<Value> slope; > >- std::tuple<Value, Value, std::optional<Value>> tied() const >+ std::tuple<Value, Value, Optional<Value>> tied() const > { > return WTF::tie(weight, width, slope); > } >@@ -351,7 +351,7 @@ inline TextStream& operator<<(TextStream& ts, const FontSelectionValue& fontSele > return ts; > } > >-inline TextStream& operator<<(TextStream& ts, const std::optional<FontSelectionValue>& optionalFontSelectionValue) >+inline TextStream& operator<<(TextStream& ts, const Optional<FontSelectionValue>& optionalFontSelectionValue) > { > ts << optionalFontSelectionValue.value_or(normalItalicValue()); > return ts; >@@ -407,7 +407,7 @@ constexpr bool operator!=(const FontSelectionCapabilities& a, const FontSelectio > struct FontSelectionSpecifiedCapabilities { > using Capabilities = FontSelectionCapabilities; > using Range = FontSelectionRange; >- using OptionalRange = std::optional<Range>; >+ using OptionalRange = Optional<Range>; > > constexpr Capabilities computeFontSelectionCapabilities() const > { >@@ -465,7 +465,7 @@ public: > using Capabilities = FontSelectionCapabilities; > > FontSelectionAlgorithm() = delete; >- FontSelectionAlgorithm(FontSelectionRequest, const Vector<Capabilities>&, std::optional<Capabilities> capabilitiesBounds = std::nullopt); >+ FontSelectionAlgorithm(FontSelectionRequest, const Vector<Capabilities>&, Optional<Capabilities> capabilitiesBounds = WTF::nullopt); > > struct DistanceResult { > FontSelectionValue distance; >diff --git a/Source/WebCore/platform/graphics/FourCC.cpp b/Source/WebCore/platform/graphics/FourCC.cpp >index d9a8962b0bb0e9a7b86c8573308b85d972b5d1ac..4b8b3e276b439b57ec0ce3cbd936de27941c9e9e 100644 >--- a/Source/WebCore/platform/graphics/FourCC.cpp >+++ b/Source/WebCore/platform/graphics/FourCC.cpp >@@ -28,11 +28,11 @@ > > namespace WebCore { > >-std::optional<FourCC> FourCC::fromString(const String& stringValue) >+Optional<FourCC> FourCC::fromString(const String& stringValue) > { > auto asciiValue = stringValue.ascii(); > if (asciiValue.length() != 4) >- return std::nullopt; >+ return WTF::nullopt; > > const char* data = asciiValue.data(); > ASSERT(asciiValue.data()); >diff --git a/Source/WebCore/platform/graphics/FourCC.h b/Source/WebCore/platform/graphics/FourCC.h >index ad40a9fbd63b51bffcf308802d57f8d4fa3fc270..bab08cfc96d2b4fe0957b129fd395627f526d419 100644 >--- a/Source/WebCore/platform/graphics/FourCC.h >+++ b/Source/WebCore/platform/graphics/FourCC.h >@@ -40,7 +40,7 @@ struct FourCC { > } > > String toString() const; >- WEBCORE_EXPORT static std::optional<FourCC> fromString(const String&); >+ WEBCORE_EXPORT static Optional<FourCC> fromString(const String&); > > bool operator==(const FourCC& other) const { return value == other.value; } > bool operator!=(const FourCC& other) const { return value != other.value; } >diff --git a/Source/WebCore/platform/graphics/GlyphMetricsMap.h b/Source/WebCore/platform/graphics/GlyphMetricsMap.h >index 3c92b765ed5caf625bfbe0625cb101de348185d0..259e97533caedcfc145ff7ab428ea169f64b1594 100644 >--- a/Source/WebCore/platform/graphics/GlyphMetricsMap.h >+++ b/Source/WebCore/platform/graphics/GlyphMetricsMap.h >@@ -115,9 +115,9 @@ template<> inline FloatRect GlyphMetricsMap<FloatRect>::unknownMetrics() > return FloatRect(0, 0, cGlyphSizeUnknown, cGlyphSizeUnknown); > } > >-template<> inline std::optional<Path> GlyphMetricsMap<std::optional<Path>>::unknownMetrics() >+template<> inline Optional<Path> GlyphMetricsMap<Optional<Path>>::unknownMetrics() > { >- return std::nullopt; >+ return WTF::nullopt; > } > > template<class T> typename GlyphMetricsMap<T>::GlyphMetricsPage& GlyphMetricsMap<T>::locatePageSlowCase(unsigned pageNumber) >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp >index 0b5769cd12d21eb7ea7e1897e9f2eb90098121dd..a8f8d84e73214e6fc2943f5899a1f25dca9917a2 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp >@@ -631,7 +631,7 @@ void GraphicsContext::endTransparencyLayer() > --m_transparencyCount; > } > >-float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, unsigned from, std::optional<unsigned> to) >+float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, unsigned from, Optional<unsigned> to) > { > if (paintingDisabled()) > return 0; >@@ -653,7 +653,7 @@ void GraphicsContext::drawGlyphs(const Font& font, const GlyphBuffer& buffer, un > FontCascade::drawGlyphs(*this, font, buffer, from, numGlyphs, point, fontSmoothingMode); > } > >-void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, std::optional<unsigned> to) >+void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, Optional<unsigned> to) > { > if (paintingDisabled()) > return; >@@ -686,7 +686,7 @@ void GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run, > subrun.setDirection(isRTL ? TextDirection::RTL : TextDirection::LTR); > subrun.setDirectionalOverride(bidiRun->dirOverride(false)); > >- float width = font.drawText(*this, subrun, currPoint, 0, std::nullopt, customFontNotReadyAction); >+ float width = font.drawText(*this, subrun, currPoint, 0, WTF::nullopt, customFontNotReadyAction); > currPoint.move(width, 0); > > bidiRun = bidiRun->next(); >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index f9afe8e60600ee276bc00304583e24abf402cf38..1c366d51cbd74d0bcedec5790df2ed71aacc7a96 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -410,9 +410,9 @@ public: > void setTextDrawingMode(TextDrawingModeFlags); > TextDrawingModeFlags textDrawingMode() const { return m_state.textDrawingMode; } > >- float drawText(const FontCascade&, const TextRun&, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt); >+ float drawText(const FontCascade&, const TextRun&, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = WTF::nullopt); > void drawGlyphs(const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, FontSmoothingMode); >- void drawEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt); >+ void drawEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = WTF::nullopt); > void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady); > > void applyState(const GraphicsContextState&); >@@ -697,7 +697,7 @@ public: > m_graphicsContext.setImageInterpolationQuality(interpolationQualityToUse); > } > >- explicit InterpolationQualityMaintainer(GraphicsContext& graphicsContext, std::optional<InterpolationQuality> interpolationQuality) >+ explicit InterpolationQualityMaintainer(GraphicsContext& graphicsContext, Optional<InterpolationQuality> interpolationQuality) > : InterpolationQualityMaintainer(graphicsContext, interpolationQuality ? interpolationQuality.value() : graphicsContext.imageInterpolationQuality()) > { > } >diff --git a/Source/WebCore/platform/graphics/GraphicsContext3D.h b/Source/WebCore/platform/graphics/GraphicsContext3D.h >index fd138d402296d12d59f7f6619b87b76ddbe07ee7..f99a008ebf8a176066e655cc89846e32f2526171 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext3D.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext3D.h >@@ -1413,8 +1413,8 @@ private: > String mappedSymbolName(Platform3DObject program, ANGLEShaderSymbolType, const String& name); > String mappedSymbolName(Platform3DObject shaders[2], size_t count, const String& name); > String originalSymbolName(Platform3DObject program, ANGLEShaderSymbolType, const String& name); >- std::optional<String> mappedSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType, const String& name); >- std::optional<String> originalSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType, const String& name); >+ Optional<String> mappedSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType, const String& name); >+ Optional<String> originalSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType, const String& name); > > std::unique_ptr<ShaderNameHash> nameHashMapForShaders; > >diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.h b/Source/WebCore/platform/graphics/GraphicsLayer.h >index 31c727338caa7373c4576dd8778ae9d2f5d0e0c1..cd793a1207204f2ea9d6556edd100017f5691d30 100644 >--- a/Source/WebCore/platform/graphics/GraphicsLayer.h >+++ b/Source/WebCore/platform/graphics/GraphicsLayer.h >@@ -320,7 +320,7 @@ public: > > // The position of the layer (the location of its top-left corner in its parent) > const FloatPoint& position() const { return m_position; } >- virtual void setPosition(const FloatPoint& p) { m_approximatePosition = std::nullopt; m_position = p; } >+ virtual void setPosition(const FloatPoint& p) { m_approximatePosition = WTF::nullopt; m_position = p; } > > // approximatePosition, if set, overrides position() and is used during coverage rect computation. > FloatPoint approximatePosition() const { return m_approximatePosition ? m_approximatePosition.value() : m_position; } >@@ -609,8 +609,8 @@ public: > virtual bool isGraphicsLayerTextureMapper() const { return false; } > virtual bool isCoordinatedGraphicsLayer() const { return false; } > >- const std::optional<FloatRect>& animationExtent() const { return m_animationExtent; } >- void setAnimationExtent(std::optional<FloatRect> animationExtent) { m_animationExtent = animationExtent; } >+ const Optional<FloatRect>& animationExtent() const { return m_animationExtent; } >+ void setAnimationExtent(Optional<FloatRect> animationExtent) { m_animationExtent = animationExtent; } > > static void traverse(GraphicsLayer&, const WTF::Function<void (GraphicsLayer&)>&); > >@@ -663,7 +663,7 @@ protected: > FloatPoint m_position; > > // If set, overrides m_position. Only used for coverage computation. >- std::optional<FloatPoint> m_approximatePosition; >+ Optional<FloatPoint> m_approximatePosition; > > FloatPoint3D m_anchorPoint { 0.5f, 0.5f, 0 }; > FloatSize m_size; >@@ -724,7 +724,7 @@ protected: > FloatSize m_contentsTilePhase; > FloatSize m_contentsTileSize; > FloatRoundedRect m_backdropFiltersRect; >- std::optional<FloatRect> m_animationExtent; >+ Optional<FloatRect> m_animationExtent; > > #if USE(CA) > WindRule m_shapeLayerWindRule { WindRule::NonZero }; >diff --git a/Source/WebCore/platform/graphics/HEVCUtilities.cpp b/Source/WebCore/platform/graphics/HEVCUtilities.cpp >index d17600c91bf706121e43ae7595b87fb1e56b9dad..40f1566bd3ff680a4ed19b6c57570b8fa847f5d2 100644 >--- a/Source/WebCore/platform/graphics/HEVCUtilities.cpp >+++ b/Source/WebCore/platform/graphics/HEVCUtilities.cpp >@@ -30,30 +30,30 @@ > > namespace WebCore { > >-std::optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecString) >+Optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecString) > { > // The format of the 'hevc' codec string is specified in ISO/IEC 14496-15:2014, Annex E.3. > StringView codecView(codecString); > auto codecSplit = codecView.split('.'); > auto nextElement = codecSplit.begin(); > if (nextElement == codecSplit.end()) >- return std::nullopt; >+ return WTF::nullopt; > > HEVCParameterSet parameters; > > // Codec identifier: legal values are specified in ISO/IEC 14496-15:2014, section 8: > parameters.codecName = (*nextElement).toString(); > if (!equal(parameters.codecName, "hvc1") && !equal(parameters.codecName, "hev1")) >- return std::nullopt; >+ return WTF::nullopt; > > if (++nextElement == codecSplit.end()) >- return std::nullopt; >+ return WTF::nullopt; > > // First element: Optional General Profile Space parameter ['A', 'B', 'C'], mapping to [1, 2, 3] > // and [0] for absent, then General Profile IDC as a 5-bit decimal number. > auto profileSpace = *nextElement; > if (!profileSpace.length()) >- return std::nullopt; >+ return WTF::nullopt; > > auto firstCharacter = profileSpace[0]; > bool hasProfileSpace = firstCharacter >= 'A' && firstCharacter <= 'C'; >@@ -65,10 +65,10 @@ std::optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecStri > bool isValidProfileIDC = false; > parameters.generalProfileIDC = toIntegralType<uint8_t>(profileSpace, &isValidProfileIDC); > if (!isValidProfileIDC) >- return std::nullopt; >+ return WTF::nullopt; > > if (++nextElement == codecSplit.end()) >- return std::nullopt; >+ return WTF::nullopt; > > // Second element: 32 bit of General Profile Compatibility Flags, in reverse bit order, > // in hex with leading zeros omitted. >@@ -76,23 +76,23 @@ std::optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecStri > bool isValidCompatibilityFlags = false; > parameters.generalProfileCompatibilityFlags = toIntegralType<uint32_t>(compatibilityFlags, &isValidCompatibilityFlags, 16); > if (!isValidCompatibilityFlags) >- return std::nullopt; >+ return WTF::nullopt; > > if (++nextElement == codecSplit.end()) >- return std::nullopt; >+ return WTF::nullopt; > > // Third element: General Tier Flag ['L', 'H'], mapping to [false, true], followed by > // General Level IDC as a 8-bit decimal number. > auto generalTier = *nextElement; > firstCharacter = generalTier[0]; > if (firstCharacter != 'L' && firstCharacter != 'H') >- return std::nullopt; >+ return WTF::nullopt; > > parameters.generalTierFlag = firstCharacter == 'H'; > bool isValidGeneralLevelIDC = false; > parameters.generalLevelIDC = toIntegralType<uint8_t>(generalTier.substring(1), &isValidGeneralLevelIDC); > if (!isValidGeneralLevelIDC) >- return std::nullopt; >+ return WTF::nullopt; > > // Optional fourth and remaning elements: a sequence of 6 1-byte constraint flags, each byte encoded > // in hex, and separated by a period, with trailing zero bytes omitted. >@@ -104,7 +104,7 @@ std::optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecStri > bool isValidFlag = false; > flag = toIntegralType<uint8_t>(*nextElement, &isValidFlag, 16); > if (!isValidFlag) >- return std::nullopt; >+ return WTF::nullopt; > } > > return WTFMove(parameters); >diff --git a/Source/WebCore/platform/graphics/HEVCUtilities.h b/Source/WebCore/platform/graphics/HEVCUtilities.h >index 466d9ff0886fb27b5b642f9cefffde9f6dcf34ce..a20992c847a45b33662b63bb65b1c6f1674dbb75 100644 >--- a/Source/WebCore/platform/graphics/HEVCUtilities.h >+++ b/Source/WebCore/platform/graphics/HEVCUtilities.h >@@ -40,6 +40,6 @@ struct HEVCParameterSet { > Vector<unsigned short> constraintFlags { 6, 0 }; > }; > >-WEBCORE_EXPORT std::optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecString); >+WEBCORE_EXPORT Optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecString); > > } >diff --git a/Source/WebCore/platform/graphics/Image.h b/Source/WebCore/platform/graphics/Image.h >index 65cb08eab007272e62652ae2001ef11f1a2bafab..ce505b9de392dbbd4281151c3c5ac35238c0fe99 100644 >--- a/Source/WebCore/platform/graphics/Image.h >+++ b/Source/WebCore/platform/graphics/Image.h >@@ -114,7 +114,7 @@ public: > FloatRect rect() const { return FloatRect(FloatPoint(), size()); } > float width() const { return size().width(); } > float height() const { return size().height(); } >- virtual std::optional<IntPoint> hotSpot() const { return std::nullopt; } >+ virtual Optional<IntPoint> hotSpot() const { return WTF::nullopt; } > > #if PLATFORM(IOS_FAMILY) > virtual FloatSize originalSize() const { return size(); } >diff --git a/Source/WebCore/platform/graphics/ImageBuffer.h b/Source/WebCore/platform/graphics/ImageBuffer.h >index 380b992ae9fd30926c7d2ceccd2d3804df07cde1..0c03055634c75626233de3e1b7d7ca6d031dbbf9 100644 >--- a/Source/WebCore/platform/graphics/ImageBuffer.h >+++ b/Source/WebCore/platform/graphics/ImageBuffer.h >@@ -106,8 +106,8 @@ public: > > void convertToLuminanceMask(); > >- String toDataURL(const String& mimeType, std::optional<double> quality = std::nullopt, PreserveResolution = PreserveResolution::No) const; >- Vector<uint8_t> toData(const String& mimeType, std::optional<double> quality = std::nullopt) const; >+ String toDataURL(const String& mimeType, Optional<double> quality = WTF::nullopt, PreserveResolution = PreserveResolution::No) const; >+ Vector<uint8_t> toData(const String& mimeType, Optional<double> quality = WTF::nullopt) const; > Vector<uint8_t> toBGRAData() const; > > #if !USE(CG) >@@ -171,15 +171,15 @@ private: > WEBCORE_EXPORT ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, const HostWindow*, bool& success); > #if USE(CG) > ImageBuffer(const FloatSize&, float resolutionScale, CGColorSpaceRef, RenderingMode, const HostWindow*, bool& success); >- RetainPtr<CFDataRef> toCFData(const String& mimeType, std::optional<double> quality, PreserveResolution) const; >+ RetainPtr<CFDataRef> toCFData(const String& mimeType, Optional<double> quality, PreserveResolution) const; > #elif USE(DIRECT2D) > ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, const HostWindow*, const GraphicsContext*, bool& success); > #endif > }; > > #if USE(CG) >-String dataURL(const ImageData&, const String& mimeType, std::optional<double> quality); >-Vector<uint8_t> data(const ImageData&, const String& mimeType, std::optional<double> quality); >+String dataURL(const ImageData&, const String& mimeType, Optional<double> quality); >+Vector<uint8_t> data(const ImageData&, const String& mimeType, Optional<double> quality); > #endif > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/ImageDecoder.h b/Source/WebCore/platform/graphics/ImageDecoder.h >index 53b5746834b6cdcd84e5c55f5ffbbb43d1895a12..dc46d11b44e1d5cbad1ec6f1e82ff41356f7abe0 100644 >--- a/Source/WebCore/platform/graphics/ImageDecoder.h >+++ b/Source/WebCore/platform/graphics/ImageDecoder.h >@@ -61,7 +61,7 @@ public: > virtual RepetitionCount repetitionCount() const = 0; > virtual String uti() const { return emptyString(); } > virtual String filenameExtension() const = 0; >- virtual std::optional<IntPoint> hotSpot() const = 0; >+ virtual Optional<IntPoint> hotSpot() const = 0; > > virtual IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default) const = 0; > virtual bool frameIsCompleteAtIndex(size_t) const = 0; >diff --git a/Source/WebCore/platform/graphics/ImageFrame.cpp b/Source/WebCore/platform/graphics/ImageFrame.cpp >index a10a069b585262c50e8c6125ff7468d07ae6d2c1..83b78b6ec006fc5477452ffd081527b2dd916184 100644 >--- a/Source/WebCore/platform/graphics/ImageFrame.cpp >+++ b/Source/WebCore/platform/graphics/ImageFrame.cpp >@@ -101,17 +101,17 @@ IntSize ImageFrame::size() const > return m_size; > } > >-bool ImageFrame::hasNativeImage(const std::optional<SubsamplingLevel>& subsamplingLevel) const >+bool ImageFrame::hasNativeImage(const Optional<SubsamplingLevel>& subsamplingLevel) const > { > return m_nativeImage && (!subsamplingLevel || *subsamplingLevel >= m_subsamplingLevel); > } > >-bool ImageFrame::hasFullSizeNativeImage(const std::optional<SubsamplingLevel>& subsamplingLevel) const >+bool ImageFrame::hasFullSizeNativeImage(const Optional<SubsamplingLevel>& subsamplingLevel) const > { > return hasNativeImage(subsamplingLevel) && (m_decodingOptions.isSynchronous() || m_decodingOptions.hasFullSize()); > } > >-bool ImageFrame::hasDecodedNativeImageCompatibleWithOptions(const std::optional<SubsamplingLevel>& subsamplingLevel, const DecodingOptions& decodingOptions) const >+bool ImageFrame::hasDecodedNativeImageCompatibleWithOptions(const Optional<SubsamplingLevel>& subsamplingLevel, const DecodingOptions& decodingOptions) const > { > return hasNativeImage(subsamplingLevel) && m_decodingOptions.isAsynchronousCompatibleWith(decodingOptions); > } >diff --git a/Source/WebCore/platform/graphics/ImageFrame.h b/Source/WebCore/platform/graphics/ImageFrame.h >index da7e6ea8c88c825037895f055b22cd3c60f1fe91..70355b8693136d34d9dad82f3dfba04dabb226f5 100644 >--- a/Source/WebCore/platform/graphics/ImageFrame.h >+++ b/Source/WebCore/platform/graphics/ImageFrame.h >@@ -76,9 +76,9 @@ public: > void setHasAlpha(bool hasAlpha) { m_hasAlpha = hasAlpha; } > bool hasAlpha() const { return !hasMetadata() || m_hasAlpha; } > >- bool hasNativeImage(const std::optional<SubsamplingLevel>& = { }) const; >- bool hasFullSizeNativeImage(const std::optional<SubsamplingLevel>& = { }) const; >- bool hasDecodedNativeImageCompatibleWithOptions(const std::optional<SubsamplingLevel>&, const DecodingOptions&) const; >+ bool hasNativeImage(const Optional<SubsamplingLevel>& = { }) const; >+ bool hasFullSizeNativeImage(const Optional<SubsamplingLevel>& = { }) const; >+ bool hasDecodedNativeImageCompatibleWithOptions(const Optional<SubsamplingLevel>&, const DecodingOptions&) const; > bool hasMetadata() const { return !size().isEmpty(); } > > Color singlePixelSolidColor() const; >diff --git a/Source/WebCore/platform/graphics/ImageSource.cpp b/Source/WebCore/platform/graphics/ImageSource.cpp >index 68d12a13888c421884eed0b118c998ec5865d96b..68dff9620bc14a19685a4ec16542c5a560e04b6b 100644 >--- a/Source/WebCore/platform/graphics/ImageSource.cpp >+++ b/Source/WebCore/platform/graphics/ImageSource.cpp >@@ -365,7 +365,7 @@ void ImageSource::startAsyncDecodingQueue() > }); > } > >-void ImageSource::requestFrameAsyncDecodingAtIndex(size_t index, SubsamplingLevel subsamplingLevel, const std::optional<IntSize>& sizeForDrawing) >+void ImageSource::requestFrameAsyncDecodingAtIndex(size_t index, SubsamplingLevel subsamplingLevel, const Optional<IntSize>& sizeForDrawing) > { > ASSERT(isDecoderAvailable()); > if (!hasAsyncDecodingQueue()) >@@ -406,7 +406,7 @@ void ImageSource::stopAsyncDecodingQueue() > LOG(Images, "ImageSource::%s - %p - url: %s [decoding has been stopped]", __FUNCTION__, this, sourceURL().string().utf8().data()); > } > >-const ImageFrame& ImageSource::frameAtIndexCacheIfNeeded(size_t index, ImageFrame::Caching caching, const std::optional<SubsamplingLevel>& subsamplingLevel) >+const ImageFrame& ImageSource::frameAtIndexCacheIfNeeded(size_t index, ImageFrame::Caching caching, const Optional<SubsamplingLevel>& subsamplingLevel) > { > ASSERT(index < m_frames.size()); > ImageFrame& frame = m_frames[index]; >@@ -439,11 +439,11 @@ const ImageFrame& ImageSource::frameAtIndexCacheIfNeeded(size_t index, ImageFram > > void ImageSource::clearMetadata() > { >- m_frameCount = std::nullopt; >- m_repetitionCount = std::nullopt; >- m_singlePixelSolidColor = std::nullopt; >- m_encodedDataStatus = std::nullopt; >- m_uti = std::nullopt; >+ m_frameCount = WTF::nullopt; >+ m_repetitionCount = WTF::nullopt; >+ m_singlePixelSolidColor = WTF::nullopt; >+ m_encodedDataStatus = WTF::nullopt; >+ m_uti = WTF::nullopt; > } > > URL ImageSource::sourceURL() const >@@ -462,7 +462,7 @@ long long ImageSource::expectedContentLength() const > } > > template<typename T, T (ImageDecoder::*functor)() const> >-T ImageSource::metadata(const T& defaultValue, std::optional<T>* cachedValue) >+T ImageSource::metadata(const T& defaultValue, Optional<T>* cachedValue) > { > if (cachedValue && *cachedValue) > return cachedValue->value(); >@@ -486,7 +486,7 @@ T ImageSource::frameMetadataAtIndex(size_t index, T (ImageFrame::*functor)(Args. > } > > template<typename T, typename... Args> >-T ImageSource::frameMetadataAtIndexCacheIfNeeded(size_t index, T (ImageFrame::*functor)() const, std::optional<T>* cachedValue, Args&&... args) >+T ImageSource::frameMetadataAtIndexCacheIfNeeded(size_t index, T (ImageFrame::*functor)() const, Optional<T>* cachedValue, Args&&... args) > { > if (cachedValue && *cachedValue) > return cachedValue->value(); >@@ -530,9 +530,9 @@ String ImageSource::filenameExtension() > return metadata<String, (&ImageDecoder::filenameExtension)>(String(), &m_filenameExtension); > } > >-std::optional<IntPoint> ImageSource::hotSpot() >+Optional<IntPoint> ImageSource::hotSpot() > { >- return metadata<std::optional<IntPoint>, (&ImageDecoder::hotSpot)>(std::nullopt, &m_hotSpot); >+ return metadata<Optional<IntPoint>, (&ImageDecoder::hotSpot)>(WTF::nullopt, &m_hotSpot); > } > > IntSize ImageSource::size() >@@ -603,12 +603,12 @@ bool ImageSource::frameHasAlphaAtIndex(size_t index) > return frameMetadataAtIndex<bool>(index, (&ImageFrame::hasAlpha)); > } > >-bool ImageSource::frameHasFullSizeNativeImageAtIndex(size_t index, const std::optional<SubsamplingLevel>& subsamplingLevel) >+bool ImageSource::frameHasFullSizeNativeImageAtIndex(size_t index, const Optional<SubsamplingLevel>& subsamplingLevel) > { > return frameMetadataAtIndex<bool>(index, (&ImageFrame::hasFullSizeNativeImage), subsamplingLevel); > } > >-bool ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(size_t index, const std::optional<SubsamplingLevel>& subsamplingLevel, const DecodingOptions& decodingOptions) >+bool ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(size_t index, const Optional<SubsamplingLevel>& subsamplingLevel, const DecodingOptions& decodingOptions) > { > return frameMetadataAtIndex<bool>(index, (&ImageFrame::hasDecodedNativeImageCompatibleWithOptions), subsamplingLevel, decodingOptions); > } >diff --git a/Source/WebCore/platform/graphics/ImageSource.h b/Source/WebCore/platform/graphics/ImageSource.h >index 980d60ee50d50bc26a00305e03e51b4d44cc9e4f..d46cd9b2d70363865cc27458a84c018934ed128d 100644 >--- a/Source/WebCore/platform/graphics/ImageSource.h >+++ b/Source/WebCore/platform/graphics/ImageSource.h >@@ -76,7 +76,7 @@ public: > // Asynchronous image decoding > bool canUseAsyncDecoding(); > void startAsyncDecodingQueue(); >- void requestFrameAsyncDecodingAtIndex(size_t, SubsamplingLevel, const std::optional<IntSize>& = { }); >+ void requestFrameAsyncDecodingAtIndex(size_t, SubsamplingLevel, const Optional<IntSize>& = { }); > void stopAsyncDecodingQueue(); > bool hasAsyncDecodingQueue() const { return m_decodingQueue; } > bool isAsyncDecodingQueueIdle() const; >@@ -91,7 +91,7 @@ public: > RepetitionCount repetitionCount(); > String uti(); > String filenameExtension(); >- std::optional<IntPoint> hotSpot(); >+ Optional<IntPoint> hotSpot(); > > // Image metadata which is calculated from the first ImageFrame. > WEBCORE_EXPORT IntSize size(); >@@ -104,8 +104,8 @@ public: > DecodingStatus frameDecodingStatusAtIndex(size_t); > bool frameHasAlphaAtIndex(size_t); > bool frameHasImageAtIndex(size_t); >- bool frameHasFullSizeNativeImageAtIndex(size_t, const std::optional<SubsamplingLevel>&); >- bool frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(size_t, const std::optional<SubsamplingLevel>&, const DecodingOptions&); >+ bool frameHasFullSizeNativeImageAtIndex(size_t, const Optional<SubsamplingLevel>&); >+ bool frameHasDecodedNativeImageCompatibleWithOptionsAtIndex(size_t, const Optional<SubsamplingLevel>&, const DecodingOptions&); > SubsamplingLevel frameSubsamplingLevelAtIndex(size_t); > > // ImageFrame metadata which forces caching or re-caching the ImageFrame. >@@ -126,13 +126,13 @@ private: > ImageSource(NativeImagePtr&&); > > template<typename T, T (ImageDecoder::*functor)() const> >- T metadata(const T& defaultValue, std::optional<T>* cachedValue = nullptr); >+ T metadata(const T& defaultValue, Optional<T>* cachedValue = nullptr); > > template<typename T, typename... Args> > T frameMetadataAtIndex(size_t, T (ImageFrame::*functor)(Args...) const, Args&&...); > > template<typename T, typename... Args> >- T frameMetadataAtIndexCacheIfNeeded(size_t, T (ImageFrame::*functor)() const, std::optional<T>* cachedValue, Args&&...); >+ T frameMetadataAtIndexCacheIfNeeded(size_t, T (ImageFrame::*functor)() const, Optional<T>* cachedValue, Args&&...); > > bool ensureDecoderAvailable(SharedBuffer* data); > bool isDecoderAvailable() const { return m_decoder; } >@@ -153,7 +153,7 @@ private: > WorkQueue& decodingQueue(); > SynchronizedFixedQueue<ImageFrameRequest, BufferSize>& frameRequestQueue(); > >- const ImageFrame& frameAtIndexCacheIfNeeded(size_t, ImageFrame::Caching, const std::optional<SubsamplingLevel>& = { }); >+ const ImageFrame& frameAtIndexCacheIfNeeded(size_t, ImageFrame::Caching, const Optional<SubsamplingLevel>& = { }); > > void dump(TextStream&); > >@@ -185,18 +185,18 @@ private: > Seconds m_frameDecodingDurationForTesting; > > // Image metadata. >- std::optional<EncodedDataStatus> m_encodedDataStatus; >- std::optional<size_t> m_frameCount; >- std::optional<RepetitionCount> m_repetitionCount; >- std::optional<String> m_uti; >- std::optional<String> m_filenameExtension; >- std::optional<std::optional<IntPoint>> m_hotSpot; >+ Optional<EncodedDataStatus> m_encodedDataStatus; >+ Optional<size_t> m_frameCount; >+ Optional<RepetitionCount> m_repetitionCount; >+ Optional<String> m_uti; >+ Optional<String> m_filenameExtension; >+ Optional<Optional<IntPoint>> m_hotSpot; > > // Image metadata which is calculated from the first ImageFrame. >- std::optional<IntSize> m_size; >- std::optional<IntSize> m_sizeRespectingOrientation; >- std::optional<Color> m_singlePixelSolidColor; >- std::optional<SubsamplingLevel> m_maximumSubsamplingLevel; >+ Optional<IntSize> m_size; >+ Optional<IntSize> m_sizeRespectingOrientation; >+ Optional<Color> m_singlePixelSolidColor; >+ Optional<SubsamplingLevel> m_maximumSubsamplingLevel; > }; > > } >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp >index be14a72a46f23eef3556581bfcaec33bda3e18eb..6551c1105ff5324e754208ff0d056efff2b48b2f 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp >+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp >@@ -1462,10 +1462,10 @@ bool MediaPlayer::ended() const > return m_private->ended(); > } > >-std::optional<VideoPlaybackQualityMetrics> MediaPlayer::videoPlaybackQualityMetrics() >+Optional<VideoPlaybackQualityMetrics> MediaPlayer::videoPlaybackQualityMetrics() > { > if (!m_private) >- return std::nullopt; >+ return WTF::nullopt; > > return m_private->videoPlaybackQualityMetrics(); > } >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h >index c2816bdd277a2252805bdb1582ccbbd6716403c1..89f50e63244d123aac37b4564704ae6414302a21 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.h >+++ b/Source/WebCore/platform/graphics/MediaPlayer.h >@@ -544,7 +544,7 @@ public: > > unsigned long long fileSize() const; > >- std::optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics(); >+ Optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics(); > > void handlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType); > String sourceApplicationIdentifier() const; >diff --git a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >index 2ad0fabafaec44455023339944adf0c87011dbf5..f4978bac7300fec07589187a052151f9837b3cf1 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >+++ b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >@@ -191,7 +191,7 @@ public: > > virtual bool hasSingleSecurityOrigin() const { return false; } > virtual bool didPassCORSAccessCheck() const { return false; } >- virtual std::optional<bool> wouldTaintOrigin(const SecurityOrigin&) const { return std::nullopt; } >+ virtual Optional<bool> wouldTaintOrigin(const SecurityOrigin&) const { return WTF::nullopt; } > > virtual MediaPlayer::MovieLoadType movieLoadType() const { return MediaPlayer::Unknown; } > >@@ -266,7 +266,7 @@ public: > > virtual bool ended() const { return false; } > >- virtual std::optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() { return std::nullopt; } >+ virtual Optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() { return WTF::nullopt; } > > #if ENABLE(AVF_CAPTIONS) > virtual void notifyTrackModeChanged() { } >diff --git a/Source/WebCore/platform/graphics/PathUtilities.cpp b/Source/WebCore/platform/graphics/PathUtilities.cpp >index 68ba059ad370dbe563b8d79ec36023ef1a2b033a..32bf95c5c262b1504ec57b034976dff831894158 100644 >--- a/Source/WebCore/platform/graphics/PathUtilities.cpp >+++ b/Source/WebCore/platform/graphics/PathUtilities.cpp >@@ -464,13 +464,13 @@ static FloatRoundedRect::Radii adjustedtRadiiForHuggingCurve(const FloatSize& to > return radii; > } > >-static std::optional<FloatRect> rectFromPolygon(const FloatPointGraph::Polygon& poly) >+static Optional<FloatRect> rectFromPolygon(const FloatPointGraph::Polygon& poly) > { > if (poly.size() != 4) >- return std::optional<FloatRect>(); >+ return Optional<FloatRect>(); > >- std::optional<FloatPoint> topLeft; >- std::optional<FloatPoint> bottomRight; >+ Optional<FloatPoint> topLeft; >+ Optional<FloatPoint> bottomRight; > for (unsigned i = 0; i < poly.size(); ++i) { > const auto& toEdge = poly[i]; > const auto& fromEdge = (i > 0) ? poly[i - 1] : poly[poly.size() - 1]; >@@ -484,7 +484,7 @@ static std::optional<FloatRect> rectFromPolygon(const FloatPointGraph::Polygon& > } > } > if (!topLeft || !bottomRight) >- return std::optional<FloatRect>(); >+ return Optional<FloatRect>(); > return FloatRect(topLeft.value(), bottomRight.value()); > } > >@@ -519,7 +519,7 @@ Path PathUtilities::pathWithShrinkWrappedRectsForOutline(const Vector<FloatRect> > return Path(); > const auto& poly = polys.at(0); > // Fast path when poly has one rect only. >- std::optional<FloatRect> rect = rectFromPolygon(poly); >+ Optional<FloatRect> rect = rectFromPolygon(poly); > if (rect) > return roundedRect(rect.value()); > >diff --git a/Source/WebCore/platform/graphics/TiledBacking.h b/Source/WebCore/platform/graphics/TiledBacking.h >index 02b752cc6d9013b54814fe9c761170d794ba65c2..444387c737b519e3c5099d6fa9e9d7b36ea355cc 100644 >--- a/Source/WebCore/platform/graphics/TiledBacking.h >+++ b/Source/WebCore/platform/graphics/TiledBacking.h >@@ -77,7 +77,7 @@ public: > virtual FloatRect visibleRect() const = 0; > > // Only used to update the tile coverage map. >- virtual void setLayoutViewportRect(std::optional<FloatRect>) = 0; >+ virtual void setLayoutViewportRect(Optional<FloatRect>) = 0; > > virtual void setCoverageRect(const FloatRect&) = 0; > virtual FloatRect coverageRect() const = 0; >diff --git a/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp b/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp >index 500f33a4054e1f7a921f67ee2ad792d7e2965f69..7e6d59f97b1b451264420b4bd90959e7cc0aa268 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp >@@ -121,8 +121,8 @@ static SchemeAndKeyResult extractSchemeAndKeyIdFromSinf(const SharedBuffer& buff > SchemeAndKeyResult result; > for (auto& buffer : buffers) { > unsigned offset = 0; >- std::optional<FourCC> scheme; >- std::optional<Vector<uint8_t>> keyID; >+ Optional<FourCC> scheme; >+ Optional<Vector<uint8_t>> keyID; > > auto view = JSC::DataView::create(buffer->tryCreateArrayBuffer(), offset, buffer->size()); > while (auto optionalBoxType = ISOBox::peekBox(view, offset)) { >@@ -158,7 +158,7 @@ static SchemeAndKeyResult extractSchemeAndKeyIdFromSinf(const SharedBuffer& buff > return result; > } > >-std::optional<Vector<Ref<SharedBuffer>>> CDMPrivateFairPlayStreaming::extractKeyIDsSinf(const SharedBuffer& buffer) >+Optional<Vector<Ref<SharedBuffer>>> CDMPrivateFairPlayStreaming::extractKeyIDsSinf(const SharedBuffer& buffer) > { > Vector<Ref<SharedBuffer>> keyIDs; > auto results = extractSchemeAndKeyIdFromSinf(buffer); >@@ -186,7 +186,7 @@ RefPtr<SharedBuffer> CDMPrivateFairPlayStreaming::sanitizeSkd(const SharedBuffer > return buffer.copy(); > } > >-std::optional<Vector<Ref<SharedBuffer>>> CDMPrivateFairPlayStreaming::extractKeyIDsSkd(const SharedBuffer& buffer) >+Optional<Vector<Ref<SharedBuffer>>> CDMPrivateFairPlayStreaming::extractKeyIDsSkd(const SharedBuffer& buffer) > { > // In the 'skd' scheme, the init data is the key ID. > Vector<Ref<SharedBuffer>> keyIDs; >@@ -376,7 +376,7 @@ RefPtr<SharedBuffer> CDMPrivateFairPlayStreaming::sanitizeResponse(const SharedB > return response.copy(); > } > >-std::optional<String> CDMPrivateFairPlayStreaming::sanitizeSessionId(const String& sessionId) const >+Optional<String> CDMPrivateFairPlayStreaming::sanitizeSessionId(const String& sessionId) const > { > return sessionId; > } >diff --git a/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.h b/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.h >index 144c021a2f4cf7756776d5ed4e006e6814f1992d..3cd6123a63e85f9199570ff4097570f7d8c80e57 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.h >+++ b/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.h >@@ -65,14 +65,14 @@ public: > bool supportsSessions() const override; > bool supportsInitData(const AtomicString&, const SharedBuffer&) const override; > RefPtr<SharedBuffer> sanitizeResponse(const SharedBuffer&) const override; >- std::optional<String> sanitizeSessionId(const String&) const override; >+ Optional<String> sanitizeSessionId(const String&) const override; > > static const AtomicString& sinfName(); >- static std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDsSinf(const SharedBuffer&); >+ static Optional<Vector<Ref<SharedBuffer>>> extractKeyIDsSinf(const SharedBuffer&); > static RefPtr<SharedBuffer> sanitizeSinf(const SharedBuffer&); > > static const AtomicString& skdName(); >- static std::optional<Vector<Ref<SharedBuffer>>> extractKeyIDsSkd(const SharedBuffer&); >+ static Optional<Vector<Ref<SharedBuffer>>> extractKeyIDsSkd(const SharedBuffer&); > static RefPtr<SharedBuffer> sanitizeSkd(const SharedBuffer&); > }; > >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h b/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h >index 6732da0c441524d881115b09ea43609b6f2109bd..58f52e2c604d9a479cf0831b36ecbd47ba12de88 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h >@@ -57,7 +57,7 @@ private: > > void loadMIMETypes(); > >- std::optional<HashSet<String, ASCIICaseInsensitiveHash>> m_cache; >+ Optional<HashSet<String, ASCIICaseInsensitiveHash>> m_cache; > CacheMIMETypesCallback m_cacheTypeCallback; > }; > >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >index b3a7a9aae718943e5ab6e4abb2f826d38def2a6d..e03475669af23942899e78c880a01b2d965cf6b2 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm >@@ -344,13 +344,13 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense(const String&, Li > auto* storageDirectory = m_instance->storageDirectory(); > > if (!certificate || !storageDirectory) { >- callback(false, std::nullopt, std::nullopt, std::nullopt, Failed); >+ callback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed); > return; > } > > RetainPtr<NSData> appIdentifier = certificate->createNSData(); > [getAVContentKeySessionClass() removePendingExpiredSessionReports:expiredSessions.get() withAppIdentifier:appIdentifier.get() storageDirectoryAtURL:storageDirectory]; >- callback(false, { }, std::nullopt, std::nullopt, Succeeded); >+ callback(false, { }, WTF::nullopt, WTF::nullopt, Succeeded); > return; > } > >@@ -361,12 +361,12 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense(const String&, Li > } > > if (!m_currentRequest) { >- callback(false, std::nullopt, std::nullopt, std::nullopt, Failed); >+ callback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed); > return; > } > Vector<Ref<SharedBuffer>> keyIDs = keyIDsForRequest(m_currentRequest.get()); > if (keyIDs.isEmpty()) { >- callback(false, std::nullopt, std::nullopt, std::nullopt, Failed); >+ callback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed); > return; > } > >@@ -378,7 +378,7 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense(const String&, Li > KeyStatusVector keyStatuses; > keyStatuses.reserveInitialCapacity(1); > keyStatuses.uncheckedAppend(std::make_pair(WTFMove(keyIDs.first()), KeyStatus::Usable)); >- callback(false, std::make_optional(WTFMove(keyStatuses)), std::nullopt, std::nullopt, Succeeded); >+ callback(false, makeOptional(WTFMove(keyStatuses)), WTF::nullopt, WTF::nullopt, Succeeded); > return; > } > >@@ -391,12 +391,12 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession(LicenseType license > if (licenseType == LicenseType::PersistentUsageRecord) { > auto* storageDirectory = m_instance->storageDirectory(); > if (!m_instance->persistentStateAllowed() || storageDirectory) { >- callback(std::nullopt, std::nullopt, std::nullopt, Failed, SessionLoadFailure::MismatchedSessionType); >+ callback(WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed, SessionLoadFailure::MismatchedSessionType); > return; > } > auto* certificate = m_instance->serverCertificate(); > if (!certificate) { >- callback(std::nullopt, std::nullopt, std::nullopt, Failed, SessionLoadFailure::NoSessionData); >+ callback(WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed, SessionLoadFailure::NoSessionData); > return; > } > >@@ -416,11 +416,11 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession(LicenseType license > } > > if (changedKeys.isEmpty()) { >- callback(std::nullopt, std::nullopt, std::nullopt, Failed, SessionLoadFailure::NoSessionData); >+ callback(WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed, SessionLoadFailure::NoSessionData); > return; > } > >- callback(WTFMove(changedKeys), std::nullopt, std::nullopt, Succeeded, SessionLoadFailure::None); >+ callback(WTFMove(changedKeys), WTF::nullopt, WTF::nullopt, Succeeded, SessionLoadFailure::None); > } > } > >@@ -431,11 +431,11 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(const String&, Clo > ASSERT(!m_requestLicenseCallback); > } > if (m_updateLicenseCallback) { >- m_updateLicenseCallback(true, std::nullopt, std::nullopt, std::nullopt, Failed); >+ m_updateLicenseCallback(true, WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed); > ASSERT(!m_updateLicenseCallback); > } > if (m_removeSessionDataCallback) { >- m_removeSessionDataCallback({ }, std::nullopt, Failed); >+ m_removeSessionDataCallback({ }, WTF::nullopt, Failed); > ASSERT(!m_removeSessionDataCallback); > } > m_currentRequest = nullptr; >@@ -454,7 +454,7 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData(const String& > auto* certificate = m_instance->serverCertificate(); > > if (!m_instance->persistentStateAllowed() || !storageDirectory || !certificate) { >- callback({ }, std::nullopt, Failed); >+ callback({ }, WTF::nullopt, Failed); > return; > } > >@@ -564,9 +564,9 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest(AVCon > return; > > if (error && m_updateLicenseCallback) >- m_updateLicenseCallback(false, std::nullopt, std::nullopt, std::nullopt, Failed); >+ m_updateLicenseCallback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed); > else if (m_updateLicenseCallback) >- m_updateLicenseCallback(false, std::nullopt, std::nullopt, Message(MessageType::LicenseRenewal, SharedBuffer::create(contentKeyRequestData.get())), Succeeded); >+ m_updateLicenseCallback(false, WTF::nullopt, WTF::nullopt, Message(MessageType::LicenseRenewal, SharedBuffer::create(contentKeyRequestData.get())), Succeeded); > else if (m_client) > m_client->sendMessage(CDMMessageType::LicenseRenewal, SharedBuffer::create(contentKeyRequestData.get())); > ASSERT(!m_updateLicenseCallback); >@@ -584,7 +584,7 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest(AVConte > UNUSED_PARAM(request); > UNUSED_PARAM(error); > if (m_updateLicenseCallback) { >- m_updateLicenseCallback(false, std::nullopt, std::nullopt, std::nullopt, Failed); >+ m_updateLicenseCallback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, Failed); > ASSERT(!m_updateLicenseCallback); > } > >@@ -597,7 +597,7 @@ void CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed(AVContentKeyR > { > UNUSED_PARAM(request); > if (m_updateLicenseCallback) { >- m_updateLicenseCallback(false, std::make_optional(keyStatuses()), std::nullopt, std::nullopt, Succeeded); >+ m_updateLicenseCallback(false, makeOptional(keyStatuses()), WTF::nullopt, WTF::nullopt, Succeeded); > ASSERT(!m_updateLicenseCallback); > } > >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h >index fd1a9eef399d2070976fc94ed5fc1a3fb7d78951..60ac34154f3591afa3eaf6f2df382a88bf55e3df 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h >@@ -72,7 +72,7 @@ public: > RepetitionCount repetitionCount() const final; > String uti() const final; > String filenameExtension() const final; >- std::optional<IntPoint> hotSpot() const final { return std::nullopt; } >+ Optional<IntPoint> hotSpot() const final { return WTF::nullopt; } > > IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default) const final; > bool frameIsCompleteAtIndex(size_t) const final; >@@ -123,8 +123,8 @@ private: > DecodeOrderSampleMap::iterator m_cursor; > Lock m_sampleGeneratorLock; > bool m_isAllDataReceived { false }; >- std::optional<IntSize> m_size; >- std::optional<RotationProperties> m_rotation; >+ Optional<IntSize> m_size; >+ Optional<RotationProperties> m_rotation; > }; > > } >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >index 71a698c69dd9216e28612040cf8053e4129d1322..e5bd79d10c53a5cbb88b2a47cd79e93e93f5b25b 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >@@ -232,7 +232,7 @@ private: > void updateVideoLayerGravity() override; > > bool didPassCORSAccessCheck() const override; >- std::optional<bool> wouldTaintOrigin(const SecurityOrigin&) const final; >+ Optional<bool> wouldTaintOrigin(const SecurityOrigin&) const final; > > > MediaTime getStartDate() const override; >@@ -324,7 +324,7 @@ private: > > void setShouldDisableSleep(bool) override; > >- std::optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() final; >+ Optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() final; > > #if !RELEASE_LOG_DISABLED > const char* logClassName() const final { return "MediaPlayerPrivateAVFoundationObjC"; } >@@ -428,7 +428,7 @@ private: > bool m_cachedCanPlayFastForward; > bool m_cachedCanPlayFastReverse; > bool m_muted { false }; >- mutable std::optional<bool> m_tracksArePlayable; >+ mutable Optional<bool> m_tracksArePlayable; > #if ENABLE(WIRELESS_PLAYBACK_TARGET) > mutable bool m_allowsWirelessVideoPlayback; > bool m_shouldPlayToPlaybackTarget { false }; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index d05785cae3616dffbe9939e03da5193c6914954f..7b935bf1b326658567c82e7aa4e9b9cff6692c20 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -2216,7 +2216,7 @@ bool MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck() const > return false; > } > >-std::optional<bool> MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin(const SecurityOrigin& origin) const >+Optional<bool> MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin(const SecurityOrigin& origin) const > { > AVAssetResourceLoader *resourceLoader = m_avAsset.get().resourceLoader; > if (!DeprecatedGlobalSettings::isAVFoundationNSURLSessionEnabled() >@@ -2227,7 +2227,7 @@ std::optional<bool> MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin(const S > if ([session isKindOfClass:[WebCoreNSURLSession class]]) > return [session wouldTaintOrigin:origin]; > >- return std::nullopt; >+ return WTF::nullopt; > } > > >@@ -3264,19 +3264,19 @@ void MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep(bool flag) > #endif > } > >-std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics() >+Optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics() > { > if (![m_videoLayer respondsToSelector:@selector(videoPerformanceMetrics)]) >- return std::nullopt; >+ return WTF::nullopt; > > #if PLATFORM(WATCHOS) >- return std::nullopt; >+ return WTF::nullopt; > #else > ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN > > auto metrics = [m_videoLayer videoPerformanceMetrics]; > if (!metrics) >- return std::nullopt; >+ return WTF::nullopt; > > uint32_t displayCompositedFrames = 0; > if ([metrics respondsToSelector:@selector(numberOfDisplayCompositedVideoFrames)]) >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >index 03605fc42a81b868c9863c6f21f7ecc642530571..a78ce1385bf2e15190a0120ae8531e75afffa188 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >@@ -224,7 +224,7 @@ private: > > size_t extraMemoryCost() const override; > >- std::optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() override; >+ Optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() override; > > #if ENABLE(WIRELESS_PLAYBACK_TARGET) > bool isCurrentPlaybackTargetWireless() const override; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >index 2b50c1a0b46c298df8a5e8580fe56d8067a6378e..eba7bda8cf29ad61895da9b68f0c93d9b270ebbb 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >@@ -640,7 +640,7 @@ size_t MediaPlayerPrivateMediaSourceAVFObjC::extraMemoryCost() const > return 0; > } > >-std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics() >+Optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics() > { > if (m_decompressionSession) { > return VideoPlaybackQualityMetrics { >@@ -654,7 +654,7 @@ std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateMediaSourceAVFObjC: > > auto metrics = [m_sampleBufferDisplayLayer videoPerformanceMetrics]; > if (!metrics) >- return std::nullopt; >+ return WTF::nullopt; > > uint32_t displayCompositedFrames = 0; > ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >index 8300dc3b6e39e8cab145aeba2176e9811dfc9871..7e3f42da0e6bee2742d3c44e1c2a7bbfb367c0c2 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >@@ -188,7 +188,7 @@ private: > Vector<Ref<SharedBuffer>> m_keyIDs; > #endif > >- std::optional<FloatSize> m_cachedSize; >+ Optional<FloatSize> m_cachedSize; > FloatSize m_currentSize; > bool m_parsingSucceeded { true }; > bool m_parserStateWasReset { false }; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >index a99feb7f653c99116d0f339ec3775fc20cef0bed..2eb952347381d540dfe9ac9d50d4b3243da3f7c9 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >@@ -1064,7 +1064,7 @@ void SourceBufferPrivateAVFObjC::flushVideo() > }); > } > >- m_cachedSize = std::nullopt; >+ m_cachedSize = WTF::nullopt; > > if (m_mediaSource) { > m_mediaSource->player()->setHasAvailableVideoFrame(false); >diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >index d8aa37391cbe3b325414366af3ca289c88ea02a1..90548087e5eed8d0f8cbe22e077ef2491addd8af 100644 >--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp >@@ -1420,7 +1420,7 @@ GraphicsLayerCA::VisibleAndCoverageRects GraphicsLayerCA::computeVisibleAndCover > } > > FloatRect coverageRect = clipRectForSelf; >- std::optional<FloatQuad> quad = state.mappedSecondaryQuad(&mapWasClamped); >+ Optional<FloatQuad> quad = state.mappedSecondaryQuad(&mapWasClamped); > if (quad && !mapWasClamped && !applyWasClamped) > coverageRect = (*quad).boundingBox(); > >diff --git a/Source/WebCore/platform/graphics/ca/TileController.cpp b/Source/WebCore/platform/graphics/ca/TileController.cpp >index 80cfc4fac345c92ecd61737fc9254dcd8b755bf8..8d1f1b4cdaa0053377f9549cafc71bb33539d603 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.cpp >+++ b/Source/WebCore/platform/graphics/ca/TileController.cpp >@@ -209,7 +209,7 @@ void TileController::setVisibleRect(const FloatRect& rect) > updateTileCoverageMap(); > } > >-void TileController::setLayoutViewportRect(std::optional<FloatRect> rect) >+void TileController::setLayoutViewportRect(Optional<FloatRect> rect) > { > if (rect == m_layoutViewportRect) > return; >diff --git a/Source/WebCore/platform/graphics/ca/TileController.h b/Source/WebCore/platform/graphics/ca/TileController.h >index ae19b8c5171fd5741a5515f76a69886662faf07c..562d8bb14518095151ec19dc21a898c8378a10bb 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.h >+++ b/Source/WebCore/platform/graphics/ca/TileController.h >@@ -88,7 +88,7 @@ public: > > FloatRect visibleRect() const override { return m_visibleRect; } > FloatRect coverageRect() const override { return m_coverageRect; } >- std::optional<FloatRect> layoutViewportRect() const { return m_layoutViewportRect; } >+ Optional<FloatRect> layoutViewportRect() const { return m_layoutViewportRect; } > > void setTileSizeUpdateDelayDisabledForTesting(bool) final; > >@@ -151,7 +151,7 @@ private: > > // TiledBacking member functions. > void setVisibleRect(const FloatRect&) override; >- void setLayoutViewportRect(std::optional<FloatRect>) override; >+ void setLayoutViewportRect(Optional<FloatRect>) override; > void setCoverageRect(const FloatRect&) override; > bool tilesWouldChangeForCoverageRect(const FloatRect&) const override; > void setTiledScrollingIndicatorPosition(const FloatPoint&) override; >@@ -202,7 +202,7 @@ private: > std::unique_ptr<TileGrid> m_zoomedOutTileGrid; > > FloatRect m_visibleRect; // Only used for scroll performance logging. >- std::optional<FloatRect> m_layoutViewportRect; // Only used by the tiled scrolling indicator. >+ Optional<FloatRect> m_layoutViewportRect; // Only used by the tiled scrolling indicator. > FloatRect m_coverageRect; > IntRect m_boundsAtLastRevalidate; > >diff --git a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp >index ccbbe1f156e0f9e3a0f031da7cce428a6fee94eb..9107c0ee55a3ee9f5eef0e0078cd95111697d1d3 100644 >--- a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp >@@ -648,7 +648,7 @@ static bool encodeImage(cairo_surface_t* image, const String& mimeType, Vector<u > return cairo_surface_write_to_png_stream(image, writeFunction, output) == CAIRO_STATUS_SUCCESS; > } > >-String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> quality, PreserveResolution) const >+String ImageBuffer::toDataURL(const String& mimeType, Optional<double> quality, PreserveResolution) const > { > Vector<uint8_t> encodedImage = toData(mimeType, quality); > if (encodedImage.isEmpty()) >@@ -660,7 +660,7 @@ String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> qual > return "data:" + mimeType + ";base64," + base64Data; > } > >-Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double>) const >+Vector<uint8_t> ImageBuffer::toData(const String& mimeType, Optional<double>) const > { > ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); > >diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp >index 6d40895149979361d79b8d85d695758373f29395..80b5d4fbd272dee435b5ce7c084ee359a501ed64 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp >@@ -472,7 +472,7 @@ static RetainPtr<CFStringRef> utiFromImageBufferMIMEType(const String& mimeType) > #endif > } > >-static bool encodeImage(CGImageRef image, CFStringRef uti, std::optional<double> quality, CFMutableDataRef data) >+static bool encodeImage(CGImageRef image, CFStringRef uti, Optional<double> quality, CFMutableDataRef data) > { > if (!image || !uti || !data) > return false; >@@ -512,21 +512,21 @@ static Vector<uint8_t> dataVector(CFDataRef cfData) > return data; > } > >-String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> quality, PreserveResolution preserveResolution) const >+String ImageBuffer::toDataURL(const String& mimeType, Optional<double> quality, PreserveResolution preserveResolution) const > { > if (auto data = toCFData(mimeType, quality, preserveResolution)) > return dataURL(data.get(), mimeType); > return "data:,"_s; > } > >-Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double> quality) const >+Vector<uint8_t> ImageBuffer::toData(const String& mimeType, Optional<double> quality) const > { > if (auto data = toCFData(mimeType, quality, PreserveResolution::No)) > return dataVector(data.get()); > return { }; > } > >-RetainPtr<CFDataRef> ImageBuffer::toCFData(const String& mimeType, std::optional<double> quality, PreserveResolution preserveResolution) const >+RetainPtr<CFDataRef> ImageBuffer::toCFData(const String& mimeType, Optional<double> quality, PreserveResolution preserveResolution) const > { > ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); > >@@ -572,7 +572,7 @@ RetainPtr<CFDataRef> ImageBuffer::toCFData(const String& mimeType, std::optional > return WTFMove(cfData); > } > >-static RetainPtr<CFDataRef> cfData(const ImageData& source, const String& mimeType, std::optional<double> quality) >+static RetainPtr<CFDataRef> cfData(const ImageData& source, const String& mimeType, Optional<double> quality) > { > ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); > >@@ -622,14 +622,14 @@ static RetainPtr<CFDataRef> cfData(const ImageData& source, const String& mimeTy > return WTFMove(cfData); > } > >-String dataURL(const ImageData& source, const String& mimeType, std::optional<double> quality) >+String dataURL(const ImageData& source, const String& mimeType, Optional<double> quality) > { > if (auto data = cfData(source, mimeType, quality)) > return dataURL(data.get(), mimeType); > return "data:,"_s; > } > >-Vector<uint8_t> data(const ImageData& source, const String& mimeType, std::optional<double> quality) >+Vector<uint8_t> data(const ImageData& source, const String& mimeType, Optional<double> quality) > { > if (auto data = cfData(source, mimeType, quality)) > return dataVector(data.get()); >diff --git a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp >index e18e63fefd6014ca5605b66a508fa6cf4382a00c..f67c5274fda8d39a30d511d8739f78a41f795756 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp >@@ -266,23 +266,23 @@ RepetitionCount ImageDecoderCG::repetitionCount() const > return RepetitionCountNone; > } > >-std::optional<IntPoint> ImageDecoderCG::hotSpot() const >+Optional<IntPoint> ImageDecoderCG::hotSpot() const > { > RetainPtr<CFDictionaryRef> properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get())); > if (!properties) >- return std::nullopt; >+ return WTF::nullopt; > > int x = -1, y = -1; > CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR("hotspotX")); > if (!num || !CFNumberGetValue(num, kCFNumberIntType, &x)) >- return std::nullopt; >+ return WTF::nullopt; > > num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR("hotspotY")); > if (!num || !CFNumberGetValue(num, kCFNumberIntType, &y)) >- return std::nullopt; >+ return WTF::nullopt; > > if (x < 0 || y < 0) >- return std::nullopt; >+ return WTF::nullopt; > > return IntPoint(x, y); > } >@@ -405,7 +405,7 @@ NativeImagePtr ImageDecoderCG::createFrameImageAtIndex(size_t index, Subsampling > > if (decodingOptions.hasSizeForDrawing()) { > // See which size is smaller: the image native size or the sizeForDrawing. >- std::optional<IntSize> sizeForDrawing = decodingOptions.sizeForDrawing(); >+ Optional<IntSize> sizeForDrawing = decodingOptions.sizeForDrawing(); > if (sizeForDrawing.value().unclampedArea() < size.unclampedArea()) > size = sizeForDrawing.value(); > } >diff --git a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h >index eac32d55c42d1b2ea8b7529a1d1cdd10efa2c6d6..acd0efcc779e6417e20870e761913a5ae4b05b3d 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h >+++ b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h >@@ -50,7 +50,7 @@ public: > RepetitionCount repetitionCount() const final; > String uti() const final; > String filenameExtension() const final; >- std::optional<IntPoint> hotSpot() const final; >+ Optional<IntPoint> hotSpot() const final; > > IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default) const final; > bool frameIsCompleteAtIndex(size_t) const final; >diff --git a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >index 30244cf658255f5495f6c45c17f2cafc554ca399..50bdb5f5f25a67b36fcce32c5a4c657a67bc3be8 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >+++ b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >@@ -971,13 +971,13 @@ struct MinMax { > }; > > struct VariationCapabilities { >- std::optional<MinMax> weight; >- std::optional<MinMax> width; >- std::optional<MinMax> slope; >+ Optional<MinMax> weight; >+ Optional<MinMax> width; >+ Optional<MinMax> slope; > }; > > #if ENABLE(VARIATION_FONTS) >-static std::optional<MinMax> extractVariationBounds(CFDictionaryRef axis) >+static Optional<MinMax> extractVariationBounds(CFDictionaryRef axis) > { > CFNumberRef minimumValue = static_cast<CFNumberRef>(CFDictionaryGetValue(axis, kCTFontVariationAxisMinimumValueKey)); > CFNumberRef maximumValue = static_cast<CFNumberRef>(CFDictionaryGetValue(axis, kCTFontVariationAxisMaximumValueKey)); >@@ -987,7 +987,7 @@ static std::optional<MinMax> extractVariationBounds(CFDictionaryRef axis) > CFNumberGetValue(maximumValue, kCFNumberFloatType, &rawMaximumValue); > if (rawMinimumValue < rawMaximumValue) > return {{ rawMinimumValue, rawMaximumValue }}; >- return std::nullopt; >+ return WTF::nullopt; > } > #endif > >diff --git a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm >index 5d4300024adce28ecef88933a2ec9fe549e3e1f5..89c25715306d75e36e10a786e96f2d6846cbc354 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm >@@ -395,7 +395,7 @@ static inline bool isTrueTypeFeature(CFDictionaryRef feature) > return CFDictionaryContainsKey(feature, kCTFontFeatureTypeIdentifierKey) && CFDictionaryContainsKey(feature, kCTFontFeatureSelectorIdentifierKey); > } > >-static inline std::optional<CFStringRef> openTypeFeature(CFDictionaryRef feature) >+static inline Optional<CFStringRef> openTypeFeature(CFDictionaryRef feature) > { > ASSERT(isOpenTypeFeature(feature)); > CFStringRef tag = static_cast<CFStringRef>(CFDictionaryGetValue(feature, kCTFontOpenTypeFeatureTag)); >@@ -403,7 +403,7 @@ static inline std::optional<CFStringRef> openTypeFeature(CFDictionaryRef feature > CFNumberRef value = static_cast<CFNumberRef>(CFDictionaryGetValue(feature, kCTFontOpenTypeFeatureValue)); > auto success = CFNumberGetValue(value, kCFNumberIntType, &rawValue); > ASSERT_UNUSED(success, success); >- return rawValue ? std::optional<CFStringRef>(tag) : std::nullopt; >+ return rawValue ? Optional<CFStringRef>(tag) : WTF::nullopt; > } > > static inline std::pair<int, int> trueTypeFeature(CFDictionaryRef feature) >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >index 6f91cd0e55d966a35ce2e40748d698d8df2df01d..b75f430f2d11944bf52eb1fb01d9e9d721e8350b 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >@@ -391,7 +391,7 @@ void DrawGlyphs::computeBounds() > } > } > >-std::optional<FloatRect> DrawGlyphs::localBounds(const GraphicsContext&) const >+Optional<FloatRect> DrawGlyphs::localBounds(const GraphicsContext&) const > { > FloatRect localBounds = m_bounds; > localBounds.move(m_blockLocation.x(), m_blockLocation.y()); >@@ -571,7 +571,7 @@ static TextStream& operator<<(TextStream& ts, const DrawRect& item) > return ts; > } > >-std::optional<FloatRect> DrawLine::localBounds(const GraphicsContext&) const >+Optional<FloatRect> DrawLine::localBounds(const GraphicsContext&) const > { > FloatRect bounds; > bounds.fitToPoints(m_point1, m_point2); >@@ -596,7 +596,7 @@ void DrawLinesForText::apply(GraphicsContext& context) const > context.drawLinesForText(point(), m_thickness, m_widths, m_printing, m_doubleLines); > } > >-std::optional<FloatRect> DrawLinesForText::localBounds(const GraphicsContext&) const >+Optional<FloatRect> DrawLinesForText::localBounds(const GraphicsContext&) const > { > // This function needs to return a value equal to or enclosing what GraphicsContext::computeLineBoundsAndAntialiasingModeForText() returns. > >@@ -627,7 +627,7 @@ void DrawDotsForDocumentMarker::apply(GraphicsContext& context) const > context.drawDotsForDocumentMarker(m_rect, m_style); > } > >-std::optional<FloatRect> DrawDotsForDocumentMarker::localBounds(const GraphicsContext&) const >+Optional<FloatRect> DrawDotsForDocumentMarker::localBounds(const GraphicsContext&) const > { > return m_rect; > } >@@ -671,7 +671,7 @@ void DrawFocusRingPath::apply(GraphicsContext& context) const > context.drawFocusRing(m_path, m_width, m_offset, m_color); > } > >-std::optional<FloatRect> DrawFocusRingPath::localBounds(const GraphicsContext&) const >+Optional<FloatRect> DrawFocusRingPath::localBounds(const GraphicsContext&) const > { > FloatRect result = m_path.fastBoundingRect(); > result.inflate(platformFocusRingWidth); >@@ -693,7 +693,7 @@ void DrawFocusRingRects::apply(GraphicsContext& context) const > context.drawFocusRing(m_rects, m_width, m_offset, m_color); > } > >-std::optional<FloatRect> DrawFocusRingRects::localBounds(const GraphicsContext&) const >+Optional<FloatRect> DrawFocusRingRects::localBounds(const GraphicsContext&) const > { > FloatRect result; > for (auto& rect : m_rects) >@@ -817,7 +817,7 @@ static TextStream& operator<<(TextStream& ts, const FillEllipse& item) > return ts; > } > >-std::optional<FloatRect> StrokeRect::localBounds(const GraphicsContext&) const >+Optional<FloatRect> StrokeRect::localBounds(const GraphicsContext&) const > { > FloatRect bounds = m_rect; > bounds.expand(m_lineWidth, m_lineWidth); >@@ -837,7 +837,7 @@ static TextStream& operator<<(TextStream& ts, const StrokeRect& item) > return ts; > } > >-std::optional<FloatRect> StrokePath::localBounds(const GraphicsContext& context) const >+Optional<FloatRect> StrokePath::localBounds(const GraphicsContext& context) const > { > // FIXME: Need to take stroke thickness into account correctly, via CGPathByStrokingPath(). > float strokeThickness = context.strokeThickness(); >@@ -859,7 +859,7 @@ static TextStream& operator<<(TextStream& ts, const StrokePath& item) > return ts; > } > >-std::optional<FloatRect> StrokeEllipse::localBounds(const GraphicsContext& context) const >+Optional<FloatRect> StrokeEllipse::localBounds(const GraphicsContext& context) const > { > float strokeThickness = context.strokeThickness(); > >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >index 2b7d14cb05d206366618237b451a4a4cb1cb6e33..d0596ebff0c69f3df564a5e4998769e4fd9edaed 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >@@ -174,12 +174,12 @@ public: > > // Return bounds of this drawing operation in local coordinates. > // Does not include effets of transform, shadow etc in the state. >- virtual std::optional<FloatRect> localBounds(const GraphicsContext&) const { return std::nullopt; } >+ virtual Optional<FloatRect> localBounds(const GraphicsContext&) const { return WTF::nullopt; } > > private: > bool isDrawingItem() const override { return true; } > >- std::optional<FloatRect> m_extent; // In base coordinates, taking shadows and transforms into account. >+ Optional<FloatRect> m_extent; // In base coordinates, taking shadows and transforms into account. > }; > > class Save : public Item { >@@ -545,7 +545,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > GlyphBuffer generateGlyphBuffer() const; > >@@ -574,7 +574,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } > > mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable. > FloatRect m_destination; >@@ -601,7 +601,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } > > mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable. > FloatRect m_destination; >@@ -627,7 +627,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } > > mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable. > FloatRect m_destination; >@@ -654,7 +654,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } > > #if USE(CG) > RetainPtr<CGImageRef> m_image; >@@ -689,7 +689,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; } > > mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable. > AffineTransform m_patternTransform; >@@ -758,7 +758,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > float m_borderThickness; >@@ -783,7 +783,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > FloatPoint m_point1; > FloatPoint m_point2; >@@ -819,7 +819,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > FloatPoint m_blockLocation; > FloatSize m_localAnchor; >@@ -848,7 +848,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > FloatRect m_rect; > DocumentMarkerLineStyle m_style; >@@ -871,7 +871,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > }; >@@ -894,7 +894,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); } > > const Path m_path; > }; >@@ -923,7 +923,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > const Path m_path; > float m_width; >@@ -955,7 +955,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > Vector<FloatRect> m_rects; > float m_width; >@@ -980,7 +980,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > }; >@@ -1005,7 +1005,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > Color m_color; >@@ -1029,7 +1029,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > mutable Ref<Gradient> m_gradient; // FIXME: Make this not mutable >@@ -1058,7 +1058,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > Color m_color; >@@ -1087,7 +1087,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect.rect(); } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect.rect(); } > > FloatRoundedRect m_rect; > Color m_color; >@@ -1115,7 +1115,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > FloatRoundedRect m_roundedHoleRect; >@@ -1139,7 +1139,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); } > > const Path m_path; > }; >@@ -1162,7 +1162,7 @@ private: > > void apply(GraphicsContext&) const override; > >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > }; >@@ -1186,7 +1186,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > FloatRect m_rect; > float m_lineWidth; >@@ -1209,7 +1209,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > const Path m_path; > FloatPoint m_blockLocation; >@@ -1232,7 +1232,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override; >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override; > > FloatRect m_rect; > }; >@@ -1254,7 +1254,7 @@ private: > } > > void apply(GraphicsContext&) const override; >- std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } >+ Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; } > > FloatRect m_rect; > }; >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >index 9039b78ee2af4dd489d3afb6e674e115aebc08bc..e6b1faf750f42744abf9f75d9a7f736740f90618 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >@@ -404,7 +404,7 @@ Item& Recorder::appendItem(Ref<Item>&& item) > > void Recorder::updateItemExtent(DrawingItem& item) const > { >- if (std::optional<FloatRect> rect = item.localBounds(graphicsContext())) >+ if (Optional<FloatRect> rect = item.localBounds(graphicsContext())) > item.setExtent(extentFromLocalBounds(rect.value())); > } > >@@ -473,7 +473,7 @@ void Recorder::ContextState::rotate(float angleInRadians) > AffineTransform rotation; > rotation.rotate(angleInDegrees); > >- if (std::optional<AffineTransform> inverse = rotation.inverse()) >+ if (Optional<AffineTransform> inverse = rotation.inverse()) > clipBounds = inverse.value().mapRect(clipBounds); > } > >@@ -487,7 +487,7 @@ void Recorder::ContextState::concatCTM(const AffineTransform& matrix) > { > ctm *= matrix; > >- if (std::optional<AffineTransform> inverse = matrix.inverse()) >+ if (Optional<AffineTransform> inverse = matrix.inverse()) > clipBounds = inverse.value().mapRect(clipBounds); > } > >diff --git a/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp b/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp >index 4bff7cc83d0983b969af9ce2579b76bb4352d47f..d636233abe2e574c75e869aad19c38df9c0160a4 100644 >--- a/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp >+++ b/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp >@@ -84,7 +84,7 @@ void Font::platformInit() > float descent = narrowPrecisionToFloat(fontExtents.descent); > float capHeight = narrowPrecisionToFloat(fontExtents.height); > float lineGap = narrowPrecisionToFloat(fontExtents.height - fontExtents.ascent - fontExtents.descent); >- std::optional<float> xHeight; >+ Optional<float> xHeight; > > { > CairoFtFaceLocker cairoFtFaceLocker(m_platformData.scaledFont()); >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm >index c81983622b75795d4ab1300c755c82a3a0e13595..bf2224cb8e9aa2f9070b5a09b8f2d32371ff09d6 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm >@@ -83,7 +83,7 @@ static bool setFunctionsForPipelineDescriptor(const char* const functionName, MT > return true; > } > >-static std::optional<MTLVertexFormat> validateAndConvertVertexFormatToMTLVertexFormat(GPUVertexFormatEnum format) >+static Optional<MTLVertexFormat> validateAndConvertVertexFormatToMTLVertexFormat(GPUVertexFormatEnum format) > { > switch (format) { > case GPUVertexFormat::FloatR32G32B32A32: >@@ -95,11 +95,11 @@ static std::optional<MTLVertexFormat> validateAndConvertVertexFormatToMTLVertexF > case GPUVertexFormat::FloatR32: > return MTLVertexFormatFloat; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-static std::optional<MTLVertexStepFunction> validateAndConvertStepModeToMTLStepFunction(GPUInputStepModeEnum mode) >+static Optional<MTLVertexStepFunction> validateAndConvertStepModeToMTLStepFunction(GPUInputStepModeEnum mode) > { > switch (mode) { > case GPUInputStepMode::Vertex: >@@ -107,7 +107,7 @@ static std::optional<MTLVertexStepFunction> validateAndConvertStepModeToMTLStepF > case GPUInputStepMode::Instance: > return MTLVertexStepFunctionPerInstance; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm >index 2f1dd08ad63090b075dc7b19b7364ad5970fac31..19b88d5743943df378cd1c09323933a6f7bbef59 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm >@@ -80,7 +80,7 @@ void GPUSwapChain::setDevice(const GPUDevice& device) > [m_platformSwapLayer setDevice:device.platformDevice()]; > } > >-static std::optional<PlatformTextureFormat> platformTextureFormatForGPUTextureFormat(GPUTextureFormatEnum format) >+static Optional<PlatformTextureFormat> platformTextureFormatForGPUTextureFormat(GPUTextureFormatEnum format) > { > switch (format) { > case GPUTextureFormatEnum::R8G8B8A8Unorm: >@@ -93,7 +93,7 @@ static std::optional<PlatformTextureFormat> platformTextureFormatForGPUTextureFo > return MTLPixelFormatDepth32Float_Stencil8; > default: > LOG(WebGPU, "GPUSwapChain::setFormat(): Invalid texture format specified!"); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >index 52649bba7ab8c4d9ab7539ae329964838381fc99..1fe8b881e199806b122da56f70f80c35eaacd62a 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >@@ -110,11 +110,11 @@ bool getVideoSizeAndFormatFromCaps(GstCaps* caps, WebCore::IntSize& size, GstVid > return true; > } > >-std::optional<FloatSize> getVideoResolutionFromCaps(const GstCaps* caps) >+Optional<FloatSize> getVideoResolutionFromCaps(const GstCaps* caps) > { > if (!doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) { > GST_WARNING("Failed to get the video resolution, these are not a video caps"); >- return std::nullopt; >+ return WTF::nullopt; > } > > int width = 0, height = 0; >@@ -129,7 +129,7 @@ std::optional<FloatSize> getVideoResolutionFromCaps(const GstCaps* caps) > GstVideoInfo info; > gst_video_info_init(&info); > if (!gst_video_info_from_caps(&info, caps)) >- return std::nullopt; >+ return WTF::nullopt; > > width = GST_VIDEO_INFO_WIDTH(&info); > height = GST_VIDEO_INFO_HEIGHT(&info); >@@ -137,7 +137,7 @@ std::optional<FloatSize> getVideoResolutionFromCaps(const GstCaps* caps) > pixelAspectRatioDenominator = GST_VIDEO_INFO_PAR_D(&info); > } > >- return std::make_optional(FloatSize(width, height * (static_cast<float>(pixelAspectRatioDenominator) / static_cast<float>(pixelAspectRatioNumerator)))); >+ return makeOptional(FloatSize(width, height * (static_cast<float>(pixelAspectRatioDenominator) / static_cast<float>(pixelAspectRatioNumerator)))); > } > > bool getSampleVideoInfo(GstSample* sample, GstVideoInfo& videoInfo) >@@ -215,7 +215,7 @@ Vector<String> extractGStreamerOptionsFromCommandLine() > return options; > } > >-bool initializeGStreamer(std::optional<Vector<String>>&& options) >+bool initializeGStreamer(Optional<Vector<String>>&& options) > { > static std::once_flag onceFlag; > static bool isGStreamerInitialized; >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h >index 5d44d47401bc718cede46290e609137190f2700f..2ef15502a005631ee4d07f7fa32b54f4698cfbc8 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h >@@ -60,14 +60,14 @@ inline bool webkitGstCheckVersion(guint major, guint minor, guint micro) > GstPad* webkitGstGhostPadFromStaticTemplate(GstStaticPadTemplate*, const gchar* name, GstPad* target); > #if ENABLE(VIDEO) > bool getVideoSizeAndFormatFromCaps(GstCaps*, WebCore::IntSize&, GstVideoFormat&, int& pixelAspectRatioNumerator, int& pixelAspectRatioDenominator, int& stride); >-std::optional<FloatSize> getVideoResolutionFromCaps(const GstCaps*); >+Optional<FloatSize> getVideoResolutionFromCaps(const GstCaps*); > bool getSampleVideoInfo(GstSample*, GstVideoInfo&); > #endif > const char* capsMediaType(const GstCaps*); > bool doCapsHaveType(const GstCaps*, const char*); > bool areEncryptedCaps(const GstCaps*); > Vector<String> extractGStreamerOptionsFromCommandLine(); >-bool initializeGStreamer(std::optional<Vector<String>>&& = std::nullopt); >+bool initializeGStreamer(Optional<Vector<String>>&& = WTF::nullopt); > bool initializeGStreamerAndRegisterWebKitElements(); > unsigned getGstPlayFlag(const char* nick); > uint64_t toGstUnsigned64Time(const MediaTime&); >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 94768dc1a92a2f64bf2ce21268814aa29a09f6cf..e0272471e3c52bb073e1e51741bca1a089bac538 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -309,7 +309,7 @@ void MediaPlayerPrivateGStreamer::loadFull(const String& urlString, const gchar* > m_player->readyStateChanged(); > m_volumeAndMuteInitialized = false; > m_durationAtEOS = MediaTime::invalidTime(); >- m_hasTaintedOrigin = std::nullopt; >+ m_hasTaintedOrigin = WTF::nullopt; > > if (!m_delayingLoad) > commitLoad(); >@@ -2671,7 +2671,7 @@ bool MediaPlayerPrivateGStreamer::canSaveMediaData() const > return false; > } > >-std::optional<bool> MediaPlayerPrivateGStreamer::wouldTaintOrigin(const SecurityOrigin&) const >+Optional<bool> MediaPlayerPrivateGStreamer::wouldTaintOrigin(const SecurityOrigin&) const > { > // Ideally the given origin should always be verified with > // webKitSrcWouldTaintOrigin() instead of only checking it for >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >index 8d6af4f35963adab62ecbb0a759c172b1ecad278..9e606cc877711421550d533e3548d058469d8b7e 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >@@ -109,7 +109,7 @@ public: > MediaTime maxTimeLoaded() const override; > > bool hasSingleSecurityOrigin() const override; >- std::optional<bool> wouldTaintOrigin(const SecurityOrigin&) const override; >+ Optional<bool> wouldTaintOrigin(const SecurityOrigin&) const override; > > void loadStateChanged(); > void timeChanged(); >@@ -259,7 +259,7 @@ private: > mutable unsigned long long m_totalBytes; > URL m_url; > bool m_preservesPitch; >- mutable std::optional<Seconds> m_lastQueryTime; >+ mutable Optional<Seconds> m_lastQueryTime; > bool m_isLegacyPlaybin; > #if GST_CHECK_VERSION(1, 10, 0) > GRefPtr<GstStreamCollection> m_streamCollection; >@@ -288,7 +288,7 @@ private: > #endif > virtual bool isMediaSource() const { return false; } > >- std::optional<bool> m_hasTaintedOrigin { std::nullopt }; >+ Optional<bool> m_hasTaintedOrigin { WTF::nullopt }; > }; > } > >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >index 026a20573ec32adb2a3bc8a686023ea80ad83108..9fbe7bfd6f48252161df470ce85ed4f2430dea51 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >@@ -382,7 +382,7 @@ void AppendPipeline::parseDemuxerSrcPadCaps(GstCaps* demuxerSrcPadCaps) > m_presentationSize = WebCore::FloatSize(); > m_streamType = WebCore::MediaSourceStreamTypeGStreamer::Invalid; > } else if (doCapsHaveType(m_demuxerSrcPadCaps.get(), GST_VIDEO_CAPS_TYPE_PREFIX)) { >- std::optional<FloatSize> size = getVideoResolutionFromCaps(m_demuxerSrcPadCaps.get()); >+ Optional<FloatSize> size = getVideoResolutionFromCaps(m_demuxerSrcPadCaps.get()); > if (size.has_value()) > m_presentationSize = size.value(); > else >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >index b63e5deee72c95c49d856dc5470baab3f6149e8c..8ea89611d8cad1a2af20b01a3becd41045e0d722 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >@@ -720,7 +720,7 @@ void MediaPlayerPrivateGStreamerMSE::trackDetected(RefPtr<AppendPipeline> append > GST_DEBUG("track ID: %s, caps: %" GST_PTR_FORMAT, newTrack->id().string().latin1().data(), caps); > > if (doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) { >- std::optional<FloatSize> size = getVideoResolutionFromCaps(caps); >+ Optional<FloatSize> size = getVideoResolutionFromCaps(caps); > if (size.has_value()) > m_videoSize = size.value(); > } >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >index 969a422442e583d3ed1af7cfe43d29e42aa9eb61..3f50d76c7ba303b4fb01abf139ed5e788b5be77f 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >@@ -458,7 +458,7 @@ void webKitMediaSrcUpdatePresentationSize(GstCaps* caps, Stream* stream) > { > GST_OBJECT_LOCK(stream->parent); > if (WebCore::doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) { >- std::optional<WebCore::FloatSize> size = WebCore::getVideoResolutionFromCaps(caps); >+ Optional<WebCore::FloatSize> size = WebCore::getVideoResolutionFromCaps(caps); > if (size.has_value()) > stream->presentationSize = size.value(); > else >diff --git a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >index 8e6095c9ac8023453aa16ed5546878f494fdf441..9933cae6bf45ed27667df89531dcf3661f350bf8 100644 >--- a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >+++ b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >@@ -32,7 +32,7 @@ > > namespace WebCore { > >-static bool encodeImage(cairo_surface_t* surface, const String& mimeType, std::optional<double> quality, GUniqueOutPtr<gchar>& buffer, gsize& bufferSize) >+static bool encodeImage(cairo_surface_t* surface, const String& mimeType, Optional<double> quality, GUniqueOutPtr<gchar>& buffer, gsize& bufferSize) > { > // List of supported image encoding types comes from the GdkPixbuf documentation. > // http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-File-saving.html#gdk-pixbuf-save-to-bufferv >@@ -75,7 +75,7 @@ static bool encodeImage(cairo_surface_t* surface, const String& mimeType, std::o > return !error; > } > >-String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> quality, PreserveResolution) const >+String ImageBuffer::toDataURL(const String& mimeType, Optional<double> quality, PreserveResolution) const > { > Vector<uint8_t> imageData = toData(mimeType, quality); > if (imageData.isEmpty()) >@@ -87,7 +87,7 @@ String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> qual > return "data:" + mimeType + ";base64," + base64Data; > } > >-Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double> quality) const >+Vector<uint8_t> ImageBuffer::toData(const String& mimeType, Optional<double> quality) const > { > ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); > >diff --git a/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp b/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp >index 44226972e470b860deae04c7617c4fc06eb253c8..0e0aa6cad15462c46a4b5f6ad9c36db10c09e7ca 100644 >--- a/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp >+++ b/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp >@@ -201,12 +201,12 @@ static Vector<hb_feature_t, 4> fontFeatures(const FontCascade& font, FontOrienta > return features; > } > >-static std::optional<UScriptCode> characterScript(UChar32 character) >+static Optional<UScriptCode> characterScript(UChar32 character) > { > UErrorCode errorCode = U_ZERO_ERROR; > UScriptCode script = uscript_getScript(character, &errorCode); > if (U_FAILURE(errorCode)) >- return std::nullopt; >+ return WTF::nullopt; > return script; > } > >@@ -216,17 +216,17 @@ struct HBRun { > UScriptCode script; > }; > >-static std::optional<HBRun> findNextRun(const UChar* characters, unsigned length, unsigned offset) >+static Optional<HBRun> findNextRun(const UChar* characters, unsigned length, unsigned offset) > { > SurrogatePairAwareTextIterator textIterator(characters + offset, offset, length, length); > UChar32 character; > unsigned clusterLength = 0; > if (!textIterator.consume(character, clusterLength)) >- return std::nullopt; >+ return WTF::nullopt; > > auto currentScript = characterScript(character); > if (!currentScript) >- return std::nullopt; >+ return WTF::nullopt; > > unsigned startIndex = offset; > for (textIterator.advance(clusterLength); textIterator.consume(character, clusterLength); textIterator.advance(clusterLength)) { >@@ -235,7 +235,7 @@ static std::optional<HBRun> findNextRun(const UChar* characters, unsigned length > > auto nextScript = characterScript(character); > if (!nextScript) >- return std::nullopt; >+ return WTF::nullopt; > > // §5.1 Handling Characters with the Common Script Property. > // Programs must resolve any of the special Script property values, such as Common, >@@ -256,10 +256,10 @@ static std::optional<HBRun> findNextRun(const UChar* characters, unsigned length > } > > if (currentScript != nextScript && !uscript_hasScript(character, currentScript.value())) >- return std::optional<HBRun>({ startIndex, textIterator.currentIndex(), currentScript.value() }); >+ return Optional<HBRun>({ startIndex, textIterator.currentIndex(), currentScript.value() }); > } > >- return std::optional<HBRun>({ startIndex, textIterator.currentIndex(), currentScript.value() }); >+ return Optional<HBRun>({ startIndex, textIterator.currentIndex(), currentScript.value() }); > } > > static hb_script_t findScriptForVerticalGlyphSubstitution(hb_face_t* face) >diff --git a/Source/WebCore/platform/graphics/iso/ISOBox.cpp b/Source/WebCore/platform/graphics/iso/ISOBox.cpp >index c06e3a6338860f11eb0ebcfa438d3520266f5d48..e0a4466bbdf5520ac338b714e50b73e782627750 100644 >--- a/Source/WebCore/platform/graphics/iso/ISOBox.cpp >+++ b/Source/WebCore/platform/graphics/iso/ISOBox.cpp >@@ -36,14 +36,14 @@ ISOBox::PeekResult ISOBox::peekBox(DataView& view, unsigned offset) > { > uint64_t size = 0; > if (!checkedRead<uint32_t>(size, view, offset, BigEndian)) >- return std::nullopt; >+ return WTF::nullopt; > > FourCC type = { uint32_t { 0 } }; > if (!checkedRead<uint32_t>(type, view, offset, BigEndian)) >- return std::nullopt; >+ return WTF::nullopt; > > if (size == 1 && !checkedRead<uint64_t>(size, view, offset, BigEndian)) >- return std::nullopt; >+ return WTF::nullopt; > else if (!size) > size = view.byteLength(); > >diff --git a/Source/WebCore/platform/graphics/iso/ISOBox.h b/Source/WebCore/platform/graphics/iso/ISOBox.h >index db42c3321f21a383c84ac0d2a2b1740c1fc171e7..e1a3a86631475cab7a9b171b4062d393d890e606 100644 >--- a/Source/WebCore/platform/graphics/iso/ISOBox.h >+++ b/Source/WebCore/platform/graphics/iso/ISOBox.h >@@ -39,7 +39,7 @@ class WEBCORE_EXPORT ISOBox { > public: > virtual ~ISOBox() = default; > >- using PeekResult = std::optional<std::pair<FourCC, uint64_t>>; >+ using PeekResult = Optional<std::pair<FourCC, uint64_t>>; > static PeekResult peekBox(JSC::DataView&, unsigned offset); > static size_t minimumBoxSize() { return 2 * sizeof(uint32_t); } > >diff --git a/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.h b/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.h >index 1e063fe6be8cf18845b6c965b8eca9287cd89f7c..f4efe281051e3c7b29dbef78e44da3b0387803f3 100644 >--- a/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.h >+++ b/Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.h >@@ -33,8 +33,8 @@ class WEBCORE_EXPORT ISOTrackEncryptionBox : public ISOFullBox { > public: > static FourCC boxTypeName() { return "tenc"; } > >- std::optional<int8_t> defaultCryptByteBlock() const { return m_defaultCryptByteBlock; } >- std::optional<int8_t> defaultSkipByteBlock() const { return m_defaultSkipByteBlock; } >+ Optional<int8_t> defaultCryptByteBlock() const { return m_defaultCryptByteBlock; } >+ Optional<int8_t> defaultSkipByteBlock() const { return m_defaultSkipByteBlock; } > int8_t defaultIsProtected() const { return m_defaultIsProtected; } > int8_t defaultPerSampleIVSize() const { return m_defaultPerSampleIVSize; } > Vector<uint8_t> defaultKID() const { return m_defaultKID; } >@@ -43,8 +43,8 @@ public: > protected: > bool parse(JSC::DataView&, unsigned& offset) override; > >- std::optional<int8_t> m_defaultCryptByteBlock; >- std::optional<int8_t> m_defaultSkipByteBlock; >+ Optional<int8_t> m_defaultCryptByteBlock; >+ Optional<int8_t> m_defaultSkipByteBlock; > int8_t m_defaultIsProtected { 0 }; > int8_t m_defaultPerSampleIVSize { 0 }; > Vector<uint8_t> m_defaultKID; >diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >index eb93bc093437a1853988d7aa394020434fb7a715..86e0825187abc5d2887d74c8351af903a34ecda4 100644 >--- a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >@@ -980,16 +980,16 @@ static String generateHashedName(const String& name) > return builder.toString(); > } > >-std::optional<String> GraphicsContext3D::mappedSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType symbolType, const String& name) >+Optional<String> GraphicsContext3D::mappedSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType symbolType, const String& name) > { > auto result = m_shaderSourceMap.find(shader); > if (result == m_shaderSourceMap.end()) >- return std::nullopt; >+ return WTF::nullopt; > > const auto& symbolMap = result->value.symbolMap(symbolType); > auto symbolEntry = symbolMap.find(name); > if (symbolEntry == symbolMap.end()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& mappedName = symbolEntry->value.mappedName; > return String(mappedName.c_str(), mappedName.length()); >@@ -1038,18 +1038,18 @@ String GraphicsContext3D::mappedSymbolName(Platform3DObject program, ANGLEShader > return name; > } > >-std::optional<String> GraphicsContext3D::originalSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType symbolType, const String& name) >+Optional<String> GraphicsContext3D::originalSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType symbolType, const String& name) > { > auto result = m_shaderSourceMap.find(shader); > if (result == m_shaderSourceMap.end()) >- return std::nullopt; >+ return WTF::nullopt; > > const auto& symbolMap = result->value.symbolMap(symbolType); > for (const auto& symbolEntry : symbolMap) { > if (name == symbolEntry.value.mappedName.c_str()) > return symbolEntry.key; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > String GraphicsContext3D::originalSymbolName(Platform3DObject program, ANGLEShaderSymbolType symbolType, const String& name) >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h b/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h >index 09e212c109b9b4ded737d5a9edf179eb9248be7d..3fa913d2fbb38c9dafc464e9d31b268cfca9716d 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h >@@ -31,9 +31,9 @@ public: > enum class AnimationState { Playing, Paused, Stopped }; > > struct ApplicationResult { >- std::optional<TransformationMatrix> transform; >- std::optional<double> opacity; >- std::optional<FilterOperations> filters; >+ Optional<TransformationMatrix> transform; >+ Optional<double> opacity; >+ Optional<FilterOperations> filters; > bool hasRunningAnimations { false }; > }; > >diff --git a/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp b/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp >index eebf228a1c4934d8263280d86df6371c5f4faec4..d4fecab4a2e5bfe458ef0aaa1953640bd8ab8b0d 100644 >--- a/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp >+++ b/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp >@@ -104,11 +104,11 @@ bool AffineTransform::isInvertible() const > return std::isfinite(determinant) && determinant != 0; > } > >-std::optional<AffineTransform> AffineTransform::inverse() const >+Optional<AffineTransform> AffineTransform::inverse() const > { > double determinant = det(m_transform); > if (!std::isfinite(determinant) || determinant == 0) >- return std::nullopt; >+ return WTF::nullopt; > > AffineTransform result; > if (isIdentityOrTranslation()) { >diff --git a/Source/WebCore/platform/graphics/transforms/AffineTransform.h b/Source/WebCore/platform/graphics/transforms/AffineTransform.h >index a8f09b796d2ae308c315f0de00246e37ff4d778f..54f195457742ed7e161c10ca51e885b695f99f2b 100644 >--- a/Source/WebCore/platform/graphics/transforms/AffineTransform.h >+++ b/Source/WebCore/platform/graphics/transforms/AffineTransform.h >@@ -129,7 +129,7 @@ public: > WEBCORE_EXPORT double yScale() const; > > bool isInvertible() const; // If you call this this, you're probably doing it wrong. >- WEBCORE_EXPORT std::optional<AffineTransform> inverse() const; >+ WEBCORE_EXPORT Optional<AffineTransform> inverse() const; > > WEBCORE_EXPORT void blend(const AffineTransform& from, double progress); > >diff --git a/Source/WebCore/platform/graphics/transforms/TransformState.cpp b/Source/WebCore/platform/graphics/transforms/TransformState.cpp >index 5ef0e5bf40b9deb4e78ce743917a82210831ee6b..f0e2da3193c4e89911ff7fcb6db8ea84648790e7 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformState.cpp >+++ b/Source/WebCore/platform/graphics/transforms/TransformState.cpp >@@ -183,13 +183,13 @@ FloatQuad TransformState::mappedQuad(bool* wasClamped) const > return quad; > } > >-std::optional<FloatQuad> TransformState::mappedSecondaryQuad(bool* wasClamped) const >+Optional<FloatQuad> TransformState::mappedSecondaryQuad(bool* wasClamped) const > { > if (wasClamped) > *wasClamped = false; > > if (!m_lastPlanarSecondaryQuad) >- return std::optional<FloatQuad>(); >+ return Optional<FloatQuad>(); > > FloatQuad quad = *m_lastPlanarSecondaryQuad; > mapQuad(quad, m_direction, wasClamped); >diff --git a/Source/WebCore/platform/graphics/transforms/TransformState.h b/Source/WebCore/platform/graphics/transforms/TransformState.h >index ae04c8bbf15cc8bd2a9e1c9a876df0bc94d47274..80d33dfb83ffaf1ffa8592da5067bd74f46a6207 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformState.h >+++ b/Source/WebCore/platform/graphics/transforms/TransformState.h >@@ -79,7 +79,7 @@ public: > m_lastPlanarQuad = quad; > } > >- // FIXME: webkit.org/b/144226 use std::optional<FloatQuad>. >+ // FIXME: webkit.org/b/144226 use Optional<FloatQuad>. > void setSecondaryQuad(const FloatQuad* quad) > { > // We must be in a flattened state (no accumulated offset) when setting this secondary quad. >@@ -90,7 +90,7 @@ public: > m_lastPlanarSecondaryQuad = nullptr; > } > >- // FIXME: webkit.org/b/144226 use std::optional<FloatQuad>. >+ // FIXME: webkit.org/b/144226 use Optional<FloatQuad>. > void setLastPlanarSecondaryQuad(const FloatQuad*); > > void move(LayoutUnit x, LayoutUnit y, TransformAccumulation accumulate = FlattenTransform) >@@ -112,7 +112,7 @@ public: > // Return the point or quad mapped through the current transform > FloatPoint mappedPoint(bool* wasClamped = nullptr) const; > FloatQuad mappedQuad(bool* wasClamped = nullptr) const; >- std::optional<FloatQuad> mappedSecondaryQuad(bool* wasClamped = nullptr) const; >+ Optional<FloatQuad> mappedSecondaryQuad(bool* wasClamped = nullptr) const; > > private: > void translateTransform(const LayoutSize&); >diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >index d2570f7c548db68570c3034ad330862ebc7c8c30..7b81cf084bd46b0b064d9b732f95999f82f4ee91 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >@@ -1460,7 +1460,7 @@ bool TransformationMatrix::isInvertible() const > return true; > } > >-std::optional<TransformationMatrix> TransformationMatrix::inverse() const >+Optional<TransformationMatrix> TransformationMatrix::inverse() const > { > if (isIdentityOrTranslation()) { > // identity matrix >@@ -1478,7 +1478,7 @@ std::optional<TransformationMatrix> TransformationMatrix::inverse() const > // FIXME: Use LU decomposition to apply the inverse instead of calculating the inverse explicitly. > // Calculating the inverse of a 4x4 matrix using cofactors is numerically unstable and unnecessary to apply the inverse transformation to a point. > if (!WebCore::inverse(m_matrix, invMat.m_matrix)) >- return std::nullopt; >+ return WTF::nullopt; > > return invMat; > } >diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >index 77e6d95ca35efc62cb507b9b05395d8b97cc3df2..eeded5f147a20dd7c5e82f39e7fe41e123bf636e 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >@@ -280,7 +280,7 @@ public: > WEBCORE_EXPORT static TransformationMatrix rectToRect(const FloatRect&, const FloatRect&); > > bool isInvertible() const; // If you call this this, you're probably doing it wrong. >- WEBCORE_EXPORT std::optional<TransformationMatrix> inverse() const; >+ WEBCORE_EXPORT Optional<TransformationMatrix> inverse() const; > > // Decompose the matrix into its component parts. > struct Decomposed2Type { >diff --git a/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp b/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp >index 1a7a26632d3f31c1ae23e7e898c92b8aad81665c..a14084524ce9702fc579791456cd0482b40883b1 100644 >--- a/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp >+++ b/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp >@@ -332,13 +332,13 @@ void ImageBuffer::putByteArray(const Uint8ClampedArray& source, AlphaPremultipli > m_data.putData(source, bufferFormat, scaledSourceSize, scaledSourceRect, destPoint, internalSize(), context().isAcceleratedContext(), 1); > } > >-String ImageBuffer::toDataURL(const String&, std::optional<double>, PreserveResolution) const >+String ImageBuffer::toDataURL(const String&, Optional<double>, PreserveResolution) const > { > notImplemented(); > return "data:,"_s; > } > >-Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double> quality) const >+Vector<uint8_t> ImageBuffer::toData(const String& mimeType, Optional<double> quality) const > { > notImplemented(); > return { }; >diff --git a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp >index fa698c5fd43054e18b95fa7c2e715f334c6595fa..70478a2cb0fde270858f71a40e5d5839642f56ee 100644 >--- a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp >+++ b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp >@@ -122,7 +122,7 @@ RepetitionCount ImageDecoderDirect2D::repetitionCount() const > return RepetitionCountNone; > } > >-std::optional<IntPoint> ImageDecoderDirect2D::hotSpot() const >+Optional<IntPoint> ImageDecoderDirect2D::hotSpot() const > { > return IntPoint(); > } >diff --git a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h >index 8a3f4f33b63746226dececb236c9082aedf0458b..f570c2f9491a2ce7fc8695502dccd1af8608cbe1 100644 >--- a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h >+++ b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h >@@ -60,7 +60,7 @@ public: > size_t frameCount() const final; > > RepetitionCount repetitionCount() const final; >- std::optional<IntPoint> hotSpot() const final; >+ Optional<IntPoint> hotSpot() const final; > > IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default) const final; > bool frameIsCompleteAtIndex(size_t) const final; >diff --git a/Source/WebCore/platform/graphics/win/PathDirect2D.cpp b/Source/WebCore/platform/graphics/win/PathDirect2D.cpp >index 5465ea732610903fa375b6d6a7710ee6911bbda3..91ecf3196777813991a0fe4f17ab5a8f17552f61 100644 >--- a/Source/WebCore/platform/graphics/win/PathDirect2D.cpp >+++ b/Source/WebCore/platform/graphics/win/PathDirect2D.cpp >@@ -286,7 +286,7 @@ void Path::transform(const AffineTransform& transform) > if (transform.isIdentity() || isEmpty()) > return; > >- std::optional<FloatPoint> currentPoint; >+ Optional<FloatPoint> currentPoint; > if (hasCurrentPoint()) > currentPoint = this->currentPoint(); > >diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp >index f26536f1190a198b9b4eb92dec6f2f89c46f1053..8c81119bc50dbee90a861930220126ab1b0f6803 100644 >--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp >+++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp >@@ -103,7 +103,7 @@ bool PlatformDisplayX11::supportsXComposite() const > return m_supportsXComposite.value(); > } > >-bool PlatformDisplayX11::supportsXDamage(std::optional<int>& damageEventBase, std::optional<int>& damageErrorBase) const >+bool PlatformDisplayX11::supportsXDamage(Optional<int>& damageEventBase, Optional<int>& damageErrorBase) const > { > if (!m_supportsXDamage) { > m_supportsXDamage = false; >diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h >index e5d38325df14b91c456db5e389b5ffd1371663de..df00d1e73a3ac819f4f4dfa059b85bec2df758e6 100644 >--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h >+++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h >@@ -44,7 +44,7 @@ public: > > Display* native() const { return m_display; } > bool supportsXComposite() const; >- bool supportsXDamage(std::optional<int>& damageEventBase, std::optional<int>& damageErrorBase) const; >+ bool supportsXDamage(Optional<int>& damageEventBase, Optional<int>& damageErrorBase) const; > > private: > PlatformDisplayX11(Display*, NativeDisplayOwned); >@@ -56,10 +56,10 @@ private: > #endif > > Display* m_display { nullptr }; >- mutable std::optional<bool> m_supportsXComposite; >- mutable std::optional<bool> m_supportsXDamage; >- mutable std::optional<int> m_damageEventBase; >- mutable std::optional<int> m_damageErrorBase; >+ mutable Optional<bool> m_supportsXComposite; >+ mutable Optional<bool> m_supportsXDamage; >+ mutable Optional<int> m_damageEventBase; >+ mutable Optional<int> m_damageErrorBase; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h b/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h >index 24e6665f6f85e7bb60df79dc7db8b51c61fdb716..8cbe2110d662076affbeb98609a6c63cb6c326e7 100644 >--- a/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h >+++ b/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h >@@ -194,7 +194,7 @@ public: > > // If the image has a cursor hot-spot, stores it in the argument > // and returns true. Otherwise returns false. >- std::optional<IntPoint> hotSpot() const override { return std::nullopt; } >+ Optional<IntPoint> hotSpot() const override { return WTF::nullopt; } > > protected: > void prepareScaleDataIfNecessary(); >diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp >index 860da38638ef52a90ed1fd89b52dee965430153c..719032fe67d16842d7cc796c0109275ed4432ba2 100644 >--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp >+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp >@@ -109,7 +109,7 @@ bool ICOImageDecoder::setFailed() > return ScalableImageDecoder::setFailed(); > } > >-std::optional<IntPoint> ICOImageDecoder::hotSpot() const >+Optional<IntPoint> ICOImageDecoder::hotSpot() const > { > // When unspecified, the default frame is always frame 0. This is consistent with > // BitmapImage where currentFrame() starts at 0 and only increases when animation is >@@ -117,10 +117,10 @@ std::optional<IntPoint> ICOImageDecoder::hotSpot() const > return hotSpotAtIndex(0); > } > >-std::optional<IntPoint> ICOImageDecoder::hotSpotAtIndex(size_t index) const >+Optional<IntPoint> ICOImageDecoder::hotSpotAtIndex(size_t index) const > { > if (index >= m_dirEntries.size() || m_fileType != CURSOR) >- return std::nullopt; >+ return WTF::nullopt; > > return m_dirEntries[index].m_hotSpot; > } >diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h >index a76eb397d14d628203d0151d690efa1b4d26a209..eb8d6e1125c9ede523ec4d2f6bc1256f1bede4a5 100644 >--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h >+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h >@@ -56,7 +56,7 @@ public: > // avoid accessing deleted memory, especially when calling this from > // inside BMPImageReader! > bool setFailed() final; >- std::optional<IntPoint> hotSpot() const final; >+ Optional<IntPoint> hotSpot() const final; > > private: > enum ImageType { >@@ -119,8 +119,8 @@ private: > // could be decoded. > bool processDirectoryEntries(); > >- // Returns the hot-spot for |index|, returns std::nullopt if there is none. >- std::optional<IntPoint> hotSpotAtIndex(size_t) const; >+ // Returns the hot-spot for |index|, returns WTF::nullopt if there is none. >+ Optional<IntPoint> hotSpotAtIndex(size_t) const; > > // Reads and returns a directory entry from the current offset into > // |data|. >diff --git a/Source/WebCore/platform/ios/LegacyTileCache.h b/Source/WebCore/platform/ios/LegacyTileCache.h >index e9153d4c1cadab4dde17f03182b555689b7f1cd6..2e21e0de292c6ba759f93b68d250e28e802d5a67 100644 >--- a/Source/WebCore/platform/ios/LegacyTileCache.h >+++ b/Source/WebCore/platform/ios/LegacyTileCache.h >@@ -143,7 +143,7 @@ public: > unsigned tileCapacityForGrid(LegacyTileGrid*); > Color colorForGridTileBorder(LegacyTileGrid*) const; > bool setOverrideVisibleRect(const FloatRect&); >- void clearOverrideVisibleRect() { m_overrideVisibleRect = std::nullopt; } >+ void clearOverrideVisibleRect() { m_overrideVisibleRect = WTF::nullopt; } > > void doPendingRepaints(); > >@@ -184,7 +184,7 @@ private: > // Ensure there are no async calls on a dead tile cache. > RetainPtr<LegacyTileCacheTombstone> m_tombstone; > >- std::optional<FloatRect> m_overrideVisibleRect; >+ Optional<FloatRect> m_overrideVisibleRect; > > IntSize m_tileSize { 512, 512 }; > >diff --git a/Source/WebCore/platform/mac/NSScrollerImpDetails.h b/Source/WebCore/platform/mac/NSScrollerImpDetails.h >index f448074d28ece49a393f3808222f298aabf2a389..53138065445d61233155a737ea72b15e2ff5ad16 100644 >--- a/Source/WebCore/platform/mac/NSScrollerImpDetails.h >+++ b/Source/WebCore/platform/mac/NSScrollerImpDetails.h >@@ -38,7 +38,7 @@ public: > WEBCORE_EXPORT static void setUseOverlayScrollbars(bool); > > private: >- static std::optional<bool> m_useOverlayScrollbars; >+ static Optional<bool> m_useOverlayScrollbars; > }; > > } >diff --git a/Source/WebCore/platform/mac/NSScrollerImpDetails.mm b/Source/WebCore/platform/mac/NSScrollerImpDetails.mm >index 4d4fc0d0a2ff82198cc29e210d2188fe2131d685..bfe3ae20f2163185bc013531d28befb391694ada 100644 >--- a/Source/WebCore/platform/mac/NSScrollerImpDetails.mm >+++ b/Source/WebCore/platform/mac/NSScrollerImpDetails.mm >@@ -34,7 +34,7 @@ > > namespace WebCore { > >-std::optional<bool> ScrollerStyle::m_useOverlayScrollbars; >+Optional<bool> ScrollerStyle::m_useOverlayScrollbars; > > NSScrollerStyle ScrollerStyle::recommendedScrollerStyle() > { >diff --git a/Source/WebCore/platform/mac/ThemeMac.h b/Source/WebCore/platform/mac/ThemeMac.h >index 49028f1b43c73c35cc31370a7df4e98414fdc626..02a0aeed026775ae83ff1a44ee25af7a6998c806 100644 >--- a/Source/WebCore/platform/mac/ThemeMac.h >+++ b/Source/WebCore/platform/mac/ThemeMac.h >@@ -43,7 +43,7 @@ private: > > int baselinePositionAdjustment(ControlPart) const final; > >- std::optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float zoomFactor) const final; >+ Optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float zoomFactor) const final; > > LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize&, float zoomFactor) const final; > LengthSize minimumControlSize(ControlPart, const FontCascade&, float zoomFactor) const final; >diff --git a/Source/WebCore/platform/mac/ThemeMac.mm b/Source/WebCore/platform/mac/ThemeMac.mm >index 5e3eae0bde3f07c3b0ab2c4700117b83050a494d..b4a8162ddb3e947c7f79adf03feeb85503f378e9 100644 >--- a/Source/WebCore/platform/mac/ThemeMac.mm >+++ b/Source/WebCore/platform/mac/ThemeMac.mm >@@ -763,7 +763,7 @@ int ThemeMac::baselinePositionAdjustment(ControlPart part) const > return Theme::baselinePositionAdjustment(part); > } > >-std::optional<FontCascadeDescription> ThemeMac::controlFont(ControlPart part, const FontCascade& font, float zoomFactor) const >+Optional<FontCascadeDescription> ThemeMac::controlFont(ControlPart part, const FontCascade& font, float zoomFactor) const > { > switch (part) { > case PushButtonPart: { >@@ -777,7 +777,7 @@ std::optional<FontCascadeDescription> ThemeMac::controlFont(ControlPart part, co > return fontDescription; > } > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >diff --git a/Source/WebCore/platform/mediacapabilities/MediaConfiguration.h b/Source/WebCore/platform/mediacapabilities/MediaConfiguration.h >index 3bdc83f2830a304de7ee2f0396328a88b9a92ff1..d01ad6e932412ca1b57c43065c6f22603b8e0d4c 100644 >--- a/Source/WebCore/platform/mediacapabilities/MediaConfiguration.h >+++ b/Source/WebCore/platform/mediacapabilities/MediaConfiguration.h >@@ -32,8 +32,8 @@ > namespace WebCore { > > struct MediaConfiguration { >- std::optional<VideoConfiguration> video; >- std::optional<AudioConfiguration> audio; >+ Optional<VideoConfiguration> video; >+ Optional<AudioConfiguration> audio; > }; > > } >diff --git a/Source/WebCore/platform/mediastream/CaptureDevice.h b/Source/WebCore/platform/mediastream/CaptureDevice.h >index fbf1c09d6d8365b98cf323b272dec7d003339128..447a89f8182db8ea4271f4bac4c3e16978610508 100644 >--- a/Source/WebCore/platform/mediastream/CaptureDevice.h >+++ b/Source/WebCore/platform/mediastream/CaptureDevice.h >@@ -68,34 +68,34 @@ public: > } > > template <class Decoder> >- static std::optional<CaptureDevice> decode(Decoder& decoder) >+ static Optional<CaptureDevice> decode(Decoder& decoder) > { >- std::optional<String> persistentId; >+ Optional<String> persistentId; > decoder >> persistentId; > if (!persistentId) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> label; >+ Optional<String> label; > decoder >> label; > if (!label) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> groupId; >+ Optional<String> groupId; > decoder >> groupId; > if (!groupId) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> enabled; >+ Optional<bool> enabled; > decoder >> enabled; > if (!enabled) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<CaptureDevice::DeviceType> type; >+ Optional<CaptureDevice::DeviceType> type; > decoder >> type; > if (!type) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<CaptureDevice> device = {{ WTFMove(*persistentId), WTFMove(*type), WTFMove(*label), WTFMove(*groupId) }}; >+ Optional<CaptureDevice> device = {{ WTFMove(*persistentId), WTFMove(*type), WTFMove(*label), WTFMove(*groupId) }}; > device->setEnabled(*enabled); > return device; > } >diff --git a/Source/WebCore/platform/mediastream/CaptureDeviceManager.h b/Source/WebCore/platform/mediastream/CaptureDeviceManager.h >index e91b47ced6d60787418e451075c2bd4957ac55db..20a93973c1e3addada837ed06770803dfdbecd0e 100644 >--- a/Source/WebCore/platform/mediastream/CaptureDeviceManager.h >+++ b/Source/WebCore/platform/mediastream/CaptureDeviceManager.h >@@ -36,7 +36,7 @@ namespace WebCore { > class WEBCORE_EXPORT CaptureDeviceManager : public CanMakeWeakPtr<CaptureDeviceManager> { > public: > virtual const Vector<CaptureDevice>& captureDevices() = 0; >- virtual std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&) { return std::nullopt; } >+ virtual Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&) { return WTF::nullopt; } > > protected: > virtual ~CaptureDeviceManager(); >diff --git a/Source/WebCore/platform/mediastream/MediaConstraints.cpp b/Source/WebCore/platform/mediastream/MediaConstraints.cpp >index 545a2f81e26aa876c7c39ac264813bc35a0abc8a..93f671cfcc95b623e5a8ad800615f6ac2baa50ef 100644 >--- a/Source/WebCore/platform/mediastream/MediaConstraints.cpp >+++ b/Source/WebCore/platform/mediastream/MediaConstraints.cpp >@@ -219,7 +219,7 @@ void MediaTrackConstraintSetMap::filter(const WTF::Function<bool(const MediaCons > return; > } > >-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<IntConstraint>&& constraint) >+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<IntConstraint>&& constraint) > { > switch (constraintType) { > case MediaConstraintType::Width: >@@ -250,7 +250,7 @@ void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::op > } > } > >-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<DoubleConstraint>&& constraint) >+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<DoubleConstraint>&& constraint) > { > switch (constraintType) { > case MediaConstraintType::AspectRatio: >@@ -279,7 +279,7 @@ void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::op > } > } > >-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<BooleanConstraint>&& constraint) >+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<BooleanConstraint>&& constraint) > { > switch (constraintType) { > case MediaConstraintType::EchoCancellation: >@@ -308,7 +308,7 @@ void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::op > } > } > >-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<StringConstraint>&& constraint) >+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<StringConstraint>&& constraint) > { > switch (constraintType) { > case MediaConstraintType::FacingMode: >diff --git a/Source/WebCore/platform/mediastream/MediaConstraints.h b/Source/WebCore/platform/mediastream/MediaConstraints.h >index b42710ab8a1d30ac029306ecbb803716430bd2ac..d6e4a867ff47b32413daaba5ab53ae7926c28d9c 100644 >--- a/Source/WebCore/platform/mediastream/MediaConstraints.h >+++ b/Source/WebCore/platform/mediastream/MediaConstraints.h >@@ -293,8 +293,8 @@ public: > ValueType valueForDiscreteCapabilityValues(ValueType current, const Vector<ValueType>& discreteCapabilityValues) const > { > ValueType value { 0 }; >- std::optional<ValueType> min; >- std::optional<ValueType> max; >+ Optional<ValueType> min; >+ Optional<ValueType> max; > > if (m_exact) { > ASSERT(discreteCapabilityValues.contains(m_exact.value())); >@@ -394,10 +394,10 @@ protected: > } > } > >- std::optional<ValueType> m_min; >- std::optional<ValueType> m_max; >- std::optional<ValueType> m_exact; >- std::optional<ValueType> m_ideal; >+ Optional<ValueType> m_min; >+ Optional<ValueType> m_max; >+ Optional<ValueType> m_exact; >+ Optional<ValueType> m_ideal; > }; > > class IntConstraint final : public NumericConstraint<int> { >@@ -527,8 +527,8 @@ public: > } > > private: >- std::optional<bool> m_exact; >- std::optional<bool> m_ideal; >+ Optional<bool> m_exact; >+ Optional<bool> m_ideal; > }; > > class StringConstraint : public MediaConstraint { >@@ -635,27 +635,27 @@ public: > bool isEmpty() const; > WEBCORE_EXPORT size_t size() const; > >- WEBCORE_EXPORT void set(MediaConstraintType, std::optional<IntConstraint>&&); >- WEBCORE_EXPORT void set(MediaConstraintType, std::optional<DoubleConstraint>&&); >- WEBCORE_EXPORT void set(MediaConstraintType, std::optional<BooleanConstraint>&&); >- WEBCORE_EXPORT void set(MediaConstraintType, std::optional<StringConstraint>&&); >+ WEBCORE_EXPORT void set(MediaConstraintType, Optional<IntConstraint>&&); >+ WEBCORE_EXPORT void set(MediaConstraintType, Optional<DoubleConstraint>&&); >+ WEBCORE_EXPORT void set(MediaConstraintType, Optional<BooleanConstraint>&&); >+ WEBCORE_EXPORT void set(MediaConstraintType, Optional<StringConstraint>&&); > >- std::optional<IntConstraint> width() const { return m_width; } >- std::optional<IntConstraint> height() const { return m_height; } >- std::optional<IntConstraint> sampleRate() const { return m_sampleRate; } >- std::optional<IntConstraint> sampleSize() const { return m_sampleSize; } >+ Optional<IntConstraint> width() const { return m_width; } >+ Optional<IntConstraint> height() const { return m_height; } >+ Optional<IntConstraint> sampleRate() const { return m_sampleRate; } >+ Optional<IntConstraint> sampleSize() const { return m_sampleSize; } > >- std::optional<DoubleConstraint> aspectRatio() const { return m_aspectRatio; } >- std::optional<DoubleConstraint> frameRate() const { return m_frameRate; } >- std::optional<DoubleConstraint> volume() const { return m_volume; } >+ Optional<DoubleConstraint> aspectRatio() const { return m_aspectRatio; } >+ Optional<DoubleConstraint> frameRate() const { return m_frameRate; } >+ Optional<DoubleConstraint> volume() const { return m_volume; } > >- std::optional<BooleanConstraint> echoCancellation() const { return m_echoCancellation; } >- std::optional<BooleanConstraint> displaySurface() const { return m_displaySurface; } >- std::optional<BooleanConstraint> logicalSurface() const { return m_logicalSurface; } >+ Optional<BooleanConstraint> echoCancellation() const { return m_echoCancellation; } >+ Optional<BooleanConstraint> displaySurface() const { return m_displaySurface; } >+ Optional<BooleanConstraint> logicalSurface() const { return m_logicalSurface; } > >- std::optional<StringConstraint> facingMode() const { return m_facingMode; } >- std::optional<StringConstraint> deviceId() const { return m_deviceId; } >- std::optional<StringConstraint> groupId() const { return m_groupId; } >+ Optional<StringConstraint> facingMode() const { return m_facingMode; } >+ Optional<StringConstraint> deviceId() const { return m_deviceId; } >+ Optional<StringConstraint> groupId() const { return m_groupId; } > > template <class Encoder> void encode(Encoder& encoder) const > { >@@ -677,59 +677,59 @@ public: > encoder << m_groupId; > } > >- template <class Decoder> static std::optional<MediaTrackConstraintSetMap> decode(Decoder& decoder) >+ template <class Decoder> static Optional<MediaTrackConstraintSetMap> decode(Decoder& decoder) > { > MediaTrackConstraintSetMap map; > if (!decoder.decode(map.m_width)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_height)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_sampleRate)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_sampleSize)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(map.m_aspectRatio)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_frameRate)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_volume)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(map.m_echoCancellation)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_displaySurface)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_logicalSurface)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(map.m_facingMode)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_deviceId)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(map.m_groupId)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(map); > } > > private: >- std::optional<IntConstraint> m_width; >- std::optional<IntConstraint> m_height; >- std::optional<IntConstraint> m_sampleRate; >- std::optional<IntConstraint> m_sampleSize; >- >- std::optional<DoubleConstraint> m_aspectRatio; >- std::optional<DoubleConstraint> m_frameRate; >- std::optional<DoubleConstraint> m_volume; >- >- std::optional<BooleanConstraint> m_echoCancellation; >- std::optional<BooleanConstraint> m_displaySurface; >- std::optional<BooleanConstraint> m_logicalSurface; >- >- std::optional<StringConstraint> m_facingMode; >- std::optional<StringConstraint> m_deviceId; >- std::optional<StringConstraint> m_groupId; >+ Optional<IntConstraint> m_width; >+ Optional<IntConstraint> m_height; >+ Optional<IntConstraint> m_sampleRate; >+ Optional<IntConstraint> m_sampleSize; >+ >+ Optional<DoubleConstraint> m_aspectRatio; >+ Optional<DoubleConstraint> m_frameRate; >+ Optional<DoubleConstraint> m_volume; >+ >+ Optional<BooleanConstraint> m_echoCancellation; >+ Optional<BooleanConstraint> m_displaySurface; >+ Optional<BooleanConstraint> m_logicalSurface; >+ >+ Optional<StringConstraint> m_facingMode; >+ Optional<StringConstraint> m_deviceId; >+ Optional<StringConstraint> m_groupId; > }; > > class FlattenedConstraint { >diff --git a/Source/WebCore/platform/mediastream/MediaStreamRequest.h b/Source/WebCore/platform/mediastream/MediaStreamRequest.h >index d927d7627abd07f428daa4d345c4d276bf81958c..205e3d7742ae6a455210769855bbbde5cd87de73 100644 >--- a/Source/WebCore/platform/mediastream/MediaStreamRequest.h >+++ b/Source/WebCore/platform/mediastream/MediaStreamRequest.h >@@ -45,13 +45,13 @@ struct MediaStreamRequest { > encoder << videoConstraints; > } > >- template <class Decoder> static std::optional<MediaStreamRequest> decode(Decoder& decoder) >+ template <class Decoder> static Optional<MediaStreamRequest> decode(Decoder& decoder) > { > MediaStreamRequest request; > if (decoder.decodeEnum(request.type) && decoder.decode(request.audioConstraints) && decoder.decode(request.videoConstraints)) > return WTFMove(request); > >- return std::nullopt; >+ return WTF::nullopt; > } > }; > >diff --git a/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h b/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h >index ddc16ef31a77b5573b877625135dd76d38ec5726..6d2d38a576c3853c317b78e9698cf23ead76a14a 100644 >--- a/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h >+++ b/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h >@@ -33,12 +33,12 @@ > namespace WebCore { > > struct RTCDataChannelInit { >- std::optional<bool> ordered; >- std::optional<unsigned short> maxPacketLifeTime; >- std::optional<unsigned short> maxRetransmits; >+ Optional<bool> ordered; >+ Optional<unsigned short> maxPacketLifeTime; >+ Optional<unsigned short> maxRetransmits; > String protocol; >- std::optional<bool> negotiated; >- std::optional<unsigned short> id; >+ Optional<bool> negotiated; >+ Optional<unsigned short> id; > }; > > class RTCDataChannelHandlerClient; >diff --git a/Source/WebCore/platform/mediastream/RTCRtpCapabilities.h b/Source/WebCore/platform/mediastream/RTCRtpCapabilities.h >index 3fa66447e4a4cb4e6fd4e0577bb4b91ad47c83aa..d970f7a21aeac4606713e25aecf4e02989d3606d 100644 >--- a/Source/WebCore/platform/mediastream/RTCRtpCapabilities.h >+++ b/Source/WebCore/platform/mediastream/RTCRtpCapabilities.h >@@ -35,7 +35,7 @@ struct RTCRtpCapabilities { > struct CodecCapability { > String mimeType; > uint32_t clockRate { 0 }; >- std::optional<uint16_t> channels; >+ Optional<uint16_t> channels; > String sdpFmtpLine; > }; > struct HeaderExtensionCapability { >diff --git a/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.cpp b/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.cpp >index d4115b26b63edc33493594ef79b2ca45c63b6725..907b9b6182ca2bdf78bd0dfcd7d92f9ac28860a2 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.cpp >+++ b/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.cpp >@@ -101,7 +101,7 @@ const RealtimeMediaSourceSettings& RealtimeIncomingVideoSource::settings() > void RealtimeIncomingVideoSource::settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag> settings) > { > if (settings.containsAny({ RealtimeMediaSourceSettings::Flag::Width, RealtimeMediaSourceSettings::Flag::Height })) >- m_currentSettings = std::nullopt; >+ m_currentSettings = WTF::nullopt; > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.h b/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.h >index 2da1a8035069156257d0eaa9e82d79361d876054..4ac4d85645f1ab8a2ff8cbef52aca905aa6599b9 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.h >+++ b/Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.h >@@ -71,7 +71,7 @@ private: > > bool isIncomingVideoSource() const final { return true; } > >- std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ Optional<RealtimeMediaSourceSettings> m_currentSettings; > rtc::scoped_refptr<webrtc::VideoTrackInterface> m_videoTrack; > }; > >diff --git a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >index 3bac9336a4eb7a4b6c8962d53357ee40969eb4c2..bf7555d9a36fd07501693947b20fbad4b3f075e6 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >+++ b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >@@ -228,13 +228,13 @@ void RealtimeMediaSource::captureFailed() > }); > } > >-bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<int>, std::optional<int>, std::optional<double>) >+bool RealtimeMediaSource::supportsSizeAndFrameRate(Optional<int>, Optional<int>, Optional<double>) > { > // The size and frame rate are within the capability limits, so they are supported. > return true; > } > >-bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> widthConstraint, std::optional<IntConstraint> heightConstraint, std::optional<DoubleConstraint> frameRateConstraint, String& badConstraint, double& distance) >+bool RealtimeMediaSource::supportsSizeAndFrameRate(Optional<IntConstraint> widthConstraint, Optional<IntConstraint> heightConstraint, Optional<DoubleConstraint> frameRateConstraint, String& badConstraint, double& distance) > { > if (!widthConstraint && !heightConstraint && !frameRateConstraint) > return true; >@@ -243,7 +243,7 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> > > distance = std::numeric_limits<double>::infinity(); > >- std::optional<int> width; >+ Optional<int> width; > if (widthConstraint && capabilities.supportsWidth()) { > double constraintDistance = fitnessDistance(*widthConstraint); > if (std::isinf(constraintDistance)) { >@@ -258,7 +258,7 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> > } > } > >- std::optional<int> height; >+ Optional<int> height; > if (heightConstraint && capabilities.supportsHeight()) { > double constraintDistance = fitnessDistance(*heightConstraint); > if (std::isinf(constraintDistance)) { >@@ -273,7 +273,7 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> > } > } > >- std::optional<double> frameRate; >+ Optional<double> frameRate; > if (frameRateConstraint && capabilities.supportsFrameRate()) { > double constraintDistance = fitnessDistance(*frameRateConstraint); > if (std::isinf(constraintDistance)) { >@@ -433,7 +433,7 @@ double RealtimeMediaSource::fitnessDistance(const MediaConstraint& constraint) > } > > template <typename ValueType> >-static void applyNumericConstraint(const NumericConstraint<ValueType>& constraint, ValueType current, std::optional<Vector<ValueType>> discreteCapabilityValues, ValueType capabilityMin, ValueType capabilityMax, RealtimeMediaSource& source, void (RealtimeMediaSource::*applier)(ValueType)) >+static void applyNumericConstraint(const NumericConstraint<ValueType>& constraint, ValueType current, Optional<Vector<ValueType>> discreteCapabilityValues, ValueType capabilityMin, ValueType capabilityMax, RealtimeMediaSource& source, void (RealtimeMediaSource::*applier)(ValueType)) > { > if (discreteCapabilityValues) { > int value = constraint.valueForDiscreteCapabilityValues(current, *discreteCapabilityValues); >@@ -447,7 +447,7 @@ static void applyNumericConstraint(const NumericConstraint<ValueType>& constrain > (source.*applier)(value); > } > >-void RealtimeMediaSource::setSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> frameRate) >+void RealtimeMediaSource::setSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> frameRate) > { > IntSize size; > if (width) >@@ -798,7 +798,7 @@ void RealtimeMediaSource::applyConstraints(const FlattenedConstraint& constraint > > auto& capabilities = this->capabilities(); > >- std::optional<int> width; >+ Optional<int> width; > if (const MediaConstraint* constraint = constraints.find(MediaConstraintType::Width)) { > ASSERT(constraint->isInt()); > if (capabilities.supportsWidth()) { >@@ -807,7 +807,7 @@ void RealtimeMediaSource::applyConstraints(const FlattenedConstraint& constraint > } > } > >- std::optional<int> height; >+ Optional<int> height; > if (const MediaConstraint* constraint = constraints.find(MediaConstraintType::Height)) { > ASSERT(constraint->isInt()); > if (capabilities.supportsHeight()) { >@@ -816,7 +816,7 @@ void RealtimeMediaSource::applyConstraints(const FlattenedConstraint& constraint > } > } > >- std::optional<double> frameRate; >+ Optional<double> frameRate; > if (const MediaConstraint* constraint = constraints.find(MediaConstraintType::FrameRate)) { > ASSERT(constraint->isDouble()); > if (capabilities.supportsFrameRate()) { >@@ -838,7 +838,7 @@ void RealtimeMediaSource::applyConstraints(const FlattenedConstraint& constraint > commitConfiguration(); > } > >-std::optional<std::pair<String, String>> RealtimeMediaSource::applyConstraints(const MediaConstraints& constraints) >+Optional<std::pair<String, String>> RealtimeMediaSource::applyConstraints(const MediaConstraints& constraints) > { > ASSERT(constraints.isValid); > >@@ -848,7 +848,7 @@ std::optional<std::pair<String, String>> RealtimeMediaSource::applyConstraints(c > return { { failedConstraint, "Constraint not supported"_s } }; > > applyConstraints(candidates); >- return std::nullopt; >+ return WTF::nullopt; > } > > void RealtimeMediaSource::applyConstraints(const MediaConstraints& constraints, SuccessHandler&& successHandler, FailureHandler&& failureHandler) >@@ -945,9 +945,9 @@ void RealtimeMediaSource::setSampleRate(int rate) > notifySettingsDidChangeObservers(RealtimeMediaSourceSettings::Flag::SampleRate); > } > >-std::optional<Vector<int>> RealtimeMediaSource::discreteSampleRates() const >+Optional<Vector<int>> RealtimeMediaSource::discreteSampleRates() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > > void RealtimeMediaSource::setSampleSize(int size) >@@ -959,9 +959,9 @@ void RealtimeMediaSource::setSampleSize(int size) > notifySettingsDidChangeObservers(RealtimeMediaSourceSettings::Flag::SampleSize); > } > >-std::optional<Vector<int>> RealtimeMediaSource::discreteSampleSizes() const >+Optional<Vector<int>> RealtimeMediaSource::discreteSampleSizes() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > > void RealtimeMediaSource::setEchoCancellation(bool echoCancellation) >diff --git a/Source/WebCore/platform/mediastream/RealtimeMediaSource.h b/Source/WebCore/platform/mediastream/RealtimeMediaSource.h >index 6de176298a3dc8aa5bd22e7f5bcba175d49aa441..166c8df53f755e5fc4580d869e87e959ad3b749b 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeMediaSource.h >+++ b/Source/WebCore/platform/mediastream/RealtimeMediaSource.h >@@ -138,11 +138,11 @@ public: > > int sampleRate() const { return m_sampleRate; } > void setSampleRate(int); >- virtual std::optional<Vector<int>> discreteSampleRates() const; >+ virtual Optional<Vector<int>> discreteSampleRates() const; > > int sampleSize() const { return m_sampleSize; } > void setSampleSize(int); >- virtual std::optional<Vector<int>> discreteSampleSizes() const; >+ virtual Optional<Vector<int>> discreteSampleSizes() const; > > bool echoCancellation() const { return m_echoCancellation; } > void setEchoCancellation(bool); >@@ -153,7 +153,7 @@ public: > using SuccessHandler = WTF::Function<void()>; > using FailureHandler = WTF::Function<void(const String& badConstraint, const String& errorString)>; > virtual void applyConstraints(const MediaConstraints&, SuccessHandler&&, FailureHandler&&); >- std::optional<std::pair<String, String>> applyConstraints(const MediaConstraints&); >+ Optional<std::pair<String, String>> applyConstraints(const MediaConstraints&); > > bool supportsConstraints(const MediaConstraints&, String&); > bool supportsConstraint(const MediaConstraint&); >@@ -189,10 +189,10 @@ protected: > double fitnessDistance(const MediaConstraint&); > void applyConstraint(const MediaConstraint&); > void applyConstraints(const FlattenedConstraint&); >- bool supportsSizeAndFrameRate(std::optional<IntConstraint> width, std::optional<IntConstraint> height, std::optional<DoubleConstraint>, String&, double& fitnessDistance); >+ bool supportsSizeAndFrameRate(Optional<IntConstraint> width, Optional<IntConstraint> height, Optional<DoubleConstraint>, String&, double& fitnessDistance); > >- virtual bool supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>); >- virtual void setSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>); >+ virtual bool supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>); >+ virtual void setSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>); > > void notifyMutedObservers() const; > void notifyMutedChange(bool muted); >diff --git a/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h b/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h >index a1b1e9832aa473fb5c4d372fbd6409ce36cd6c93..f37e417a0535a513a7245b3bc99855d62269d6bb 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h >+++ b/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h >@@ -112,7 +112,7 @@ private: > void trackEnded(MediaStreamTrackPrivate&) final { } > > Ref<MediaStreamTrackPrivate> m_videoSource; >- std::optional<RealtimeMediaSourceSettings> m_initialSettings; >+ Optional<RealtimeMediaSourceSettings> m_initialSettings; > Timer m_blackFrameTimer; > rtc::scoped_refptr<webrtc::VideoFrameBuffer> m_blackFrame; > >diff --git a/Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp b/Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp >index 90ac7dc6b609a309ce016a398f727249ee57990b..4529e28038b36a4860cf852e60b9a96558cedcb6 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp >+++ b/Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp >@@ -191,7 +191,7 @@ void RealtimeVideoSource::updateCapabilities(RealtimeMediaSourceCapabilities& ca > capabilities.setFrameRate({ minimumFrameRate, maximumFrameRate }); > } > >-bool RealtimeVideoSource::supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> frameRate) >+bool RealtimeVideoSource::supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> frameRate) > { > if (!width && !height && !frameRate) > return true; >@@ -215,7 +215,7 @@ bool RealtimeVideoSource::presetSupportsFrameRate(RefPtr<VideoPreset> preset, do > return false; > } > >-bool RealtimeVideoSource::supportsCaptureSize(std::optional<int> width, std::optional<int> height, const Function<bool(const IntSize&)>&& function) >+bool RealtimeVideoSource::supportsCaptureSize(Optional<int> width, Optional<int> height, const Function<bool(const IntSize&)>&& function) > { > if (width && height) > return function({ width.value(), height.value() }); >@@ -242,7 +242,7 @@ bool RealtimeVideoSource::shouldUsePreset(VideoPreset& current, VideoPreset& can > return candidate.size.width() <= current.size.width() && candidate.size.height() <= current.size.height() && prefersPreset(candidate); > } > >-std::optional<RealtimeVideoSource::CaptureSizeAndFrameRate> RealtimeVideoSource::bestSupportedSizeAndFrameRate(std::optional<int> requestedWidth, std::optional<int> requestedHeight, std::optional<double> requestedFrameRate) >+Optional<RealtimeVideoSource::CaptureSizeAndFrameRate> RealtimeVideoSource::bestSupportedSizeAndFrameRate(Optional<int> requestedWidth, Optional<int> requestedHeight, Optional<double> requestedFrameRate) > { > if (!requestedWidth && !requestedHeight && !requestedFrameRate) > return { }; >@@ -350,9 +350,9 @@ std::optional<RealtimeVideoSource::CaptureSizeAndFrameRate> RealtimeVideoSource: > return result; > } > >-void RealtimeVideoSource::setSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> frameRate) >+void RealtimeVideoSource::setSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> frameRate) > { >- std::optional<RealtimeVideoSource::CaptureSizeAndFrameRate> match; >+ Optional<RealtimeVideoSource::CaptureSizeAndFrameRate> match; > > auto size = this->size(); > if (!width && !height && !size.isEmpty()) { >diff --git a/Source/WebCore/platform/mediastream/RealtimeVideoSource.h b/Source/WebCore/platform/mediastream/RealtimeVideoSource.h >index 84268ab666e39d7705d8088dcac853d551e6fad9..07ded4f1f5970d38383817f9435f3996d15f828b 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeVideoSource.h >+++ b/Source/WebCore/platform/mediastream/RealtimeVideoSource.h >@@ -47,8 +47,8 @@ protected: > RealtimeVideoSource(String&& name, String&& id, String&& hashSalt); > > void prepareToProduceData(); >- bool supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>) override; >- void setSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>) override; >+ bool supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>) override; >+ void setSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>) override; > > virtual void generatePresets() = 0; > virtual bool prefersPreset(VideoPreset&) { return true; } >@@ -77,8 +77,8 @@ private: > IntSize requestedSize; > double requestedFrameRate { 0 }; > }; >- bool supportsCaptureSize(std::optional<int>, std::optional<int>, const Function<bool(const IntSize&)>&&); >- std::optional<CaptureSizeAndFrameRate> bestSupportedSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>); >+ bool supportsCaptureSize(Optional<int>, Optional<int>, const Function<bool(const IntSize&)>&&); >+ Optional<CaptureSizeAndFrameRate> bestSupportedSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>); > bool presetSupportsFrameRate(RefPtr<VideoPreset>, double); > > Vector<Ref<VideoPreset>> m_presets; >diff --git a/Source/WebCore/platform/mediastream/VideoPreset.h b/Source/WebCore/platform/mediastream/VideoPreset.h >index 40702c8e4d3d4dcbe6168cb54fe18a004fcc673b..f99ff0a38c744f7613d79ad9a5ae243da019fe2c 100644 >--- a/Source/WebCore/platform/mediastream/VideoPreset.h >+++ b/Source/WebCore/platform/mediastream/VideoPreset.h >@@ -41,7 +41,7 @@ struct FrameRateRange { > double maximum; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<FrameRateRange> decode(Decoder&); >+ template<class Decoder> static Optional<FrameRateRange> decode(Decoder&); > }; > > template<class Encoder> >@@ -52,17 +52,17 @@ void FrameRateRange::encode(Encoder& encoder) const > } > > template <class Decoder> >-std::optional<FrameRateRange> FrameRateRange::decode(Decoder& decoder) >+Optional<FrameRateRange> FrameRateRange::decode(Decoder& decoder) > { >- std::optional<double> minimum; >+ Optional<double> minimum; > decoder >> minimum; > if (!minimum) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<double> maximum; >+ Optional<double> maximum; > decoder >> maximum; > if (!maximum) >- return std::nullopt; >+ return WTF::nullopt; > > return FrameRateRange { *minimum, *maximum }; > } >@@ -72,7 +72,7 @@ struct VideoPresetData { > Vector<FrameRateRange> frameRateRanges; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<VideoPresetData> decode(Decoder&); >+ template<class Decoder> static Optional<VideoPresetData> decode(Decoder&); > }; > > template<class Encoder> >@@ -83,17 +83,17 @@ void VideoPresetData::encode(Encoder& encoder) const > } > > template <class Decoder> >-std::optional<VideoPresetData> VideoPresetData::decode(Decoder& decoder) >+Optional<VideoPresetData> VideoPresetData::decode(Decoder& decoder) > { >- std::optional<IntSize> size; >+ Optional<IntSize> size; > decoder >> size; > if (!size) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<FrameRateRange>> frameRateRanges; >+ Optional<Vector<FrameRateRange>> frameRateRanges; > decoder >> frameRateRanges; > if (!frameRateRanges) >- return std::nullopt; >+ return WTF::nullopt; > > return VideoPresetData { *size, *frameRateRanges }; > } >diff --git a/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h b/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h >index fa34194da2e35cde0a1fedede9feee64d6d8ffd0..5229a251cc59428318d60cba19de1e8c94d094ba 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h >+++ b/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h >@@ -46,8 +46,8 @@ protected: > void startProducingData() override; > void stopProducingData() override; > >- mutable std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >- mutable std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ mutable Optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ mutable Optional<RealtimeMediaSourceSettings> m_currentSettings; > > private: > bool isCaptureSource() const final { return true; } >diff --git a/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp b/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp >index c7cf33b8bd6d924b38182cdf485a03fdd2292224..e08df296ebc7d3a79a418b6df68181b2e6a45022 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp >+++ b/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp >@@ -66,7 +66,7 @@ GStreamerDisplayCaptureDeviceManager& GStreamerDisplayCaptureDeviceManager::sing > return manager; > } > >-std::optional<GStreamerCaptureDevice> GStreamerCaptureDeviceManager::gstreamerDeviceWithUID(const String& deviceID) >+Optional<GStreamerCaptureDevice> GStreamerCaptureDeviceManager::gstreamerDeviceWithUID(const String& deviceID) > { > captureDevices(); > >@@ -74,7 +74,7 @@ std::optional<GStreamerCaptureDevice> GStreamerCaptureDeviceManager::gstreamerDe > if (device.persistentId() == deviceID) > return device; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > const Vector<CaptureDevice>& GStreamerCaptureDeviceManager::captureDevices() >diff --git a/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h b/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h >index ce11c4f3a8c3ff156a85ecad3232c85f079671f9..27fb0aabc10a95e913befb651d227d69312d682a 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h >+++ b/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h >@@ -32,7 +32,7 @@ namespace WebCore { > > class GStreamerCaptureDeviceManager : public CaptureDeviceManager { > public: >- std::optional<GStreamerCaptureDevice> gstreamerDeviceWithUID(const String&); >+ Optional<GStreamerCaptureDevice> gstreamerDeviceWithUID(const String&); > > const Vector<CaptureDevice>& captureDevices() final; > virtual CaptureDevice::DeviceType deviceType() = 0; >diff --git a/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h b/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h >index c9fa15a621bd7f144bfe1344ae011056c01f050f..cb5e651cd37b8f630184f2e861e71b8e8f3d3991 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h >+++ b/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h >@@ -50,8 +50,8 @@ protected: > void generatePresets() final; > > >- mutable std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >- mutable std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ mutable Optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ mutable Optional<RealtimeMediaSourceSettings> m_currentSettings; > > private: > static GstFlowReturn newSampleCallback(GstElement*, GStreamerVideoCaptureSource*); >diff --git a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp >index 16bb68cb64ac5c878100c6df296a6054113aacaa..dedc079b2a1b357c50d71a8da4199abc4c56fa26 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp >+++ b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp >@@ -123,7 +123,7 @@ public: > } > > GRefPtr<GstElement> m_src; >- std::optional<GStreamerAudioStreamDescription> m_streamFormat; >+ Optional<GStreamerAudioStreamDescription> m_streamFormat; > Vector<float> m_bipBopBuffer; > uint32_t m_maximiumFrameCount; > uint64_t m_samplesEmitted { 0 }; >@@ -141,7 +141,7 @@ CaptureSourceOrError MockRealtimeAudioSource::create(String&& deviceID, > return CaptureSourceOrError(WTFMove(source)); > } > >-std::optional<std::pair<String, String>> MockGStreamerAudioCaptureSource::applyConstraints(const MediaConstraints& constraints) >+Optional<std::pair<String, String>> MockGStreamerAudioCaptureSource::applyConstraints(const MediaConstraints& constraints) > { > m_wrappedSource->applyConstraints(constraints); > return GStreamerAudioCaptureSource::applyConstraints(constraints); >diff --git a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h >index 8a4bbe85f377de67064a908eb4161562fa4d67fb..f332530accb256f62903d69592827c1630626b9c 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h >+++ b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h >@@ -31,7 +31,7 @@ class MockGStreamerAudioCaptureSource final : public GStreamerAudioCaptureSource > public: > MockGStreamerAudioCaptureSource(String&& deviceID, String&& name, String&& hashSalt); > ~MockGStreamerAudioCaptureSource(); >- std::optional<std::pair<String, String>> applyConstraints(const MediaConstraints&); >+ Optional<std::pair<String, String>> applyConstraints(const MediaConstraints&); > void applyConstraints(const MediaConstraints&, SuccessHandler&&, FailureHandler&&) final; > > private: >diff --git a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp >index cb30696609dbd88f862f0beab6a99fdf26a89ef5..0d62e4b91c6f4975966ea2cba62dcb9fa0360ca0 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp >+++ b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp >@@ -107,7 +107,7 @@ MockGStreamerVideoCaptureSource::~MockGStreamerVideoCaptureSource() > m_wrappedSource->removeObserver(*this); > } > >-std::optional<std::pair<String, String>> MockGStreamerVideoCaptureSource::applyConstraints(const MediaConstraints& constraints) >+Optional<std::pair<String, String>> MockGStreamerVideoCaptureSource::applyConstraints(const MediaConstraints& constraints) > { > m_wrappedSource->applyConstraints(constraints); > return GStreamerVideoCaptureSource::applyConstraints(constraints); >diff --git a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h >index c2486323b31a3ee5fd44614911d88b6da3cef958..481459d511f9a37c9f1f5b75ef45872171cad276 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h >+++ b/Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h >@@ -36,7 +36,7 @@ class MockGStreamerVideoCaptureSource final : public GStreamerVideoCaptureSource > public: > MockGStreamerVideoCaptureSource(String&& deviceID, String&& name, String&& hashSalt); > ~MockGStreamerVideoCaptureSource(); >- std::optional<std::pair<String, String>> applyConstraints(const MediaConstraints&); >+ Optional<std::pair<String, String>> applyConstraints(const MediaConstraints&); > void applyConstraints(const MediaConstraints&, SuccessHandler&&, FailureHandler&&) final; > > private: >diff --git a/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h b/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h >index 00d76dd9a1245eeafcf3aa4eed36e232bd2c1495..aa5ace30c808b21d869455634196e40ac52ff7c8 100644 >--- a/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h >+++ b/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h >@@ -45,10 +45,10 @@ public: > static AVAudioSessionCaptureDeviceManager& singleton(); > > const Vector<CaptureDevice>& captureDevices() final; >- std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&); >+ Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&); > > Vector<AVAudioSessionCaptureDevice>& audioSessionCaptureDevices(); >- std::optional<AVAudioSessionCaptureDevice> audioSessionDeviceWithUID(const String&); >+ Optional<AVAudioSessionCaptureDevice> audioSessionDeviceWithUID(const String&); > > private: > AVAudioSessionCaptureDeviceManager() = default; >@@ -56,8 +56,8 @@ private: > > void refreshAudioCaptureDevices(); > >- std::optional<Vector<CaptureDevice>> m_devices; >- std::optional<Vector<AVAudioSessionCaptureDevice>> m_audioSessionCaptureDevices; >+ Optional<Vector<CaptureDevice>> m_devices; >+ Optional<Vector<AVAudioSessionCaptureDevice>> m_audioSessionCaptureDevices; > RetainPtr<WebAVAudioSessionAvailableInputsListener> m_listener; > }; > >diff --git a/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm b/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm >index 2b35b33c27c5702b1b6635aa60b252cf11295d60..0406d6c9b531d5297a8938b274fb38a603f09440 100644 >--- a/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm >+++ b/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm >@@ -92,14 +92,14 @@ const Vector<CaptureDevice>& AVAudioSessionCaptureDeviceManager::captureDevices( > return m_devices.value(); > } > >-std::optional<CaptureDevice> AVAudioSessionCaptureDeviceManager::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& deviceID) >+Optional<CaptureDevice> AVAudioSessionCaptureDeviceManager::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& deviceID) > { > ASSERT_UNUSED(type, type == CaptureDevice::DeviceType::Microphone); > for (auto& device : captureDevices()) { > if (device.persistentId() == deviceID) > return device; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > Vector<AVAudioSessionCaptureDevice>& AVAudioSessionCaptureDeviceManager::audioSessionCaptureDevices() >@@ -109,7 +109,7 @@ Vector<AVAudioSessionCaptureDevice>& AVAudioSessionCaptureDeviceManager::audioSe > return m_audioSessionCaptureDevices.value(); > } > >-std::optional<AVAudioSessionCaptureDevice> AVAudioSessionCaptureDeviceManager::audioSessionDeviceWithUID(const String& deviceID) >+Optional<AVAudioSessionCaptureDevice> AVAudioSessionCaptureDeviceManager::audioSessionDeviceWithUID(const String& deviceID) > { > if (!m_audioSessionCaptureDevices) > refreshAudioCaptureDevices(); >@@ -118,7 +118,7 @@ std::optional<AVAudioSessionCaptureDevice> AVAudioSessionCaptureDeviceManager::a > if (device.persistentId() == deviceID) > return device; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > void AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices() >diff --git a/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp b/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp >index c24dc0799d14052b7025aaa515fce807bf9bad1c..c357704f5a14db50e0e6c17aecac8915545e060b 100644 >--- a/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp >+++ b/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp >@@ -287,7 +287,7 @@ rtc::RTCCertificateGenerator& LibWebRTCProvider::certificateGenerator() > return *factoryAndThreads.certificateGenerator; > } > >-static inline std::optional<cricket::MediaType> typeFromKind(const String& kind) >+static inline Optional<cricket::MediaType> typeFromKind(const String& kind) > { > if (kind == "audio"_s) > return cricket::MediaType::MEDIA_TYPE_AUDIO; >@@ -301,7 +301,7 @@ static inline String fromStdString(const std::string& value) > return String::fromUTF8(value.data(), value.length()); > } > >-static inline std::optional<uint16_t> toChannels(absl::optional<int> numChannels) >+static inline Optional<uint16_t> toChannels(absl::optional<int> numChannels) > { > if (!numChannels) > return { }; >@@ -323,7 +323,7 @@ static inline RTCRtpCapabilities toRTCRtpCapabilities(const webrtc::RtpCapabilit > return capabilities; > } > >-std::optional<RTCRtpCapabilities> LibWebRTCProvider::receiverCapabilities(const String& kind) >+Optional<RTCRtpCapabilities> LibWebRTCProvider::receiverCapabilities(const String& kind) > { > auto mediaType = typeFromKind(kind); > if (!mediaType) >@@ -336,7 +336,7 @@ std::optional<RTCRtpCapabilities> LibWebRTCProvider::receiverCapabilities(const > return toRTCRtpCapabilities(factory->GetRtpReceiverCapabilities(*mediaType)); > } > >-std::optional<RTCRtpCapabilities> LibWebRTCProvider::senderCapabilities(const String& kind) >+Optional<RTCRtpCapabilities> LibWebRTCProvider::senderCapabilities(const String& kind) > { > auto mediaType = typeFromKind(kind); > if (!mediaType) >diff --git a/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h b/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h >index c2494275df285ffd4735e748974eb9cfcb7960cc..a31bd6a3b4f5b20ce3ab4e85c6f97c26bcef2804 100644 >--- a/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h >+++ b/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h >@@ -110,8 +110,8 @@ public: > > rtc::RTCCertificateGenerator& certificateGenerator(); > >- std::optional<RTCRtpCapabilities> receiverCapabilities(const String& kind); >- std::optional<RTCRtpCapabilities> senderCapabilities(const String& kind); >+ Optional<RTCRtpCapabilities> receiverCapabilities(const String& kind); >+ Optional<RTCRtpCapabilities> senderCapabilities(const String& kind); > > protected: > LibWebRTCProvider() = default; >diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h >index a83d6618635ec815f61a9be2e52ca25f4ccb94d8..926c763b5be9ac1df8a933601a7ca37f4b04daad 100644 >--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h >+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h >@@ -114,8 +114,8 @@ private: > int m_deviceOrientation { 0 }; > MediaSample::VideoRotation m_sampleRotation { MediaSample::VideoRotation::None }; > >- std::optional<RealtimeMediaSourceSettings> m_currentSettings; >- std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ Optional<RealtimeMediaSourceSettings> m_currentSettings; >+ Optional<RealtimeMediaSourceCapabilities> m_capabilities; > RetainPtr<WebCoreAVVideoCaptureSourceObserver> m_objcObserver; > RetainPtr<AVCaptureSession> m_session; > RetainPtr<AVCaptureDevice> m_device; >diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >index 9410587736c69c9dcf1de146d5feb8dcfd8c80b5..24871011a6c6138d7facfa361f6dc3a9ab9a653f 100644 >--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >@@ -239,7 +239,7 @@ void AVVideoCaptureSource::commitConfiguration() > > void AVVideoCaptureSource::settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag>) > { >- m_currentSettings = std::nullopt; >+ m_currentSettings = WTF::nullopt; > } > > const RealtimeMediaSourceSettings& AVVideoCaptureSource::settings() >diff --git a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.cpp b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.cpp >index 0e6338fa2319dbaf81a4232941fbb68b86bb375e..2be85b060a3148660a4c9837533a781643832348 100644 >--- a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.cpp >+++ b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.cpp >@@ -65,12 +65,12 @@ static bool getDeviceInfo(uint32_t deviceID, String& persistentID, String& label > return true; > } > >-std::optional<CoreAudioCaptureDevice> CoreAudioCaptureDevice::create(uint32_t deviceID) >+Optional<CoreAudioCaptureDevice> CoreAudioCaptureDevice::create(uint32_t deviceID) > { > String persistentID; > String label; > if (!getDeviceInfo(deviceID, persistentID, label)) >- return std::nullopt; >+ return WTF::nullopt; > > return CoreAudioCaptureDevice(deviceID, persistentID, label); > } >diff --git a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.h b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.h >index f8f9bb39a4bfd49462dc2b2eda83379b96667a5e..94c94949524e5294714d8021d6a9fa576912a1cd 100644 >--- a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.h >+++ b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDevice.h >@@ -38,7 +38,7 @@ namespace WebCore { > class CoreAudioCaptureDevice : public CaptureDevice { > public: > >- static std::optional<CoreAudioCaptureDevice> create(uint32_t); >+ static Optional<CoreAudioCaptureDevice> create(uint32_t); > virtual ~CoreAudioCaptureDevice() = default; > > uint32_t deviceID() const { return m_deviceID; } >diff --git a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp >index 1111eab0320f41be16b308fb70843443bef4e941..10956ba1fc9694f03f3558c07736d353e6206d48 100644 >--- a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp >+++ b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp >@@ -52,14 +52,14 @@ const Vector<CaptureDevice>& CoreAudioCaptureDeviceManager::captureDevices() > return m_devices; > } > >-std::optional<CaptureDevice> CoreAudioCaptureDeviceManager::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& deviceID) >+Optional<CaptureDevice> CoreAudioCaptureDeviceManager::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& deviceID) > { > ASSERT_UNUSED(type, type == CaptureDevice::DeviceType::Microphone); > for (auto& device : captureDevices()) { > if (device.persistentId() == deviceID) > return device; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > static bool deviceHasInputStreams(AudioObjectID deviceID) >@@ -100,13 +100,13 @@ Vector<CoreAudioCaptureDevice>& CoreAudioCaptureDeviceManager::coreAudioCaptureD > return m_coreAudioCaptureDevices; > } > >-std::optional<CoreAudioCaptureDevice> CoreAudioCaptureDeviceManager::coreAudioDeviceWithUID(const String& deviceID) >+Optional<CoreAudioCaptureDevice> CoreAudioCaptureDeviceManager::coreAudioDeviceWithUID(const String& deviceID) > { > for (auto& device : coreAudioCaptureDevices()) { > if (device.persistentId() == deviceID) > return device; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > >diff --git a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.h b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.h >index cf48276414b242aafa486d9250375c8814cc1b9f..5c972f1864fa6a1078762ae4c4ff0ffe897f659e 100644 >--- a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.h >+++ b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.h >@@ -44,9 +44,9 @@ public: > static CoreAudioCaptureDeviceManager& singleton(); > > const Vector<CaptureDevice>& captureDevices() final; >- std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&); >+ Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&); > >- std::optional<CoreAudioCaptureDevice> coreAudioDeviceWithUID(const String&); >+ Optional<CoreAudioCaptureDevice> coreAudioDeviceWithUID(const String&); > > private: > CoreAudioCaptureDeviceManager() = default; >diff --git a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp >index 72be7307bab19c718ef41a1535c0d32dec728aa7..57d6b014fd5058e010c96852e49f6c45987d8a0b 100644 >--- a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp >+++ b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp >@@ -153,7 +153,7 @@ private: > int32_t m_producingCount { 0 }; > > mutable std::unique_ptr<RealtimeMediaSourceCapabilities> m_capabilities; >- mutable std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ mutable Optional<RealtimeMediaSourceSettings> m_currentSettings; > > #if !LOG_DISABLED > void checkTimestamps(const AudioTimeStamp&, uint64_t, double); >@@ -896,7 +896,7 @@ void CoreAudioCaptureSource::settingsDidChange(OptionSet<RealtimeMediaSourceSett > scheduleReconfiguration(); > } > >- m_currentSettings = std::nullopt; >+ m_currentSettings = WTF::nullopt; > } > > void CoreAudioCaptureSource::scheduleReconfiguration() >diff --git a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h >index 84a634fdbaee8ce19a74453df5beebf87450cb32..d9fa0ae43406aa3960dd659feb7b1258c805973a 100644 >--- a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h >+++ b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h >@@ -85,7 +85,7 @@ private: > void startProducingData() final; > void stopProducingData() final; > >- std::optional<Vector<int>> discreteSampleRates() const final { return { { 8000, 16000, 32000, 44100, 48000, 96000 } }; } >+ Optional<Vector<int>> discreteSampleRates() const final { return { { 8000, 16000, 32000, 44100, 48000, 96000 } }; } > > const RealtimeMediaSourceCapabilities& capabilities() final; > const RealtimeMediaSourceSettings& settings() final; >@@ -95,8 +95,8 @@ private: > > uint32_t m_captureDeviceID { 0 }; > >- std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >- std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ Optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ Optional<RealtimeMediaSourceSettings> m_currentSettings; > > enum class SuspensionType { None, WhilePaused, WhilePlaying }; > SuspensionType m_suspendType { SuspensionType::None }; >diff --git a/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp b/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp >index 06da625e29c55eb0da1d3593d675fcaa3cef559a..e55894360985e4503632a511f7b0ad5702851422 100644 >--- a/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp >+++ b/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp >@@ -72,27 +72,27 @@ void DisplayCaptureManagerCocoa::updateWindowCaptureDevices() > #endif > } > >-std::optional<CaptureDevice> DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID(const String& deviceID) >+Optional<CaptureDevice> DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID(const String& deviceID) > { > #if PLATFORM(MAC) > return ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID(deviceID); > #else > UNUSED_PARAM(deviceID); >- return std::nullopt; >+ return WTF::nullopt; > #endif > } > >-std::optional<CaptureDevice> DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID(const String& deviceID) >+Optional<CaptureDevice> DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID(const String& deviceID) > { > #if PLATFORM(MAC) > return WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID(deviceID); > #else > UNUSED_PARAM(deviceID); >- return std::nullopt; >+ return WTF::nullopt; > #endif > } > >-std::optional<CaptureDevice> DisplayCaptureManagerCocoa::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) >+Optional<CaptureDevice> DisplayCaptureManagerCocoa::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) > { > switch (type) { > case CaptureDevice::DeviceType::Screen: >@@ -114,7 +114,7 @@ std::optional<CaptureDevice> DisplayCaptureManagerCocoa::captureDeviceWithPersis > break; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.h b/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.h >index 28fff40a797137069669048574332d8eb22ef3a3..e67c8ee482e5e3b6fab971dd95361789b42c080c 100644 >--- a/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.h >+++ b/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.h >@@ -45,9 +45,9 @@ private: > > const Vector<CaptureDevice>& captureDevices() final; > >- std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&) final; >- std::optional<CaptureDevice> screenCaptureDeviceWithPersistentID(const String&); >- std::optional<CaptureDevice> windowCaptureDeviceWithPersistentID(const String&); >+ Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&) final; >+ Optional<CaptureDevice> screenCaptureDeviceWithPersistentID(const String&); >+ Optional<CaptureDevice> windowCaptureDeviceWithPersistentID(const String&); > > Vector<CaptureDevice> m_devices; > }; >diff --git a/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.h b/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.h >index ed79d2cb49117ca87869c0a54f941ef271df3d53..186f256261a8812622ae6b53b0a9b7cdfe9c8b50 100644 >--- a/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.h >+++ b/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.h >@@ -79,8 +79,8 @@ private: > > void emitFrame(); > >- std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >- std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ Optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ Optional<RealtimeMediaSourceSettings> m_currentSettings; > RealtimeMediaSourceSupportedConstraints m_supportedConstraints; > > MonotonicTime m_startTime { MonotonicTime::nan() }; >diff --git a/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.h b/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.h >index 5208b262a3c0377f6283c30ac2ca8356c42f3dbc..49384f4f53bef283fca152c6618df2c908716945 100644 >--- a/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.h >+++ b/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.h >@@ -51,7 +51,7 @@ private: > MockRealtimeAudioSourceMac(String&& deviceID, String&& name, String&& hashSalt); > > void settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag>) final; >- std::optional<Vector<int>> discreteSampleRates() const final { return { { 44100, 48000 } }; } >+ Optional<Vector<int>> discreteSampleRates() const final { return { { 44100, 48000 } }; } > > void emitSampleBuffers(uint32_t); > void render(Seconds) final; >diff --git a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h >index 05ebeae9da3849b3f3aa4bf75eaf9d45b21d6a6a..939304f58627e77c491b189fa84b595e7194dac4 100644 >--- a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h >+++ b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h >@@ -43,7 +43,7 @@ class ScreenDisplayCaptureSourceMac : public DisplayCaptureSourceCocoa { > public: > static CaptureSourceOrError create(String&&, const MediaConstraints*); > >- static std::optional<CaptureDevice> screenCaptureDeviceWithPersistentID(const String&); >+ static Optional<CaptureDevice> screenCaptureDeviceWithPersistentID(const String&); > static void screenCaptureDevices(Vector<CaptureDevice>&); > > private: >diff --git a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm >index 8200e9019183552a88614e1df53a8fa6e272d729..1e8ac6c86e2f9fe7140b8acc99efc5961f2cf3a0 100644 >--- a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm >+++ b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm >@@ -47,25 +47,25 @@ size_t CGDisplayModeGetPixelsHigh(CGDisplayModeRef); > > namespace WebCore { > >-static std::optional<CGDirectDisplayID> updateDisplayID(CGDirectDisplayID displayID) >+static Optional<CGDirectDisplayID> updateDisplayID(CGDirectDisplayID displayID) > { > uint32_t displayCount = 0; > auto err = CGGetActiveDisplayList(0, nullptr, &displayCount); > if (err) { > RELEASE_LOG(Media, "CGGetActiveDisplayList() returned error %d when trying to get display count", static_cast<int>(err)); >- return std::nullopt; >+ return WTF::nullopt; > } > > if (!displayCount) { > RELEASE_LOG(Media, "CGGetActiveDisplayList() returned a display count of 0"); >- return std::nullopt; >+ return WTF::nullopt; > } > > CGDirectDisplayID activeDisplays[displayCount]; > err = CGGetActiveDisplayList(displayCount, &(activeDisplays[0]), &displayCount); > if (err) { > RELEASE_LOG(Media, "CGGetActiveDisplayList() returned error %d when trying to get the active display list", static_cast<int>(err)); >- return std::nullopt; >+ return WTF::nullopt; > } > > auto displayMask = CGDisplayIDToOpenGLDisplayMask(displayID); >@@ -74,7 +74,7 @@ static std::optional<CGDirectDisplayID> updateDisplayID(CGDirectDisplayID displa > return display; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > CaptureSourceOrError ScreenDisplayCaptureSourceMac::create(String&& deviceID, const MediaConstraints* constraints) >@@ -277,18 +277,18 @@ void ScreenDisplayCaptureSourceMac::frameAvailable(CGDisplayStreamFrameStatus st > m_currentFrame = frameSurface; > } > >-std::optional<CaptureDevice> ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID(const String& deviceID) >+Optional<CaptureDevice> ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID(const String& deviceID) > { > bool ok; > auto displayID = deviceID.toUIntStrict(&ok); > if (!ok) { > RELEASE_LOG(Media, "ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID: display ID does not convert to 32-bit integer"); >- return std::nullopt; >+ return WTF::nullopt; > } > > auto actualDisplayID = updateDisplayID(displayID); > if (!actualDisplayID) >- return std::nullopt; >+ return WTF::nullopt; > > auto device = CaptureDevice(String::number(actualDisplayID.value()), CaptureDevice::DeviceType::Screen, "ScreenCaptureDevice"_s); > device.setEnabled(true); >diff --git a/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h b/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h >index 2899ff21a722f17138655ac9a30e6a1a3bdc64e4..ff30eb37eb70d9c1f4c78b4aa1214a41e169240d 100644 >--- a/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h >+++ b/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h >@@ -69,8 +69,8 @@ private: > void trackEnabledChanged(MediaStreamTrackPrivate&) final { } > > size_t m_listBufferSize { 0 }; >- std::optional<CAAudioStreamDescription> m_inputDescription; >- std::optional<CAAudioStreamDescription> m_outputDescription; >+ Optional<CAAudioStreamDescription> m_inputDescription; >+ Optional<CAAudioStreamDescription> m_outputDescription; > RefPtr<AudioSampleDataSource> m_dataSource; > > uint64_t m_writeCount { 0 }; >diff --git a/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm b/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm >index 94efae695ddd292cf8f4214e3c3d04d181638e35..dadf2b5c63857823e50223ab17dcf6ba4fd17f76 100644 >--- a/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm >+++ b/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm >@@ -149,8 +149,8 @@ void WebAudioSourceProviderAVFObjC::unprepare() > { > std::lock_guard<Lock> lock(m_mutex); > >- m_inputDescription = std::nullopt; >- m_outputDescription = std::nullopt; >+ m_inputDescription = WTF::nullopt; >+ m_outputDescription = WTF::nullopt; > m_dataSource = nullptr; > m_listBufferSize = 0; > if (m_captureSource) { >diff --git a/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.h b/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.h >index 2d1a66e0312badca89d9bcf0b8066ed432db2d56..33d1b817e9a9e45abafe487de35f1d7a31723ae0 100644 >--- a/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.h >+++ b/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.h >@@ -42,7 +42,7 @@ class WindowDisplayCaptureSourceMac : public DisplayCaptureSourceCocoa { > public: > static CaptureSourceOrError create(String&&, const MediaConstraints*); > >- static std::optional<CaptureDevice> windowCaptureDeviceWithPersistentID(const String&); >+ static Optional<CaptureDevice> windowCaptureDeviceWithPersistentID(const String&); > static void windowCaptureDevices(Vector<CaptureDevice>&); > > private: >diff --git a/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm b/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm >index 9c5d5d4312d6d53684c85f2a780d83b326951581..1e8ec47efbe0d315f9ea4af6d5d8221f93f37912 100644 >--- a/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm >+++ b/Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm >@@ -144,13 +144,13 @@ DisplayCaptureSourceCocoa::DisplayFrameType WindowDisplayCaptureSourceMac::gener > return DisplayCaptureSourceCocoa::DisplayFrameType { RetainPtr<CGImageRef> { windowImage() } }; > } > >-std::optional<CaptureDevice> WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID(const String& idString) >+Optional<CaptureDevice> WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID(const String& idString) > { > bool ok; > auto windowID = idString.toUIntStrict(&ok); > if (!ok) { > RELEASE_LOG(Media, "WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID: window ID does not convert to 32-bit integer"); >- return std::nullopt; >+ return WTF::nullopt; > } > > String windowTitle; >@@ -163,7 +163,7 @@ std::optional<CaptureDevice> WindowDisplayCaptureSourceMac::windowCaptureDeviceW > > })) { > RELEASE_LOG(Media, "WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID: window ID is not valid"); >- return std::nullopt; >+ return WTF::nullopt; > } > > auto device = CaptureDevice(String::number(windowID), CaptureDevice::DeviceType::Window, windowTitle); >diff --git a/Source/WebCore/platform/mock/GeolocationClientMock.cpp b/Source/WebCore/platform/mock/GeolocationClientMock.cpp >index 18dafd9e7fcbd4bb315b9e473d7e77d0eda88546..b80cc1e0fca0813b350813aa98b0c7de93093c8d 100644 >--- a/Source/WebCore/platform/mock/GeolocationClientMock.cpp >+++ b/Source/WebCore/platform/mock/GeolocationClientMock.cpp >@@ -72,7 +72,7 @@ void GeolocationClientMock::setPositionUnavailableError(const String& errorMessa > { > m_hasError = true; > m_errorMessage = errorMessage; >- m_lastPosition = std::nullopt; >+ m_lastPosition = WTF::nullopt; > asyncUpdateController(); > } > >@@ -126,7 +126,7 @@ void GeolocationClientMock::permissionTimerFired() > > void GeolocationClientMock::reset() > { >- m_lastPosition = std::nullopt; >+ m_lastPosition = WTF::nullopt; > clearError(); > m_permissionState = PermissionStateUnset; > } >@@ -156,7 +156,7 @@ void GeolocationClientMock::setEnableHighAccuracy(bool) > // See https://bugs.webkit.org/show_bug.cgi?id=49438 > } > >-std::optional<GeolocationPosition> GeolocationClientMock::lastPosition() >+Optional<GeolocationPosition> GeolocationClientMock::lastPosition() > { > return m_lastPosition; > } >diff --git a/Source/WebCore/platform/mock/GeolocationClientMock.h b/Source/WebCore/platform/mock/GeolocationClientMock.h >index fc1b51d7f710fc38621edcc76e604fc76daa1045..27ccd94316516c11c06cff3984bb70a25201eaf0 100644 >--- a/Source/WebCore/platform/mock/GeolocationClientMock.h >+++ b/Source/WebCore/platform/mock/GeolocationClientMock.h >@@ -62,7 +62,7 @@ public: > void startUpdating() override; > void stopUpdating() override; > void setEnableHighAccuracy(bool) override; >- std::optional<GeolocationPosition> lastPosition() override; >+ Optional<GeolocationPosition> lastPosition() override; > void requestPermission(Geolocation&) override; > void cancelPermissionRequest(Geolocation&) override; > >@@ -76,7 +76,7 @@ private: > void clearError(); > > GeolocationController* m_controller; >- std::optional<GeolocationPosition> m_lastPosition; >+ Optional<GeolocationPosition> m_lastPosition; > bool m_hasError; > String m_errorMessage; > Timer m_controllerTimer; >diff --git a/Source/WebCore/platform/mock/MockMediaDevice.h b/Source/WebCore/platform/mock/MockMediaDevice.h >index 6546503e88fdb4c428a4030e42eab077283933ab..b44b41bde5e8fb4bd8d9d86c9edca4b7b45a67d6 100644 >--- a/Source/WebCore/platform/mock/MockMediaDevice.h >+++ b/Source/WebCore/platform/mock/MockMediaDevice.h >@@ -43,12 +43,12 @@ struct MockMicrophoneProperties { > } > > template <class Decoder> >- static std::optional<MockMicrophoneProperties> decode(Decoder& decoder) >+ static Optional<MockMicrophoneProperties> decode(Decoder& decoder) > { >- std::optional<int32_t> defaultSampleRate; >+ Optional<int32_t> defaultSampleRate; > decoder >> defaultSampleRate; > if (!defaultSampleRate) >- return std::nullopt; >+ return WTF::nullopt; > return MockMicrophoneProperties { *defaultSampleRate }; > } > >@@ -67,27 +67,27 @@ struct MockCameraProperties { > } > > template <class Decoder> >- static std::optional<MockCameraProperties> decode(Decoder& decoder) >+ static Optional<MockCameraProperties> decode(Decoder& decoder) > { >- std::optional<double> defaultFrameRate; >+ Optional<double> defaultFrameRate; > decoder >> defaultFrameRate; > if (!defaultFrameRate) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<RealtimeMediaSourceSettings::VideoFacingMode> facingMode; >+ Optional<RealtimeMediaSourceSettings::VideoFacingMode> facingMode; > decoder >> facingMode; > if (!facingMode) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<VideoPresetData>> presets; >+ Optional<Vector<VideoPresetData>> presets; > decoder >> presets; > if (!presets) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Color> fillColor; >+ Optional<Color> fillColor; > decoder >> fillColor; > if (!fillColor) >- return std::nullopt; >+ return WTF::nullopt; > > return MockCameraProperties { *defaultFrameRate, *facingMode, WTFMove(*presets), *fillColor }; > } >@@ -108,21 +108,21 @@ struct MockDisplayProperties { > } > > template <class Decoder> >- static std::optional<MockDisplayProperties> decode(Decoder& decoder) >+ static Optional<MockDisplayProperties> decode(Decoder& decoder) > { >- std::optional<CaptureDevice::DeviceType> type; >+ Optional<CaptureDevice::DeviceType> type; > decoder >> type; >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Color> fillColor; >+ Optional<Color> fillColor; > decoder >> fillColor; > if (!fillColor) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<IntSize> defaultSize; >+ Optional<IntSize> defaultSize; > decoder >> defaultSize; > if (!defaultSize) >- return std::nullopt; >+ return WTF::nullopt; > > return MockDisplayProperties { *type, *fillColor, *defaultSize }; > } >@@ -166,32 +166,32 @@ struct MockMediaDevice { > } > > template <typename Properties, typename Decoder> >- static std::optional<MockMediaDevice> decodeMockMediaDevice(Decoder& decoder, String&& persistentId, String&& label) >+ static Optional<MockMediaDevice> decodeMockMediaDevice(Decoder& decoder, String&& persistentId, String&& label) > { >- std::optional<Properties> properties; >+ Optional<Properties> properties; > decoder >> properties; > if (!properties) >- return std::nullopt; >+ return WTF::nullopt; > return MockMediaDevice { WTFMove(persistentId), WTFMove(label), WTFMove(*properties) }; > } > > template <class Decoder> >- static std::optional<MockMediaDevice> decode(Decoder& decoder) >+ static Optional<MockMediaDevice> decode(Decoder& decoder) > { >- std::optional<String> persistentId; >+ Optional<String> persistentId; > decoder >> persistentId; > if (!persistentId) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> label; >+ Optional<String> label; > decoder >> label; > if (!label) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint8_t> index; >+ Optional<uint8_t> index; > decoder >> index; > if (!index) >- return std::nullopt; >+ return WTF::nullopt; > > switch (*index) { > case 1: >@@ -201,7 +201,7 @@ struct MockMediaDevice { > case 3: > return decodeMockMediaDevice<MockDisplayProperties>(decoder, WTFMove(*persistentId), WTFMove(*label)); > } >- return std::nullopt; >+ return WTF::nullopt; > } > > String persistentId; >diff --git a/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp b/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp >index dc5a2d6e660e40efc437304f7164b509d72711df..a14aee21e3172a6b326e2c1987fc81acf487d080 100644 >--- a/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp >+++ b/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp >@@ -114,7 +114,7 @@ const RealtimeMediaSourceCapabilities& MockRealtimeAudioSource::capabilities() > > void MockRealtimeAudioSource::settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag>) > { >- m_currentSettings = std::nullopt; >+ m_currentSettings = WTF::nullopt; > } > > void MockRealtimeAudioSource::startProducingData() >diff --git a/Source/WebCore/platform/mock/MockRealtimeAudioSource.h b/Source/WebCore/platform/mock/MockRealtimeAudioSource.h >index 1d1d5b186727a9eb842b09bdeba2696acce784f6..819b3e8012a58e907a8b51582dee4ea3b0466973 100644 >--- a/Source/WebCore/platform/mock/MockRealtimeAudioSource.h >+++ b/Source/WebCore/platform/mock/MockRealtimeAudioSource.h >@@ -67,8 +67,8 @@ private: > > void delaySamples(Seconds) final; > >- std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >- std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ Optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ Optional<RealtimeMediaSourceSettings> m_currentSettings; > RealtimeMediaSourceSupportedConstraints m_supportedConstraints; > > RunLoop::Timer<MockRealtimeAudioSource> m_timer; >diff --git a/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp b/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp >index 2719d15b2c34acc7a86535a9035d0edee64f43c3..1296a37199e719492e1a21952158ae66bbea1c40 100644 >--- a/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp >+++ b/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp >@@ -267,26 +267,26 @@ void MockRealtimeMediaSourceCenter::removeDevice(const String& persistentId) > RealtimeMediaSourceCenter::singleton().captureDevicesChanged(); > } > >-std::optional<MockMediaDevice> MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID(const String& id) >+Optional<MockMediaDevice> MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID(const String& id) > { > ASSERT(!id.isEmpty()); > > auto& map = deviceMap(); > auto iterator = map.find(id); > if (iterator == map.end()) >- return std::nullopt; >+ return WTF::nullopt; > > return iterator->value; > } > >-std::optional<CaptureDevice> MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) >+Optional<CaptureDevice> MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) > { > ASSERT(!id.isEmpty()); > > auto& map = deviceMap(); > auto iterator = map.find(id); > if (iterator == map.end() || iterator->value.type() != type) >- return std::nullopt; >+ return WTF::nullopt; > > CaptureDevice device { iterator->value.persistentId, type, iterator->value.label }; > device.setEnabled(true); >diff --git a/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h b/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h >index 60590876448cc8f75a9d5837c06394a8f4007d79..deea05377f97582a8e56ed49778fd2e9c826d9b1 100644 >--- a/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h >+++ b/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h >@@ -55,8 +55,8 @@ public: > static Vector<CaptureDevice>& videoDevices(); > static Vector<CaptureDevice>& displayDevices(); > >- static std::optional<MockMediaDevice> mockDeviceWithPersistentID(const String&); >- static std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&); >+ static Optional<MockMediaDevice> mockDeviceWithPersistentID(const String&); >+ static Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType, const String&); > > CaptureDeviceManager& audioCaptureDeviceManager() { return m_audioCaptureDeviceManager; } > CaptureDeviceManager& videoCaptureDeviceManager() { return m_videoCaptureDeviceManager; } >@@ -73,17 +73,17 @@ private: > class MockAudioCaptureDeviceManager final : public CaptureDeviceManager { > private: > const Vector<CaptureDevice>& captureDevices() final { return MockRealtimeMediaSourceCenter::audioDevices(); } >- std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) final { return MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(type, id); } >+ Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) final { return MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(type, id); } > }; > class MockVideoCaptureDeviceManager final : public CaptureDeviceManager { > private: > const Vector<CaptureDevice>& captureDevices() final { return MockRealtimeMediaSourceCenter::videoDevices(); } >- std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) final { return MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(type, id); } >+ Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) final { return MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(type, id); } > }; > class MockDisplayCaptureDeviceManager final : public CaptureDeviceManager { > private: > const Vector<CaptureDevice>& captureDevices() final { return MockRealtimeMediaSourceCenter::displayDevices(); } >- std::optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) final { return MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(type, id); } >+ Optional<CaptureDevice> captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id) final { return MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID(type, id); } > }; > > MockAudioCaptureDeviceManager m_audioCaptureDeviceManager; >diff --git a/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp b/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp >index 4e7336e2c8121fc54f9e20d62723524b53abc0d2..a48e14fdf25df742ccf384bf2b054c921fb5bc64 100644 >--- a/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp >+++ b/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp >@@ -92,7 +92,7 @@ MockRealtimeVideoSource::MockRealtimeVideoSource(String&& deviceID, String&& nam > m_fillColor = properties.fillColor; > } > >-bool MockRealtimeVideoSource::supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> rate) >+bool MockRealtimeVideoSource::supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> rate) > { > // FIXME: consider splitting mock display into another class so we don't don't have to do this silly dance > // because of the RealtimeVideoSource inheritance. >@@ -102,7 +102,7 @@ bool MockRealtimeVideoSource::supportsSizeAndFrameRate(std::optional<int> width, > return RealtimeMediaSource::supportsSizeAndFrameRate(width, height, rate); > } > >-void MockRealtimeVideoSource::setSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> rate) >+void MockRealtimeVideoSource::setSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> rate) > { > // FIXME: consider splitting mock display into another class so we don't don't have to do this silly dance > // because of the RealtimeVideoSource inheritance. >@@ -195,7 +195,7 @@ IntSize MockRealtimeVideoSource::captureSize() const > > void MockRealtimeVideoSource::settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag> settings) > { >- m_currentSettings = std::nullopt; >+ m_currentSettings = WTF::nullopt; > if (settings.containsAny({ RealtimeMediaSourceSettings::Flag::Width, RealtimeMediaSourceSettings::Flag::Height })) { > m_baseFontSize = captureSize().height() * .08; > m_bipBopFontSize = m_baseFontSize * 2.5; >diff --git a/Source/WebCore/platform/mock/MockRealtimeVideoSource.h b/Source/WebCore/platform/mock/MockRealtimeVideoSource.h >index 58b8e4292afa78c23b413b6609017fc898198176..dd215b94ba8f3a6c6ee80a30444d642a9bd6b9e0 100644 >--- a/Source/WebCore/platform/mock/MockRealtimeVideoSource.h >+++ b/Source/WebCore/platform/mock/MockRealtimeVideoSource.h >@@ -68,8 +68,8 @@ private: > void startProducingData() final; > void stopProducingData() final; > bool isCaptureSource() const final { return true; } >- bool supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>) final; >- void setSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>) final; >+ bool supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>) final; >+ void setSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>) final; > void setSizeAndFrameRateWithPreset(IntSize, double, RefPtr<VideoPreset>) final; > IntSize captureSize() const; > >@@ -105,8 +105,8 @@ private: > > unsigned m_frameNumber { 0 }; > RunLoop::Timer<MockRealtimeVideoSource> m_emitFrameTimer; >- std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >- std::optional<RealtimeMediaSourceSettings> m_currentSettings; >+ Optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ Optional<RealtimeMediaSourceSettings> m_currentSettings; > RealtimeMediaSourceSupportedConstraints m_supportedConstraints; > Color m_fillColor { Color::black }; > MockMediaDevice m_device; >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >index 72af0711c58a027c02938dd8f1a9d43d741091f2..55993382b3a1dc36d8356b61b25c7002e07347fe 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >@@ -271,9 +271,9 @@ void MockMediaPlayerMediaSource::seekCompleted() > }); > } > >-std::optional<VideoPlaybackQualityMetrics> MockMediaPlayerMediaSource::videoPlaybackQualityMetrics() >+Optional<VideoPlaybackQualityMetrics> MockMediaPlayerMediaSource::videoPlaybackQualityMetrics() > { >- return m_mediaSourcePrivate ? m_mediaSourcePrivate->videoPlaybackQualityMetrics() : std::nullopt; >+ return m_mediaSourcePrivate ? m_mediaSourcePrivate->videoPlaybackQualityMetrics() : WTF::nullopt; > } > > } >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >index 031a10ec0b834a557ab77d6826fc9505d393c242..b3bf3a19a66f39ba7dc0d6b5c96d67abf8126950 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >@@ -81,7 +81,7 @@ private: > MediaTime currentMediaTime() const override; > MediaTime durationMediaTime() const override; > void seekWithTolerance(const MediaTime&, const MediaTime&, const MediaTime&) override; >- std::optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() override; >+ Optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics() override; > > MediaPlayer* m_player; > RefPtr<MockMediaSourcePrivate> m_mediaSourcePrivate; >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp b/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp >index abc3ba574e5512882cdad5cf19b0773f2d5092af..d7d21930032fef6851691356640d73a5dfcb27a7 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp >@@ -171,7 +171,7 @@ MediaTime MockMediaSourcePrivate::seekToTime(const MediaTime& targetTime, const > return seekTime; > } > >-std::optional<VideoPlaybackQualityMetrics> MockMediaSourcePrivate::videoPlaybackQualityMetrics() >+Optional<VideoPlaybackQualityMetrics> MockMediaSourcePrivate::videoPlaybackQualityMetrics() > { > return VideoPlaybackQualityMetrics { > m_totalVideoFrames, >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h b/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h >index 4d94566c3248678be36f85ce869c15e35894f910..8bcbe3b38b0b5033dca3f499674f8e217b453699 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h >@@ -53,7 +53,7 @@ public: > void seekToTime(const MediaTime&); > MediaTime seekToTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold); > >- std::optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics(); >+ Optional<VideoPlaybackQualityMetrics> videoPlaybackQualityMetrics(); > > void incrementTotalVideoFrames() { ++m_totalVideoFrames; } > void incrementDroppedFrames() { ++m_droppedVideoFrames; } >diff --git a/Source/WebCore/platform/network/BlobDataFileReference.cpp b/Source/WebCore/platform/network/BlobDataFileReference.cpp >index b8d1312afe5ff1b42365b82bf215009fd54c87dc..b63f0612abfcb866da0ced0a235dc15593ff05ed 100644 >--- a/Source/WebCore/platform/network/BlobDataFileReference.cpp >+++ b/Source/WebCore/platform/network/BlobDataFileReference.cpp >@@ -68,13 +68,13 @@ unsigned long long BlobDataFileReference::size() > return m_size; > } > >-std::optional<WallTime> BlobDataFileReference::expectedModificationTime() >+Optional<WallTime> BlobDataFileReference::expectedModificationTime() > { > #if ENABLE(FILE_REPLACEMENT) > // We do not currently track modifications for generated files, because we have a snapshot. > // Unfortunately, this is inconsistent with regular file handling - File objects should be invalidated when underlying files change. > if (m_replacementShouldBeGenerated || !m_replacementPath.isNull()) >- return std::nullopt; >+ return WTF::nullopt; > #endif > return m_expectedModificationTime; > } >diff --git a/Source/WebCore/platform/network/BlobDataFileReference.h b/Source/WebCore/platform/network/BlobDataFileReference.h >index 40def69f6f8c7ba8cb64307e5c99cda94fd2e808..658829d07fcfbd6b02a20e1cb01fdc9d6dcc07c9 100644 >--- a/Source/WebCore/platform/network/BlobDataFileReference.h >+++ b/Source/WebCore/platform/network/BlobDataFileReference.h >@@ -46,7 +46,7 @@ public: > > const String& path(); > unsigned long long size(); >- std::optional<WallTime> expectedModificationTime(); >+ Optional<WallTime> expectedModificationTime(); > > virtual void prepareForFileAccess(); > virtual void revokeFileAccess(); >diff --git a/Source/WebCore/platform/network/CacheValidation.cpp b/Source/WebCore/platform/network/CacheValidation.cpp >index 910fbf956821fb70c6e63251f0ab4815223f1e02..0212bc9f1c7e311b616534de13ec90142489ed59 100644 >--- a/Source/WebCore/platform/network/CacheValidation.cpp >+++ b/Source/WebCore/platform/network/CacheValidation.cpp >@@ -337,9 +337,9 @@ static String headerValueForVary(const ResourceRequest& request, const String& h > auto* cookieStrategy = platformStrategies() ? platformStrategies()->cookiesStrategy() : nullptr; > if (!cookieStrategy) { > ASSERT(sessionID == PAL::SessionID::defaultSessionID()); >- return NetworkStorageSession::defaultStorageSession().cookieRequestHeaderFieldValue(request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), std::nullopt, std::nullopt, includeSecureCookies).first; >+ return NetworkStorageSession::defaultStorageSession().cookieRequestHeaderFieldValue(request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), WTF::nullopt, WTF::nullopt, includeSecureCookies).first; > } >- return cookieStrategy->cookieRequestHeaderFieldValue(sessionID, request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), std::nullopt, std::nullopt, includeSecureCookies).first; >+ return cookieStrategy->cookieRequestHeaderFieldValue(sessionID, request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), WTF::nullopt, WTF::nullopt, includeSecureCookies).first; > } > return request.httpHeaderField(headerName); > } >diff --git a/Source/WebCore/platform/network/CertificateInfoBase.h b/Source/WebCore/platform/network/CertificateInfoBase.h >index b01b97f78a364506a1f308a2a78bbc287358eb3e..3f6677696fada4961a7c7349b6ab0683a1378dbf 100644 >--- a/Source/WebCore/platform/network/CertificateInfoBase.h >+++ b/Source/WebCore/platform/network/CertificateInfoBase.h >@@ -43,7 +43,7 @@ public: > Vector<String> dnsNames; > Vector<String> ipAddresses; > }; >- std::optional<SummaryInfo> summaryInfo() const { return std::nullopt; }; >+ Optional<SummaryInfo> summaryInfo() const { return WTF::nullopt; }; > > bool isEmpty() const { return true; }; > }; >diff --git a/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h b/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h >index 32a6f57c0a2196047c7439b0939dfe2cd0c369e7..a6bf577e06e20746768485c18aa6b98500389db2 100644 >--- a/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h >+++ b/Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h >@@ -37,12 +37,12 @@ struct CookieRequestHeaderFieldProxy { > URL firstParty; > SameSiteInfo sameSiteInfo; > URL url; >- std::optional<uint64_t> frameID; >- std::optional<uint64_t> pageID; >+ Optional<uint64_t> frameID; >+ Optional<uint64_t> pageID; > IncludeSecureCookies includeSecureCookies { IncludeSecureCookies::No }; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<CookieRequestHeaderFieldProxy> decode(Decoder&); >+ template<class Decoder> static Optional<CookieRequestHeaderFieldProxy> decode(Decoder&); > }; > > template<class Encoder> >@@ -58,23 +58,23 @@ void CookieRequestHeaderFieldProxy::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<CookieRequestHeaderFieldProxy> CookieRequestHeaderFieldProxy::decode(Decoder& decoder) >+Optional<CookieRequestHeaderFieldProxy> CookieRequestHeaderFieldProxy::decode(Decoder& decoder) > { > CookieRequestHeaderFieldProxy result; > if (!decoder.decode(result.sessionID)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.firstParty)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.sameSiteInfo)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.url)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.frameID)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.pageID)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.includeSecureCookies)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > } > >diff --git a/Source/WebCore/platform/network/DataURLDecoder.h b/Source/WebCore/platform/network/DataURLDecoder.h >index 974d9cebeb195188b5c84692aa0f5b26ba990cd6..f387be9f6e6541ec23080f138aa45c2086851f7e 100644 >--- a/Source/WebCore/platform/network/DataURLDecoder.h >+++ b/Source/WebCore/platform/network/DataURLDecoder.h >@@ -46,7 +46,7 @@ struct Result { > RefPtr<SharedBuffer> data; > }; > >-using DecodeCompletionHandler = WTF::Function<void (std::optional<Result>)>; >+using DecodeCompletionHandler = WTF::Function<void (Optional<Result>)>; > struct ScheduleContext { > #if HAVE(RUNLOOP_TIMER) > SchedulePairHashSet scheduledPairs; >diff --git a/Source/WebCore/platform/network/FormData.cpp b/Source/WebCore/platform/network/FormData.cpp >index 45aebae5209c9b5d50f1f2145da553f9e45ee9d3..54e4ac04962a221907e3b7d80a4fbacbe254b399 100644 >--- a/Source/WebCore/platform/network/FormData.cpp >+++ b/Source/WebCore/platform/network/FormData.cpp >@@ -172,7 +172,7 @@ FormDataElement FormDataElement::isolatedCopy() const > > void FormData::appendData(const void* data, size_t size) > { >- m_lengthInBytes = std::nullopt; >+ m_lengthInBytes = WTF::nullopt; > if (!m_elements.isEmpty()) { > if (auto* vector = WTF::get_if<Vector<char>>(m_elements.last().data)) { > vector->append(reinterpret_cast<const char*>(data), size); >@@ -186,20 +186,20 @@ void FormData::appendData(const void* data, size_t size) > > void FormData::appendFile(const String& filename, bool shouldGenerateFile) > { >- m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, std::nullopt, shouldGenerateFile)); >- m_lengthInBytes = std::nullopt; >+ m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, WTF::nullopt, shouldGenerateFile)); >+ m_lengthInBytes = WTF::nullopt; > } > >-void FormData::appendFileRange(const String& filename, long long start, long long length, std::optional<WallTime> expectedModificationTime, bool shouldGenerateFile) >+void FormData::appendFileRange(const String& filename, long long start, long long length, Optional<WallTime> expectedModificationTime, bool shouldGenerateFile) > { > m_elements.append(FormDataElement(filename, start, length, expectedModificationTime, shouldGenerateFile)); >- m_lengthInBytes = std::nullopt; >+ m_lengthInBytes = WTF::nullopt; > } > > void FormData::appendBlob(const URL& blobURL) > { > m_elements.append(FormDataElement(blobURL)); >- m_lengthInBytes = std::nullopt; >+ m_lengthInBytes = WTF::nullopt; > } > > static Vector<uint8_t> normalizeStringData(TextEncoding& encoding, const String& value) >diff --git a/Source/WebCore/platform/network/FormData.h b/Source/WebCore/platform/network/FormData.h >index d7c1e5faa0de50783bfb47724bf59919ab66f91d..9d0573afe3b46708f61268054215a0ed6ab2dbcf 100644 >--- a/Source/WebCore/platform/network/FormData.h >+++ b/Source/WebCore/platform/network/FormData.h >@@ -45,7 +45,7 @@ struct FormDataElement { > : data(WTFMove(data)) { } > explicit FormDataElement(Vector<char>&& array) > : data(WTFMove(array)) { } >- FormDataElement(const String& filename, int64_t fileStart, int64_t fileLength, std::optional<WallTime> expectedFileModificationTime, bool shouldGenerateFile) >+ FormDataElement(const String& filename, int64_t fileStart, int64_t fileLength, Optional<WallTime> expectedFileModificationTime, bool shouldGenerateFile) > : data(EncodedFileData { filename, fileStart, fileLength, expectedFileModificationTime, { }, shouldGenerateFile, false }) { } > explicit FormDataElement(const URL& blobURL) > : data(EncodedBlobData { blobURL }) { } >@@ -58,12 +58,12 @@ struct FormDataElement { > { > encoder << data; > } >- template<typename Decoder> static std::optional<FormDataElement> decode(Decoder& decoder) >+ template<typename Decoder> static Optional<FormDataElement> decode(Decoder& decoder) > { >- std::optional<Data> data; >+ Optional<Data> data; > decoder >> data; > if (!data) >- return std::nullopt; >+ return WTF::nullopt; > return FormDataElement(WTFMove(*data)); > } > >@@ -71,7 +71,7 @@ struct FormDataElement { > String filename; > int64_t fileStart { 0 }; > int64_t fileLength { 0 }; >- std::optional<WallTime> expectedFileModificationTime; >+ Optional<WallTime> expectedFileModificationTime; > String generatedFilename; > bool shouldGenerateFile { false }; > bool ownsGeneratedFile { false }; >@@ -99,37 +99,37 @@ struct FormDataElement { > { > encoder << filename << fileStart << fileLength << expectedFileModificationTime << generatedFilename << shouldGenerateFile; > } >- template<typename Decoder> static std::optional<EncodedFileData> decode(Decoder& decoder) >+ template<typename Decoder> static Optional<EncodedFileData> decode(Decoder& decoder) > { >- std::optional<String> filename; >+ Optional<String> filename; > decoder >> filename; > if (!filename) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int64_t> fileStart; >+ Optional<int64_t> fileStart; > decoder >> fileStart; > if (!fileStart) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int64_t> fileLength; >+ Optional<int64_t> fileLength; > decoder >> fileLength; > if (!fileLength) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<WallTime>> expectedFileModificationTime; >+ Optional<Optional<WallTime>> expectedFileModificationTime; > decoder >> expectedFileModificationTime; > if (!expectedFileModificationTime) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> generatedFilename; >+ Optional<String> generatedFilename; > decoder >> generatedFilename; > if (!generatedFilename) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> shouldGenerateFile; >+ Optional<bool> shouldGenerateFile; > decoder >> shouldGenerateFile; > if (!shouldGenerateFile) >- return std::nullopt; >+ return WTF::nullopt; > > bool ownsGeneratedFile = false; > >@@ -157,12 +157,12 @@ struct FormDataElement { > { > encoder << url; > } >- template<typename Decoder> static std::optional<EncodedBlobData> decode(Decoder& decoder) >+ template<typename Decoder> static Optional<EncodedBlobData> decode(Decoder& decoder) > { >- std::optional<URL> url; >+ Optional<URL> url; > decoder >> url; > if (!url) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*url) }}; > } >@@ -218,7 +218,7 @@ public: > > WEBCORE_EXPORT void appendData(const void* data, size_t); > void appendFile(const String& filePath, bool shouldGenerateFile = false); >- WEBCORE_EXPORT void appendFileRange(const String& filename, long long start, long long length, std::optional<WallTime> expectedModificationTime, bool shouldGenerateFile = false); >+ WEBCORE_EXPORT void appendFileRange(const String& filename, long long start, long long length, Optional<WallTime> expectedModificationTime, bool shouldGenerateFile = false); > WEBCORE_EXPORT void appendBlob(const URL& blobURL); > > Vector<char> flatten() const; // omits files >@@ -279,7 +279,7 @@ private: > bool m_alwaysStream { false }; > Vector<char> m_boundary; > bool m_containsPasswordData { false }; >- mutable std::optional<uint64_t> m_lengthInBytes; >+ mutable Optional<uint64_t> m_lengthInBytes; > }; > > inline bool operator==(const FormData& a, const FormData& b) >diff --git a/Source/WebCore/platform/network/HTTPHeaderMap.h b/Source/WebCore/platform/network/HTTPHeaderMap.h >index 0bcb03f979002e4b05b052cfba6addcac512214e..a55b14563b89fb12702cd00e53e6a36d60d1c8f8 100644 >--- a/Source/WebCore/platform/network/HTTPHeaderMap.h >+++ b/Source/WebCore/platform/network/HTTPHeaderMap.h >@@ -44,7 +44,7 @@ public: > > CommonHeader isolatedCopy() const { return { key , value.isolatedCopy() }; } > template <class Encoder> void encode(Encoder&) const; >- template <class Decoder> static std::optional<CommonHeader> decode(Decoder&); >+ template <class Decoder> static Optional<CommonHeader> decode(Decoder&); > > bool operator==(const CommonHeader& other) const { return key == other.key && value == other.value; } > }; >@@ -55,7 +55,7 @@ public: > > UncommonHeader isolatedCopy() const { return { key.isolatedCopy() , value.isolatedCopy() }; } > template <class Encoder> void encode(Encoder&) const; >- template <class Decoder> static std::optional<UncommonHeader> decode(Decoder&); >+ template <class Decoder> static Optional<UncommonHeader> decode(Decoder&); > > bool operator==(const UncommonHeader& other) const { return key == other.key && value == other.value; } > }; >@@ -76,7 +76,7 @@ public: > > struct KeyValue { > String key; >- std::optional<HTTPHeaderName> keyAsHTTPHeaderName; >+ Optional<HTTPHeaderName> keyAsHTTPHeaderName; > String value; > }; > >@@ -121,7 +121,7 @@ public: > if (it == m_table.uncommonHeaders().end()) > return false; > m_keyValue.key = it->key; >- m_keyValue.keyAsHTTPHeaderName = std::nullopt; >+ m_keyValue.keyAsHTTPHeaderName = WTF::nullopt; > m_keyValue.value = it->value; > return true; > } >@@ -214,14 +214,14 @@ void HTTPHeaderMap::CommonHeader::encode(Encoder& encoder) const > } > > template <class Decoder> >-auto HTTPHeaderMap::CommonHeader::decode(Decoder& decoder) -> std::optional<CommonHeader> >+auto HTTPHeaderMap::CommonHeader::decode(Decoder& decoder) -> Optional<CommonHeader> > { > HTTPHeaderName name; > if (!decoder.decodeEnum(name)) >- return std::nullopt; >+ return WTF::nullopt; > String value; > if (!decoder.decode(value)) >- return std::nullopt; >+ return WTF::nullopt; > > return CommonHeader { name, WTFMove(value) }; > } >@@ -234,14 +234,14 @@ void HTTPHeaderMap::UncommonHeader::encode(Encoder& encoder) const > } > > template <class Decoder> >-auto HTTPHeaderMap::UncommonHeader::decode(Decoder& decoder) -> std::optional<UncommonHeader> >+auto HTTPHeaderMap::UncommonHeader::decode(Decoder& decoder) -> Optional<UncommonHeader> > { > String name; > if (!decoder.decode(name)) >- return std::nullopt; >+ return WTF::nullopt; > String value; > if (!decoder.decode(value)) >- return std::nullopt; >+ return WTF::nullopt; > > return UncommonHeader { WTFMove(name), WTFMove(value) }; > } >diff --git a/Source/WebCore/platform/network/HTTPParsers.cpp b/Source/WebCore/platform/network/HTTPParsers.cpp >index fa00f9ef103fed44693837f9b91677c9efbde4d7..333631b6272b166313f0999b072c3292036bfa7f 100644 >--- a/Source/WebCore/platform/network/HTTPParsers.cpp >+++ b/Source/WebCore/platform/network/HTTPParsers.cpp >@@ -260,11 +260,11 @@ bool parseHTTPRefresh(const String& refresh, double& delay, String& url) > } > } > >-std::optional<WallTime> parseHTTPDate(const String& value) >+Optional<WallTime> parseHTTPDate(const String& value) > { > double dateInMillisecondsSinceEpoch = parseDateFromNullTerminatedCharacters(value.utf8().data()); > if (!std::isfinite(dateInMillisecondsSinceEpoch)) >- return std::nullopt; >+ return WTF::nullopt; > // This assumes system_clock epoch equals Unix epoch which is true for all implementations but unspecified. > // FIXME: The parsing function should be switched to WallTime too. > return WallTime::fromRawSeconds(dateInMillisecondsSinceEpoch / 1000.0); >diff --git a/Source/WebCore/platform/network/HTTPParsers.h b/Source/WebCore/platform/network/HTTPParsers.h >index 0c9fd97cf17d7ec076544be3d33506fa9ff78a4f..46ce37794070b96b04b57f2281dc1c15fc1e9de3 100644 >--- a/Source/WebCore/platform/network/HTTPParsers.h >+++ b/Source/WebCore/platform/network/HTTPParsers.h >@@ -77,7 +77,7 @@ bool isValidAcceptHeaderValue(const String&); > bool isValidLanguageHeaderValue(const String&); > bool isValidHTTPToken(const String&); > bool parseHTTPRefresh(const String& refresh, double& delay, String& url); >-std::optional<WallTime> parseHTTPDate(const String&); >+Optional<WallTime> parseHTTPDate(const String&); > String filenameFromHTTPContentDisposition(const String&); > String extractMIMETypeFromMediaType(const String&); > String extractCharsetFromMediaType(const String&); >diff --git a/Source/WebCore/platform/network/NetworkLoadInformation.h b/Source/WebCore/platform/network/NetworkLoadInformation.h >index e3b89c6f185eae07e69d8c9bd525e16e0b632e0e..86b37dda547347cf62d1382c63d2c5bac2810e57 100644 >--- a/Source/WebCore/platform/network/NetworkLoadInformation.h >+++ b/Source/WebCore/platform/network/NetworkLoadInformation.h >@@ -40,7 +40,7 @@ struct NetworkTransactionInformation { > NetworkLoadMetrics metrics; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<NetworkTransactionInformation> decode(Decoder&); >+ template<class Decoder> static Optional<NetworkTransactionInformation> decode(Decoder&); > }; > > struct NetworkLoadInformation { >@@ -72,18 +72,18 @@ template<class Encoder> inline void NetworkTransactionInformation::encode(Encode > encoder << metrics; > } > >-template<class Decoder> inline std::optional<NetworkTransactionInformation> NetworkTransactionInformation::decode(Decoder& decoder) >+template<class Decoder> inline Optional<NetworkTransactionInformation> NetworkTransactionInformation::decode(Decoder& decoder) > { > NetworkTransactionInformation information; > > if (!decoder.decode(information.type)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(information.request)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(information.response)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(information.metrics)) >- return std::nullopt; >+ return WTF::nullopt; > > return information; > } >diff --git a/Source/WebCore/platform/network/NetworkLoadMetrics.h b/Source/WebCore/platform/network/NetworkLoadMetrics.h >index 05d660a33c14557b569e89e97d00b9f8af6e593e..44ce29223268427d185bd215f7f655caf355e280 100644 >--- a/Source/WebCore/platform/network/NetworkLoadMetrics.h >+++ b/Source/WebCore/platform/network/NetworkLoadMetrics.h >@@ -236,13 +236,13 @@ bool NetworkLoadMetrics::decode(Decoder& decoder, NetworkLoadMetrics& metrics) > namespace WTF { > namespace Persistence { > >-template<> struct Coder<std::optional<WebCore::NetworkLoadPriority>> { >- static NO_RETURN_DUE_TO_ASSERT void encode(Encoder&, const std::optional<WebCore::NetworkLoadPriority>&) >+template<> struct Coder<Optional<WebCore::NetworkLoadPriority>> { >+ static NO_RETURN_DUE_TO_ASSERT void encode(Encoder&, const Optional<WebCore::NetworkLoadPriority>&) > { > ASSERT_NOT_REACHED(); > } > >- static bool decode(Decoder&, std::optional<WebCore::NetworkLoadPriority>&) >+ static bool decode(Decoder&, Optional<WebCore::NetworkLoadPriority>&) > { > ASSERT_NOT_REACHED(); > return false; >diff --git a/Source/WebCore/platform/network/NetworkStateNotifier.h b/Source/WebCore/platform/network/NetworkStateNotifier.h >index 3fc259868b6cb486f7414fdb2a1d0f26ecf15c71..87930048f4fd18d6098af7de4da25be532df5931 100644 >--- a/Source/WebCore/platform/network/NetworkStateNotifier.h >+++ b/Source/WebCore/platform/network/NetworkStateNotifier.h >@@ -71,7 +71,7 @@ private: > static void networkChangedCallback(NetworkStateNotifier*); > #endif > >- std::optional<bool> m_isOnLine; >+ Optional<bool> m_isOnLine; > Vector<WTF::Function<void(bool)>> m_listeners; > Timer m_updateStateTimer; > >diff --git a/Source/WebCore/platform/network/NetworkStorageSession.cpp b/Source/WebCore/platform/network/NetworkStorageSession.cpp >index 1a9c8daec7fe17a4920413e87d52b11fb7a5da25..bbb48f2658400954486bb9a7c50ae35776b0f072 100644 >--- a/Source/WebCore/platform/network/NetworkStorageSession.cpp >+++ b/Source/WebCore/platform/network/NetworkStorageSession.cpp >@@ -103,12 +103,12 @@ bool NetworkStorageSession::shouldBlockThirdPartyCookies(const String& topPrivat > return m_topPrivatelyControlledDomainsToBlock.contains(topPrivatelyControlledDomain); > } > >-bool NetworkStorageSession::shouldBlockCookies(const ResourceRequest& request, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) const >+bool NetworkStorageSession::shouldBlockCookies(const ResourceRequest& request, Optional<uint64_t> frameID, Optional<uint64_t> pageID) const > { > return shouldBlockCookies(request.firstPartyForCookies(), request.url(), frameID, pageID); > } > >-bool NetworkStorageSession::shouldBlockCookies(const URL& firstPartyForCookies, const URL& resource, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) const >+bool NetworkStorageSession::shouldBlockCookies(const URL& firstPartyForCookies, const URL& resource, Optional<uint64_t> frameID, Optional<uint64_t> pageID) const > { > auto firstPartyDomain = getPartitioningDomain(firstPartyForCookies); > if (firstPartyDomain.isEmpty()) >@@ -127,14 +127,14 @@ bool NetworkStorageSession::shouldBlockCookies(const URL& firstPartyForCookies, > return shouldBlockThirdPartyCookies(resourceDomain); > } > >-std::optional<Seconds> NetworkStorageSession::maxAgeCacheCap(const ResourceRequest& request) >+Optional<Seconds> NetworkStorageSession::maxAgeCacheCap(const ResourceRequest& request) > { >- if (m_cacheMaxAgeCapForPrevalentResources && shouldBlockCookies(request, std::nullopt, std::nullopt)) >+ if (m_cacheMaxAgeCapForPrevalentResources && shouldBlockCookies(request, WTF::nullopt, WTF::nullopt)) > return m_cacheMaxAgeCapForPrevalentResources; >- return std::nullopt; >+ return WTF::nullopt; > } > >-void NetworkStorageSession::setAgeCapForClientSideCookies(std::optional<Seconds> seconds) >+void NetworkStorageSession::setAgeCapForClientSideCookies(Optional<Seconds> seconds) > { > m_ageCapForClientSideCookies = seconds; > } >@@ -151,7 +151,7 @@ void NetworkStorageSession::removePrevalentDomains(const Vector<String>& domains > m_topPrivatelyControlledDomainsToBlock.remove(domain); > } > >-bool NetworkStorageSession::hasStorageAccess(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID) const >+bool NetworkStorageSession::hasStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID) const > { > if (frameID) { > auto framesGrantedIterator = m_framesGrantedStorageAccess.find(pageID); >@@ -184,7 +184,7 @@ Vector<String> NetworkStorageSession::getAllStorageAccessEntries() const > return entries; > } > >-void NetworkStorageSession::grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID) >+void NetworkStorageSession::grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID) > { > if (!frameID) { > if (firstPartyDomain.isEmpty()) >@@ -246,7 +246,7 @@ void NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources(Seconds secon > > void NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources() > { >- m_cacheMaxAgeCapForPrevalentResources = std::nullopt; >+ m_cacheMaxAgeCapForPrevalentResources = WTF::nullopt; > } > #endif // ENABLE(RESOURCE_LOAD_STATISTICS) > >diff --git a/Source/WebCore/platform/network/NetworkStorageSession.h b/Source/WebCore/platform/network/NetworkStorageSession.h >index 2fb390f48589e49e546327293bf57a72c5c0c747..9884119ce54b502ed0c59fc0ca07859eb5cbba9b 100644 >--- a/Source/WebCore/platform/network/NetworkStorageSession.h >+++ b/Source/WebCore/platform/network/NetworkStorageSession.h >@@ -133,7 +133,7 @@ public: > WEBCORE_EXPORT bool cookiesEnabled() const; > WEBCORE_EXPORT void setCookie(const Cookie&); > WEBCORE_EXPORT void setCookies(const Vector<Cookie>&, const URL&, const URL& mainDocumentURL); >- WEBCORE_EXPORT void setCookiesFromDOM(const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) const; >+ WEBCORE_EXPORT void setCookiesFromDOM(const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String&) const; > WEBCORE_EXPORT void deleteCookie(const Cookie&); > WEBCORE_EXPORT void deleteCookie(const URL&, const String&) const; > WEBCORE_EXPORT void deleteAllCookies(); >@@ -141,28 +141,28 @@ public: > WEBCORE_EXPORT void deleteCookiesForHostnames(const Vector<String>& cookieHostNames); > WEBCORE_EXPORT Vector<Cookie> getAllCookies(); > WEBCORE_EXPORT Vector<Cookie> getCookies(const URL&); >- WEBCORE_EXPORT bool getRawCookies(const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>&) const; >+ WEBCORE_EXPORT bool getRawCookies(const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>&) const; > WEBCORE_EXPORT void flushCookieStore(); > WEBCORE_EXPORT void getHostnamesWithCookies(HashSet<String>& hostnames); >- WEBCORE_EXPORT std::pair<String, bool> cookiesForDOM(const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const; >- WEBCORE_EXPORT std::pair<String, bool> cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const; >+ WEBCORE_EXPORT std::pair<String, bool> cookiesForDOM(const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const; >+ WEBCORE_EXPORT std::pair<String, bool> cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const; > WEBCORE_EXPORT std::pair<String, bool> cookieRequestHeaderFieldValue(const CookieRequestHeaderFieldProxy&) const; > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >- WEBCORE_EXPORT bool shouldBlockCookies(const ResourceRequest&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) const; >- WEBCORE_EXPORT bool shouldBlockCookies(const URL& firstPartyForCookies, const URL& resource, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) const; >+ WEBCORE_EXPORT bool shouldBlockCookies(const ResourceRequest&, Optional<uint64_t> frameID, Optional<uint64_t> pageID) const; >+ WEBCORE_EXPORT bool shouldBlockCookies(const URL& firstPartyForCookies, const URL& resource, Optional<uint64_t> frameID, Optional<uint64_t> pageID) const; > WEBCORE_EXPORT void setPrevalentDomainsToBlockCookiesFor(const Vector<String>&); >- WEBCORE_EXPORT void setAgeCapForClientSideCookies(std::optional<Seconds>); >+ WEBCORE_EXPORT void setAgeCapForClientSideCookies(Optional<Seconds>); > WEBCORE_EXPORT void removePrevalentDomains(const Vector<String>& domains); >- WEBCORE_EXPORT bool hasStorageAccess(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID) const; >+ WEBCORE_EXPORT bool hasStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID) const; > WEBCORE_EXPORT Vector<String> getAllStorageAccessEntries() const; >- WEBCORE_EXPORT void grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID); >+ WEBCORE_EXPORT void grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID); > WEBCORE_EXPORT void removeStorageAccessForFrame(uint64_t frameID, uint64_t pageID); > WEBCORE_EXPORT void removeStorageAccessForAllFramesOnPage(uint64_t pageID); > WEBCORE_EXPORT void removeAllStorageAccess(); > WEBCORE_EXPORT void setCacheMaxAgeCapForPrevalentResources(Seconds); > WEBCORE_EXPORT void resetCacheMaxAgeCapForPrevalentResources(); >- WEBCORE_EXPORT std::optional<Seconds> maxAgeCacheCap(const ResourceRequest&); >+ WEBCORE_EXPORT Optional<Seconds> maxAgeCacheCap(const ResourceRequest&); > #endif > > private: >@@ -194,8 +194,8 @@ private: > HashSet<String> m_topPrivatelyControlledDomainsToBlock; > HashMap<uint64_t, HashMap<uint64_t, String, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>>, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> m_framesGrantedStorageAccess; > HashMap<uint64_t, HashMap<String, String>, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> m_pagesGrantedStorageAccess; >- std::optional<Seconds> m_cacheMaxAgeCapForPrevalentResources { }; >- std::optional<Seconds> m_ageCapForClientSideCookies { }; >+ Optional<Seconds> m_cacheMaxAgeCapForPrevalentResources { }; >+ Optional<Seconds> m_ageCapForClientSideCookies { }; > #endif > > #if PLATFORM(COCOA) >diff --git a/Source/WebCore/platform/network/ParsedContentType.cpp b/Source/WebCore/platform/network/ParsedContentType.cpp >index d729a05dbc0a528172a48ea9371cd8c51f3e1002..9e8f7e16b91c204709895c49668ce5402370a1af 100644 >--- a/Source/WebCore/platform/network/ParsedContentType.cpp >+++ b/Source/WebCore/platform/network/ParsedContentType.cpp >@@ -53,14 +53,14 @@ static bool isTokenCharacter(char c) > return isASCII(c) && c > ' ' && c != '"' && c != '(' && c != ')' && c != ',' && c != '/' && (c < ':' || c > '@') && (c < '[' || c > ']'); > } > >-static std::optional<SubstringRange> parseToken(const String& input, unsigned& startIndex) >+static Optional<SubstringRange> parseToken(const String& input, unsigned& startIndex) > { > unsigned inputLength = input.length(); > unsigned tokenStart = startIndex; > unsigned& tokenEnd = startIndex; > > if (tokenEnd >= inputLength) >- return std::nullopt; >+ return WTF::nullopt; > > while (tokenEnd < inputLength) { > if (!isTokenCharacter(input[tokenEnd])) >@@ -69,27 +69,27 @@ static std::optional<SubstringRange> parseToken(const String& input, unsigned& s > } > > if (tokenEnd == tokenStart) >- return std::nullopt; >+ return WTF::nullopt; > return SubstringRange(tokenStart, tokenEnd - tokenStart); > } > >-static std::optional<SubstringRange> parseQuotedString(const String& input, unsigned& startIndex) >+static Optional<SubstringRange> parseQuotedString(const String& input, unsigned& startIndex) > { > unsigned inputLength = input.length(); > unsigned quotedStringStart = startIndex + 1; > unsigned& quotedStringEnd = startIndex; > > if (quotedStringEnd >= inputLength) >- return std::nullopt; >+ return WTF::nullopt; > > if (input[quotedStringEnd++] != '"' || quotedStringEnd >= inputLength) >- return std::nullopt; >+ return WTF::nullopt; > > bool lastCharacterWasBackslash = false; > char currentCharacter; > while ((currentCharacter = input[quotedStringEnd++]) != '"' || lastCharacterWasBackslash) { > if (quotedStringEnd >= inputLength) >- return std::nullopt; >+ return WTF::nullopt; > if (currentCharacter == '\\' && !lastCharacterWasBackslash) { > lastCharacterWasBackslash = true; > continue; >@@ -205,7 +205,7 @@ bool parseContentType(const String& contentType, ReceiverType& receiver) > > // Should we tolerate spaces here? > String value; >- std::optional<SubstringRange> valueRange; >+ Optional<SubstringRange> valueRange; > if (contentType[index] == '"') > valueRange = parseQuotedString(contentType, index); > else >diff --git a/Source/WebCore/platform/network/ResourceHandle.cpp b/Source/WebCore/platform/network/ResourceHandle.cpp >index d2ea9a107de679ac2a65ab56ec00384c113a6e49..e1cba34bedcb3a92828b4802fd3bd50f6aadf5a8 100644 >--- a/Source/WebCore/platform/network/ResourceHandle.cpp >+++ b/Source/WebCore/platform/network/ResourceHandle.cpp >@@ -155,7 +155,7 @@ void ResourceHandle::didReceiveResponse(ResourceResponse&& response, CompletionH > { > if (response.isHTTP09()) { > auto url = response.url(); >- std::optional<uint16_t> port = url.port(); >+ Optional<uint16_t> port = url.port(); > if (port && !WTF::isDefaultPortForProtocol(port.value(), url.protocol())) { > cancel(); > String message = "Cancelled load from '" + url.stringCenterEllipsizedToLength() + "' because it is using HTTP/0.9."; >diff --git a/Source/WebCore/platform/network/ResourceHandle.h b/Source/WebCore/platform/network/ResourceHandle.h >index b59ab21aa0a547f5d57c4b0288eb8b723689cfbd..9e25d9e2b4496ed16c9a93d2bb87252f19be4ad0 100644 >--- a/Source/WebCore/platform/network/ResourceHandle.h >+++ b/Source/WebCore/platform/network/ResourceHandle.h >@@ -262,7 +262,7 @@ private: > > bool shouldRedirectAsGET(const ResourceRequest&, bool crossOrigin); > >- std::optional<Credential> getCredential(const ResourceRequest&, bool); >+ Optional<Credential> getCredential(const ResourceRequest&, bool); > void restartRequestWithCredential(const ProtectionSpace&, const Credential&); > > void handleDataURL(); >diff --git a/Source/WebCore/platform/network/ResourceRequestBase.h b/Source/WebCore/platform/network/ResourceRequestBase.h >index 30d4b1062dd0388845e847c9cd69ac44d297166a..eb507271ea15c66b2d1e9c9b2d3c39048d84f832 100644 >--- a/Source/WebCore/platform/network/ResourceRequestBase.h >+++ b/Source/WebCore/platform/network/ResourceRequestBase.h >@@ -173,7 +173,7 @@ public: > void setInitiatorIdentifier(const String& identifier) { m_initiatorIdentifier = identifier; } > > // Additional information for the Inspector to be able to identify the node that initiated this request. >- const std::optional<int>& inspectorInitiatorNodeIdentifier() const { return m_inspectorInitiatorNodeIdentifier; } >+ const Optional<int>& inspectorInitiatorNodeIdentifier() const { return m_inspectorInitiatorNodeIdentifier; } > void setInspectorInitiatorNodeIdentifier(int inspectorInitiatorNodeIdentifier) { m_inspectorInitiatorNodeIdentifier = inspectorInitiatorNodeIdentifier; } > > #if USE(SYSTEM_PREVIEW) >@@ -236,7 +236,7 @@ protected: > SameSiteDisposition m_sameSiteDisposition { SameSiteDisposition::Unspecified }; > ResourceLoadPriority m_priority { ResourceLoadPriority::Low }; > Requester m_requester { Requester::Unspecified }; >- std::optional<int> m_inspectorInitiatorNodeIdentifier; >+ Optional<int> m_inspectorInitiatorNodeIdentifier; > bool m_allowCookies { false }; > mutable bool m_resourceRequestUpdated { false }; > mutable bool m_platformRequestUpdated { false }; >diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp >index f32de8c9217e7d6eb68859d891dd0461cdbe6aa6..108872f95a91e21cbf5aae8d3a8f72590a2a92e6 100644 >--- a/Source/WebCore/platform/network/ResourceResponseBase.cpp >+++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp >@@ -653,18 +653,18 @@ bool ResourceResponseBase::hasCacheValidatorFields() const > return !m_httpHeaderFields.get(HTTPHeaderName::LastModified).isEmpty() || !m_httpHeaderFields.get(HTTPHeaderName::ETag).isEmpty(); > } > >-std::optional<Seconds> ResourceResponseBase::cacheControlMaxAge() const >+Optional<Seconds> ResourceResponseBase::cacheControlMaxAge() const > { > if (!m_haveParsedCacheControlHeader) > parseCacheControlDirectives(); > return m_cacheControlDirectives.maxAge; > } > >-static std::optional<WallTime> parseDateValueInHeader(const HTTPHeaderMap& headers, HTTPHeaderName headerName) >+static Optional<WallTime> parseDateValueInHeader(const HTTPHeaderMap& headers, HTTPHeaderName headerName) > { > String headerValue = headers.get(headerName); > if (headerValue.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > // This handles all date formats required by RFC2616: > // Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 > // Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 >@@ -672,7 +672,7 @@ static std::optional<WallTime> parseDateValueInHeader(const HTTPHeaderMap& heade > return parseHTTPDate(headerValue); > } > >-std::optional<WallTime> ResourceResponseBase::date() const >+Optional<WallTime> ResourceResponseBase::date() const > { > lazyInit(CommonFieldsOnly); > >@@ -683,7 +683,7 @@ std::optional<WallTime> ResourceResponseBase::date() const > return m_date; > } > >-std::optional<Seconds> ResourceResponseBase::age() const >+Optional<Seconds> ResourceResponseBase::age() const > { > lazyInit(CommonFieldsOnly); > >@@ -698,7 +698,7 @@ std::optional<Seconds> ResourceResponseBase::age() const > return m_age; > } > >-std::optional<WallTime> ResourceResponseBase::expires() const >+Optional<WallTime> ResourceResponseBase::expires() const > { > lazyInit(CommonFieldsOnly); > >@@ -709,7 +709,7 @@ std::optional<WallTime> ResourceResponseBase::expires() const > return m_expires; > } > >-std::optional<WallTime> ResourceResponseBase::lastModified() const >+Optional<WallTime> ResourceResponseBase::lastModified() const > { > lazyInit(CommonFieldsOnly); > >@@ -720,7 +720,7 @@ std::optional<WallTime> ResourceResponseBase::lastModified() const > // an invalid value (rdar://problem/22352838). > const WallTime epoch = WallTime::fromRawSeconds(0); > if (m_lastModified && m_lastModified.value() == epoch) >- m_lastModified = std::nullopt; >+ m_lastModified = WTF::nullopt; > #endif > m_haveParsedLastModifiedHeader = true; > } >diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h >index 19c55068d799c36bbcea2816903043cee121db16..ce75e9c814bda0b7f46bafa2e59d2378f30a77bf 100644 >--- a/Source/WebCore/platform/network/ResourceResponseBase.h >+++ b/Source/WebCore/platform/network/ResourceResponseBase.h >@@ -127,7 +127,7 @@ public: > WEBCORE_EXPORT static String sanitizeSuggestedFilename(const String&); > > WEBCORE_EXPORT void includeCertificateInfo() const; >- const std::optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; }; >+ const Optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; }; > > // These functions return parsed values of the corresponding response headers. > WEBCORE_EXPORT bool cacheControlContainsNoCache() const; >@@ -135,11 +135,11 @@ public: > WEBCORE_EXPORT bool cacheControlContainsMustRevalidate() const; > WEBCORE_EXPORT bool cacheControlContainsImmutable() const; > WEBCORE_EXPORT bool hasCacheValidatorFields() const; >- WEBCORE_EXPORT std::optional<Seconds> cacheControlMaxAge() const; >- WEBCORE_EXPORT std::optional<WallTime> date() const; >- WEBCORE_EXPORT std::optional<Seconds> age() const; >- WEBCORE_EXPORT std::optional<WallTime> expires() const; >- WEBCORE_EXPORT std::optional<WallTime> lastModified() const; >+ WEBCORE_EXPORT Optional<Seconds> cacheControlMaxAge() const; >+ WEBCORE_EXPORT Optional<WallTime> date() const; >+ WEBCORE_EXPORT Optional<Seconds> age() const; >+ WEBCORE_EXPORT Optional<WallTime> expires() const; >+ WEBCORE_EXPORT Optional<WallTime> lastModified() const; > const ParsedContentRange& contentRange() const; > > enum class Source : uint8_t { Unknown, Network, DiskCache, DiskCacheAfterValidation, MemoryCache, MemoryCacheAfterValidation, ServiceWorker, ApplicationCache }; >@@ -214,7 +214,7 @@ protected: > HTTPHeaderMap m_httpHeaderFields; > mutable NetworkLoadMetrics m_networkLoadMetrics; > >- mutable std::optional<CertificateInfo> m_certificateInfo; >+ mutable Optional<CertificateInfo> m_certificateInfo; > > private: > mutable Markable<Seconds, Seconds::MarkableTraits> m_age; >diff --git a/Source/WebCore/platform/network/SocketStreamHandle.cpp b/Source/WebCore/platform/network/SocketStreamHandle.cpp >index 270f6134b9d6e9fa47154907dab233df265e95bb..35bee3652f4861788ffdc5f279ba6550ce7ca7eb 100644 >--- a/Source/WebCore/platform/network/SocketStreamHandle.cpp >+++ b/Source/WebCore/platform/network/SocketStreamHandle.cpp >@@ -56,7 +56,7 @@ void SocketStreamHandle::sendData(const char* data, size_t length, Function<void > platformSend(reinterpret_cast<const uint8_t*>(data), length, WTFMove(completionHandler)); > } > >-void SocketStreamHandle::sendHandshake(CString&& handshake, std::optional<CookieRequestHeaderFieldProxy>&& headerFieldProxy, Function<void(bool, bool)> completionHandler) >+void SocketStreamHandle::sendHandshake(CString&& handshake, Optional<CookieRequestHeaderFieldProxy>&& headerFieldProxy, Function<void(bool, bool)> completionHandler) > { > if (m_state == Connecting || m_state == Closing) > return completionHandler(false, false); >diff --git a/Source/WebCore/platform/network/SocketStreamHandle.h b/Source/WebCore/platform/network/SocketStreamHandle.h >index 6d1fd1a8309939894b49ea84b77a59f117d8a021..1569bda3febf847e9c676cd017afe5de3defbe27 100644 >--- a/Source/WebCore/platform/network/SocketStreamHandle.h >+++ b/Source/WebCore/platform/network/SocketStreamHandle.h >@@ -54,7 +54,7 @@ public: > SocketStreamState state() const; > > void sendData(const char* data, size_t length, Function<void(bool)>); >- void sendHandshake(CString&& handshake, std::optional<CookieRequestHeaderFieldProxy>&&, Function<void(bool, bool)>); >+ void sendHandshake(CString&& handshake, Optional<CookieRequestHeaderFieldProxy>&&, Function<void(bool, bool)>); > void close(); // Disconnect after all data in buffer are sent. > void disconnect(); > virtual size_t bufferedAmount() = 0; >@@ -63,7 +63,7 @@ protected: > WEBCORE_EXPORT SocketStreamHandle(const URL&, SocketStreamHandleClient&); > > virtual void platformSend(const uint8_t* data, size_t length, Function<void(bool)>&&) = 0; >- virtual void platformSendHandshake(const uint8_t* data, size_t length, const std::optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) = 0; >+ virtual void platformSendHandshake(const uint8_t* data, size_t length, const Optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) = 0; > virtual void platformClose() = 0; > > URL m_url; >diff --git a/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp b/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp >index 389b6ea0366a69afc65ca30f18571ddf440ae4d3..a4a604c9c567d953d6040d71f1dd47f4aaef0781 100644 >--- a/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp >+++ b/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp >@@ -76,11 +76,11 @@ static size_t removeTerminationCharacters(const uint8_t* data, size_t dataLength > return dataLength - 2; > } > >-static std::optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(const CookieRequestHeaderFieldProxy& headerFieldProxy) >+static Optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(const CookieRequestHeaderFieldProxy& headerFieldProxy) > { > auto networkStorageSession = NetworkStorageSession::storageSession(headerFieldProxy.sessionID); > if (!networkStorageSession) >- return std::nullopt; >+ return WTF::nullopt; > > String cookieDataString; > bool secureCookiesAccessed = false; >@@ -97,7 +97,7 @@ static std::optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(co > return std::pair<Vector<uint8_t>, bool> { data, secureCookiesAccessed }; > } > >-void SocketStreamHandleImpl::platformSendHandshake(const uint8_t* data, size_t length, const std::optional<CookieRequestHeaderFieldProxy>& headerFieldProxy, Function<void(bool, bool)>&& completionHandler) >+void SocketStreamHandleImpl::platformSendHandshake(const uint8_t* data, size_t length, const Optional<CookieRequestHeaderFieldProxy>& headerFieldProxy, Function<void(bool, bool)>&& completionHandler) > { > Vector<uint8_t> cookieData; > bool secureCookiesAccessed = false; >diff --git a/Source/WebCore/platform/network/cf/CertificateInfo.h b/Source/WebCore/platform/network/cf/CertificateInfo.h >index 3a711834dd6a4578ae256051ada96ccb41af1057..f9311130793c13485acc657c40d6af5199b049f8 100644 >--- a/Source/WebCore/platform/network/cf/CertificateInfo.h >+++ b/Source/WebCore/platform/network/cf/CertificateInfo.h >@@ -74,7 +74,7 @@ public: > WEBCORE_EXPORT Type type() const; > WEBCORE_EXPORT bool containsNonRootSHA1SignedCertificate() const; > >- std::optional<SummaryInfo> summaryInfo() const; >+ Optional<SummaryInfo> summaryInfo() const; > > bool isEmpty() const { return type() == Type::None; } > >diff --git a/Source/WebCore/platform/network/cf/CertificateInfoCFNet.cpp b/Source/WebCore/platform/network/cf/CertificateInfoCFNet.cpp >index 448def8ca28bfb0cd64bb60facf73d8015585df7..8cc7a37c6e65569c060d7f74af08de0122952357 100644 >--- a/Source/WebCore/platform/network/cf/CertificateInfoCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/CertificateInfoCFNet.cpp >@@ -93,11 +93,11 @@ bool CertificateInfo::containsNonRootSHA1SignedCertificate() const > return false; > } > >-std::optional<CertificateInfo::SummaryInfo> CertificateInfo::summaryInfo() const >+Optional<CertificateInfo::SummaryInfo> CertificateInfo::summaryInfo() const > { > auto chain = certificateChain(); > if (!chain) >- return std::nullopt; >+ return WTF::nullopt; > > SummaryInfo summaryInfo; > >diff --git a/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp b/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >index 5226f855b6bfa6c5eb93e9289a923d0ed2c782d5..909aa4fe57026900fef51a667a25fb3327100c7e 100644 >--- a/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >@@ -365,7 +365,7 @@ static CFArrayRef createCookies(CFDictionaryRef headerFields, CFURLRef url) > return parsedCookies; > } > >-void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& value) const >+void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& value) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -401,7 +401,7 @@ static bool containsSecureCookies(CFArrayRef cookies) > return false; > } > >-std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -416,7 +416,7 @@ std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstPar > return { cookieString, didAccessSecureCookies }; > } > >-std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -440,7 +440,7 @@ bool NetworkStorageSession::cookiesEnabled() const > return policy == CFHTTPCookieStorageAcceptPolicyOnlyFromMainDocumentDomain || policy == CFHTTPCookieStorageAcceptPolicyExclusivelyFromMainDocumentDomain || policy == CFHTTPCookieStorageAcceptPolicyAlways; > } > >-bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const >+bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >diff --git a/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h b/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h >index c5f9c760cca7eecda253780a9ab5c227cffee8c8..94fe06f7a00b468df33b8a960854dd65d40bf85d 100644 >--- a/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h >+++ b/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h >@@ -51,11 +51,11 @@ public: > virtual ~SocketStreamHandleImpl(); > > WEBCORE_EXPORT void platformSend(const uint8_t* data, size_t length, Function<void(bool)>&&) final; >- WEBCORE_EXPORT void platformSendHandshake(const uint8_t* data, size_t length, const std::optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final; >+ WEBCORE_EXPORT void platformSendHandshake(const uint8_t* data, size_t length, const Optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final; > WEBCORE_EXPORT void platformClose() final; > private: > size_t bufferedAmount() final; >- std::optional<size_t> platformSendInternal(const uint8_t*, size_t); >+ Optional<size_t> platformSendInternal(const uint8_t*, size_t); > bool sendPendingData(); > > WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, SourceApplicationAuditToken&&); >diff --git a/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp b/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp >index ca73b70236455b17f30f3f1835923e6c4c1f7944..85ff3ebefff07654b186dccb4479b8caa209ebae 100644 >--- a/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp >@@ -693,7 +693,7 @@ SocketStreamHandleImpl::~SocketStreamHandleImpl() > ASSERT(!m_pacRunLoopSource); > } > >-std::optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t* data, size_t length) >+Optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t* data, size_t length) > { > if (!m_writeStream) > return 0; >@@ -703,7 +703,7 @@ std::optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t > > CFIndex result = CFWriteStreamWrite(m_writeStream.get(), reinterpret_cast<const UInt8*>(data), length); > if (result == -1) >- return std::nullopt; >+ return WTF::nullopt; > > ASSERT(result >= 0); > return static_cast<size_t>(result); >diff --git a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm >index c0900aeb5d16f433e4e715a90d3061dc4f55d085..b579973279c6184d322e7bcc910b65ad9dc3398e 100644 >--- a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm >+++ b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm >@@ -199,10 +199,10 @@ static RetainPtr<NSDictionary> policyProperties(const SameSiteInfo& sameSiteInfo > } > #endif > >-static NSArray *cookiesForURL(NSHTTPCookieStorage *storage, NSURL *url, NSURL *mainDocumentURL, const std::optional<SameSiteInfo>& sameSiteInfo, NSString *partition = nullptr) >+static NSArray *cookiesForURL(NSHTTPCookieStorage *storage, NSURL *url, NSURL *mainDocumentURL, const Optional<SameSiteInfo>& sameSiteInfo, NSString *partition = nullptr) > { >- // The _getCookiesForURL: method calls the completionHandler synchronously. We use std::optional<> to ensure this invariant. >- std::optional<RetainPtr<NSArray *>> cookiesPtr; >+ // The _getCookiesForURL: method calls the completionHandler synchronously. We use Optional<> to ensure this invariant. >+ Optional<RetainPtr<NSArray *>> cookiesPtr; > auto completionHandler = [&cookiesPtr] (NSArray *cookies) { > cookiesPtr = retainPtr(cookies); > }; >@@ -248,7 +248,7 @@ static void setHTTPCookiesForURL(CFHTTPCookieStorageRef cookieStorage, NSArray * > #endif > } > >-static NSArray *httpCookiesForURL(CFHTTPCookieStorageRef cookieStorage, NSURL *firstParty, const std::optional<SameSiteInfo>& sameSiteInfo, NSURL *url) >+static NSArray *httpCookiesForURL(CFHTTPCookieStorageRef cookieStorage, NSURL *firstParty, const Optional<SameSiteInfo>& sameSiteInfo, NSURL *url) > { > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); > if (!cookieStorage) >@@ -260,7 +260,7 @@ static NSArray *httpCookiesForURL(CFHTTPCookieStorageRef cookieStorage, NSURL *f > return cookiesForURL(nsCookieStorage.get(), url, firstParty, sameSiteInfo); > } > >-static RetainPtr<NSArray> filterCookies(NSArray *unfilteredCookies, std::optional<Seconds> cappedLifetime) >+static RetainPtr<NSArray> filterCookies(NSArray *unfilteredCookies, Optional<Seconds> cappedLifetime) > { > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); > NSUInteger count = [unfilteredCookies count]; >@@ -295,7 +295,7 @@ static RetainPtr<NSArray> filterCookies(NSArray *unfilteredCookies, std::optiona > return filteredCookies; > } > >-static NSArray *cookiesForURL(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) >+static NSArray *cookiesForURL(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID) > { > #if ENABLE(RESOURCE_LOAD_STATISTICS) > if (session.shouldBlockCookies(firstParty, url, frameID, pageID)) >@@ -308,7 +308,7 @@ static NSArray *cookiesForURL(const NetworkStorageSession& session, const URL& f > } > > enum IncludeHTTPOnlyOrNot { DoNotIncludeHTTPOnly, IncludeHTTPOnly }; >-static std::pair<String, bool> cookiesForSession(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeHTTPOnlyOrNot includeHTTPOnly, IncludeSecureCookies includeSecureCookies) >+static std::pair<String, bool> cookiesForSession(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeHTTPOnlyOrNot includeHTTPOnly, IncludeSecureCookies includeSecureCookies) > { > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); > >@@ -364,12 +364,12 @@ static void deleteAllHTTPCookies(CFHTTPCookieStorageRef cookieStorage) > CFHTTPCookieStorageDeleteAllCookies(cookieStorage); > } > >-std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > return cookiesForSession(*this, firstParty, sameSiteInfo, url, frameID, pageID, DoNotIncludeHTTPOnly, includeSecureCookies); > } > >-std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > return cookiesForSession(*this, firstParty, sameSiteInfo, url, frameID, pageID, IncludeHTTPOnly, includeSecureCookies); > } >@@ -379,7 +379,7 @@ std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(con > return cookiesForSession(*this, headerFieldProxy.firstParty, headerFieldProxy.sameSiteInfo, headerFieldProxy.url, headerFieldProxy.frameID, headerFieldProxy.pageID, IncludeHTTPOnly, headerFieldProxy.includeSecureCookies); > } > >-void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& cookieStr) const >+void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& cookieStr) const > { > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); > >@@ -444,7 +444,7 @@ bool NetworkStorageSession::cookiesEnabled() const > return false; > } > >-bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const >+bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const > { > rawCookies.clear(); > BEGIN_BLOCK_OBJC_EXCEPTIONS; >@@ -468,7 +468,7 @@ void NetworkStorageSession::deleteCookie(const URL& url, const String& cookieNam > BEGIN_BLOCK_OBJC_EXCEPTIONS; > > RetainPtr<CFHTTPCookieStorageRef> cookieStorage = this->cookieStorage(); >- NSArray *cookies = httpCookiesForURL(cookieStorage.get(), nil, std::nullopt, url); >+ NSArray *cookies = httpCookiesForURL(cookieStorage.get(), nil, WTF::nullopt, url); > > NSString *cookieNameString = cookieName; > >diff --git a/Source/WebCore/platform/network/curl/AuthenticationChallenge.h b/Source/WebCore/platform/network/curl/AuthenticationChallenge.h >index 54de3d6b29dc2b1315c8f9bf044271f7d3273b67..0c1c031ca8c941bc94d42fb3572374b6df876e07 100644 >--- a/Source/WebCore/platform/network/curl/AuthenticationChallenge.h >+++ b/Source/WebCore/platform/network/curl/AuthenticationChallenge.h >@@ -50,7 +50,7 @@ public: > private: > ProtectionSpaceServerType protectionSpaceServerTypeFromURI(const URL&, bool isForProxy); > ProtectionSpace protectionSpaceFromHandle(const CurlResponse&, const ResourceResponse&); >- std::optional<uint16_t> determineProxyPort(const URL&); >+ Optional<uint16_t> determineProxyPort(const URL&); > ProtectionSpaceAuthenticationScheme authenticationSchemeFromCurlAuth(long); > String parseRealm(const ResourceResponse&); > void removeLeadingAndTrailingQuotes(String&); >diff --git a/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp b/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp >index eb99b9787b3bd2dfae327229248d0214c7e1850c..2fdccdb3d578ef254b10a7e8b0ec28174a8ca3e9 100644 >--- a/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp >+++ b/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp >@@ -65,7 +65,7 @@ ProtectionSpace AuthenticationChallenge::protectionSpaceFromHandle(const CurlRes > return ProtectionSpace(url.host().toString(), static_cast<int>(port ? *port : 0), serverType, parseRealm(response), authenticationScheme); > } > >-std::optional<uint16_t> AuthenticationChallenge::determineProxyPort(const URL& url) >+Optional<uint16_t> AuthenticationChallenge::determineProxyPort(const URL& url) > { > static const uint16_t socksPort = 1080; > >@@ -78,7 +78,7 @@ std::optional<uint16_t> AuthenticationChallenge::determineProxyPort(const URL& u > if (protocolIsInSocksFamily(url)) > return socksPort; > >- return std::nullopt; >+ return WTF::nullopt; > } > > ProtectionSpaceAuthenticationScheme AuthenticationChallenge::authenticationSchemeFromCurlAuth(long curlAuth) >diff --git a/Source/WebCore/platform/network/curl/CertificateInfo.h b/Source/WebCore/platform/network/curl/CertificateInfo.h >index eed863b8118b68ea992371ed5b86be92737ea6ca..e57f3bd0a48908e53fe58c9ae4d4af5601fa0e00 100644 >--- a/Source/WebCore/platform/network/curl/CertificateInfo.h >+++ b/Source/WebCore/platform/network/curl/CertificateInfo.h >@@ -49,7 +49,7 @@ public: > > bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; } > >- std::optional<SummaryInfo> summaryInfo() const { notImplemented(); return std::nullopt; } >+ Optional<SummaryInfo> summaryInfo() const { notImplemented(); return WTF::nullopt; } > > bool isEmpty() const { return m_certificateChain.isEmpty(); } > >diff --git a/Source/WebCore/platform/network/curl/CookieJarCurl.cpp b/Source/WebCore/platform/network/curl/CookieJarCurl.cpp >index ef606b65603fcdb91937da2162a436dbe6d48b9e..f9b45e8b506e765941214f59a937579ba910dbe0 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarCurl.cpp >+++ b/Source/WebCore/platform/network/curl/CookieJarCurl.cpp >@@ -44,10 +44,10 @@ static String cookiesForSession(const NetworkStorageSession& session, const URL& > StringBuilder cookies; > > CookieJarDB& cookieJarDB = session.cookieDatabase(); >- auto searchHTTPOnly = (forHTTPHeader ? std::nullopt : std::optional<bool> {false}); >- auto secure = url.protocolIs("https") ? std::nullopt : std::optional<bool> {false}; >+ auto searchHTTPOnly = (forHTTPHeader ? WTF::nullopt : Optional<bool> {false}); >+ auto secure = url.protocolIs("https") ? WTF::nullopt : Optional<bool> {false}; > >- if (auto result = cookieJarDB.searchCookies(url.string(), searchHTTPOnly, secure, std::nullopt)) { >+ if (auto result = cookieJarDB.searchCookies(url.string(), searchHTTPOnly, secure, WTF::nullopt)) { > for (auto& cookie : *result) { > if (!cookies.isEmpty()) > cookies.append("; "); >@@ -59,7 +59,7 @@ static String cookiesForSession(const NetworkStorageSession& session, const URL& > return cookies.toString(); > } > >-void CookieJarCurl::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& value) const >+void CookieJarCurl::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& value) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -75,7 +75,7 @@ void CookieJarCurl::setCookiesFromHTTPResponse(const NetworkStorageSession& sess > cookieJarDB.setCookie(url.string(), value, CookieJarDB::Source::Network); > } > >-std::pair<String, bool> CookieJarCurl::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const >+std::pair<String, bool> CookieJarCurl::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -84,7 +84,7 @@ std::pair<String, bool> CookieJarCurl::cookiesForDOM(const NetworkStorageSession > return { cookiesForSession(session, firstParty, url, false), false }; > } > >-std::pair<String, bool> CookieJarCurl::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const >+std::pair<String, bool> CookieJarCurl::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -103,13 +103,13 @@ bool CookieJarCurl::cookiesEnabled(const NetworkStorageSession& session) const > return session.cookieDatabase().isEnabled(); > } > >-bool CookieJarCurl::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const >+bool CookieJarCurl::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); > > CookieJarDB& cookieJarDB = session.cookieDatabase(); >- if (auto cookies = cookieJarDB.searchCookies(firstParty.string(), std::nullopt, std::nullopt, std::nullopt)) { >+ if (auto cookies = cookieJarDB.searchCookies(firstParty.string(), WTF::nullopt, WTF::nullopt, WTF::nullopt)) { > rawCookies = WTFMove(*cookies); > return true; > } >diff --git a/Source/WebCore/platform/network/curl/CookieJarCurl.h b/Source/WebCore/platform/network/curl/CookieJarCurl.h >index 9f69bd409789a7677feb02fa94798e2ae26676e6..f1a4c789579d01e3b01376ae94d04d0cdc448dc6 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarCurl.h >+++ b/Source/WebCore/platform/network/curl/CookieJarCurl.h >@@ -40,13 +40,13 @@ struct SameSiteInfo; > > class CookieJarCurl { > public: >- std::pair<String, bool> cookiesForDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const; >- void setCookiesFromDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) const; >+ std::pair<String, bool> cookiesForDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const; >+ void setCookiesFromDOM(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String&) const; > void setCookiesFromHTTPResponse(const NetworkStorageSession&, const URL&, const String&) const; > bool cookiesEnabled(const NetworkStorageSession&) const; >- std::pair<String, bool> cookieRequestHeaderFieldValue(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const; > std::pair<String, bool> cookieRequestHeaderFieldValue(const NetworkStorageSession&, const CookieRequestHeaderFieldProxy&) const; >- bool getRawCookies(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>&) const; >+ bool getRawCookies(const NetworkStorageSession&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>&) const; > void deleteCookie(const NetworkStorageSession&, const URL&, const String&) const; > void getHostnamesWithCookies(const NetworkStorageSession&, HashSet<String>& hostnames) const; > void deleteCookiesForHostnames(const NetworkStorageSession&, const Vector<String>& cookieHostNames) const; >diff --git a/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp b/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp >index c2d051e3793f5a8e868a4e79dfe1646567517aff..68563cd91f21902e8b1d5b787a88d1a123092b12 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp >+++ b/Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp >@@ -44,11 +44,11 @@ static String cookiesForSession(const NetworkStorageSession& session, const URL& > StringBuilder cookies; > > CookieJarDB& cookieJarDB = session.cookieDatabase(); >- auto searchHTTPOnly = (forHTTPHeader ? std::nullopt : std::optional<bool> {false}); >- auto secure = url.protocolIs("https") ? std::nullopt : std::optional<bool> {false}; >+ auto searchHTTPOnly = (forHTTPHeader ? WTF::nullopt : Optional<bool> {false}); >+ auto secure = url.protocolIs("https") ? WTF::nullopt : Optional<bool> {false}; > > Vector<Cookie> results; >- if (cookieJarDB.searchCookies(url.string(), searchHTTPOnly, secure, std::nullopt, results)) { >+ if (cookieJarDB.searchCookies(url.string(), searchHTTPOnly, secure, WTF::nullopt, results)) { > for (auto result : results) { > if (!cookies.isEmpty()) > cookies.append("; "); >@@ -60,7 +60,7 @@ static String cookiesForSession(const NetworkStorageSession& session, const URL& > return cookies.toString(); > } > >-void CookieJarCurlDatabase::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& value) const >+void CookieJarCurlDatabase::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& value) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -76,7 +76,7 @@ void CookieJarCurlDatabase::setCookiesFromHTTPResponse(const NetworkStorageSessi > cookieJarDB.setCookie(url.string(), value, false); > } > >-std::pair<String, bool> CookieJarCurlDatabase::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const >+std::pair<String, bool> CookieJarCurlDatabase::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -85,7 +85,7 @@ std::pair<String, bool> CookieJarCurlDatabase::cookiesForDOM(const NetworkStorag > return { cookiesForSession(session, firstParty, url, false), false }; > } > >-std::pair<String, bool> CookieJarCurlDatabase::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies) const >+std::pair<String, bool> CookieJarCurlDatabase::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -104,13 +104,13 @@ bool CookieJarCurlDatabase::cookiesEnabled(const NetworkStorageSession& session) > return session.cookieDatabase().isEnabled(); > } > >-bool CookieJarCurlDatabase::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const >+bool CookieJarCurlDatabase::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); > > CookieJarDB& cookieJarDB = session.cookieDatabase(); >- return cookieJarDB.searchCookies(firstParty.string(), std::nullopt, std::nullopt, std::nullopt, rawCookies); >+ return cookieJarDB.searchCookies(firstParty.string(), WTF::nullopt, WTF::nullopt, WTF::nullopt, rawCookies); > } > > void CookieJarCurlDatabase::deleteCookie(const NetworkStorageSession& session, const URL& url, const String& name) const >diff --git a/Source/WebCore/platform/network/curl/CookieJarDB.cpp b/Source/WebCore/platform/network/curl/CookieJarDB.cpp >index 12921c7f53b6f7e0a479a5b99f979efb7c2674d5..c23fd72f1917102082e121e44d58edd8a32d1e71 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarDB.cpp >+++ b/Source/WebCore/platform/network/curl/CookieJarDB.cpp >@@ -312,17 +312,17 @@ bool CookieJarDB::isEnabled() const > return m_isEnabled; > } > >-std::optional<Vector<Cookie>> CookieJarDB::searchCookies(const String& requestUrl, const std::optional<bool>& httpOnly, const std::optional<bool>& secure, const std::optional<bool>& session) >+Optional<Vector<Cookie>> CookieJarDB::searchCookies(const String& requestUrl, const Optional<bool>& httpOnly, const Optional<bool>& secure, const Optional<bool>& session) > { > if (!isEnabled() || !m_database.isOpen()) >- return std::nullopt; >+ return WTF::nullopt; > > URL requestUrlObj({ }, requestUrl); > String requestHost(requestUrlObj.host().toString().convertToASCIILowercase()); > String requestPath(requestUrlObj.path().convertToASCIILowercase()); > > if (requestHost.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > if (requestPath.isEmpty()) > requestPath = "/"; >@@ -338,7 +338,7 @@ std::optional<Vector<Cookie>> CookieJarDB::searchCookies(const String& requestUr > > auto pstmt = std::make_unique<SQLiteStatement>(m_database, sql); > if (!pstmt) >- return std::nullopt; >+ return WTF::nullopt; > > pstmt->prepare(); > pstmt->bindInt(1, httpOnly ? *httpOnly : -1); >@@ -368,7 +368,7 @@ std::optional<Vector<Cookie>> CookieJarDB::searchCookies(const String& requestUr > } > > if (!pstmt) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<Cookie> results; > >diff --git a/Source/WebCore/platform/network/curl/CookieJarDB.h b/Source/WebCore/platform/network/curl/CookieJarDB.h >index 7759614500487632641df515fbeaaa7e5f9235f0..de58032e335ad89bb03893c30e0420a5665ee9e7 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarDB.h >+++ b/Source/WebCore/platform/network/curl/CookieJarDB.h >@@ -48,7 +48,7 @@ public: > bool isEnabled() const; > void setEnabled(bool); > >- std::optional<Vector<Cookie>> searchCookies(const String& requestUrl, const std::optional<bool>& httpOnly, const std::optional<bool>& secure, const std::optional<bool>& session); >+ Optional<Vector<Cookie>> searchCookies(const String& requestUrl, const Optional<bool>& httpOnly, const Optional<bool>& secure, const Optional<bool>& session); > bool setCookie(const String& url, const String& cookie, Source); > bool setCookie(const Cookie&); > >diff --git a/Source/WebCore/platform/network/curl/CookieUtil.cpp b/Source/WebCore/platform/network/curl/CookieUtil.cpp >index be5e79ae2d715eb6f6859a9a7de59fd7e4b7546d..1bdb84c61bbab2591a1708987d195d5cbe40cf9d 100644 >--- a/Source/WebCore/platform/network/curl/CookieUtil.cpp >+++ b/Source/WebCore/platform/network/curl/CookieUtil.cpp >@@ -79,13 +79,13 @@ bool domainMatch(const String& cookieDomain, const String& host) > return false; > } > >-static std::optional<double> parseExpires(const char* expires) >+static Optional<double> parseExpires(const char* expires) > { > double tmp = WTF::parseDateFromNullTerminatedCharacters(expires); > if (isnan(tmp)) > return { }; > >- return std::optional<double> {tmp / WTF::msPerSecond}; >+ return Optional<double> {tmp / WTF::msPerSecond}; > } > > static void parseCookieAttributes(const String& attribute, bool& hasMaxAge, Cookie& result) >@@ -137,10 +137,10 @@ static void parseCookieAttributes(const String& attribute, bool& hasMaxAge, Cook > } > } > >-std::optional<Cookie> parseCookieHeader(const String& cookieLine) >+Optional<Cookie> parseCookieHeader(const String& cookieLine) > { > if (cookieLine.length() >= MAX_COOKIE_LINE) >- return std::nullopt; >+ return WTF::nullopt; > > // This Algorithm is based on the algorithm defined in RFC 6265 5.2 https://tools.ietf.org/html/rfc6265#section-5.2/ > >diff --git a/Source/WebCore/platform/network/curl/CookieUtil.h b/Source/WebCore/platform/network/curl/CookieUtil.h >index 84d38df7e0bec734a8343209345cfe8d7f850edf..956c153a93bf301743b8eeadc11900017f5123ec 100644 >--- a/Source/WebCore/platform/network/curl/CookieUtil.h >+++ b/Source/WebCore/platform/network/curl/CookieUtil.h >@@ -34,7 +34,7 @@ struct Cookie; > > namespace CookieUtil { > >-std::optional<Cookie> parseCookieHeader(const String&); >+Optional<Cookie> parseCookieHeader(const String&); > > bool isIPAddress(const String&); > >diff --git a/Source/WebCore/platform/network/curl/CurlContext.cpp b/Source/WebCore/platform/network/curl/CurlContext.cpp >index f79ba8f86245eb74637a2c5a83c9658e05c1cbd8..0ce1100c860363dd67642b7b47671999e2e0aa5e 100644 >--- a/Source/WebCore/platform/network/curl/CurlContext.cpp >+++ b/Source/WebCore/platform/network/curl/CurlContext.cpp >@@ -52,7 +52,7 @@ public: > const char* read(const char* name) { return ::getenv(name); } > bool defined(const char* name) { return read(name) != nullptr; } > >- template<typename T> std::optional<T> readAs(const char* name) >+ template<typename T> Optional<T> readAs(const char* name) > { > if (const char* valueStr = read(name)) { > T value; >@@ -60,7 +60,7 @@ public: > return value; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > private: >@@ -639,95 +639,95 @@ void CurlHandle::enableConnectionOnly() > curl_easy_setopt(m_handle, CURLOPT_CONNECT_ONLY, 1L); > } > >-std::optional<String> CurlHandle::getProxyUrl() >+Optional<String> CurlHandle::getProxyUrl() > { > auto& proxy = CurlContext::singleton().proxySettings(); > if (proxy.mode() == CurlProxySettings::Mode::Default) >- return std::nullopt; >+ return WTF::nullopt; > > return proxy.url(); > } > >-std::optional<long> CurlHandle::getResponseCode() >+Optional<long> CurlHandle::getResponseCode() > { > if (!m_handle) >- return std::nullopt; >+ return WTF::nullopt; > > long responseCode; > CURLcode errorCode = curl_easy_getinfo(m_handle, CURLINFO_RESPONSE_CODE, &responseCode); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > return responseCode; > } > >-std::optional<long> CurlHandle::getHttpConnectCode() >+Optional<long> CurlHandle::getHttpConnectCode() > { > if (!m_handle) >- return std::nullopt; >+ return WTF::nullopt; > > long httpConnectCode; > CURLcode errorCode = curl_easy_getinfo(m_handle, CURLINFO_HTTP_CONNECTCODE, &httpConnectCode); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > return httpConnectCode; > } > >-std::optional<long long> CurlHandle::getContentLength() >+Optional<long long> CurlHandle::getContentLength() > { > if (!m_handle) >- return std::nullopt; >+ return WTF::nullopt; > > double contentLength; > > CURLcode errorCode = curl_easy_getinfo(m_handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &contentLength); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > return static_cast<long long>(contentLength); > } > >-std::optional<long> CurlHandle::getHttpAuthAvail() >+Optional<long> CurlHandle::getHttpAuthAvail() > { > if (!m_handle) >- return std::nullopt; >+ return WTF::nullopt; > > long httpAuthAvailable; > CURLcode errorCode = curl_easy_getinfo(m_handle, CURLINFO_HTTPAUTH_AVAIL, &httpAuthAvailable); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > return httpAuthAvailable; > } > >-std::optional<long> CurlHandle::getProxyAuthAvail() >+Optional<long> CurlHandle::getProxyAuthAvail() > { > if (!m_handle) >- return std::nullopt; >+ return WTF::nullopt; > > long proxyAuthAvailable; > CURLcode errorCode = curl_easy_getinfo(m_handle, CURLINFO_PROXYAUTH_AVAIL, &proxyAuthAvailable); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > return proxyAuthAvailable; > } > >-std::optional<long> CurlHandle::getHttpVersion() >+Optional<long> CurlHandle::getHttpVersion() > { > if (!m_handle) >- return std::nullopt; >+ return WTF::nullopt; > > long version; > CURLcode errorCode = curl_easy_getinfo(m_handle, CURLINFO_HTTP_VERSION, &version); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > return version; > } > >-std::optional<NetworkLoadMetrics> CurlHandle::getNetworkLoadMetrics(const WTF::Seconds& domainLookupStart) >+Optional<NetworkLoadMetrics> CurlHandle::getNetworkLoadMetrics(const WTF::Seconds& domainLookupStart) > { > double nameLookup = 0.0; > double connect = 0.0; >@@ -736,27 +736,27 @@ std::optional<NetworkLoadMetrics> CurlHandle::getNetworkLoadMetrics(const WTF::S > long version = 0; > > if (!m_handle) >- return std::nullopt; >+ return WTF::nullopt; > > CURLcode errorCode = curl_easy_getinfo(m_handle, CURLINFO_NAMELOOKUP_TIME, &nameLookup); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > errorCode = curl_easy_getinfo(m_handle, CURLINFO_CONNECT_TIME, &connect); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > errorCode = curl_easy_getinfo(m_handle, CURLINFO_APPCONNECT_TIME, &appConnect); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > errorCode = curl_easy_getinfo(m_handle, CURLINFO_STARTTRANSFER_TIME, &startTransfer); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > errorCode = curl_easy_getinfo(m_handle, CURLINFO_HTTP_VERSION, &version); > if (errorCode != CURLE_OK) >- return std::nullopt; >+ return WTF::nullopt; > > NetworkLoadMetrics networkLoadMetrics; > >@@ -829,10 +829,10 @@ void CurlHandle::addExtraNetworkLoadMetrics(NetworkLoadMetrics& networkLoadMetri > } > } > >-std::optional<CertificateInfo> CurlHandle::certificateInfo() const >+Optional<CertificateInfo> CurlHandle::certificateInfo() const > { > if (!m_sslVerifier) >- return std::nullopt; >+ return WTF::nullopt; > > return m_sslVerifier->certificateInfo(); > } >@@ -921,7 +921,7 @@ size_t CurlSocketHandle::send(const uint8_t* buffer, size_t size) > return totalBytesSent; > } > >-std::optional<size_t> CurlSocketHandle::receive(uint8_t* buffer, size_t bufferSize) >+Optional<size_t> CurlSocketHandle::receive(uint8_t* buffer, size_t bufferSize) > { > size_t bytesRead = 0; > >@@ -930,19 +930,19 @@ std::optional<size_t> CurlSocketHandle::receive(uint8_t* buffer, size_t bufferSi > if (errorCode != CURLE_AGAIN) > m_errorHandler(errorCode); > >- return std::nullopt; >+ return WTF::nullopt; > } > > return bytesRead; > } > >-std::optional<CurlSocketHandle::WaitResult> CurlSocketHandle::wait(const Seconds& timeout, bool alsoWaitForWrite) >+Optional<CurlSocketHandle::WaitResult> CurlSocketHandle::wait(const Seconds& timeout, bool alsoWaitForWrite) > { > curl_socket_t socket; > CURLcode errorCode = curl_easy_getinfo(handle(), CURLINFO_ACTIVESOCKET, &socket); > if (errorCode != CURLE_OK) { > m_errorHandler(errorCode); >- return std::nullopt; >+ return WTF::nullopt; > } > > int64_t usec = timeout.microsecondsAs<int64_t>(); >@@ -978,7 +978,7 @@ std::optional<CurlSocketHandle::WaitResult> CurlSocketHandle::wait(const Seconds > } while (rc == -1 && errno == EINTR); > > if (rc <= 0) >- return std::nullopt; >+ return WTF::nullopt; > > WaitResult result; > result.readable = FD_ISSET(socket, &fdread) || FD_ISSET(socket, &fderr); >diff --git a/Source/WebCore/platform/network/curl/CurlContext.h b/Source/WebCore/platform/network/curl/CurlContext.h >index e741038dc43cc2ae36e66eebc87f16659e48fdad..c79dec1fadf7a83d95ce368be67139aea015a2cf 100644 >--- a/Source/WebCore/platform/network/curl/CurlContext.h >+++ b/Source/WebCore/platform/network/curl/CurlContext.h >@@ -274,18 +274,18 @@ public: > void setSslCtxCallbackFunction(curl_ssl_ctx_callback, void*); > > // Status >- std::optional<String> getProxyUrl(); >- std::optional<long> getResponseCode(); >- std::optional<long> getHttpConnectCode(); >- std::optional<long long> getContentLength(); >- std::optional<long> getHttpAuthAvail(); >- std::optional<long> getProxyAuthAvail(); >- std::optional<long> getHttpVersion(); >- std::optional<NetworkLoadMetrics> getNetworkLoadMetrics(const WTF::Seconds& domainLookupStart); >+ Optional<String> getProxyUrl(); >+ Optional<long> getResponseCode(); >+ Optional<long> getHttpConnectCode(); >+ Optional<long long> getContentLength(); >+ Optional<long> getHttpAuthAvail(); >+ Optional<long> getProxyAuthAvail(); >+ Optional<long> getHttpVersion(); >+ Optional<NetworkLoadMetrics> getNetworkLoadMetrics(const WTF::Seconds& domainLookupStart); > void addExtraNetworkLoadMetrics(NetworkLoadMetrics&); > > int sslErrors() const; >- std::optional<CertificateInfo> certificateInfo() const; >+ Optional<CertificateInfo> certificateInfo() const; > > static long long maxCurlOffT(); > >@@ -322,8 +322,8 @@ public: > > bool connect(); > size_t send(const uint8_t*, size_t); >- std::optional<size_t> receive(uint8_t*, size_t); >- std::optional<WaitResult> wait(const Seconds& timeout, bool alsoWaitForWrite); >+ Optional<size_t> receive(uint8_t*, size_t); >+ Optional<WaitResult> wait(const Seconds& timeout, bool alsoWaitForWrite); > > private: > Function<void(CURLcode)> m_errorHandler; >diff --git a/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp b/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp >index 7ece8953b20b0957904248a4c9de2de9d62b57c3..a837d2ea61d1c78a6a47c2d5c6552edb10b1e0ef 100644 >--- a/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp >+++ b/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp >@@ -107,10 +107,10 @@ void CurlFormDataStream::computeContentLength() > m_totalSize += element.lengthInBytes(); > } > >-std::optional<size_t> CurlFormDataStream::read(char* buffer, size_t size) >+Optional<size_t> CurlFormDataStream::read(char* buffer, size_t size) > { > if (!m_formData) >- return std::nullopt; >+ return WTF::nullopt; > > const auto totalElementSize = m_formData->elements().size(); > if (m_elementPosition >= totalElementSize) >@@ -124,19 +124,19 @@ std::optional<size_t> CurlFormDataStream::read(char* buffer, size_t size) > size_t bufferSize = size - totalReadBytes; > char* bufferPosition = buffer + totalReadBytes; > >- std::optional<size_t> readBytes = switchOn(element.data, >+ Optional<size_t> readBytes = switchOn(element.data, > [&] (const Vector<char>& bytes) { > return readFromData(bytes, bufferPosition, bufferSize); > }, [&] (const FormDataElement::EncodedFileData& fileData) { > return readFromFile(fileData, bufferPosition, bufferSize); > }, [] (const FormDataElement::EncodedBlobData& blobData) { > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > ); > > if (!readBytes) >- return std::nullopt; >+ return WTF::nullopt; > > totalReadBytes += *readBytes; > } >@@ -146,7 +146,7 @@ std::optional<size_t> CurlFormDataStream::read(char* buffer, size_t size) > return totalReadBytes; > } > >-std::optional<size_t> CurlFormDataStream::readFromFile(const FormDataElement::EncodedFileData& fileData, char* buffer, size_t size) >+Optional<size_t> CurlFormDataStream::readFromFile(const FormDataElement::EncodedFileData& fileData, char* buffer, size_t size) > { > if (m_fileHandle == FileSystem::invalidPlatformFileHandle) > m_fileHandle = FileSystem::openFile(fileData.filename, FileSystem::FileOpenMode::Read); >@@ -154,7 +154,7 @@ std::optional<size_t> CurlFormDataStream::readFromFile(const FormDataElement::En > if (!FileSystem::isHandleValid(m_fileHandle)) { > LOG(Network, "Curl - Failed while trying to open %s for upload\n", fileData.filename.utf8().data()); > m_fileHandle = FileSystem::invalidPlatformFileHandle; >- return std::nullopt; >+ return WTF::nullopt; > } > > auto readBytes = FileSystem::readFromFile(m_fileHandle, buffer, size); >@@ -162,7 +162,7 @@ std::optional<size_t> CurlFormDataStream::readFromFile(const FormDataElement::En > LOG(Network, "Curl - Failed while trying to read %s for upload\n", fileData.filename.utf8().data()); > FileSystem::closeFile(m_fileHandle); > m_fileHandle = FileSystem::invalidPlatformFileHandle; >- return std::nullopt; >+ return WTF::nullopt; > } > > if (!readBytes) { >@@ -174,7 +174,7 @@ std::optional<size_t> CurlFormDataStream::readFromFile(const FormDataElement::En > return readBytes; > } > >-std::optional<size_t> CurlFormDataStream::readFromData(const Vector<char>& data, char* buffer, size_t size) >+Optional<size_t> CurlFormDataStream::readFromData(const Vector<char>& data, char* buffer, size_t size) > { > size_t elementSize = data.size() - m_dataOffset; > const char* elementBuffer = data.data() + m_dataOffset; >diff --git a/Source/WebCore/platform/network/curl/CurlFormDataStream.h b/Source/WebCore/platform/network/curl/CurlFormDataStream.h >index 6c7a00e15eca42eb2a480b69db36c7f60ee81a9d..c8ef333e0d8c0e028ecd8a46d826b90671a00e0c 100644 >--- a/Source/WebCore/platform/network/curl/CurlFormDataStream.h >+++ b/Source/WebCore/platform/network/curl/CurlFormDataStream.h >@@ -45,14 +45,14 @@ public: > bool shouldUseChunkTransfer(); > unsigned long long totalSize(); > >- std::optional<size_t> read(char*, size_t); >+ Optional<size_t> read(char*, size_t); > unsigned long long totalReadSize() { return m_totalReadSize; } > > private: > void computeContentLength(); > >- std::optional<size_t> readFromFile(const FormDataElement::EncodedFileData&, char*, size_t); >- std::optional<size_t> readFromData(const Vector<char>&, char*, size_t); >+ Optional<size_t> readFromFile(const FormDataElement::EncodedFileData&, char*, size_t); >+ Optional<size_t> readFromData(const Vector<char>&, char*, size_t); > > RefPtr<FormData> m_formData; > >diff --git a/Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp b/Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp >index 9948c55920c5bb936d925e8c95c2b7c8c1ce5583..a8bb8d81a7abd71743bd395dcc8663179fde2d55 100644 >--- a/Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp >+++ b/Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp >@@ -49,7 +49,7 @@ std::unique_ptr<CurlMultipartHandle> CurlMultipartHandle::createIfNeeded(CurlMul > return std::make_unique<CurlMultipartHandle>(client, *boundary); > } > >-std::optional<String> CurlMultipartHandle::extractBoundary(const CurlResponse& response) >+Optional<String> CurlMultipartHandle::extractBoundary(const CurlResponse& response) > { > for (auto header : response.headers) { > auto splitPosistion = header.find(":"); >@@ -72,16 +72,16 @@ std::optional<String> CurlMultipartHandle::extractBoundary(const CurlResponse& r > return String("--" + *boundary); > } > >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<String> CurlMultipartHandle::extractBoundaryFromContentType(const String& contentType) >+Optional<String> CurlMultipartHandle::extractBoundaryFromContentType(const String& contentType) > { > static const size_t length = strlen("boundary="); > > auto boundaryStart = contentType.findIgnoringASCIICase("boundary="); > if (boundaryStart == notFound) >- return std::nullopt; >+ return WTF::nullopt; > > boundaryStart += length; > size_t boundaryEnd = 0; >@@ -91,13 +91,13 @@ std::optional<String> CurlMultipartHandle::extractBoundaryFromContentType(const > ++boundaryStart; > boundaryEnd = contentType.find('"', boundaryStart); > if (boundaryEnd == notFound) >- return std::nullopt; >+ return WTF::nullopt; > } else if (contentType[boundaryStart] == '\'') { > // Boundary value starts with a ' quote. Search for the closing one. > ++boundaryStart; > boundaryEnd = contentType.find('\'', boundaryStart); > if (boundaryEnd == notFound) >- return std::nullopt; >+ return WTF::nullopt; > } else { > // Check for the end of the boundary. That can be a semicolon or a newline. > boundaryEnd = contentType.find(';', boundaryStart); >@@ -107,7 +107,7 @@ std::optional<String> CurlMultipartHandle::extractBoundaryFromContentType(const > > // The boundary end should not be before the start > if (boundaryEnd <= boundaryStart) >- return std::nullopt; >+ return WTF::nullopt; > > return contentType.substring(boundaryStart, boundaryEnd - boundaryStart); > } >diff --git a/Source/WebCore/platform/network/curl/CurlMultipartHandle.h b/Source/WebCore/platform/network/curl/CurlMultipartHandle.h >index e5268683521bf752e6307c3d808b14fd3e47c449..804c7446c453b6715f885e9afc2738858e26871a 100644 >--- a/Source/WebCore/platform/network/curl/CurlMultipartHandle.h >+++ b/Source/WebCore/platform/network/curl/CurlMultipartHandle.h >@@ -56,8 +56,8 @@ private: > End > }; > >- static std::optional<String> extractBoundary(const CurlResponse&); >- static std::optional<String> extractBoundaryFromContentType(const String&); >+ static Optional<String> extractBoundary(const CurlResponse&); >+ static Optional<String> extractBoundaryFromContentType(const String&); > > bool processContent(); > bool checkForBoundary(size_t& boundaryStartPosition, size_t& lastPartialMatchPosition); >diff --git a/Source/WebCore/platform/network/curl/CurlProxySettings.cpp b/Source/WebCore/platform/network/curl/CurlProxySettings.cpp >index 4caf0ad34a67c6f2e5ccdcbc924ebbb33eb3ce4f..0c2d3f04430651b331952b6d019fe56d1c6b0454 100644 >--- a/Source/WebCore/platform/network/curl/CurlProxySettings.cpp >+++ b/Source/WebCore/platform/network/curl/CurlProxySettings.cpp >@@ -38,8 +38,8 @@ namespace WebCore { > > static const uint16_t SocksProxyPort = 1080; > >-static std::optional<uint16_t> getProxyPort(const URL&); >-static std::optional<String> createProxyUrl(const URL&); >+static Optional<uint16_t> getProxyPort(const URL&); >+static Optional<String> createProxyUrl(const URL&); > > CurlProxySettings::CurlProxySettings(URL&& proxyUrl, String&& ignoreHosts) > : m_mode(Mode::Custom) >@@ -89,7 +89,7 @@ bool protocolIsInSocksFamily(const URL& url) > return url.protocolIs("socks4") || url.protocolIs("socks4a") || url.protocolIs("socks5") || url.protocolIs("socks5h"); > } > >-static std::optional<uint16_t> getProxyPort(const URL& url) >+static Optional<uint16_t> getProxyPort(const URL& url) > { > auto port = url.port(); > if (port) >@@ -103,20 +103,20 @@ static std::optional<uint16_t> getProxyPort(const URL& url) > if (protocolIsInSocksFamily(url)) > return SocksProxyPort; > >- return std::nullopt; >+ return WTF::nullopt; > } > >-static std::optional<String> createProxyUrl(const URL &url) >+static Optional<String> createProxyUrl(const URL &url) > { > if (url.isEmpty() || url.host().isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > if (!url.protocolIsInHTTPFamily() && !protocolIsInSocksFamily(url)) >- return std::nullopt; >+ return WTF::nullopt; > > auto port = getProxyPort(url); > if (!port) >- return std::nullopt; >+ return WTF::nullopt; > > auto userpass = (url.hasUsername() || url.hasPassword()) ? makeString(url.user(), ":", url.pass(), "@") : String(); > return makeString(url.protocol(), "://", userpass, url.host(), ":", String::number(*port)); >diff --git a/Source/WebCore/platform/network/curl/CurlSSLHandle.cpp b/Source/WebCore/platform/network/curl/CurlSSLHandle.cpp >index 2dd6192cf6775abe13dd75659452bf5c0526b22c..2cf9c8771ddd8f52b2e0029c4f93a7da11e3fd05 100644 >--- a/Source/WebCore/platform/network/curl/CurlSSLHandle.cpp >+++ b/Source/WebCore/platform/network/curl/CurlSSLHandle.cpp >@@ -82,13 +82,13 @@ void CurlSSLHandle::setClientCertificateInfo(const String& hostName, const Strin > m_allowedClientHosts.set(hostName, ClientCertificate { certificate, key }); > } > >-std::optional<CurlSSLHandle::ClientCertificate> CurlSSLHandle::getSSLClientCertificate(const String& hostName) const >+Optional<CurlSSLHandle::ClientCertificate> CurlSSLHandle::getSSLClientCertificate(const String& hostName) const > { > LockHolder mutex(m_allowedClientHostsLock); > > auto it = m_allowedClientHosts.find(hostName); > if (it == m_allowedClientHosts.end()) >- return std::nullopt; >+ return WTF::nullopt; > > return it->value; > } >diff --git a/Source/WebCore/platform/network/curl/CurlSSLHandle.h b/Source/WebCore/platform/network/curl/CurlSSLHandle.h >index e0768a12e728d3270aef421fe07307dfc602c471..2269d95baca87ab5f138ddb657bedb6b46f7c599 100644 >--- a/Source/WebCore/platform/network/curl/CurlSSLHandle.h >+++ b/Source/WebCore/platform/network/curl/CurlSSLHandle.h >@@ -73,7 +73,7 @@ public: > bool canIgnoreAnyHTTPSCertificatesForHost(const String&) const; > > WEBCORE_EXPORT void setClientCertificateInfo(const String&, const String&, const String&); >- std::optional<ClientCertificate> getSSLClientCertificate(const String&) const; >+ Optional<ClientCertificate> getSSLClientCertificate(const String&) const; > > private: > #if NEED_OPENSSL_THREAD_SUPPORT >diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp >index 25f1ec2bc1371fbdae345c7e76feb9ee520f96e4..ce9a2ffa436f652953a207b41074c192947f32e2 100644 >--- a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp >+++ b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp >@@ -111,7 +111,7 @@ void NetworkStorageSession::switchToNewTestingSession() > // FIXME: Implement for WebKit to use. > } > >-void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& value) const >+void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& value) const > { > cookieStorage().setCookiesFromDOM(*this, firstParty, sameSiteInfo, url, frameID, pageID, value); > } >@@ -121,7 +121,7 @@ bool NetworkStorageSession::cookiesEnabled() const > return cookieStorage().cookiesEnabled(*this); > } > >-std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > return cookieStorage().cookiesForDOM(*this, firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } >@@ -178,7 +178,7 @@ Vector<Cookie> NetworkStorageSession::getCookies(const URL&) > return { }; > } > >-bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const >+bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const > { > return cookieStorage().getRawCookies(*this, firstParty, sameSiteInfo, url, frameID, pageID, rawCookies); > } >@@ -188,7 +188,7 @@ void NetworkStorageSession::flushCookieStore() > // FIXME: Implement for WebKit to use. > } > >-std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > return cookieStorage().cookieRequestHeaderFieldValue(*this, firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } >diff --git a/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp b/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp >index 5df367641429f700c2278ead052ab3835d88a752..4bb66048800fd22599e001b7704c17db98ef58b6 100644 >--- a/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp >+++ b/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp >@@ -148,7 +148,7 @@ Ref<CurlRequest> ResourceHandle::createCurlRequest(ResourceRequest&& request, Re > auto& storageSession = NetworkStorageSession::defaultStorageSession(); > auto& cookieJar = storageSession.cookieStorage(); > auto includeSecureCookies = request.url().protocolIs("https") ? IncludeSecureCookies::Yes : IncludeSecureCookies::No; >- String cookieHeaderField = cookieJar.cookieRequestHeaderFieldValue(storageSession, request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), std::nullopt, std::nullopt, includeSecureCookies).first; >+ String cookieHeaderField = cookieJar.cookieRequestHeaderFieldValue(storageSession, request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), WTF::nullopt, WTF::nullopt, includeSecureCookies).first; > if (!cookieHeaderField.isEmpty()) > request.addHTTPHeaderField(HTTPHeaderName::Cookie, cookieHeaderField); > } >@@ -335,7 +335,7 @@ void ResourceHandle::receivedChallengeRejection(const AuthenticationChallenge&) > ASSERT_NOT_REACHED(); > } > >-std::optional<Credential> ResourceHandle::getCredential(const ResourceRequest& request, bool redirect) >+Optional<Credential> ResourceHandle::getCredential(const ResourceRequest& request, bool redirect) > { > // m_user/m_pass are credentials given manually, for instance, by the arguments passed to XMLHttpRequest.open(). > Credential credential { d->m_user, d->m_pass, CredentialPersistenceNone }; >@@ -359,7 +359,7 @@ std::optional<Credential> ResourceHandle::getCredential(const ResourceRequest& r > if (!d->m_initialCredential.isEmpty()) > return d->m_initialCredential; > >- return std::nullopt; >+ return WTF::nullopt; > } > > void ResourceHandle::restartRequestWithCredential(const ProtectionSpace& protectionSpace, const Credential& credential) >diff --git a/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h b/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h >index 365938cfcc2186a10092479eaecdeb1b30ff3d9c..24e5e1c7a2890bb88dd9e7e4d619e86abc416f4b 100644 >--- a/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h >+++ b/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h >@@ -52,14 +52,14 @@ public: > virtual ~SocketStreamHandleImpl(); > > WEBCORE_EXPORT void platformSend(const uint8_t* data, size_t length, Function<void(bool)>&&) final; >- WEBCORE_EXPORT void platformSendHandshake(const uint8_t* data, size_t length, const std::optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final; >+ WEBCORE_EXPORT void platformSendHandshake(const uint8_t* data, size_t length, const Optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final; > WEBCORE_EXPORT void platformClose() final; > > private: > WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&); > > size_t bufferedAmount() final; >- std::optional<size_t> platformSendInternal(const uint8_t*, size_t); >+ Optional<size_t> platformSendInternal(const uint8_t*, size_t); > bool sendPendingData(); > > void threadEntryPoint(); >diff --git a/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp b/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp >index 0710caee2503c1f3f3808e20437058827ed36dc5..5bda1cf48be93cfe1449d4631aff341d5330eccb 100644 >--- a/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp >+++ b/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp >@@ -67,7 +67,7 @@ SocketStreamHandleImpl::~SocketStreamHandleImpl() > stopThread(); > } > >-std::optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t* data, size_t length) >+Optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t* data, size_t length) > { > LOG(Network, "SocketStreamHandle %p platformSend", this); > ASSERT(isMainThread()); >diff --git a/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h b/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h >index 3eda27ea8a217c620f9a3eda75b0ef680d81423a..249ee43f2cfe8df33959d1b2168809fb16bc7ff9 100644 >--- a/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h >+++ b/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h >@@ -46,7 +46,7 @@ class ResourceHandle; > RetainPtr<NSURLRequest> m_requestResult; > Lock m_mutex; > RetainPtr<NSCachedURLResponse> m_cachedResponseResult; >- std::optional<SchedulePairHashSet> m_scheduledPairs; >+ Optional<SchedulePairHashSet> m_scheduledPairs; > BOOL m_boolResult; > } > >diff --git a/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm b/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm >index ec7d01babb1a78492a181346dc85ef1c4006ceb9..a4c47170cb43524c79b0c539f6c1a79ef36c52e9 100644 >--- a/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm >+++ b/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm >@@ -43,7 +43,7 @@ > > using namespace WebCore; > >-static bool scheduledWithCustomRunLoopMode(const std::optional<SchedulePairHashSet>& pairs) >+static bool scheduledWithCustomRunLoopMode(const Optional<SchedulePairHashSet>& pairs) > { > if (!pairs) > return false; >diff --git a/Source/WebCore/platform/network/soup/CertificateInfo.h b/Source/WebCore/platform/network/soup/CertificateInfo.h >index af99352d61264fb1370790d5edb8697b0192a8fe..939bae580a7567a67b46e68b25f8d2f32717edf4 100644 >--- a/Source/WebCore/platform/network/soup/CertificateInfo.h >+++ b/Source/WebCore/platform/network/soup/CertificateInfo.h >@@ -55,7 +55,7 @@ public: > > bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; } > >- std::optional<SummaryInfo> summaryInfo() const { notImplemented(); return std::nullopt; } >+ Optional<SummaryInfo> summaryInfo() const { notImplemented(); return WTF::nullopt; } > > bool isEmpty() const { return !m_certificate; } > >diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >index 7e213e8a75874cca8659671f9b724bac75eb7ff6..8995fd27bbe017904e794d56b6363e3034aad188 100644 >--- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >+++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >@@ -315,7 +315,7 @@ static inline bool httpOnlyCookieExists(const GSList* cookies, const gchar* name > return false; > } > >-void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& value) const >+void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& value) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >@@ -461,7 +461,7 @@ Vector<Cookie> NetworkStorageSession::getCookies(const URL& url) > return cookies; > } > >-bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const >+bool NetworkStorageSession::getRawCookies(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) const > { > UNUSED_PARAM(firstParty); > UNUSED_PARAM(frameID); >@@ -531,7 +531,7 @@ static std::pair<String, bool> cookiesForSession(const NetworkStorageSession& se > return { String::fromUTF8(cookieHeader.get()), didAccessSecureCookies }; > } > >-std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > UNUSED_PARAM(firstParty); > UNUSED_PARAM(frameID); >@@ -539,7 +539,7 @@ std::pair<String, bool> NetworkStorageSession::cookiesForDOM(const URL& firstPar > return cookiesForSession(*this, url, false, includeSecureCookies); > } > >-std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const >+std::pair<String, bool> NetworkStorageSession::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const > { > UNUSED_PARAM(firstParty); > UNUSED_PARAM(frameID); >diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h b/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h >index 6c4ddbbbc35ae7579b2944386da1aed39e093b44..28aac78f8254c0e2a35d9504ecad9b3a8958c143 100644 >--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h >+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h >@@ -57,13 +57,13 @@ public: > const URL& url() const { return m_url; } > > void platformSend(const uint8_t* data, size_t length, Function<void(bool)>&&) final; >- void platformSendHandshake(const uint8_t* data, size_t length, const std::optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final; >+ void platformSendHandshake(const uint8_t* data, size_t length, const Optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final; > void platformClose() final; > private: > SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&); > > size_t bufferedAmount() final; >- std::optional<size_t> platformSendInternal(const uint8_t*, size_t); >+ Optional<size_t> platformSendInternal(const uint8_t*, size_t); > bool sendPendingData(); > > void beginWaitingForSocketWritability(); >diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >index b5ebde6526cc9fdea014af3d2743eada68aef568..5d9dc96ad74972603c89750049bc9d657966e5ee 100644 >--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp >@@ -216,7 +216,7 @@ void SocketStreamHandleImpl::writeReady() > sendPendingData(); > } > >-std::optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t* data, size_t length) >+Optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t* data, size_t length) > { > LOG(Network, "SocketStreamHandle %p platformSend", this); > if (!m_outputStream || !data) >@@ -229,7 +229,7 @@ std::optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t > beginWaitingForSocketWritability(); > else > didFail(SocketStreamError(error->code, String(), error->message)); >- return std::nullopt; >+ return WTF::nullopt; > } > > // If we did not send all the bytes we were given, we know that >@@ -238,7 +238,7 @@ std::optional<size_t> SocketStreamHandleImpl::platformSendInternal(const uint8_t > beginWaitingForSocketWritability(); > > if (written == -1) >- return std::nullopt; >+ return WTF::nullopt; > > return static_cast<size_t>(written); > } >diff --git a/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp b/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >index f24e265c96eafb5de4371a1d22638cc718e69516..343faeb9feb2194ccc3ef779d77d3f6b4d1edc87 100644 >--- a/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >+++ b/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp >@@ -276,17 +276,17 @@ void SoupNetworkSession::setShouldIgnoreTLSErrors(bool ignoreTLSErrors) > gIgnoreTLSErrors = ignoreTLSErrors; > } > >-std::optional<ResourceError> SoupNetworkSession::checkTLSErrors(const URL& requestURL, GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors) >+Optional<ResourceError> SoupNetworkSession::checkTLSErrors(const URL& requestURL, GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors) > { > if (gIgnoreTLSErrors) >- return std::nullopt; >+ return WTF::nullopt; > > if (!tlsErrors) >- return std::nullopt; >+ return WTF::nullopt; > > auto it = clientCertificates().find(requestURL.host().toString()); > if (it != clientCertificates().end() && it->value.contains(certificate)) >- return std::nullopt; >+ return WTF::nullopt; > > return ResourceError::tlsError(requestURL, tlsErrors, certificate); > } >diff --git a/Source/WebCore/platform/network/soup/SoupNetworkSession.h b/Source/WebCore/platform/network/soup/SoupNetworkSession.h >index 5b5ff7977347151961a45c3497ea2f551344b1aa..ffbd49a762a926f559c6422c45352296f60b3039 100644 >--- a/Source/WebCore/platform/network/soup/SoupNetworkSession.h >+++ b/Source/WebCore/platform/network/soup/SoupNetworkSession.h >@@ -66,7 +66,7 @@ public: > void setAcceptLanguages(const CString&); > > static void setShouldIgnoreTLSErrors(bool); >- static std::optional<ResourceError> checkTLSErrors(const URL&, GTlsCertificate*, GTlsCertificateFlags); >+ static Optional<ResourceError> checkTLSErrors(const URL&, GTlsCertificate*, GTlsCertificateFlags); > static void allowSpecificHTTPSCertificateForHost(const CertificateInfo&, const String& host); > > static void setCustomProtocolRequestType(GType); >diff --git a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >index 8d284c25fa01057786c73c056c27784c80f5b7bc..94851352518d606bea25eeea336185280334cfcc 100644 >--- a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >+++ b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >@@ -202,37 +202,37 @@ bool getFileSize(PlatformFileHandle handle, long long& result) > return true; > } > >-std::optional<WallTime> getFileCreationTime(const String& path) >+Optional<WallTime> getFileCreationTime(const String& path) > { > #if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD) > CString fsRep = fileSystemRepresentation(path); > > if (!fsRep.data() || fsRep.data()[0] == '\0') >- return std::nullopt; >+ return WTF::nullopt; > > struct stat fileInfo; > > if (stat(fsRep.data(), &fileInfo)) >- return std::nullopt; >+ return WTF::nullopt; > > return WallTime::fromRawSeconds(fileInfo.st_birthtime); > #else > UNUSED_PARAM(path); >- return std::nullopt; >+ return WTF::nullopt; > #endif > } > >-std::optional<WallTime> getFileModificationTime(const String& path) >+Optional<WallTime> getFileModificationTime(const String& path) > { > CString fsRep = fileSystemRepresentation(path); > > if (!fsRep.data() || fsRep.data()[0] == '\0') >- return std::nullopt; >+ return WTF::nullopt; > > struct stat fileInfo; > > if (stat(fsRep.data(), &fileInfo)) >- return std::nullopt; >+ return WTF::nullopt; > > return WallTime::fromRawSeconds(fileInfo.st_mtime); > } >@@ -246,16 +246,16 @@ static FileMetadata::Type toFileMetataType(struct stat fileInfo) > return FileMetadata::Type::File; > } > >-static std::optional<FileMetadata> fileMetadataUsingFunction(const String& path, int (*statFunc)(const char*, struct stat*)) >+static Optional<FileMetadata> fileMetadataUsingFunction(const String& path, int (*statFunc)(const char*, struct stat*)) > { > CString fsRep = fileSystemRepresentation(path); > > if (!fsRep.data() || fsRep.data()[0] == '\0') >- return std::nullopt; >+ return WTF::nullopt; > > struct stat fileInfo; > if (statFunc(fsRep.data(), &fileInfo)) >- return std::nullopt; >+ return WTF::nullopt; > > String filename = pathGetFileName(path); > bool isHidden = !filename.isEmpty() && filename[0] == '.'; >@@ -267,12 +267,12 @@ static std::optional<FileMetadata> fileMetadataUsingFunction(const String& path, > }; > } > >-std::optional<FileMetadata> fileMetadata(const String& path) >+Optional<FileMetadata> fileMetadata(const String& path) > { > return fileMetadataUsingFunction(path, &lstat); > } > >-std::optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path) >+Optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path) > { > return fileMetadataUsingFunction(path, &stat); > } >@@ -472,11 +472,11 @@ bool hardLinkOrCopyFile(const String& source, const String& destination) > return appendResult; > } > >-std::optional<int32_t> getFileDeviceId(const CString& fsFile) >+Optional<int32_t> getFileDeviceId(const CString& fsFile) > { > struct stat fileStat; > if (stat(fsFile.data(), &fileStat) == -1) >- return std::nullopt; >+ return WTF::nullopt; > > return fileStat.st_dev; > } >diff --git a/Source/WebCore/platform/sql/SQLiteFileSystem.cpp b/Source/WebCore/platform/sql/SQLiteFileSystem.cpp >index 5b110a8bde8238ec9e1899ada32d94225b7d77ea..90c20c7bce6a67b67d53d5c4053776bf14c7e5e5 100644 >--- a/Source/WebCore/platform/sql/SQLiteFileSystem.cpp >+++ b/Source/WebCore/platform/sql/SQLiteFileSystem.cpp >@@ -108,12 +108,12 @@ long long SQLiteFileSystem::getDatabaseFileSize(const String& fileName) > return FileSystem::getFileSize(fileName, size) ? size : 0; > } > >-std::optional<WallTime> SQLiteFileSystem::databaseCreationTime(const String& fileName) >+Optional<WallTime> SQLiteFileSystem::databaseCreationTime(const String& fileName) > { > return FileSystem::getFileCreationTime(fileName); > } > >-std::optional<WallTime> SQLiteFileSystem::databaseModificationTime(const String& fileName) >+Optional<WallTime> SQLiteFileSystem::databaseModificationTime(const String& fileName) > { > return FileSystem::getFileModificationTime(fileName); > } >diff --git a/Source/WebCore/platform/sql/SQLiteFileSystem.h b/Source/WebCore/platform/sql/SQLiteFileSystem.h >index 17bfa0628790bb981294093eea5a0c0b386b894a..c371ecfa4087f59999ff97c6507e1087dbde13fc 100644 >--- a/Source/WebCore/platform/sql/SQLiteFileSystem.h >+++ b/Source/WebCore/platform/sql/SQLiteFileSystem.h >@@ -97,8 +97,8 @@ public: > #endif > > static long long getDatabaseFileSize(const String& fileName); >- WEBCORE_EXPORT static std::optional<WallTime> databaseCreationTime(const String& fileName); >- WEBCORE_EXPORT static std::optional<WallTime> databaseModificationTime(const String& fileName); >+ WEBCORE_EXPORT static Optional<WallTime> databaseCreationTime(const String& fileName); >+ WEBCORE_EXPORT static Optional<WallTime> databaseModificationTime(const String& fileName); > > private: > // do not instantiate this class >diff --git a/Source/WebCore/platform/vr/VRManager.cpp b/Source/WebCore/platform/vr/VRManager.cpp >index c97c5f431bf54f6d0f438291c973cff61549e81e..2f7e65b189e18113b809700025a163fb30f44ed1 100644 >--- a/Source/WebCore/platform/vr/VRManager.cpp >+++ b/Source/WebCore/platform/vr/VRManager.cpp >@@ -48,10 +48,10 @@ VRManager::~VRManager() > m_platformManager = nullptr; > } > >-std::optional<VRManager::VRDisplaysVector> VRManager::getVRDisplays() >+Optional<VRManager::VRDisplaysVector> VRManager::getVRDisplays() > { > if (!m_platformManager) >- return std::nullopt; >+ return WTF::nullopt; > > auto displays = m_platformManager->getVRDisplays(); > VRDisplaysHashMap newDisplays; >diff --git a/Source/WebCore/platform/vr/VRManager.h b/Source/WebCore/platform/vr/VRManager.h >index fb3b7cd2f8ee13a64759df694caed5a5d4e8ed8d..7df3b9e92d5c7bc56e1b724e66b4b7d938bd0f3a 100644 >--- a/Source/WebCore/platform/vr/VRManager.h >+++ b/Source/WebCore/platform/vr/VRManager.h >@@ -39,7 +39,7 @@ public: > > WEBCORE_EXPORT static VRManager& singleton(); > >- std::optional<VRDisplaysVector> getVRDisplays(); >+ Optional<VRDisplaysVector> getVRDisplays(); > > private: > VRManager(); >diff --git a/Source/WebCore/platform/vr/VRPlatformDisplay.h b/Source/WebCore/platform/vr/VRPlatformDisplay.h >index 21fa3e0f0383611c680bf0c03117318becb43f14..8d24c2bae1b61838dff75fa54156922a75f718f8 100644 >--- a/Source/WebCore/platform/vr/VRPlatformDisplay.h >+++ b/Source/WebCore/platform/vr/VRPlatformDisplay.h >@@ -83,10 +83,10 @@ public: > void setRenderSize(const RenderSize& renderSize) { m_renderSize = renderSize; } > > void setPlayAreaBounds(const FloatSize& playAreaBounds) { m_playAreaBounds = playAreaBounds; } >- const std::optional<FloatSize>& playAreaBounds() const { return m_playAreaBounds; } >+ const Optional<FloatSize>& playAreaBounds() const { return m_playAreaBounds; } > > void setSittingToStandingTransform(const TransformationMatrix& transform) { m_sittingToStandingTransform = transform; } >- const std::optional<TransformationMatrix>& sittingToStandingTransform() const { return m_sittingToStandingTransform; } >+ const Optional<TransformationMatrix>& sittingToStandingTransform() const { return m_sittingToStandingTransform; } > > private: > String m_displayName; >@@ -100,8 +100,8 @@ private: > RenderSize m_renderSize; > FieldOfView m_eyeFieldOfView[Eye::NumEyes]; > >- std::optional<FloatSize> m_playAreaBounds; >- std::optional<TransformationMatrix> m_sittingToStandingTransform; >+ Optional<FloatSize> m_playAreaBounds; >+ Optional<TransformationMatrix> m_sittingToStandingTransform; > }; > > struct VRPlatformTrackingInfo { >@@ -141,20 +141,20 @@ struct VRPlatformTrackingInfo { > void clear() > { > timestamp = 0; >- position = std::nullopt; >- orientation = std::nullopt; >- angularAcceleration = std::nullopt; >- angularVelocity = std::nullopt; >- linearAcceleration = std::nullopt; >- linearVelocity = std::nullopt; >+ position = WTF::nullopt; >+ orientation = WTF::nullopt; >+ angularAcceleration = WTF::nullopt; >+ angularVelocity = WTF::nullopt; >+ linearAcceleration = WTF::nullopt; >+ linearVelocity = WTF::nullopt; > } > >- std::optional<Quaternion> orientation; >- std::optional<FloatPoint3D> position; >- std::optional<Float3> angularAcceleration; >- std::optional<Float3> angularVelocity; >- std::optional<Float3> linearAcceleration; >- std::optional<Float3> linearVelocity; >+ Optional<Quaternion> orientation; >+ Optional<FloatPoint3D> position; >+ Optional<Float3> angularAcceleration; >+ Optional<Float3> angularVelocity; >+ Optional<Float3> linearAcceleration; >+ Optional<Float3> linearVelocity; > double timestamp { 0 }; > }; > >diff --git a/Source/WebCore/platform/win/FileSystemWin.cpp b/Source/WebCore/platform/win/FileSystemWin.cpp >index b30621f9430b281b3452026532d5c310faa8d4f9..bb702cb0120abbf258529faf94310ddfffdf6084 100644 >--- a/Source/WebCore/platform/win/FileSystemWin.cpp >+++ b/Source/WebCore/platform/win/FileSystemWin.cpp >@@ -124,22 +124,22 @@ bool getFileSize(PlatformFileHandle fileHandle, long long& size) > return getFileSizeFromByHandleFileInformationStructure(fileInformation, size); > } > >-std::optional<WallTime> getFileModificationTime(const String& path) >+Optional<WallTime> getFileModificationTime(const String& path) > { > WIN32_FIND_DATAW findData; > if (!getFindData(path, findData)) >- return std::nullopt; >+ return WTF::nullopt; > > time_t time = 0; > getFileModificationTimeFromFindData(findData, time); > return WallTime::fromRawSeconds(time); > } > >-std::optional<WallTime> getFileCreationTime(const String& path) >+Optional<WallTime> getFileCreationTime(const String& path) > { > WIN32_FIND_DATAW findData; > if (!getFindData(path, findData)) >- return std::nullopt; >+ return WTF::nullopt; > > time_t time = 0; > getFileCreationTimeFromFindData(findData, time); >@@ -177,11 +177,11 @@ static FileMetadata::Type toFileMetadataType(WIN32_FIND_DATAW findData) > return FileMetadata::Type::File; > } > >-static std::optional<FileMetadata> findDataToFileMetadata(WIN32_FIND_DATAW findData) >+static Optional<FileMetadata> findDataToFileMetadata(WIN32_FIND_DATAW findData) > { > long long length; > if (!getFileSizeFromFindData(findData, length)) >- return std::nullopt; >+ return WTF::nullopt; > > time_t modificationTime; > getFileModificationTimeFromFindData(findData, modificationTime); >@@ -194,27 +194,27 @@ static std::optional<FileMetadata> findDataToFileMetadata(WIN32_FIND_DATAW findD > }; > } > >-std::optional<FileMetadata> fileMetadata(const String& path) >+Optional<FileMetadata> fileMetadata(const String& path) > { > WIN32_FIND_DATAW findData; > if (!getFindData(path, findData)) >- return std::nullopt; >+ return WTF::nullopt; > > return findDataToFileMetadata(findData); > } > >-std::optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path) >+Optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path) > { > WIN32_FIND_DATAW findData; > if (!getFindData(path, findData)) >- return std::nullopt; >+ return WTF::nullopt; > > if (isSymbolicLink(findData)) { > String targetPath = getFinalPathName(path); > if (targetPath.isNull()) >- return std::nullopt; >+ return WTF::nullopt; > if (!getFindData(targetPath, findData)) >- return std::nullopt; >+ return WTF::nullopt; > } > > return findDataToFileMetadata(findData); >@@ -541,16 +541,16 @@ bool getVolumeFreeSpace(const String&, uint64_t&) > return false; > } > >-std::optional<int32_t> getFileDeviceId(const CString& fsFile) >+Optional<int32_t> getFileDeviceId(const CString& fsFile) > { > auto handle = openFile(fsFile.data(), FileOpenMode::Read); > if (!isHandleValid(handle)) >- return std::nullopt; >+ return WTF::nullopt; > > BY_HANDLE_FILE_INFORMATION fileInformation = { }; > if (!::GetFileInformationByHandle(handle, &fileInformation)) { > closeFile(handle); >- return std::nullopt; >+ return WTF::nullopt; > } > > closeFile(handle); >diff --git a/Source/WebCore/plugins/PluginData.cpp b/Source/WebCore/plugins/PluginData.cpp >index 6f3cf86a59bcd33491090266448ff938b57c0533..c5922da81dec2f8ceff2c8ee71f3724cfa78bd84 100644 >--- a/Source/WebCore/plugins/PluginData.cpp >+++ b/Source/WebCore/plugins/PluginData.cpp >@@ -42,7 +42,7 @@ const Vector<PluginInfo>& PluginData::webVisiblePlugins() const > auto documentURL = m_page.mainFrame().document() ? m_page.mainFrame().document()->url() : URL { }; > if (!documentURL.isNull() && !protocolHostAndPortAreEqual(m_cachedVisiblePlugins.pageURL, documentURL)) { > m_cachedVisiblePlugins.pageURL = WTFMove(documentURL); >- m_cachedVisiblePlugins.pluginList = std::nullopt; >+ m_cachedVisiblePlugins.pluginList = WTF::nullopt; > } > > if (!m_cachedVisiblePlugins.pluginList) >diff --git a/Source/WebCore/plugins/PluginData.h b/Source/WebCore/plugins/PluginData.h >index f040b0af96f3b8bbd9f549329312b8f4f7069ed9..587fe90a2c8ebe3a8423bd9efd046c414d4bb473 100644 >--- a/Source/WebCore/plugins/PluginData.h >+++ b/Source/WebCore/plugins/PluginData.h >@@ -93,7 +93,7 @@ struct SupportedPluginIdentifier { > String pluginIdentifier; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<SupportedPluginIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<SupportedPluginIdentifier> decode(Decoder&); > }; > > // FIXME: merge with PluginDatabase in the future >@@ -128,11 +128,11 @@ private: > protected: > Page& m_page; > Vector<PluginInfo> m_plugins; >- std::optional<Vector<SupportedPluginIdentifier>> m_supportedPluginIdentifiers; >+ Optional<Vector<SupportedPluginIdentifier>> m_supportedPluginIdentifiers; > > struct CachedVisiblePlugins { > URL pageURL; >- std::optional<Vector<PluginInfo>> pluginList; >+ Optional<Vector<PluginInfo>> pluginList; > }; > mutable CachedVisiblePlugins m_cachedVisiblePlugins; > }; >@@ -144,17 +144,17 @@ inline bool isSupportedPlugin(const Vector<SupportedPluginIdentifier>& pluginIde > }) != notFound; > } > >-template<class Decoder> inline std::optional<SupportedPluginIdentifier> SupportedPluginIdentifier::decode(Decoder& decoder) >+template<class Decoder> inline Optional<SupportedPluginIdentifier> SupportedPluginIdentifier::decode(Decoder& decoder) > { >- std::optional<String> matchingDomain; >+ Optional<String> matchingDomain; > decoder >> matchingDomain; > if (!matchingDomain) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> pluginIdentifier; >+ Optional<String> pluginIdentifier; > decoder >> pluginIdentifier; > if (!pluginIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return SupportedPluginIdentifier { WTFMove(matchingDomain.value()), WTFMove(pluginIdentifier.value()) }; > } >diff --git a/Source/WebCore/plugins/PluginInfoProvider.h b/Source/WebCore/plugins/PluginInfoProvider.h >index f4707b7d69392f24cebb71387ce967520e43534d..3d6b48a7f3930c717e743eae4bc8133e35228120 100644 >--- a/Source/WebCore/plugins/PluginInfoProvider.h >+++ b/Source/WebCore/plugins/PluginInfoProvider.h >@@ -40,7 +40,7 @@ public: > void removePage(Page&); > void clearPagesPluginData(); > >- virtual Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginIdentifier>>&) = 0; >+ virtual Vector<PluginInfo> pluginInfo(Page&, Optional<Vector<SupportedPluginIdentifier>>&) = 0; > virtual Vector<PluginInfo> webVisiblePluginInfo(Page&, const URL&) = 0; > > private: >diff --git a/Source/WebCore/rendering/BreakLines.h b/Source/WebCore/rendering/BreakLines.h >index c7e5a86b293d454d024f012d16f7ec4ed22bf6ef..b85148b6c8bede3bf8fd48b818a9d4224cd50094 100644 >--- a/Source/WebCore/rendering/BreakLines.h >+++ b/Source/WebCore/rendering/BreakLines.h >@@ -90,7 +90,7 @@ inline bool needsLineBreakIterator(UChar character) > template<typename CharacterType, NonBreakingSpaceBehavior nonBreakingSpaceBehavior, CanUseShortcut canUseShortcut> > inline unsigned nextBreakablePosition(LazyLineBreakIterator& lazyBreakIterator, const CharacterType* string, unsigned length, unsigned startPosition) > { >- std::optional<unsigned> nextBreak; >+ Optional<unsigned> nextBreak; > > CharacterType lastLastCharacter = startPosition > 1 ? string[startPosition - 2] : static_cast<CharacterType>(lazyBreakIterator.secondToLastCharacter()); > CharacterType lastCharacter = startPosition > 0 ? string[startPosition - 1] : static_cast<CharacterType>(lazyBreakIterator.lastCharacter()); >@@ -109,7 +109,7 @@ inline unsigned nextBreakablePosition(LazyLineBreakIterator& lazyBreakIterator, > if (breakIterator) { > int candidate = ubrk_following(breakIterator, i - 1 + priorContextLength); > if (candidate == UBRK_DONE) >- nextBreak = std::nullopt; >+ nextBreak = WTF::nullopt; > else { > unsigned result = candidate; > ASSERT(result >= priorContextLength); >@@ -187,7 +187,7 @@ inline unsigned nextBreakablePositionIgnoringNBSPWithoutShortcut(LazyLineBreakIt > return nextBreakablePosition<UChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace, CanUseShortcut::No>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition); > } > >-inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, std::optional<unsigned>& nextBreakable, bool breakNBSP, bool canUseShortcut, bool keepAllWords) >+inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, Optional<unsigned>& nextBreakable, bool breakNBSP, bool canUseShortcut, bool keepAllWords) > { > if (nextBreakable && nextBreakable.value() >= startPosition) > return startPosition == nextBreakable; >diff --git a/Source/WebCore/rendering/FloatingObjects.cpp b/Source/WebCore/rendering/FloatingObjects.cpp >index 2a340add8521bbb0bd17513fe7d600158d6eee18..de28d67dd4b382083fccb543ce70db78f7797e52 100644 >--- a/Source/WebCore/rendering/FloatingObjects.cpp >+++ b/Source/WebCore/rendering/FloatingObjects.cpp >@@ -201,8 +201,8 @@ public: > private: > WeakPtr<const RenderBlockFlow> m_renderer; > LayoutUnit m_belowLogicalHeight; >- std::optional<LayoutUnit> m_nextLogicalBottom; >- std::optional<LayoutUnit> m_nextShapeLogicalBottom; >+ Optional<LayoutUnit> m_nextLogicalBottom; >+ Optional<LayoutUnit> m_nextShapeLogicalBottom; > }; > > inline void FindNextFloatLogicalBottomAdapter::collectIfNeeded(const IntervalType& interval) >diff --git a/Source/WebCore/rendering/GridLayoutFunctions.cpp b/Source/WebCore/rendering/GridLayoutFunctions.cpp >index 7e315be7b4f3a0b4dac9b96997d54bac3cbb7a66..0e790bf0c6cc1555bd594514fe8fd8a15c13a5fa 100644 >--- a/Source/WebCore/rendering/GridLayoutFunctions.cpp >+++ b/Source/WebCore/rendering/GridLayoutFunctions.cpp >@@ -89,7 +89,7 @@ bool hasOverrideContainingBlockContentSizeForChild(const RenderBox& child, GridT > return direction == ForColumns ? child.hasOverrideContainingBlockContentLogicalWidth() : child.hasOverrideContainingBlockContentLogicalHeight(); > } > >-std::optional<LayoutUnit> overrideContainingBlockContentSizeForChild(const RenderBox& child, GridTrackSizingDirection direction) >+Optional<LayoutUnit> overrideContainingBlockContentSizeForChild(const RenderBox& child, GridTrackSizingDirection direction) > { > return direction == ForColumns ? child.overrideContainingBlockContentLogicalWidth() : child.overrideContainingBlockContentLogicalHeight(); > } >diff --git a/Source/WebCore/rendering/GridLayoutFunctions.h b/Source/WebCore/rendering/GridLayoutFunctions.h >index 874fe55452f8f1eb33b03f845c76cd5675b696da..07146376b0403716e84327afcdae1448c3442e2e 100644 >--- a/Source/WebCore/rendering/GridLayoutFunctions.h >+++ b/Source/WebCore/rendering/GridLayoutFunctions.h >@@ -39,7 +39,7 @@ LayoutUnit marginLogicalSizeForChild(const RenderGrid&, GridTrackSizingDirection > bool isOrthogonalChild(const RenderGrid&, const RenderBox&); > GridTrackSizingDirection flowAwareDirectionForChild(const RenderGrid&, const RenderBox&, GridTrackSizingDirection); > bool hasOverrideContainingBlockContentSizeForChild(const RenderBox&, GridTrackSizingDirection); >-std::optional<LayoutUnit> overrideContainingBlockContentSizeForChild(const RenderBox&, GridTrackSizingDirection); >+Optional<LayoutUnit> overrideContainingBlockContentSizeForChild(const RenderBox&, GridTrackSizingDirection); > > } > >diff --git a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp b/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp >index 3a024162e5ac1705af30233224416290bd805af2..f75376b390baa37ed29fe4052a7babfee2a4f2a6 100644 >--- a/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp >+++ b/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp >@@ -77,7 +77,7 @@ void GridTrack::growTempSize(const LayoutUnit& tempSize) > m_tempSize += tempSize; > } > >-void GridTrack::setGrowthLimitCap(std::optional<LayoutUnit> growthLimitCap) >+void GridTrack::setGrowthLimitCap(Optional<LayoutUnit> growthLimitCap) > { > ASSERT(!growthLimitCap || growthLimitCap.value() >= 0); > m_growthLimitCap = growthLimitCap; >@@ -108,7 +108,7 @@ static bool shouldClearOverrideContainingBlockContentSizeForChild(const RenderBo > return child.hasRelativeLogicalHeight() || child.style().logicalHeight().isIntrinsicOrAuto(); > } > >-static void setOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, std::optional<LayoutUnit> size) >+static void setOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, Optional<LayoutUnit> size) > { > if (direction == ForColumns) > child.setOverrideContainingBlockContentLogicalWidth(size); >@@ -134,7 +134,7 @@ static LayoutUnit marginIntrinsicLogicalWidthForChild(const RenderGrid* renderGr > > // GridTrackSizingAlgorithm private. > >-void GridTrackSizingAlgorithm::setFreeSpace(GridTrackSizingDirection direction, std::optional<LayoutUnit> freeSpace) >+void GridTrackSizingAlgorithm::setFreeSpace(GridTrackSizingDirection direction, Optional<LayoutUnit> freeSpace) > { > if (direction == ForColumns) > m_freeSpaceColumns = freeSpace; >@@ -142,13 +142,13 @@ void GridTrackSizingAlgorithm::setFreeSpace(GridTrackSizingDirection direction, > m_freeSpaceRows = freeSpace; > } > >-std::optional<LayoutUnit> GridTrackSizingAlgorithm::availableSpace() const >+Optional<LayoutUnit> GridTrackSizingAlgorithm::availableSpace() const > { > ASSERT(wasSetup()); > return availableSpace(m_direction); > } > >-void GridTrackSizingAlgorithm::setAvailableSpace(GridTrackSizingDirection direction, std::optional<LayoutUnit> availableSpace) >+void GridTrackSizingAlgorithm::setAvailableSpace(GridTrackSizingDirection direction, Optional<LayoutUnit> availableSpace) > { > if (direction == ForColumns) > m_availableSpaceColumns = availableSpace; >@@ -559,7 +559,7 @@ LayoutUnit GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild(const Rend > const GridSpan& span = m_grid.gridItemSpan(child, direction); > LayoutUnit gridAreaSize; > bool gridAreaIsIndefinite = false; >- std::optional<LayoutUnit> availableSize = availableSpace(direction); >+ Optional<LayoutUnit> availableSize = availableSpace(direction); > for (auto trackPosition : span) { > // We may need to estimate the grid area size before running the track > // sizing algorithm in order to perform the pre-layout of orthogonal >@@ -744,7 +744,7 @@ void GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes() > m_maxContentSize += track.growthLimit(); > // The growth limit caps must be cleared now in order to properly sort > // tracks by growth potential on an eventual "Maximize Tracks". >- track.setGrowthLimitCap(std::nullopt); >+ track.setGrowthLimitCap(WTF::nullopt); > } > } > >@@ -755,7 +755,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::logicalHeightForChild(RenderBox& ch > // If |child| has a relative logical height, we shouldn't let it override its intrinsic height, which is > // what we are interested in here. Thus we need to set the block-axis override size to -1 (no possible resolution). > if (shouldClearOverrideContainingBlockContentSizeForChild(child, ForRows)) { >- setOverrideContainingBlockContentSizeForChild(child, childBlockDirection, std::nullopt); >+ setOverrideContainingBlockContentSizeForChild(child, childBlockDirection, WTF::nullopt); > child.setNeedsLayout(MarkOnlyThis); > } > >@@ -831,7 +831,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::minSizeForChild(RenderBox& child) c > bool overrideSizeHasChanged = updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection, gridAreaSize); > layoutGridItemForMinSizeComputation(child, overrideSizeHasChanged); > >- return child.computeLogicalHeightUsing(MinSize, childMinSize, std::nullopt).value_or(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight() + baselineShim; >+ return child.computeLogicalHeightUsing(MinSize, childMinSize, WTF::nullopt).value_or(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight() + baselineShim; > } > > bool GridTrackSizingAlgorithm::canParticipateInBaselineAlignment(const RenderBox& child, GridAxis baselineAxis) const >@@ -902,7 +902,7 @@ void GridTrackSizingAlgorithm::copyBaselineItemsCache(const GridTrackSizingAlgor > m_rowBaselineItemsMap = source.m_rowBaselineItemsMap; > } > >-bool GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, std::optional<LayoutUnit> overrideSize) const >+bool GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, Optional<LayoutUnit> overrideSize) const > { > if (!overrideSize) > overrideSize = m_algorithm.gridAreaBreadthForChild(child, direction); >@@ -921,8 +921,8 @@ public: > private: > LayoutUnit minLogicalWidthForChild(RenderBox&, Length childMinSize, LayoutUnit availableSize) const override; > void layoutGridItemForMinSizeComputation(RenderBox&, bool overrideSizeHasChanged) const override; >- void maximizeTracks(Vector<GridTrack>&, std::optional<LayoutUnit>& freeSpace) override; >- double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, std::optional<LayoutUnit> freeSpace) const override; >+ void maximizeTracks(Vector<GridTrack>&, Optional<LayoutUnit>& freeSpace) override; >+ double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> freeSpace) const override; > bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const override; > LayoutUnit freeSpaceForStretchAutoTracksStep() const override; > }; >@@ -939,7 +939,7 @@ void IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation(RenderBox& chil > child.layoutIfNeeded(); > } > >-void IndefiniteSizeStrategy::maximizeTracks(Vector<GridTrack>& tracks, std::optional<LayoutUnit>& freeSpace) >+void IndefiniteSizeStrategy::maximizeTracks(Vector<GridTrack>& tracks, Optional<LayoutUnit>& freeSpace) > { > UNUSED_PARAM(freeSpace); > for (auto& track : tracks) >@@ -952,7 +952,7 @@ static inline double normalizedFlexFraction(const GridTrack& track, double flexF > return track.baseSize() / std::max<double>(1, flexFactor); > } > >-double IndefiniteSizeStrategy::findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection direction, std::optional<LayoutUnit> freeSpace) const >+double IndefiniteSizeStrategy::findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection direction, Optional<LayoutUnit> freeSpace) const > { > UNUSED_PARAM(freeSpace); > auto allTracks = m_algorithm.tracks(direction); >@@ -993,8 +993,8 @@ bool IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded(double& flexFract > > const RenderGrid* renderGrid = this->renderGrid(); > >- auto minSize = renderGrid->computeContentLogicalHeight(MinSize, renderGrid->style().logicalMinHeight(), std::nullopt); >- auto maxSize = renderGrid->computeContentLogicalHeight(MaxSize, renderGrid->style().logicalMaxHeight(), std::nullopt); >+ auto minSize = renderGrid->computeContentLogicalHeight(MinSize, renderGrid->style().logicalMinHeight(), WTF::nullopt); >+ auto maxSize = renderGrid->computeContentLogicalHeight(MaxSize, renderGrid->style().logicalMaxHeight(), WTF::nullopt); > > // Redo the flex fraction computation using min|max-height as definite available space in case > // the total height is smaller than min-height or larger than max-height. >@@ -1021,8 +1021,8 @@ public: > private: > LayoutUnit minLogicalWidthForChild(RenderBox&, Length childMinSize, LayoutUnit availableSize) const override; > void layoutGridItemForMinSizeComputation(RenderBox&, bool overrideSizeHasChanged) const override; >- void maximizeTracks(Vector<GridTrack>&, std::optional<LayoutUnit>& freeSpace) override; >- double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, std::optional<LayoutUnit> freeSpace) const override; >+ void maximizeTracks(Vector<GridTrack>&, Optional<LayoutUnit>& freeSpace) override; >+ double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> freeSpace) const override; > bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const override; > LayoutUnit freeSpaceForStretchAutoTracksStep() const override; > }; >@@ -1033,7 +1033,7 @@ LayoutUnit IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep() const > if (direction() == ForColumns) > return 0_lu; > >- auto minSize = renderGrid()->computeContentLogicalHeight(MinSize, renderGrid()->style().logicalMinHeight(), std::nullopt); >+ auto minSize = renderGrid()->computeContentLogicalHeight(MinSize, renderGrid()->style().logicalMinHeight(), WTF::nullopt); > if (!minSize) > return 0_lu; > return minSize.value() - computeTrackBasedSize(); >@@ -1046,7 +1046,7 @@ LayoutUnit DefiniteSizeStrategy::minLogicalWidthForChild(RenderBox& child, Lengt > return child.computeLogicalWidthInFragmentUsing(MinSize, childMinSize, availableSize, *renderGrid(), nullptr) + marginLogicalWidth; > } > >-void DefiniteSizeStrategy::maximizeTracks(Vector<GridTrack>& tracks, std::optional<LayoutUnit>& freeSpace) >+void DefiniteSizeStrategy::maximizeTracks(Vector<GridTrack>& tracks, Optional<LayoutUnit>& freeSpace) > { > size_t tracksSize = tracks.size(); > Vector<GridTrack*> tracksForDistribution(tracksSize); >@@ -1070,7 +1070,7 @@ void DefiniteSizeStrategy::layoutGridItemForMinSizeComputation(RenderBox& child, > child.layoutIfNeeded(); > } > >-double DefiniteSizeStrategy::findUsedFlexFraction(Vector<unsigned>&, GridTrackSizingDirection direction, std::optional<LayoutUnit> freeSpace) const >+double DefiniteSizeStrategy::findUsedFlexFraction(Vector<unsigned>&, GridTrackSizingDirection direction, Optional<LayoutUnit> freeSpace) const > { > GridSpan allTracksSpan = GridSpan::translatedDefiniteGridSpan(0, m_algorithm.tracks(direction).size()); > ASSERT(freeSpace); >@@ -1173,7 +1173,7 @@ void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes() > } > } > >-void GridTrackSizingAlgorithm::stretchFlexibleTracks(std::optional<LayoutUnit> freeSpace) >+void GridTrackSizingAlgorithm::stretchFlexibleTracks(Optional<LayoutUnit> freeSpace) > { > if (m_flexibleSizedTracksIndex.isEmpty()) > return; >@@ -1255,7 +1255,7 @@ bool GridTrackSizingAlgorithm::isValidTransition() const > > // GridTrackSizingAlgorithm API. > >-void GridTrackSizingAlgorithm::setup(GridTrackSizingDirection direction, unsigned numTracks, SizingOperation sizingOperation, std::optional<LayoutUnit> availableSpace, std::optional<LayoutUnit> freeSpace) >+void GridTrackSizingAlgorithm::setup(GridTrackSizingDirection direction, unsigned numTracks, SizingOperation sizingOperation, Optional<LayoutUnit> availableSpace, Optional<LayoutUnit> freeSpace) > { > ASSERT(m_needsSetup); > m_direction = direction; >@@ -1309,7 +1309,7 @@ void GridTrackSizingAlgorithm::run() > StateMachine stateMachine(*this); > > // Step 1. >- const std::optional<LayoutUnit> initialFreeSpace = freeSpace(m_direction); >+ const Optional<LayoutUnit> initialFreeSpace = freeSpace(m_direction); > initializeTrackSizes(); > > // Step 2. >@@ -1346,8 +1346,8 @@ void GridTrackSizingAlgorithm::reset() > m_contentSizedTracksIndex.shrink(0); > m_flexibleSizedTracksIndex.shrink(0); > m_autoSizedTracksForStretchIndex.shrink(0); >- setAvailableSpace(ForRows, std::nullopt); >- setAvailableSpace(ForColumns, std::nullopt); >+ setAvailableSpace(ForRows, WTF::nullopt); >+ setAvailableSpace(ForColumns, WTF::nullopt); > m_hasPercentSizedRowsIndefiniteHeight = false; > } > >diff --git a/Source/WebCore/rendering/GridTrackSizingAlgorithm.h b/Source/WebCore/rendering/GridTrackSizingAlgorithm.h >index 06062207159ab72390e6a887dc6087c5b4dabea1..899573cbdc2b04e79d0eda604c0ee039440a9e9b 100644 >--- a/Source/WebCore/rendering/GridTrackSizingAlgorithm.h >+++ b/Source/WebCore/rendering/GridTrackSizingAlgorithm.h >@@ -70,8 +70,8 @@ public: > bool infinitelyGrowable() const { return m_infinitelyGrowable; } > void setInfinitelyGrowable(bool infinitelyGrowable) { m_infinitelyGrowable = infinitelyGrowable; } > >- void setGrowthLimitCap(std::optional<LayoutUnit>); >- std::optional<LayoutUnit> growthLimitCap() const { return m_growthLimitCap; } >+ void setGrowthLimitCap(Optional<LayoutUnit>); >+ Optional<LayoutUnit> growthLimitCap() const { return m_growthLimitCap; } > > private: > bool isGrowthLimitBiggerThanBaseSize() const { return growthLimitIsInfinite() || m_growthLimit >= m_baseSize; } >@@ -82,7 +82,7 @@ private: > LayoutUnit m_growthLimit { 0 }; > LayoutUnit m_plannedSize { 0 }; > LayoutUnit m_tempSize { 0 }; >- std::optional<LayoutUnit> m_growthLimitCap; >+ Optional<LayoutUnit> m_growthLimitCap; > bool m_infinitelyGrowable { false }; > }; > >@@ -97,7 +97,7 @@ public: > { > } > >- void setup(GridTrackSizingDirection, unsigned numTracks, SizingOperation, std::optional<LayoutUnit> availableSpace, std::optional<LayoutUnit> freeSpace); >+ void setup(GridTrackSizingDirection, unsigned numTracks, SizingOperation, Optional<LayoutUnit> availableSpace, Optional<LayoutUnit> freeSpace); > void run(); > void reset(); > >@@ -120,11 +120,11 @@ public: > Vector<GridTrack>& tracks(GridTrackSizingDirection direction) { return direction == ForColumns ? m_columns : m_rows; } > const Vector<GridTrack>& tracks(GridTrackSizingDirection direction) const { return direction == ForColumns ? m_columns : m_rows; } > >- std::optional<LayoutUnit> freeSpace(GridTrackSizingDirection direction) const { return direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows; } >- void setFreeSpace(GridTrackSizingDirection, std::optional<LayoutUnit>); >+ Optional<LayoutUnit> freeSpace(GridTrackSizingDirection direction) const { return direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows; } >+ void setFreeSpace(GridTrackSizingDirection, Optional<LayoutUnit>); > >- std::optional<LayoutUnit> availableSpace(GridTrackSizingDirection direction) const { return direction == ForColumns ? m_availableSpaceColumns : m_availableSpaceRows; } >- void setAvailableSpace(GridTrackSizingDirection, std::optional<LayoutUnit>); >+ Optional<LayoutUnit> availableSpace(GridTrackSizingDirection direction) const { return direction == ForColumns ? m_availableSpaceColumns : m_availableSpaceRows; } >+ void setAvailableSpace(GridTrackSizingDirection, Optional<LayoutUnit>); > > LayoutUnit computeTrackBasedSize() const; > >@@ -135,7 +135,7 @@ public: > #endif > > private: >- std::optional<LayoutUnit> availableSpace() const; >+ Optional<LayoutUnit> availableSpace() const; > bool isRelativeGridLengthAsAuto(const GridLength&, GridTrackSizingDirection) const; > GridTrackSize gridTrackSize(GridTrackSizingDirection, unsigned translatedIndex) const; > const GridTrackSize& rawGridTrackSize(GridTrackSizingDirection, unsigned translatedIndex) const; >@@ -173,7 +173,7 @@ private: > // method at thise level. > void initializeTrackSizes(); > void resolveIntrinsicTrackSizes(); >- void stretchFlexibleTracks(std::optional<LayoutUnit> freeSpace); >+ void stretchFlexibleTracks(Optional<LayoutUnit> freeSpace); > void stretchAutoTracks(); > > // State machine. >@@ -184,11 +184,11 @@ private: > bool wasSetup() const { return !!m_strategy; } > bool m_needsSetup { true }; > bool m_hasPercentSizedRowsIndefiniteHeight { false }; >- std::optional<LayoutUnit> m_availableSpaceRows; >- std::optional<LayoutUnit> m_availableSpaceColumns; >+ Optional<LayoutUnit> m_availableSpaceRows; >+ Optional<LayoutUnit> m_availableSpaceColumns; > >- std::optional<LayoutUnit> m_freeSpaceColumns; >- std::optional<LayoutUnit> m_freeSpaceRows; >+ Optional<LayoutUnit> m_freeSpaceColumns; >+ Optional<LayoutUnit> m_freeSpaceRows; > > // We need to keep both alive in order to properly size grids with orthogonal > // writing modes. >@@ -249,8 +249,8 @@ public: > > virtual ~GridTrackSizingAlgorithmStrategy() = default; > >- virtual void maximizeTracks(Vector<GridTrack>&, std::optional<LayoutUnit>& freeSpace) = 0; >- virtual double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, std::optional<LayoutUnit> initialFreeSpace) const = 0; >+ virtual void maximizeTracks(Vector<GridTrack>&, Optional<LayoutUnit>& freeSpace) = 0; >+ virtual double findUsedFlexFraction(Vector<unsigned>& flexibleSizedTracksIndex, GridTrackSizingDirection, Optional<LayoutUnit> initialFreeSpace) const = 0; > virtual bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const = 0; > virtual LayoutUnit freeSpaceForStretchAutoTracksStep() const = 0; > >@@ -262,7 +262,7 @@ protected: > virtual void layoutGridItemForMinSizeComputation(RenderBox&, bool overrideSizeHasChanged) const = 0; > > LayoutUnit logicalHeightForChild(RenderBox&) const; >- bool updateOverrideContainingBlockContentSizeForChild(RenderBox&, GridTrackSizingDirection, std::optional<LayoutUnit> = std::nullopt) const; >+ bool updateOverrideContainingBlockContentSizeForChild(RenderBox&, GridTrackSizingDirection, Optional<LayoutUnit> = WTF::nullopt) const; > > GridTrackSize gridTrackSize(GridTrackSizingDirection direction, size_t translatedIndex) const { return m_algorithm.gridTrackSize(direction, translatedIndex); } > >@@ -272,7 +272,7 @@ protected: > double findFrUnitSize(const GridSpan& tracksSpan, LayoutUnit leftOverSpace) const { return m_algorithm.findFrUnitSize(tracksSpan, leftOverSpace); } > void distributeSpaceToTracks(Vector<GridTrack*>& tracks, LayoutUnit& availableLogicalSpace) const { m_algorithm.distributeSpaceToTracks<MaximizeTracks>(tracks, nullptr, availableLogicalSpace); } > const RenderGrid* renderGrid() const { return m_algorithm.m_renderGrid; } >- std::optional<LayoutUnit> availableSpace() const { return m_algorithm.availableSpace(); } >+ Optional<LayoutUnit> availableSpace() const { return m_algorithm.availableSpace(); } > > GridTrackSizingAlgorithm& m_algorithm; > }; >diff --git a/Source/WebCore/rendering/HitTestingTransformState.cpp b/Source/WebCore/rendering/HitTestingTransformState.cpp >index 6316b3a82f786cc43a6c908324124be6f2edc3d1..ff90450b81e217da905259a8948f0c1d6a8c6918 100644 >--- a/Source/WebCore/rendering/HitTestingTransformState.cpp >+++ b/Source/WebCore/rendering/HitTestingTransformState.cpp >@@ -55,7 +55,7 @@ void HitTestingTransformState::flatten() > > void HitTestingTransformState::flattenWithTransform(const TransformationMatrix& t) > { >- if (std::optional<TransformationMatrix> inverse = t.inverse()) { >+ if (Optional<TransformationMatrix> inverse = t.inverse()) { > m_lastPlanarPoint = inverse.value().projectPoint(m_lastPlanarPoint); > m_lastPlanarQuad = inverse.value().projectQuad(m_lastPlanarQuad); > m_lastPlanarArea = inverse.value().projectQuad(m_lastPlanarArea); >diff --git a/Source/WebCore/rendering/ImageQualityController.cpp b/Source/WebCore/rendering/ImageQualityController.cpp >index f3dbef95f7d98bb0a4f039d6cd4592f7e321963c..6d509bbc25fc08159500d9bd95324ae3e2ae5589 100644 >--- a/Source/WebCore/rendering/ImageQualityController.cpp >+++ b/Source/WebCore/rendering/ImageQualityController.cpp >@@ -97,7 +97,7 @@ void ImageQualityController::restartTimer() > m_timer.startOneShot(lowQualityTimeThreshold); > } > >-std::optional<InterpolationQuality> ImageQualityController::interpolationQualityFromStyle(const RenderStyle& style) >+Optional<InterpolationQuality> ImageQualityController::interpolationQualityFromStyle(const RenderStyle& style) > { > switch (style.imageRendering()) { > case ImageRendering::OptimizeSpeed: >@@ -110,7 +110,7 @@ std::optional<InterpolationQuality> ImageQualityController::interpolationQuality > case ImageRendering::Auto: > break; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > InterpolationQuality ImageQualityController::chooseInterpolationQuality(GraphicsContext& context, RenderBoxModelObject* object, Image& image, const void* layer, const LayoutSize& size) >@@ -119,7 +119,7 @@ InterpolationQuality ImageQualityController::chooseInterpolationQuality(Graphics > if (!(image.isBitmapImage() || image.isPDFDocumentImage()) || context.paintingDisabled()) > return InterpolationDefault; > >- if (std::optional<InterpolationQuality> styleInterpolation = interpolationQualityFromStyle(object->style())) >+ if (Optional<InterpolationQuality> styleInterpolation = interpolationQualityFromStyle(object->style())) > return styleInterpolation.value(); > > // Make sure to use the unzoomed image size, since if a full page zoom is in effect, the image >diff --git a/Source/WebCore/rendering/ImageQualityController.h b/Source/WebCore/rendering/ImageQualityController.h >index eb4f1535be4b3d68d6a446fca5643749bd24b268..2b1a4456e141a2e02d689321d84d0cf803e8c6d2 100644 >--- a/Source/WebCore/rendering/ImageQualityController.h >+++ b/Source/WebCore/rendering/ImageQualityController.h >@@ -44,7 +44,7 @@ class ImageQualityController { > public: > explicit ImageQualityController(const RenderView&); > >- static std::optional<InterpolationQuality> interpolationQualityFromStyle(const RenderStyle&); >+ static Optional<InterpolationQuality> interpolationQualityFromStyle(const RenderStyle&); > InterpolationQuality chooseInterpolationQuality(GraphicsContext&, RenderBoxModelObject*, Image&, const void* layer, const LayoutSize&); > > void rendererWillBeDestroyed(RenderBoxModelObject& renderer) { removeObject(&renderer); } >diff --git a/Source/WebCore/rendering/InlineFlowBox.cpp b/Source/WebCore/rendering/InlineFlowBox.cpp >index 853bccbd55e808ef049e40a5aedbd195d0073674..1ef25ad1796be493eb56cf5757705af73dcbbf74 100644 >--- a/Source/WebCore/rendering/InlineFlowBox.cpp >+++ b/Source/WebCore/rendering/InlineFlowBox.cpp >@@ -705,7 +705,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei > } > } > if (is<InlineTextBox>(*child)) { >- if (std::optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle)) { >+ if (Optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle)) { > if (*markExistsAndIsAbove != childLineStyle.isFlippedLinesWritingMode()) > hasAnnotationsBefore = true; > else >@@ -900,7 +900,7 @@ inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox& textBox, Glyp > int leftGlyphOverflow = -strokeOverflow - leftGlyphEdge; > int rightGlyphOverflow = strokeOverflow + rightGlyphEdge; > >- if (std::optional<bool> markExistsAndIsAbove = textBox.emphasisMarkExistsAndIsAbove(lineStyle)) { >+ if (Optional<bool> markExistsAndIsAbove = textBox.emphasisMarkExistsAndIsAbove(lineStyle)) { > int emphasisMarkHeight = lineStyle.fontCascade().emphasisMarkHeight(lineStyle.textEmphasisMarkString()); > if (*markExistsAndIsAbove == !lineStyle.isFlippedLinesWritingMode()) > topGlyphOverflow = std::min(topGlyphOverflow, -emphasisMarkHeight); >@@ -1591,7 +1591,7 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi > > if (is<InlineTextBox>(*child)) { > const RenderStyle& childLineStyle = child->lineStyle(); >- std::optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle); >+ Optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle); > if (markExistsAndIsAbove && *markExistsAndIsAbove) { > if (!childLineStyle.isFlippedLinesWritingMode()) { > int topOfEmphasisMark = child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); >@@ -1639,7 +1639,7 @@ LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPos > > if (is<InlineTextBox>(*child)) { > const RenderStyle& childLineStyle = child->lineStyle(); >- std::optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle); >+ Optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle); > if (markExistsAndIsAbove && !*markExistsAndIsAbove) { > if (!childLineStyle.isFlippedLinesWritingMode()) { > LayoutUnit bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); >diff --git a/Source/WebCore/rendering/InlineIterator.h b/Source/WebCore/rendering/InlineIterator.h >index fb9e5af1a62ae5b3307a66023a739e068de6839a..8aef3c40ff89a05bb31a42f839d582c1fd0146a6 100644 >--- a/Source/WebCore/rendering/InlineIterator.h >+++ b/Source/WebCore/rendering/InlineIterator.h >@@ -74,7 +74,7 @@ public: > moveTo(object, 0); > } > >- void moveTo(RenderObject& object, unsigned offset, std::optional<unsigned> nextBreak = std::optional<unsigned>()) >+ void moveTo(RenderObject& object, unsigned offset, Optional<unsigned> nextBreak = Optional<unsigned>()) > { > setRenderer(&object); > setOffset(offset); >@@ -86,8 +86,8 @@ public: > unsigned offset() const { return m_pos; } > void setOffset(unsigned position); > RenderElement* root() const { return m_root; } >- std::optional<unsigned> nextBreakablePosition() const { return m_nextBreakablePosition; } >- void setNextBreakablePosition(std::optional<unsigned> position) { m_nextBreakablePosition = position; } >+ Optional<unsigned> nextBreakablePosition() const { return m_nextBreakablePosition; } >+ void setNextBreakablePosition(Optional<unsigned> position) { m_nextBreakablePosition = position; } > bool refersToEndOfPreviousNode() const { return m_refersToEndOfPreviousNode; } > void setRefersToEndOfPreviousNode(); > >@@ -118,7 +118,7 @@ private: > RenderElement* m_root { nullptr }; > RenderObject* m_renderer { nullptr }; > >- std::optional<unsigned> m_nextBreakablePosition; >+ Optional<unsigned> m_nextBreakablePosition; > unsigned m_pos { 0 }; > > // There are a couple places where we want to decrement an InlineIterator. >diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp >index 1d01090b11fba959f1d09acf63c355616c1c2ef3..c49ca3d84709a4500497cc7034440df7da2a8ac1 100644 >--- a/Source/WebCore/rendering/InlineTextBox.cpp >+++ b/Source/WebCore/rendering/InlineTextBox.cpp >@@ -364,11 +364,11 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re > return false; > } > >-std::optional<bool> InlineTextBox::emphasisMarkExistsAndIsAbove(const RenderStyle& style) const >+Optional<bool> InlineTextBox::emphasisMarkExistsAndIsAbove(const RenderStyle& style) const > { > // This function returns true if there are text emphasis marks and they are suppressed by ruby text. > if (style.textEmphasisMark() == TextEmphasisMark::None) >- return std::nullopt; >+ return WTF::nullopt; > > const OptionSet<TextEmphasisPosition> horizontalMask { TextEmphasisPosition::Left, TextEmphasisPosition::Right }; > >@@ -400,7 +400,7 @@ std::optional<bool> InlineTextBox::emphasisMarkExistsAndIsAbove(const RenderStyl > > // The emphasis marks over are suppressed only if there is a ruby text box and it not empty. > if (rubyText && rubyText->hasLines()) >- return std::nullopt; >+ return WTF::nullopt; > > return isAbove; > } >@@ -422,7 +422,7 @@ struct InlineTextBox::MarkedTextStyle { > Color backgroundColor; > TextPaintStyle textStyles; > TextDecorationPainter::Styles textDecorationStyles; >- std::optional<ShadowData> textShadow; >+ Optional<ShadowData> textShadow; > float alpha; > }; > >@@ -1031,7 +1031,7 @@ void InlineTextBox::paintMarkedTextForeground(PaintInfo& paintInfo, const FloatR > const RenderStyle& lineStyle = this->lineStyle(); > > float emphasisMarkOffset = 0; >- std::optional<bool> markExistsAndIsAbove = emphasisMarkExistsAndIsAbove(lineStyle); >+ Optional<bool> markExistsAndIsAbove = emphasisMarkExistsAndIsAbove(lineStyle); > const AtomicString& emphasisMark = markExistsAndIsAbove ? lineStyle.textEmphasisMarkString() : nullAtom(); > if (!emphasisMark.isEmpty()) > emphasisMarkOffset = *markExistsAndIsAbove ? -font.fontMetrics().ascent() - font.emphasisMarkDescent(emphasisMark) : font.fontMetrics().descent() + font.emphasisMarkAscent(emphasisMark); >diff --git a/Source/WebCore/rendering/InlineTextBox.h b/Source/WebCore/rendering/InlineTextBox.h >index ae77a66986ae8b260977087c609c2bba2a0f0991..52348a501c9d0189332d2188a26e421ca7c03bcb 100644 >--- a/Source/WebCore/rendering/InlineTextBox.h >+++ b/Source/WebCore/rendering/InlineTextBox.h >@@ -94,7 +94,7 @@ public: > int baselinePosition(FontBaseline) const final; > LayoutUnit lineHeight() const final; > >- std::optional<bool> emphasisMarkExistsAndIsAbove(const RenderStyle&) const; >+ Optional<bool> emphasisMarkExistsAndIsAbove(const RenderStyle&) const; > > LayoutRect logicalOverflowRect() const; > void setLogicalOverflowRect(const LayoutRect&); >diff --git a/Source/WebCore/rendering/MarkedText.cpp b/Source/WebCore/rendering/MarkedText.cpp >index 499bd12fefbcd44ff55529c3b96bafe69048ba8a..a79192e28ae1999686b62657c890f57b2c84e562 100644 >--- a/Source/WebCore/rendering/MarkedText.cpp >+++ b/Source/WebCore/rendering/MarkedText.cpp >@@ -68,7 +68,7 @@ Vector<MarkedText> subdivide(const Vector<MarkedText>& markedTexts, OverlapStrat > for (unsigned i = 1; i < numberOfOffsets; ++i) { > if (offsets[i].value > offsets[i - 1].value) { > if (overlapStrategy == OverlapStrategy::Frontmost) { >- std::optional<unsigned> frontmost; >+ Optional<unsigned> frontmost; > for (unsigned j = 0; j < i; ++j) { > if (!processedMarkedTexts.contains(offsets[j].markedText) && (!frontmost || offsets[j].markedText->type > offsets[*frontmost].markedText->type)) > frontmost = j; >diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp >index 547299e6edc918e2043834d07221d390acf13652..3909c5a3697eacf289b289800b679f9c07d78f7e 100644 >--- a/Source/WebCore/rendering/RenderBlock.cpp >+++ b/Source/WebCore/rendering/RenderBlock.cpp >@@ -257,7 +257,7 @@ public: > LayoutUnit m_pageLogicalOffset; > LayoutUnit m_intrinsicBorderForFieldset; > >- std::optional<WeakPtr<RenderFragmentedFlow>> m_enclosingFragmentedFlow; >+ Optional<WeakPtr<RenderFragmentedFlow>> m_enclosingFragmentedFlow; > }; > > typedef HashMap<const RenderBlock*, std::unique_ptr<RenderBlockRareData>> RenderBlockRareDataMap; >@@ -2382,16 +2382,16 @@ void RenderBlock::computeChildPreferredLogicalWidths(RenderObject& child, Layout > > // The preferred widths of flexbox children should never depend on override sizes. They should > // always be computed without regard for any overrides that are present. >- std::optional<LayoutUnit> overrideHeight; >- std::optional<LayoutUnit> overrideWidth; >+ Optional<LayoutUnit> overrideHeight; >+ Optional<LayoutUnit> overrideWidth; > > if (child.isBox()) { > auto& box = downcast<RenderBox>(child); > if (box.isFlexItem()) { > if (box.hasOverrideContentLogicalHeight()) >- overrideHeight = std::optional<LayoutUnit>(box.overrideContentLogicalHeight()); >+ overrideHeight = Optional<LayoutUnit>(box.overrideContentLogicalHeight()); > if (box.hasOverrideContentLogicalWidth()) >- overrideWidth = std::optional<LayoutUnit>(box.overrideContentLogicalWidth()); >+ overrideWidth = Optional<LayoutUnit>(box.overrideContentLogicalWidth()); > box.clearOverrideContentSize(); > } > } >@@ -2470,7 +2470,7 @@ int RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, Lin > bool ignoreBaseline = (layer() && (layer()->marquee() || (direction == HorizontalLine ? (layer()->verticalScrollbar() || layer()->scrollOffset().y() != 0) > : (layer()->horizontalScrollbar() || layer()->scrollOffset().x() != 0)))) || (isWritingModeRoot() && !isRubyRun()); > >- std::optional<int> baselinePos = ignoreBaseline ? std::optional<int>() : inlineBlockBaseline(direction); >+ Optional<int> baselinePos = ignoreBaseline ? Optional<int>() : inlineBlockBaseline(direction); > > if (isDeprecatedFlexibleBox()) { > // Historically, we did this check for all baselines. But we can't >@@ -2480,7 +2480,7 @@ int RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, Lin > // For simplicity, we use this for all uses of deprecated flexbox. > LayoutUnit bottomOfContent = direction == HorizontalLine ? borderTop() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWidth(); > if (baselinePos && baselinePos.value() > bottomOfContent) >- baselinePos = std::optional<int>(); >+ baselinePos = Optional<int>(); > } > if (baselinePos) > return direction == HorizontalLine ? marginTop() + baselinePos.value() : marginRight() + baselinePos.value(); >@@ -2505,43 +2505,43 @@ LayoutUnit RenderBlock::minLineHeightForReplacedRenderer(bool isFirstLine, Layou > return std::max<LayoutUnit>(replacedHeight, lineHeight(isFirstLine, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes)); > } > >-std::optional<int> RenderBlock::firstLineBaseline() const >+Optional<int> RenderBlock::firstLineBaseline() const > { > if (isWritingModeRoot() && !isRubyRun()) >- return std::optional<int>(); >+ return Optional<int>(); > > for (RenderBox* curr = firstChildBox(); curr; curr = curr->nextSiblingBox()) { > if (!curr->isFloatingOrOutOfFlowPositioned()) { >- if (std::optional<int> result = curr->firstLineBaseline()) >- return std::optional<int>(curr->logicalTop() + result.value()); // Translate to our coordinate space. >+ if (Optional<int> result = curr->firstLineBaseline()) >+ return Optional<int>(curr->logicalTop() + result.value()); // Translate to our coordinate space. > } > } > >- return std::optional<int>(); >+ return Optional<int>(); > } > >-std::optional<int> RenderBlock::inlineBlockBaseline(LineDirectionMode lineDirection) const >+Optional<int> RenderBlock::inlineBlockBaseline(LineDirectionMode lineDirection) const > { > if (isWritingModeRoot() && !isRubyRun()) >- return std::optional<int>(); >+ return Optional<int>(); > > bool haveNormalFlowChild = false; > for (auto* box = lastChildBox(); box; box = box->previousSiblingBox()) { > if (box->isFloatingOrOutOfFlowPositioned()) > continue; > haveNormalFlowChild = true; >- if (std::optional<int> result = box->inlineBlockBaseline(lineDirection)) >- return std::optional<int>(box->logicalTop() + result.value()); // Translate to our coordinate space. >+ if (Optional<int> result = box->inlineBlockBaseline(lineDirection)) >+ return Optional<int>(box->logicalTop() + result.value()); // Translate to our coordinate space. > } > > if (!haveNormalFlowChild && hasLineIfEmpty()) { > auto& fontMetrics = firstLineStyle().fontMetrics(); >- return std::optional<int>(fontMetrics.ascent() >+ return Optional<int>(fontMetrics.ascent() > + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2 > + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight())); > } > >- return std::optional<int>(); >+ return Optional<int>(); > } > > static inline bool isRenderBlockFlowOrRenderButton(RenderElement& renderElement) >@@ -2674,7 +2674,7 @@ bool RenderBlock::cachedEnclosingFragmentedFlowNeedsUpdate() const > void RenderBlock::setCachedEnclosingFragmentedFlowNeedsUpdate() > { > RenderBlockRareData& rareData = ensureBlockRareData(*this); >- rareData.m_enclosingFragmentedFlow = std::nullopt; >+ rareData.m_enclosingFragmentedFlow = WTF::nullopt; > } > > RenderFragmentedFlow* RenderBlock::updateCachedEnclosingFragmentedFlow(RenderFragmentedFlow* fragmentedFlow) const >@@ -3159,9 +3159,9 @@ bool RenderBlock::hasDefiniteLogicalHeight() const > return (bool)availableLogicalHeightForPercentageComputation(); > } > >-std::optional<LayoutUnit> RenderBlock::availableLogicalHeightForPercentageComputation() const >+Optional<LayoutUnit> RenderBlock::availableLogicalHeightForPercentageComputation() const > { >- std::optional<LayoutUnit> availableHeight; >+ Optional<LayoutUnit> availableHeight; > > // For anonymous blocks that are skipped during percentage height calculation, > // we consider them to have an indefinite height. >@@ -3175,7 +3175,7 @@ std::optional<LayoutUnit> RenderBlock::availableLogicalHeightForPercentageComput > // that can be used for any percentage computations. > bool isOutOfFlowPositionedWithSpecifiedHeight = isOutOfFlowPositioned() && (!styleToUse.logicalHeight().isAuto() || (!styleToUse.logicalTop().isAuto() && !styleToUse.logicalBottom().isAuto())); > >- std::optional<LayoutUnit> stretchedFlexHeight; >+ Optional<LayoutUnit> stretchedFlexHeight; > if (isFlexItem()) > stretchedFlexHeight = downcast<RenderFlexibleBox>(parent())->childLogicalHeightForPercentageResolution(*this); > >@@ -3185,16 +3185,16 @@ std::optional<LayoutUnit> RenderBlock::availableLogicalHeightForPercentageComput > availableHeight = overrideContentLogicalHeight(); > else if (styleToUse.logicalHeight().isFixed()) { > LayoutUnit contentBoxHeight = adjustContentBoxLogicalHeightForBoxSizing((LayoutUnit)styleToUse.logicalHeight().value()); >- availableHeight = std::max(0_lu, constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - scrollbarLogicalHeight(), std::nullopt)); >+ availableHeight = std::max(0_lu, constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - scrollbarLogicalHeight(), WTF::nullopt)); > } else if (styleToUse.logicalHeight().isPercentOrCalculated() && !isOutOfFlowPositionedWithSpecifiedHeight) { >- std::optional<LayoutUnit> heightWithScrollbar = computePercentageLogicalHeight(styleToUse.logicalHeight()); >+ Optional<LayoutUnit> heightWithScrollbar = computePercentageLogicalHeight(styleToUse.logicalHeight()); > if (heightWithScrollbar) { > LayoutUnit contentBoxHeightWithScrollbar = adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar.value()); > // We need to adjust for min/max height because this method does not > // handle the min/max of the current block, its caller does. So the > // return value from the recursive call will not have been adjusted > // yet. >- LayoutUnit contentBoxHeight = constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - scrollbarLogicalHeight(), std::nullopt); >+ LayoutUnit contentBoxHeight = constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - scrollbarLogicalHeight(), WTF::nullopt); > availableHeight = std::max(0_lu, contentBoxHeight); > } > } else if (isOutOfFlowPositionedWithSpecifiedHeight) { >@@ -3442,7 +3442,7 @@ LayoutUnit RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit heig > return std::max(height, bordersPlusPadding); > } > >-LayoutUnit RenderBlock::adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit> height) const >+LayoutUnit RenderBlock::adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit> height) const > { > // FIXME: We're doing this to match other browsers even though it's questionable. > // Shouldn't height:100px mean the fieldset content gets 100px of height even if the >diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h >index f2667085b2b59b265adc4886c0db1a0844d327c1..fd74af17824db3f7f9c240f2ed64a7dd352f7d39 100644 >--- a/Source/WebCore/rendering/RenderBlock.h >+++ b/Source/WebCore/rendering/RenderBlock.h >@@ -231,7 +231,7 @@ public: > LayoutUnit borderRight() const override; > LayoutUnit borderBefore() const override; > LayoutUnit adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const override; >- LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit> height) const override; >+ LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit> height) const override; > void paintExcludedChildrenInBorder(PaintInfo&, const LayoutPoint&); > > // Accessors for logical width/height and margins in the containing block's block-flow direction. >@@ -315,7 +315,7 @@ public: > virtual bool cachedEnclosingFragmentedFlowNeedsUpdate() const; > void resetEnclosingFragmentedFlowAndChildInfoIncludingDescendants(RenderFragmentedFlow* = nullptr) final; > >- std::optional<LayoutUnit> availableLogicalHeightForPercentageComputation() const; >+ Optional<LayoutUnit> availableLogicalHeightForPercentageComputation() const; > bool hasDefiniteLogicalHeight() const; > > protected: >@@ -351,8 +351,8 @@ protected: > void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override; > void computePreferredLogicalWidths() override; > >- std::optional<int> firstLineBaseline() const override; >- std::optional<int> inlineBlockBaseline(LineDirectionMode) const override; >+ Optional<int> firstLineBaseline() const override; >+ Optional<int> inlineBlockBaseline(LineDirectionMode) const override; > > // Delay updating scrollbars until endAndCommitUpdateScrollInfoAfterLayoutTransaction() is called. These functions are used > // when a flexbox is laying out its descendants. If multiple calls are made to beginUpdateScrollInfoAfterLayoutTransaction() >diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp >index 2df8068df84bc65cf91b103f460d34e7d3a8a339..0ecf11fa2a62e80af165ea09abfbce021dce501c 100644 >--- a/Source/WebCore/rendering/RenderBlockFlow.cpp >+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp >@@ -404,7 +404,7 @@ void RenderBlockFlow::computeColumnCountAndWidth() > setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth); > } > >-bool RenderBlockFlow::willCreateColumns(std::optional<unsigned> desiredColumnCount) const >+bool RenderBlockFlow::willCreateColumns(Optional<unsigned> desiredColumnCount) const > { > // The following types are not supposed to create multicol context. > if (isFileUploadControl() || isTextControl() || isListBox()) >@@ -2998,19 +2998,19 @@ void RenderBlockFlow::markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUn > } > } > >-std::optional<int> RenderBlockFlow::firstLineBaseline() const >+Optional<int> RenderBlockFlow::firstLineBaseline() const > { > if (isWritingModeRoot() && !isRubyRun() && !isGridItem()) >- return std::nullopt; >+ return WTF::nullopt; > > if (!childrenInline()) > return RenderBlock::firstLineBaseline(); > > if (!hasLines()) >- return std::nullopt; >+ return WTF::nullopt; > > if (auto simpleLineLayout = this->simpleLineLayout()) >- return std::optional<int>(SimpleLineLayout::computeFlowFirstLineBaseline(*this, *simpleLineLayout)); >+ return Optional<int>(SimpleLineLayout::computeFlowFirstLineBaseline(*this, *simpleLineLayout)); > > ASSERT(firstRootBox()); > if (style().isFlippedLinesWritingMode()) >@@ -3018,25 +3018,25 @@ std::optional<int> RenderBlockFlow::firstLineBaseline() const > return firstRootBox()->logicalTop() + firstLineStyle().fontMetrics().ascent(firstRootBox()->baselineType()); > } > >-std::optional<int> RenderBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirection) const >+Optional<int> RenderBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirection) const > { > if (isWritingModeRoot() && !isRubyRun()) >- return std::nullopt; >+ return WTF::nullopt; > > // Note that here we only take the left and bottom into consideration. Our caller takes the right and top into consideration. > float boxHeight = lineDirection == HorizontalLine ? height() + m_marginBox.bottom() : width() + m_marginBox.left(); > float lastBaseline; > if (!childrenInline()) { >- std::optional<int> inlineBlockBaseline = RenderBlock::inlineBlockBaseline(lineDirection); >+ Optional<int> inlineBlockBaseline = RenderBlock::inlineBlockBaseline(lineDirection); > if (!inlineBlockBaseline) > return inlineBlockBaseline; > lastBaseline = inlineBlockBaseline.value(); > } else { > if (!hasLines()) { > if (!hasLineIfEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > const auto& fontMetrics = firstLineStyle().fontMetrics(); >- return std::optional<int>(fontMetrics.ascent() >+ return Optional<int>(fontMetrics.ascent() > + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2 > + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight())); > } >diff --git a/Source/WebCore/rendering/RenderBlockFlow.h b/Source/WebCore/rendering/RenderBlockFlow.h >index 4e40b114d84e0d2de47d70b168f06a00a75bc1b3..bdbbe3ceb5f7fb6450a16819ced5669ce13c7410 100644 >--- a/Source/WebCore/rendering/RenderBlockFlow.h >+++ b/Source/WebCore/rendering/RenderBlockFlow.h >@@ -267,7 +267,7 @@ public: > RenderMultiColumnFlow* multiColumnFlow() const { return hasRareBlockFlowData() ? rareBlockFlowData()->m_multiColumnFlow.get() : nullptr; } > void setMultiColumnFlow(RenderMultiColumnFlow&); > void clearMultiColumnFlow(); >- bool willCreateColumns(std::optional<unsigned> desiredColumnCount = std::nullopt) const; >+ bool willCreateColumns(Optional<unsigned> desiredColumnCount = WTF::nullopt) const; > virtual bool requiresColumns(int) const; > > bool containsFloats() const override { return m_floatingObjects && !m_floatingObjects->set().isEmpty(); } >@@ -438,8 +438,8 @@ protected: > > void createFloatingObjects(); > >- std::optional<int> firstLineBaseline() const override; >- std::optional<int> inlineBlockBaseline(LineDirectionMode) const override; >+ Optional<int> firstLineBaseline() const override; >+ Optional<int> inlineBlockBaseline(LineDirectionMode) const override; > > bool isMultiColumnBlockFlow() const override { return multiColumnFlow(); } > >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index c0f3ff08271a4ef4fb6b178e0def6015b9279405..aa737e490a4884f5ae2fc6f06ee4fa606df573df 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -98,7 +98,7 @@ static OverrideSizeMap* gOverrideContentLogicalHeightMap = nullptr; > static OverrideSizeMap* gOverrideContentLogicalWidthMap = nullptr; > > // Used by grid elements to properly size their grid items. >-typedef WTF::HashMap<const RenderBox*, std::optional<LayoutUnit>> OverrideOptionalSizeMap; >+typedef WTF::HashMap<const RenderBox*, Optional<LayoutUnit>> OverrideOptionalSizeMap; > static OverrideOptionalSizeMap* gOverrideContainingBlockContentLogicalHeightMap = nullptr; > static OverrideOptionalSizeMap* gOverrideContainingBlockContentLogicalWidthMap = nullptr; > >@@ -621,26 +621,26 @@ LayoutUnit RenderBox::constrainLogicalWidthInFragmentByMinMax(LayoutUnit logical > return std::max(logicalWidth, computeLogicalWidthInFragmentUsing(MinSize, styleToUse.logicalMinWidth(), availableWidth, cb, fragment)); > } > >-LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const >+LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const > { > const RenderStyle& styleToUse = style(); > if (!styleToUse.logicalMaxHeight().isUndefined()) { >- if (std::optional<LayoutUnit> maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight)) >+ if (Optional<LayoutUnit> maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight)) > logicalHeight = std::min(logicalHeight, maxH.value()); > } >- if (std::optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight)) >+ if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight)) > return std::max(logicalHeight, computedLogicalHeight.value()); > return logicalHeight; > } > >-LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const >+LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const > { > const RenderStyle& styleToUse = style(); > if (!styleToUse.logicalMaxHeight().isUndefined()) { >- if (std::optional<LayoutUnit> maxH = computeContentLogicalHeight(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight)) >+ if (Optional<LayoutUnit> maxH = computeContentLogicalHeight(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight)) > logicalHeight = std::min(logicalHeight, maxH.value()); > } >- if (std::optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight)) >+ if (Optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight)) > return std::max(logicalHeight, computedContentLogicalHeight.value()); > return logicalHeight; > } >@@ -1086,13 +1086,13 @@ LayoutUnit RenderBox::overrideContentLogicalHeight() const > return gOverrideContentLogicalHeightMap->get(this); > } > >-std::optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalWidth() const >+Optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalWidth() const > { > ASSERT(hasOverrideContainingBlockContentLogicalWidth()); > return gOverrideContainingBlockContentLogicalWidthMap->get(this); > } > >-std::optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalHeight() const >+Optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalHeight() const > { > ASSERT(hasOverrideContainingBlockContentLogicalHeight()); > return gOverrideContainingBlockContentLogicalHeightMap->get(this); >@@ -1108,14 +1108,14 @@ bool RenderBox::hasOverrideContainingBlockContentLogicalHeight() const > return gOverrideContainingBlockContentLogicalHeightMap && gOverrideContainingBlockContentLogicalHeightMap->contains(this); > } > >-void RenderBox::setOverrideContainingBlockContentLogicalWidth(std::optional<LayoutUnit> logicalWidth) >+void RenderBox::setOverrideContainingBlockContentLogicalWidth(Optional<LayoutUnit> logicalWidth) > { > if (!gOverrideContainingBlockContentLogicalWidthMap) > gOverrideContainingBlockContentLogicalWidthMap = new OverrideOptionalSizeMap; > gOverrideContainingBlockContentLogicalWidthMap->set(this, logicalWidth); > } > >-void RenderBox::setOverrideContainingBlockContentLogicalHeight(std::optional<LayoutUnit> logicalHeight) >+void RenderBox::setOverrideContainingBlockContentLogicalHeight(Optional<LayoutUnit> logicalHeight) > { > if (!gOverrideContainingBlockContentLogicalHeightMap) > gOverrideContainingBlockContentLogicalHeightMap = new OverrideOptionalSizeMap; >@@ -1158,7 +1158,7 @@ LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) > return std::max<LayoutUnit>(0, width); > } > >-LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit> height) const >+LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit> height) const > { > if (!height) > return 0; >@@ -2158,7 +2158,7 @@ LayoutRect RenderBox::computeVisibleRectUsingPaintOffset(const LayoutRect& rect) > return adjustedRect; > } > >-std::optional<LayoutRect> RenderBox::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<LayoutRect> RenderBox::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > // The rect we compute at each step is shifted by our x/y offset in the parent container's coordinate space. > // Only when we cross a writing mode boundary will we have to possibly flipForWritingMode (to convert into a more appropriate >@@ -2263,7 +2263,7 @@ std::optional<LayoutRect> RenderBox::computeVisibleRectInContainer(const LayoutR > bool isEmpty = !containerBox.applyCachedClipAndScrollPosition(adjustedRect, container, context); > if (isEmpty) { > if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >- return std::nullopt; >+ return WTF::nullopt; > return adjustedRect; > } > } >@@ -2803,21 +2803,21 @@ LayoutUnit RenderBox::computeLogicalHeightWithoutLayout() const > return computedValues.m_extent; > } > >-std::optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const >+Optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const > { >- if (std::optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight)) >+ if (Optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight)) > return adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight.value()); >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<LayoutUnit> RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const >+Optional<LayoutUnit> RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const > { >- if (std::optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight)) >+ if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight)) > return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight()); >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<LayoutUnit> RenderBox::computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const >+Optional<LayoutUnit> RenderBox::computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, Optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const > { > // FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to. > // If that happens, this code will have to change. >@@ -2834,10 +2834,10 @@ std::optional<LayoutUnit> RenderBox::computeIntrinsicLogicalContentHeightUsing(L > return 0_lu; > } > >-std::optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const >+Optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const > { > if (height.isAuto()) >- return heightType == MinSize ? std::optional<LayoutUnit>(0) : std::nullopt; >+ return heightType == MinSize ? Optional<LayoutUnit>(0) : WTF::nullopt; > // FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to. > // If that happens, this code will have to change. > if (height.isIntrinsic()) >@@ -2846,7 +2846,7 @@ std::optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsin > return LayoutUnit(height.value()); > if (height.isPercentOrCalculated()) > return computePercentageLogicalHeight(height); >- return std::nullopt; >+ return WTF::nullopt; > } > > bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox& containingBlock, bool isPerpendicularWritingMode) const >@@ -2901,9 +2901,9 @@ static bool tableCellShouldHaveZeroInitialSize(const RenderBlock& block, const R > return scrollsOverflowY && !child.shouldTreatChildAsReplacedInTableCells() && (!cell.style().logicalHeight().isAuto() || !cell.table()->style().logicalHeight().isAuto()); > } > >-std::optional<LayoutUnit> RenderBox::computePercentageLogicalHeight(const Length& height) const >+Optional<LayoutUnit> RenderBox::computePercentageLogicalHeight(const Length& height) const > { >- std::optional<LayoutUnit> availableHeight; >+ Optional<LayoutUnit> availableHeight; > > bool skippedAutoHeightContainingBlock = false; > RenderBlock* cb = containingBlock(); >@@ -2929,7 +2929,7 @@ std::optional<LayoutUnit> RenderBox::computePercentageLogicalHeight(const Length > // don't care if the cell specified a height or not. We just always make ourselves > // be a percentage of the cell's current content height. > if (!cb->hasOverrideContentLogicalHeight()) >- return tableCellShouldHaveZeroInitialSize(*cb, *this, scrollsOverflowY()) ? std::optional<LayoutUnit>(0) : std::nullopt; >+ return tableCellShouldHaveZeroInitialSize(*cb, *this, scrollsOverflowY()) ? Optional<LayoutUnit>(0) : WTF::nullopt; > > availableHeight = cb->overrideContentLogicalHeight(); > } >@@ -3015,7 +3015,7 @@ LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType widthType, Lengt > return 0; > } > >-LayoutUnit RenderBox::computeReplacedLogicalHeight(std::optional<LayoutUnit>) const >+LayoutUnit RenderBox::computeReplacedLogicalHeight(Optional<LayoutUnit>) const > { > return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight())); > } >@@ -3065,7 +3065,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType heightType, Len > { > ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeight.isAuto()); > if (heightType == MinSize && logicalHeight.isAuto()) >- return adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit>(0)); >+ return adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit>(0)); > > switch (logicalHeight.type()) { > case Fixed: >@@ -3080,7 +3080,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType heightType, Len > break; > container = container->containingBlock(); > } >- std::optional<LayoutUnit> stretchedHeight; >+ Optional<LayoutUnit> stretchedHeight; > if (is<RenderBlock>(container)) { > auto* block = downcast<RenderBlock>(container); > block->addPercentHeightDescendant(*const_cast<RenderBox*>(this)); >@@ -3143,7 +3143,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType heightType, Len > > LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightType) const > { >- return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), std::nullopt); >+ return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), WTF::nullopt); > } > > LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const >@@ -3170,7 +3170,7 @@ LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi > return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, availableHeight)); > } > >- if (std::optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h, std::nullopt)) >+ if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h, WTF::nullopt)) > return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight()); > > // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical writing-mode. >@@ -4626,7 +4626,7 @@ bool RenderBox::percentageLogicalHeightIsResolvable() const > // Do this to avoid duplicating all the logic that already exists when computing > // an actual percentage height. > Length fakeLength(100, Percent); >- return computePercentageLogicalHeight(fakeLength) != std::nullopt; >+ return computePercentageLogicalHeight(fakeLength) != WTF::nullopt; > } > > bool RenderBox::hasUnsplittableScrollingOverflow() const >diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h >index db1094d69e57333f5bab39490ad2ab0da861bcc8..88d91714161eac1546cd235c9637c76d427838ce 100644 >--- a/Source/WebCore/rendering/RenderBox.h >+++ b/Source/WebCore/rendering/RenderBox.h >@@ -84,8 +84,8 @@ public: > LayoutUnit logicalHeight() const { return style().isHorizontalWritingMode() ? height() : width(); } > > LayoutUnit constrainLogicalWidthInFragmentByMinMax(LayoutUnit, LayoutUnit, RenderBlock&, RenderFragmentContainer* = nullptr) const; >- LayoutUnit constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const; >- LayoutUnit constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const; >+ LayoutUnit constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const; >+ LayoutUnit constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const; > > void setLogicalLeft(LayoutUnit left) > { >@@ -314,12 +314,12 @@ public: > void clearOverrideContentLogicalHeight(); > void clearOverrideContentLogicalWidth(); > >- std::optional<LayoutUnit> overrideContainingBlockContentLogicalWidth() const; >- std::optional<LayoutUnit> overrideContainingBlockContentLogicalHeight() const; >+ Optional<LayoutUnit> overrideContainingBlockContentLogicalWidth() const; >+ Optional<LayoutUnit> overrideContainingBlockContentLogicalHeight() const; > bool hasOverrideContainingBlockContentLogicalWidth() const; > bool hasOverrideContainingBlockContentLogicalHeight() const; >- void setOverrideContainingBlockContentLogicalWidth(std::optional<LayoutUnit>); >- void setOverrideContainingBlockContentLogicalHeight(std::optional<LayoutUnit>); >+ void setOverrideContainingBlockContentLogicalWidth(Optional<LayoutUnit>); >+ void setOverrideContainingBlockContentLogicalHeight(Optional<LayoutUnit>); > void clearOverrideContainingBlockContentSize(); > void clearOverrideContainingBlockContentLogicalHeight(); > >@@ -330,7 +330,7 @@ public: > > // Overridden by fieldsets to subtract out the intrinsic border. > virtual LayoutUnit adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const; >- virtual LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit> height) const; >+ virtual LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit> height) const; > > struct ComputedMarginValues { > LayoutUnit m_before; >@@ -371,7 +371,7 @@ public: > void deleteLineBoxWrapper(); > > LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >- std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const >+ Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const > override; > void repaintDuringLayoutIfMoved(const LayoutRect&); > virtual void repaintOverhangingFloats(bool paintAllDescendants); >@@ -421,18 +421,18 @@ override; > LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock& cb, RenderFragmentContainer*) const; > > LayoutUnit computeLogicalWidthInFragmentUsing(SizeType, Length logicalWidth, LayoutUnit availableLogicalWidth, const RenderBlock& containingBlock, RenderFragmentContainer*) const; >- std::optional<LayoutUnit> computeLogicalHeightUsing(SizeType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const; >- std::optional<LayoutUnit> computeContentLogicalHeight(SizeType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const; >- std::optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const; >+ Optional<LayoutUnit> computeLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const; >+ Optional<LayoutUnit> computeContentLogicalHeight(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const; >+ Optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const; > LayoutUnit computeReplacedLogicalWidthUsing(SizeType, Length width) const; > LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred = ComputeActual) const; > LayoutUnit computeReplacedLogicalHeightUsing(SizeType, Length height) const; > LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const; > > virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const; >- virtual LayoutUnit computeReplacedLogicalHeight(std::optional<LayoutUnit> estimatedUsedWidth = std::nullopt) const; >+ virtual LayoutUnit computeReplacedLogicalHeight(Optional<LayoutUnit> estimatedUsedWidth = WTF::nullopt) const; > >- std::optional<LayoutUnit> computePercentageLogicalHeight(const Length& height) const; >+ Optional<LayoutUnit> computePercentageLogicalHeight(const Length& height) const; > > virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); } > virtual LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const; >@@ -519,8 +519,8 @@ override; > > RenderLayer* enclosingFloatPaintingLayer() const; > >- virtual std::optional<int> firstLineBaseline() const { return std::optional<int>(); } >- virtual std::optional<int> inlineBlockBaseline(LineDirectionMode) const { return std::optional<int>(); } // Returns empty if we should skip this box when computing the baseline of an inline-block. >+ virtual Optional<int> firstLineBaseline() const { return Optional<int>(); } >+ virtual Optional<int> inlineBlockBaseline(LineDirectionMode) const { return Optional<int>(); } // Returns empty if we should skip this box when computing the baseline of an inline-block. > > bool shrinkToAvoidFloats() const; > virtual bool avoidsFloats() const; >@@ -660,7 +660,7 @@ protected: > void computePositionedLogicalWidth(LogicalExtentComputedValues&, RenderFragmentContainer* = nullptr) const; > > LayoutUnit computeIntrinsicLogicalWidthUsing(Length logicalWidthLength, LayoutUnit availableLogicalWidth, LayoutUnit borderAndPadding) const; >- virtual std::optional<LayoutUnit> computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const; >+ virtual Optional<LayoutUnit> computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, Optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const; > > virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); } > >diff --git a/Source/WebCore/rendering/RenderCombineText.cpp b/Source/WebCore/rendering/RenderCombineText.cpp >index cc86c3dd406e6e57d786987c704a8c6967236fad..15f1619168e76270288067856ce86f1c212f4ea2 100644 >--- a/Source/WebCore/rendering/RenderCombineText.cpp >+++ b/Source/WebCore/rendering/RenderCombineText.cpp >@@ -76,10 +76,10 @@ float RenderCombineText::width(unsigned from, unsigned length, const FontCascade > return RenderText::width(from, length, font, xPosition, fallbackFonts, glyphOverflow); > } > >-std::optional<FloatPoint> RenderCombineText::computeTextOrigin(const FloatRect& boxRect) const >+Optional<FloatPoint> RenderCombineText::computeTextOrigin(const FloatRect& boxRect) const > { > if (!m_isCombined) >- return std::nullopt; >+ return WTF::nullopt; > > // Visually center m_combinedTextWidth/Ascent/Descent within boxRect > FloatPoint result = boxRect.minXMaxYCorner(); >diff --git a/Source/WebCore/rendering/RenderCombineText.h b/Source/WebCore/rendering/RenderCombineText.h >index 15850f15a35f132cc6fee2a98babe30b1b1a5731..83b847532f450feece24453efe07846156824f49 100644 >--- a/Source/WebCore/rendering/RenderCombineText.h >+++ b/Source/WebCore/rendering/RenderCombineText.h >@@ -34,7 +34,7 @@ public: > Text& textNode() const { return downcast<Text>(nodeForNonAnonymous()); } > > void combineTextIfNeeded(); >- std::optional<FloatPoint> computeTextOrigin(const FloatRect& boxRect) const; >+ Optional<FloatPoint> computeTextOrigin(const FloatRect& boxRect) const; > String combinedStringForRendering() const; > bool isCombined() const { return m_isCombined; } > float combinedTextWidth(const FontCascade& font) const { return font.size(); } >diff --git a/Source/WebCore/rendering/RenderCounter.cpp b/Source/WebCore/rendering/RenderCounter.cpp >index 11e547bb6ab90b6e3aa3110de14534362c6726fb..150ac065abd893fcb71ec20f1cf26305f8a94ed4 100644 >--- a/Source/WebCore/rendering/RenderCounter.cpp >+++ b/Source/WebCore/rendering/RenderCounter.cpp >@@ -111,8 +111,8 @@ static CounterDirectives listItemCounterDirectives(RenderElement& renderer) > if (is<RenderListItem>(renderer)) { > auto& item = downcast<RenderListItem>(renderer); > if (auto explicitValue = item.explicitValue()) >- return { *explicitValue, std::nullopt }; >- return { std::nullopt, item.isInReversedOrderedList() ? -1 : 1 }; >+ return { *explicitValue, WTF::nullopt }; >+ return { WTF::nullopt, item.isInReversedOrderedList() ? -1 : 1 }; > } > if (auto element = renderer.element()) { > if (is<HTMLOListElement>(*element)) { >@@ -120,7 +120,7 @@ static CounterDirectives listItemCounterDirectives(RenderElement& renderer) > return { list.start(), list.isReversed() ? 1 : -1 }; > } > if (isHTMLListElement(*element)) >- return { 0, std::nullopt }; >+ return { 0, WTF::nullopt }; > } > return { }; > } >@@ -130,12 +130,12 @@ struct CounterPlan { > int value; > }; > >-static std::optional<CounterPlan> planCounter(RenderElement& renderer, const AtomicString& identifier) >+static Optional<CounterPlan> planCounter(RenderElement& renderer, const AtomicString& identifier) > { > // We must have a generating node or else we cannot have a counter. > Element* generatingElement = renderer.generatingElement(); > if (!generatingElement) >- return std::nullopt; >+ return WTF::nullopt; > > auto& style = renderer.style(); > >@@ -144,13 +144,13 @@ static std::optional<CounterPlan> planCounter(RenderElement& renderer, const Ato > // Sometimes elements have more then one renderer. Only the first one gets the counter > // LayoutTests/http/tests/css/counter-crash.html > if (generatingElement->renderer() != &renderer) >- return std::nullopt; >+ return WTF::nullopt; > break; > case PseudoId::Before: > case PseudoId::After: > break; > default: >- return std::nullopt; // Counters are forbidden from all other pseudo elements. >+ return WTF::nullopt; // Counters are forbidden from all other pseudo elements. > } > > CounterDirectives directives; >@@ -170,7 +170,7 @@ static std::optional<CounterPlan> planCounter(RenderElement& renderer, const Ato > return CounterPlan { true, saturatedAddition(*directives.resetValue, directives.incrementValue.value_or(0)) }; > if (directives.incrementValue) > return CounterPlan { false, *directives.incrementValue }; >- return std::nullopt; >+ return WTF::nullopt; > } > > // - Finds the insertion point for the counter described by counterOwner, isReset and >diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp >index 01bdf07e3e948694e1526d9af99557ac6023abf0..7949fbf3407f466fa66e5120f41a6f04d2ea978e 100644 >--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp >+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp >@@ -178,10 +178,10 @@ int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode di > return baseline + marginAscent; > } > >-std::optional<int> RenderFlexibleBox::firstLineBaseline() const >+Optional<int> RenderFlexibleBox::firstLineBaseline() const > { > if (isWritingModeRoot() || m_numberOfInFlowChildrenOnFirstLine <= 0) >- return std::optional<int>(); >+ return Optional<int>(); > RenderBox* baselineChild = nullptr; > int childNumber = 0; > for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) { >@@ -200,27 +200,27 @@ std::optional<int> RenderFlexibleBox::firstLineBaseline() const > } > > if (!baselineChild) >- return std::optional<int>(); >+ return Optional<int>(); > > if (!isColumnFlow() && hasOrthogonalFlow(*baselineChild)) >- return std::optional<int>(crossAxisExtentForChild(*baselineChild) + baselineChild->logicalTop()); >+ return Optional<int>(crossAxisExtentForChild(*baselineChild) + baselineChild->logicalTop()); > if (isColumnFlow() && !hasOrthogonalFlow(*baselineChild)) >- return std::optional<int>(mainAxisExtentForChild(*baselineChild) + baselineChild->logicalTop()); >+ return Optional<int>(mainAxisExtentForChild(*baselineChild) + baselineChild->logicalTop()); > >- std::optional<int> baseline = baselineChild->firstLineBaseline(); >+ Optional<int> baseline = baselineChild->firstLineBaseline(); > if (!baseline) { > // FIXME: We should pass |direction| into firstLineBoxBaseline and stop bailing out if we're a writing mode root. > // This would also fix some cases where the flexbox is orthogonal to its container. > LineDirectionMode direction = isHorizontalWritingMode() ? HorizontalLine : VerticalLine; >- return std::optional<int>(synthesizedBaselineFromContentBox(*baselineChild, direction) + baselineChild->logicalTop()); >+ return Optional<int>(synthesizedBaselineFromContentBox(*baselineChild, direction) + baselineChild->logicalTop()); > } > >- return std::optional<int>(baseline.value() + baselineChild->logicalTop()); >+ return Optional<int>(baseline.value() + baselineChild->logicalTop()); > } > >-std::optional<int> RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const >+Optional<int> RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const > { >- if (std::optional<int> baseline = firstLineBaseline()) >+ if (Optional<int> baseline = firstLineBaseline()) > return baseline; > > int marginAscent = direction == HorizontalLine ? marginTop() : marginRight(); >@@ -517,7 +517,7 @@ LayoutUnit RenderFlexibleBox::mainAxisContentExtent(LayoutUnit contentLogicalHei > return contentLogicalWidth(); > } > >-std::optional<LayoutUnit> RenderFlexibleBox::computeMainAxisExtentForChild(const RenderBox& child, SizeType sizeType, const Length& size) >+Optional<LayoutUnit> RenderFlexibleBox::computeMainAxisExtentForChild(const RenderBox& child, SizeType sizeType, const Length& size) > { > // If we have a horizontal flow, that means the main size is the width. > // That's the logical width for horizontal writing modes, and the logical >@@ -533,7 +533,7 @@ std::optional<LayoutUnit> RenderFlexibleBox::computeMainAxisExtentForChild(const > // if necessary (see ComputeNextFlexLine and the call to > // childHasIntrinsicMainAxisSize) so we can be sure that the two height > // calls here will return up-to-date data. >- std::optional<LayoutUnit> height = child.computeContentLogicalHeight(sizeType, size, cachedChildIntrinsicContentLogicalHeight(child)); >+ Optional<LayoutUnit> height = child.computeContentLogicalHeight(sizeType, size, cachedChildIntrinsicContentLogicalHeight(child)); > if (!height) > return height; > return height.value() + child.scrollbarLogicalHeight(); >@@ -733,7 +733,7 @@ LayoutUnit RenderFlexibleBox::computeMainSizeFromAspectRatioUsing(const RenderBo > ASSERT(child.hasAspectRatio()); > ASSERT(child.intrinsicSize().height()); > >- std::optional<LayoutUnit> crossSize; >+ Optional<LayoutUnit> crossSize; > if (crossSizeLength.isFixed()) > crossSize = LayoutUnit(crossSizeLength.value()); > else { >@@ -768,7 +768,7 @@ bool RenderFlexibleBox::mainAxisLengthIsDefinite(const RenderBox& child, const L > return true; > if (m_hasDefiniteHeight == SizeDefiniteness::Indefinite) > return false; >- bool definite = child.computePercentageLogicalHeight(flexBasis) != std::nullopt; >+ bool definite = child.computePercentageLogicalHeight(flexBasis) != WTF::nullopt; > if (m_inLayout) { > // We can reach this code even while we're not laying ourselves out, such > // as from mainSizeForPercentageResolution. >@@ -1071,7 +1071,7 @@ void RenderFlexibleBox::prepareOrderIteratorAndMargins() > LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(const RenderBox& child, LayoutUnit childSize) > { > Length max = isHorizontalFlow() ? child.style().maxWidth() : child.style().maxHeight(); >- std::optional<LayoutUnit> maxExtent = std::nullopt; >+ Optional<LayoutUnit> maxExtent = WTF::nullopt; > if (max.isSpecifiedOrIntrinsic()) { > maxExtent = computeMainAxisExtentForChild(child, MaxSize, max); > childSize = std::min(childSize, maxExtent.value_or(childSize)); >@@ -1105,7 +1105,7 @@ LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(const RenderBox& child > > if (useChildAspectRatio(child)) { > Length crossSizeLength = isHorizontalFlow() ? child.style().height() : child.style().width(); >- std::optional<LayoutUnit> transferredSize = computeMainSizeFromAspectRatioUsing(child, crossSizeLength); >+ Optional<LayoutUnit> transferredSize = computeMainSizeFromAspectRatioUsing(child, crossSizeLength); > if (transferredSize) { > transferredSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child, transferredSize.value()); > return std::max(childSize, std::min(transferredSize.value(), contentSize)); >@@ -1118,10 +1118,10 @@ LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(const RenderBox& child > return std::max(0_lu, childSize); > } > >-std::optional<LayoutUnit> RenderFlexibleBox::crossSizeForPercentageResolution(const RenderBox& child) >+Optional<LayoutUnit> RenderFlexibleBox::crossSizeForPercentageResolution(const RenderBox& child) > { > if (alignmentForChild(child) != ItemPosition::Stretch) >- return std::nullopt; >+ return WTF::nullopt; > > // Here we implement https://drafts.csswg.org/css-flexbox/#algo-stretch > if (hasOrthogonalFlow(child) && child.hasOverrideContentLogicalWidth()) >@@ -1135,10 +1135,10 @@ std::optional<LayoutUnit> RenderFlexibleBox::crossSizeForPercentageResolution(co > // definite size, which itself is not cheap. We can consider implementing it > // at a later time. (The correctness is ensured by redoing layout in > // applyStretchAlignmentToChild) >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<LayoutUnit> RenderFlexibleBox::mainSizeForPercentageResolution(const RenderBox& child) >+Optional<LayoutUnit> RenderFlexibleBox::mainSizeForPercentageResolution(const RenderBox& child) > { > // This function implements section 9.8. Definite and Indefinite Sizes, case > // 2) of the flexbox spec. >@@ -1146,21 +1146,21 @@ std::optional<LayoutUnit> RenderFlexibleBox::mainSizeForPercentageResolution(con > // flex item to have a definite flex basis. > const Length& flexBasis = flexBasisForChild(child); > if (!mainAxisLengthIsDefinite(child, flexBasis)) >- return std::nullopt; >+ return WTF::nullopt; > if (!flexBasis.isPercentOrCalculated()) { > // If flex basis had a percentage, our size is guaranteed to be definite or > // the flex item's size could not be definite. Otherwise, we make up a > // percentage to check whether we have a definite size. > if (!mainAxisLengthIsDefinite(child, Length(0, Percent))) >- return std::nullopt; >+ return WTF::nullopt; > } > > if (hasOrthogonalFlow(child)) >- return child.hasOverrideContentLogicalHeight() ? std::optional<LayoutUnit>(child.overrideContentLogicalHeight()) : std::nullopt; >- return child.hasOverrideContentLogicalWidth() ? std::optional<LayoutUnit>(child.overrideContentLogicalWidth()) : std::nullopt; >+ return child.hasOverrideContentLogicalHeight() ? Optional<LayoutUnit>(child.overrideContentLogicalHeight()) : WTF::nullopt; >+ return child.hasOverrideContentLogicalWidth() ? Optional<LayoutUnit>(child.overrideContentLogicalWidth()) : WTF::nullopt; > } > >-std::optional<LayoutUnit> RenderFlexibleBox::childLogicalHeightForPercentageResolution(const RenderBox& child) >+Optional<LayoutUnit> RenderFlexibleBox::childLogicalHeightForPercentageResolution(const RenderBox& child) > { > if (!hasOrthogonalFlow(child)) > return crossSizeForPercentageResolution(child); >diff --git a/Source/WebCore/rendering/RenderFlexibleBox.h b/Source/WebCore/rendering/RenderFlexibleBox.h >index 79bfeeee2cfc62961e73dd6a4ddacd9dfb3da467..df6749657d905a21a9e0ef21188f36a337abc4a1 100644 >--- a/Source/WebCore/rendering/RenderFlexibleBox.h >+++ b/Source/WebCore/rendering/RenderFlexibleBox.h >@@ -53,8 +53,8 @@ public: > void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) final; > > int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override; >- std::optional<int> firstLineBaseline() const override; >- std::optional<int> inlineBlockBaseline(LineDirectionMode) const override; >+ Optional<int> firstLineBaseline() const override; >+ Optional<int> inlineBlockBaseline(LineDirectionMode) const override; > > void styleDidChange(StyleDifference, const RenderStyle*) override; > void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) override; >@@ -68,9 +68,9 @@ public: > > virtual bool isFlexibleBoxImpl() const { return false; }; > >- std::optional<LayoutUnit> crossSizeForPercentageResolution(const RenderBox&); >- std::optional<LayoutUnit> mainSizeForPercentageResolution(const RenderBox&); >- std::optional<LayoutUnit> childLogicalHeightForPercentageResolution(const RenderBox&); >+ Optional<LayoutUnit> crossSizeForPercentageResolution(const RenderBox&); >+ Optional<LayoutUnit> mainSizeForPercentageResolution(const RenderBox&); >+ Optional<LayoutUnit> childLogicalHeightForPercentageResolution(const RenderBox&); > > void clearCachedMainSizeForChild(const RenderBox& child); > >@@ -122,7 +122,7 @@ private: > LayoutUnit mainAxisExtent() const; > LayoutUnit crossAxisContentExtent() const; > LayoutUnit mainAxisContentExtent(LayoutUnit contentLogicalHeight); >- std::optional<LayoutUnit> computeMainAxisExtentForChild(const RenderBox& child, SizeType, const Length& size); >+ Optional<LayoutUnit> computeMainAxisExtentForChild(const RenderBox& child, SizeType, const Length& size); > WritingMode transformedWritingMode() const; > LayoutUnit flowAwareBorderStart() const; > LayoutUnit flowAwareBorderEnd() const; >diff --git a/Source/WebCore/rendering/RenderGrid.cpp b/Source/WebCore/rendering/RenderGrid.cpp >index ef45ce1a1c9bcd23cb9b3c5977d0713773b16d59..04bb2b6cba21a9e91f4a7936e78915a0ec97eef4 100644 >--- a/Source/WebCore/rendering/RenderGrid.cpp >+++ b/Source/WebCore/rendering/RenderGrid.cpp >@@ -127,12 +127,12 @@ bool RenderGrid::namedGridLinesDefinitionDidChange(const RenderStyle& oldStyle) > > // This method optimizes the gutters computation by skiping the available size > // call if gaps are fixed size (it's only needed for percentages). >-std::optional<LayoutUnit> RenderGrid::availableSpaceForGutters(GridTrackSizingDirection direction) const >+Optional<LayoutUnit> RenderGrid::availableSpaceForGutters(GridTrackSizingDirection direction) const > { > bool isRowAxis = direction == ForColumns; > const GapLength& gapLength = isRowAxis ? style().columnGap() : style().rowGap(); > if (gapLength.isNormal() || !gapLength.length().isPercentOrCalculated()) >- return std::nullopt; >+ return WTF::nullopt; > > return isRowAxis ? availableLogicalWidth() : contentLogicalHeight(); > } >@@ -192,7 +192,7 @@ void RenderGrid::layoutBlock(bool relayoutChildren, LayoutUnit) > LayoutSize previousSize = size(); > // FIXME: We should use RenderBlock::hasDefiniteLogicalHeight() but it does not work for positioned stuff. > // FIXME: Consider caching the hasDefiniteLogicalHeight value throughout the layout. >- bool hasDefiniteLogicalHeight = hasOverrideContentLogicalHeight() || computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), std::nullopt); >+ bool hasDefiniteLogicalHeight = hasOverrideContentLogicalHeight() || computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), WTF::nullopt); > > m_hasAnyOrthogonalItem = false; > for (auto* child = firstChildBox(); child; child = child->nextSiblingBox()) { >@@ -304,7 +304,7 @@ void RenderGrid::layoutBlock(bool relayoutChildren, LayoutUnit) > m_baselineItemsCached = false; > } > >-LayoutUnit RenderGrid::gridGap(GridTrackSizingDirection direction, std::optional<LayoutUnit> availableSize) const >+LayoutUnit RenderGrid::gridGap(GridTrackSizingDirection direction, Optional<LayoutUnit> availableSize) const > { > const GapLength& gapLength = direction == ForColumns? style().columnGap() : style().rowGap(); > if (gapLength.isNormal()) >@@ -323,7 +323,7 @@ LayoutUnit RenderGrid::gridItemOffset(GridTrackSizingDirection direction) const > return direction == ForRows ? m_offsetBetweenRows.distributionOffset : m_offsetBetweenColumns.distributionOffset; > } > >-LayoutUnit RenderGrid::guttersSize(const Grid& grid, GridTrackSizingDirection direction, unsigned startLine, unsigned span, std::optional<LayoutUnit> availableSize) const >+LayoutUnit RenderGrid::guttersSize(const Grid& grid, GridTrackSizingDirection direction, unsigned startLine, unsigned span, Optional<LayoutUnit> availableSize) const > { > if (span <= 1) > return { }; >@@ -399,7 +399,7 @@ void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo > > Grid grid(const_cast<RenderGrid&>(*this)); > GridTrackSizingAlgorithm algorithm(this, grid); >- placeItemsOnGrid(algorithm, std::nullopt); >+ placeItemsOnGrid(algorithm, WTF::nullopt); > > performGridItemsPreLayout(algorithm); > >@@ -429,11 +429,11 @@ void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo > void RenderGrid::computeTrackSizesForIndefiniteSize(GridTrackSizingAlgorithm& algorithm, GridTrackSizingDirection direction, LayoutUnit* minIntrinsicSize, LayoutUnit* maxIntrinsicSize) const > { > const Grid& grid = algorithm.grid(); >- algorithm.setup(direction, numTracks(direction, grid), IntrinsicSizeComputation, std::nullopt, std::nullopt); >+ algorithm.setup(direction, numTracks(direction, grid), IntrinsicSizeComputation, WTF::nullopt, WTF::nullopt); > algorithm.run(); > > size_t numberOfTracks = algorithm.tracks(direction).size(); >- LayoutUnit totalGuttersSize = guttersSize(grid, direction, 0, numberOfTracks, std::nullopt); >+ LayoutUnit totalGuttersSize = guttersSize(grid, direction, 0, numberOfTracks, WTF::nullopt); > > if (minIntrinsicSize) > *minIntrinsicSize = algorithm.minContentSize() + totalGuttersSize; >@@ -443,7 +443,7 @@ void RenderGrid::computeTrackSizesForIndefiniteSize(GridTrackSizingAlgorithm& al > ASSERT(algorithm.tracksAreWiderThanMinTrackBreadth()); > } > >-unsigned RenderGrid::computeAutoRepeatTracksCount(GridTrackSizingDirection direction, std::optional<LayoutUnit> availableSize) const >+unsigned RenderGrid::computeAutoRepeatTracksCount(GridTrackSizingDirection direction, Optional<LayoutUnit> availableSize) const > { > ASSERT(!availableSize || availableSize.value() != -1); > bool isRowAxis = direction == ForColumns; >@@ -456,9 +456,9 @@ unsigned RenderGrid::computeAutoRepeatTracksCount(GridTrackSizingDirection direc > if (!isRowAxis && !availableSize) { > const Length& maxLength = style().logicalMaxHeight(); > if (!maxLength.isUndefined()) { >- availableSize = computeContentLogicalHeight(MaxSize, maxLength, std::nullopt); >+ availableSize = computeContentLogicalHeight(MaxSize, maxLength, WTF::nullopt); > if (availableSize) >- availableSize = constrainContentBoxLogicalHeightByMinMax(availableSize.value(), std::nullopt); >+ availableSize = constrainContentBoxLogicalHeightByMinMax(availableSize.value(), WTF::nullopt); > } > } > >@@ -569,7 +569,7 @@ unsigned RenderGrid::clampAutoRepeatTracks(GridTrackSizingDirection direction, u > // availableLogicalWidth() does always return a value even if we cannot resolve it like when > // computing the intrinsic size (preferred widths). That's why we pass the responsibility to the > // caller who does know whether the available logical width is indefinite or not. >-void RenderGrid::placeItemsOnGrid(GridTrackSizingAlgorithm& algorithm, std::optional<LayoutUnit> availableLogicalWidth) const >+void RenderGrid::placeItemsOnGrid(GridTrackSizingAlgorithm& algorithm, Optional<LayoutUnit> availableLogicalWidth) const > { > Grid& grid = algorithm.mutableGrid(); > unsigned autoRepeatColumns = computeAutoRepeatTracksCount(ForColumns, availableLogicalWidth); >@@ -1229,10 +1229,10 @@ int RenderGrid::baselinePosition(FontBaseline, bool, LineDirectionMode direction > return firstLineBaseline().value_or(synthesizedBaselineFromMarginBox(*this, direction)); > } > >-std::optional<int> RenderGrid::firstLineBaseline() const >+Optional<int> RenderGrid::firstLineBaseline() const > { > if (isWritingModeRoot() || !m_grid.hasGridItems()) >- return std::nullopt; >+ return WTF::nullopt; > > const RenderBox* baselineChild = nullptr; > // Finding the first grid item in grid order. >@@ -1252,9 +1252,9 @@ std::optional<int> RenderGrid::firstLineBaseline() const > } > > if (!baselineChild) >- return std::nullopt; >+ return WTF::nullopt; > >- auto baseline = GridLayoutFunctions::isOrthogonalChild(*this, *baselineChild) ? std::nullopt : baselineChild->firstLineBaseline(); >+ auto baseline = GridLayoutFunctions::isOrthogonalChild(*this, *baselineChild) ? WTF::nullopt : baselineChild->firstLineBaseline(); > // We take border-box's bottom if no valid baseline. > if (!baseline) { > // FIXME: We should pass |direction| into firstLineBaseline and stop bailing out if we're a writing >@@ -1265,9 +1265,9 @@ std::optional<int> RenderGrid::firstLineBaseline() const > return baseline.value() + baselineChild->logicalTop().toInt(); > } > >-std::optional<int> RenderGrid::inlineBlockBaseline(LineDirectionMode direction) const >+Optional<int> RenderGrid::inlineBlockBaseline(LineDirectionMode direction) const > { >- if (std::optional<int> baseline = firstLineBaseline()) >+ if (Optional<int> baseline = firstLineBaseline()) > return baseline; > > int marginAscent = direction == HorizontalLine ? marginBottom() : marginRight(); >@@ -1542,7 +1542,7 @@ LayoutUnit RenderGrid::gridAreaBreadthForOutOfFlowChild(const RenderBox& child, > else { > end = positions[endLine]; > // These vectors store line positions including gaps, but we shouldn't consider them for the edges of the grid. >- std::optional<LayoutUnit> availableSizeForGutters = availableSpaceForGutters(direction); >+ Optional<LayoutUnit> availableSizeForGutters = availableSpaceForGutters(direction); > if (endLine > 0 && endLine < lastLine) { > ASSERT(!m_grid.needsItemsPlacement()); > end -= guttersSize(m_grid, direction, endLine - 1, 2, availableSizeForGutters); >diff --git a/Source/WebCore/rendering/RenderGrid.h b/Source/WebCore/rendering/RenderGrid.h >index 00924cee61538513bdb1b10170975b5993591e15..131a00841aceb243bd50fedade4a5077955ce35f 100644 >--- a/Source/WebCore/rendering/RenderGrid.h >+++ b/Source/WebCore/rendering/RenderGrid.h >@@ -70,7 +70,7 @@ public: > unsigned autoRepeatCountForDirection(GridTrackSizingDirection direction) const { return m_grid.autoRepeatTracks(direction); } > > // Required by GridTrackSizingAlgorithm. Keep them under control. >- LayoutUnit guttersSize(const Grid&, GridTrackSizingDirection, unsigned startLine, unsigned span, std::optional<LayoutUnit> availableSize) const; >+ LayoutUnit guttersSize(const Grid&, GridTrackSizingDirection, unsigned startLine, unsigned span, Optional<LayoutUnit> availableSize) const; > LayoutUnit gridItemOffset(GridTrackSizingDirection) const; > > void updateGridAreaLogicalSize(RenderBox&, LayoutSize) const; >@@ -96,12 +96,12 @@ private: > bool selfAlignmentChangedToStretch(GridAxis, const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderBox&) const; > bool selfAlignmentChangedFromStretch(GridAxis, const RenderStyle& oldStyle, const RenderStyle& newStyle, const RenderBox&) const; > >- std::optional<LayoutUnit> availableSpaceForGutters(GridTrackSizingDirection) const; >+ Optional<LayoutUnit> availableSpaceForGutters(GridTrackSizingDirection) const; > > bool explicitGridDidResize(const RenderStyle&) const; > bool namedGridLinesDefinitionDidChange(const RenderStyle&) const; > >- unsigned computeAutoRepeatTracksCount(GridTrackSizingDirection, std::optional<LayoutUnit> availableSize) const; >+ unsigned computeAutoRepeatTracksCount(GridTrackSizingDirection, Optional<LayoutUnit> availableSize) const; > > unsigned clampAutoRepeatTracks(GridTrackSizingDirection, unsigned autoRepeatTracks) const; > >@@ -109,7 +109,7 @@ private: > > void performGridItemsPreLayout(const GridTrackSizingAlgorithm&) const; > >- void placeItemsOnGrid(GridTrackSizingAlgorithm&, std::optional<LayoutUnit> availableLogicalWidth) const; >+ void placeItemsOnGrid(GridTrackSizingAlgorithm&, Optional<LayoutUnit> availableLogicalWidth) const; > void populateExplicitGridAndOrderIterator(Grid&) const; > std::unique_ptr<GridArea> createEmptyGridAreaAtSpecifiedPositionsOutsideGrid(Grid&, const RenderBox&, GridTrackSizingDirection, const GridSpan&) const; > void placeSpecifiedMajorAxisItemsOnGrid(Grid&, const Vector<RenderBox*>&) const; >@@ -169,15 +169,15 @@ private: > void updateAutoMarginsInRowAxisIfNeeded(RenderBox&); > > int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const final; >- std::optional<int> firstLineBaseline() const final; >- std::optional<int> inlineBlockBaseline(LineDirectionMode) const final; >+ Optional<int> firstLineBaseline() const final; >+ Optional<int> inlineBlockBaseline(LineDirectionMode) const final; > bool isInlineBaselineAlignedChild(const RenderBox&) const; > > LayoutUnit columnAxisBaselineOffsetForChild(const RenderBox&) const; > LayoutUnit rowAxisBaselineOffsetForChild(const RenderBox&) const; > > LayoutUnit gridGap(GridTrackSizingDirection) const; >- LayoutUnit gridGap(GridTrackSizingDirection, std::optional<LayoutUnit> availableSize) const; >+ LayoutUnit gridGap(GridTrackSizingDirection, Optional<LayoutUnit> availableSize) const; > > unsigned nonCollapsedTracks(GridTrackSizingDirection) const; > unsigned numTracks(GridTrackSizingDirection, const Grid&) const; >@@ -194,7 +194,7 @@ private: > ContentAlignmentData m_offsetBetweenColumns; > ContentAlignmentData m_offsetBetweenRows; > >- typedef HashMap<const RenderBox*, std::optional<size_t>> OutOfFlowPositionsMap; >+ typedef HashMap<const RenderBox*, Optional<size_t>> OutOfFlowPositionsMap; > OutOfFlowPositionsMap m_outOfFlowItemColumn; > OutOfFlowPositionsMap m_outOfFlowItemRow; > >diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp >index 9c1b9c5b4eeff6741b515269935cf07c0996909d..f041afce354f7e8954aa7b852389ae7741fda825 100644 >--- a/Source/WebCore/rendering/RenderInline.cpp >+++ b/Source/WebCore/rendering/RenderInline.cpp >@@ -884,7 +884,7 @@ LayoutRect RenderInline::computeVisibleRectUsingPaintOffset(const LayoutRect& re > return adjustedRect; > } > >-std::optional<LayoutRect> RenderInline::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<LayoutRect> RenderInline::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > // Repaint offset cache is only valid for root-relative repainting > if (view().frameView().layoutContext().isPaintOffsetCacheEnabled() && !container && !context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >@@ -918,7 +918,7 @@ std::optional<LayoutRect> RenderInline::computeVisibleRectInContainer(const Layo > bool isEmpty = !downcast<RenderBox>(*localContainer).applyCachedClipAndScrollPosition(adjustedRect, container, context); > if (isEmpty) { > if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >- return std::nullopt; >+ return WTF::nullopt; > return adjustedRect; > } > } >diff --git a/Source/WebCore/rendering/RenderInline.h b/Source/WebCore/rendering/RenderInline.h >index 4689d8cbf3713ac25bfc46c6c76264ae2e12ceea..549733860098f1014812229a14335796b8eafaca 100644 >--- a/Source/WebCore/rendering/RenderInline.h >+++ b/Source/WebCore/rendering/RenderInline.h >@@ -130,7 +130,7 @@ private: > LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; > LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const final; > >- std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; >+ Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; > LayoutRect computeVisibleRectUsingPaintOffset(const LayoutRect&) const; > > void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override; >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index db183544719bde917b5dbd5dfd3d3992fbbc5233..c26e6b79fd61f66ef2589d096c6a230dcf3c8d49 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -2303,7 +2303,7 @@ void RenderLayer::scrollByRecursively(const IntSize& delta, ScrollableArea** scr > } > } > >-void RenderLayer::setPostLayoutScrollPosition(std::optional<ScrollPosition> position) >+void RenderLayer::setPostLayoutScrollPosition(Optional<ScrollPosition> position) > { > m_postLayoutScrollPosition = position; > } >@@ -2314,7 +2314,7 @@ void RenderLayer::applyPostLayoutScrollPositionIfNeeded() > return; > > scrollToOffset(scrollOffsetFromPosition(m_postLayoutScrollPosition.value())); >- m_postLayoutScrollPosition = std::nullopt; >+ m_postLayoutScrollPosition = WTF::nullopt; > } > > void RenderLayer::scrollToXPosition(int x, ScrollClamping clamping) >@@ -5037,7 +5037,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont > > // Check for hit test on backface if backface-visibility is 'hidden' > if (localTransformState && renderer().style().backfaceVisibility() == BackfaceVisibility::Hidden) { >- std::optional<TransformationMatrix> invertedMatrix = localTransformState->m_accumulatedTransform.inverse(); >+ Optional<TransformationMatrix> invertedMatrix = localTransformState->m_accumulatedTransform.inverse(); > // If the z-vector of the matrix is negative, the back is facing towards the viewer. > if (invertedMatrix && invertedMatrix.value().m33() < 0) > return nullptr; >diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h >index 1a86ea78c0f4782229dfbd64d7a332fac0cd6212..24d87313b3aeb5a0adf2c26c775b58045587f5da 100644 >--- a/Source/WebCore/rendering/RenderLayer.h >+++ b/Source/WebCore/rendering/RenderLayer.h >@@ -413,7 +413,7 @@ public: > void scrollToXPosition(int x, ScrollClamping = ScrollClamping::Clamped); > void scrollToYPosition(int y, ScrollClamping = ScrollClamping::Clamped); > >- void setPostLayoutScrollPosition(std::optional<ScrollPosition>); >+ void setPostLayoutScrollPosition(Optional<ScrollPosition>); > void applyPostLayoutScrollPositionIfNeeded(); > > ScrollOffset scrollOffset() const { return scrollOffsetFromPosition(m_scrollPosition); } >@@ -1243,7 +1243,7 @@ private: > IntSize m_layerSize; > > ScrollPosition m_scrollPosition; >- std::optional<ScrollPosition> m_postLayoutScrollPosition; >+ Optional<ScrollPosition> m_postLayoutScrollPosition; > > // The width/height of our scrolled area. > IntSize m_scrollSize; >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index 54984777de9bb673a92f840d66110e866501b4f0..01aca80c1019fb7fe5ec2b2073a1cb6d3ff15c4e 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -905,9 +905,9 @@ private: > return m_fromAncestorGraphicsLayer.value(); > } > >- std::optional<LayoutSize> m_fromAncestorGraphicsLayer; >- std::optional<LayoutSize> m_fromParentGraphicsLayer; >- std::optional<LayoutSize> m_fromPrimaryGraphicsLayer; >+ Optional<LayoutSize> m_fromAncestorGraphicsLayer; >+ Optional<LayoutSize> m_fromParentGraphicsLayer; >+ Optional<LayoutSize> m_fromPrimaryGraphicsLayer; > > const RenderLayer& m_renderLayer; > // Location is relative to the renderer. >@@ -1026,7 +1026,7 @@ void RenderLayerBacking::updateGeometry() > m_graphicsLayer->setPosition(primaryGraphicsLayerRect.location()); > m_graphicsLayer->setSize(primaryGraphicsLayerRect.size()); > >- auto computeAnimationExtent = [&] () -> std::optional<FloatRect> { >+ auto computeAnimationExtent = [&] () -> Optional<FloatRect> { > LayoutRect animatedBounds; > if (isRunningAcceleratedTransformAnimation && m_owningLayer.getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(animatedBounds, RenderLayer::IncludeCompositedDescendants)) > return FloatRect(animatedBounds); >diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp >index cf7f2b9bee7e666eca30318f4ab47aa3501af92a..670e374655c13c5e8badd28fe18237cd3846f264 100644 >--- a/Source/WebCore/rendering/RenderListBox.cpp >+++ b/Source/WebCore/rendering/RenderListBox.cpp >@@ -130,7 +130,7 @@ void RenderListBox::updateFromElement() > if (m_optionsChanged) { > float width = 0; > auto& normalFont = style().fontCascade(); >- std::optional<FontCascade> boldFont; >+ Optional<FontCascade> boldFont; > for (auto* element : selectElement().listItems()) { > String text; > WTF::Function<const FontCascade&()> selectFont = [&normalFont] () -> const FontCascade& { >@@ -693,8 +693,8 @@ int RenderListBox::numberOfVisibleItemsInPaddingBottom() const > > void RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas() > { >- m_indexOfFirstVisibleItemInsidePaddingTopArea = std::nullopt; >- m_indexOfFirstVisibleItemInsidePaddingBottomArea = std::nullopt; >+ m_indexOfFirstVisibleItemInsidePaddingTopArea = WTF::nullopt; >+ m_indexOfFirstVisibleItemInsidePaddingBottomArea = WTF::nullopt; > > int maximumNumberOfItemsThatFitInPaddingTopArea = paddingTop() / itemHeight(); > if (maximumNumberOfItemsThatFitInPaddingTopArea) { >diff --git a/Source/WebCore/rendering/RenderListBox.h b/Source/WebCore/rendering/RenderListBox.h >index 93f6ae60c33d2ac30e6501b9f40c5cd0535fca5c..7695c2d62b151e6d4d44b91806a5efa1ce7ded26 100644 >--- a/Source/WebCore/rendering/RenderListBox.h >+++ b/Source/WebCore/rendering/RenderListBox.h >@@ -178,8 +178,8 @@ private: > int m_optionsWidth; > int m_indexOffset; > >- std::optional<int> m_indexOfFirstVisibleItemInsidePaddingTopArea; >- std::optional<int> m_indexOfFirstVisibleItemInsidePaddingBottomArea; >+ Optional<int> m_indexOfFirstVisibleItemInsidePaddingTopArea; >+ Optional<int> m_indexOfFirstVisibleItemInsidePaddingBottomArea; > > RefPtr<Scrollbar> m_vBar; > }; >diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp >index 653c1a64b69de3e906549687b67e37d4dd2c2205..e4837e184abb0ca36d021108beab431f13f9e6c6 100644 >--- a/Source/WebCore/rendering/RenderListItem.cpp >+++ b/Source/WebCore/rendering/RenderListItem.cpp >@@ -232,7 +232,7 @@ void RenderListItem::updateValueNow() const > void RenderListItem::updateValue() > { > if (!m_valueWasSetExplicitly) { >- m_value = std::nullopt; >+ m_value = WTF::nullopt; > if (m_marker) > m_marker->setNeedsLayoutAndPrefWidthsRecalc(); > } >@@ -398,7 +398,7 @@ void RenderListItem::explicitValueChanged() > item->updateValue(); > } > >-void RenderListItem::setExplicitValue(std::optional<int> value) >+void RenderListItem::setExplicitValue(Optional<int> value) > { > if (!value) { > if (!m_valueWasSetExplicitly) >diff --git a/Source/WebCore/rendering/RenderListItem.h b/Source/WebCore/rendering/RenderListItem.h >index b701567e8fd882718bb76d1d753aa97f5d099696..406d80800fe9d6b97b605c93b25c3639cbd59862 100644 >--- a/Source/WebCore/rendering/RenderListItem.h >+++ b/Source/WebCore/rendering/RenderListItem.h >@@ -40,8 +40,8 @@ public: > int value() const; > void updateValue(); > >- std::optional<int> explicitValue() const { return m_valueWasSetExplicitly ? m_value : std::nullopt; } >- void setExplicitValue(std::optional<int>); >+ Optional<int> explicitValue() const { return m_valueWasSetExplicitly ? m_value : WTF::nullopt; } >+ void setExplicitValue(Optional<int>); > > void setNotInList(bool notInList) { m_notInList = notInList; } > bool notInList() const { return m_notInList; } >@@ -83,7 +83,7 @@ private: > void explicitValueChanged(); > > WeakPtr<RenderListMarker> m_marker; >- mutable std::optional<int> m_value; >+ mutable Optional<int> m_value; > bool m_valueWasSetExplicitly { false }; > bool m_notInList { false }; > }; >diff --git a/Source/WebCore/rendering/RenderMenuList.h b/Source/WebCore/rendering/RenderMenuList.h >index 37964dc186f604b2845bd684869cb8703daebfd9..d792ded24ba2205198eb4d26b1118f1e520ccfb7 100644 >--- a/Source/WebCore/rendering/RenderMenuList.h >+++ b/Source/WebCore/rendering/RenderMenuList.h >@@ -125,8 +125,8 @@ private: > { > return RenderBlock::baselinePosition(baseline, firstLine, direction, position); > } >- std::optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); } >- std::optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); } >+ Optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); } >+ Optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); } > > void getItemBackgroundColor(unsigned listIndex, Color&, bool& itemHasCustomBackgroundColor) const; > >@@ -145,7 +145,7 @@ private: > bool m_needsOptionsWidthUpdate; > int m_optionsWidth; > >- std::optional<int> m_lastActiveIndex; >+ Optional<int> m_lastActiveIndex; > > std::unique_ptr<RenderStyle> m_optionStyle; > >diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.cpp b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >index 1c12ba856844478fd41887d5f7c5881b34f1ca5e..dbb8ac58a1fde8b4ae269d65b0d151b882bdc227 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnSet.cpp >+++ b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >@@ -420,7 +420,7 @@ LayoutUnit RenderMultiColumnSet::calculateMaxColumnHeight() const > LayoutUnit availableHeight = multiColumnFlow()->columnHeightAvailable(); > LayoutUnit maxColumnHeight = availableHeight ? availableHeight : RenderFragmentedFlow::maxLogicalHeight(); > if (!multicolStyle.logicalMaxHeight().isUndefined()) >- maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), std::nullopt).value_or(maxColumnHeight)); >+ maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), WTF::nullopt).value_or(maxColumnHeight)); > return heightAdjustedForSetOffset(maxColumnHeight); > } > >diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp >index d5f8085e836800e7e164b6f37c5a0e5d82d2494c..bc283e263b1c1593a7a232a38e455079c9ee0e97 100644 >--- a/Source/WebCore/rendering/RenderObject.cpp >+++ b/Source/WebCore/rendering/RenderObject.cpp >@@ -989,7 +989,7 @@ FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect& rect, const > return *computeFloatVisibleRectInContainer(rect, repaintContainer, visibleRectContextForRepaint()); > } > >-std::optional<LayoutRect> RenderObject::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<LayoutRect> RenderObject::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > if (container == this) > return rect; >@@ -1003,14 +1003,14 @@ std::optional<LayoutRect> RenderObject::computeVisibleRectInContainer(const Layo > bool isEmpty = !downcast<RenderBox>(*parent).applyCachedClipAndScrollPosition(adjustedRect, container, context); > if (isEmpty) { > if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >- return std::nullopt; >+ return WTF::nullopt; > return adjustedRect; > } > } > return parent->computeVisibleRectInContainer(adjustedRect, container, context); > } > >-std::optional<FloatRect> RenderObject::computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject*, VisibleRectContext) const >+Optional<FloatRect> RenderObject::computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject*, VisibleRectContext) const > { > ASSERT_NOT_REACHED(); > return FloatRect(); >diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h >index 6745c07485c80cdb7c2bb2f691904c4cf79a01d6..0dd0a509c468694ffe8f3ab5edcaf6adc3890d6b 100644 >--- a/Source/WebCore/rendering/RenderObject.h >+++ b/Source/WebCore/rendering/RenderObject.h >@@ -684,7 +684,7 @@ public: > FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer) const; > > // Given a rect in the object's coordinate space, compute the location in container space where this rect is visible, >- // when clipping and scrolling as specified by the context. When using edge-inclusive intersection, return std::nullopt >+ // when clipping and scrolling as specified by the context. When using edge-inclusive intersection, return WTF::nullopt > // rather than an empty rect if the rect is completely clipped out in container space. > enum class VisibleRectContextOption { > UseEdgeInclusiveIntersection = 1 << 0, >@@ -702,8 +702,8 @@ public: > bool m_dirtyRectIsFlipped; > OptionSet<VisibleRectContextOption> m_options; > }; >- virtual std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const; >- virtual std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const; >+ virtual Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const; >+ virtual Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const; > > virtual unsigned int length() const { return 1; } > >diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp >index a0f08398dbbb5b89e1a766db5a821db1a4ccf24b..ccd1b0457199fc4142e1a3482e015a190debf98a 100644 >--- a/Source/WebCore/rendering/RenderReplaced.cpp >+++ b/Source/WebCore/rendering/RenderReplaced.cpp >@@ -478,7 +478,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh > // of 'width' is: (used height) * (intrinsic ratio) > if (intrinsicRatio && ((computedHeightIsAuto && !hasIntrinsicWidth && hasIntrinsicHeight) || !computedHeightIsAuto)) { > LayoutUnit estimatedUsedWidth = hasIntrinsicWidth ? LayoutUnit(constrainedSize.width()) : computeConstrainedLogicalWidth(shouldComputePreferred); >- LayoutUnit logicalHeight = computeReplacedLogicalHeight(std::optional<LayoutUnit>(estimatedUsedWidth)); >+ LayoutUnit logicalHeight = computeReplacedLogicalHeight(Optional<LayoutUnit>(estimatedUsedWidth)); > return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(logicalHeight * intrinsicRatio)), shouldComputePreferred); > } > >@@ -508,7 +508,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh > return computeReplacedLogicalWidthRespectingMinMaxWidth(intrinsicLogicalWidth(), shouldComputePreferred); > } > >-LayoutUnit RenderReplaced::computeReplacedLogicalHeight(std::optional<LayoutUnit> estimatedUsedWidth) const >+LayoutUnit RenderReplaced::computeReplacedLogicalHeight(Optional<LayoutUnit> estimatedUsedWidth) const > { > // 10.5 Content height: the 'height' property: http://www.w3.org/TR/CSS21/visudet.html#propdef-height > if (hasReplacedLogicalHeight()) >diff --git a/Source/WebCore/rendering/RenderReplaced.h b/Source/WebCore/rendering/RenderReplaced.h >index a8db86a44fa3d9989fe690ecc6878bb8dbdc1c8a..91e25a2b120101e4950895be9491b7e9e4528634 100644 >--- a/Source/WebCore/rendering/RenderReplaced.h >+++ b/Source/WebCore/rendering/RenderReplaced.h >@@ -31,7 +31,7 @@ public: > virtual ~RenderReplaced(); > > LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const override; >- LayoutUnit computeReplacedLogicalHeight(std::optional<LayoutUnit> estimatedUsedWidth = std::nullopt) const override; >+ LayoutUnit computeReplacedLogicalHeight(Optional<LayoutUnit> estimatedUsedWidth = WTF::nullopt) const override; > > LayoutRect replacedContentRect(const LayoutSize& intrinsicSize) const; > LayoutRect replacedContentRect() const { return replacedContentRect(intrinsicSize()); } >diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp >index d114a912f1ad12a3ca39e69cba85dfec3de85fb5..0b03604293901b32cd0577ce3557ce75d4a7e295 100644 >--- a/Source/WebCore/rendering/RenderTable.cpp >+++ b/Source/WebCore/rendering/RenderTable.cpp >@@ -1440,32 +1440,32 @@ int RenderTable::baselinePosition(FontBaseline baselineType, bool firstLine, Lin > }); > } > >-std::optional<int> RenderTable::inlineBlockBaseline(LineDirectionMode) const >+Optional<int> RenderTable::inlineBlockBaseline(LineDirectionMode) const > { > // Tables are skipped when computing an inline-block's baseline. >- return std::optional<int>(); >+ return Optional<int>(); > } > >-std::optional<int> RenderTable::firstLineBaseline() const >+Optional<int> RenderTable::firstLineBaseline() const > { > // The baseline of a 'table' is the same as the 'inline-table' baseline per CSS 3 Flexbox (CSS 2.1 > // doesn't define the baseline of a 'table' only an 'inline-table'). > // This is also needed to properly determine the baseline of a cell if it has a table child. > > if (isWritingModeRoot()) >- return std::optional<int>(); >+ return Optional<int>(); > > recalcSectionsIfNeeded(); > > const RenderTableSection* topNonEmptySection = this->topNonEmptySection(); > if (!topNonEmptySection) >- return std::optional<int>(); >+ return Optional<int>(); > >- if (std::optional<int> baseline = topNonEmptySection->firstLineBaseline()) >- return std::optional<int>(topNonEmptySection->logicalTop() + baseline.value()); >+ if (Optional<int> baseline = topNonEmptySection->firstLineBaseline()) >+ return Optional<int>(topNonEmptySection->logicalTop() + baseline.value()); > > // FIXME: A table row always has a baseline per CSS 2.1. Will this return the right value? >- return std::optional<int>(); >+ return Optional<int>(); > } > > LayoutRect RenderTable::overflowClipRect(const LayoutPoint& location, RenderFragmentContainer* fragment, OverlayScrollbarSizeRelevancy relevancy, PaintPhase phase) >diff --git a/Source/WebCore/rendering/RenderTable.h b/Source/WebCore/rendering/RenderTable.h >index 9ad6d26bf47146a0de0c966075c9dbe2dbd8c3dd..346cf5dc8dee1335f558fb6e50e065f3d193eed7 100644 >--- a/Source/WebCore/rendering/RenderTable.h >+++ b/Source/WebCore/rendering/RenderTable.h >@@ -293,8 +293,8 @@ private: > bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; > > int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const final; >- std::optional<int> firstLineBaseline() const override; >- std::optional<int> inlineBlockBaseline(LineDirectionMode) const final; >+ Optional<int> firstLineBaseline() const override; >+ Optional<int> inlineBlockBaseline(LineDirectionMode) const final; > > RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const; > >diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp >index 58b2270fcc541c3730247707b185ae47eae91c63..8dd66a46c10b45e0dda9dabfdef66bdae7c5b785 100644 >--- a/Source/WebCore/rendering/RenderTableCell.cpp >+++ b/Source/WebCore/rendering/RenderTableCell.cpp >@@ -395,7 +395,7 @@ LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModel > return computeRectForRepaint(r, repaintContainer); > } > >-std::optional<LayoutRect> RenderTableCell::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<LayoutRect> RenderTableCell::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > if (container == this) > return rect; >diff --git a/Source/WebCore/rendering/RenderTableCell.h b/Source/WebCore/rendering/RenderTableCell.h >index 66a8b55b9add91f1b34f04b317f406977398150f..03925f4f70c3142011bb57bb160d63103e427a14 100644 >--- a/Source/WebCore/rendering/RenderTableCell.h >+++ b/Source/WebCore/rendering/RenderTableCell.h >@@ -155,7 +155,7 @@ private: > bool boxShadowShouldBeAppliedToBackground(const LayoutPoint& paintOffset, BackgroundBleedAvoidance, InlineFlowBox*) const override; > > LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = 0) const override; >- std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >+ Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > > LayoutUnit borderHalfLeft(bool outer) const; > LayoutUnit borderHalfRight(bool outer) const; >diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp >index b623c90356da0953e3ca1556c1e595ea0a775efc..9119312549c1dc3f09406f96af021e0bccc3f109 100644 >--- a/Source/WebCore/rendering/RenderTableSection.cpp >+++ b/Source/WebCore/rendering/RenderTableSection.cpp >@@ -871,16 +871,16 @@ void RenderTableSection::recalcOuterBorder() > m_outerBorderEnd = calcOuterBorderEnd(); > } > >-std::optional<int> RenderTableSection::firstLineBaseline() const >+Optional<int> RenderTableSection::firstLineBaseline() const > { > if (!m_grid.size()) >- return std::optional<int>(); >+ return Optional<int>(); > > int firstLineBaseline = m_grid[0].baseline; > if (firstLineBaseline) > return firstLineBaseline + roundToInt(m_rowPos[0]); > >- std::optional<int> result; >+ Optional<int> result; > const Row& firstRow = m_grid[0].row; > for (size_t i = 0; i < firstRow.size(); ++i) { > const CellStruct& cs = firstRow.at(i); >diff --git a/Source/WebCore/rendering/RenderTableSection.h b/Source/WebCore/rendering/RenderTableSection.h >index 4ce7bfd4e76b5ac4b0c32fd3c10e0f7fa742db7c..de8d91100d89504d6026da33c6487f86c90ed48e 100644 >--- a/Source/WebCore/rendering/RenderTableSection.h >+++ b/Source/WebCore/rendering/RenderTableSection.h >@@ -62,7 +62,7 @@ public: > RenderTableRow* firstRow() const; > RenderTableRow* lastRow() const; > >- std::optional<int> firstLineBaseline() const override; >+ Optional<int> firstLineBaseline() const override; > > void addCell(RenderTableCell*, RenderTableRow* row); > >diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp >index 42257f725b503c61e03195045eec949a9135430c..afd759eb5af31f9abdc48b1f9dcc00c2dba2bad1 100644 >--- a/Source/WebCore/rendering/RenderText.cpp >+++ b/Source/WebCore/rendering/RenderText.cpp >@@ -808,7 +808,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Fo > bool isSpace = false; > bool firstWord = true; > bool firstLine = true; >- std::optional<unsigned> nextBreakable; >+ Optional<unsigned> nextBreakable; > unsigned lastWordBoundary = 0; > > WordTrailingSpace wordTrailingSpace(style); >@@ -828,7 +828,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Fo > minimumSuffixLength = after < 0 ? 2 : after; > } > >- std::optional<int> firstGlyphLeftOverflow; >+ Optional<int> firstGlyphLeftOverflow; > > bool breakNBSP = style.autoWrap() && style.nbspMode() == NBSPMode::Space; > >@@ -904,7 +904,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Fo > float currMinWidth = 0; > bool isSpace = (j < length) && isSpaceAccordingToStyle(c, style); > float w; >- std::optional<float> wordTrailingSpaceWidth; >+ Optional<float> wordTrailingSpaceWidth; > if (isSpace) > wordTrailingSpaceWidth = wordTrailingSpace.width(fallbackFonts); > if (wordTrailingSpaceWidth) >@@ -921,7 +921,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Fo > > if (suffixStart) { > float suffixWidth; >- std::optional<float> wordTrailingSpaceWidth; >+ Optional<float> wordTrailingSpaceWidth; > if (isSpace) > wordTrailingSpaceWidth = wordTrailingSpace.width(fallbackFonts); > if (wordTrailingSpaceWidth) >@@ -1545,7 +1545,7 @@ void RenderText::momentarilyRevealLastTypedCharacter(unsigned offsetAfterLastTyp > secureTextTimer->restart(offsetAfterLastTypedCharacter); > } > >-StringView RenderText::stringView(unsigned start, std::optional<unsigned> stop) const >+StringView RenderText::stringView(unsigned start, Optional<unsigned> stop) const > { > unsigned destination = stop.value_or(text().length()); > ASSERT(start <= length()); >diff --git a/Source/WebCore/rendering/RenderText.h b/Source/WebCore/rendering/RenderText.h >index 4d19b109c113436e850159121ebdc2cacdf5c9d2..c50feb239db42aff0ad1052a03ec15c86bca4b25 100644 >--- a/Source/WebCore/rendering/RenderText.h >+++ b/Source/WebCore/rendering/RenderText.h >@@ -167,7 +167,7 @@ public: > void deleteLineBoxesBeforeSimpleLineLayout(); > const SimpleLineLayout::Layout* simpleLineLayout() const; > >- StringView stringView(unsigned start = 0, std::optional<unsigned> stop = std::nullopt) const; >+ StringView stringView(unsigned start = 0, Optional<unsigned> stop = WTF::nullopt) const; > > LayoutUnit topOfFirstText() const; > >diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h >index 18dc19db0fac004044d232400088f2a38e4b723b..69b193b1ff28bf2d0e58be6ae3152da8d9229a90 100644 >--- a/Source/WebCore/rendering/RenderTextControl.h >+++ b/Source/WebCore/rendering/RenderTextControl.h >@@ -98,8 +98,8 @@ public: > { > return RenderBlock::baselinePosition(baseline, firstLine, direction, position); > } >- std::optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); } >- std::optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); } >+ Optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); } >+ Optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); } > > private: > bool isFlexibleBoxImpl() const override { return true; } >diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp >index d2535c4a33571b8e87215b1ce7d4aeb935d6af1a..967692ee0a2c33457d777732424ec791a4fccead 100644 >--- a/Source/WebCore/rendering/RenderView.cpp >+++ b/Source/WebCore/rendering/RenderView.cpp >@@ -577,7 +577,7 @@ LayoutRect RenderView::visualOverflowRect() const > return RenderBlockFlow::visualOverflowRect(); > } > >-std::optional<LayoutRect> RenderView::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<LayoutRect> RenderView::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > // If a container was specified, and was not nullptr or the RenderView, > // then we should have found it by now. >diff --git a/Source/WebCore/rendering/RenderView.h b/Source/WebCore/rendering/RenderView.h >index 8f17d3646c2e35cff2d558bff54a98f7013540f5..ea056e5cdc9e0406ac2ac7b1f2ab3812cd38d445 100644 >--- a/Source/WebCore/rendering/RenderView.h >+++ b/Source/WebCore/rendering/RenderView.h >@@ -72,7 +72,7 @@ public: > FrameView& frameView() const { return m_frameView; } > > LayoutRect visualOverflowRect() const override; >- std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >+ Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > void repaintRootContents(); > void repaintViewRectangle(const LayoutRect&) const; > void repaintViewAndCompositedLayers(); >@@ -242,7 +242,7 @@ private: > HashSet<RenderBox*> m_renderersNeedingLazyRepaint; > > std::unique_ptr<ImageQualityController> m_imageQualityController; >- std::optional<LayoutSize> m_pageLogicalSize; >+ Optional<LayoutSize> m_pageLogicalSize; > bool m_pageLogicalHeightChanged { false }; > std::unique_ptr<RenderLayerCompositor> m_compositor; > >diff --git a/Source/WebCore/rendering/SelectionRangeData.cpp b/Source/WebCore/rendering/SelectionRangeData.cpp >index aacf5e84a6e7c4a1df8450cb9ecd7752e37eec2e..ec5e7356a64d1249dda1147e8bba31f4790b4bf2 100644 >--- a/Source/WebCore/rendering/SelectionRangeData.cpp >+++ b/Source/WebCore/rendering/SelectionRangeData.cpp >@@ -49,8 +49,8 @@ struct SelectionData { > using RendererMap = HashMap<RenderObject*, std::unique_ptr<RenderSelectionInfo>>; > using RenderBlockMap = HashMap<const RenderBlock*, std::unique_ptr<RenderBlockSelectionInfo>>; > >- std::optional<unsigned> startPosition; >- std::optional<unsigned> endPosition; >+ Optional<unsigned> startPosition; >+ Optional<unsigned> endPosition; > RendererMap renderers; > RenderBlockMap blocks; > }; >diff --git a/Source/WebCore/rendering/SelectionRangeData.h b/Source/WebCore/rendering/SelectionRangeData.h >index 8a7f1e55c24e13bf5f0291418f2b45088c500d11..7cdefe907483718d6dbf5d66aeb88f8a552dc142 100644 >--- a/Source/WebCore/rendering/SelectionRangeData.h >+++ b/Source/WebCore/rendering/SelectionRangeData.h >@@ -57,8 +57,8 @@ public: > > RenderObject* start() const { return m_start.get(); } > RenderObject* end() const { return m_end.get(); } >- std::optional<unsigned> startPosition() const { return m_startPosition; } >- std::optional<unsigned> endPosition() const { return m_endPosition; } >+ Optional<unsigned> startPosition() const { return m_startPosition; } >+ Optional<unsigned> endPosition() const { return m_endPosition; } > > bool operator==(const Context& other) const > { >@@ -68,8 +68,8 @@ public: > private: > WeakPtr<RenderObject> m_start; > WeakPtr<RenderObject> m_end; >- std::optional<unsigned> m_startPosition; >- std::optional<unsigned> m_endPosition; >+ Optional<unsigned> m_startPosition; >+ Optional<unsigned> m_endPosition; > }; > > enum class RepaintMode { NewXOROld, NewMinusOld, Nothing }; >diff --git a/Source/WebCore/rendering/SimpleLineLayout.cpp b/Source/WebCore/rendering/SimpleLineLayout.cpp >index 112a7fa819bb1eefa85d0e09953cf6e52bf5df4e..387a76be0933e9881b7224abeabad812ca27ce99 100644 >--- a/Source/WebCore/rendering/SimpleLineLayout.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayout.cpp >@@ -107,7 +107,7 @@ template<> AvoidanceReasonFlags canUseForCharacter(LChar, bool, IncludeReasons) > } > > template <typename CharacterType> >-static AvoidanceReasonFlags canUseForText(const CharacterType* text, unsigned length, const FontCascade& fontCascade, std::optional<float> lineHeightConstraint, >+static AvoidanceReasonFlags canUseForText(const CharacterType* text, unsigned length, const FontCascade& fontCascade, Optional<float> lineHeightConstraint, > bool textIsJustified, IncludeReasons includeReasons) > { > AvoidanceReasonFlags reasons = { }; >@@ -146,7 +146,7 @@ static AvoidanceReasonFlags canUseForText(const CharacterType* text, unsigned le > return reasons; > } > >-static AvoidanceReasonFlags canUseForText(StringView text, const FontCascade& fontCascade, std::optional<float> lineHeightConstraint, bool textIsJustified, IncludeReasons includeReasons) >+static AvoidanceReasonFlags canUseForText(StringView text, const FontCascade& fontCascade, Optional<float> lineHeightConstraint, bool textIsJustified, IncludeReasons includeReasons) > { > if (text.is8Bit()) > return canUseForText(text.characters8(), text.length(), fontCascade, lineHeightConstraint, textIsJustified, includeReasons); >@@ -161,7 +161,7 @@ static AvoidanceReasonFlags canUseForFontAndText(const RenderBlockFlow& flow, In > auto& fontCascade = style.fontCascade(); > if (fontCascade.primaryFont().isInterstitial()) > SET_REASON_AND_RETURN_IF_NEEDED(FlowIsMissingPrimaryFont, reasons, includeReasons); >- std::optional<float> lineHeightConstraint; >+ Optional<float> lineHeightConstraint; > if (style.lineBoxContain() & LineBoxContainGlyphs) > lineHeightConstraint = lineHeightFromFlow(flow).toFloat(); > bool flowIsJustified = style.textAlign() == TextAlignMode::Justify; >@@ -245,7 +245,7 @@ static AvoidanceReasonFlags canUseForStyle(const RenderStyle& style, IncludeReas > SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonAutoTrailingWord, reasons, includeReasons); > #endif > if (style.hyphens() == Hyphens::Auto) { >- auto textReasons = canUseForText(style.hyphenString(), style.fontCascade(), std::nullopt, false, includeReasons); >+ auto textReasons = canUseForText(style.hyphenString(), style.fontCascade(), WTF::nullopt, false, includeReasons); > if (textReasons != NoReason) > SET_REASON_AND_RETURN_IF_NEEDED(textReasons, reasons, includeReasons); > } >@@ -570,7 +570,7 @@ private: > float m_runsWidth { 0 }; > TextFragmentIterator::TextFragment m_overflowedFragment; > TextFragmentIterator::TextFragment m_lastFragment; >- std::optional<TextFragmentIterator::TextFragment> m_lastNonWhitespaceFragment; >+ Optional<TextFragmentIterator::TextFragment> m_lastNonWhitespaceFragment; > TextFragmentIterator::TextFragment m_lastCompleteFragment; > float m_uncompletedWidth { 0 }; > float m_trailingWhitespaceWidth { 0 }; // Use this to remove trailing whitespace without re-mesuring the text. >@@ -579,7 +579,7 @@ private: > // First character of the first fragment might be forced on to the current line even if it does not fit. > bool m_firstCharacterFits { false }; > bool m_hyphenationDisabled { false }; >- std::optional<Vector<TextFragmentIterator::TextFragment, 30>> m_fragments; >+ Optional<Vector<TextFragmentIterator::TextFragment, 30>> m_fragments; > }; > > static bool preWrap(const TextFragmentIterator::Style& style) >@@ -622,12 +622,12 @@ struct SplitFragmentData { > unsigned position; > float width; > }; >-static std::optional<unsigned> hyphenPositionForFragment(SplitFragmentData splitData, const TextFragmentIterator::TextFragment& fragmentToSplit, >+static Optional<unsigned> hyphenPositionForFragment(SplitFragmentData splitData, const TextFragmentIterator::TextFragment& fragmentToSplit, > const LineState& line, const TextFragmentIterator& textFragmentIterator, float availableWidth) > { > auto& style = textFragmentIterator.style(); > if (!style.shouldHyphenate || line.isHyphenationDisabled()) >- return std::nullopt; >+ return WTF::nullopt; > > // FIXME: This is a workaround for webkit.org/b/169613. See maxPrefixWidth computation in tryHyphenating(). > // It does not work properly with non-collapsed leading tabs when font is enlarged. >@@ -635,7 +635,7 @@ static std::optional<unsigned> hyphenPositionForFragment(SplitFragmentData split > if (!line.isEmpty()) > adjustedAvailableWidth += style.font.spaceWidth(); > if (!enoughWidthForHyphenation(adjustedAvailableWidth, style.font.pixelSize())) >- return std::nullopt; >+ return WTF::nullopt; > > // We might be able to fit the hyphen at the split position. > auto splitPositionWithHyphen = splitData.position; >@@ -644,7 +644,7 @@ static std::optional<unsigned> hyphenPositionForFragment(SplitFragmentData split > auto leftSideWidth = splitData.width; > while (leftSideWidth + style.hyphenStringWidth > availableWidth) { > if (--splitPositionWithHyphen <= start) >- return std::nullopt; // No space for hyphen. >+ return WTF::nullopt; // No space for hyphen. > leftSideWidth -= textFragmentIterator.textWidth(splitPositionWithHyphen, splitPositionWithHyphen + 1, 0); > } > ASSERT(splitPositionWithHyphen > start); >@@ -684,7 +684,7 @@ static TextFragmentIterator::TextFragment splitFragmentToFitLine(TextFragmentIte > { > auto availableWidth = line.availableWidth() - line.width(); > auto splitFragmentData = split(fragmentToSplit, availableWidth, textFragmentIterator); >- std::optional<unsigned> hyphenPosition = std::nullopt; >+ Optional<unsigned> hyphenPosition = WTF::nullopt; > // Does first character fit this line? > if (splitFragmentData.position == fragmentToSplit.start()) { > // Keep at least one character on empty lines. >@@ -916,7 +916,7 @@ static TextAlignMode textAlignForLine(const TextFragmentIterator::Style& style, > return textAlign; > } > >-static void closeLineEndingAndAdjustRuns(LineState& line, Layout::RunVector& runs, std::optional<unsigned> lastRunIndexOfPreviousLine, unsigned& lineCount, >+static void closeLineEndingAndAdjustRuns(LineState& line, Layout::RunVector& runs, Optional<unsigned> lastRunIndexOfPreviousLine, unsigned& lineCount, > const TextFragmentIterator& textFragmentIterator, bool lastLineInFlow) > { > if (!runs.size() || (lastRunIndexOfPreviousLine && runs.size() - 1 == lastRunIndexOfPreviousLine.value())) >@@ -949,7 +949,7 @@ static void createTextRuns(Layout::RunVector& runs, RenderBlockFlow& flow, unsig > unsigned numberOfPrecedingLinesWithHyphen = 0; > bool isEndOfContent = false; > TextFragmentIterator textFragmentIterator = TextFragmentIterator(flow); >- std::optional<unsigned> lastRunIndexOfPreviousLine; >+ Optional<unsigned> lastRunIndexOfPreviousLine; > do { > flow.setLogicalHeight(lineHeight * lineCount + borderAndPaddingBefore); > LineState previousLine = line; >diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >index d26c0483c845568f7f68d5a92b575e3a8b21630d..fc225557130389990e1f6cfb049992aed913bf25 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >@@ -93,7 +93,7 @@ void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& pai > textPainter.setShadow(debugShadow.get()); > } > >- std::optional<TextDecorationPainter> textDecorationPainter; >+ Optional<TextDecorationPainter> textDecorationPainter; > if (!style.textDecorationsInEffect().isEmpty()) { > const RenderText* textRenderer = childrenOfType<RenderText>(flow).first(); > if (textRenderer) { >diff --git a/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp b/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp >index b313cd34b6687695c4d3f055ca6a86866ea38bfd..385864a49e033c0fc247486d2f3ff2d2477e3b4a 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp >@@ -164,7 +164,7 @@ unsigned RunResolver::adjustLineIndexForStruts(LayoutUnit y, IndexType type, uns > if (strut.lineBreak >= lineIndexCandidate) > return lineIndexCandidate; > unsigned strutIndex = 0; >- std::optional<unsigned> lastIndexCandidate; >+ Optional<unsigned> lastIndexCandidate; > auto top = strut.lineBreak * m_lineHeight; > auto lineHeightWithOverflow = m_lineHeight; > // If font is larger than the line height (glyphs overflow), use the font size when checking line boundaries. >diff --git a/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp b/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp >index 510a0cb8d942d43d7581498fafc6fd23c7f16160..1c51861eadb61d13d9fe787e6cac660c2ea4c5b9 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp >@@ -167,22 +167,22 @@ unsigned TextFragmentIterator::nextNonWhitespacePosition(const FlowContents::Seg > return position; > } > >-std::optional<unsigned> TextFragmentIterator::lastHyphenPosition(const TextFragmentIterator::TextFragment& run, unsigned before) const >+Optional<unsigned> TextFragmentIterator::lastHyphenPosition(const TextFragmentIterator::TextFragment& run, unsigned before) const > { > ASSERT(run.start() < before); > auto& segment = *m_currentSegment; > ASSERT(segment.start <= before && before <= segment.end); > ASSERT(is<RenderText>(segment.renderer)); > if (!m_style.shouldHyphenate || run.type() != TextFragment::NonWhitespace) >- return std::nullopt; >+ return WTF::nullopt; > // Check if there are enough characters in the run. > unsigned runLength = run.end() - run.start(); > if (m_style.hyphenLimitBefore >= runLength || m_style.hyphenLimitAfter >= runLength || m_style.hyphenLimitBefore + m_style.hyphenLimitAfter > runLength) >- return std::nullopt; >+ return WTF::nullopt; > auto runStart = segment.toSegmentPosition(run.start()); > auto beforeIndex = segment.toSegmentPosition(before) - runStart; > if (beforeIndex <= m_style.hyphenLimitBefore) >- return std::nullopt; >+ return WTF::nullopt; > // Adjust before index to accommodate the limit-after value (this is the last potential hyphen location). > beforeIndex = std::min(beforeIndex, runLength - m_style.hyphenLimitAfter + 1); > auto substringForHyphenation = StringView(segment.text).substring(runStart, run.end() - run.start()); >@@ -190,7 +190,7 @@ std::optional<unsigned> TextFragmentIterator::lastHyphenPosition(const TextFragm > // Check if there are enough characters before and after the hyphen. > if (hyphenLocation && hyphenLocation >= m_style.hyphenLimitBefore && m_style.hyphenLimitAfter <= (runLength - hyphenLocation)) > return segment.toRenderPosition(hyphenLocation + runStart); >- return std::nullopt; >+ return WTF::nullopt; > } > > unsigned TextFragmentIterator::skipToNextPosition(PositionType positionType, unsigned startPosition, float& width, float xPosition, bool& overlappingFragment) >diff --git a/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h b/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h >index df135bd083dea76071ef8e4707dd498b9c29a1d0..a69f850a3591af08aa8c343293ae0a0030ea06fe 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h >+++ b/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h >@@ -100,7 +100,7 @@ public: > > // FIXME: These functions below should be decoupled from the text iterator. > float textWidth(unsigned startPosition, unsigned endPosition, float xPosition) const; >- std::optional<unsigned> lastHyphenPosition(const TextFragmentIterator::TextFragment& run, unsigned beforeIndex) const; >+ Optional<unsigned> lastHyphenPosition(const TextFragmentIterator::TextFragment& run, unsigned beforeIndex) const; > > struct Style { > explicit Style(const RenderStyle&); >@@ -122,7 +122,7 @@ public: > unsigned hyphenLimitBefore; > unsigned hyphenLimitAfter; > AtomicString locale; >- std::optional<unsigned> hyphenLimitLines; >+ Optional<unsigned> hyphenLimitLines; > }; > const Style& style() const { return m_style; } > >diff --git a/Source/WebCore/rendering/TextDecorationPainter.cpp b/Source/WebCore/rendering/TextDecorationPainter.cpp >index 729cdefce0c215f6662d7efc157d74d104dce33f..74d046b3ef545ecdc02715d3f30e75f4b9d030f7 100644 >--- a/Source/WebCore/rendering/TextDecorationPainter.cpp >+++ b/Source/WebCore/rendering/TextDecorationPainter.cpp >@@ -197,7 +197,7 @@ bool TextDecorationPainter::Styles::operator==(const Styles& other) const > && underlineStyle == other.underlineStyle && overlineStyle == other.overlineStyle && linethroughStyle == other.linethroughStyle; > } > >-TextDecorationPainter::TextDecorationPainter(GraphicsContext& context, OptionSet<TextDecoration> decorations, const RenderText& renderer, bool isFirstLine, const FontCascade& font, std::optional<Styles> styles) >+TextDecorationPainter::TextDecorationPainter(GraphicsContext& context, OptionSet<TextDecoration> decorations, const RenderText& renderer, bool isFirstLine, const FontCascade& font, Optional<Styles> styles) > : m_context { context } > , m_decorations { decorations } > , m_wavyOffset { wavyOffsetFromDecoration() } >diff --git a/Source/WebCore/rendering/TextDecorationPainter.h b/Source/WebCore/rendering/TextDecorationPainter.h >index a6d14b2b5f4563783602a2ea790046ef9c801b00..21cb3d96faedf504a0fa4d29e592a260821bdc24 100644 >--- a/Source/WebCore/rendering/TextDecorationPainter.h >+++ b/Source/WebCore/rendering/TextDecorationPainter.h >@@ -42,7 +42,7 @@ class TextRun; > class TextDecorationPainter { > public: > struct Styles; >- TextDecorationPainter(GraphicsContext&, OptionSet<TextDecoration> decorations, const RenderText&, bool isFirstLine, const FontCascade&, std::optional<Styles> = std::nullopt); >+ TextDecorationPainter(GraphicsContext&, OptionSet<TextDecoration> decorations, const RenderText&, bool isFirstLine, const FontCascade&, Optional<Styles> = WTF::nullopt); > > void setInlineTextBox(const InlineTextBox* inlineTextBox) { m_inlineTextBox = inlineTextBox; } > void setIsHorizontal(bool isHorizontal) { m_isHorizontal = isHorizontal; } >diff --git a/Source/WebCore/rendering/TextPaintStyle.cpp b/Source/WebCore/rendering/TextPaintStyle.cpp >index 6b0a1848995e0ec5cb28427945c1065ae6cde927..9b56b0a5407299702c29ea68e139434991601671 100644 >--- a/Source/WebCore/rendering/TextPaintStyle.cpp >+++ b/Source/WebCore/rendering/TextPaintStyle.cpp >@@ -135,7 +135,7 @@ TextPaintStyle computeTextPaintStyle(const Frame& frame, const RenderStyle& line > return paintStyle; > } > >-TextPaintStyle computeTextSelectionPaintStyle(const TextPaintStyle& textPaintStyle, const RenderText& renderer, const RenderStyle& lineStyle, const PaintInfo& paintInfo, std::optional<ShadowData>& selectionShadow) >+TextPaintStyle computeTextSelectionPaintStyle(const TextPaintStyle& textPaintStyle, const RenderText& renderer, const RenderStyle& lineStyle, const PaintInfo& paintInfo, Optional<ShadowData>& selectionShadow) > { > TextPaintStyle selectionPaintStyle = textPaintStyle; > >diff --git a/Source/WebCore/rendering/TextPaintStyle.h b/Source/WebCore/rendering/TextPaintStyle.h >index 260c4d0b506b6f086f5ade8a36022d2a48901f5f..c9f104c6e80ad3fe251c33fbe42ef4bccefb4d42 100644 >--- a/Source/WebCore/rendering/TextPaintStyle.h >+++ b/Source/WebCore/rendering/TextPaintStyle.h >@@ -60,7 +60,7 @@ struct TextPaintStyle { > > bool textColorIsLegibleAgainstBackgroundColor(const Color& textColor, const Color& backgroundColor); > TextPaintStyle computeTextPaintStyle(const Frame&, const RenderStyle&, const PaintInfo&); >-TextPaintStyle computeTextSelectionPaintStyle(const TextPaintStyle&, const RenderText&, const RenderStyle&, const PaintInfo&, std::optional<ShadowData>& selectionShadow); >+TextPaintStyle computeTextSelectionPaintStyle(const TextPaintStyle&, const RenderText&, const RenderStyle&, const PaintInfo&, Optional<ShadowData>& selectionShadow); > > enum FillColorType { UseNormalFillColor, UseEmphasisMarkColor }; > void updateGraphicsContext(GraphicsContext&, const TextPaintStyle&, FillColorType = UseNormalFillColor); >diff --git a/Source/WebCore/rendering/line/BreakingContext.h b/Source/WebCore/rendering/line/BreakingContext.h >index 1ba01dd41210ab348f686778a6ad7d67fa4416bb..4a0158d6d767f4fc5a34fec35957dff8b26d5738 100644 >--- a/Source/WebCore/rendering/line/BreakingContext.h >+++ b/Source/WebCore/rendering/line/BreakingContext.h >@@ -73,7 +73,7 @@ struct WordTrailingSpace { > m_state = WordTrailingSpaceState::Initialized; > } > >- std::optional<float> width(HashSet<const Font*>& fallbackFonts) >+ Optional<float> width(HashSet<const Font*>& fallbackFonts) > { > if (m_state == WordTrailingSpaceState::Initialized) > return m_width; >@@ -88,7 +88,7 @@ private: > enum class WordTrailingSpaceState { Uninitialized, Initialized }; > const RenderStyle& m_style; > WordTrailingSpaceState m_state { WordTrailingSpaceState::Uninitialized }; >- std::optional<float> m_width; >+ Optional<float> m_width; > }; > > class BreakingContext { >@@ -173,7 +173,7 @@ public: > m_hangsAtEnd = false; > } > >- void commitLineBreakAtCurrentWidth(RenderObject& object, unsigned offset = 0, std::optional<unsigned> nextBreak = std::optional<unsigned>()) >+ void commitLineBreakAtCurrentWidth(RenderObject& object, unsigned offset = 0, Optional<unsigned> nextBreak = Optional<unsigned>()) > { > m_width.commit(); > m_lineBreakHistory.moveTo(object, offset, nextBreak); >@@ -210,14 +210,14 @@ private: > > RenderObject* renderer() const { return this->at(0).renderer(); } > unsigned offset() const { return this->at(0).offset(); } >- std::optional<unsigned> nextBreakablePosition() const { return this->at(0).nextBreakablePosition(); } >+ Optional<unsigned> nextBreakablePosition() const { return this->at(0).nextBreakablePosition(); } > bool atTextParagraphSeparator() const { return this->at(0).atTextParagraphSeparator(); } > UChar previousInSameNode() const { return this->at(0).previousInSameNode(); } > const InlineIterator& get(size_t i) const { return this->at(i); }; > const InlineIterator& current() const { return get(0); } > size_t historyLength() const { return this->size(); } > >- void moveTo(RenderObject& object, unsigned offset, std::optional<unsigned> nextBreak = std::nullopt) >+ void moveTo(RenderObject& object, unsigned offset, Optional<unsigned> nextBreak = WTF::nullopt) > { > push([&](InlineIterator& modifyMe) { > modifyMe.moveTo(object, offset, nextBreak); >@@ -643,7 +643,7 @@ inline void ensureCharacterGetsLineBox(LineWhitespaceCollapsingState& lineWhites > lineWhitespaceCollapsingState.stopIgnoringSpaces(InlineIterator(0, textParagraphSeparator.renderer(), textParagraphSeparator.offset())); > } > >-inline void tryHyphenating(RenderText& text, const FontCascade& font, const AtomicString& localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, float availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, std::optional<unsigned> nextBreakable, bool& hyphenated) >+inline void tryHyphenating(RenderText& text, const FontCascade& font, const AtomicString& localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, float availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, Optional<unsigned> nextBreakable, bool& hyphenated) > { > // Map 'hyphenate-limit-{before,after}: auto;' to 2. > unsigned minimumPrefixLength; >@@ -716,7 +716,7 @@ inline float BreakingContext::computeAdditionalBetweenWordsWidth(RenderText& ren > wordMeasurement.startOffset = lastSpace; > > float additionalTempWidth = 0; >- std::optional<float> wordTrailingSpaceWidth; >+ Optional<float> wordTrailingSpaceWidth; > if (currentCharacter == ' ') > wordTrailingSpaceWidth = wordTrailingSpace.width(fallbackFonts); > if (wordTrailingSpaceWidth) >@@ -846,7 +846,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool > midWordBreak = m_width.committedWidth() + wrapW + charWidth > m_width.availableWidth(); > } > >- std::optional<unsigned> nextBreakablePosition = m_current.nextBreakablePosition(); >+ Optional<unsigned> nextBreakablePosition = m_current.nextBreakablePosition(); > bool betweenWords = c == '\n' || (m_currWS != WhiteSpace::Pre && !m_atStart && isBreakable(m_renderTextInfo.lineBreakIterator, m_current.offset(), nextBreakablePosition, breakNBSP, canUseLineBreakShortcut, keepAllWords) > && (style.hyphens() != Hyphens::None || (m_current.previousInSameNode() != softHyphen))); > m_current.setNextBreakablePosition(nextBreakablePosition); >@@ -948,7 +948,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool > } > // Check if the last breaking position is a soft-hyphen. > if (!hyphenated && style.hyphens() != Hyphens::None) { >- std::optional<unsigned> lastBreakingPositon; >+ Optional<unsigned> lastBreakingPositon; > const RenderObject* rendererAtBreakingPosition = nullptr; > if (m_lineBreakHistory.offset() || m_lineBreakHistory.nextBreakablePosition()) { > lastBreakingPositon = m_lineBreakHistory.offset(); >@@ -959,7 +959,7 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool > rendererAtBreakingPosition = m_current.renderer(); > } > if (lastBreakingPositon) { >- std::optional<UChar> characterBeforeBreakingPosition; >+ Optional<UChar> characterBeforeBreakingPosition; > // When last breaking position points to the start of the current context, we need to look at the last character from > // the previous non-empty text renderer. > if (!lastBreakingPositon.value()) >@@ -1318,7 +1318,7 @@ inline InlineIterator BreakingContext::optimalLineBreakLocationForTrailingWord() > return lineBreak; > bool canUseLineBreakShortcut = m_renderTextInfo.lineBreakIterator.mode() == LineBreakIteratorMode::Default; > bool breakNBSP = m_autoWrap && m_currentStyle->nbspMode() == NBSPMode::Space; >- std::optional<unsigned> nextBreakablePosition = lineBreak.nextBreakablePosition(); >+ Optional<unsigned> nextBreakablePosition = lineBreak.nextBreakablePosition(); > isBreakable(m_renderTextInfo.lineBreakIterator, lineBreak.offset() + 1, nextBreakablePosition, breakNBSP, canUseLineBreakShortcut, m_currentStyle->wordBreak() == WordBreak::KeepAll); > if (!nextBreakablePosition || nextBreakablePosition.value() != renderText.text().length()) > return lineBreak; >diff --git a/Source/WebCore/rendering/mathml/MathMLStyle.cpp b/Source/WebCore/rendering/mathml/MathMLStyle.cpp >index 6000da66854d75d0cb77355d58b8b367fe21f088..82f622ef14ae71d30867013b3f19b492729cde4f 100644 >--- a/Source/WebCore/rendering/mathml/MathMLStyle.cpp >+++ b/Source/WebCore/rendering/mathml/MathMLStyle.cpp >@@ -136,10 +136,10 @@ void MathMLStyle::resolveMathMLStyle(RenderObject* renderer) > // The displaystyle and mathvariant attributes override the default behavior. > auto* element = downcast<RenderElement>(renderer)->element(); > if (is<MathMLElement>(element)) { >- std::optional<bool> displayStyle = downcast<MathMLElement>(element)->specifiedDisplayStyle(); >+ Optional<bool> displayStyle = downcast<MathMLElement>(element)->specifiedDisplayStyle(); > if (displayStyle) > m_displayStyle = displayStyle.value(); >- std::optional<MathMLElement::MathVariant> mathVariant = downcast<MathMLElement>(element)->specifiedMathVariant(); >+ Optional<MathMLElement::MathVariant> mathVariant = downcast<MathMLElement>(element)->specifiedMathVariant(); > if (mathVariant) > m_mathVariant = mathVariant.value(); > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp >index 00bde6d6694d8ac84313bf7158d0319f10f8337b..c9e3513133a7a3e0bb6349ca5b34a35afd29192f 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp >@@ -178,11 +178,11 @@ LayoutUnit toUserUnits(const MathMLElement::Length& length, const RenderStyle& s > } > } > >-std::optional<int> RenderMathMLTable::firstLineBaseline() const >+Optional<int> RenderMathMLTable::firstLineBaseline() const > { > // By default the vertical center of <mtable> is aligned on the math axis. > // This is different than RenderTable::firstLineBoxBaseline, which returns the baseline of the first row of a <table>. >- return std::optional<int>(logicalHeight() / 2 + axisHeight(style())); >+ return Optional<int>(logicalHeight() / 2 + axisHeight(style())); > } > > void RenderMathMLBlock::layoutItems(bool relayoutChildren) >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h >index 3c4e6de40e58ed6687f84fc01ff359dcf4e47e65..048c7ec885288c194dae2d2db1110a971cc482ca 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h >@@ -111,7 +111,7 @@ public: > private: > bool isRenderMathMLTable() const final { return true; } > const char* renderName() const final { return "RenderMathMLTable"; } >- std::optional<int> firstLineBaseline() const final; >+ Optional<int> firstLineBaseline() const final; > > Ref<MathMLStyle> m_mathMLStyle; > }; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp >index 4958571c1287b2463e42dc494ca1e88130e15cb5..9a1047f8ac1d81938727e3d62c568b26faa770e1 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp >@@ -268,10 +268,10 @@ void RenderMathMLFraction::paint(PaintInfo& info, const LayoutPoint& paintOffset > info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + logicalWidth(), adjustedPaintOffset.y()))); > } > >-std::optional<int> RenderMathMLFraction::firstLineBaseline() const >+Optional<int> RenderMathMLFraction::firstLineBaseline() const > { > if (isValid()) >- return std::optional<int>(std::lround(static_cast<float>(ascentOverHorizontalAxis() + mathAxisHeight()))); >+ return Optional<int>(std::lround(static_cast<float>(ascentOverHorizontalAxis() + mathAxisHeight()))); > return RenderMathMLBlock::firstLineBaseline(); > } > >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h >index 5d1d17a9232de4f4b8fde0256325b12208477661..8e2c18412da8dcf89456ed686fa0bb10a43a5117 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h >@@ -51,7 +51,7 @@ private: > > void computePreferredLogicalWidths() final; > void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) final; >- std::optional<int> firstLineBaseline() const final; >+ Optional<int> firstLineBaseline() const final; > void paint(PaintInfo&, const LayoutPoint&) final; > RenderMathMLOperator* unembellishedOperator() const final; > >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >index 18bd9ccc215484598b135a4a000236c4fcfc6686..7a7113ad66543d01d3077afab94014a3c5adeb2c 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >@@ -295,10 +295,10 @@ LayoutUnit RenderMathMLOperator::verticalStretchedOperatorShift() const > return (m_stretchDepthBelowBaseline - m_stretchHeightAboveBaseline - m_mathOperator.descent() + m_mathOperator.ascent()) / 2; > } > >-std::optional<int> RenderMathMLOperator::firstLineBaseline() const >+Optional<int> RenderMathMLOperator::firstLineBaseline() const > { > if (useMathOperator()) >- return std::optional<int>(std::lround(static_cast<float>(m_mathOperator.ascent() - verticalStretchedOperatorShift()))); >+ return Optional<int>(std::lround(static_cast<float>(m_mathOperator.ascent() - verticalStretchedOperatorShift()))); > return RenderMathMLToken::firstLineBaseline(); > } > >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h >index 44b52cc8364456f8ce3527fdca03ba728ab689f5..a237cb14facd644a5526b0bbb982e1a28b725b0e 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h >@@ -79,7 +79,7 @@ private: > bool isRenderMathMLOperator() const final { return true; } > bool isInvisibleOperator() const; > >- std::optional<int> firstLineBaseline() const final; >+ Optional<int> firstLineBaseline() const final; > RenderMathMLOperator* unembellishedOperator() const final { return const_cast<RenderMathMLOperator*>(this); } > > LayoutUnit verticalStretchedOperatorShift() const; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp b/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp >index 94f8eb22a1c9626a036613d716f7f329432aefa5..9cdd5c95c71edbf282e5bbdc59282bd4ca1b8313 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp >@@ -114,7 +114,7 @@ void RenderMathMLPadded::layoutBlock(bool relayoutChildren, LayoutUnit) > clearNeedsLayout(); > } > >-std::optional<int> RenderMathMLPadded::firstLineBaseline() const >+Optional<int> RenderMathMLPadded::firstLineBaseline() const > { > // We try and calculate the baseline from the position of the first child. > LayoutUnit ascent; >@@ -122,7 +122,7 @@ std::optional<int> RenderMathMLPadded::firstLineBaseline() const > ascent = ascentForChild(*baselineChild) + baselineChild->logicalTop() + voffset(); > else > ascent = mpaddedHeight(0); >- return std::optional<int>(std::lround(static_cast<float>(ascent))); >+ return Optional<int>(std::lround(static_cast<float>(ascent))); > } > > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLPadded.h b/Source/WebCore/rendering/mathml/RenderMathMLPadded.h >index 0906379f2d26d46ecc4b32b693dc3d317df2cd10..0d7f310abb45f3a208f162611d7288d9cfa1cbc6 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLPadded.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLPadded.h >@@ -43,7 +43,7 @@ private: > > void computePreferredLogicalWidths() final; > void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) final; >- std::optional<int> firstLineBaseline() const final; >+ Optional<int> firstLineBaseline() const final; > > MathMLPaddedElement& element() const { return static_cast<MathMLPaddedElement&>(nodeForNonAnonymous()); } > LayoutUnit voffset() const; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp >index 1c527a8ac40962df56cee0c03d1be8a0c21658e5..d072fede82ab91598a1b8dfe540306f4997538cb 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp >@@ -52,13 +52,13 @@ MathMLRowElement& RenderMathMLRow::element() const > return static_cast<MathMLRowElement&>(nodeForNonAnonymous()); > } > >-std::optional<int> RenderMathMLRow::firstLineBaseline() const >+Optional<int> RenderMathMLRow::firstLineBaseline() const > { > auto* baselineChild = firstChildBox(); > if (!baselineChild) >- return std::optional<int>(); >+ return Optional<int>(); > >- return std::optional<int>(static_cast<int>(lroundf(ascentForChild(*baselineChild) + baselineChild->logicalTop()))); >+ return Optional<int>(static_cast<int>(lroundf(ascentForChild(*baselineChild) + baselineChild->logicalTop()))); > } > > static RenderMathMLOperator* toVerticalStretchyOperator(RenderBox* box) >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRow.h b/Source/WebCore/rendering/mathml/RenderMathMLRow.h >index 119d2b91ffb8175811fabc8cc3732ddf0d0a6ffb..e8758ae8ebc10a5f1abd841967fd15c685bd8918 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLRow.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLRow.h >@@ -42,7 +42,7 @@ public: > > protected: > void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) override; >- std::optional<int> firstLineBaseline() const override; >+ Optional<int> firstLineBaseline() const override; > > void stretchVerticalOperatorsAndLayoutChildren(); > void getContentBoundingBox(LayoutUnit& width, LayoutUnit& ascent, LayoutUnit& descent) const; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp >index 5fb73d29251e04ca9e52208c36b2c49b4846d913..1ec49f21a42c1576be2c4a9c08d159ffa88bf4f9 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp >@@ -67,13 +67,13 @@ RenderMathMLOperator* RenderMathMLScripts::unembellishedOperator() const > return downcast<RenderMathMLBlock>(base)->unembellishedOperator(); > } > >-std::optional<RenderMathMLScripts::ReferenceChildren> RenderMathMLScripts::validateAndGetReferenceChildren() >+Optional<RenderMathMLScripts::ReferenceChildren> RenderMathMLScripts::validateAndGetReferenceChildren() > { > // All scripted elements must have at least one child. > // The first child is the base. > auto base = firstChildBox(); > if (!base) >- return std::nullopt; >+ return WTF::nullopt; > > ReferenceChildren reference; > reference.base = base; >@@ -94,7 +94,7 @@ std::optional<RenderMathMLScripts::ReferenceChildren> RenderMathMLScripts::valid > // <mover> base overscript </mover> > auto script = base->nextSiblingBox(); > if (!script || isPrescriptDelimiter(*script) || script->nextSiblingBox()) >- return std::nullopt; >+ return WTF::nullopt; > reference.firstPostScript = script; > return reference; > } >@@ -106,10 +106,10 @@ std::optional<RenderMathMLScripts::ReferenceChildren> RenderMathMLScripts::valid > // <munderover> base subscript superscript </munderover> > auto subScript = base->nextSiblingBox(); > if (!subScript || isPrescriptDelimiter(*subScript)) >- return std::nullopt; >+ return WTF::nullopt; > auto superScript = subScript->nextSiblingBox(); > if (!superScript || isPrescriptDelimiter(*superScript) || superScript->nextSiblingBox()) >- return std::nullopt; >+ return WTF::nullopt; > reference.firstPostScript = subScript; > return reference; > } >@@ -139,19 +139,19 @@ std::optional<RenderMathMLScripts::ReferenceChildren> RenderMathMLScripts::valid > if (isPrescriptDelimiter(*script)) { > // This is a <mprescripts/>. Let's check 2a) and 2c). > if (!numberOfScriptIsEven || reference.firstPreScript) >- return std::nullopt; >+ return WTF::nullopt; > reference.firstPreScript = script->nextSiblingBox(); // We do 1). > reference.prescriptDelimiter = script; > continue; > } > numberOfScriptIsEven = !numberOfScriptIsEven; > } >- return numberOfScriptIsEven ? std::optional<ReferenceChildren>(reference) : std::nullopt; // We verify 2b). >+ return numberOfScriptIsEven ? Optional<ReferenceChildren>(reference) : WTF::nullopt; // We verify 2b). > } > } > > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > > LayoutUnit RenderMathMLScripts::spaceAfterScript() >@@ -464,12 +464,12 @@ void RenderMathMLScripts::layoutBlock(bool relayoutChildren, LayoutUnit) > clearNeedsLayout(); > } > >-std::optional<int> RenderMathMLScripts::firstLineBaseline() const >+Optional<int> RenderMathMLScripts::firstLineBaseline() const > { > auto* base = firstChildBox(); > if (!base) >- return std::optional<int>(); >- return std::optional<int>(static_cast<int>(lroundf(ascentForChild(*base) + base->logicalTop()))); >+ return Optional<int>(); >+ return Optional<int>(static_cast<int>(lroundf(ascentForChild(*base) + base->logicalTop()))); > } > > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.h b/Source/WebCore/rendering/mathml/RenderMathMLScripts.h >index 6cc77d8f4ab0b863a82525022fe57b5f466994d6..dda0be52d42a94c5cafbf022455559dc2aff23c5 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.h >@@ -53,14 +53,14 @@ protected: > > private: > MathMLScriptsElement& element() const; >- std::optional<int> firstLineBaseline() const final; >+ Optional<int> firstLineBaseline() const final; > struct ReferenceChildren { > RenderBox* base; > RenderBox* prescriptDelimiter; > RenderBox* firstPostScript; > RenderBox* firstPreScript; > }; >- std::optional<ReferenceChildren> validateAndGetReferenceChildren(); >+ Optional<ReferenceChildren> validateAndGetReferenceChildren(); > LayoutUnit spaceAfterScript(); > LayoutUnit italicCorrection(const ReferenceChildren&); > struct VerticalParameters { >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp >index b64517684ed0cf9d4b23021332911def95ebc415..099fe68e23c62436414a9a8f7fb22840273f7cbe 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp >@@ -84,11 +84,11 @@ void RenderMathMLSpace::layoutBlock(bool relayoutChildren, LayoutUnit) > clearNeedsLayout(); > } > >-std::optional<int> RenderMathMLSpace::firstLineBaseline() const >+Optional<int> RenderMathMLSpace::firstLineBaseline() const > { > LayoutUnit height, depth; > getSpaceHeightAndDepth(height, depth); >- return std::optional<int>(height); >+ return Optional<int>(height); > } > > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.h b/Source/WebCore/rendering/mathml/RenderMathMLSpace.h >index 9dcec7b6b1c81b535321295b7bbda991658b844b..b2597261492c714cf3a20cfdd3b7b716959b01b7 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.h >@@ -44,7 +44,7 @@ private: > bool isChildAllowed(const RenderObject&, const RenderStyle&) const final { return false; } > void computePreferredLogicalWidths() final; > void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) final; >- std::optional<int> firstLineBaseline() const final; >+ Optional<int> firstLineBaseline() const final; > > LayoutUnit spaceWidth() const; > void getSpaceHeightAndDepth(LayoutUnit& height, LayoutUnit& depth) const; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >index 5d4166b8bab4b055736d9e7d2f40e5ce452e4177..967280bbb5a1d20231b9b276f5a45f0301b5f94e 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >@@ -519,7 +519,7 @@ void RenderMathMLToken::updateMathVariantGlyph() > { > ASSERT(m_mathVariantGlyphDirty); > >- m_mathVariantCodePoint = std::nullopt; >+ m_mathVariantCodePoint = WTF::nullopt; > m_mathVariantGlyphDirty = false; > > // Early return if the token element contains RenderElements. >@@ -554,12 +554,12 @@ void RenderMathMLToken::updateFromElement() > setMathVariantGlyphDirty(); > } > >-std::optional<int> RenderMathMLToken::firstLineBaseline() const >+Optional<int> RenderMathMLToken::firstLineBaseline() const > { > if (m_mathVariantCodePoint) { > auto mathVariantGlyph = style().fontCascade().glyphDataForCharacter(m_mathVariantCodePoint.value(), m_mathVariantIsMirrored); > if (mathVariantGlyph.font) >- return std::optional<int>(static_cast<int>(lroundf(-mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).y()))); >+ return Optional<int>(static_cast<int>(lroundf(-mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).y()))); > } > return RenderMathMLBlock::firstLineBaseline(); > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.h b/Source/WebCore/rendering/mathml/RenderMathMLToken.h >index 9ce8f583f559758767f6b709b0029fc91aec3973..c26f11af639b3e92ec97e07c40afd4f58039ebed 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.h >@@ -49,7 +49,7 @@ public: > protected: > void paint(PaintInfo&, const LayoutPoint&) override; > void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) override; >- std::optional<int> firstLineBaseline() const override; >+ Optional<int> firstLineBaseline() const override; > void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) override; > void computePreferredLogicalWidths() override; > >@@ -64,7 +64,7 @@ private: > m_mathVariantGlyphDirty = true; > setNeedsLayoutAndPrefWidthsRecalc(); > } >- std::optional<UChar32> m_mathVariantCodePoint { std::nullopt }; >+ Optional<UChar32> m_mathVariantCodePoint { WTF::nullopt }; > bool m_mathVariantIsMirrored { false }; > bool m_mathVariantGlyphDirty { false }; > }; >diff --git a/Source/WebCore/rendering/style/CounterDirectives.h b/Source/WebCore/rendering/style/CounterDirectives.h >index 4a9aade6664f02f3b2da4ada479436f2cbba3dd1..5503e9fe4667720e7318f723176c226741287bce 100644 >--- a/Source/WebCore/rendering/style/CounterDirectives.h >+++ b/Source/WebCore/rendering/style/CounterDirectives.h >@@ -26,8 +26,8 @@ > namespace WebCore { > > struct CounterDirectives { >- std::optional<int> resetValue; >- std::optional<int> incrementValue; >+ Optional<int> resetValue; >+ Optional<int> incrementValue; > }; > > constexpr bool operator==(const CounterDirectives& a, const CounterDirectives& b) >diff --git a/Source/WebCore/rendering/style/GridPosition.cpp b/Source/WebCore/rendering/style/GridPosition.cpp >index d596736e6d78ee568ef89c61801049849eeb3a76..f12d3afe6fcfc825705c9c4c96847e17b4b10d21 100644 >--- a/Source/WebCore/rendering/style/GridPosition.cpp >+++ b/Source/WebCore/rendering/style/GridPosition.cpp >@@ -33,7 +33,7 @@ > > namespace WebCore { > >-std::optional<int> GridPosition::gMaxPositionForTesting; >+Optional<int> GridPosition::gMaxPositionForTesting; > static const int kGridMaxPosition = 1000000; > > void GridPosition::setExplicitPosition(int position, const String& namedGridLine) >diff --git a/Source/WebCore/rendering/style/GridPosition.h b/Source/WebCore/rendering/style/GridPosition.h >index a39f4d8e06559dd732a4fbeb0d54a38a96961b0d..69c50f8d934589e1b975d65bc9483c48927e588c 100644 >--- a/Source/WebCore/rendering/style/GridPosition.h >+++ b/Source/WebCore/rendering/style/GridPosition.h >@@ -85,7 +85,7 @@ public: > WEBCORE_EXPORT static void setMaxPositionForTesting(unsigned); > > private: >- static std::optional<int> gMaxPositionForTesting; >+ static Optional<int> gMaxPositionForTesting; > > void setIntegerPosition(int integerPosition) { m_integerPosition = clampTo(integerPosition, min(), max()); } > >diff --git a/Source/WebCore/rendering/style/NinePieceImage.h b/Source/WebCore/rendering/style/NinePieceImage.h >index d5465e94e9252ec45584a9c4c43c5dc1ed987b0a..daf74964601d47fa362b7122df5638fbfe1f61c8 100644 >--- a/Source/WebCore/rendering/style/NinePieceImage.h >+++ b/Source/WebCore/rendering/style/NinePieceImage.h >@@ -76,7 +76,7 @@ inline bool isVerticalPiece(ImagePiece piece) > return piece == LeftPiece || piece == RightPiece || piece == MiddlePiece; > } > >-inline std::optional<PhysicalBoxSide> imagePieceHorizontalSide(ImagePiece piece) >+inline Optional<PhysicalBoxSide> imagePieceHorizontalSide(ImagePiece piece) > { > if (piece == TopLeftPiece || piece == TopPiece || piece == TopRightPiece) > return PhysicalBoxSide::Top; >@@ -84,10 +84,10 @@ inline std::optional<PhysicalBoxSide> imagePieceHorizontalSide(ImagePiece piece) > if (piece == BottomLeftPiece || piece == BottomPiece || piece == BottomRightPiece) > return PhysicalBoxSide::Bottom; > >- return std::nullopt; >+ return WTF::nullopt; > } > >-inline std::optional<PhysicalBoxSide> imagePieceVerticalSide(ImagePiece piece) >+inline Optional<PhysicalBoxSide> imagePieceVerticalSide(ImagePiece piece) > { > if (piece == TopLeftPiece || piece == LeftPiece || piece == BottomLeftPiece) > return PhysicalBoxSide::Left; >@@ -95,7 +95,7 @@ inline std::optional<PhysicalBoxSide> imagePieceVerticalSide(ImagePiece piece) > if (piece == TopRightPiece || piece == RightPiece || piece == BottomRightPiece) > return PhysicalBoxSide::Right; > >- return std::nullopt; >+ return WTF::nullopt; > } > > class NinePieceImage { >diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp >index 552aafcd4394ef834698a415ccced67d2813cc2e..bc3d534a9bbabfb6f390b0d727eec58239356285 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.cpp >+++ b/Source/WebCore/rendering/style/RenderStyle.cpp >@@ -1797,7 +1797,7 @@ void RenderStyle::setFontStretch(FontSelectionValue value) > fontCascade().update(currentFontSelector); > } > >-void RenderStyle::setFontItalic(std::optional<FontSelectionValue> value) >+void RenderStyle::setFontItalic(Optional<FontSelectionValue> value) > { > FontSelector* currentFontSelector = fontCascade().fontSelector(); > auto description = fontDescription(); >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index dbaaf0c763eedcd5dd6a3c16cf16b7ea44961218..54cbfaa4887c1248b4f859fb9eb3cc6e7b7eedfd 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -369,7 +369,7 @@ public: > #endif > FontSelectionValue fontWeight() const { return fontDescription().weight(); } > FontSelectionValue fontStretch() const { return fontDescription().stretch(); } >- std::optional<FontSelectionValue> fontItalic() const { return fontDescription().italic(); } >+ Optional<FontSelectionValue> fontItalic() const { return fontDescription().italic(); } > > const Length& textIndent() const { return m_rareInheritedData->indent; } > TextAlignMode textAlign() const { return static_cast<TextAlignMode>(m_inheritedFlags.textAlign); } >@@ -922,7 +922,7 @@ public: > #endif > void setFontWeight(FontSelectionValue); > void setFontStretch(FontSelectionValue); >- void setFontItalic(std::optional<FontSelectionValue>); >+ void setFontItalic(Optional<FontSelectionValue>); > > void setColor(const Color&); > void setTextIndent(Length&& length) { SET_VAR(m_rareInheritedData, indent, WTFMove(length)); } >diff --git a/Source/WebCore/rendering/style/ShadowData.cpp b/Source/WebCore/rendering/style/ShadowData.cpp >index acad18e63742067a3f39f90d87cdeb4eb7bb5084..3d61c94c0166160858dabd8409fc408670e501ca 100644 >--- a/Source/WebCore/rendering/style/ShadowData.cpp >+++ b/Source/WebCore/rendering/style/ShadowData.cpp >@@ -37,10 +37,10 @@ ShadowData::ShadowData(const ShadowData& o) > { > } > >-std::optional<ShadowData> ShadowData::clone(const ShadowData* data) >+Optional<ShadowData> ShadowData::clone(const ShadowData* data) > { > if (!data) >- return std::nullopt; >+ return WTF::nullopt; > return *data; > } > >diff --git a/Source/WebCore/rendering/style/ShadowData.h b/Source/WebCore/rendering/style/ShadowData.h >index 0177103df3638d7343bd8b192e024aa7218ad1e1..1d75f1e9f079ec5bf9cbdd1b94cfee39fbdc71b9 100644 >--- a/Source/WebCore/rendering/style/ShadowData.h >+++ b/Source/WebCore/rendering/style/ShadowData.h >@@ -56,7 +56,7 @@ public: > } > > ShadowData(const ShadowData&); >- static std::optional<ShadowData> clone(const ShadowData*); >+ static Optional<ShadowData> clone(const ShadowData*); > > ShadowData& operator=(ShadowData&&) = default; > >diff --git a/Source/WebCore/rendering/style/TextUnderlineOffset.h b/Source/WebCore/rendering/style/TextUnderlineOffset.h >index 961e7b2d9312d2a1990d8eab5669030dc9325a3b..807e4db8b798843f337536f95e888c780af92499 100644 >--- a/Source/WebCore/rendering/style/TextUnderlineOffset.h >+++ b/Source/WebCore/rendering/style/TextUnderlineOffset.h >@@ -93,7 +93,7 @@ private: > m_length = 0; > } > >- std::optional<float> m_length; >+ Optional<float> m_length; > }; > > inline TextStream& operator<<(TextStream& ts, const TextUnderlineOffset& offset) >diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >index 22fa7d010908ac56c13b245344847ce0998b3264..dfb4b8766e8d37082350aa7a5c0151dea457855f 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >@@ -98,17 +98,17 @@ LayoutRect RenderSVGForeignObject::clippedOverflowRectForRepaint(const RenderLay > return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); > } > >-std::optional<FloatRect> RenderSVGForeignObject::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<FloatRect> RenderSVGForeignObject::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > return SVGRenderSupport::computeFloatVisibleRectInContainer(*this, rect, container, context); > } > >-std::optional<LayoutRect> RenderSVGForeignObject::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<LayoutRect> RenderSVGForeignObject::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { >- std::optional<FloatRect> adjustedRect = computeFloatVisibleRectInContainer(rect, container, context); >+ Optional<FloatRect> adjustedRect = computeFloatVisibleRectInContainer(rect, container, context); > if (adjustedRect) > return enclosingLayoutRect(*adjustedRect); >- return std::nullopt; >+ return WTF::nullopt; > } > > const AffineTransform& RenderSVGForeignObject::localToParentTransform() const >diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >index 35def3075bc875c6b4a34e326f8085f74fbf16c8..c281e1c52af841b2d7d0f0c6ba9ad012af12cd0e 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >@@ -40,8 +40,8 @@ public: > void paint(PaintInfo&, const LayoutPoint&) override; > > LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >- std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >- std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >+ Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >+ Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > > bool requiresLayer() const override { return false; } > void layout() override; >diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.cpp b/Source/WebCore/rendering/svg/RenderSVGInline.cpp >index 0f60e6ca18d9655e89f3f2670dc1b9b5ae3457e3..473a693715db90a694192926a365085592124701 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGInline.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGInline.cpp >@@ -75,7 +75,7 @@ LayoutRect RenderSVGInline::clippedOverflowRectForRepaint(const RenderLayerModel > return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); > } > >-std::optional<FloatRect> RenderSVGInline::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<FloatRect> RenderSVGInline::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > return SVGRenderSupport::computeFloatVisibleRectInContainer(*this, rect, container, context); > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.h b/Source/WebCore/rendering/svg/RenderSVGInline.h >index 294d461113065ec60a23245b864f64948dc71839..5ba4b47f939e3b2703433c536a23f4bbb0e0c6bd 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGInline.h >+++ b/Source/WebCore/rendering/svg/RenderSVGInline.h >@@ -51,7 +51,7 @@ private: > FloatRect repaintRectInLocalCoordinates() const final; > > LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const final; >- std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; >+ Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; > void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const final; > const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const final; > void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const final; >diff --git a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp >index 7e3448a194ae19e5ae75946eaeb2752a1286b2f4..64069c479d254fc43aeaefc6b05a1830cdef8d48 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp >@@ -52,7 +52,7 @@ LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayer > return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); > } > >-std::optional<FloatRect> RenderSVGModelObject::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<FloatRect> RenderSVGModelObject::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > return SVGRenderSupport::computeFloatVisibleRectInContainer(*this, rect, container, context); > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGModelObject.h b/Source/WebCore/rendering/svg/RenderSVGModelObject.h >index 07ec0f5fcf33cbcfda8e01ae530377b43d6c3d5a..4d4f453e317e3a579d79e053c01cf754a0ed6191 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGModelObject.h >+++ b/Source/WebCore/rendering/svg/RenderSVGModelObject.h >@@ -47,7 +47,7 @@ class RenderSVGModelObject : public RenderElement { > WTF_MAKE_ISO_ALLOCATED(RenderSVGModelObject); > public: > LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >- std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; >+ Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; > LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap*) const final; > > void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const final; >diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >index e63200697a6848c4fd2a0c8e0490af41bfba772b..e1502ef75bebf677f617c42184450b680f7100a8 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >@@ -125,7 +125,7 @@ LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(ShouldComputePreferred sho > return RenderReplaced::computeReplacedLogicalWidth(shouldComputePreferred); > } > >-LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight(std::optional<LayoutUnit> estimatedUsedWidth) const >+LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight(Optional<LayoutUnit> estimatedUsedWidth) const > { > // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size. > if (!m_containerSize.isEmpty()) >@@ -341,7 +341,7 @@ LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelOb > return RenderReplaced::computeRectForRepaint(enclosingIntRect(repaintRect), repaintContainer); > } > >-std::optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > // Apply our local transforms (except for x/y translation), then our shadow, > // and then call RenderBox's method to handle all the normal CSS Box model bits >@@ -355,7 +355,7 @@ std::optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const > if (shouldApplyViewportClip()) { > if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) { > if (!adjustedRect.edgeInclusiveIntersect(snappedIntRect(borderBoxRect()))) >- return std::nullopt; >+ return WTF::nullopt; > } else > adjustedRect.intersect(snappedIntRect(borderBoxRect())); > } >@@ -367,9 +367,9 @@ std::optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const > adjustedRect.unite(decoratedRepaintRect); > } > >- if (std::optional<LayoutRect> rectInContainer = RenderReplaced::computeVisibleRectInContainer(enclosingIntRect(adjustedRect), container, context)) >+ if (Optional<LayoutRect> rectInContainer = RenderReplaced::computeVisibleRectInContainer(enclosingIntRect(adjustedRect), container, context)) > return FloatRect(*rectInContainer); >- return std::nullopt; >+ return WTF::nullopt; > } > > // This method expects local CSS box coordinates. >diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.h b/Source/WebCore/rendering/svg/RenderSVGRoot.h >index 0743a75aa69eb26a21093a680a6f17ef246e6a27..c7635b7dc58971695038b41a75a5c93ae82b8f32 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRoot.h >+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.h >@@ -69,7 +69,7 @@ private: > const char* renderName() const override { return "RenderSVGRoot"; } > > LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const override; >- LayoutUnit computeReplacedLogicalHeight(std::optional<LayoutUnit> estimatedUsedWidth = std::nullopt) const override; >+ LayoutUnit computeReplacedLogicalHeight(Optional<LayoutUnit> estimatedUsedWidth = WTF::nullopt) const override; > void layout() override; > void paintReplaced(PaintInfo&, const LayoutPoint&) override; > >@@ -92,7 +92,7 @@ private: > bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; > > LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >- std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >+ Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > > void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override; > const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override; >diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.cpp b/Source/WebCore/rendering/svg/RenderSVGShape.cpp >index ea43610610f224d088a137aa41f168d219ca5ed2..fa3bc9170c3503b40a6b12cb0515ccd395504013 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGShape.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGShape.cpp >@@ -200,7 +200,7 @@ Path* RenderSVGShape::nonScalingStrokePath(const Path* path, const AffineTransfo > > bool RenderSVGShape::setupNonScalingStrokeContext(AffineTransform& strokeTransform, GraphicsContextStateSaver& stateSaver) > { >- std::optional<AffineTransform> inverse = strokeTransform.inverse(); >+ Optional<AffineTransform> inverse = strokeTransform.inverse(); > if (!inverse) > return false; > >@@ -441,7 +441,7 @@ FloatRect RenderSVGShape::calculateStrokeBoundingBox() const > BoundingRectStrokeStyleApplier strokeStyle(*this); > if (hasNonScalingStroke()) { > AffineTransform nonScalingTransform = nonScalingStrokeTransform(); >- if (std::optional<AffineTransform> inverse = nonScalingTransform.inverse()) { >+ if (Optional<AffineTransform> inverse = nonScalingTransform.inverse()) { > Path* usePath = nonScalingStrokePath(m_path.get(), nonScalingTransform); > FloatRect strokeBoundingRect = usePath->strokeBoundingRect(&strokeStyle); > strokeBoundingRect = inverse.value().mapRect(strokeBoundingRect); >diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp >index 8b355faf36fc492fea9ecf78a2b5651a7bcf96e8..637d8c4fd844a44fed9492ffc9e5188d0723b28d 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp >@@ -92,15 +92,15 @@ LayoutRect RenderSVGText::clippedOverflowRectForRepaint(const RenderLayerModelOb > return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); > } > >-std::optional<LayoutRect> RenderSVGText::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<LayoutRect> RenderSVGText::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { >- std::optional<FloatRect> adjustedRect = computeFloatVisibleRectInContainer(rect, container, context); >+ Optional<FloatRect> adjustedRect = computeFloatVisibleRectInContainer(rect, container, context); > if (adjustedRect) > return enclosingLayoutRect(*adjustedRect); >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<FloatRect> RenderSVGText::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+Optional<FloatRect> RenderSVGText::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > return SVGRenderSupport::computeFloatVisibleRectInContainer(*this, rect, container, context); > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGText.h b/Source/WebCore/rendering/svg/RenderSVGText.h >index f88c769c02826dfb6b092ccdabc5c1c4c636b27c..64c47a12bdcda956ec8b8f6c9c16ee40940e49f2 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGText.h >+++ b/Source/WebCore/rendering/svg/RenderSVGText.h >@@ -78,8 +78,8 @@ private: > void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override; > > LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >- std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >- std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >+ Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; >+ Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > > void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override; > const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override; >diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp >index f036802c3e00de3a4a7a3733763ebb50f24dcc35..ef46a5a85ce8181e3fe0aa5286e9aa10e5a8ee41 100644 >--- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp >+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp >@@ -62,7 +62,7 @@ LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderElement& > return enclosingLayoutRect(renderer.computeFloatRectForRepaint(repaintRect, repaintContainer)); > } > >-std::optional<FloatRect> SVGRenderSupport::computeFloatVisibleRectInContainer(const RenderElement& renderer, const FloatRect& rect, const RenderLayerModelObject* container, RenderObject::VisibleRectContext context) >+Optional<FloatRect> SVGRenderSupport::computeFloatVisibleRectInContainer(const RenderElement& renderer, const FloatRect& rect, const RenderLayerModelObject* container, RenderObject::VisibleRectContext context) > { > FloatRect adjustedRect = rect; > const SVGRenderStyle& svgStyle = renderer.style().svgStyle(); >diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.h b/Source/WebCore/rendering/svg/SVGRenderSupport.h >index 2b77c2afa759931b40f929cbc8be994d67677ffb..a6f792312559811907eddef4f83d0cab35600481 100644 >--- a/Source/WebCore/rendering/svg/SVGRenderSupport.h >+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.h >@@ -65,7 +65,7 @@ public: > > // Important functions used by nearly all SVG renderers centralizing coordinate transformations / repaint rect calculations > static LayoutRect clippedOverflowRectForRepaint(const RenderElement&, const RenderLayerModelObject* repaintContainer); >- static std::optional<FloatRect> computeFloatVisibleRectInContainer(const RenderElement&, const FloatRect&, const RenderLayerModelObject* container, RenderObject::VisibleRectContext); >+ static Optional<FloatRect> computeFloatVisibleRectInContainer(const RenderElement&, const FloatRect&, const RenderLayerModelObject* container, RenderObject::VisibleRectContext); > static const RenderElement& localToParentTransform(const RenderElement&, AffineTransform &); > static void mapLocalToContainer(const RenderElement&, const RenderLayerModelObject* repaintContainer, TransformState&, bool* wasFixed); > static const RenderElement* pushMappingToContainer(const RenderElement&, const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&); >diff --git a/Source/WebCore/rendering/svg/SVGTextQuery.cpp b/Source/WebCore/rendering/svg/SVGTextQuery.cpp >index fd8902294b6a004ca50586f57aba644b6e03e5e7..d3af293997d83786ecec5be817736a097b87bf4b 100644 >--- a/Source/WebCore/rendering/svg/SVGTextQuery.cpp >+++ b/Source/WebCore/rendering/svg/SVGTextQuery.cpp >@@ -169,7 +169,7 @@ void SVGTextQuery::modifyStartEndPositionsRespectingLigatures(Data* queryData, u > bool alterStartPosition = true; > bool alterEndPosition = true; > >- std::optional<unsigned> lastPositionOffset; >+ Optional<unsigned> lastPositionOffset; > for (; textMetricsOffset < textMetricsSize && positionOffset < positionSize; ++textMetricsOffset) { > SVGTextMetrics& metrics = textMetricsValues[textMetricsOffset]; > >diff --git a/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp b/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >index d3a6f8cb630c7cdf23ccc8e0cf0120195e40b156..6ac88f88131e5b0996d983ab35f496f53ada3ac6 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >+++ b/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >@@ -79,7 +79,7 @@ RenderTreeUpdater::Parent::Parent(ContainerNode& root) > RenderTreeUpdater::Parent::Parent(Element& element, const Style::ElementUpdates* updates) > : element(&element) > , updates(updates) >- , renderTreePosition(element.renderer() ? std::make_optional(RenderTreePosition(*element.renderer())) : std::nullopt) >+ , renderTreePosition(element.renderer() ? makeOptional(RenderTreePosition(*element.renderer())) : WTF::nullopt) > { > } > >diff --git a/Source/WebCore/rendering/updating/RenderTreeUpdater.h b/Source/WebCore/rendering/updating/RenderTreeUpdater.h >index 45b729ced32803aeac3ef9a36d3391b9e25bc7ff..531f2cfd092ad272cf4fa99f8c6309ab69d2cd21 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeUpdater.h >+++ b/Source/WebCore/rendering/updating/RenderTreeUpdater.h >@@ -68,7 +68,7 @@ private: > struct Parent { > Element* element { nullptr }; > const Style::ElementUpdates* updates { nullptr }; >- std::optional<RenderTreePosition> renderTreePosition; >+ Optional<RenderTreePosition> renderTreePosition; > > bool didCreateOrDestroyChildRenderer { false }; > RenderObject* previousChildRenderer { nullptr }; >diff --git a/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp b/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp >index 45cf49013e3d1027eabff4b7e88d5af96b3e1f11..72fa0bf50ba1b5f047f393f96ad2902b508e1dd2 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp >+++ b/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp >@@ -89,7 +89,7 @@ static void updateStyleForContentRenderers(RenderElement& pseudoRenderer, const > } > } > >-void RenderTreeUpdater::GeneratedContent::updatePseudoElement(Element& current, const std::optional<Style::ElementUpdate>& update, PseudoId pseudoId) >+void RenderTreeUpdater::GeneratedContent::updatePseudoElement(Element& current, const Optional<Style::ElementUpdate>& update, PseudoId pseudoId) > { > PseudoElement* pseudoElement = pseudoId == PseudoId::Before ? current.beforePseudoElement() : current.afterPseudoElement(); > >@@ -154,7 +154,7 @@ void RenderTreeUpdater::GeneratedContent::updatePseudoElement(Element& current, > m_updater.m_builder.updateAfterDescendants(*pseudoElementRenderer); > } > >-bool RenderTreeUpdater::GeneratedContent::needsPseudoElement(const std::optional<Style::ElementUpdate>& update) >+bool RenderTreeUpdater::GeneratedContent::needsPseudoElement(const Optional<Style::ElementUpdate>& update) > { > if (!update) > return false; >diff --git a/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h b/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h >index d16367cfaa0a3ac229ebe6d12f43725c1da7c2dd..02e1db18fa9132e12aee8fe0ca1d053086277301 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h >+++ b/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h >@@ -38,7 +38,7 @@ class RenderTreeUpdater::GeneratedContent { > public: > GeneratedContent(RenderTreeUpdater&); > >- void updatePseudoElement(Element&, const std::optional<Style::ElementUpdate>&, PseudoId); >+ void updatePseudoElement(Element&, const Optional<Style::ElementUpdate>&, PseudoId); > void updateRemainingQuotes(); > > static void removeBeforePseudoElement(Element&, RenderTreeBuilder&); >@@ -47,7 +47,7 @@ public: > private: > void updateQuotesUpTo(RenderQuote*); > >- bool needsPseudoElement(const std::optional<Style::ElementUpdate>&); >+ bool needsPseudoElement(const Optional<Style::ElementUpdate>&); > > RenderTreeUpdater& m_updater; > WeakPtr<RenderQuote> m_previousUpdatedQuote; >diff --git a/Source/WebCore/style/StyleScope.h b/Source/WebCore/style/StyleScope.h >index 366fca6003a90d2ffb5c9296ea02803a0562f8fb..7f5500524f2c67cf64bddae98feb4518870d4b9d 100644 >--- a/Source/WebCore/style/StyleScope.h >+++ b/Source/WebCore/style/StyleScope.h >@@ -171,7 +171,7 @@ private: > HashSet<const Element*> m_elementsInHeadWithPendingSheets; > HashSet<const Element*> m_elementsInBodyWithPendingSheets; > >- std::optional<UpdateType> m_pendingUpdate; >+ Optional<UpdateType> m_pendingUpdate; > bool m_hasDescendantWithPendingUpdate { false }; > > ListHashSet<Node*> m_styleSheetCandidateNodes; >diff --git a/Source/WebCore/style/StyleUpdate.h b/Source/WebCore/style/StyleUpdate.h >index d9d18af3f3b44f5ac07d88c33a5fc32e11b5dfc5..20ad6577e192d81d0858b94dc446c54562c94ed1 100644 >--- a/Source/WebCore/style/StyleUpdate.h >+++ b/Source/WebCore/style/StyleUpdate.h >@@ -53,14 +53,14 @@ enum class DescendantsToResolve { None, ChildrenWithExplicitInherit, Children, A > struct ElementUpdates { > ElementUpdate update; > DescendantsToResolve descendantsToResolve { DescendantsToResolve::None }; >- std::optional<ElementUpdate> beforePseudoElementUpdate; >- std::optional<ElementUpdate> afterPseudoElementUpdate; >+ Optional<ElementUpdate> beforePseudoElementUpdate; >+ Optional<ElementUpdate> afterPseudoElementUpdate; > }; > > struct TextUpdate { > unsigned offset { 0 }; > unsigned length { std::numeric_limits<unsigned>::max() }; >- std::optional<std::unique_ptr<RenderStyle>> inheritedDisplayContentsStyle; >+ Optional<std::unique_ptr<RenderStyle>> inheritedDisplayContentsStyle; > }; > > class Update { >diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp >index 025b96bbcb4448611c7345b0cdfc7a10d96ce506..8ce1a9e74a4e0f5659c51c52741881e4085f73f5 100644 >--- a/Source/WebCore/svg/SVGElement.cpp >+++ b/Source/WebCore/svg/SVGElement.cpp >@@ -712,11 +712,11 @@ void SVGElement::synchronizeAnimatedSVGAttribute(const QualifiedName& name) cons > nonConstThis->synchronizeAttribute(name); > } > >-std::optional<ElementStyle> SVGElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*) >+Optional<ElementStyle> SVGElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*) > { > // If the element is in a <use> tree we get the style from the definition tree. > if (auto styleElement = makeRefPtr(this->correspondingElement())) { >- std::optional<ElementStyle> style = styleElement->resolveStyle(&parentStyle); >+ Optional<ElementStyle> style = styleElement->resolveStyle(&parentStyle); > StyleResolver::adjustSVGElementStyle(*this, *style->renderStyle); > return style; > } >diff --git a/Source/WebCore/svg/SVGElement.h b/Source/WebCore/svg/SVGElement.h >index f8339e44289ab5cc40805948e01afbe681cbbc78..b2ce28ef74bcf4e157bb828cf0ddeab180aca356 100644 >--- a/Source/WebCore/svg/SVGElement.h >+++ b/Source/WebCore/svg/SVGElement.h >@@ -107,7 +107,7 @@ public: > void synchronizeAnimatedSVGAttribute(const QualifiedName&) const; > static void synchronizeAllAnimatedSVGAttribute(SVGElement*); > >- std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; >+ Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; > > static QualifiedName animatableAttributeForName(const AtomicString&); > #ifndef NDEBUG >diff --git a/Source/WebCore/svg/SVGLengthListValues.h b/Source/WebCore/svg/SVGLengthListValues.h >index b07286064439d09a970523e853d074fd3c763568..4842e7c05bd804dbfcfa6d83d0a44b2ef9d73da8 100644 >--- a/Source/WebCore/svg/SVGLengthListValues.h >+++ b/Source/WebCore/svg/SVGLengthListValues.h >@@ -43,7 +43,7 @@ struct SVGPropertyTraits<SVGLengthListValues> { > list.parse(string, lengthMode); > return list; > } >- static std::optional<SVGLengthListValues> parse(const QualifiedName& attrName, const String& string) >+ static Optional<SVGLengthListValues> parse(const QualifiedName& attrName, const String& string) > { > SVGLengthListValues list; > list.parse(string, SVGLengthValue::lengthModeForAnimatedLengthAttribute(attrName)); >diff --git a/Source/WebCore/svg/SVGLengthValue.h b/Source/WebCore/svg/SVGLengthValue.h >index f84bf03b667f8294e782790139894ac86adc2f1b..92661b21e53e700ca1bafee51e1f7c5ac9d6e345 100644 >--- a/Source/WebCore/svg/SVGLengthValue.h >+++ b/Source/WebCore/svg/SVGLengthValue.h >@@ -147,7 +147,7 @@ private: > > template<> struct SVGPropertyTraits<SVGLengthValue> { > static SVGLengthValue initialValue() { return { }; } >- static std::optional<SVGLengthValue> parse(const QualifiedName& attrName, const String& string) >+ static Optional<SVGLengthValue> parse(const QualifiedName& attrName, const String& string) > { > SVGLengthValue length; > length.setValueAsString(string, SVGLengthValue::lengthModeForAnimatedLengthAttribute(attrName)).hasException(); >diff --git a/Source/WebCore/svg/SVGMarkerTypes.h b/Source/WebCore/svg/SVGMarkerTypes.h >index fac187c322917bb21086ceb9715eb7143fa77596..e51089578e7dcfc6204e5a9da15242d62b520fdc 100644 >--- a/Source/WebCore/svg/SVGMarkerTypes.h >+++ b/Source/WebCore/svg/SVGMarkerTypes.h >@@ -103,7 +103,7 @@ struct SVGPropertyTraits<std::pair<SVGAngleValue, unsigned>> { > angle = { }; > return std::pair<SVGAngleValue, unsigned>(angle, orientType); > } >- static std::optional<std::pair<SVGAngleValue, unsigned>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<std::pair<SVGAngleValue, unsigned>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(const std::pair<SVGAngleValue, unsigned>&) { ASSERT_NOT_REACHED(); return emptyString(); } > }; > >diff --git a/Source/WebCore/svg/SVGNumberListValues.h b/Source/WebCore/svg/SVGNumberListValues.h >index 30c2db3f988276ca8612792ee8833edf149926a1..6e45e0c8ef797c2848b4a06835fc2e0a6f0e1e1d 100644 >--- a/Source/WebCore/svg/SVGNumberListValues.h >+++ b/Source/WebCore/svg/SVGNumberListValues.h >@@ -42,7 +42,7 @@ template<> struct SVGPropertyTraits<SVGNumberListValues> { > list.parse(string); > return list; > } >- static std::optional<SVGNumberListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<SVGNumberListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(const SVGNumberListValues& list) { return list.valueAsString(); } > > using ListItemType = float; >diff --git a/Source/WebCore/svg/SVGPathByteStream.h b/Source/WebCore/svg/SVGPathByteStream.h >index d28c59ebb8985522216ddbd74e147b825f53864f..395a104f0dac84e22522331fe4bb8722d05f12cc 100644 >--- a/Source/WebCore/svg/SVGPathByteStream.h >+++ b/Source/WebCore/svg/SVGPathByteStream.h >@@ -108,7 +108,7 @@ struct SVGPropertyTraits<SVGPathByteStream> { > buildSVGPathByteStreamFromString(string, byteStream, UnalteredParsing); > return byteStream; > } >- static std::optional<SVGPathByteStream> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return { }; } >+ static Optional<SVGPathByteStream> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return { }; } > static String toString(const SVGPathByteStream&) { ASSERT_NOT_REACHED(); return emptyString(); } > }; > >diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp >index f9391b7d388564dc13eeb8dbcbac407125091943..a28e71452cc82c6107734bcdbc7e475fc3cbfc33 100644 >--- a/Source/WebCore/svg/SVGPathElement.cpp >+++ b/Source/WebCore/svg/SVGPathElement.cpp >@@ -198,7 +198,7 @@ void SVGPathElement::parseAttribute(const QualifiedName& name, const AtomicStrin > if (name == SVGNames::dAttr) { > if (!buildSVGPathByteStreamFromString(value, m_pathByteStream, UnalteredParsing)) > document().accessSVGExtensions().reportError("Problem parsing d=\"" + value + "\""); >- m_cachedPath = std::nullopt; >+ m_cachedPath = WTF::nullopt; > return; > } > >@@ -341,7 +341,7 @@ void SVGPathElement::pathSegListChanged(SVGPathSegRole role, ListModification li > appendSVGPathByteStreamFromSVGPathSeg(pathSegList.last().copyRef(), m_pathByteStream, UnalteredParsing); > } else > buildSVGPathByteStreamFromSVGPathSegListValues(pathSegList, m_pathByteStream, UnalteredParsing); >- m_cachedPath = std::nullopt; >+ m_cachedPath = WTF::nullopt; > break; > } > case PathSegUndefinedRole: >diff --git a/Source/WebCore/svg/SVGPathElement.h b/Source/WebCore/svg/SVGPathElement.h >index 667a620945759dd57c9e2fff4e88b61443ada98d..95b915fc7aed0d273284d383191f13d634518056 100644 >--- a/Source/WebCore/svg/SVGPathElement.h >+++ b/Source/WebCore/svg/SVGPathElement.h >@@ -131,7 +131,7 @@ private: > > private: > SVGPathByteStream m_pathByteStream; >- mutable std::optional<Path> m_cachedPath; >+ mutable Optional<Path> m_cachedPath; > bool m_isAnimValObserved { false }; > > class SVGAnimatedCustomPathSegListAttribute : public SVGAnimatedPathSegListAttribute { >diff --git a/Source/WebCore/svg/SVGPointListValues.h b/Source/WebCore/svg/SVGPointListValues.h >index 362fdcc5d7d341c0f9371e5b5cbee2e5f265e584..89075b3b96a50a358b69eb32f36238b5a44614df 100644 >--- a/Source/WebCore/svg/SVGPointListValues.h >+++ b/Source/WebCore/svg/SVGPointListValues.h >@@ -44,7 +44,7 @@ struct SVGPropertyTraits<SVGPointListValues> { > pointsListFromSVGData(list, string); > return list; > } >- static std::optional<SVGPointListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return { }; } >+ static Optional<SVGPointListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return { }; } > static String toString(const SVGPointListValues& list) { return list.valueAsString(); } > > using ListItemType = FloatPoint; >diff --git a/Source/WebCore/svg/SVGPreserveAspectRatioValue.h b/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >index 6a7fca24a4d8d918c041a6cbbfa45dd21c38bd58..415b8723f8d30864c1b3fd788cc3b989bad7ef9c 100644 >--- a/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >+++ b/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >@@ -79,7 +79,7 @@ private: > template<> struct SVGPropertyTraits<SVGPreserveAspectRatioValue> { > static SVGPreserveAspectRatioValue initialValue() { return SVGPreserveAspectRatioValue(); } > static SVGPreserveAspectRatioValue fromString(const String& string) { return SVGPreserveAspectRatioValue(string); } >- static std::optional<SVGPreserveAspectRatioValue> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<SVGPreserveAspectRatioValue> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(const SVGPreserveAspectRatioValue& type) { return type.valueAsString(); } > }; > >diff --git a/Source/WebCore/svg/SVGToOTFFontConversion.cpp b/Source/WebCore/svg/SVGToOTFFontConversion.cpp >index 2322791d2ebd9a37620c9ee99b05e1f8aad69e4c..902e54cb9e27adbe4502bee6276b3cdfec016b65 100644 >--- a/Source/WebCore/svg/SVGToOTFFontConversion.cpp >+++ b/Source/WebCore/svg/SVGToOTFFontConversion.cpp >@@ -196,7 +196,7 @@ private: > > uint32_t calculateChecksum(size_t startingOffset, size_t endingOffset) const; > >- void processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement*, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, std::optional<FloatRect>& boundingBox); >+ void processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement*, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, Optional<FloatRect>& boundingBox); > > typedef void (SVGToOTFFontConverter::*FontAppendingFunction)(); > void appendTable(const char identifier[4], FontAppendingFunction); >@@ -222,7 +222,7 @@ private: > > void appendValidCFFString(const String&); > >- Vector<char> transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, std::optional<FloatRect>& boundingBox) const; >+ Vector<char> transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, Optional<FloatRect>& boundingBox) const; > > void addCodepointRanges(const UnicodeRanges&, HashSet<Glyph>& glyphSet) const; > void addCodepoints(const HashSet<String>& codepoints, HashSet<Glyph>& glyphSet) const; >@@ -1141,7 +1141,7 @@ public: > m_cffData.append(rMoveTo); > } > >- std::optional<FloatRect> boundingBox() const >+ Optional<FloatRect> boundingBox() const > { > return m_boundingBox; > } >@@ -1232,11 +1232,11 @@ private: > Vector<char>& m_cffData; > FloatPoint m_startingPoint; > FloatPoint m_current; >- std::optional<FloatRect> m_boundingBox; >+ Optional<FloatRect> m_boundingBox; > float m_unitsPerEmScalar; > }; > >-Vector<char> SVGToOTFFontConverter::transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, std::optional<FloatRect>& boundingBox) const >+Vector<char> SVGToOTFFontConverter::transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, Optional<FloatRect>& boundingBox) const > { > Vector<char> result; > >@@ -1272,7 +1272,7 @@ Vector<char> SVGToOTFFontConverter::transcodeGlyphPaths(float width, const SVGEl > return result; > } > >-void SVGToOTFFontConverter::processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement* glyphElement, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, std::optional<FloatRect>& boundingBox) >+void SVGToOTFFontConverter::processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement* glyphElement, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, Optional<FloatRect>& boundingBox) > { > bool ok; > float horizontalAdvance = scaleUnitsPerEm(glyphOrMissingGlyphElement.attributeWithoutSynchronization(SVGNames::horiz_adv_xAttr).toFloat(&ok)); >@@ -1284,7 +1284,7 @@ void SVGToOTFFontConverter::processGlyphElement(const SVGElement& glyphOrMissing > verticalAdvance = defaultVerticalAdvance; > m_advanceHeightMax = std::max(m_advanceHeightMax, verticalAdvance); > >- std::optional<FloatRect> glyphBoundingBox; >+ Optional<FloatRect> glyphBoundingBox; > auto path = transcodeGlyphPaths(horizontalAdvance, glyphOrMissingGlyphElement, glyphBoundingBox); > if (!path.size()) { > // It's better to use a fallback font rather than use a font without all its glyphs. >@@ -1407,7 +1407,7 @@ SVGToOTFFontConverter::SVGToOTFFontConverter(const SVGFontElement& fontElement) > > populateEmptyGlyphCharString(m_emptyGlyphCharString, s_outputUnitsPerEm); > >- std::optional<FloatRect> boundingBox; >+ Optional<FloatRect> boundingBox; > if (m_missingGlyphElement) > processGlyphElement(*m_missingGlyphElement, nullptr, defaultHorizontalAdvance, defaultVerticalAdvance, String(), boundingBox); > else { >@@ -1563,13 +1563,13 @@ bool SVGToOTFFontConverter::convertSVGToOTFFont() > return true; > } > >-std::optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement& element) >+Optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement& element) > { > SVGToOTFFontConverter converter(element); > if (converter.error()) >- return std::nullopt; >+ return WTF::nullopt; > if (!converter.convertSVGToOTFFont()) >- return std::nullopt; >+ return WTF::nullopt; > return converter.releaseResult(); > } > >diff --git a/Source/WebCore/svg/SVGToOTFFontConversion.h b/Source/WebCore/svg/SVGToOTFFontConversion.h >index 7756e4529b67c0e3abe27644e49095c9db581179..cc53de3009e0e8751111c80ead89ad05180ac67c 100644 >--- a/Source/WebCore/svg/SVGToOTFFontConversion.h >+++ b/Source/WebCore/svg/SVGToOTFFontConversion.h >@@ -32,6 +32,6 @@ namespace WebCore { > > class SVGFontElement; > >-std::optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement&); >+Optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement&); > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransformListValues.h b/Source/WebCore/svg/SVGTransformListValues.h >index 2f32951e4be5b84da389ddf6ee09dbefc3564c0e..45cc441e37156ca0e6a47c488d23e9703716a985 100644 >--- a/Source/WebCore/svg/SVGTransformListValues.h >+++ b/Source/WebCore/svg/SVGTransformListValues.h >@@ -50,7 +50,7 @@ template<> struct SVGPropertyTraits<SVGTransformListValues> { > values.parse(string); > return values; > } >- static std::optional<SVGTransformListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<SVGTransformListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(const SVGTransformListValues& list) { return list.valueAsString(); } > > using ListItemType = SVGTransformValue; >diff --git a/Source/WebCore/svg/properties/SVGPropertyTraits.h b/Source/WebCore/svg/properties/SVGPropertyTraits.h >index a2327e6c4cf526119249e1a6234bd67a35b88800..dfff9420cd6f687b8ca2c91a85a56dead182ff11 100644 >--- a/Source/WebCore/svg/properties/SVGPropertyTraits.h >+++ b/Source/WebCore/svg/properties/SVGPropertyTraits.h >@@ -39,7 +39,7 @@ template<> > struct SVGPropertyTraits<bool> { > static bool initialValue() { return false; } > static bool fromString(const String& string) { return string == "true"; } >- static std::optional<bool> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<bool> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(bool type) { return type ? "true" : "false"; } > }; > >@@ -47,11 +47,11 @@ template<> > struct SVGPropertyTraits<Color> { > static Color initialValue() { return Color(); } > static Color fromString(const String& string) { return CSSParser::parseColor(string.stripWhiteSpace()); } >- static std::optional<Color> parse(const QualifiedName&, const String& string) >+ static Optional<Color> parse(const QualifiedName&, const String& string) > { > Color color = CSSParser::parseColor(string.stripWhiteSpace()); > if (!color.isValid()) >- return std::nullopt; >+ return WTF::nullopt; > return color; > } > static String toString(const Color& type) { return type.serialized(); } >@@ -60,7 +60,7 @@ struct SVGPropertyTraits<Color> { > template<> > struct SVGPropertyTraits<unsigned> { > static unsigned initialValue() { return 0; } >- static std::optional<unsigned> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<unsigned> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(unsigned type) { return String::number(type); } > }; > >@@ -68,7 +68,7 @@ template<> > struct SVGPropertyTraits<int> { > static int initialValue() { return 0; } > static int fromString(const String&string) { return string.toIntStrict(); } >- static std::optional<int> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<int> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(int type) { return String::number(type); } > }; > >@@ -82,7 +82,7 @@ struct SVGPropertyTraits<std::pair<int, int>> { > return { }; > return std::make_pair(static_cast<int>(roundf(firstNumber)), static_cast<int>(roundf(secondNumber))); > } >- static std::optional<std::pair<int, int>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<std::pair<int, int>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(std::pair<int, int>) { ASSERT_NOT_REACHED(); return emptyString(); } > }; > >@@ -96,11 +96,11 @@ struct SVGPropertyTraits<float> { > return 0; > return number; > } >- static std::optional<float> parse(const QualifiedName&, const String& string) >+ static Optional<float> parse(const QualifiedName&, const String& string) > { > float number; > if (!parseNumberFromString(string, number)) >- return std::nullopt; >+ return WTF::nullopt; > return number; > } > static String toString(float type) { return String::number(type); } >@@ -116,7 +116,7 @@ struct SVGPropertyTraits<std::pair<float, float>> { > return { }; > return std::make_pair(firstNumber, secondNumber); > } >- static std::optional<std::pair<float, float>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >+ static Optional<std::pair<float, float>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } > static String toString(std::pair<float, float>) { ASSERT_NOT_REACHED(); return emptyString(); } > }; > >@@ -130,11 +130,11 @@ struct SVGPropertyTraits<FloatPoint> { > return { }; > return point; > } >- static std::optional<FloatPoint> parse(const QualifiedName&, const String& string) >+ static Optional<FloatPoint> parse(const QualifiedName&, const String& string) > { > FloatPoint point; > if (!parsePoint(string, point)) >- return std::nullopt; >+ return WTF::nullopt; > return point; > } > static String toString(const FloatPoint& type) >@@ -157,11 +157,11 @@ struct SVGPropertyTraits<FloatRect> { > return { }; > return rect; > } >- static std::optional<FloatRect> parse(const QualifiedName&, const String& string) >+ static Optional<FloatRect> parse(const QualifiedName&, const String& string) > { > FloatRect rect; > if (!parseRect(string, rect)) >- return std::nullopt; >+ return WTF::nullopt; > return rect; > } > static String toString(const FloatRect& type) >@@ -182,7 +182,7 @@ template<> > struct SVGPropertyTraits<String> { > static String initialValue() { return String(); } > static String fromString(const String& string) { return string; } >- static std::optional<String> parse(const QualifiedName&, const String& string) { return string; } >+ static Optional<String> parse(const QualifiedName&, const String& string) { return string; } > static String toString(const String& string) { return string; } > }; > >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 6eb00d56b7806461cb47f503beebd21f6295ef1b..bc0671a117c8f23740edfcf071f8e6a8aca952d4 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -446,7 +446,7 @@ void Internals::resetToConsistentState(Page& page) > > page.mainFrame().setTextZoomFactor(1.0f); > >- page.setCompositingPolicyOverride(std::nullopt); >+ page.setCompositingPolicyOverride(WTF::nullopt); > > FrameView* mainFrameView = page.mainFrame().view(); > if (mainFrameView) { >@@ -498,7 +498,7 @@ void Internals::resetToConsistentState(Page& page) > #endif > > page.setShowAllPlugins(false); >- page.setLowPowerModeEnabledOverrideForTesting(std::nullopt); >+ page.setLowPowerModeEnabledOverrideForTesting(WTF::nullopt); > > #if USE(QUICK_LOOK) > MockPreviewLoaderClient::singleton().setPassword(""); >@@ -1299,14 +1299,14 @@ bool Internals::areTimersThrottled() const > return contextDocument()->isTimerThrottlingEnabled(); > } > >-void Internals::setEventThrottlingBehaviorOverride(std::optional<EventThrottlingBehavior> value) >+void Internals::setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior> value) > { > Document* document = contextDocument(); > if (!document || !document->page()) > return; > > if (!value) { >- document->page()->setEventThrottlingBehaviorOverride(std::nullopt); >+ document->page()->setEventThrottlingBehaviorOverride(WTF::nullopt); > return; > } > >@@ -1320,15 +1320,15 @@ void Internals::setEventThrottlingBehaviorOverride(std::optional<EventThrottling > } > } > >-std::optional<Internals::EventThrottlingBehavior> Internals::eventThrottlingBehaviorOverride() const >+Optional<Internals::EventThrottlingBehavior> Internals::eventThrottlingBehaviorOverride() const > { > Document* document = contextDocument(); > if (!document || !document->page()) >- return std::nullopt; >+ return WTF::nullopt; > > auto behavior = document->page()->eventThrottlingBehaviorOverride(); > if (!behavior) >- return std::nullopt; >+ return WTF::nullopt; > > switch (behavior.value()) { > case WebCore::EventThrottlingBehavior::Responsive: >@@ -1337,7 +1337,7 @@ std::optional<Internals::EventThrottlingBehavior> Internals::eventThrottlingBeha > return Internals::EventThrottlingBehavior::Unresponsive; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > String Internals::visiblePlaceholder(Element& element) >@@ -3111,14 +3111,14 @@ ExceptionOr<unsigned> Internals::compositingUpdateCount() > return document->renderView()->compositor().compositingUpdateCount(); > } > >-ExceptionOr<void> Internals::setCompositingPolicyOverride(std::optional<CompositingPolicy> policyOverride) >+ExceptionOr<void> Internals::setCompositingPolicyOverride(Optional<CompositingPolicy> policyOverride) > { > Document* document = contextDocument(); > if (!document) > return Exception { InvalidAccessError }; > > if (!policyOverride) { >- document->page()->setCompositingPolicyOverride(std::nullopt); >+ document->page()->setCompositingPolicyOverride(WTF::nullopt); > return { }; > } > >@@ -3134,7 +3134,7 @@ ExceptionOr<void> Internals::setCompositingPolicyOverride(std::optional<Composit > return { }; > } > >-ExceptionOr<std::optional<Internals::CompositingPolicy>> Internals::compositingPolicyOverride() const >+ExceptionOr<Optional<Internals::CompositingPolicy>> Internals::compositingPolicyOverride() const > { > Document* document = contextDocument(); > if (!document) >@@ -3142,7 +3142,7 @@ ExceptionOr<std::optional<Internals::CompositingPolicy>> Internals::compositingP > > auto policyOverride = document->page()->compositingPolicyOverride(); > if (!policyOverride) >- return { std::nullopt }; >+ return { WTF::nullopt }; > > switch (policyOverride.value()) { > case WebCore::CompositingPolicy::Normal: >@@ -4564,7 +4564,7 @@ void Internals::videoSampleAvailable(MediaSample& sample) > m_nextTrackFramePromise->resolve(imageData.releaseReturnValue().releaseNonNull()); > else > m_nextTrackFramePromise->reject(imageData.exception().code()); >- m_nextTrackFramePromise = std::nullopt; >+ m_nextTrackFramePromise = WTF::nullopt; > } > > void Internals::delayMediaStreamTrackSamples(MediaStreamTrack& track, float delay) >@@ -4829,7 +4829,7 @@ bool Internals::supportsVCPEncoder() > #endif > } > >-std::optional<HEVCParameterSet> Internals::parseHEVCCodecParameters(const String& codecString) >+Optional<HEVCParameterSet> Internals::parseHEVCCodecParameters(const String& codecString) > { > return WebCore::parseHEVCCodecParameters(codecString); > } >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index 03f474ead26a4349d666d173e47ea680ec1c743b..b37fa6986d57b7b166b88bd42cf24e0b9e0f4fc3 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -181,8 +181,8 @@ public: > bool areTimersThrottled() const; > > enum EventThrottlingBehavior { Responsive, Unresponsive }; >- void setEventThrottlingBehaviorOverride(std::optional<EventThrottlingBehavior>); >- std::optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const; >+ void setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior>); >+ Optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const; > > // Spatial Navigation testing. > ExceptionOr<unsigned> lastSpatialNavigationCandidateCount() const; >@@ -466,8 +466,8 @@ public: > ExceptionOr<unsigned> compositingUpdateCount(); > > enum CompositingPolicy { Normal, Conservative }; >- ExceptionOr<void> setCompositingPolicyOverride(std::optional<CompositingPolicy>); >- ExceptionOr<std::optional<CompositingPolicy>> compositingPolicyOverride() const; >+ ExceptionOr<void> setCompositingPolicyOverride(Optional<CompositingPolicy>); >+ ExceptionOr<Optional<CompositingPolicy>> compositingPolicyOverride() const; > > ExceptionOr<void> updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*); > unsigned layoutCount() const; >@@ -756,7 +756,7 @@ public: > bool supportsVCPEncoder(); > > using HEVCParameterSet = WebCore::HEVCParameterSet; >- std::optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecString); >+ Optional<HEVCParameterSet> parseHEVCCodecParameters(const String& codecString); > > struct CookieData { > String name; >@@ -808,7 +808,7 @@ private: > unsigned long m_trackVideoSampleCount { 0 }; > unsigned long m_trackAudioSampleCount { 0 }; > RefPtr<MediaStreamTrack> m_track; >- std::optional<TrackFramePromise> m_nextTrackFramePromise; >+ Optional<TrackFramePromise> m_nextTrackFramePromise; > #endif > > std::unique_ptr<InspectorStubFrontend> m_inspectorFrontend; >diff --git a/Source/WebCore/testing/MockCDMFactory.cpp b/Source/WebCore/testing/MockCDMFactory.cpp >index 34283f17302e024e8acd15cea2d7bf22372f8ed9..7d869b4d4a62dbf4f13dd02560742927078ff22a 100644 >--- a/Source/WebCore/testing/MockCDMFactory.cpp >+++ b/Source/WebCore/testing/MockCDMFactory.cpp >@@ -219,11 +219,11 @@ RefPtr<SharedBuffer> MockCDM::sanitizeResponse(const SharedBuffer& response) con > return response.copy(); > } > >-std::optional<String> MockCDM::sanitizeSessionId(const String& sessionId) const >+Optional<String> MockCDM::sanitizeSessionId(const String& sessionId) const > { > if (equalLettersIgnoringASCIICase(sessionId, "valid-loaded-session")) > return sessionId; >- return std::nullopt; >+ return WTF::nullopt; > } > > MockCDMInstance::MockCDMInstance(WeakPtr<MockCDM> cdm) >@@ -329,18 +329,18 @@ void MockCDMInstanceSession::updateLicense(const String& sessionID, LicenseType, > { > MockCDMFactory* factory = m_instance ? m_instance->factory() : nullptr; > if (!factory) { >- callback(false, std::nullopt, std::nullopt, std::nullopt, SuccessValue::Failed); >+ callback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, SuccessValue::Failed); > return; > } > > Vector<String> responseVector = String(response.data(), response.size()).split(' '); > > if (responseVector.contains(String("invalid-format"_s))) { >- callback(false, std::nullopt, std::nullopt, std::nullopt, SuccessValue::Failed); >+ callback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, SuccessValue::Failed); > return; > } > >- std::optional<KeyStatusVector> changedKeys; >+ Optional<KeyStatusVector> changedKeys; > if (responseVector.contains(String("keys-changed"_s))) { > const auto* keys = factory->keysForSessionWithID(sessionID); > if (keys) { >@@ -356,14 +356,14 @@ void MockCDMInstanceSession::updateLicense(const String& sessionID, LicenseType, > // FIXME: Session closure, expiration and message handling should be implemented > // once the relevant algorithms are supported. > >- callback(false, WTFMove(changedKeys), std::nullopt, std::nullopt, SuccessValue::Succeeded); >+ callback(false, WTFMove(changedKeys), WTF::nullopt, WTF::nullopt, SuccessValue::Succeeded); > } > > void MockCDMInstanceSession::loadSession(LicenseType, const String&, const String&, LoadSessionCallback&& callback) > { > MockCDMFactory* factory = m_instance ? m_instance->factory() : nullptr; > if (!factory) { >- callback(std::nullopt, std::nullopt, std::nullopt, SuccessValue::Failed, SessionLoadFailure::Other); >+ callback(WTF::nullopt, WTF::nullopt, WTF::nullopt, SuccessValue::Failed, SessionLoadFailure::Other); > return; > } > >@@ -372,7 +372,7 @@ void MockCDMInstanceSession::loadSession(LicenseType, const String&, const Strin > CString messageData { "session loaded" }; > Message message { MessageType::LicenseRenewal, SharedBuffer::create(messageData.data(), messageData.length()) }; > >- callback(std::nullopt, std::nullopt, WTFMove(message), SuccessValue::Succeeded, SessionLoadFailure::None); >+ callback(WTF::nullopt, WTF::nullopt, WTFMove(message), SuccessValue::Succeeded, SessionLoadFailure::None); > } > > void MockCDMInstanceSession::closeSession(const String& sessionID, CloseSessionCallback&& callback) >@@ -391,7 +391,7 @@ void MockCDMInstanceSession::removeSessionData(const String& id, LicenseType, Re > { > MockCDMFactory* factory = m_instance ? m_instance->factory() : nullptr; > if (!factory) { >- callback({ }, std::nullopt, SuccessValue::Failed); >+ callback({ }, WTF::nullopt, SuccessValue::Failed); > return; > } > >diff --git a/Source/WebCore/testing/MockCDMFactory.h b/Source/WebCore/testing/MockCDMFactory.h >index 843a08a34264405936d636456b337da2dd9cb962..5cadf28d654a1dd02bdd18a8e88269a77b0400d7 100644 >--- a/Source/WebCore/testing/MockCDMFactory.h >+++ b/Source/WebCore/testing/MockCDMFactory.h >@@ -122,7 +122,7 @@ private: > bool supportsSessions() const final; > bool supportsInitData(const AtomicString&, const SharedBuffer&) const final; > RefPtr<SharedBuffer> sanitizeResponse(const SharedBuffer&) const final; >- std::optional<String> sanitizeSessionId(const String&) const final; >+ Optional<String> sanitizeSessionId(const String&) const final; > > WeakPtr<MockCDMFactory> m_factory; > }; >diff --git a/Source/WebCore/testing/MockPaymentCoordinator.cpp b/Source/WebCore/testing/MockPaymentCoordinator.cpp >index f56c485e444f836092725157506106eafc0423e9..38241b7d0e649199ee37a3faf5d1e8b013fa8eb0 100644 >--- a/Source/WebCore/testing/MockPaymentCoordinator.cpp >+++ b/Source/WebCore/testing/MockPaymentCoordinator.cpp >@@ -68,11 +68,11 @@ bool MockPaymentCoordinator::supportsVersion(unsigned version) > return version <= currentVersion; > } > >-std::optional<String> MockPaymentCoordinator::validatedPaymentNetwork(const String& paymentNetwork) >+Optional<String> MockPaymentCoordinator::validatedPaymentNetwork(const String& paymentNetwork) > { > auto result = m_availablePaymentNetworks.find(paymentNetwork); > if (result == m_availablePaymentNetworks.end()) >- return std::nullopt; >+ return WTF::nullopt; > return *result; > } > >@@ -152,13 +152,13 @@ void MockPaymentCoordinator::updateTotalAndLineItems(const ApplePaySessionPaymen > m_lineItems.append(convert(lineItem)); > } > >-void MockPaymentCoordinator::completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&& shippingMethodUpdate) >+void MockPaymentCoordinator::completeShippingMethodSelection(Optional<ShippingMethodUpdate>&& shippingMethodUpdate) > { > if (shippingMethodUpdate) > updateTotalAndLineItems(shippingMethodUpdate->newTotalAndLineItems); > } > >-void MockPaymentCoordinator::completeShippingContactSelection(std::optional<ShippingContactUpdate>&& shippingContactUpdate) >+void MockPaymentCoordinator::completeShippingContactSelection(Optional<ShippingContactUpdate>&& shippingContactUpdate) > { > if (!shippingContactUpdate) > return; >@@ -168,7 +168,7 @@ void MockPaymentCoordinator::completeShippingContactSelection(std::optional<Ship > m_errors = WTFMove(shippingContactUpdate->errors); > } > >-void MockPaymentCoordinator::completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&& paymentMethodUpdate) >+void MockPaymentCoordinator::completePaymentMethodSelection(Optional<PaymentMethodUpdate>&& paymentMethodUpdate) > { > if (paymentMethodUpdate) > updateTotalAndLineItems(paymentMethodUpdate->newTotalAndLineItems); >@@ -208,7 +208,7 @@ void MockPaymentCoordinator::cancelPayment() > }); > } > >-void MockPaymentCoordinator::completePaymentSession(std::optional<PaymentAuthorizationResult>&& result) >+void MockPaymentCoordinator::completePaymentSession(Optional<PaymentAuthorizationResult>&& result) > { > auto isFinalState = isFinalStateResult(result); > m_errors = WTFMove(result->errors); >diff --git a/Source/WebCore/testing/MockPaymentCoordinator.h b/Source/WebCore/testing/MockPaymentCoordinator.h >index 9b5a3e5833b51180ec5c364f4dbb3d3e60debf0a..8de2a870ed4da7fe1d90cb6c2a61237583b7610f 100644 >--- a/Source/WebCore/testing/MockPaymentCoordinator.h >+++ b/Source/WebCore/testing/MockPaymentCoordinator.h >@@ -62,16 +62,16 @@ public: > > private: > bool supportsVersion(unsigned) final; >- std::optional<String> validatedPaymentNetwork(const String&) final; >+ Optional<String> validatedPaymentNetwork(const String&) final; > bool canMakePayments() final; > void canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void(bool)>&&); > void openPaymentSetup(const String&, const String&, WTF::Function<void(bool)>&&); > bool showPaymentUI(const URL&, const Vector<URL>&, const ApplePaySessionPaymentRequest&) final; > void completeMerchantValidation(const PaymentMerchantSession&) final; >- void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&) final; >- void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&) final; >- void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&) final; >- void completePaymentSession(std::optional<PaymentAuthorizationResult>&&) final; >+ void completeShippingMethodSelection(Optional<ShippingMethodUpdate>&&) final; >+ void completeShippingContactSelection(Optional<ShippingContactUpdate>&&) final; >+ void completePaymentMethodSelection(Optional<PaymentMethodUpdate>&&) final; >+ void completePaymentSession(Optional<PaymentAuthorizationResult>&&) final; > void abortPaymentSession() final; > void cancelPaymentSession() final; > void paymentCoordinatorDestroyed() final; >diff --git a/Source/WebCore/workers/Worker.h b/Source/WebCore/workers/Worker.h >index 2dccf2062f2cdf740c0d3428a1ecfba2eb5b3bdb..87e7006f3772a3190e70be39e14b7b11ed1a6288 100644 >--- a/Source/WebCore/workers/Worker.h >+++ b/Source/WebCore/workers/Worker.h >@@ -86,7 +86,7 @@ private: > String m_name; > String m_identifier; > WorkerGlobalScopeProxy& m_contextProxy; // The proxy outlives the worker to perform thread shutdown. >- std::optional<ContentSecurityPolicyResponseHeaders> m_contentSecurityPolicyResponseHeaders; >+ Optional<ContentSecurityPolicyResponseHeaders> m_contentSecurityPolicyResponseHeaders; > MonotonicTime m_workerCreationTime; > bool m_shouldBypassMainWorldContentSecurityPolicy { false }; > JSC::RuntimeFlags m_runtimeFlags; >diff --git a/Source/WebCore/workers/WorkerScriptLoader.cpp b/Source/WebCore/workers/WorkerScriptLoader.cpp >index 8db171e51f304fb79845a32e999d6648039455e1..52ac9b6aefbcdd00444b2e335a127303843a73fa 100644 >--- a/Source/WebCore/workers/WorkerScriptLoader.cpp >+++ b/Source/WebCore/workers/WorkerScriptLoader.cpp >@@ -46,7 +46,7 @@ WorkerScriptLoader::WorkerScriptLoader() = default; > > WorkerScriptLoader::~WorkerScriptLoader() = default; > >-std::optional<Exception> WorkerScriptLoader::loadSynchronously(ScriptExecutionContext* scriptExecutionContext, const URL& url, FetchOptions::Mode mode, FetchOptions::Cache cachePolicy, ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement, const String& initiatorIdentifier) >+Optional<Exception> WorkerScriptLoader::loadSynchronously(ScriptExecutionContext* scriptExecutionContext, const URL& url, FetchOptions::Mode mode, FetchOptions::Cache cachePolicy, ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement, const String& initiatorIdentifier) > { > ASSERT(scriptExecutionContext); > auto& workerGlobalScope = downcast<WorkerGlobalScope>(*scriptExecutionContext); >@@ -62,14 +62,14 @@ std::optional<Exception> WorkerScriptLoader::loadSynchronously(ScriptExecutionCo > m_script.append(scriptResource->script); > m_responseURL = URL { URL { }, scriptResource->responseURL }; > m_responseMIMEType = scriptResource->mimeType; >- return std::nullopt; >+ return WTF::nullopt; > } > } > #endif > > std::unique_ptr<ResourceRequest> request(createResourceRequest(initiatorIdentifier)); > if (!request) >- return std::nullopt; >+ return WTF::nullopt; > > ASSERT_WITH_SECURITY_IMPLICATION(is<WorkerGlobalScope>(scriptExecutionContext)); > >@@ -103,7 +103,7 @@ std::optional<Exception> WorkerScriptLoader::loadSynchronously(ScriptExecutionCo > downcast<ServiceWorkerGlobalScope>(workerGlobalScope).setScriptResource(url, ServiceWorkerContextData::ImportedScript { script(), m_responseURL, m_responseMIMEType }); > } > #endif >- return std::nullopt; >+ return WTF::nullopt; > } > > void WorkerScriptLoader::loadAsynchronously(ScriptExecutionContext& scriptExecutionContext, ResourceRequest&& scriptRequest, FetchOptions&& fetchOptions, ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement, ServiceWorkersMode serviceWorkerMode, WorkerScriptLoaderClient& client) >diff --git a/Source/WebCore/workers/WorkerScriptLoader.h b/Source/WebCore/workers/WorkerScriptLoader.h >index 04a41c21cb2f7531fde619e4d67dd5644905f98d..82fe5a15928a1e46e03eb2e81ed5505494de54c4 100644 >--- a/Source/WebCore/workers/WorkerScriptLoader.h >+++ b/Source/WebCore/workers/WorkerScriptLoader.h >@@ -54,7 +54,7 @@ public: > return adoptRef(*new WorkerScriptLoader); > } > >- std::optional<Exception> loadSynchronously(ScriptExecutionContext*, const URL&, FetchOptions::Mode, FetchOptions::Cache, ContentSecurityPolicyEnforcement, const String& initiatorIdentifier); >+ Optional<Exception> loadSynchronously(ScriptExecutionContext*, const URL&, FetchOptions::Mode, FetchOptions::Cache, ContentSecurityPolicyEnforcement, const String& initiatorIdentifier); > void loadAsynchronously(ScriptExecutionContext&, ResourceRequest&&, FetchOptions&&, ContentSecurityPolicyEnforcement, ServiceWorkersMode, WorkerScriptLoaderClient&); > > void notifyError(); >diff --git a/Source/WebCore/workers/service/ExtendableMessageEvent.cpp b/Source/WebCore/workers/service/ExtendableMessageEvent.cpp >index efbcab4043c0e6e8ae3510e34596cba1840956f7..7b05fffc03114f7712323aa300927c7a77e4711f 100644 >--- a/Source/WebCore/workers/service/ExtendableMessageEvent.cpp >+++ b/Source/WebCore/workers/service/ExtendableMessageEvent.cpp >@@ -32,7 +32,7 @@ > > namespace WebCore { > >-Ref<ExtendableMessageEvent> ExtendableMessageEvent::create(Vector<RefPtr<MessagePort>>&& ports, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<ExtendableMessageEventSource>&& source) >+Ref<ExtendableMessageEvent> ExtendableMessageEvent::create(Vector<RefPtr<MessagePort>>&& ports, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<ExtendableMessageEventSource>&& source) > { > return adoptRef(*new ExtendableMessageEvent(WTFMove(data), origin, lastEventId, WTFMove(source), WTFMove(ports))); > } >@@ -47,7 +47,7 @@ ExtendableMessageEvent::ExtendableMessageEvent(JSC::ExecState& state, const Atom > { > } > >-ExtendableMessageEvent::ExtendableMessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<ExtendableMessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports) >+ExtendableMessageEvent::ExtendableMessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<ExtendableMessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports) > : ExtendableEvent(eventNames().messageEvent, CanBubble::No, IsCancelable::No) > , m_data(WTFMove(data)) > , m_origin(origin) >diff --git a/Source/WebCore/workers/service/ExtendableMessageEvent.h b/Source/WebCore/workers/service/ExtendableMessageEvent.h >index c0587cb85eafcec05ad14dbfddb42dbf7f16e4c9..4a01a79d27fc77c761f29a8b1df0351f544112f5 100644 >--- a/Source/WebCore/workers/service/ExtendableMessageEvent.h >+++ b/Source/WebCore/workers/service/ExtendableMessageEvent.h >@@ -53,7 +53,7 @@ public: > JSC::JSValue data; > String origin; > String lastEventId; >- std::optional<ExtendableMessageEventSource> source; >+ Optional<ExtendableMessageEventSource> source; > Vector<RefPtr<MessagePort>> ports; > }; > >@@ -62,26 +62,26 @@ public: > return adoptRef(*new ExtendableMessageEvent(state, type, initializer, isTrusted)); > } > >- static Ref<ExtendableMessageEvent> create(Vector<RefPtr<MessagePort>>&&, RefPtr<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, std::optional<ExtendableMessageEventSource>&& source = std::nullopt); >+ static Ref<ExtendableMessageEvent> create(Vector<RefPtr<MessagePort>>&&, RefPtr<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, Optional<ExtendableMessageEventSource>&& source = WTF::nullopt); > > ~ExtendableMessageEvent(); > > SerializedScriptValue* data() const { return m_data.get(); } > const String& origin() const { return m_origin; } > const String& lastEventId() const { return m_lastEventId; } >- const std::optional<ExtendableMessageEventSource>& source() const { return m_source; } >+ const Optional<ExtendableMessageEventSource>& source() const { return m_source; } > const Vector<RefPtr<MessagePort>>& ports() const { return m_ports; } > > EventInterface eventInterface() const final { return ExtendableMessageEventInterfaceType; } > > private: > ExtendableMessageEvent(JSC::ExecState&, const AtomicString&, const Init&, IsTrusted); >- ExtendableMessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<ExtendableMessageEventSource>&&, Vector<RefPtr<MessagePort>>&&); >+ ExtendableMessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<ExtendableMessageEventSource>&&, Vector<RefPtr<MessagePort>>&&); > > RefPtr<SerializedScriptValue> m_data; > String m_origin; > String m_lastEventId; >- std::optional<ExtendableMessageEventSource> m_source; >+ Optional<ExtendableMessageEventSource> m_source; > Vector<RefPtr<MessagePort>> m_ports; > }; > >diff --git a/Source/WebCore/workers/service/SWClientConnection.cpp b/Source/WebCore/workers/service/SWClientConnection.cpp >index e56b05cca4d069e5e862263d0c8c558f93b2fa61..8ed67f67cbfda5af966eff89c5340bbced18f550 100644 >--- a/Source/WebCore/workers/service/SWClientConnection.cpp >+++ b/Source/WebCore/workers/service/SWClientConnection.cpp >@@ -135,7 +135,7 @@ void SWClientConnection::postMessageToServiceWorkerClient(DocumentIdentifier des > container->dispatchEvent(messageEvent); > } > >-void SWClientConnection::updateRegistrationState(ServiceWorkerRegistrationIdentifier identifier, ServiceWorkerRegistrationState state, const std::optional<ServiceWorkerData>& serviceWorkerData) >+void SWClientConnection::updateRegistrationState(ServiceWorkerRegistrationIdentifier identifier, ServiceWorkerRegistrationState state, const Optional<ServiceWorkerData>& serviceWorkerData) > { > ASSERT(isMainThread()); > >diff --git a/Source/WebCore/workers/service/SWClientConnection.h b/Source/WebCore/workers/service/SWClientConnection.h >index da7e3dd64a421ad44bbc0fa4b33232b029491b0e..b6f9e16bf69b1319762be75ca3b8231dd11038b9 100644 >--- a/Source/WebCore/workers/service/SWClientConnection.h >+++ b/Source/WebCore/workers/service/SWClientConnection.h >@@ -57,7 +57,7 @@ class SWClientConnection : public ThreadSafeRefCounted<SWClientConnection> { > public: > WEBCORE_EXPORT virtual ~SWClientConnection(); > >- using RegistrationCallback = WTF::CompletionHandler<void(std::optional<ServiceWorkerRegistrationData>&&)>; >+ using RegistrationCallback = WTF::CompletionHandler<void(Optional<ServiceWorkerRegistrationData>&&)>; > virtual void matchRegistration(SecurityOriginData&& topOrigin, const URL& clientURL, RegistrationCallback&&) = 0; > > using GetRegistrationsCallback = WTF::CompletionHandler<void(Vector<ServiceWorkerRegistrationData>&&)>; >@@ -80,7 +80,7 @@ public: > virtual bool mayHaveServiceWorkerRegisteredForOrigin(const SecurityOriginData&) const = 0; > virtual void syncTerminateWorker(ServiceWorkerIdentifier) = 0; > >- virtual void registerServiceWorkerClient(const SecurityOrigin& topOrigin, const ServiceWorkerClientData&, const std::optional<ServiceWorkerRegistrationIdentifier>&) = 0; >+ virtual void registerServiceWorkerClient(const SecurityOrigin& topOrigin, const ServiceWorkerClientData&, const Optional<ServiceWorkerRegistrationIdentifier>&) = 0; > virtual void unregisterServiceWorkerClient(DocumentIdentifier) = 0; > > virtual void finishFetchingScriptInServer(const ServiceWorkerFetchResult&) = 0; >@@ -93,7 +93,7 @@ protected: > WEBCORE_EXPORT void unregistrationJobResolvedInServer(ServiceWorkerJobIdentifier, bool unregistrationResult); > WEBCORE_EXPORT void startScriptFetchForServer(ServiceWorkerJobIdentifier, const ServiceWorkerRegistrationKey&, FetchOptions::Cache); > WEBCORE_EXPORT void postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, MessageWithMessagePorts&&, ServiceWorkerData&& source, const String& sourceOrigin); >- WEBCORE_EXPORT void updateRegistrationState(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const std::optional<ServiceWorkerData>&); >+ WEBCORE_EXPORT void updateRegistrationState(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const Optional<ServiceWorkerData>&); > WEBCORE_EXPORT void updateWorkerState(ServiceWorkerIdentifier, ServiceWorkerState); > WEBCORE_EXPORT void fireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier); > WEBCORE_EXPORT void setRegistrationLastUpdateTime(ServiceWorkerRegistrationIdentifier, WallTime); >diff --git a/Source/WebCore/workers/service/ServiceWorkerClientData.h b/Source/WebCore/workers/service/ServiceWorkerClientData.h >index f991f32ce6d3a9b257a5612b46365a679ae2d17d..046e3ac2f55b9e076adf19ec73cfaa6227d0b8a0 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerClientData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerClientData.h >@@ -48,7 +48,7 @@ struct ServiceWorkerClientData { > static ServiceWorkerClientData from(ScriptExecutionContext&, SWClientConnection&); > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerClientData> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerClientData> decode(Decoder&); > }; > > template<class Encoder> >@@ -58,27 +58,27 @@ void ServiceWorkerClientData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerClientData> ServiceWorkerClientData::decode(Decoder& decoder) >+Optional<ServiceWorkerClientData> ServiceWorkerClientData::decode(Decoder& decoder) > { >- std::optional<ServiceWorkerClientIdentifier> identifier; >+ Optional<ServiceWorkerClientIdentifier> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerClientType> type; >+ Optional<ServiceWorkerClientType> type; > decoder >> type; > if (!type) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerClientFrameType> frameType; >+ Optional<ServiceWorkerClientFrameType> frameType; > decoder >> frameType; > if (!frameType) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<URL> url; >+ Optional<URL> url; > decoder >> url; > if (!url) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*identifier), WTFMove(*type), WTFMove(*frameType), WTFMove(*url) } }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h b/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h >index 0d0e92eb325f5555120de93d8a65f517a19bd710..b8170f51cf50b5ff8d45bfa9dce5e2c8da787b97 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h >+++ b/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h >@@ -40,10 +40,10 @@ struct ServiceWorkerClientIdentifier { > unsigned hash() const; > > String toString() const { return String::number(serverConnectionIdentifier.toUInt64()) + "-" + String::number(contextIdentifier.toUInt64()); } >- static std::optional<ServiceWorkerClientIdentifier> fromString(StringView); >+ static Optional<ServiceWorkerClientIdentifier> fromString(StringView); > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerClientIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerClientIdentifier> decode(Decoder&); > }; > > inline bool operator==(const ServiceWorkerClientIdentifier& a, const ServiceWorkerClientIdentifier& b) >@@ -51,7 +51,7 @@ inline bool operator==(const ServiceWorkerClientIdentifier& a, const ServiceWork > return a.serverConnectionIdentifier == b.serverConnectionIdentifier && a.contextIdentifier == b.contextIdentifier; > } > >-inline std::optional<ServiceWorkerClientIdentifier> ServiceWorkerClientIdentifier::fromString(StringView string) >+inline Optional<ServiceWorkerClientIdentifier> ServiceWorkerClientIdentifier::fromString(StringView string) > { > ServiceWorkerClientIdentifier clientIdentifier; > >@@ -59,13 +59,13 @@ inline std::optional<ServiceWorkerClientIdentifier> ServiceWorkerClientIdentifie > for (auto item : string.split('-')) { > auto identifier = item.toUInt64Strict(); > if (!identifier || !*identifier) >- return std::nullopt; >+ return WTF::nullopt; > if (!counter++) > clientIdentifier.serverConnectionIdentifier = makeObjectIdentifier<SWServerConnectionIdentifierType>(identifier.value()); > else if (counter == 2) > clientIdentifier.contextIdentifier = makeObjectIdentifier<DocumentIdentifierType>(identifier.value()); > } >- return (counter == 2) ? std::make_optional(WTFMove(clientIdentifier)) : std::nullopt; >+ return (counter == 2) ? makeOptional(WTFMove(clientIdentifier)) : WTF::nullopt; > } > > template<class Encoder> >@@ -75,17 +75,17 @@ void ServiceWorkerClientIdentifier::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerClientIdentifier> ServiceWorkerClientIdentifier::decode(Decoder& decoder) >+Optional<ServiceWorkerClientIdentifier> ServiceWorkerClientIdentifier::decode(Decoder& decoder) > { >- std::optional<SWServerConnectionIdentifier> serverConnectionIdentifier; >+ Optional<SWServerConnectionIdentifier> serverConnectionIdentifier; > decoder >> serverConnectionIdentifier; > if (!serverConnectionIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<DocumentIdentifier> contextIdentifier; >+ Optional<DocumentIdentifier> contextIdentifier; > decoder >> contextIdentifier; > if (!contextIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*serverConnectionIdentifier), WTFMove(*contextIdentifier) } }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerClientQueryOptions.h b/Source/WebCore/workers/service/ServiceWorkerClientQueryOptions.h >index 14aaef6c97cfef84d0add526e609a7410d020893..428467292c238c0786853b3d1305bdb23f9fc9ba 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerClientQueryOptions.h >+++ b/Source/WebCore/workers/service/ServiceWorkerClientQueryOptions.h >@@ -36,7 +36,7 @@ struct ServiceWorkerClientQueryOptions { > ServiceWorkerClientType type { ServiceWorkerClientType::Window }; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerClientQueryOptions> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerClientQueryOptions> decode(Decoder&); > }; > > template<class Encoder> >@@ -46,17 +46,17 @@ void ServiceWorkerClientQueryOptions::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerClientQueryOptions> ServiceWorkerClientQueryOptions::decode(Decoder& decoder) >+Optional<ServiceWorkerClientQueryOptions> ServiceWorkerClientQueryOptions::decode(Decoder& decoder) > { >- std::optional<bool> includeUncontrolled; >+ Optional<bool> includeUncontrolled; > decoder >> includeUncontrolled; > if (!includeUncontrolled) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerClientType> type; >+ Optional<ServiceWorkerClientType> type; > decoder >> type; > if (!type) >- return std::nullopt; >+ return WTF::nullopt; > > return { { *includeUncontrolled, *type } }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerClients.cpp b/Source/WebCore/workers/service/ServiceWorkerClients.cpp >index 9652bd07b12514aa5dc5b64a38f017b685a80a3c..b07aa2afd00a3f4e17064eece0f0ba6d1a407c24 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerClients.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerClients.cpp >@@ -34,7 +34,7 @@ > > namespace WebCore { > >-static inline void didFinishGetRequest(ServiceWorkerGlobalScope& scope, DeferredPromise& promise, ExceptionOr<std::optional<ServiceWorkerClientData>>&& clientData) >+static inline void didFinishGetRequest(ServiceWorkerGlobalScope& scope, DeferredPromise& promise, ExceptionOr<Optional<ServiceWorkerClientData>>&& clientData) > { > if (clientData.hasException()) { > promise.reject(clientData.releaseException()); >diff --git a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >index 0ef9bf3503135101fac5f9fad959387eab91a27f..1a65873165a760ac5ea30e1d9e09fdd26c5a07af 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >@@ -284,7 +284,7 @@ void ServiceWorkerContainer::getRegistration(const String& clientURL, Ref<Deferr > }); > } > >-void ServiceWorkerContainer::didFinishGetRegistrationRequest(uint64_t pendingPromiseIdentifier, std::optional<ServiceWorkerRegistrationData>&& result) >+void ServiceWorkerContainer::didFinishGetRegistrationRequest(uint64_t pendingPromiseIdentifier, Optional<ServiceWorkerRegistrationData>&& result) > { > #ifndef NDEBUG > ASSERT(m_creationThread.ptr() == &Thread::current()); >@@ -308,7 +308,7 @@ void ServiceWorkerContainer::didFinishGetRegistrationRequest(uint64_t pendingPro > pendingPromise->promise->resolve<IDLInterface<ServiceWorkerRegistration>>(WTFMove(registration)); > } > >-void ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState(ServiceWorkerRegistrationIdentifier identifier, ServiceWorkerRegistrationState state, const std::optional<ServiceWorkerData>& serviceWorkerData) >+void ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState(ServiceWorkerRegistrationIdentifier identifier, ServiceWorkerRegistrationState state, const Optional<ServiceWorkerData>& serviceWorkerData) > { > auto* context = scriptExecutionContext(); > if (!context) >@@ -532,7 +532,7 @@ void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, con > }); > } > >-void ServiceWorkerContainer::jobFailedLoadingScript(ServiceWorkerJob& job, const ResourceError& error, std::optional<Exception>&& exception) >+void ServiceWorkerContainer::jobFailedLoadingScript(ServiceWorkerJob& job, const ResourceError& error, Optional<Exception>&& exception) > { > #ifndef NDEBUG > ASSERT(m_creationThread.ptr() == &Thread::current()); >diff --git a/Source/WebCore/workers/service/ServiceWorkerContainer.h b/Source/WebCore/workers/service/ServiceWorkerContainer.h >index 9b77454ea4edcdd4a9d52dd9c54f83a85eb547e7..290f07351d9b21da35bd564c2479e22f128803f6 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerContainer.h >+++ b/Source/WebCore/workers/service/ServiceWorkerContainer.h >@@ -66,7 +66,7 @@ public: > void updateRegistration(const URL& scopeURL, const URL& scriptURL, WorkerType, RefPtr<DeferredPromise>&&); > > void getRegistration(const String& clientURL, Ref<DeferredPromise>&&); >- void scheduleTaskToUpdateRegistrationState(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const std::optional<ServiceWorkerData>&); >+ void scheduleTaskToUpdateRegistrationState(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const Optional<ServiceWorkerData>&); > void scheduleTaskToFireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier); > void scheduleTaskToFireControllerChangeEvent(); > >@@ -96,11 +96,11 @@ private: > void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) final; > void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) final; > void jobFinishedLoadingScript(ServiceWorkerJob&, const String& script, const ContentSecurityPolicyResponseHeaders&) final; >- void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, std::optional<Exception>&&) final; >+ void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Optional<Exception>&&) final; > > void jobDidFinish(ServiceWorkerJob&); > >- void didFinishGetRegistrationRequest(uint64_t requestIdentifier, std::optional<ServiceWorkerRegistrationData>&&); >+ void didFinishGetRegistrationRequest(uint64_t requestIdentifier, Optional<ServiceWorkerRegistrationData>&&); > void didFinishGetRegistrationsRequest(uint64_t requestIdentifier, Vector<ServiceWorkerRegistrationData>&&); > > SWServerConnectionIdentifier connectionIdentifier() final; >diff --git a/Source/WebCore/workers/service/ServiceWorkerContextData.h b/Source/WebCore/workers/service/ServiceWorkerContextData.h >index 4d620889f934a7efa260b3209b4e176b02ab0d20..23c4ccf791f3b29608e64fa62bd7c34308da7341 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerContextData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerContextData.h >@@ -70,7 +70,7 @@ struct ServiceWorkerContextData { > } > }; > >- std::optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier; >+ Optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier; > ServiceWorkerRegistrationData registration; > ServiceWorkerIdentifier serviceWorkerIdentifier; > String script; >@@ -82,7 +82,7 @@ struct ServiceWorkerContextData { > HashMap<URL, ImportedScript> scriptResourceMap; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerContextData> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerContextData> decode(Decoder&); > > ServiceWorkerContextData isolatedCopy() const; > }; >@@ -95,49 +95,49 @@ void ServiceWorkerContextData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerContextData> ServiceWorkerContextData::decode(Decoder& decoder) >+Optional<ServiceWorkerContextData> ServiceWorkerContextData::decode(Decoder& decoder) > { >- std::optional<std::optional<ServiceWorkerJobDataIdentifier>> jobDataIdentifier; >+ Optional<Optional<ServiceWorkerJobDataIdentifier>> jobDataIdentifier; > decoder >> jobDataIdentifier; > if (!jobDataIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerRegistrationData> registration; >+ Optional<ServiceWorkerRegistrationData> registration; > decoder >> registration; > if (!registration) >- return std::nullopt; >+ return WTF::nullopt; > > auto serviceWorkerIdentifier = ServiceWorkerIdentifier::decode(decoder); > if (!serviceWorkerIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > String script; > if (!decoder.decode(script)) >- return std::nullopt; >+ return WTF::nullopt; > > ContentSecurityPolicyResponseHeaders contentSecurityPolicy; > if (!decoder.decode(contentSecurityPolicy)) >- return std::nullopt; >+ return WTF::nullopt; > > URL scriptURL; > if (!decoder.decode(scriptURL)) >- return std::nullopt; >+ return WTF::nullopt; > > WorkerType workerType; > if (!decoder.decodeEnum(workerType)) >- return std::nullopt; >+ return WTF::nullopt; > > PAL::SessionID sessionID; > if (!decoder.decode(sessionID)) >- return std::nullopt; >+ return WTF::nullopt; > > bool loadedFromDisk; > if (!decoder.decode(loadedFromDisk)) >- return std::nullopt; >+ return WTF::nullopt; > > HashMap<URL, ImportedScript> scriptResourceMap; > if (!decoder.decode(scriptResourceMap)) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*jobDataIdentifier), WTFMove(*registration), WTFMove(*serviceWorkerIdentifier), WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(scriptURL), workerType, sessionID, loadedFromDisk, WTFMove(scriptResourceMap) }}; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerData.h b/Source/WebCore/workers/service/ServiceWorkerData.h >index ce361d3f3d0f3873a86dc8a938baf03f1d164a58..c38c9e7a6029b285aabbf2adb7e78a0742ca4dae 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerData.h >@@ -44,7 +44,7 @@ struct ServiceWorkerData { > ServiceWorkerData isolatedCopy() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerData> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerData> decode(Decoder&); > }; > > template<class Encoder> >@@ -54,32 +54,32 @@ void ServiceWorkerData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerData> ServiceWorkerData::decode(Decoder& decoder) >+Optional<ServiceWorkerData> ServiceWorkerData::decode(Decoder& decoder) > { >- std::optional<ServiceWorkerIdentifier> identifier; >+ Optional<ServiceWorkerIdentifier> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<URL> scriptURL; >+ Optional<URL> scriptURL; > decoder >> scriptURL; > if (!scriptURL) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerState> state; >+ Optional<ServiceWorkerState> state; > decoder >> state; > if (!state) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WorkerType> type; >+ Optional<WorkerType> type; > decoder >> type; > if (!type) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerRegistrationIdentifier> registrationIdentifier; >+ Optional<ServiceWorkerRegistrationIdentifier> registrationIdentifier; > decoder >> registrationIdentifier; > if (!registrationIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*identifier), WTFMove(*scriptURL), WTFMove(*state), WTFMove(*type), WTFMove(*registrationIdentifier) } }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerFetchResult.h b/Source/WebCore/workers/service/ServiceWorkerFetchResult.h >index e0a599976192d8b34d48faea9a9ed2770a3faee4..d390aa9f1b452a66a51d8f24ddfaa868f883312d 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerFetchResult.h >+++ b/Source/WebCore/workers/service/ServiceWorkerFetchResult.h >@@ -54,7 +54,7 @@ void ServiceWorkerFetchResult::encode(Encoder& encoder) const > template<class Decoder> > bool ServiceWorkerFetchResult::decode(Decoder& decoder, ServiceWorkerFetchResult& result) > { >- std::optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier; >+ Optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier; > decoder >> jobDataIdentifier; > if (!jobDataIdentifier) > return false; >diff --git a/Source/WebCore/workers/service/ServiceWorkerJob.cpp b/Source/WebCore/workers/service/ServiceWorkerJob.cpp >index 488b857fb6bd35b63a142e7450e29742b80a67c2..bbacdc01fbc484f66d13998ed905501ff6c8bd74 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerJob.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerJob.cpp >@@ -150,7 +150,7 @@ void ServiceWorkerJob::notifyFinished() > else { > auto& error = m_scriptLoader->error(); > ASSERT(!error.isNull()); >- m_client->jobFailedLoadingScript(*this, error, std::nullopt); >+ m_client->jobFailedLoadingScript(*this, error, WTF::nullopt); > } > > m_scriptLoader = nullptr; >diff --git a/Source/WebCore/workers/service/ServiceWorkerJobClient.h b/Source/WebCore/workers/service/ServiceWorkerJobClient.h >index 6737ecaf1ec2df1ed5fbcbec6eb398bd73f0feaa..1840f351843469cde0d66e2263235afc6875b436 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerJobClient.h >+++ b/Source/WebCore/workers/service/ServiceWorkerJobClient.h >@@ -50,7 +50,7 @@ public: > virtual void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) = 0; > virtual void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) = 0; > virtual void jobFinishedLoadingScript(ServiceWorkerJob&, const String& script, const ContentSecurityPolicyResponseHeaders&) = 0; >- virtual void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, std::optional<Exception>&&) = 0; >+ virtual void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Optional<Exception>&&) = 0; > > virtual SWServerConnectionIdentifier connectionIdentifier() = 0; > >diff --git a/Source/WebCore/workers/service/ServiceWorkerJobData.h b/Source/WebCore/workers/service/ServiceWorkerJobData.h >index 93c2df6ff0d2f398e841268be19664f7a9ce64fc..5a9ba794e96c1b2cb5393fdcb142e4896a9dbc30 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerJobData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerJobData.h >@@ -60,7 +60,7 @@ struct ServiceWorkerJobData { > ServiceWorkerJobData isolatedCopy() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerJobData> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerJobData> decode(Decoder&); > > private: > WEBCORE_EXPORT explicit ServiceWorkerJobData(const Identifier&); >@@ -84,39 +84,39 @@ void ServiceWorkerJobData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerJobData> ServiceWorkerJobData::decode(Decoder& decoder) >+Optional<ServiceWorkerJobData> ServiceWorkerJobData::decode(Decoder& decoder) > { >- std::optional<ServiceWorkerJobDataIdentifier> identifier; >+ Optional<ServiceWorkerJobDataIdentifier> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > > ServiceWorkerJobData jobData { WTFMove(*identifier) }; > > if (!decoder.decode(jobData.scriptURL)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(jobData.clientCreationURL)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<SecurityOriginData> topOrigin; >+ Optional<SecurityOriginData> topOrigin; > decoder >> topOrigin; > if (!topOrigin) >- return std::nullopt; >+ return WTF::nullopt; > jobData.topOrigin = WTFMove(*topOrigin); > > if (!decoder.decode(jobData.scopeURL)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(jobData.sourceContext)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decodeEnum(jobData.type)) >- return std::nullopt; >+ return WTF::nullopt; > > switch (jobData.type) { > case ServiceWorkerJobType::Register: { >- std::optional<ServiceWorkerRegistrationOptions> registrationOptions; >+ Optional<ServiceWorkerRegistrationOptions> registrationOptions; > decoder >> registrationOptions; > if (!registrationOptions) >- return std::nullopt; >+ return WTF::nullopt; > jobData.registrationOptions = WTFMove(*registrationOptions); > break; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerJobDataIdentifier.h b/Source/WebCore/workers/service/ServiceWorkerJobDataIdentifier.h >index 725a83ac210affb129c0e586186e19be2d078152..1cfc613537b6e92cc4011969bcce11ec6adb3dfc 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerJobDataIdentifier.h >+++ b/Source/WebCore/workers/service/ServiceWorkerJobDataIdentifier.h >@@ -41,7 +41,7 @@ struct ServiceWorkerJobDataIdentifier { > } > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerJobDataIdentifier> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerJobDataIdentifier> decode(Decoder&); > }; > > inline bool operator==(const ServiceWorkerJobDataIdentifier& a, const ServiceWorkerJobDataIdentifier& b) >@@ -56,17 +56,17 @@ void ServiceWorkerJobDataIdentifier::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerJobDataIdentifier> ServiceWorkerJobDataIdentifier::decode(Decoder& decoder) >+Optional<ServiceWorkerJobDataIdentifier> ServiceWorkerJobDataIdentifier::decode(Decoder& decoder) > { >- std::optional<SWServerConnectionIdentifier> connectionIdentifier; >+ Optional<SWServerConnectionIdentifier> connectionIdentifier; > decoder >> connectionIdentifier; > if (!connectionIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerJobIdentifier> jobIdentifier; >+ Optional<ServiceWorkerJobIdentifier> jobIdentifier; > decoder >> jobIdentifier; > if (!jobIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*connectionIdentifier), WTFMove(*jobIdentifier) } }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp b/Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp >index 0ca5850b5cced517d436cb780aecdedf0978322c..7e7695f2a92e61a37ec547c4a775f19d3cc28e07 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp >@@ -38,9 +38,9 @@ ServiceWorkerRegistrationData ServiceWorkerRegistrationData::isolatedCopy() cons > scopeURL.isolatedCopy(), > updateViaCache, > lastUpdateTime, >- installingWorker ? std::optional<ServiceWorkerData>(installingWorker->isolatedCopy()) : std::nullopt, >- waitingWorker ? std::optional<ServiceWorkerData>(waitingWorker->isolatedCopy()) : std::nullopt, >- activeWorker ? std::optional<ServiceWorkerData>(activeWorker->isolatedCopy()) : std::nullopt, >+ installingWorker ? Optional<ServiceWorkerData>(installingWorker->isolatedCopy()) : WTF::nullopt, >+ waitingWorker ? Optional<ServiceWorkerData>(waitingWorker->isolatedCopy()) : WTF::nullopt, >+ activeWorker ? Optional<ServiceWorkerData>(activeWorker->isolatedCopy()) : WTF::nullopt, > }; > } > >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationData.h b/Source/WebCore/workers/service/ServiceWorkerRegistrationData.h >index 3ff4049f52d4b3137e2a47cdd2314e77693b8c9a..f3bf32b9fd78759e17bb9df68f0cc824a9640d35 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationData.h >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationData.h >@@ -45,14 +45,14 @@ struct ServiceWorkerRegistrationData { > ServiceWorkerUpdateViaCache updateViaCache; > WallTime lastUpdateTime; > >- std::optional<ServiceWorkerData> installingWorker; >- std::optional<ServiceWorkerData> waitingWorker; >- std::optional<ServiceWorkerData> activeWorker; >+ Optional<ServiceWorkerData> installingWorker; >+ Optional<ServiceWorkerData> waitingWorker; >+ Optional<ServiceWorkerData> activeWorker; > > ServiceWorkerRegistrationData isolatedCopy() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerRegistrationData> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerRegistrationData> decode(Decoder&); > }; > > >@@ -63,47 +63,47 @@ void ServiceWorkerRegistrationData::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerRegistrationData> ServiceWorkerRegistrationData::decode(Decoder& decoder) >+Optional<ServiceWorkerRegistrationData> ServiceWorkerRegistrationData::decode(Decoder& decoder) > { >- std::optional<ServiceWorkerRegistrationKey> key; >+ Optional<ServiceWorkerRegistrationKey> key; > decoder >> key; > if (!key) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerRegistrationIdentifier> identifier; >+ Optional<ServiceWorkerRegistrationIdentifier> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<URL> scopeURL; >+ Optional<URL> scopeURL; > decoder >> scopeURL; > if (!scopeURL) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerUpdateViaCache> updateViaCache; >+ Optional<ServiceWorkerUpdateViaCache> updateViaCache; > decoder >> updateViaCache; > if (!updateViaCache) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<double> rawWallTime; >+ Optional<double> rawWallTime; > decoder >> rawWallTime; > if (!rawWallTime) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<ServiceWorkerData>> installingWorker; >+ Optional<Optional<ServiceWorkerData>> installingWorker; > decoder >> installingWorker; > if (!installingWorker) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<ServiceWorkerData>> waitingWorker; >+ Optional<Optional<ServiceWorkerData>> waitingWorker; > decoder >> waitingWorker; > if (!waitingWorker) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<ServiceWorkerData>> activeWorker; >+ Optional<Optional<ServiceWorkerData>> activeWorker; > decoder >> activeWorker; > if (!activeWorker) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*key), WTFMove(*identifier), WTFMove(*scopeURL), WTFMove(*updateViaCache), WallTime::fromRawSeconds(*rawWallTime), WTFMove(*installingWorker), WTFMove(*waitingWorker), WTFMove(*activeWorker) } }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >index bc297da66f53f4b7b851870456ffbcab3da0b6b2..0d53bcf923ed6126539f35dd2b949ca14b7b567c 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >@@ -94,16 +94,16 @@ String ServiceWorkerRegistrationKey::toDatabaseKey() const > return makeString(m_topOrigin.protocol, separatorCharacter, m_topOrigin.host, separatorCharacter, separatorCharacter, m_scope.string()); > } > >-std::optional<ServiceWorkerRegistrationKey> ServiceWorkerRegistrationKey::fromDatabaseKey(const String& key) >+Optional<ServiceWorkerRegistrationKey> ServiceWorkerRegistrationKey::fromDatabaseKey(const String& key) > { > auto first = key.find(separatorCharacter, 0); > auto second = key.find(separatorCharacter, first + 1); > auto third = key.find(separatorCharacter, second + 1); > > if (first == second || second == third) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint16_t> shortPort; >+ Optional<uint16_t> shortPort; > > // If there's a gap between third and second, we expect to have a port to decode > if (third - second > 1) { >@@ -115,17 +115,17 @@ std::optional<ServiceWorkerRegistrationKey> ServiceWorkerRegistrationKey::fromDa > port = charactersToUIntStrict(key.characters16() + second + 1, third - second - 1, &ok); > > if (!ok) >- return std::nullopt; >+ return WTF::nullopt; > > if (port > std::numeric_limits<uint16_t>::max()) >- return std::nullopt; >+ return WTF::nullopt; > > shortPort = static_cast<uint16_t>(port); > } > > auto scope = URL { URL(), key.substring(third + 1) }; > if (!scope.isValid()) >- return std::nullopt; >+ return WTF::nullopt; > > return ServiceWorkerRegistrationKey { { key.substring(0, first), key.substring(first + 1, second - first - 1), shortPort }, WTFMove(scope) }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h >index eb9d7fa0148dae4108104b9fbcf49d7d95228c48..5f2137654db4c3c74d5bf7520756c443a812ad58 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h >@@ -54,10 +54,10 @@ public: > ServiceWorkerRegistrationKey isolatedCopy() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerRegistrationKey> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerRegistrationKey> decode(Decoder&); > > String toDatabaseKey() const; >- static std::optional<ServiceWorkerRegistrationKey> fromDatabaseKey(const String&); >+ static Optional<ServiceWorkerRegistrationKey> fromDatabaseKey(const String&); > > #if !LOG_DISABLED > String loggingString() const; >@@ -75,16 +75,16 @@ void ServiceWorkerRegistrationKey::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerRegistrationKey> ServiceWorkerRegistrationKey::decode(Decoder& decoder) >+Optional<ServiceWorkerRegistrationKey> ServiceWorkerRegistrationKey::decode(Decoder& decoder) > { >- std::optional<SecurityOriginData> topOrigin; >+ Optional<SecurityOriginData> topOrigin; > decoder >> topOrigin; > if (!topOrigin) >- return std::nullopt; >+ return WTF::nullopt; > > URL scope; > if (!decoder.decode(scope)) >- return std::nullopt; >+ return WTF::nullopt; > > return ServiceWorkerRegistrationKey { WTFMove(*topOrigin), WTFMove(scope) }; > } >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationOptions.h b/Source/WebCore/workers/service/ServiceWorkerRegistrationOptions.h >index 09a245ded8ef7f4adffcd632cbd7bd603897c8af..9d500f85acb18841cc55bea8211db14fadc97475 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationOptions.h >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationOptions.h >@@ -42,7 +42,7 @@ struct ServiceWorkerRegistrationOptions { > ServiceWorkerRegistrationOptions isolatedCopy() const; > > template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<ServiceWorkerRegistrationOptions> decode(Decoder&); >+ template<class Decoder> static Optional<ServiceWorkerRegistrationOptions> decode(Decoder&); > }; > > template<class Encoder> >@@ -52,22 +52,22 @@ void ServiceWorkerRegistrationOptions::encode(Encoder& encoder) const > } > > template<class Decoder> >-std::optional<ServiceWorkerRegistrationOptions> ServiceWorkerRegistrationOptions::decode(Decoder& decoder) >+Optional<ServiceWorkerRegistrationOptions> ServiceWorkerRegistrationOptions::decode(Decoder& decoder) > { >- std::optional<String> scope; >+ Optional<String> scope; > decoder >> scope; > if (!scope) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WorkerType> type; >+ Optional<WorkerType> type; > decoder >> type; > if (!type) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ServiceWorkerUpdateViaCache> updateViaCache; >+ Optional<ServiceWorkerUpdateViaCache> updateViaCache; > decoder >> updateViaCache; > if (!updateViaCache) >- return std::nullopt; >+ return WTF::nullopt; > > return ServiceWorkerRegistrationOptions { WTFMove(*scope), WTFMove(*type), WTFMove(*updateViaCache) }; > } >diff --git a/Source/WebCore/workers/service/context/SWContextManager.cpp b/Source/WebCore/workers/service/context/SWContextManager.cpp >index 61eebe3d1666072484696162a2a6fecb69d9a8ac..89a849ee4de706255ade5a46fcb348f0f1cf2807 100644 >--- a/Source/WebCore/workers/service/context/SWContextManager.cpp >+++ b/Source/WebCore/workers/service/context/SWContextManager.cpp >@@ -64,7 +64,7 @@ void SWContextManager::registerServiceWorkerThreadForInstall(Ref<ServiceWorkerTh > }); > } > >-void SWContextManager::startedServiceWorker(std::optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const String& exceptionMessage) >+void SWContextManager::startedServiceWorker(Optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const String& exceptionMessage) > { > connection()->serviceWorkerStartedWithMessage(jobDataIdentifier, serviceWorkerIdentifier, exceptionMessage); > if (m_serviceWorkerCreationCallback) >diff --git a/Source/WebCore/workers/service/context/SWContextManager.h b/Source/WebCore/workers/service/context/SWContextManager.h >index b7b52e6b4e5ab66c334fb321b6aa430473d3347c..d24dd3e534350357e60f7ea9f765769bf370a9d3 100644 >--- a/Source/WebCore/workers/service/context/SWContextManager.h >+++ b/Source/WebCore/workers/service/context/SWContextManager.h >@@ -49,15 +49,15 @@ public: > virtual ~Connection() { } > > virtual void postMessageToServiceWorkerClient(const ServiceWorkerClientIdentifier& destinationIdentifier, MessageWithMessagePorts&&, ServiceWorkerIdentifier source, const String& sourceOrigin) = 0; >- virtual void serviceWorkerStartedWithMessage(std::optional<ServiceWorkerJobDataIdentifier>, ServiceWorkerIdentifier, const String& exceptionMessage) = 0; >- virtual void didFinishInstall(std::optional<ServiceWorkerJobDataIdentifier>, ServiceWorkerIdentifier, bool wasSuccessful) = 0; >+ virtual void serviceWorkerStartedWithMessage(Optional<ServiceWorkerJobDataIdentifier>, ServiceWorkerIdentifier, const String& exceptionMessage) = 0; >+ virtual void didFinishInstall(Optional<ServiceWorkerJobDataIdentifier>, ServiceWorkerIdentifier, bool wasSuccessful) = 0; > virtual void didFinishActivation(ServiceWorkerIdentifier) = 0; > virtual void setServiceWorkerHasPendingEvents(ServiceWorkerIdentifier, bool) = 0; > virtual void workerTerminated(ServiceWorkerIdentifier) = 0; > virtual void skipWaiting(ServiceWorkerIdentifier, Function<void()>&&) = 0; > virtual void setScriptResource(ServiceWorkerIdentifier, const URL&, const ServiceWorkerContextData::ImportedScript&) = 0; > >- using FindClientByIdentifierCallback = CompletionHandler<void(ExceptionOr<std::optional<ServiceWorkerClientData>>&&)>; >+ using FindClientByIdentifierCallback = CompletionHandler<void(ExceptionOr<Optional<ServiceWorkerClientData>>&&)>; > virtual void findClientByIdentifier(ServiceWorkerIdentifier, ServiceWorkerClientIdentifier, FindClientByIdentifierCallback&&) = 0; > virtual void matchAll(ServiceWorkerIdentifier, const ServiceWorkerClientQueryOptions&, ServiceWorkerClientsMatchAllCallback&&) = 0; > virtual void claim(ServiceWorkerIdentifier, CompletionHandler<void()>&&) = 0; >@@ -85,7 +85,7 @@ public: > private: > SWContextManager() = default; > >- void startedServiceWorker(std::optional<ServiceWorkerJobDataIdentifier>, ServiceWorkerIdentifier, const String& exceptionMessage); >+ void startedServiceWorker(Optional<ServiceWorkerJobDataIdentifier>, ServiceWorkerIdentifier, const String& exceptionMessage); > void serviceWorkerFailedToTerminate(ServiceWorkerIdentifier); > > HashMap<ServiceWorkerIdentifier, RefPtr<ServiceWorkerThreadProxy>> m_workerMap; >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp b/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp >index 7e5a60db045689a5f686f2e77fef60fa5149a789..0e3649249827b14c35a485e95a481dcfa039a808 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp >+++ b/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp >@@ -84,7 +84,7 @@ static void processResponse(Ref<Client>&& client, Expected<Ref<FetchResponse>, R > }); > } > >-void dispatchFetchEvent(Ref<Client>&& client, ServiceWorkerGlobalScope& globalScope, std::optional<ServiceWorkerClientIdentifier> clientId, ResourceRequest&& request, String&& referrer, FetchOptions&& options) >+void dispatchFetchEvent(Ref<Client>&& client, ServiceWorkerGlobalScope& globalScope, Optional<ServiceWorkerClientIdentifier> clientId, ResourceRequest&& request, String&& referrer, FetchOptions&& options) > { > auto requestHeaders = FetchHeaders::create(FetchHeaders::Guard::Immutable, HTTPHeaderMap { request.httpHeaderFields() }); > >@@ -96,7 +96,7 @@ void dispatchFetchEvent(Ref<Client>&& client, ServiceWorkerGlobalScope& globalSc > ASSERT(globalScope.registration().active()->state() == ServiceWorkerState::Activated); > > auto* formData = request.httpBody(); >- std::optional<FetchBody> body; >+ Optional<FetchBody> body; > if (formData && !formData->isEmpty()) { > body = FetchBody::fromFormData(*formData); > if (!body) { >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerFetch.h b/Source/WebCore/workers/service/context/ServiceWorkerFetch.h >index 861228ce2f241802ab71258db5b1e7274a9c0251..0983425159d731c7b4d0d324789253ba47c486d1 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerFetch.h >+++ b/Source/WebCore/workers/service/context/ServiceWorkerFetch.h >@@ -57,7 +57,7 @@ public: > virtual void cancel() = 0; > }; > >-void dispatchFetchEvent(Ref<Client>&&, ServiceWorkerGlobalScope&, std::optional<ServiceWorkerClientIdentifier>, ResourceRequest&&, String&& referrer, FetchOptions&&); >+void dispatchFetchEvent(Ref<Client>&&, ServiceWorkerGlobalScope&, Optional<ServiceWorkerClientIdentifier>, ResourceRequest&&, String&& referrer, FetchOptions&&); > }; > > } // namespace WebCore >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp b/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp >index 51760aa79678d2b7ba6f771c622206be03f5de6d..010f6d499ab7ed95276f7438a5c09da3c61d24ec 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp >+++ b/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp >@@ -93,7 +93,7 @@ void ServiceWorkerThread::runEventLoop() > WorkerThread::runEventLoop(); > } > >-void ServiceWorkerThread::postFetchTask(Ref<ServiceWorkerFetch::Client>&& client, std::optional<ServiceWorkerClientIdentifier>&& clientId, ResourceRequest&& request, String&& referrer, FetchOptions&& options) >+void ServiceWorkerThread::postFetchTask(Ref<ServiceWorkerFetch::Client>&& client, Optional<ServiceWorkerClientIdentifier>&& clientId, ResourceRequest&& request, String&& referrer, FetchOptions&& options) > { > // FIXME: instead of directly using runLoop(), we should be using something like WorkerGlobalScopeProxy. > // FIXME: request and options come straigth from IPC so are already isolated. We should be able to take benefit of that. >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerThread.h b/Source/WebCore/workers/service/context/ServiceWorkerThread.h >index 3492a39fe0bfbc00ef6c48a7e1cf6260ad324e92..51cf121a01de6b25103ee3c0450b069acfe9de1a 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerThread.h >+++ b/Source/WebCore/workers/service/context/ServiceWorkerThread.h >@@ -55,7 +55,7 @@ public: > > WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } > >- WEBCORE_EXPORT void postFetchTask(Ref<ServiceWorkerFetch::Client>&&, std::optional<ServiceWorkerClientIdentifier>&&, ResourceRequest&&, String&& referrer, FetchOptions&&); >+ WEBCORE_EXPORT void postFetchTask(Ref<ServiceWorkerFetch::Client>&&, Optional<ServiceWorkerClientIdentifier>&&, ResourceRequest&&, String&& referrer, FetchOptions&&); > WEBCORE_EXPORT void postMessageToServiceWorker(MessageWithMessagePorts&&, ServiceWorkerOrClientData&& sourceData); > > void fireInstallEvent(); >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp >index 72da981eb91d0527f6e6bc1dac0a012f0d3ac70e..1728076660638272fcdf3050e944962b7d99eb53 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp >+++ b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp >@@ -185,7 +185,7 @@ void ServiceWorkerThreadProxy::notifyNetworkStateChange(bool isOnline) > }, WorkerRunLoop::defaultMode()); > } > >-void ServiceWorkerThreadProxy::startFetch(SWServerConnectionIdentifier connectionIdentifier, FetchIdentifier fetchIdentifier, Ref<ServiceWorkerFetch::Client>&& client, std::optional<ServiceWorkerClientIdentifier>&& clientId, ResourceRequest&& request, String&& referrer, FetchOptions&& options) >+void ServiceWorkerThreadProxy::startFetch(SWServerConnectionIdentifier connectionIdentifier, FetchIdentifier fetchIdentifier, Ref<ServiceWorkerFetch::Client>&& client, Optional<ServiceWorkerClientIdentifier>&& clientId, ResourceRequest&& request, String&& referrer, FetchOptions&& options) > { > auto key = std::make_pair(connectionIdentifier, fetchIdentifier); > >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h >index 49628299c845175faca66ff404e33d8e86bb3d46..e5ffa93620a2066f8fdf438ed272f9d0447ee30c 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h >+++ b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h >@@ -71,7 +71,7 @@ public: > // Public only for testing purposes. > WEBCORE_TESTSUPPORT_EXPORT void notifyNetworkStateChange(bool isOnline); > >- WEBCORE_EXPORT void startFetch(SWServerConnectionIdentifier, FetchIdentifier, Ref<ServiceWorkerFetch::Client>&&, std::optional<ServiceWorkerClientIdentifier>&&, ResourceRequest&&, String&& referrer, FetchOptions&&); >+ WEBCORE_EXPORT void startFetch(SWServerConnectionIdentifier, FetchIdentifier, Ref<ServiceWorkerFetch::Client>&&, Optional<ServiceWorkerClientIdentifier>&&, ResourceRequest&&, String&& referrer, FetchOptions&&); > WEBCORE_EXPORT void cancelFetch(SWServerConnectionIdentifier, FetchIdentifier); > WEBCORE_EXPORT void removeFetch(SWServerConnectionIdentifier, FetchIdentifier); > >diff --git a/Source/WebCore/workers/service/server/RegistrationDatabase.cpp b/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >index a4cb2534262332dad1c55fcffc66d1b8194da02b..10e0f30f2b03a882ac617778c7d24ee6c0c5253d 100644 >--- a/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >+++ b/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >@@ -237,7 +237,7 @@ static String updateViaCacheToString(ServiceWorkerUpdateViaCache update) > RELEASE_ASSERT_NOT_REACHED(); > } > >-static std::optional<ServiceWorkerUpdateViaCache> stringToUpdateViaCache(const String& update) >+static Optional<ServiceWorkerUpdateViaCache> stringToUpdateViaCache(const String& update) > { > if (update == "Imports") > return ServiceWorkerUpdateViaCache::Imports; >@@ -246,7 +246,7 @@ static std::optional<ServiceWorkerUpdateViaCache> stringToUpdateViaCache(const S > if (update == "None") > return ServiceWorkerUpdateViaCache::None; > >- return std::nullopt; >+ return WTF::nullopt; > } > > static String workerTypeToString(WorkerType workerType) >@@ -261,14 +261,14 @@ static String workerTypeToString(WorkerType workerType) > RELEASE_ASSERT_NOT_REACHED(); > } > >-static std::optional<WorkerType> stringToWorkerType(const String& type) >+static Optional<WorkerType> stringToWorkerType(const String& type) > { > if (type == "Classic") > return WorkerType::Classic; > if (type == "Module") > return WorkerType::Module; > >- return std::nullopt; >+ return WTF::nullopt; > } > > void RegistrationDatabase::pushChanges(Vector<ServiceWorkerContextData>&& datas, CompletionHandler<void()>&& completionHandler) >@@ -400,8 +400,8 @@ String RegistrationDatabase::importRecords() > auto workerIdentifier = generateObjectIdentifier<ServiceWorkerIdentifierType>(); > auto registrationIdentifier = generateObjectIdentifier<ServiceWorkerRegistrationIdentifierType>(); > auto serviceWorkerData = ServiceWorkerData { workerIdentifier, scriptURL, ServiceWorkerState::Activated, *workerType, registrationIdentifier }; >- auto registration = ServiceWorkerRegistrationData { WTFMove(*key), registrationIdentifier, URL(originURL, scopePath), *updateViaCache, lastUpdateCheckTime, std::nullopt, std::nullopt, WTFMove(serviceWorkerData) }; >- auto contextData = ServiceWorkerContextData { std::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(scriptURL), *workerType, m_sessionID, true, WTFMove(scriptResourceMap) }; >+ auto registration = ServiceWorkerRegistrationData { WTFMove(*key), registrationIdentifier, URL(originURL, scopePath), *updateViaCache, lastUpdateCheckTime, WTF::nullopt, WTF::nullopt, WTFMove(serviceWorkerData) }; >+ auto contextData = ServiceWorkerContextData { WTF::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(scriptURL), *workerType, m_sessionID, true, WTFMove(scriptResourceMap) }; > > callOnMainThread([protectedThis = makeRef(*this), contextData = contextData.isolatedCopy()]() mutable { > protectedThis->addRegistrationToStore(WTFMove(contextData)); >diff --git a/Source/WebCore/workers/service/server/SWServer.cpp b/Source/WebCore/workers/service/server/SWServer.cpp >index 11405950552a43a436a1f63702c158ffb73cc419..bcb197ca2ca7bf75991110137dd09916191346b6 100644 >--- a/Source/WebCore/workers/service/server/SWServer.cpp >+++ b/Source/WebCore/workers/service/server/SWServer.cpp >@@ -78,14 +78,14 @@ SWServerWorker* SWServer::workerByID(ServiceWorkerIdentifier identifier) const > return worker; > } > >-std::optional<ServiceWorkerClientData> SWServer::serviceWorkerClientWithOriginByID(const ClientOrigin& clientOrigin, const ServiceWorkerClientIdentifier& clientIdentifier) const >+Optional<ServiceWorkerClientData> SWServer::serviceWorkerClientWithOriginByID(const ClientOrigin& clientOrigin, const ServiceWorkerClientIdentifier& clientIdentifier) const > { > auto iterator = m_clientIdentifiersPerOrigin.find(clientOrigin); > if (iterator == m_clientIdentifiersPerOrigin.end()) >- return std::nullopt; >+ return WTF::nullopt; > > if (!iterator->value.identifiers.contains(clientIdentifier)) >- return std::nullopt; >+ return WTF::nullopt; > > auto clientIterator = m_clientsById.find(clientIdentifier); > ASSERT(clientIterator != m_clientsById.end()); >@@ -348,7 +348,7 @@ void SWServer::scriptFetchFinished(Connection& connection, const ServiceWorkerFe > jobQueue->scriptFetchFinished(connection, result); > } > >-void SWServer::scriptContextFailedToStart(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, SWServerWorker& worker, const String& message) >+void SWServer::scriptContextFailedToStart(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, SWServerWorker& worker, const String& message) > { > if (!jobDataIdentifier) > return; >@@ -364,7 +364,7 @@ void SWServer::scriptContextFailedToStart(const std::optional<ServiceWorkerJobDa > jobQueue->scriptContextFailedToStart(*jobDataIdentifier, worker.identifier(), message); > } > >-void SWServer::scriptContextStarted(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, SWServerWorker& worker) >+void SWServer::scriptContextStarted(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, SWServerWorker& worker) > { > if (!jobDataIdentifier) > return; >@@ -386,7 +386,7 @@ void SWServer::terminatePreinstallationWorker(SWServerWorker& worker) > registration->setPreInstallationWorker(nullptr); > } > >-void SWServer::didFinishInstall(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, SWServerWorker& worker, bool wasSuccessful) >+void SWServer::didFinishInstall(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, SWServerWorker& worker, bool wasSuccessful) > { > if (!jobDataIdentifier) > return; >@@ -731,7 +731,7 @@ SWServerRegistration* SWServer::registrationFromServiceWorkerIdentifier(ServiceW > return m_registrations.get(iterator->value->registrationKey()); > } > >-void SWServer::registerServiceWorkerClient(ClientOrigin&& clientOrigin, ServiceWorkerClientData&& data, const std::optional<ServiceWorkerRegistrationIdentifier>& controllingServiceWorkerRegistrationIdentifier) >+void SWServer::registerServiceWorkerClient(ClientOrigin&& clientOrigin, ServiceWorkerClientData&& data, const Optional<ServiceWorkerRegistrationIdentifier>& controllingServiceWorkerRegistrationIdentifier) > { > auto clientIdentifier = data.identifier; > >diff --git a/Source/WebCore/workers/service/server/SWServer.h b/Source/WebCore/workers/service/server/SWServer.h >index 75bcc1cff12d40bf396442449b9b5e10332ccc88..c3910d6be21d12be54f457f6bd201dd57af6854b 100644 >--- a/Source/WebCore/workers/service/server/SWServer.h >+++ b/Source/WebCore/workers/service/server/SWServer.h >@@ -79,7 +79,7 @@ public: > void resolveRegistrationReadyRequests(SWServerRegistration&); > > // Messages to the client WebProcess >- virtual void updateRegistrationStateInClient(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const std::optional<ServiceWorkerData>&) = 0; >+ virtual void updateRegistrationStateInClient(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const Optional<ServiceWorkerData>&) = 0; > virtual void updateWorkerStateInClient(ServiceWorkerIdentifier, ServiceWorkerState) = 0; > virtual void fireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier) = 0; > virtual void setRegistrationLastUpdateTime(ServiceWorkerRegistrationIdentifier, WallTime) = 0; >@@ -140,7 +140,7 @@ public: > void fireActivateEvent(SWServerWorker&); > > WEBCORE_EXPORT SWServerWorker* workerByID(ServiceWorkerIdentifier) const; >- std::optional<ServiceWorkerClientData> serviceWorkerClientWithOriginByID(const ClientOrigin&, const ServiceWorkerClientIdentifier&) const; >+ Optional<ServiceWorkerClientData> serviceWorkerClientWithOriginByID(const ClientOrigin&, const ServiceWorkerClientIdentifier&) const; > WEBCORE_EXPORT SWServerWorker* activeWorkerFromRegistrationID(ServiceWorkerRegistrationIdentifier); > > WEBCORE_EXPORT void markAllWorkersForOriginAsTerminated(const SecurityOriginData&); >@@ -151,9 +151,9 @@ public: > > SWOriginStore& originStore() { return m_originStore; } > >- void scriptContextFailedToStart(const std::optional<ServiceWorkerJobDataIdentifier>&, SWServerWorker&, const String& message); >- void scriptContextStarted(const std::optional<ServiceWorkerJobDataIdentifier>&, SWServerWorker&); >- void didFinishInstall(const std::optional<ServiceWorkerJobDataIdentifier>&, SWServerWorker&, bool wasSuccessful); >+ void scriptContextFailedToStart(const Optional<ServiceWorkerJobDataIdentifier>&, SWServerWorker&, const String& message); >+ void scriptContextStarted(const Optional<ServiceWorkerJobDataIdentifier>&, SWServerWorker&); >+ void didFinishInstall(const Optional<ServiceWorkerJobDataIdentifier>&, SWServerWorker&, bool wasSuccessful); > void didFinishActivation(SWServerWorker&); > void workerContextTerminated(SWServerWorker&); > void matchAll(SWServerWorker&, const ServiceWorkerClientQueryOptions&, ServiceWorkerClientsMatchAllCallback&&); >@@ -163,7 +163,7 @@ public: > > WEBCORE_EXPORT static HashSet<SWServer*>& allServers(); > >- WEBCORE_EXPORT void registerServiceWorkerClient(ClientOrigin&&, ServiceWorkerClientData&&, const std::optional<ServiceWorkerRegistrationIdentifier>&); >+ WEBCORE_EXPORT void registerServiceWorkerClient(ClientOrigin&&, ServiceWorkerClientData&&, const Optional<ServiceWorkerRegistrationIdentifier>&); > WEBCORE_EXPORT void unregisterServiceWorkerClient(const ClientOrigin&, ServiceWorkerClientIdentifier); > > using RunServiceWorkerCallback = WTF::Function<void(SWServerToContextConnection*)>; >diff --git a/Source/WebCore/workers/service/server/SWServerRegistration.cpp b/Source/WebCore/workers/service/server/SWServerRegistration.cpp >index 3a1b6d1cdbb8913b19beb8cba43734bf45825d27..6567ca4fbbbcd949388d4d1e4c0d41a980918739 100644 >--- a/Source/WebCore/workers/service/server/SWServerRegistration.cpp >+++ b/Source/WebCore/workers/service/server/SWServerRegistration.cpp >@@ -94,7 +94,7 @@ void SWServerRegistration::updateRegistrationState(ServiceWorkerRegistrationStat > break; > }; > >- std::optional<ServiceWorkerData> serviceWorkerData; >+ Optional<ServiceWorkerData> serviceWorkerData; > if (worker) > serviceWorkerData = worker->data(); > >@@ -143,15 +143,15 @@ void SWServerRegistration::forEachConnection(const WTF::Function<void(SWServer:: > > ServiceWorkerRegistrationData SWServerRegistration::data() const > { >- std::optional<ServiceWorkerData> installingWorkerData; >+ Optional<ServiceWorkerData> installingWorkerData; > if (m_installingWorker) > installingWorkerData = m_installingWorker->data(); > >- std::optional<ServiceWorkerData> waitingWorkerData; >+ Optional<ServiceWorkerData> waitingWorkerData; > if (m_waitingWorker) > waitingWorkerData = m_waitingWorker->data(); > >- std::optional<ServiceWorkerData> activeWorkerData; >+ Optional<ServiceWorkerData> activeWorkerData; > if (m_activeWorker) > activeWorkerData = m_activeWorker->data(); > >diff --git a/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp b/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp >index 57ce37deda1bb5e38ffbdf42e4bb3188d4e10e69..3ea309d307ded63a7c5a4833194ac66c8c748ee8 100644 >--- a/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp >+++ b/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp >@@ -64,19 +64,19 @@ SWServerToContextConnection* SWServerToContextConnection::connectionForOrigin(co > return allConnectionsByOrigin().get(securityOrigin); > } > >-void SWServerToContextConnection::scriptContextFailedToStart(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const String& message) >+void SWServerToContextConnection::scriptContextFailedToStart(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const String& message) > { > if (auto* worker = SWServerWorker::existingWorkerForIdentifier(serviceWorkerIdentifier)) > worker->scriptContextFailedToStart(jobDataIdentifier, message); > } > >-void SWServerToContextConnection::scriptContextStarted(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier) >+void SWServerToContextConnection::scriptContextStarted(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier) > { > if (auto* worker = SWServerWorker::existingWorkerForIdentifier(serviceWorkerIdentifier)) > worker->scriptContextStarted(jobDataIdentifier); > } > >-void SWServerToContextConnection::didFinishInstall(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, bool wasSuccessful) >+void SWServerToContextConnection::didFinishInstall(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, bool wasSuccessful) > { > if (auto* worker = SWServerWorker::existingWorkerForIdentifier(serviceWorkerIdentifier)) > worker->didFinishInstall(jobDataIdentifier, wasSuccessful); >diff --git a/Source/WebCore/workers/service/server/SWServerToContextConnection.h b/Source/WebCore/workers/service/server/SWServerToContextConnection.h >index 606c389fa18de9c528052903cc8f8bb1a3a0cc3e..771da75ce9859576f7fed99ae774303884d42b3a 100644 >--- a/Source/WebCore/workers/service/server/SWServerToContextConnection.h >+++ b/Source/WebCore/workers/service/server/SWServerToContextConnection.h >@@ -58,15 +58,15 @@ public: > virtual void fireActivateEvent(ServiceWorkerIdentifier) = 0; > virtual void terminateWorker(ServiceWorkerIdentifier) = 0; > virtual void syncTerminateWorker(ServiceWorkerIdentifier) = 0; >- virtual void findClientByIdentifierCompleted(uint64_t requestIdentifier, const std::optional<ServiceWorkerClientData>&, bool hasSecurityError) = 0; >+ virtual void findClientByIdentifierCompleted(uint64_t requestIdentifier, const Optional<ServiceWorkerClientData>&, bool hasSecurityError) = 0; > virtual void matchAllCompleted(uint64_t requestIdentifier, const Vector<ServiceWorkerClientData>&) = 0; > virtual void claimCompleted(uint64_t requestIdentifier) = 0; > virtual void didFinishSkipWaiting(uint64_t callbackID) = 0; > > // Messages back from the SW host process >- WEBCORE_EXPORT void scriptContextFailedToStart(const std::optional<ServiceWorkerJobDataIdentifier>&, ServiceWorkerIdentifier, const String& message); >- WEBCORE_EXPORT void scriptContextStarted(const std::optional<ServiceWorkerJobDataIdentifier>&, ServiceWorkerIdentifier); >- WEBCORE_EXPORT void didFinishInstall(const std::optional<ServiceWorkerJobDataIdentifier>&, ServiceWorkerIdentifier, bool wasSuccessful); >+ WEBCORE_EXPORT void scriptContextFailedToStart(const Optional<ServiceWorkerJobDataIdentifier>&, ServiceWorkerIdentifier, const String& message); >+ WEBCORE_EXPORT void scriptContextStarted(const Optional<ServiceWorkerJobDataIdentifier>&, ServiceWorkerIdentifier); >+ WEBCORE_EXPORT void didFinishInstall(const Optional<ServiceWorkerJobDataIdentifier>&, ServiceWorkerIdentifier, bool wasSuccessful); > WEBCORE_EXPORT void didFinishActivation(ServiceWorkerIdentifier); > WEBCORE_EXPORT void setServiceWorkerHasPendingEvents(ServiceWorkerIdentifier, bool hasPendingEvents); > WEBCORE_EXPORT void skipWaiting(ServiceWorkerIdentifier, uint64_t callbackID); >diff --git a/Source/WebCore/workers/service/server/SWServerWorker.cpp b/Source/WebCore/workers/service/server/SWServerWorker.cpp >index 78ff60b8285ddca3e3f2fc6543f25536d95d1be4..c8b68e6b9b8ff2384c00c46eef76f716190e8b69 100644 >--- a/Source/WebCore/workers/service/server/SWServerWorker.cpp >+++ b/Source/WebCore/workers/service/server/SWServerWorker.cpp >@@ -74,7 +74,7 @@ ServiceWorkerContextData SWServerWorker::contextData() const > auto* registration = m_server.getRegistration(m_registrationKey); > ASSERT(registration); > >- return { std::nullopt, registration->data(), m_data.identifier, m_script, m_contentSecurityPolicy, m_data.scriptURL, m_data.type, m_server.sessionID(), false, m_scriptResourceMap }; >+ return { WTF::nullopt, registration->data(), m_data.identifier, m_script, m_contentSecurityPolicy, m_data.scriptURL, m_data.type, m_server.sessionID(), false, m_scriptResourceMap }; > } > > void SWServerWorker::terminate() >@@ -101,17 +101,17 @@ SWServerToContextConnection* SWServerWorker::contextConnection() > return SWServerToContextConnection::connectionForOrigin(securityOrigin()); > } > >-void SWServerWorker::scriptContextFailedToStart(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, const String& message) >+void SWServerWorker::scriptContextFailedToStart(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, const String& message) > { > m_server.scriptContextFailedToStart(jobDataIdentifier, *this, message); > } > >-void SWServerWorker::scriptContextStarted(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier) >+void SWServerWorker::scriptContextStarted(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier) > { > m_server.scriptContextStarted(jobDataIdentifier, *this); > } > >-void SWServerWorker::didFinishInstall(const std::optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, bool wasSuccessful) >+void SWServerWorker::didFinishInstall(const Optional<ServiceWorkerJobDataIdentifier>& jobDataIdentifier, bool wasSuccessful) > { > m_server.didFinishInstall(jobDataIdentifier, *this, wasSuccessful); > } >@@ -126,7 +126,7 @@ void SWServerWorker::contextTerminated() > m_server.workerContextTerminated(*this); > } > >-std::optional<ServiceWorkerClientData> SWServerWorker::findClientByIdentifier(const ServiceWorkerClientIdentifier& clientId) const >+Optional<ServiceWorkerClientData> SWServerWorker::findClientByIdentifier(const ServiceWorkerClientIdentifier& clientId) const > { > return m_server.serviceWorkerClientWithOriginByID(origin(), clientId); > } >diff --git a/Source/WebCore/workers/service/server/SWServerWorker.h b/Source/WebCore/workers/service/server/SWServerWorker.h >index 3419fd20f56da7cd4bcd7e303b61c41c7e05dc2c..a31dba714485514f437f3ad40878cb532597244b 100644 >--- a/Source/WebCore/workers/service/server/SWServerWorker.h >+++ b/Source/WebCore/workers/service/server/SWServerWorker.h >@@ -86,12 +86,12 @@ public: > bool hasPendingEvents() const { return m_hasPendingEvents; } > void setHasPendingEvents(bool); > >- void scriptContextFailedToStart(const std::optional<ServiceWorkerJobDataIdentifier>&, const String& message); >- void scriptContextStarted(const std::optional<ServiceWorkerJobDataIdentifier>&); >- void didFinishInstall(const std::optional<ServiceWorkerJobDataIdentifier>&, bool wasSuccessful); >+ void scriptContextFailedToStart(const Optional<ServiceWorkerJobDataIdentifier>&, const String& message); >+ void scriptContextStarted(const Optional<ServiceWorkerJobDataIdentifier>&); >+ void didFinishInstall(const Optional<ServiceWorkerJobDataIdentifier>&, bool wasSuccessful); > void didFinishActivation(); > void contextTerminated(); >- WEBCORE_EXPORT std::optional<ServiceWorkerClientData> findClientByIdentifier(const ServiceWorkerClientIdentifier&) const; >+ WEBCORE_EXPORT Optional<ServiceWorkerClientData> findClientByIdentifier(const ServiceWorkerClientIdentifier&) const; > void matchAll(const ServiceWorkerClientQueryOptions&, ServiceWorkerClientsMatchAllCallback&&); > void claim(); > void setScriptResource(URL&&, ServiceWorkerContextData::ImportedScript&&); >@@ -122,7 +122,7 @@ private: > ContentSecurityPolicyResponseHeaders m_contentSecurityPolicy; > bool m_hasPendingEvents { false }; > State m_state { State::NotRunning }; >- mutable std::optional<ClientOrigin> m_origin; >+ mutable Optional<ClientOrigin> m_origin; > bool m_isSkipWaitingFlagSet { false }; > Vector<Function<void(bool)>> m_whenActivatedHandlers; > HashMap<URL, ServiceWorkerContextData::ImportedScript> m_scriptResourceMap; >diff --git a/Source/WebCore/xml/XMLErrors.h b/Source/WebCore/xml/XMLErrors.h >index 617ceb02b728efd20d0c433b725566fd26ec9868..b021cce153c3192950a2bf77d809a2847ab0f0c1 100644 >--- a/Source/WebCore/xml/XMLErrors.h >+++ b/Source/WebCore/xml/XMLErrors.h >@@ -51,7 +51,7 @@ private: > > Document& m_document; > int m_errorCount { 0 }; >- std::optional<TextPosition> m_lastErrorPosition; >+ Optional<TextPosition> m_lastErrorPosition; > StringBuilder m_errorMessages; > }; > >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index b9eccf352fa940749e671dfef6e6f8e7b0905a18..0dd7152bbddc374ecfa889d06e997fbfd191a868 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -411,10 +411,10 @@ ExceptionOr<void> XMLHttpRequest::open(const String& method, const String& url, > return open(method, urlWithCredentials, async); > } > >-std::optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend() >+Optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend() > { >- // A return value other than std::nullopt means we should not try to send, and we should return that value to the caller. >- // std::nullopt means we are ready to send and should continue with the send algorithm. >+ // A return value other than WTF::nullopt means we should not try to send, and we should return that value to the caller. >+ // WTF::nullopt means we are ready to send and should continue with the send algorithm. > > if (!scriptExecutionContext()) > return ExceptionOr<void> { }; >@@ -436,10 +436,10 @@ std::optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend() > } > > m_error = false; >- return std::nullopt; >+ return WTF::nullopt; > } > >-ExceptionOr<void> XMLHttpRequest::send(std::optional<SendTypes>&& sendType) >+ExceptionOr<void> XMLHttpRequest::send(Optional<SendTypes>&& sendType) > { > InspectorInstrumentation::willSendXMLHttpRequest(scriptExecutionContext(), url()); > >@@ -627,7 +627,7 @@ ExceptionOr<void> XMLHttpRequest::createRequest() > } > } > >- m_exceptionCode = std::nullopt; >+ m_exceptionCode = WTF::nullopt; > m_error = false; > m_uploadComplete = !request.httpBody(); > m_sendFlag = true; >diff --git a/Source/WebCore/xml/XMLHttpRequest.h b/Source/WebCore/xml/XMLHttpRequest.h >index b489db39fe7ae7ceb17e24de7c7a52a9f0396f93..fa597353e33e9c8aab4aa9b8cb50f34898211146 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.h >+++ b/Source/WebCore/xml/XMLHttpRequest.h >@@ -80,7 +80,7 @@ public: > ExceptionOr<void> open(const String& method, const String& url); > ExceptionOr<void> open(const String& method, const URL&, bool async); > ExceptionOr<void> open(const String& method, const String&, bool async, const String& user, const String& password); >- ExceptionOr<void> send(std::optional<SendTypes>&&); >+ ExceptionOr<void> send(Optional<SendTypes>&&); > void abort(); > ExceptionOr<void> setRequestHeader(const String& name, const String& value); > ExceptionOr<void> overrideMimeType(const String& override); >@@ -157,7 +157,7 @@ private: > > bool responseIsXML() const; > >- std::optional<ExceptionOr<void>> prepareToSend(); >+ Optional<ExceptionOr<void>> prepareToSend(); > ExceptionOr<void> send(Document&); > ExceptionOr<void> send(const String& = { }); > ExceptionOr<void> send(Blob&); >@@ -240,7 +240,7 @@ private: > > MonotonicTime m_sendingTime; > >- std::optional<ExceptionCode> m_exceptionCode; >+ Optional<ExceptionCode> m_exceptionCode; > }; > > inline auto XMLHttpRequest::responseType() const -> ResponseType >diff --git a/Source/WebCore/xml/parser/XMLDocumentParser.h b/Source/WebCore/xml/parser/XMLDocumentParser.h >index cbdf5fe96e0bfdd450109af67482f873fc4c09a5..e822c23a0dc8e4c36e30cf3c5b0c76590940f49f 100644 >--- a/Source/WebCore/xml/parser/XMLDocumentParser.h >+++ b/Source/WebCore/xml/parser/XMLDocumentParser.h >@@ -190,6 +190,6 @@ private: > xmlDocPtr xmlDocPtrForString(CachedResourceLoader&, const String& source, const String& url); > #endif > >-std::optional<HashMap<String, String>> parseAttributes(const String&); >+Optional<HashMap<String, String>> parseAttributes(const String&); > > } // namespace WebCore >diff --git a/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp b/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp >index d7998bb8970a3a6b74a88b25e7f60046d97c726d..e71478609676350616ba872880a29f138661ac5b 100644 >--- a/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp >+++ b/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp >@@ -1453,7 +1453,7 @@ bool XMLDocumentParser::appendFragmentSource(const String& chunk) > > // -------------------------------- > >-using AttributeParseState = std::optional<HashMap<String, String>>; >+using AttributeParseState = Optional<HashMap<String, String>>; > > static void attributesStartElementNsHandler(void* closure, const xmlChar* xmlLocalName, const xmlChar* /*xmlPrefix*/, const xmlChar* /*xmlURI*/, int /*numNamespaces*/, const xmlChar** /*namespaces*/, int numAttributes, int /*numDefaulted*/, const xmlChar** libxmlAttributes) > { >@@ -1476,7 +1476,7 @@ static void attributesStartElementNsHandler(void* closure, const xmlChar* xmlLoc > } > } > >-std::optional<HashMap<String, String>> parseAttributes(const String& string) >+Optional<HashMap<String, String>> parseAttributes(const String& string) > { > String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; > >diff --git a/Source/WebDriver/Actions.h b/Source/WebDriver/Actions.h >index fdc9ac6feef871d6226f3cc4142e098776691ac0..671f4a210f7983143410e79a7cecf193b7669e64 100644 >--- a/Source/WebDriver/Actions.h >+++ b/Source/WebDriver/Actions.h >@@ -36,7 +36,7 @@ struct InputSource { > enum class Type { None, Key, Pointer }; > > Type type; >- std::optional<PointerType> pointerType; >+ Optional<PointerType> pointerType; > }; > > struct PointerParameters { >@@ -47,7 +47,7 @@ struct PointerOrigin { > enum class Type { Viewport, Pointer, Element }; > > Type type; >- std::optional<String> elementID; >+ Optional<String> elementID; > }; > > struct Action { >@@ -64,15 +64,15 @@ struct Action { > String id; > Type type; > Subtype subtype; >- std::optional<unsigned> duration; >+ Optional<unsigned> duration; > >- std::optional<PointerType> pointerType; >- std::optional<MouseButton> button; >- std::optional<PointerOrigin> origin; >- std::optional<int64_t> x; >- std::optional<int64_t> y; >+ Optional<PointerType> pointerType; >+ Optional<MouseButton> button; >+ Optional<PointerOrigin> origin; >+ Optional<int64_t> x; >+ Optional<int64_t> y; > >- std::optional<String> key; >+ Optional<String> key; > }; > > } // WebDriver >diff --git a/Source/WebDriver/Capabilities.h b/Source/WebDriver/Capabilities.h >index 815115a70dc48d471950fff3fa7de059cea067aa..de084f4950d5075e230f01e0783bb2154522e844 100644 >--- a/Source/WebDriver/Capabilities.h >+++ b/Source/WebDriver/Capabilities.h >@@ -34,9 +34,9 @@ > namespace WebDriver { > > struct Timeouts { >- std::optional<Seconds> script; >- std::optional<Seconds> pageLoad; >- std::optional<Seconds> implicit; >+ Optional<Seconds> script; >+ Optional<Seconds> pageLoad; >+ Optional<Seconds> implicit; > }; > > enum class PageLoadStrategy { >@@ -54,21 +54,21 @@ enum class UnhandledPromptBehavior { > }; > > struct Capabilities { >- std::optional<String> browserName; >- std::optional<String> browserVersion; >- std::optional<String> platformName; >- std::optional<bool> acceptInsecureCerts; >- std::optional<bool> setWindowRect; >- std::optional<Timeouts> timeouts; >- std::optional<PageLoadStrategy> pageLoadStrategy; >- std::optional<UnhandledPromptBehavior> unhandledPromptBehavior; >+ Optional<String> browserName; >+ Optional<String> browserVersion; >+ Optional<String> platformName; >+ Optional<bool> acceptInsecureCerts; >+ Optional<bool> setWindowRect; >+ Optional<Timeouts> timeouts; >+ Optional<PageLoadStrategy> pageLoadStrategy; >+ Optional<UnhandledPromptBehavior> unhandledPromptBehavior; > #if PLATFORM(GTK) || PLATFORM(WPE) >- std::optional<String> browserBinary; >- std::optional<Vector<String>> browserArguments; >- std::optional<Vector<std::pair<String, String>>> certificates; >+ Optional<String> browserBinary; >+ Optional<Vector<String>> browserArguments; >+ Optional<Vector<std::pair<String, String>>> certificates; > #endif > #if PLATFORM(GTK) >- std::optional<bool> useOverlayScrollbars; >+ Optional<bool> useOverlayScrollbars; > #endif > }; > >diff --git a/Source/WebDriver/CommandResult.cpp b/Source/WebDriver/CommandResult.cpp >index e0f85fa3b05768a0083056aac2681229703e7b31..d40ff6581f0941a0e6c08b95adbbe3eb644e3e3b 100644 >--- a/Source/WebDriver/CommandResult.cpp >+++ b/Source/WebDriver/CommandResult.cpp >@@ -38,7 +38,7 @@ enum ProtocolErrorCode { > ServerError = -32000 > }; > >-CommandResult::CommandResult(RefPtr<JSON::Value>&& result, std::optional<ErrorCode> errorCode) >+CommandResult::CommandResult(RefPtr<JSON::Value>&& result, Optional<ErrorCode> errorCode) > : m_errorCode(errorCode) > { > if (!m_errorCode) { >@@ -116,7 +116,7 @@ CommandResult::CommandResult(RefPtr<JSON::Value>&& result, std::optional<ErrorCo > } > } > >-CommandResult::CommandResult(ErrorCode errorCode, std::optional<String> errorMessage) >+CommandResult::CommandResult(ErrorCode errorCode, Optional<String> errorMessage) > : m_errorCode(errorCode) > , m_errorMessage(errorMessage) > { >diff --git a/Source/WebDriver/CommandResult.h b/Source/WebDriver/CommandResult.h >index 29dda759309e6127e62d71d0497fb15693548169..67133dfc346c7943ee8795c6865bd3a2fd523f3c 100644 >--- a/Source/WebDriver/CommandResult.h >+++ b/Source/WebDriver/CommandResult.h >@@ -71,7 +71,7 @@ public: > return CommandResult(WTFMove(result), CommandResult::ErrorCode::UnknownError); > } > >- static CommandResult fail(ErrorCode errorCode, std::optional<String> errorMessage = std::nullopt) >+ static CommandResult fail(ErrorCode errorCode, Optional<String> errorMessage = WTF::nullopt) > { > return CommandResult(errorCode, errorMessage); > } >@@ -82,16 +82,16 @@ public: > bool isError() const { return !!m_errorCode; } > ErrorCode errorCode() const { ASSERT(isError()); return m_errorCode.value(); } > String errorString() const; >- std::optional<String> errorMessage() const { ASSERT(isError()); return m_errorMessage; } >+ Optional<String> errorMessage() const { ASSERT(isError()); return m_errorMessage; } > const RefPtr<JSON::Object>& additionalErrorData() const { return m_errorAdditionalData; } > > private: >- explicit CommandResult(RefPtr<JSON::Value>&&, std::optional<ErrorCode> = std::nullopt); >- explicit CommandResult(ErrorCode, std::optional<String> = std::nullopt); >+ explicit CommandResult(RefPtr<JSON::Value>&&, Optional<ErrorCode> = WTF::nullopt); >+ explicit CommandResult(ErrorCode, Optional<String> = WTF::nullopt); > > RefPtr<JSON::Value> m_result; >- std::optional<ErrorCode> m_errorCode; >- std::optional<String> m_errorMessage; >+ Optional<ErrorCode> m_errorCode; >+ Optional<String> m_errorMessage; > RefPtr<JSON::Object> m_errorAdditionalData; > }; > >diff --git a/Source/WebDriver/HTTPServer.h b/Source/WebDriver/HTTPServer.h >index 9748b57f18063a081221142e09969aef300a2877..217113e3686913538011a26fe10aa8987b2ba54e 100644 >--- a/Source/WebDriver/HTTPServer.h >+++ b/Source/WebDriver/HTTPServer.h >@@ -57,7 +57,7 @@ public: > explicit HTTPServer(HTTPRequestHandler&); > ~HTTPServer() = default; > >- bool listen(const std::optional<String>& host, unsigned port); >+ bool listen(const Optional<String>& host, unsigned port); > void disconnect(); > > private: >diff --git a/Source/WebDriver/Session.cpp b/Source/WebDriver/Session.cpp >index fa861ec21c4a21532c79effbbc5ae8288c876d8b..0c63a20aa1241cf9a9f74e3c6100aa4578bfda34 100644 >--- a/Source/WebDriver/Session.cpp >+++ b/Source/WebDriver/Session.cpp >@@ -80,7 +80,7 @@ bool Session::isConnected() const > return m_host->isConnected(); > } > >-static std::optional<String> firstWindowHandleInResult(JSON::Value& result) >+static Optional<String> firstWindowHandleInResult(JSON::Value& result) > { > RefPtr<JSON::Array> handles; > if (result.asArray(handles) && handles->length()) { >@@ -89,7 +89,7 @@ static std::optional<String> firstWindowHandleInResult(JSON::Value& result) > if (handleValue->asString(handle)) > return handle; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > void Session::closeAllToplevelBrowsingContexts(const String& toplevelBrowsingContext, Function<void (CommandResult&&)>&& completionHandler) >@@ -109,7 +109,7 @@ void Session::closeAllToplevelBrowsingContexts(const String& toplevelBrowsingCon > > void Session::close(Function<void (CommandResult&&)>&& completionHandler) > { >- m_toplevelBrowsingContext = std::nullopt; >+ m_toplevelBrowsingContext = WTF::nullopt; > getWindowHandles([this, completionHandler = WTFMove(completionHandler)](CommandResult&& result) mutable { > if (result.isError()) { > completionHandler(WTFMove(result)); >@@ -143,25 +143,25 @@ void Session::setTimeouts(const Timeouts& timeouts, Function<void (CommandResult > completionHandler(CommandResult::success()); > } > >-void Session::switchToTopLevelBrowsingContext(std::optional<String> toplevelBrowsingContext) >+void Session::switchToTopLevelBrowsingContext(Optional<String> toplevelBrowsingContext) > { > m_toplevelBrowsingContext = toplevelBrowsingContext; >- m_currentBrowsingContext = std::nullopt; >+ m_currentBrowsingContext = WTF::nullopt; > } > >-void Session::switchToBrowsingContext(std::optional<String> browsingContext) >+void Session::switchToBrowsingContext(Optional<String> browsingContext) > { > // Automation sends empty strings for main frame. > if (!browsingContext || browsingContext.value().isEmpty()) >- m_currentBrowsingContext = std::nullopt; >+ m_currentBrowsingContext = WTF::nullopt; > else > m_currentBrowsingContext = browsingContext; > } > >-std::optional<String> Session::pageLoadStrategyString() const >+Optional<String> Session::pageLoadStrategyString() const > { > if (!capabilities().pageLoadStrategy) >- return std::nullopt; >+ return WTF::nullopt; > > switch (capabilities().pageLoadStrategy.value()) { > case PageLoadStrategy::None: >@@ -172,7 +172,7 @@ std::optional<String> Session::pageLoadStrategyString() const > return String("Eager"); > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > void Session::createTopLevelBrowsingContext(Function<void (CommandResult&&)>&& completionHandler) >@@ -267,7 +267,7 @@ void Session::acceptAndNotifyAlert(Function<void (CommandResult&&)>&& completion > void Session::reportUnexpectedAlertOpen(Function<void (CommandResult&&)>&& completionHandler) > { > getAlertText([completionHandler = WTFMove(completionHandler)](CommandResult&& result) { >- std::optional<String> alertText; >+ Optional<String> alertText; > if (!result.isError()) { > String valueString; > if (result.result()->asString(valueString)) >@@ -307,7 +307,7 @@ void Session::go(const String& url, Function<void (CommandResult&&)>&& completio > completionHandler(CommandResult::fail(WTFMove(response.responseObject))); > return; > } >- switchToBrowsingContext(std::nullopt); >+ switchToBrowsingContext(WTF::nullopt); > completionHandler(CommandResult::success()); > }); > }); >@@ -370,7 +370,7 @@ void Session::back(Function<void (CommandResult&&)>&& completionHandler) > completionHandler(CommandResult::fail(WTFMove(response.responseObject))); > return; > } >- switchToBrowsingContext(std::nullopt); >+ switchToBrowsingContext(WTF::nullopt); > completionHandler(CommandResult::success()); > }); > }); >@@ -398,7 +398,7 @@ void Session::forward(Function<void (CommandResult&&)>&& completionHandler) > completionHandler(CommandResult::fail(WTFMove(response.responseObject))); > return; > } >- switchToBrowsingContext(std::nullopt); >+ switchToBrowsingContext(WTF::nullopt); > completionHandler(CommandResult::success()); > }); > }); >@@ -426,7 +426,7 @@ void Session::refresh(Function<void (CommandResult&&)>&& completionHandler) > completionHandler(CommandResult::fail(WTFMove(response.responseObject))); > return; > } >- switchToBrowsingContext(std::nullopt); >+ switchToBrowsingContext(WTF::nullopt); > completionHandler(CommandResult::success()); > }); > }); >@@ -534,7 +534,7 @@ void Session::closeWindow(Function<void (CommandResult&&)>&& completionHandler) > completionHandler(WTFMove(result)); > return; > } >- auto toplevelBrowsingContext = std::exchange(m_toplevelBrowsingContext, std::nullopt); >+ auto toplevelBrowsingContext = std::exchange(m_toplevelBrowsingContext, WTF::nullopt); > closeTopLevelBrowsingContext(toplevelBrowsingContext.value(), WTFMove(completionHandler)); > }); > } >@@ -594,7 +594,7 @@ void Session::switchToFrame(RefPtr<JSON::Value>&& frameID, Function<void (Comman > } > > if (frameID->isNull()) { >- switchToBrowsingContext(std::nullopt); >+ switchToBrowsingContext(WTF::nullopt); > completionHandler(CommandResult::success()); > return; > } >@@ -737,7 +737,7 @@ void Session::getWindowRect(Function<void (CommandResult&&)>&& completionHandler > }); > } > >-void Session::setWindowRect(std::optional<double> x, std::optional<double> y, std::optional<double> width, std::optional<double> height, Function<void (CommandResult&&)>&& completionHandler) >+void Session::setWindowRect(Optional<double> x, Optional<double> y, Optional<double> width, Optional<double> height, Function<void (CommandResult&&)>&& completionHandler) > { > if (!m_toplevelBrowsingContext) { > completionHandler(CommandResult::fail(CommandResult::ErrorCode::NoSuchWindow)); >@@ -905,7 +905,7 @@ String Session::extractElementID(JSON::Value& value) > return elementID; > } > >-void Session::computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption> options, Function<void (std::optional<Rect>&&, std::optional<Point>&&, bool, RefPtr<JSON::Object>&&)>&& completionHandler) >+void Session::computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption> options, Function<void (Optional<Rect>&&, Optional<Point>&&, bool, RefPtr<JSON::Object>&&)>&& completionHandler) > { > ASSERT(m_toplevelBrowsingContext.value()); > >@@ -917,16 +917,16 @@ void Session::computeElementLayout(const String& elementID, OptionSet<ElementLay > parameters->setString("coordinateSystem"_s, options.contains(ElementLayoutOption::UseViewportCoordinates) ? "LayoutViewport"_s : "Page"_s); > m_host->sendCommandToBackend("computeElementLayout"_s, WTFMove(parameters), [protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) mutable { > if (response.isError || !response.responseObject) { >- completionHandler(std::nullopt, std::nullopt, false, WTFMove(response.responseObject)); >+ completionHandler(WTF::nullopt, WTF::nullopt, false, WTFMove(response.responseObject)); > return; > } > RefPtr<JSON::Object> rectObject; > if (!response.responseObject->getObject("rect"_s, rectObject)) { >- completionHandler(std::nullopt, std::nullopt, false, nullptr); >+ completionHandler(WTF::nullopt, WTF::nullopt, false, nullptr); > return; > } >- std::optional<int> elementX; >- std::optional<int> elementY; >+ Optional<int> elementX; >+ Optional<int> elementY; > RefPtr<JSON::Object> elementPosition; > if (rectObject->getObject("origin"_s, elementPosition)) { > int x, y; >@@ -936,11 +936,11 @@ void Session::computeElementLayout(const String& elementID, OptionSet<ElementLay > } > } > if (!elementX || !elementY) { >- completionHandler(std::nullopt, std::nullopt, false, nullptr); >+ completionHandler(WTF::nullopt, WTF::nullopt, false, nullptr); > return; > } >- std::optional<int> elementWidth; >- std::optional<int> elementHeight; >+ Optional<int> elementWidth; >+ Optional<int> elementHeight; > RefPtr<JSON::Object> elementSize; > if (rectObject->getObject("size"_s, elementSize)) { > int width, height; >@@ -950,25 +950,25 @@ void Session::computeElementLayout(const String& elementID, OptionSet<ElementLay > } > } > if (!elementWidth || !elementHeight) { >- completionHandler(std::nullopt, std::nullopt, false, nullptr); >+ completionHandler(WTF::nullopt, WTF::nullopt, false, nullptr); > return; > } > Rect rect = { { elementX.value(), elementY.value() }, { elementWidth.value(), elementHeight.value() } }; > > bool isObscured; > if (!response.responseObject->getBoolean("isObscured"_s, isObscured)) { >- completionHandler(std::nullopt, std::nullopt, false, nullptr); >+ completionHandler(WTF::nullopt, WTF::nullopt, false, nullptr); > return; > } > RefPtr<JSON::Object> inViewCenterPointObject; > if (!response.responseObject->getObject("inViewCenterPoint"_s, inViewCenterPointObject)) { >- completionHandler(rect, std::nullopt, isObscured, nullptr); >+ completionHandler(rect, WTF::nullopt, isObscured, nullptr); > return; > } > int inViewCenterPointX, inViewCenterPointY; > if (!inViewCenterPointObject->getInteger("x"_s, inViewCenterPointX) > || !inViewCenterPointObject->getInteger("y"_s, inViewCenterPointY)) { >- completionHandler(std::nullopt, std::nullopt, isObscured, nullptr); >+ completionHandler(WTF::nullopt, WTF::nullopt, isObscured, nullptr); > return; > } > Point inViewCenterPoint = { inViewCenterPointX, inViewCenterPointY }; >@@ -1236,7 +1236,7 @@ void Session::getElementRect(const String& elementID, Function<void (CommandResu > completionHandler(WTFMove(result)); > return; > } >- computeElementLayout(elementID, { }, [protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, std::optional<Point>&&, bool, RefPtr<JSON::Object>&& error) { >+ computeElementLayout(elementID, { }, [protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](Optional<Rect>&& rect, Optional<Point>&&, bool, RefPtr<JSON::Object>&& error) { > if (!rect || error) { > completionHandler(CommandResult::fail(WTFMove(error))); > return; >@@ -1477,11 +1477,11 @@ void Session::waitForNavigationToComplete(Function<void (CommandResult&&)>&& com > switch (result.errorCode()) { > case CommandResult::ErrorCode::NoSuchWindow: > // Window was closed, reset the top level browsing context and ignore the error. >- m_toplevelBrowsingContext = std::nullopt; >+ m_toplevelBrowsingContext = WTF::nullopt; > break; > case CommandResult::ErrorCode::NoSuchFrame: > // Navigation destroyed the current frame, switch to top level browsing context and ignore the error. >- switchToBrowsingContext(std::nullopt); >+ switchToBrowsingContext(WTF::nullopt); > break; > default: > completionHandler(WTFMove(result)); >@@ -1515,7 +1515,7 @@ void Session::elementClick(const String& elementID, Function<void (CommandResult > } > > OptionSet<ElementLayoutOption> options = { ElementLayoutOption::ScrollIntoViewIfNeeded, ElementLayoutOption::UseViewportCoordinates }; >- computeElementLayout(elementID, options, [this, protectedThis = makeRef(*this), elementID, completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, std::optional<Point>&& inViewCenter, bool isObscured, RefPtr<JSON::Object>&& error) mutable { >+ computeElementLayout(elementID, options, [this, protectedThis = makeRef(*this), elementID, completionHandler = WTFMove(completionHandler)](Optional<Rect>&& rect, Optional<Point>&& inViewCenter, bool isObscured, RefPtr<JSON::Object>&& error) mutable { > if (!rect || error) { > completionHandler(CommandResult::fail(WTFMove(error))); > return; >@@ -1784,13 +1784,13 @@ void Session::elementSendKeys(const String& elementID, const String& text, Funct > // Reset sticky modifiers if needed. > if (stickyModifiers) { > if (stickyModifiers & KeyModifier::Shift) >- interactions.append({ KeyboardInteractionType::KeyRelease, std::nullopt, std::optional<String>("Shift"_s) }); >+ interactions.append({ KeyboardInteractionType::KeyRelease, WTF::nullopt, Optional<String>("Shift"_s) }); > if (stickyModifiers & KeyModifier::Control) >- interactions.append({ KeyboardInteractionType::KeyRelease, std::nullopt, std::optional<String>("Control"_s) }); >+ interactions.append({ KeyboardInteractionType::KeyRelease, WTF::nullopt, Optional<String>("Control"_s) }); > if (stickyModifiers & KeyModifier::Alternate) >- interactions.append({ KeyboardInteractionType::KeyRelease, std::nullopt, std::optional<String>("Alternate"_s) }); >+ interactions.append({ KeyboardInteractionType::KeyRelease, WTF::nullopt, Optional<String>("Alternate"_s) }); > if (stickyModifiers & KeyModifier::Meta) >- interactions.append({ KeyboardInteractionType::KeyRelease, std::nullopt, std::optional<String>("Meta"_s) }); >+ interactions.append({ KeyboardInteractionType::KeyRelease, WTF::nullopt, Optional<String>("Meta"_s) }); > } > > performKeyboardInteractions(WTFMove(interactions), WTFMove(completionHandler)); >@@ -1968,13 +1968,13 @@ void Session::performKeyboardInteractions(Vector<KeyboardInteraction>&& interact > }); > } > >-static std::optional<Session::Cookie> parseAutomationCookie(const JSON::Object& cookieObject) >+static Optional<Session::Cookie> parseAutomationCookie(const JSON::Object& cookieObject) > { > Session::Cookie cookie; > if (!cookieObject.getString("name"_s, cookie.name)) >- return std::nullopt; >+ return WTF::nullopt; > if (!cookieObject.getString("value"_s, cookie.value)) >- return std::nullopt; >+ return WTF::nullopt; > > String path; > if (cookieObject.getString("path"_s, path)) >@@ -2175,7 +2175,7 @@ void Session::deleteAllCookies(Function<void (CommandResult&&)>&& completionHand > }); > } > >-InputSource& Session::getOrCreateInputSource(const String& id, InputSource::Type type, std::optional<PointerType> pointerType) >+InputSource& Session::getOrCreateInputSource(const String& id, InputSource::Type type, Optional<PointerType> pointerType) > { > auto addResult = m_activeInputSources.add(id, InputSource()); > if (addResult.isNewEntry) >@@ -2262,7 +2262,7 @@ void Session::performActions(Vector<Vector<Action>>&& actionsByTick, Function<vo > case Action::Type::Pointer: { > switch (action.subtype) { > case Action::Subtype::PointerUp: >- currentState.pressedButton = std::nullopt; >+ currentState.pressedButton = WTF::nullopt; > break; > case Action::Subtype::PointerDown: > currentState.pressedButton = action.button.value(); >@@ -2282,7 +2282,7 @@ void Session::performActions(Vector<Vector<Action>>&& actionsByTick, Function<vo > state->setDouble("duration"_s, action.duration.value()); > break; > case Action::Subtype::PointerCancel: >- currentState.pressedButton = std::nullopt; >+ currentState.pressedButton = WTF::nullopt; > break; > case Action::Subtype::KeyUp: > case Action::Subtype::KeyDown: >@@ -2296,9 +2296,9 @@ void Session::performActions(Vector<Vector<Action>>&& actionsByTick, Function<vo > switch (action.subtype) { > case Action::Subtype::KeyUp: > if (currentState.pressedVirtualKey) >- currentState.pressedVirtualKey = std::nullopt; >+ currentState.pressedVirtualKey = WTF::nullopt; > else >- currentState.pressedKey = std::nullopt; >+ currentState.pressedKey = WTF::nullopt; > break; > case Action::Subtype::KeyDown: { > KeyModifier modifier; >@@ -2446,7 +2446,7 @@ void Session::sendAlertText(const String& text, Function<void (CommandResult&&)> > }); > } > >-void Session::takeScreenshot(std::optional<String> elementID, std::optional<bool> scrollIntoView, Function<void (CommandResult&&)>&& completionHandler) >+void Session::takeScreenshot(Optional<String> elementID, Optional<bool> scrollIntoView, Function<void (CommandResult&&)>&& completionHandler) > { > if (!m_toplevelBrowsingContext) { > completionHandler(CommandResult::fail(CommandResult::ErrorCode::NoSuchWindow)); >diff --git a/Source/WebDriver/Session.h b/Source/WebDriver/Session.h >index d3fbcb777edb7a32de8010b9d246fe075e0ce9e5..b3d6dad6a68a8d98f2248ed0241553f188a08a2b 100644 >--- a/Source/WebDriver/Session.h >+++ b/Source/WebDriver/Session.h >@@ -61,14 +61,14 @@ public: > struct Cookie { > String name; > String value; >- std::optional<String> path; >- std::optional<String> domain; >- std::optional<bool> secure; >- std::optional<bool> httpOnly; >- std::optional<uint64_t> expiry; >+ Optional<String> path; >+ Optional<String> domain; >+ Optional<bool> secure; >+ Optional<bool> httpOnly; >+ Optional<uint64_t> expiry; > }; > >- InputSource& getOrCreateInputSource(const String& id, InputSource::Type, std::optional<PointerType>); >+ InputSource& getOrCreateInputSource(const String& id, InputSource::Type, Optional<PointerType>); > > void waitForNavigationToComplete(Function<void (CommandResult&&)>&&); > void createTopLevelBrowsingContext(Function<void (CommandResult&&)>&&); >@@ -89,7 +89,7 @@ public: > void switchToFrame(RefPtr<JSON::Value>&&, Function<void (CommandResult&&)>&&); > void switchToParentFrame(Function<void (CommandResult&&)>&&); > void getWindowRect(Function<void (CommandResult&&)>&&); >- void setWindowRect(std::optional<double> x, std::optional<double> y, std::optional<double> width, std::optional<double> height, Function<void (CommandResult&&)>&&); >+ void setWindowRect(Optional<double> x, Optional<double> y, Optional<double> width, Optional<double> height, Function<void (CommandResult&&)>&&); > void maximizeWindow(Function<void (CommandResult&&)>&&); > void minimizeWindow(Function<void (CommandResult&&)>&&); > void fullscreenWindow(Function<void (CommandResult&&)>&&); >@@ -119,19 +119,19 @@ public: > void acceptAlert(Function<void (CommandResult&&)>&&); > void getAlertText(Function<void (CommandResult&&)>&&); > void sendAlertText(const String&, Function<void (CommandResult&&)>&&); >- void takeScreenshot(std::optional<String> elementID, std::optional<bool> scrollIntoView, Function<void (CommandResult&&)>&&); >+ void takeScreenshot(Optional<String> elementID, Optional<bool> scrollIntoView, Function<void (CommandResult&&)>&&); > > private: > Session(std::unique_ptr<SessionHost>&&); > >- void switchToTopLevelBrowsingContext(std::optional<String>); >- void switchToBrowsingContext(std::optional<String>); >+ void switchToTopLevelBrowsingContext(Optional<String>); >+ void switchToBrowsingContext(Optional<String>); > void closeTopLevelBrowsingContext(const String& toplevelBrowsingContext, Function<void (CommandResult&&)>&&); > void closeAllToplevelBrowsingContexts(const String& toplevelBrowsingContext, Function<void (CommandResult&&)>&&); > > void getToplevelBrowsingContextRect(Function<void (CommandResult&&)>&&); > >- std::optional<String> pageLoadStrategyString() const; >+ Optional<String> pageLoadStrategyString() const; > > void handleUserPrompts(Function<void (CommandResult&&)>&&); > void handleUnexpectedAlertOpen(Function<void (CommandResult&&)>&&); >@@ -164,7 +164,7 @@ private: > ScrollIntoViewIfNeeded = 1 << 0, > UseViewportCoordinates = 1 << 1, > }; >- void computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption>, Function<void (std::optional<Rect>&&, std::optional<Point>&&, bool, RefPtr<JSON::Object>&&)>&&); >+ void computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption>, Function<void (Optional<Rect>&&, Optional<Point>&&, bool, RefPtr<JSON::Object>&&)>&&); > > void selectOptionElement(const String& elementID, Function<void (CommandResult&&)>&&); > >@@ -174,8 +174,8 @@ private: > enum class KeyboardInteractionType { KeyPress, KeyRelease, InsertByKey }; > struct KeyboardInteraction { > KeyboardInteractionType type { KeyboardInteractionType::InsertByKey }; >- std::optional<String> text; >- std::optional<String> key; >+ Optional<String> text; >+ Optional<String> key; > }; > enum KeyModifier { > None = 0, >@@ -192,9 +192,9 @@ private: > > Type type; > String subtype; >- std::optional<MouseButton> pressedButton; >- std::optional<String> pressedKey; >- std::optional<String> pressedVirtualKey; >+ Optional<MouseButton> pressedButton; >+ Optional<String> pressedKey; >+ Optional<String> pressedVirtualKey; > }; > InputSourceState& inputSourceState(const String& id); > >@@ -202,8 +202,8 @@ private: > Seconds m_scriptTimeout; > Seconds m_pageLoadTimeout; > Seconds m_implicitWaitTimeout; >- std::optional<String> m_toplevelBrowsingContext; >- std::optional<String> m_currentBrowsingContext; >+ Optional<String> m_toplevelBrowsingContext; >+ Optional<String> m_currentBrowsingContext; > HashMap<String, InputSource> m_activeInputSources; > HashMap<String, InputSourceState> m_inputStateTable; > }; >diff --git a/Source/WebDriver/SessionHost.h b/Source/WebDriver/SessionHost.h >index 97b525eead66c5bfe946701c31eb184f1581ed2d..536507016a12efec150b917183c838958cacb815 100644 >--- a/Source/WebDriver/SessionHost.h >+++ b/Source/WebDriver/SessionHost.h >@@ -54,8 +54,8 @@ public: > const String& sessionID() const { return m_sessionID; } > const Capabilities& capabilities() const { return m_capabilities; } > >- void connectToBrowser(Function<void (std::optional<String> error)>&&); >- void startAutomationSession(Function<void (bool, std::optional<String>)>&&); >+ void connectToBrowser(Function<void (Optional<String> error)>&&); >+ void startAutomationSession(Function<void (bool, Optional<String>)>&&); > > struct CommandResponse { > RefPtr<JSON::Object> responseObject; >@@ -77,7 +77,7 @@ private: > #if USE(GLIB) > static void dbusConnectionClosedCallback(SessionHost*); > static const GDBusInterfaceVTable s_interfaceVTable; >- void launchBrowser(Function<void (std::optional<String> error)>&&); >+ void launchBrowser(Function<void (Optional<String> error)>&&); > void connectToBrowser(std::unique_ptr<ConnectToBrowserAsyncData>&&); > bool matchCapabilities(GVariant*); > bool buildSessionCapabilities(GVariantBuilder*) const; >@@ -95,7 +95,7 @@ private: > HashMap<long, Function<void (CommandResponse&&)>> m_commandRequests; > > #if USE(GLIB) >- Function<void (bool, std::optional<String>)> m_startSessionCompletionHandler; >+ Function<void (bool, Optional<String>)> m_startSessionCompletionHandler; > GRefPtr<GSubprocess> m_browser; > GRefPtr<GDBusConnection> m_dbusConnection; > GRefPtr<GCancellable> m_cancellable; >diff --git a/Source/WebDriver/WebDriverService.cpp b/Source/WebDriver/WebDriverService.cpp >index 7d528b265f8ad7ad4431d8a752376de7da3787c5..f04f4fdea80a6ab3c6cdc84b2e9f146d27171573 100644 >--- a/Source/WebDriver/WebDriverService.cpp >+++ b/Source/WebDriver/WebDriverService.cpp >@@ -54,7 +54,7 @@ static void printUsageStatement(const char* programName) > int WebDriverService::run(int argc, char** argv) > { > String portString; >- std::optional<String> host; >+ Optional<String> host; > for (int i = 1 ; i < argc; ++i) { > const char* arg = argv[i]; > if (!strcmp(arg, "-h") || !strcmp(arg, "--help")) { >@@ -177,7 +177,7 @@ const WebDriverService::Command WebDriverService::s_commands[] = { > { HTTPMethod::Get, "/session/$sessionId/element/$elementId/displayed", &WebDriverService::isElementDisplayed }, > }; > >-std::optional<WebDriverService::HTTPMethod> WebDriverService::toCommandHTTPMethod(const String& method) >+Optional<WebDriverService::HTTPMethod> WebDriverService::toCommandHTTPMethod(const String& method) > { > auto lowerCaseMethod = method.convertToASCIILowercase(); > if (lowerCaseMethod == "get") >@@ -187,7 +187,7 @@ std::optional<WebDriverService::HTTPMethod> WebDriverService::toCommandHTTPMetho > if (lowerCaseMethod == "delete") > return WebDriverService::HTTPMethod::Delete; > >- return std::nullopt; >+ return WTF::nullopt; > } > > bool WebDriverService::findCommand(HTTPMethod method, const String& path, CommandHandler* handler, HashMap<String, String>& parameters) >@@ -287,38 +287,38 @@ void WebDriverService::sendResponse(Function<void (HTTPRequestHandler::Response& > replyHandler({ result.httpStatusCode(), responseObject->toJSONString().utf8(), "application/json; charset=utf-8"_s }); > } > >-static std::optional<double> valueAsNumberInRange(const JSON::Value& value, double minAllowed = 0, double maxAllowed = std::numeric_limits<int>::max()) >+static Optional<double> valueAsNumberInRange(const JSON::Value& value, double minAllowed = 0, double maxAllowed = std::numeric_limits<int>::max()) > { > double number; > if (!value.asDouble(number)) >- return std::nullopt; >+ return WTF::nullopt; > > if (std::isnan(number) || std::isinf(number)) >- return std::nullopt; >+ return WTF::nullopt; > > if (number < minAllowed || number > maxAllowed) >- return std::nullopt; >+ return WTF::nullopt; > > return number; > } > >-static std::optional<uint64_t> unsignedValue(JSON::Value& value) >+static Optional<uint64_t> unsignedValue(JSON::Value& value) > { > auto number = valueAsNumberInRange(value, 0, maxSafeInteger); > if (!number) >- return std::nullopt; >+ return WTF::nullopt; > > auto intValue = static_cast<uint64_t>(number.value()); > // If the contained value is a double, bail in case it doesn't match the integer > // value, i.e. if the double value was not originally in integer form. > // https://w3c.github.io/webdriver/webdriver-spec.html#dfn-integer > if (number.value() != intValue) >- return std::nullopt; >+ return WTF::nullopt; > > return intValue; > } > >-static std::optional<Timeouts> deserializeTimeouts(JSON::Object& timeoutsObject) >+static Optional<Timeouts> deserializeTimeouts(JSON::Object& timeoutsObject) > { > // §8.5 Set Timeouts. > // https://w3c.github.io/webdriver/webdriver-spec.html#dfn-deserialize-as-a-timeout >@@ -331,7 +331,7 @@ static std::optional<Timeouts> deserializeTimeouts(JSON::Object& timeoutsObject) > // If value is not an integer, or it is less than 0 or greater than the maximum safe integer, return error with error code invalid argument. > auto timeoutMS = unsignedValue(*it->value); > if (!timeoutMS) >- return std::nullopt; >+ return WTF::nullopt; > > if (it->key == "script") > timeouts.script = Seconds::fromMilliseconds(timeoutMS.value()); >@@ -340,12 +340,12 @@ static std::optional<Timeouts> deserializeTimeouts(JSON::Object& timeoutsObject) > else if (it->key == "implicit") > timeouts.implicit = Seconds::fromMilliseconds(timeoutMS.value()); > else >- return std::nullopt; >+ return WTF::nullopt; > } > return timeouts; > } > >-static std::optional<PageLoadStrategy> deserializePageLoadStrategy(const String& pageLoadStrategy) >+static Optional<PageLoadStrategy> deserializePageLoadStrategy(const String& pageLoadStrategy) > { > if (pageLoadStrategy == "none") > return PageLoadStrategy::None; >@@ -353,10 +353,10 @@ static std::optional<PageLoadStrategy> deserializePageLoadStrategy(const String& > return PageLoadStrategy::Normal; > if (pageLoadStrategy == "eager") > return PageLoadStrategy::Eager; >- return std::nullopt; >+ return WTF::nullopt; > } > >-static std::optional<UnhandledPromptBehavior> deserializeUnhandledPromptBehavior(const String& unhandledPromptBehavior) >+static Optional<UnhandledPromptBehavior> deserializeUnhandledPromptBehavior(const String& unhandledPromptBehavior) > { > if (unhandledPromptBehavior == "dismiss") > return UnhandledPromptBehavior::Dismiss; >@@ -368,7 +368,7 @@ static std::optional<UnhandledPromptBehavior> deserializeUnhandledPromptBehavior > return UnhandledPromptBehavior::AcceptAndNotify; > if (unhandledPromptBehavior == "ignore") > return UnhandledPromptBehavior::Ignore; >- return std::nullopt; >+ return WTF::nullopt; > } > > void WebDriverService::parseCapabilities(const JSON::Object& matchedCapabilities, Capabilities& capabilities) const >@@ -659,7 +659,7 @@ void WebDriverService::connectToBrowser(Vector<Capabilities>&& capabilitiesList, > > auto sessionHost = std::make_unique<SessionHost>(capabilitiesList.takeLast()); > auto* sessionHostPtr = sessionHost.get(); >- sessionHostPtr->connectToBrowser([this, capabilitiesList = WTFMove(capabilitiesList), sessionHost = WTFMove(sessionHost), completionHandler = WTFMove(completionHandler)](std::optional<String> error) mutable { >+ sessionHostPtr->connectToBrowser([this, capabilitiesList = WTFMove(capabilitiesList), sessionHost = WTFMove(sessionHost), completionHandler = WTFMove(completionHandler)](Optional<String> error) mutable { > if (error) { > completionHandler(CommandResult::fail(CommandResult::ErrorCode::SessionNotCreated, makeString("Failed to connect to browser: ", error.value()))); > return; >@@ -672,7 +672,7 @@ void WebDriverService::connectToBrowser(Vector<Capabilities>&& capabilitiesList, > void WebDriverService::createSession(Vector<Capabilities>&& capabilitiesList, std::unique_ptr<SessionHost>&& sessionHost, Function<void (CommandResult&&)>&& completionHandler) > { > auto* sessionHostPtr = sessionHost.get(); >- sessionHostPtr->startAutomationSession([this, capabilitiesList = WTFMove(capabilitiesList), sessionHost = WTFMove(sessionHost), completionHandler = WTFMove(completionHandler)](bool capabilitiesDidMatch, std::optional<String> errorMessage) mutable { >+ sessionHostPtr->startAutomationSession([this, capabilitiesList = WTFMove(capabilitiesList), sessionHost = WTFMove(sessionHost), completionHandler = WTFMove(completionHandler)](bool capabilitiesDidMatch, Optional<String> errorMessage) mutable { > if (errorMessage) { > completionHandler(CommandResult::fail(CommandResult::ErrorCode::UnknownError, errorMessage.value())); > return; >@@ -926,7 +926,7 @@ void WebDriverService::setWindowRect(RefPtr<JSON::Object>&& parameters, Function > // §10.7.2 Set Window Rect. > // https://w3c.github.io/webdriver/webdriver-spec.html#set-window-rect > RefPtr<JSON::Value> value; >- std::optional<double> width; >+ Optional<double> width; > if (parameters->getValue("width"_s, value)) { > if (auto number = valueAsNumberInRange(*value)) > width = number; >@@ -935,7 +935,7 @@ void WebDriverService::setWindowRect(RefPtr<JSON::Object>&& parameters, Function > return; > } > } >- std::optional<double> height; >+ Optional<double> height; > if (parameters->getValue("height"_s, value)) { > if (auto number = valueAsNumberInRange(*value)) > height = number; >@@ -944,7 +944,7 @@ void WebDriverService::setWindowRect(RefPtr<JSON::Object>&& parameters, Function > return; > } > } >- std::optional<double> x; >+ Optional<double> x; > if (parameters->getValue("x"_s, value)) { > if (auto number = valueAsNumberInRange(*value, INT_MIN)) > x = number; >@@ -953,7 +953,7 @@ void WebDriverService::setWindowRect(RefPtr<JSON::Object>&& parameters, Function > return; > } > } >- std::optional<double> y; >+ Optional<double> y; > if (parameters->getValue("y"_s, value)) { > if (auto number = valueAsNumberInRange(*value, INT_MIN)) > y = number; >@@ -1077,12 +1077,12 @@ void WebDriverService::switchToParentFrame(RefPtr<JSON::Object>&& parameters, Fu > }); > } > >-static std::optional<String> findElementOrCompleteWithError(JSON::Object& parameters, Function<void (CommandResult&&)>& completionHandler) >+static Optional<String> findElementOrCompleteWithError(JSON::Object& parameters, Function<void (CommandResult&&)>& completionHandler) > { > String elementID; > if (!parameters.getString("elementId"_s, elementID) || elementID.isEmpty()) { > completionHandler(CommandResult::fail(CommandResult::ErrorCode::InvalidArgument)); >- return std::nullopt; >+ return WTF::nullopt; > } > return elementID; > } >@@ -1488,43 +1488,43 @@ void WebDriverService::getNamedCookie(RefPtr<JSON::Object>&& parameters, Functio > }); > } > >-static std::optional<Session::Cookie> deserializeCookie(JSON::Object& cookieObject) >+static Optional<Session::Cookie> deserializeCookie(JSON::Object& cookieObject) > { > Session::Cookie cookie; > if (!cookieObject.getString("name"_s, cookie.name) || cookie.name.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > if (!cookieObject.getString("value"_s, cookie.value) || cookie.value.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > RefPtr<JSON::Value> value; > if (cookieObject.getValue("path"_s, value)) { > String path; > if (!value->asString(path)) >- return std::nullopt; >+ return WTF::nullopt; > cookie.path = path; > } > if (cookieObject.getValue("domain"_s, value)) { > String domain; > if (!value->asString(domain)) >- return std::nullopt; >+ return WTF::nullopt; > cookie.domain = domain; > } > if (cookieObject.getValue("secure"_s, value)) { > bool secure; > if (!value->asBoolean(secure)) >- return std::nullopt; >+ return WTF::nullopt; > cookie.secure = secure; > } > if (cookieObject.getValue("httpOnly"_s, value)) { > bool httpOnly; > if (!value->asBoolean(httpOnly)) >- return std::nullopt; >+ return WTF::nullopt; > cookie.httpOnly = httpOnly; > } > if (cookieObject.getValue("expiry"_s, value)) { > auto expiry = unsignedValue(*value); > if (!expiry) >- return std::nullopt; >+ return WTF::nullopt; > cookie.expiry = expiry.value(); > } > >@@ -1597,7 +1597,7 @@ void WebDriverService::deleteAllCookies(RefPtr<JSON::Object>&& parameters, Funct > }); > } > >-static bool processPauseAction(JSON::Object& actionItem, Action& action, std::optional<String>& errorMessage) >+static bool processPauseAction(JSON::Object& actionItem, Action& action, Optional<String>& errorMessage) > { > RefPtr<JSON::Value> durationValue; > if (!actionItem.getValue("duration"_s, durationValue)) { >@@ -1615,23 +1615,23 @@ static bool processPauseAction(JSON::Object& actionItem, Action& action, std::op > return true; > } > >-static std::optional<Action> processNullAction(const String& id, JSON::Object& actionItem, std::optional<String>& errorMessage) >+static Optional<Action> processNullAction(const String& id, JSON::Object& actionItem, Optional<String>& errorMessage) > { > String subtype; > actionItem.getString("type"_s, subtype); > if (subtype != "pause") { > errorMessage = String("The parameter 'type' in null action is invalid or missing"); >- return std::nullopt; >+ return WTF::nullopt; > } > > Action action(id, Action::Type::None, Action::Subtype::Pause); > if (!processPauseAction(actionItem, action, errorMessage)) >- return std::nullopt; >+ return WTF::nullopt; > > return action; > } > >-static std::optional<Action> processKeyAction(const String& id, JSON::Object& actionItem, std::optional<String>& errorMessage) >+static Optional<Action> processKeyAction(const String& id, JSON::Object& actionItem, Optional<String>& errorMessage) > { > Action::Subtype actionSubtype; > String subtype; >@@ -1644,7 +1644,7 @@ static std::optional<Action> processKeyAction(const String& id, JSON::Object& ac > actionSubtype = Action::Subtype::KeyDown; > else { > errorMessage = String("The parameter 'type' of key action is invalid"); >- return std::nullopt; >+ return WTF::nullopt; > } > > Action action(id, Action::Type::Key, actionSubtype); >@@ -1652,19 +1652,19 @@ static std::optional<Action> processKeyAction(const String& id, JSON::Object& ac > switch (actionSubtype) { > case Action::Subtype::Pause: > if (!processPauseAction(actionItem, action, errorMessage)) >- return std::nullopt; >+ return WTF::nullopt; > break; > case Action::Subtype::KeyUp: > case Action::Subtype::KeyDown: { > RefPtr<JSON::Value> keyValue; > if (!actionItem.getValue("value"_s, keyValue)) { > errorMessage = String("The paramater 'value' is missing for key up/down action"); >- return std::nullopt; >+ return WTF::nullopt; > } > String key; > if (!keyValue->asString(key) || key.isEmpty()) { > errorMessage = String("The paramater 'value' is invalid for key up/down action"); >- return std::nullopt; >+ return WTF::nullopt; > } > // FIXME: check single unicode code point. > action.key = key; >@@ -1696,7 +1696,7 @@ static MouseButton actionMouseButton(unsigned button) > return MouseButton::None; > } > >-static std::optional<Action> processPointerAction(const String& id, PointerParameters& parameters, JSON::Object& actionItem, std::optional<String>& errorMessage) >+static Optional<Action> processPointerAction(const String& id, PointerParameters& parameters, JSON::Object& actionItem, Optional<String>& errorMessage) > { > Action::Subtype actionSubtype; > String subtype; >@@ -1713,7 +1713,7 @@ static std::optional<Action> processPointerAction(const String& id, PointerParam > actionSubtype = Action::Subtype::PointerCancel; > else { > errorMessage = String("The parameter 'type' of pointer action is invalid"); >- return std::nullopt; >+ return WTF::nullopt; > } > > Action action(id, Action::Type::Pointer, actionSubtype); >@@ -1722,19 +1722,19 @@ static std::optional<Action> processPointerAction(const String& id, PointerParam > switch (actionSubtype) { > case Action::Subtype::Pause: > if (!processPauseAction(actionItem, action, errorMessage)) >- return std::nullopt; >+ return WTF::nullopt; > break; > case Action::Subtype::PointerUp: > case Action::Subtype::PointerDown: { > RefPtr<JSON::Value> buttonValue; > if (!actionItem.getValue("button"_s, buttonValue)) { > errorMessage = String("The paramater 'button' is missing for pointer up/down action"); >- return std::nullopt; >+ return WTF::nullopt; > } > auto button = unsignedValue(*buttonValue); > if (!button) { > errorMessage = String("The paramater 'button' is invalid for pointer up/down action"); >- return std::nullopt; >+ return WTF::nullopt; > } > action.button = actionMouseButton(button.value()); > break; >@@ -1745,7 +1745,7 @@ static std::optional<Action> processPointerAction(const String& id, PointerParam > auto duration = unsignedValue(*durationValue); > if (!duration) { > errorMessage = String("The parameter 'duration' is invalid in pointer move action"); >- return std::nullopt; >+ return WTF::nullopt; > } > action.duration = duration.value(); > } >@@ -1758,30 +1758,30 @@ static std::optional<Action> processPointerAction(const String& id, PointerParam > String elementID; > if (!originObject->getString(Session::webElementIdentifier(), elementID)) { > errorMessage = String("The parameter 'origin' is not a valid web element object in pointer move action"); >- return std::nullopt; >+ return WTF::nullopt; > } > action.origin = PointerOrigin { PointerOrigin::Type::Element, elementID }; > } else { > String origin; > originValue->asString(origin); > if (origin == "viewport") >- action.origin = PointerOrigin { PointerOrigin::Type::Viewport, std::nullopt }; >+ action.origin = PointerOrigin { PointerOrigin::Type::Viewport, WTF::nullopt }; > else if (origin == "pointer") >- action.origin = PointerOrigin { PointerOrigin::Type::Pointer, std::nullopt }; >+ action.origin = PointerOrigin { PointerOrigin::Type::Pointer, WTF::nullopt }; > else { > errorMessage = String("The parameter 'origin' is invalid in pointer move action"); >- return std::nullopt; >+ return WTF::nullopt; > } > } > } else >- action.origin = PointerOrigin { PointerOrigin::Type::Viewport, std::nullopt }; >+ action.origin = PointerOrigin { PointerOrigin::Type::Viewport, WTF::nullopt }; > > RefPtr<JSON::Value> xValue; > if (actionItem.getValue("x"_s, xValue)) { > auto x = valueAsNumberInRange(*xValue, INT_MIN); > if (!x) { > errorMessage = String("The paramater 'x' is invalid for pointer move action"); >- return std::nullopt; >+ return WTF::nullopt; > } > action.x = x.value(); > } >@@ -1791,7 +1791,7 @@ static std::optional<Action> processPointerAction(const String& id, PointerParam > auto y = valueAsNumberInRange(*yValue, INT_MIN); > if (!y) { > errorMessage = String("The paramater 'y' is invalid for pointer move action"); >- return std::nullopt; >+ return WTF::nullopt; > } > action.y = y.value(); > } >@@ -1807,7 +1807,7 @@ static std::optional<Action> processPointerAction(const String& id, PointerParam > return action; > } > >-static std::optional<PointerParameters> processPointerParameters(JSON::Object& actionSequence, std::optional<String>& errorMessage) >+static Optional<PointerParameters> processPointerParameters(JSON::Object& actionSequence, Optional<String>& errorMessage) > { > PointerParameters parameters; > RefPtr<JSON::Value> parametersDataValue; >@@ -1817,7 +1817,7 @@ static std::optional<PointerParameters> processPointerParameters(JSON::Object& a > RefPtr<JSON::Object> parametersData; > if (!parametersDataValue->asObject(parametersData)) { > errorMessage = String("Action sequence pointer parameters is not an object"); >- return std::nullopt; >+ return WTF::nullopt; > } > > String pointerType; >@@ -1832,18 +1832,18 @@ static std::optional<PointerParameters> processPointerParameters(JSON::Object& a > parameters.pointerType = PointerType::Touch; > else { > errorMessage = String("The parameter 'pointerType' in action sequence pointer parameters is invalid"); >- return std::nullopt; >+ return WTF::nullopt; > } > > return parameters; > } > >-static std::optional<Vector<Action>> processInputActionSequence(Session& session, JSON::Value& actionSequenceValue, std::optional<String>& errorMessage) >+static Optional<Vector<Action>> processInputActionSequence(Session& session, JSON::Value& actionSequenceValue, Optional<String>& errorMessage) > { > RefPtr<JSON::Object> actionSequence; > if (!actionSequenceValue.asObject(actionSequence)) { > errorMessage = String("The action sequence is not an object"); >- return std::nullopt; >+ return WTF::nullopt; > } > > String type; >@@ -1857,21 +1857,21 @@ static std::optional<Vector<Action>> processInputActionSequence(Session& session > inputSourceType = InputSource::Type::None; > else { > errorMessage = String("The parameter 'type' is invalid or missing in action sequence"); >- return std::nullopt; >+ return WTF::nullopt; > } > > String id; > if (!actionSequence->getString("id"_s, id)) { > errorMessage = String("The parameter 'id' is invalid or missing in action sequence"); >- return std::nullopt; >+ return WTF::nullopt; > } > >- std::optional<PointerParameters> parameters; >- std::optional<PointerType> pointerType; >+ Optional<PointerParameters> parameters; >+ Optional<PointerType> pointerType; > if (inputSourceType == InputSource::Type::Pointer) { > parameters = processPointerParameters(*actionSequence, errorMessage); > if (!parameters) >- return std::nullopt; >+ return WTF::nullopt; > > pointerType = parameters->pointerType; > } >@@ -1879,18 +1879,18 @@ static std::optional<Vector<Action>> processInputActionSequence(Session& session > auto& inputSource = session.getOrCreateInputSource(id, inputSourceType, pointerType); > if (inputSource.type != inputSourceType) { > errorMessage = String("Action sequence type doesn't match input source type"); >- return std::nullopt; >+ return WTF::nullopt; > } > > if (inputSource.type == InputSource::Type::Pointer && inputSource.pointerType != pointerType) { > errorMessage = String("Action sequence pointer type doesn't match input source pointer type"); >- return std::nullopt; >+ return WTF::nullopt; > } > > RefPtr<JSON::Array> actionItems; > if (!actionSequence->getArray("actions"_s, actionItems)) { > errorMessage = String("The parameter 'actions' is invalid or not present in action sequence"); >- return std::nullopt; >+ return WTF::nullopt; > } > > Vector<Action> actions; >@@ -1900,10 +1900,10 @@ static std::optional<Vector<Action>> processInputActionSequence(Session& session > RefPtr<JSON::Object> actionItem; > if (!actionItemValue->asObject(actionItem)) { > errorMessage = String("An action in action sequence is not an object"); >- return std::nullopt; >+ return WTF::nullopt; > } > >- std::optional<Action> action; >+ Optional<Action> action; > if (inputSourceType == InputSource::Type::None) > action = processNullAction(id, *actionItem, errorMessage); > else if (inputSourceType == InputSource::Type::Key) >@@ -1911,7 +1911,7 @@ static std::optional<Vector<Action>> processInputActionSequence(Session& session > else if (inputSourceType == InputSource::Type::Pointer) > action = processPointerAction(id, parameters.value(), *actionItem, errorMessage); > if (!action) >- return std::nullopt; >+ return WTF::nullopt; > > actions.append(action.value()); > } >@@ -1932,7 +1932,7 @@ void WebDriverService::performActions(RefPtr<JSON::Object>&& parameters, Functio > return; > } > >- std::optional<String> errorMessage; >+ Optional<String> errorMessage; > Vector<Vector<Action>> actionsByTick; > unsigned actionsArrayLength = actionsArray->length(); > for (unsigned i = 0; i < actionsArrayLength; ++i) { >@@ -2044,7 +2044,7 @@ void WebDriverService::takeScreenshot(RefPtr<JSON::Object>&& parameters, Functio > completionHandler(WTFMove(result)); > return; > } >- m_session->takeScreenshot(std::nullopt, std::nullopt, WTFMove(completionHandler)); >+ m_session->takeScreenshot(WTF::nullopt, WTF::nullopt, WTFMove(completionHandler)); > }); > } > >diff --git a/Source/WebDriver/WebDriverService.h b/Source/WebDriver/WebDriverService.h >index 4d6878ef45dcdb45248e2137a3b1773e3b9f68c9..c90d619462fe37b6eecbb5481e8e4288e4978db4 100644 >--- a/Source/WebDriver/WebDriverService.h >+++ b/Source/WebDriver/WebDriverService.h >@@ -57,7 +57,7 @@ private: > }; > static const Command s_commands[]; > >- static std::optional<HTTPMethod> toCommandHTTPMethod(const String& method); >+ static Optional<HTTPMethod> toCommandHTTPMethod(const String& method); > static bool findCommand(HTTPMethod, const String& path, CommandHandler*, HashMap<String, String>& parameters); > > void newSession(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&&); >diff --git a/Source/WebDriver/glib/SessionHostGlib.cpp b/Source/WebDriver/glib/SessionHostGlib.cpp >index a5aa783593ba034c1bab916bc09f93c1102ba650..0b2ddaa45e075e829ab1727248e8b7ef97b72bbc 100644 >--- a/Source/WebDriver/glib/SessionHostGlib.cpp >+++ b/Source/WebDriver/glib/SessionHostGlib.cpp >@@ -99,7 +99,7 @@ const GDBusInterfaceVTable SessionHost::s_interfaceVTable = { > { 0 } > }; > >-void SessionHost::connectToBrowser(Function<void (std::optional<String> error)>&& completionHandler) >+void SessionHost::connectToBrowser(Function<void (Optional<String> error)>&& completionHandler) > { > launchBrowser(WTFMove(completionHandler)); > } >@@ -110,7 +110,7 @@ bool SessionHost::isConnected() const > } > > struct ConnectToBrowserAsyncData { >- ConnectToBrowserAsyncData(SessionHost* sessionHost, GUniquePtr<char>&& dbusAddress, GCancellable* cancellable, Function<void (std::optional<String> error)>&& completionHandler) >+ ConnectToBrowserAsyncData(SessionHost* sessionHost, GUniquePtr<char>&& dbusAddress, GCancellable* cancellable, Function<void (Optional<String> error)>&& completionHandler) > : sessionHost(sessionHost) > , dbusAddress(WTFMove(dbusAddress)) > , cancellable(cancellable) >@@ -121,7 +121,7 @@ struct ConnectToBrowserAsyncData { > SessionHost* sessionHost; > GUniquePtr<char> dbusAddress; > GRefPtr<GCancellable> cancellable; >- Function<void (std::optional<String> error)> completionHandler; >+ Function<void (Optional<String> error)> completionHandler; > }; > > static guint16 freePort() >@@ -136,7 +136,7 @@ static guint16 freePort() > return g_inet_socket_address_get_port(G_INET_SOCKET_ADDRESS(address.get())); > } > >-void SessionHost::launchBrowser(Function<void (std::optional<String> error)>&& completionHandler) >+void SessionHost::launchBrowser(Function<void (Optional<String> error)>&& completionHandler) > { > m_cancellable = adoptGRef(g_cancellable_new()); > GRefPtr<GSubprocessLauncher> launcher = adoptGRef(g_subprocess_launcher_new(G_SUBPROCESS_FLAGS_NONE)); >@@ -201,7 +201,7 @@ void SessionHost::connectToBrowser(std::unique_ptr<ConnectToBrowserAsyncData>&& > return; > } > data->sessionHost->setupConnection(WTFMove(connection)); >- data->completionHandler(std::nullopt); >+ data->completionHandler(WTF::nullopt); > }, data); > }); > } >@@ -283,7 +283,7 @@ bool SessionHost::buildSessionCapabilities(GVariantBuilder* builder) const > return true; > } > >-void SessionHost::startAutomationSession(Function<void (bool, std::optional<String>)>&& completionHandler) >+void SessionHost::startAutomationSession(Function<void (bool, Optional<String>)>&& completionHandler) > { > ASSERT(m_dbusConnection); > ASSERT(!m_startSessionCompletionHandler); >@@ -311,7 +311,7 @@ void SessionHost::startAutomationSession(Function<void (bool, std::optional<Stri > > if (!sessionHost->matchCapabilities(resultVariant.get())) { > auto completionHandler = std::exchange(sessionHost->m_startSessionCompletionHandler, nullptr); >- completionHandler(false, std::nullopt); >+ completionHandler(false, WTF::nullopt); > return; > } > }, this >@@ -355,7 +355,7 @@ void SessionHost::setTargetList(uint64_t connectionID, Vector<Target>&& targetLi > -1, m_cancellable.get(), dbusConnectionCallAsyncReadyCallback, nullptr); > > auto startSessionCompletionHandler = std::exchange(m_startSessionCompletionHandler, nullptr); >- startSessionCompletionHandler(true, std::nullopt); >+ startSessionCompletionHandler(true, WTF::nullopt); > } > > void SessionHost::sendMessageToFrontend(uint64_t connectionID, uint64_t targetID, const char* message) >diff --git a/Source/WebDriver/gtk/WebDriverServiceGtk.cpp b/Source/WebDriver/gtk/WebDriverServiceGtk.cpp >index 808b7e2298adf3f8dee6d8b558e9aaeb1dec41ad..24d1bdd014a070b597644b55367d437407e2c194 100644 >--- a/Source/WebDriver/gtk/WebDriverServiceGtk.cpp >+++ b/Source/WebDriver/gtk/WebDriverServiceGtk.cpp >@@ -123,7 +123,7 @@ void WebDriverService::platformParseCapabilities(const JSON::Object& matchedCapa > String browserBinary; > if (browserOptions->getString("binary"_s, browserBinary)) { > capabilities.browserBinary = browserBinary; >- capabilities.browserArguments = std::nullopt; >+ capabilities.browserArguments = WTF::nullopt; > } > > RefPtr<JSON::Array> browserArguments; >diff --git a/Source/WebDriver/soup/HTTPServerSoup.cpp b/Source/WebDriver/soup/HTTPServerSoup.cpp >index 45e199e40199e12261ffca3bbebad6894f60cb89..ba7aeafd436419a401e7f0893a9af1d0bec1e900 100644 >--- a/Source/WebDriver/soup/HTTPServerSoup.cpp >+++ b/Source/WebDriver/soup/HTTPServerSoup.cpp >@@ -32,7 +32,7 @@ > > namespace WebDriver { > >-static bool soupServerListen(SoupServer* server, const std::optional<String>& host, unsigned port, GError** error) >+static bool soupServerListen(SoupServer* server, const Optional<String>& host, unsigned port, GError** error) > { > static const auto options = static_cast<SoupServerListenOptions>(0); > if (!host || host.value() == "local") >@@ -50,7 +50,7 @@ static bool soupServerListen(SoupServer* server, const std::optional<String>& ho > return soup_server_listen(server, address.get(), options, error); > } > >-bool HTTPServer::listen(const std::optional<String>& host, unsigned port) >+bool HTTPServer::listen(const Optional<String>& host, unsigned port) > { > m_soupServer = adoptGRef(soup_server_new(SOUP_SERVER_SERVER_HEADER, "WebKitWebDriver", nullptr)); > GUniqueOutPtr<GError> error; >diff --git a/Source/WebDriver/wpe/WebDriverServiceWPE.cpp b/Source/WebDriver/wpe/WebDriverServiceWPE.cpp >index 66ae94e4a6ac8d5dfcd755cbf8ad5241f183d084..06d3a5c2a8252918e74f103ebc89cb52379e9037 100644 >--- a/Source/WebDriver/wpe/WebDriverServiceWPE.cpp >+++ b/Source/WebDriver/wpe/WebDriverServiceWPE.cpp >@@ -115,7 +115,7 @@ void WebDriverService::platformParseCapabilities(const JSON::Object& matchedCapa > String browserBinary; > if (browserOptions->getString("binary"_s, browserBinary)) { > capabilities.browserBinary = browserBinary; >- capabilities.browserArguments = std::nullopt; >+ capabilities.browserArguments = WTF::nullopt; > } > > RefPtr<JSON::Array> browserArguments; >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >index 9bba7809ee238c0016531c028a3fa2735de1db8e..dfa9974e732ddd2b46c4da02074f715f17430167 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >@@ -446,26 +446,26 @@ void NetworkConnectionToWebProcess::convertMainResourceLoadToDownload(PAL::Sessi > loader->convertToDownload(downloadID, request, response); > } > >-void NetworkConnectionToWebProcess::cookiesForDOM(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, String& cookieString, bool& secureCookiesAccessed) >+void NetworkConnectionToWebProcess::cookiesForDOM(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, String& cookieString, bool& secureCookiesAccessed) > { > auto& networkStorageSession = storageSession(sessionID); > std::tie(cookieString, secureCookiesAccessed) = networkStorageSession.cookiesForDOM(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED > if (auto session = SessionTracker::networkSession(sessionID)) { > if (session->shouldLogCookieInformation()) >- NetworkResourceLoader::logCookieInformation("NetworkConnectionToWebProcess::cookiesForDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, std::nullopt); >+ NetworkResourceLoader::logCookieInformation("NetworkConnectionToWebProcess::cookiesForDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, WTF::nullopt); > } > #endif > } > >-void NetworkConnectionToWebProcess::setCookiesFromDOM(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& cookieString) >+void NetworkConnectionToWebProcess::setCookiesFromDOM(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& cookieString) > { > auto& networkStorageSession = storageSession(sessionID); > networkStorageSession.setCookiesFromDOM(firstParty, sameSiteInfo, url, frameID, pageID, cookieString); > #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED > if (auto session = SessionTracker::networkSession(sessionID)) { > if (session->shouldLogCookieInformation()) >- NetworkResourceLoader::logCookieInformation("NetworkConnectionToWebProcess::setCookiesFromDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, std::nullopt); >+ NetworkResourceLoader::logCookieInformation("NetworkConnectionToWebProcess::setCookiesFromDOM", reinterpret_cast<const void*>(this), networkStorageSession, firstParty, sameSiteInfo, url, emptyString(), frameID, pageID, WTF::nullopt); > } > #endif > } >@@ -475,12 +475,12 @@ void NetworkConnectionToWebProcess::cookiesEnabled(PAL::SessionID sessionID, boo > result = storageSession(sessionID).cookiesEnabled(); > } > >-void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, String& cookieString, bool& secureCookiesAccessed) >+void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, String& cookieString, bool& secureCookiesAccessed) > { > std::tie(cookieString, secureCookiesAccessed) = storageSession(sessionID).cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-void NetworkConnectionToWebProcess::getRawCookies(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& result) >+void NetworkConnectionToWebProcess::getRawCookies(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& result) > { > storageSession(sessionID).getRawCookies(firstParty, sameSiteInfo, url, frameID, pageID, result); > } >@@ -593,10 +593,10 @@ void NetworkConnectionToWebProcess::resetOriginAccessWhitelists() > SecurityPolicy::resetOriginAccessWhitelists(); > } > >-std::optional<NetworkActivityTracker> NetworkConnectionToWebProcess::startTrackingResourceLoad(uint64_t pageID, ResourceLoadIdentifier resourceID, bool isMainResource, const PAL::SessionID& sessionID) >+Optional<NetworkActivityTracker> NetworkConnectionToWebProcess::startTrackingResourceLoad(uint64_t pageID, ResourceLoadIdentifier resourceID, bool isMainResource, const PAL::SessionID& sessionID) > { > if (sessionID.isEphemeral()) >- return std::nullopt; >+ return WTF::nullopt; > > // Either get the existing root activity tracker for this page or create a > // new one if this is the main resource. >@@ -621,7 +621,7 @@ std::optional<NetworkActivityTracker> NetworkConnectionToWebProcess::startTracki > // This could happen if the Networking process crashes, taking its > // previous state with it. > if (rootActivityIndex == notFound) >- return std::nullopt; >+ return WTF::nullopt; > > #if HAVE(NW_ACTIVITY) > ASSERT(m_networkActivityTrackers[rootActivityIndex].networkActivity.getPlatformObject()); >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >index 9be001aa994bf713b2f72f5e3092bb7b52d40dc1..26a10f614da3b089d2e9440dc62115550f3a7609 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >@@ -116,7 +116,7 @@ public: > m_networkLoadInformationByID.remove(identifier); > } > >- std::optional<NetworkActivityTracker> startTrackingResourceLoad(uint64_t pageID, ResourceLoadIdentifier resourceID, bool isMainResource, const PAL::SessionID&); >+ Optional<NetworkActivityTracker> startTrackingResourceLoad(uint64_t pageID, ResourceLoadIdentifier resourceID, bool isMainResource, const PAL::SessionID&); > void stopTrackingResourceLoad(ResourceLoadIdentifier resourceID, NetworkActivityTracker::CompletionCode); > > private: >@@ -147,11 +147,11 @@ private: > void startDownload(PAL::SessionID, DownloadID, const WebCore::ResourceRequest&, const String& suggestedName = { }); > void convertMainResourceLoadToDownload(PAL::SessionID, uint64_t mainResourceLoadIdentifier, DownloadID, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); > >- void cookiesForDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >- void setCookiesFromDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&); >+ void cookiesForDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >+ void setCookiesFromDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String&); > void cookiesEnabled(PAL::SessionID, bool& result); >- void cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >- void getRawCookies(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&); >+ void cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed); >+ void getRawCookies(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<WebCore::Cookie>&); > void deleteCookie(PAL::SessionID, const URL&, const String& cookieName); > > void registerFileBlobURL(const URL&, const String& path, SandboxExtension::Handle&&, const String& contentType); >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >index a774963f61de94c5b08ab0f6be4ee161c624b01b..932b9345202357d0f632a0915b51094c711fe55f 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >@@ -34,11 +34,11 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver { > StartDownload(PAL::SessionID sessionID, WebKit::DownloadID downloadID, WebCore::ResourceRequest request, String suggestedName) > ConvertMainResourceLoadToDownload(PAL::SessionID sessionID, uint64_t mainResourceLoadIdentifier, WebKit::DownloadID downloadID, WebCore::ResourceRequest request, WebCore::ResourceResponse response) > >- CookiesForDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >- SetCookiesFromDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, String cookieString) >+ CookiesForDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >+ SetCookiesFromDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, String cookieString) > CookiesEnabled(PAL::SessionID sessionID) -> (bool enabled) LegacySync >- CookieRequestHeaderFieldValue(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >- GetRawCookies(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID) -> (Vector<WebCore::Cookie> cookies) LegacySync >+ CookieRequestHeaderFieldValue(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync >+ GetRawCookies(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID) -> (Vector<WebCore::Cookie> cookies) LegacySync > DeleteCookie(PAL::SessionID sessionID, URL url, String cookieName) > > RegisterFileBlobURL(URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType) >diff --git a/Source/WebKit/NetworkProcess/NetworkDataTask.cpp b/Source/WebKit/NetworkProcess/NetworkDataTask.cpp >index 4f4c415a17c8fc3c30e7fd01b3f74fda9d8594e7..0c8b97e2be25bfc1f2be02281e3ba60b24a16e88 100644 >--- a/Source/WebKit/NetworkProcess/NetworkDataTask.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkDataTask.cpp >@@ -103,7 +103,7 @@ void NetworkDataTask::didReceiveResponse(ResourceResponse&& response, ResponseCo > ASSERT(m_client); > if (response.isHTTP09()) { > auto url = response.url(); >- std::optional<uint16_t> port = url.port(); >+ Optional<uint16_t> port = url.port(); > if (port && !WTF::isDefaultPortForProtocol(port.value(), url.protocol())) { > completionHandler(PolicyAction::Ignore); > cancel(); >diff --git a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >index 6227c957d44ce62b6436033a834538169077e8c8..da5acd99d5fe738ae11f93e46952735fae7b9b5f 100644 >--- a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >+++ b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >@@ -68,7 +68,7 @@ public: > > void setCSPResponseHeaders(WebCore::ContentSecurityPolicyResponseHeaders&& headers) { m_cspResponseHeaders = WTFMove(headers); } > #if ENABLE(CONTENT_EXTENSIONS) >- void setContentExtensionController(URL&& mainDocumentURL, std::optional<UserContentControllerIdentifier> identifier) >+ void setContentExtensionController(URL&& mainDocumentURL, Optional<UserContentControllerIdentifier> identifier) > { > m_mainDocumentURL = WTFMove(mainDocumentURL); > m_userContentControllerIdentifier = identifier; >@@ -125,10 +125,10 @@ private: > WebCore::HTTPHeaderMap m_firstRequestHeaders; // Needed for CORS checks. > URL m_url; > RefPtr<WebCore::SecurityOrigin> m_origin; >- std::optional<WebCore::ContentSecurityPolicyResponseHeaders> m_cspResponseHeaders; >+ Optional<WebCore::ContentSecurityPolicyResponseHeaders> m_cspResponseHeaders; > #if ENABLE(CONTENT_EXTENSIONS) > URL m_mainDocumentURL; >- std::optional<UserContentControllerIdentifier> m_userContentControllerIdentifier; >+ Optional<UserContentControllerIdentifier> m_userContentControllerIdentifier; > #endif > > std::unique_ptr<NetworkCORSPreflightChecker> m_corsPreflightChecker; >diff --git a/Source/WebKit/NetworkProcess/NetworkLoadParameters.h b/Source/WebKit/NetworkProcess/NetworkLoadParameters.h >index decb94e73ee97665f8ae312baf87e4b9713d8790..cfc4b527f0d1f72f3d868583f9d48b873de351ce 100644 >--- a/Source/WebKit/NetworkProcess/NetworkLoadParameters.h >+++ b/Source/WebKit/NetworkProcess/NetworkLoadParameters.h >@@ -51,7 +51,7 @@ public: > bool isMainFrameNavigation { false }; > Vector<RefPtr<WebCore::BlobDataFileReference>> blobFileReferences; > PreconnectOnly shouldPreconnectOnly { PreconnectOnly::No }; >- std::optional<NetworkActivityTracker> networkActivityTracker; >+ Optional<NetworkActivityTracker> networkActivityTracker; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index 0b31ff7733dc24ca061cbdebe644bba9e013ac35..e660975280a3acb36034e79b36d458150bcf79f7 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -484,7 +484,7 @@ void NetworkProcess::updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sess > parentProcessConnection()->send(Messages::NetworkProcessProxy::DidUpdateBlockCookies(contextId), 0); > } > >-void NetworkProcess::setAgeCapForClientSideCookies(PAL::SessionID sessionID, std::optional<Seconds> seconds, uint64_t contextId) >+void NetworkProcess::setAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds, uint64_t contextId) > { > if (auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID)) > networkStorageSession->setAgeCapForClientSideCookies(seconds); >@@ -507,7 +507,7 @@ void NetworkProcess::getAllStorageAccessEntries(PAL::SessionID sessionID, uint64 > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId) >+void NetworkProcess::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId) > { > bool isStorageGranted = false; > if (auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID)) { >@@ -1201,7 +1201,7 @@ void NetworkProcess::connectionToContextProcessWasClosed(Ref<WebSWServerToContex > > if (needsServerToContextConnectionForOrigin(securityOrigin)) { > RELEASE_LOG(ServiceWorker, "Connection to service worker process was closed but is still needed, relaunching it"); >- createServerToContextConnection(securityOrigin, std::nullopt); >+ createServerToContextConnection(securityOrigin, WTF::nullopt); > } > } > >@@ -1249,7 +1249,7 @@ WebSWServerToContextConnection* NetworkProcess::serverToContextConnectionForOrig > return m_serverToContextConnections.get(securityOrigin); > } > >-void NetworkProcess::createServerToContextConnection(const SecurityOriginData& securityOrigin, std::optional<PAL::SessionID> sessionID) >+void NetworkProcess::createServerToContextConnection(const SecurityOriginData& securityOrigin, Optional<PAL::SessionID> sessionID) > { > if (m_waitingForServerToContextProcessConnection) > return; >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h >index f5c2fedbfc7e779b51d350e1c1e9e6a550458ee3..a60b526ecdc7187546dd3531d347f54dc541ec8e 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h >@@ -149,10 +149,10 @@ public: > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > void updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID, const Vector<String>& domainsToBlock, uint64_t contextId); >- void setAgeCapForClientSideCookies(PAL::SessionID, std::optional<Seconds>, uint64_t contextId); >+ void setAgeCapForClientSideCookies(PAL::SessionID, Optional<Seconds>, uint64_t contextId); > void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId); > void getAllStorageAccessEntries(PAL::SessionID, uint64_t contextId); >- void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId); >+ void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId); > void removeAllStorageAccess(PAL::SessionID, uint64_t contextId); > void removePrevalentDomains(PAL::SessionID, const Vector<String>& domains); > void setCacheMaxAgeCapForPrevalentResources(PAL::SessionID, Seconds, uint64_t contextId); >@@ -186,7 +186,7 @@ public: > > #if ENABLE(SERVICE_WORKER) > WebSWServerToContextConnection* serverToContextConnectionForOrigin(const WebCore::SecurityOriginData&); >- void createServerToContextConnection(const WebCore::SecurityOriginData&, std::optional<PAL::SessionID>); >+ void createServerToContextConnection(const WebCore::SecurityOriginData&, Optional<PAL::SessionID>); > > WebCore::SWServer& swServerForSession(PAL::SessionID); > void registerSWServerConnection(WebSWServerConnection&); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >index 50795a282279b1367160091b28ad9c71b03d5fe1..68cdaec97f67a2d71c5aadf116155aabba217cdb 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >@@ -86,10 +86,10 @@ messages -> NetworkProcess LegacyReceiver { > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > UpdatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, Vector<String> domainsToBlock, uint64_t contextId) >- SetAgeCapForClientSideCookies(PAL::SessionID sessionID, std::optional<Seconds> seconds, uint64_t contextId) >+ SetAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds, uint64_t contextId) > HasStorageAccessForFrame(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId) > GetAllStorageAccessEntries(PAL::SessionID sessionID, uint64_t contextId) >- GrantStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId) >+ GrantStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId) > RemoveAllStorageAccess(PAL::SessionID sessionID, uint64_t contextId) > RemovePrevalentDomains(PAL::SessionID sessionID, Vector<String> domainsWithInteraction) > SetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, Seconds seconds, uint64_t contextId) >diff --git a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >index 639752e182a58b92a72a0fd0de1899056dd7d797..fe54ca9a82e37ee64212cb717acc30e149e0bfbc 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >@@ -119,7 +119,7 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc > if (!decoder.decode(result.diskCacheDirectory)) > return false; > >- std::optional<SandboxExtension::Handle> diskCacheDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> diskCacheDirectoryExtensionHandle; > decoder >> diskCacheDirectoryExtensionHandle; > if (!diskCacheDirectoryExtensionHandle) > return false; >@@ -138,26 +138,26 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc > if (!decoder.decode(result.defaultSessionPendingCookies)) > return false; > #if PLATFORM(IOS_FAMILY) >- std::optional<SandboxExtension::Handle> cookieStorageDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> cookieStorageDirectoryExtensionHandle; > decoder >> cookieStorageDirectoryExtensionHandle; > if (!cookieStorageDirectoryExtensionHandle) > return false; > result.cookieStorageDirectoryExtensionHandle = WTFMove(*cookieStorageDirectoryExtensionHandle); > >- std::optional<SandboxExtension::Handle> containerCachesDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> containerCachesDirectoryExtensionHandle; > decoder >> containerCachesDirectoryExtensionHandle; > if (!containerCachesDirectoryExtensionHandle) > return false; > result.containerCachesDirectoryExtensionHandle = WTFMove(*containerCachesDirectoryExtensionHandle); > >- std::optional<SandboxExtension::Handle> parentBundleDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> parentBundleDirectoryExtensionHandle; > decoder >> parentBundleDirectoryExtensionHandle; > if (!parentBundleDirectoryExtensionHandle) > return false; > result.parentBundleDirectoryExtensionHandle = WTFMove(*parentBundleDirectoryExtensionHandle); > > #if ENABLE(INDEXED_DATABASE) >- std::optional<SandboxExtension::Handle> indexedDatabaseTempBlobDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> indexedDatabaseTempBlobDirectoryExtensionHandle; > decoder >> indexedDatabaseTempBlobDirectoryExtensionHandle; > if (!indexedDatabaseTempBlobDirectoryExtensionHandle) > return false; >@@ -235,7 +235,7 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc > if (!decoder.decode(result.indexedDatabaseDirectory)) > return false; > >- std::optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle; > decoder >> indexedDatabaseDirectoryExtensionHandle; > if (!indexedDatabaseDirectoryExtensionHandle) > return false; >@@ -246,7 +246,7 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc > if (!decoder.decode(result.serviceWorkerRegistrationDirectory)) > return false; > >- std::optional<SandboxExtension::Handle> serviceWorkerRegistrationDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> serviceWorkerRegistrationDirectoryExtensionHandle; > decoder >> serviceWorkerRegistrationDirectoryExtensionHandle; > if (!serviceWorkerRegistrationDirectoryExtensionHandle) > return false; >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp >index 1b57415be89c3b9a46939143df9c93c0dd927a5e..0cfeea5ccd063fca7f610ab6c9d5b1d2c2bd9efc 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp >@@ -128,7 +128,7 @@ bool NetworkResourceLoadParameters::decode(IPC::Decoder& decoder, NetworkResourc > return false; > result.request.setHTTPBody(WTFMove(formData)); > >- std::optional<SandboxExtension::HandleArray> requestBodySandboxExtensionHandles; >+ Optional<SandboxExtension::HandleArray> requestBodySandboxExtensionHandles; > decoder >> requestBodySandboxExtensionHandles; > if (!requestBodySandboxExtensionHandles) > return false; >@@ -139,7 +139,7 @@ bool NetworkResourceLoadParameters::decode(IPC::Decoder& decoder, NetworkResourc > } > > if (result.request.url().isLocalFile()) { >- std::optional<SandboxExtension::Handle> resourceSandboxExtensionHandle; >+ Optional<SandboxExtension::Handle> resourceSandboxExtensionHandle; > decoder >> resourceSandboxExtensionHandle; > if (!resourceSandboxExtensionHandle) > return false; >@@ -176,7 +176,7 @@ bool NetworkResourceLoadParameters::decode(IPC::Decoder& decoder, NetworkResourc > return false; > } > >- std::optional<FetchOptions> options; >+ Optional<FetchOptions> options; > decoder >> options; > if (!options) > return false; >@@ -187,7 +187,7 @@ bool NetworkResourceLoadParameters::decode(IPC::Decoder& decoder, NetworkResourc > if (!decoder.decode(result.originalRequestHeaders)) > return false; > >- std::optional<bool> shouldRestrictHTTPResponseAccess; >+ Optional<bool> shouldRestrictHTTPResponseAccess; > decoder >> shouldRestrictHTTPResponseAccess; > if (!shouldRestrictHTTPResponseAccess) > return false; >@@ -196,7 +196,7 @@ bool NetworkResourceLoadParameters::decode(IPC::Decoder& decoder, NetworkResourc > if (!decoder.decodeEnum(result.preflightPolicy)) > return false; > >- std::optional<bool> shouldEnableCrossOriginResourcePolicy; >+ Optional<bool> shouldEnableCrossOriginResourcePolicy; > decoder >> shouldEnableCrossOriginResourcePolicy; > if (!shouldEnableCrossOriginResourcePolicy) > return false; >@@ -209,7 +209,7 @@ bool NetworkResourceLoadParameters::decode(IPC::Decoder& decoder, NetworkResourc > if (!decoder.decode(result.mainDocumentURL)) > return false; > >- std::optional<std::optional<UserContentControllerIdentifier>> userContentControllerIdentifier; >+ Optional<Optional<UserContentControllerIdentifier>> userContentControllerIdentifier; > decoder >> userContentControllerIdentifier; > if (!userContentControllerIdentifier) > return false; >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h b/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h >index ba987d88a480ea085bdddce468b9fcfd3174b07d..132710fce0a5cbd9a80e62ddb98ff4435ae1a3c5 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h >@@ -53,7 +53,7 @@ public: > Seconds maximumBufferingTime; > RefPtr<WebCore::SecurityOrigin> sourceOrigin; > WebCore::FetchOptions options; >- std::optional<WebCore::ContentSecurityPolicyResponseHeaders> cspResponseHeaders; >+ Optional<WebCore::ContentSecurityPolicyResponseHeaders> cspResponseHeaders; > WebCore::HTTPHeaderMap originalRequestHeaders; > bool shouldRestrictHTTPResponseAccess { false }; > WebCore::PreflightPolicy preflightPolicy { WebCore::PreflightPolicy::Consider }; >@@ -62,7 +62,7 @@ public: > > #if ENABLE(CONTENT_EXTENSIONS) > URL mainDocumentURL; >- std::optional<UserContentControllerIdentifier> userContentControllerIdentifier; >+ Optional<UserContentControllerIdentifier> userContentControllerIdentifier; > #endif > }; > >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >index e38927be3148ccbe255264ad4523def9ebb52350..77fa8ea29d65ba16dae0cd8e35c22e6f994b9d7f 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >@@ -593,7 +593,7 @@ void NetworkResourceLoader::didBlockAuthenticationChallenge() > send(Messages::WebResourceLoader::DidBlockAuthenticationChallenge()); > } > >-std::optional<Seconds> NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation(const ResourceRequest& request, const ResourceRequest& redirectRequest, const ResourceResponse& redirectResponse) >+Optional<Seconds> NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation(const ResourceRequest& request, const ResourceRequest& redirectRequest, const ResourceResponse& redirectResponse) > { > #if ENABLE(RESOURCE_LOAD_STATISTICS) > bool existingCacheEntryMatchesNewResponse = false; >@@ -612,7 +612,7 @@ std::optional<Seconds> NetworkResourceLoader::validateCacheEntryForMaxAgeCapVali > return networkStorageSession->maxAgeCacheCap(request); > } > #endif >- return std::nullopt; >+ return WTF::nullopt; > } > > void NetworkResourceLoader::willSendRedirectedRequest(ResourceRequest&& request, ResourceRequest&& redirectRequest, ResourceResponse&& redirectResponse) >@@ -965,7 +965,7 @@ static String escapeForJSON(String s) > return s.replace('\\', "\\\\").replace('"', "\\\""); > } > >-static String escapeIDForJSON(const std::optional<uint64_t>& value) >+static String escapeIDForJSON(const Optional<uint64_t>& value) > { > return value ? String::number(value.value()) : String("None"); > }; >@@ -980,7 +980,7 @@ void NetworkResourceLoader::logCookieInformation() const > logCookieInformation("NetworkResourceLoader", reinterpret_cast<const void*>(this), *networkStorageSession, originalRequest().firstPartyForCookies(), SameSiteInfo::create(originalRequest()), originalRequest().url(), originalRequest().httpReferrer(), frameID(), pageID(), identifier()); > } > >-static void logBlockedCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier) >+static void logBlockedCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier) > { > ASSERT(NetworkResourceLoader::shouldLogCookieInformation(networkStorageSession.sessionID())); > >@@ -1007,7 +1007,7 @@ static void logBlockedCookieInformation(const String& label, const void* loggedO > #undef LOCAL_LOG_IF_ALLOWED > } > >-static void logCookieInformationInternal(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier) >+static void logCookieInformationInternal(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession& networkStorageSession, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier) > { > ASSERT(NetworkResourceLoader::shouldLogCookieInformation(networkStorageSession.sessionID())); > >@@ -1068,7 +1068,7 @@ static void logCookieInformationInternal(const String& label, const void* logged > #undef LOCAL_LOG_IF_ALLOWED > } > >-void NetworkResourceLoader::logCookieInformation(const String& label, const void* loggedObject, const NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier) >+void NetworkResourceLoader::logCookieInformation(const String& label, const void* loggedObject, const NetworkStorageSession& networkStorageSession, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier) > { > ASSERT(shouldLogCookieInformation(networkStorageSession.sessionID())); > >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.h b/Source/WebKit/NetworkProcess/NetworkResourceLoader.h >index a2c492b0ab1ef0633a53363c75ee6c09e04de1d0..c09ecb7b6bbe5581a58e15dcf085e3a9be2696d5 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.h >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.h >@@ -110,7 +110,7 @@ public: > > #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED > static bool shouldLogCookieInformation(const PAL::SessionID&); >- static void logCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, const String& referrer, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, std::optional<uint64_t> identifier); >+ static void logCookieInformation(const String& label, const void* loggedObject, const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, const String& referrer, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Optional<uint64_t> identifier); > #endif > > private: >@@ -170,7 +170,7 @@ private: > > void logSlowCacheRetrieveIfNeeded(const NetworkCache::Cache::RetrieveInfo&); > >- std::optional<Seconds> validateCacheEntryForMaxAgeCapValidation(const WebCore::ResourceRequest&, const WebCore::ResourceRequest& redirectRequest, const WebCore::ResourceResponse&); >+ Optional<Seconds> validateCacheEntryForMaxAgeCapValidation(const WebCore::ResourceRequest&, const WebCore::ResourceRequest& redirectRequest, const WebCore::ResourceResponse&); > > const NetworkResourceLoadParameters m_parameters; > >@@ -206,7 +206,7 @@ private: > bool m_shouldRestartLoad { false }; > ResponseCompletionHandler m_responseCompletionHandler; > >- std::optional<NetworkActivityTracker> m_networkActivityTracker; >+ Optional<NetworkActivityTracker> m_networkActivityTracker; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp >index b5a44849887d21b305032d6b4cfa9540b1c56e1a..0ee9c7aeaff0a7e20a3fcffa8fe1321a1b5372d8 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp >@@ -67,53 +67,53 @@ void NetworkSessionCreationParameters::encode(IPC::Encoder& encoder) const > #endif > } > >-std::optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::decode(IPC::Decoder& decoder) >+Optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::decode(IPC::Decoder& decoder) > { > PAL::SessionID sessionID; > if (!decoder.decode(sessionID)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> boundInterfaceIdentifier; >+ Optional<String> boundInterfaceIdentifier; > decoder >> boundInterfaceIdentifier; > if (!boundInterfaceIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<AllowsCellularAccess> allowsCellularAccess; >+ Optional<AllowsCellularAccess> allowsCellularAccess; > decoder >> allowsCellularAccess; > if (!allowsCellularAccess) >- return std::nullopt; >+ return WTF::nullopt; > > #if PLATFORM(COCOA) > RetainPtr<CFDictionaryRef> proxyConfiguration; > if (!IPC::decode(decoder, proxyConfiguration)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> sourceApplicationBundleIdentifier; >+ Optional<String> sourceApplicationBundleIdentifier; > decoder >> sourceApplicationBundleIdentifier; > if (!sourceApplicationBundleIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> sourceApplicationSecondaryIdentifier; >+ Optional<String> sourceApplicationSecondaryIdentifier; > decoder >> sourceApplicationSecondaryIdentifier; > if (!sourceApplicationSecondaryIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> shouldLogCookieInformation; >+ Optional<bool> shouldLogCookieInformation; > decoder >> shouldLogCookieInformation; > if (!shouldLogCookieInformation) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Seconds> loadThrottleLatency; >+ Optional<Seconds> loadThrottleLatency; > decoder >> loadThrottleLatency; > if (!loadThrottleLatency) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > #if USE(CURL) >- std::optional<WebCore::CurlProxySettings> proxySettings; >+ Optional<WebCore::CurlProxySettings> proxySettings; > decoder >> proxySettings; > if (!proxySettings) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > return {{ >diff --git a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >index 27ce7b88d90eb4e685a9bb958944204ef2d7a096..cd498b6cf22e6a2553609f0349ed60bdf8107c21 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >+++ b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >@@ -44,7 +44,7 @@ enum class AllowsCellularAccess : bool { No, Yes }; > > struct NetworkSessionCreationParameters { > void encode(IPC::Encoder&) const; >- static std::optional<NetworkSessionCreationParameters> decode(IPC::Decoder&); >+ static Optional<NetworkSessionCreationParameters> decode(IPC::Decoder&); > static NetworkSessionCreationParameters privateSessionParameters(const PAL::SessionID&); > > PAL::SessionID sessionID { PAL::SessionID::defaultSessionID() }; >diff --git a/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp b/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp >index 4c70830a9e0c531e517197e62bbd1de1ba5f9f52..8fd8f0c828d17610169ea25ac8dce95c425982fc 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp >@@ -53,7 +53,7 @@ void NetworkSocketStream::sendData(const IPC::DataReference& data, uint64_t iden > }); > } > >-void NetworkSocketStream::sendHandshake(const IPC::DataReference& data, const std::optional<CookieRequestHeaderFieldProxy>& headerFieldProxy, uint64_t identifier) >+void NetworkSocketStream::sendHandshake(const IPC::DataReference& data, const Optional<CookieRequestHeaderFieldProxy>& headerFieldProxy, uint64_t identifier) > { > m_impl->platformSendHandshake(data.data(), data.size(), headerFieldProxy, [this, protectedThis = makeRef(*this), identifier] (bool success, bool didAccessSecureCookies) { > send(Messages::WebSocketStream::DidSendHandshake(identifier, success, didAccessSecureCookies)); >diff --git a/Source/WebKit/NetworkProcess/NetworkSocketStream.h b/Source/WebKit/NetworkProcess/NetworkSocketStream.h >index b0a25470ac277e047fb273812cd71d197b81fe91..c74f5c609fc3ef025e1085ae1ac96e545aab32a9 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSocketStream.h >+++ b/Source/WebKit/NetworkProcess/NetworkSocketStream.h >@@ -47,7 +47,7 @@ public: > void didReceiveMessage(IPC::Connection&, IPC::Decoder&); > > void sendData(const IPC::DataReference&, uint64_t); >- void sendHandshake(const IPC::DataReference&, const std::optional<WebCore::CookieRequestHeaderFieldProxy>&, uint64_t); >+ void sendHandshake(const IPC::DataReference&, const Optional<WebCore::CookieRequestHeaderFieldProxy>&, uint64_t); > void close(); > > // SocketStreamHandleClient >diff --git a/Source/WebKit/NetworkProcess/NetworkSocketStream.messages.in b/Source/WebKit/NetworkProcess/NetworkSocketStream.messages.in >index 02e8518b01b030f6ebc7d66f01ea250610caae4f..009562ba50285e8c8c33fd6b812e91ac502762e4 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSocketStream.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkSocketStream.messages.in >@@ -22,6 +22,6 @@ > > messages -> NetworkSocketStream { > SendData(IPC::DataReference data, uint64_t identifier) >- SendHandshake(IPC::DataReference data, std::optional<WebCore::CookieRequestHeaderFieldProxy> headerFieldProxy, uint64_t identifier) >+ SendHandshake(IPC::DataReference data, Optional<WebCore::CookieRequestHeaderFieldProxy> headerFieldProxy, uint64_t identifier) > Close() > } >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp >index 85f895ef69fa4596a92ee1ce85569fc3c51ddbe3..97cbf45d8838468ca34a6f17fe43ee462ced42a3 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp >@@ -95,7 +95,7 @@ void WebSWServerConnection::startScriptFetchInClient(ServiceWorkerJobIdentifier > send(Messages::WebSWClientConnection::StartScriptFetchForServer(jobIdentifier, registrationKey, cachePolicy)); > } > >-void WebSWServerConnection::updateRegistrationStateInClient(ServiceWorkerRegistrationIdentifier identifier, ServiceWorkerRegistrationState state, const std::optional<ServiceWorkerData>& serviceWorkerData) >+void WebSWServerConnection::updateRegistrationStateInClient(ServiceWorkerRegistrationIdentifier identifier, ServiceWorkerRegistrationState state, const Optional<ServiceWorkerData>& serviceWorkerData) > { > send(Messages::WebSWClientConnection::UpdateRegistrationState(identifier, state, serviceWorkerData)); > } >@@ -195,7 +195,7 @@ void WebSWServerConnection::postMessageToServiceWorker(ServiceWorkerIdentifier d > if (!destinationWorker) > return; > >- std::optional<ServiceWorkerOrClientData> sourceData; >+ Optional<ServiceWorkerOrClientData> sourceData; > WTF::switchOn(sourceIdentifier, [&](ServiceWorkerIdentifier identifier) { > if (auto* sourceWorker = server().workerByID(identifier)) > sourceData = ServiceWorkerOrClientData { sourceWorker->data() }; >@@ -277,7 +277,7 @@ void WebSWServerConnection::matchRegistration(uint64_t registrationMatchRequestI > send(Messages::WebSWClientConnection::DidMatchRegistration { registrationMatchRequestIdentifier, registration->data() }); > return; > } >- send(Messages::WebSWClientConnection::DidMatchRegistration { registrationMatchRequestIdentifier, std::nullopt }); >+ send(Messages::WebSWClientConnection::DidMatchRegistration { registrationMatchRequestIdentifier, WTF::nullopt }); > } > > void WebSWServerConnection::registrationReady(uint64_t registrationReadyRequestIdentifier, ServiceWorkerRegistrationData&& registrationData) >@@ -291,7 +291,7 @@ void WebSWServerConnection::getRegistrations(uint64_t registrationMatchRequestId > send(Messages::WebSWClientConnection::DidGetRegistrations { registrationMatchRequestIdentifier, registrations }); > } > >-void WebSWServerConnection::registerServiceWorkerClient(SecurityOriginData&& topOrigin, ServiceWorkerClientData&& data, const std::optional<ServiceWorkerRegistrationIdentifier>& controllingServiceWorkerRegistrationIdentifier) >+void WebSWServerConnection::registerServiceWorkerClient(SecurityOriginData&& topOrigin, ServiceWorkerClientData&& data, const Optional<ServiceWorkerRegistrationIdentifier>& controllingServiceWorkerRegistrationIdentifier) > { > auto clientOrigin = ClientOrigin { WTFMove(topOrigin), SecurityOriginData::fromURL(data.url) }; > m_clientOrigins.add(data.identifier, clientOrigin); >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h >index 9d17037894f5b511038de06bad09dd7f634c7f1a..307da2c9f69c444273353b5432641ce1679522a9 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h >@@ -77,7 +77,7 @@ private: > void resolveRegistrationJobInClient(WebCore::ServiceWorkerJobIdentifier, const WebCore::ServiceWorkerRegistrationData&, WebCore::ShouldNotifyWhenResolved) final; > void resolveUnregistrationJobInClient(WebCore::ServiceWorkerJobIdentifier, const WebCore::ServiceWorkerRegistrationKey&, bool unregistrationResult) final; > void startScriptFetchInClient(WebCore::ServiceWorkerJobIdentifier, const WebCore::ServiceWorkerRegistrationKey&, WebCore::FetchOptions::Cache) final; >- void updateRegistrationStateInClient(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::ServiceWorkerRegistrationState, const std::optional<WebCore::ServiceWorkerData>&) final; >+ void updateRegistrationStateInClient(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::ServiceWorkerRegistrationState, const Optional<WebCore::ServiceWorkerData>&) final; > void updateWorkerStateInClient(WebCore::ServiceWorkerIdentifier, WebCore::ServiceWorkerState) final; > void fireUpdateFoundEvent(WebCore::ServiceWorkerRegistrationIdentifier) final; > void setRegistrationLastUpdateTime(WebCore::ServiceWorkerRegistrationIdentifier, WallTime) final; >@@ -93,7 +93,7 @@ private: > void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const URL& clientURL); > void getRegistrations(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const URL& clientURL); > >- void registerServiceWorkerClient(WebCore::SecurityOriginData&& topOrigin, WebCore::ServiceWorkerClientData&&, const std::optional<WebCore::ServiceWorkerRegistrationIdentifier>&); >+ void registerServiceWorkerClient(WebCore::SecurityOriginData&& topOrigin, WebCore::ServiceWorkerClientData&&, const Optional<WebCore::ServiceWorkerRegistrationIdentifier>&); > void unregisterServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier&); > > IPC::Connection* messageSenderConnection() final { return m_contentConnection.ptr(); } >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in >index d533c35c9b7eb42c886cd1ca978ac87568d9edbb..7cbc230a4330e24eae2ed0cab28c88ef94f72338 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in >@@ -39,7 +39,7 @@ messages -> WebSWServerConnection { > MatchRegistration(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, URL clientURL) > WhenRegistrationReady(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, URL clientURL) > GetRegistrations(uint64_t serviceRegistrationMatchRequestIdentifier, struct WebCore::SecurityOriginData topOrigin, URL clientURL) >- RegisterServiceWorkerClient(struct WebCore::SecurityOriginData topOrigin, struct WebCore::ServiceWorkerClientData data, std::optional<WebCore::ServiceWorkerRegistrationIdentifier> controllingServiceWorkerRegistrationIdentifier) >+ RegisterServiceWorkerClient(struct WebCore::SecurityOriginData topOrigin, struct WebCore::ServiceWorkerClientData data, Optional<WebCore::ServiceWorkerRegistrationIdentifier> controllingServiceWorkerRegistrationIdentifier) > UnregisterServiceWorkerClient(struct WebCore::ServiceWorkerClientIdentifier identifier) > > SyncTerminateWorker(WebCore::ServiceWorkerIdentifier workerIdentifier) -> () LegacySync >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp >index e3d7aac205e28fd3fee4abfea53dc7c09ae29c63..fc9afd7461f3d14361798ac7c223c7ac862e6f9d 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp >@@ -82,7 +82,7 @@ void WebSWServerToContextConnection::syncTerminateWorker(ServiceWorkerIdentifier > sendSync(Messages::WebSWContextManagerConnection::SyncTerminateWorker(serviceWorkerIdentifier), Messages::WebSWContextManagerConnection::SyncTerminateWorker::Reply()); > } > >-void WebSWServerToContextConnection::findClientByIdentifierCompleted(uint64_t requestIdentifier, const std::optional<ServiceWorkerClientData>& data, bool hasSecurityError) >+void WebSWServerToContextConnection::findClientByIdentifierCompleted(uint64_t requestIdentifier, const Optional<ServiceWorkerClientData>& data, bool hasSecurityError) > { > send(Messages::WebSWContextManagerConnection::FindClientByIdentifierCompleted { requestIdentifier, data, hasSecurityError }); > } >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h >index e9c3988c936eb8ebd8281d2b7c3182c328d9952e..0129ad8dbee15539e94c8ee93bf11efef095a757 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h >@@ -62,7 +62,7 @@ private: > void fireActivateEvent(WebCore::ServiceWorkerIdentifier) final; > void terminateWorker(WebCore::ServiceWorkerIdentifier) final; > void syncTerminateWorker(WebCore::ServiceWorkerIdentifier) final; >- void findClientByIdentifierCompleted(uint64_t requestIdentifier, const std::optional<WebCore::ServiceWorkerClientData>&, bool hasSecurityError) final; >+ void findClientByIdentifierCompleted(uint64_t requestIdentifier, const Optional<WebCore::ServiceWorkerClientData>&, bool hasSecurityError) final; > void matchAllCompleted(uint64_t requestIdentifier, const Vector<WebCore::ServiceWorkerClientData>&) final; > void claimCompleted(uint64_t requestIdentifier) final; > void didFinishSkipWaiting(uint64_t callbackID) final; >diff --git a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in >index 611692d1949972feb1e3ce85b88b858559fe64b0..68f95ea7802d67b243a11e63ace371e0df58c6b9 100644 >--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in >+++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in >@@ -25,9 +25,9 @@ > messages -> WebSWServerToContextConnection { > # When possible, these messages can be implemented directly by WebCore::SWServerToContextConnection > >- ScriptContextFailedToStart(std::optional<WebCore::ServiceWorkerJobDataIdentifier> jobDataIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, String message); >- ScriptContextStarted(std::optional<WebCore::ServiceWorkerJobDataIdentifier> jobDataIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier); >- DidFinishInstall(std::optional<WebCore::ServiceWorkerJobDataIdentifier> jobDataIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, bool wasSuccessful); >+ ScriptContextFailedToStart(Optional<WebCore::ServiceWorkerJobDataIdentifier> jobDataIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, String message); >+ ScriptContextStarted(Optional<WebCore::ServiceWorkerJobDataIdentifier> jobDataIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier); >+ DidFinishInstall(Optional<WebCore::ServiceWorkerJobDataIdentifier> jobDataIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, bool wasSuccessful); > DidFinishActivation(WebCore::ServiceWorkerIdentifier identifier); > SetServiceWorkerHasPendingEvents(WebCore::ServiceWorkerIdentifier identifier, bool hasPendingEvents); > SkipWaiting(WebCore::ServiceWorkerIdentifier identifier, uint64_t callbackID) >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >index 2b9e543b9461554b43cfaabbc78c707bce2b6541..0045727a1a01c9253c803a34e2d1e964431611f7 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >@@ -285,13 +285,13 @@ void Engine::deleteMatchingRecords(uint64_t cacheIdentifier, WebCore::ResourceRe > void Engine::initialize(CompletionCallback&& callback) > { > if (m_salt) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > > if (!shouldPersist()) { > m_salt = NetworkCache::Salt { }; >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -312,14 +312,14 @@ void Engine::initialize(CompletionCallback&& callback) > > auto callbacks = WTFMove(m_initializationCallbacks); > for (auto& callback : callbacks) >- callback(m_salt ? std::nullopt : std::make_optional(Error::WriteDisk)); >+ callback(m_salt ? WTF::nullopt : makeOptional(Error::WriteDisk)); > }); > }); > } > > void Engine::readCachesFromDisk(const WebCore::ClientOrigin& origin, CachesCallback&& callback) > { >- initialize([this, origin, callback = WTFMove(callback)](std::optional<Error>&& error) mutable { >+ initialize([this, origin, callback = WTFMove(callback)](Optional<Error>&& error) mutable { > auto& caches = m_caches.ensure(origin, [&origin, this] { > auto path = cachesRootPath(origin); > return Caches::create(*this, WebCore::ClientOrigin { origin }, WTFMove(path), m_quota); >@@ -335,7 +335,7 @@ void Engine::readCachesFromDisk(const WebCore::ClientOrigin& origin, CachesCallb > return; > } > >- caches->initialize([callback = WTFMove(callback), caches = caches.copyRef()](std::optional<Error>&& error) mutable { >+ caches->initialize([callback = WTFMove(callback), caches = caches.copyRef()](Optional<Error>&& error) mutable { > if (error) { > callback(makeUnexpected(error.value())); > return; >@@ -354,7 +354,7 @@ void Engine::readCache(uint64_t cacheIdentifier, CacheCallback&& callback) > return; > } > if (!cache->isOpened()) { >- cache->open([this, protectedThis = makeRef(*this), cacheIdentifier, callback = WTFMove(callback)](std::optional<Error>&& error) mutable { >+ cache->open([this, protectedThis = makeRef(*this), cacheIdentifier, callback = WTFMove(callback)](Optional<Error>&& error) mutable { > if (error) { > callback(makeUnexpected(error.value())); > return; >@@ -386,7 +386,7 @@ Cache* Engine::cache(uint64_t cacheIdentifier) > void Engine::writeFile(const String& filename, NetworkCache::Data&& data, WebCore::DOMCacheEngine::CompletionCallback&& callback) > { > if (!shouldPersist()) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -410,7 +410,7 @@ void Engine::writeFile(const String& filename, NetworkCache::Data&& data, WebCor > callback(Error::WriteDisk); > return; > } >- callback(std::nullopt); >+ callback(WTF::nullopt); > }); > }); > } >@@ -575,7 +575,7 @@ void Engine::clearCachesForOriginFromDisk(const WebCore::SecurityOriginData& ori > for (auto& folderPath : WebCore::FileSystem::listDirectory(m_rootPath, "*")) { > if (!WebCore::FileSystem::fileIsDirectory(folderPath, WebCore::FileSystem::ShouldFollowSymbolicLinks::No)) > continue; >- Caches::retrieveOriginFromDirectory(folderPath, *m_ioQueue, [this, protectedThis = makeRef(*this), origin, callbackAggregator = callbackAggregator.copyRef(), folderPath] (std::optional<WebCore::ClientOrigin>&& folderOrigin) mutable { >+ Caches::retrieveOriginFromDirectory(folderPath, *m_ioQueue, [this, protectedThis = makeRef(*this), origin, callbackAggregator = callbackAggregator.copyRef(), folderPath] (Optional<WebCore::ClientOrigin>&& folderOrigin) mutable { > if (!folderOrigin) > return; > if (folderOrigin->topOrigin != origin && folderOrigin->clientOrigin != origin) >@@ -606,7 +606,7 @@ void Engine::clearMemoryRepresentation(const WebCore::ClientOrigin& origin, WebC > return; > } > result.value().get().clearMemoryRepresentation(); >- callback(std::nullopt); >+ callback(WTF::nullopt); > }); > } > >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >index 7e14225bee50a977b5fc9251465467bb34d83524..231d7ad4e24d13b00e15235eca09039e2d8f4136 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >@@ -132,7 +132,7 @@ private: > String m_rootPath; > uint64_t m_quota { 0 }; > RefPtr<WorkQueue> m_ioQueue; >- std::optional<NetworkCache::Salt> m_salt; >+ Optional<NetworkCache::Salt> m_salt; > HashMap<CacheIdentifier, LockCount> m_cacheLocks; > Vector<WebCore::DOMCacheEngine::CompletionCallback> m_initializationCallbacks; > HashMap<uint64_t, WebCore::DOMCacheEngine::CompletionCallback> m_pendingWriteCallbacks; >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp >index 61a4de5f636f76a354fdd89eb881fee03f2085d1..e452dba5e331354592ce920cc284ba6623f0aa5a 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp >@@ -160,7 +160,7 @@ static TraversalResult isolatedCopy(TraversalResult&& result) > void Cache::open(CompletionCallback&& callback) > { > if (m_state == State::Open) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > if (m_state == State::Opening) { >@@ -181,7 +181,7 @@ void Cache::open(CompletionCallback&& callback) > return; > } > cache->m_records = WTFMove(traversalResult.records); >- cache->finishOpening(WTFMove(callback), std::nullopt); >+ cache->finishOpening(WTFMove(callback), WTF::nullopt); > }); > return; > } >@@ -203,7 +203,7 @@ void Cache::open(CompletionCallback&& callback) > }); > } > >-void Cache::finishOpening(CompletionCallback&& callback, std::optional<Error>&& error) >+void Cache::finishOpening(CompletionCallback&& callback, Optional<Error>&& error) > { > Vector<std::reference_wrapper<RecordInformation>> records; > for (auto& value : m_records.values()) { >@@ -226,10 +226,10 @@ void Cache::finishOpening(CompletionCallback&& callback, std::optional<Error>&& > } > m_state = State::Open; > >- callback(std::nullopt); >+ callback(WTF::nullopt); > auto callbacks = WTFMove(m_pendingOpeningCallbacks); > for (auto& callback : callbacks) >- callback(std::nullopt); >+ callback(WTF::nullopt); > } > > class ReadRecordTaskCounter : public RefCounted<ReadRecordTaskCounter> { >@@ -370,7 +370,7 @@ private: > { > } > >- std::optional<Error> m_error; >+ Optional<Error> m_error; > RecordIdentifiersCallback m_callback; > Vector<uint64_t> m_recordIdentifiers; > }; >@@ -423,7 +423,7 @@ void Cache::put(Vector<Record>&& records, RecordIdentifiersCallback&& callback) > return; > } > >- m_caches.requestSpace(spaceRequired, [caches = makeRef(m_caches), identifier = m_identifier, records = WTFMove(records), callback = WTFMove(callback)](std::optional<DOMCacheEngine::Error>&& error) mutable { >+ m_caches.requestSpace(spaceRequired, [caches = makeRef(m_caches), identifier = m_identifier, records = WTFMove(records), callback = WTFMove(callback)](Optional<DOMCacheEngine::Error>&& error) mutable { > if (error) { > callback(makeUnexpected(error.value())); > return; >@@ -477,7 +477,7 @@ void Cache::removeFromRecordList(const Vector<uint64_t>& recordIdentifiers) > > void Cache::writeRecordToDisk(const RecordInformation& recordInformation, Record&& record, Ref<AsynchronousPutTaskCounter>&& taskCounter, uint64_t previousRecordSize) > { >- m_caches.writeRecord(*this, recordInformation, WTFMove(record), previousRecordSize, [taskCounter = WTFMove(taskCounter)](std::optional<Error>&& error) { >+ m_caches.writeRecord(*this, recordInformation, WTFMove(record), previousRecordSize, [taskCounter = WTFMove(taskCounter)](Optional<Error>&& error) { > if (error) > taskCounter->setError(error.value()); > }); >@@ -555,7 +555,7 @@ Storage::Record Cache::encode(const RecordInformation& recordInformation, const > return { recordInformation.key, { }, header, body, { } }; > } > >-std::optional<Cache::DecodedRecord> Cache::decodeRecordHeader(const Storage::Record& storage) >+Optional<Cache::DecodedRecord> Cache::decodeRecordHeader(const Storage::Record& storage) > { > WTF::Persistence::Decoder decoder(storage.header.data(), storage.header.size()); > >@@ -563,45 +563,45 @@ std::optional<Cache::DecodedRecord> Cache::decodeRecordHeader(const Storage::Rec > > double insertionTime; > if (!decoder.decode(insertionTime)) >- return std::nullopt; >+ return WTF::nullopt; > > uint64_t size; > if (!decoder.decode(size)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(record.requestHeadersGuard)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!record.request.decodeWithoutPlatformData(decoder)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!FetchOptions::decodePersistent(decoder, record.options)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(record.referrer)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(record.responseHeadersGuard)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(record.response)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(record.responseBodySize)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.verifyChecksum()) >- return std::nullopt; >+ return WTF::nullopt; > > return DecodedRecord { insertionTime, size, WTFMove(record) }; > } > >-std::optional<Record> Cache::decode(const Storage::Record& storage) >+Optional<Record> Cache::decode(const Storage::Record& storage) > { > auto result = decodeRecordHeader(storage); > > if (!result) >- return std::nullopt; >+ return WTF::nullopt; > > auto record = WTFMove(result->record); > record.responseBody = WebCore::SharedBuffer::create(storage.body.data(), storage.body.size()); >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h >index 898018e4ea37fb12fb632b192fe8aea1c7146576..cf1b3b613e151fd0b6270992b26ae91455219c29 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h >@@ -77,7 +77,7 @@ public: > void dispose(); > void clearMemoryRepresentation(); > >- static std::optional<WebCore::DOMCacheEngine::Record> decode(const NetworkCache::Storage::Record&); >+ static Optional<WebCore::DOMCacheEngine::Record> decode(const NetworkCache::Storage::Record&); > static NetworkCache::Storage::Record encode(const RecordInformation&, const WebCore::DOMCacheEngine::Record&); > > struct DecodedRecord { >@@ -91,7 +91,7 @@ public: > uint64_t size { 0 }; > WebCore::DOMCacheEngine::Record record; > }; >- static std::optional<DecodedRecord> decodeRecordHeader(const NetworkCache::Storage::Record&); >+ static Optional<DecodedRecord> decodeRecordHeader(const NetworkCache::Storage::Record&); > > private: > Vector<RecordInformation>* recordsFromURL(const URL&); >@@ -102,7 +102,7 @@ private: > > RecordInformation toRecordInformation(const WebCore::DOMCacheEngine::Record&); > >- void finishOpening(WebCore::DOMCacheEngine::CompletionCallback&&, std::optional<WebCore::DOMCacheEngine::Error>&&); >+ void finishOpening(WebCore::DOMCacheEngine::CompletionCallback&&, Optional<WebCore::DOMCacheEngine::Error>&&); > void retrieveRecord(const RecordInformation&, Ref<ReadRecordTaskCounter>&&); > > void readRecordsList(WebCore::DOMCacheEngine::CompletionCallback&&); >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp >index 7f04bf02d3676f0c15667e7dfd56714ea7f696d9..faa88c963c36f7622287d78b57eeb13459ade5e5 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp >@@ -55,12 +55,12 @@ Caches::~Caches() > ASSERT(m_pendingWritingCachesToDiskCallbacks.isEmpty()); > } > >-void Caches::retrieveOriginFromDirectory(const String& folderPath, WorkQueue& queue, WTF::CompletionHandler<void(std::optional<WebCore::ClientOrigin>&&)>&& completionHandler) >+void Caches::retrieveOriginFromDirectory(const String& folderPath, WorkQueue& queue, WTF::CompletionHandler<void(Optional<WebCore::ClientOrigin>&&)>&& completionHandler) > { > queue.dispatch([completionHandler = WTFMove(completionHandler), filename = cachesOriginFilename(folderPath)]() mutable { > if (!WebCore::FileSystem::fileExists(filename)) { > RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)]() mutable { >- completionHandler(std::nullopt); >+ completionHandler(WTF::nullopt); > }); > return; > } >@@ -70,7 +70,7 @@ void Caches::retrieveOriginFromDirectory(const String& folderPath, WorkQueue& qu > ASSERT(RunLoop::isMain()); > if (error) { > RELEASE_LOG_ERROR(CacheStorage, "Caches::retrieveOriginFromDirectory failed reading channel with error %d", error); >- completionHandler(std::nullopt); >+ completionHandler(WTF::nullopt); > return; > } > completionHandler(readOrigin(data)); >@@ -95,43 +95,43 @@ void Caches::storeOrigin(CompletionCallback&& completionHandler) > encoder << m_origin.clientOrigin.protocol; > encoder << m_origin.clientOrigin.host; > encoder << m_origin.clientOrigin.port; >- m_engine->writeFile(cachesOriginFilename(m_rootPath), Data { encoder.buffer(), encoder.bufferSize() }, [protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (std::optional<Error>&& error) mutable { >+ m_engine->writeFile(cachesOriginFilename(m_rootPath), Data { encoder.buffer(), encoder.bufferSize() }, [protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (Optional<Error>&& error) mutable { > completionHandler(WTFMove(error)); > }); > } > >-std::optional<WebCore::ClientOrigin> Caches::readOrigin(const Data& data) >+Optional<WebCore::ClientOrigin> Caches::readOrigin(const Data& data) > { > // FIXME: We should be able to use modern decoders for persistent data. > WebCore::SecurityOriginData topOrigin, clientOrigin; > WTF::Persistence::Decoder decoder(data.data(), data.size()); > > if (!decoder.decode(topOrigin.protocol)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(topOrigin.host)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(topOrigin.port)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(clientOrigin.protocol)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(clientOrigin.host)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(clientOrigin.port)) >- return std::nullopt; >+ return WTF::nullopt; > return WebCore::ClientOrigin { WTFMove(topOrigin), WTFMove(clientOrigin) }; > } > > void Caches::initialize(WebCore::DOMCacheEngine::CompletionCallback&& callback) > { > if (m_isInitialized) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > > if (m_rootPath.isNull()) { > makeDirty(); > m_isInitialized = true; >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -151,7 +151,7 @@ void Caches::initialize(WebCore::DOMCacheEngine::CompletionCallback&& callback) > m_storage = storage.releaseNonNull(); > m_storage->writeWithoutWaiting(); > >- storeOrigin([this] (std::optional<Error>&& error) mutable { >+ storeOrigin([this] (Optional<Error>&& error) mutable { > if (error) { > RELEASE_LOG_ERROR(CacheStorage, "Caches::initialize failed storing origin with error %d", static_cast<int>(*error)); > >@@ -204,7 +204,7 @@ void Caches::initializeSize() > m_isInitialized = true; > auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks); > for (auto& callback : pendingCallbacks) >- callback(std::nullopt); >+ callback(WTF::nullopt); > > return; > } >@@ -289,7 +289,7 @@ void Caches::open(const String& name, CacheIdentifierCallback&& callback) > } > > if (auto* cache = find(name)) { >- cache->open([cacheIdentifier = cache->identifier(), callback = WTFMove(callback)](std::optional<Error>&& error) mutable { >+ cache->open([cacheIdentifier = cache->identifier(), callback = WTFMove(callback)](Optional<Error>&& error) mutable { > if (error) { > callback(makeUnexpected(error.value())); > return; >@@ -304,7 +304,7 @@ void Caches::open(const String& name, CacheIdentifierCallback&& callback) > uint64_t cacheIdentifier = m_engine->nextCacheIdentifier(); > m_caches.append(Cache { *this, cacheIdentifier, Cache::State::Open, String { name }, createCanonicalUUIDString() }); > >- writeCachesToDisk([callback = WTFMove(callback), cacheIdentifier](std::optional<Error>&& error) mutable { >+ writeCachesToDisk([callback = WTFMove(callback), cacheIdentifier](Optional<Error>&& error) mutable { > callback(CacheIdentifierOperationResult { cacheIdentifier, !!error }); > }); > } >@@ -338,7 +338,7 @@ void Caches::remove(uint64_t identifier, CacheIdentifierCallback&& callback) > m_removedCaches.append(WTFMove(m_caches[position])); > m_caches.remove(position); > >- writeCachesToDisk([callback = WTFMove(callback), identifier](std::optional<Error>&& error) mutable { >+ writeCachesToDisk([callback = WTFMove(callback), identifier](Optional<Error>&& error) mutable { > callback(CacheIdentifierOperationResult { identifier, !!error }); > }); > } >@@ -442,7 +442,7 @@ void Caches::writeCachesToDisk(CompletionCallback&& callback) > ASSERT(!m_isWritingCachesToDisk); > ASSERT(m_isInitialized); > if (!shouldPersist()) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -450,19 +450,19 @@ void Caches::writeCachesToDisk(CompletionCallback&& callback) > > if (m_caches.isEmpty()) { > m_engine->removeFile(cachesListFilename(m_rootPath)); >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > > m_isWritingCachesToDisk = true; >- m_engine->writeFile(cachesListFilename(m_rootPath), encodeCacheNames(m_caches), [this, protectedThis = makeRef(*this), callback = WTFMove(callback)](std::optional<Error>&& error) mutable { >+ m_engine->writeFile(cachesListFilename(m_rootPath), encodeCacheNames(m_caches), [this, protectedThis = makeRef(*this), callback = WTFMove(callback)](Optional<Error>&& error) mutable { > m_isWritingCachesToDisk = false; > if (error) > RELEASE_LOG_ERROR(CacheStorage, "Caches::writeCachesToDisk failed writing caches to disk with error %d", static_cast<int>(*error)); > > callback(WTFMove(error)); > while (!m_pendingWritingCachesToDiskCallbacks.isEmpty() && !m_isWritingCachesToDisk) >- m_pendingWritingCachesToDiskCallbacks.takeFirst()(std::nullopt); >+ m_pendingWritingCachesToDiskCallbacks.takeFirst()(WTF::nullopt); > }); > } > >@@ -498,7 +498,7 @@ void Caches::writeRecord(const Cache& cache, const RecordInformation& recordInfo > > if (!shouldPersist()) { > m_volatileStorage.set(recordInformation.key, WTFMove(record)); >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -508,7 +508,7 @@ void Caches::writeRecord(const Cache& cache, const RecordInformation& recordInfo > callback(Error::WriteDisk); > return; > } >- callback(std::nullopt); >+ callback(WTF::nullopt); > }); > } > >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.h b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.h >index 823ec7003db54febcc76585668d6f0e92c3b2e88..f8e72bfee72915f0323a60352a482db46e852544 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.h >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.h >@@ -42,7 +42,7 @@ public: > static Ref<Caches> create(Engine& engine, WebCore::ClientOrigin&& origin, String&& rootPath, uint64_t quota) { return adoptRef(*new Caches { engine, WTFMove(origin), WTFMove(rootPath), quota }); } > ~Caches(); > >- static void retrieveOriginFromDirectory(const String& folderPath, WorkQueue&, WTF::CompletionHandler<void(std::optional<WebCore::ClientOrigin>&&)>&&); >+ static void retrieveOriginFromDirectory(const String& folderPath, WorkQueue&, WTF::CompletionHandler<void(Optional<WebCore::ClientOrigin>&&)>&&); > > void initialize(WebCore::DOMCacheEngine::CompletionCallback&&); > void open(const String& name, WebCore::DOMCacheEngine::CacheIdentifierCallback&&); >@@ -85,7 +85,7 @@ private: > void writeCachesToDisk(WebCore::DOMCacheEngine::CompletionCallback&&); > > void storeOrigin(WebCore::DOMCacheEngine::CompletionCallback&&); >- static std::optional<WebCore::ClientOrigin> readOrigin(const NetworkCache::Data&); >+ static Optional<WebCore::ClientOrigin> readOrigin(const NetworkCache::Data&); > > Cache* find(const String& name); > void clearPendingWritingCachesToDiskCallbacks(); >@@ -104,10 +104,10 @@ private: > Vector<Cache> m_removedCaches; > RefPtr<NetworkCache::Storage> m_storage; > HashMap<NetworkCache::Key, WebCore::DOMCacheEngine::Record> m_volatileStorage; >- mutable std::optional<NetworkCache::Salt> m_volatileSalt; >+ mutable Optional<NetworkCache::Salt> m_volatileSalt; > Vector<WebCore::DOMCacheEngine::CompletionCallback> m_pendingInitializationCallbacks; > bool m_isWritingCachesToDisk { false }; >- Deque<CompletionHandler<void(std::optional<WebCore::DOMCacheEngine::Error>)>> m_pendingWritingCachesToDiskCallbacks; >+ Deque<CompletionHandler<void(Optional<WebCore::DOMCacheEngine::Error>)>> m_pendingWritingCachesToDiskCallbacks; > }; > > } // namespace CacheStorage >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp >index 3e32517e94bdfcf3bedb2103a12e8e4c86c4c5df..c26aef0a023b2dbfa4f1a21fefe29ea281c55643 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp >@@ -151,7 +151,7 @@ void CacheStorageEngineConnection::dereference(PAL::SessionID sessionID, uint64_ > > void CacheStorageEngineConnection::clearMemoryRepresentation(PAL::SessionID sessionID, uint64_t requestIdentifier, WebCore::ClientOrigin&& origin) > { >- Engine::clearMemoryRepresentation(sessionID, WTFMove(origin), [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier] (std::optional<Error>&& error) { >+ Engine::clearMemoryRepresentation(sessionID, WTFMove(origin), [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier] (Optional<Error>&& error) { > connection->send(Messages::WebCacheStorageConnection::ClearMemoryRepresentationCompleted(requestIdentifier, error), sessionID.sessionID()); > }); > } >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp b/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp >index abe98ef3d0d004dafb7af0aee883ff0fa219f7f2..dafff427f3872b125f78a51996f7ee487f15fcbb 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp >@@ -152,7 +152,7 @@ static bool cachePolicyAllowsExpired(WebCore::ResourceRequestCachePolicy policy) > return false; > } > >-static bool responseHasExpired(const WebCore::ResourceResponse& response, WallTime timestamp, std::optional<Seconds> maxStale) >+static bool responseHasExpired(const WebCore::ResourceResponse& response, WallTime timestamp, Optional<Seconds> maxStale) > { > if (response.cacheControlContainsNoCache()) > return true; >@@ -413,7 +413,7 @@ std::unique_ptr<Entry> Cache::store(const WebCore::ResourceRequest& request, con > return cacheEntry; > } > >-std::unique_ptr<Entry> Cache::storeRedirect(const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& redirectRequest, std::optional<Seconds> maxAgeCap) >+std::unique_ptr<Entry> Cache::storeRedirect(const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& redirectRequest, Optional<Seconds> maxAgeCap) > { > LOG(NetworkCache, "(NetworkProcess) storing redirect %s -> %s", request.url().string().latin1().data(), redirectRequest.url().string().latin1().data()); > >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCache.h b/Source/WebKit/NetworkProcess/cache/NetworkCache.h >index c2d0e964effdfced268659485c751d538db665a6..54b4bb2bf593a137cc818af8971e7ffff648aafd 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCache.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCache.h >@@ -114,7 +114,7 @@ public: > using RetrieveCompletionHandler = Function<void (std::unique_ptr<Entry>, const RetrieveInfo&)>; > void retrieve(const WebCore::ResourceRequest&, const GlobalFrameID&, RetrieveCompletionHandler&&); > std::unique_ptr<Entry> store(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, RefPtr<WebCore::SharedBuffer>&&, Function<void (MappedBody&)>&&); >- std::unique_ptr<Entry> storeRedirect(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest& redirectRequest, std::optional<Seconds> maxAgeCap); >+ std::unique_ptr<Entry> storeRedirect(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest& redirectRequest, Optional<Seconds> maxAgeCap); > std::unique_ptr<Entry> update(const WebCore::ResourceRequest&, const GlobalFrameID&, const Entry&, const WebCore::ResourceResponse& validatingResponse); > > struct TraversalEntry { >@@ -155,7 +155,7 @@ private: > String dumpFilePath() const; > void deleteDumpFile(); > >- std::optional<Seconds> maxAgeCap(Entry&, const WebCore::ResourceRequest&, PAL::SessionID); >+ Optional<Seconds> maxAgeCap(Entry&, const WebCore::ResourceRequest&, PAL::SessionID); > > Ref<Storage> m_storage; > >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp b/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp >index a6e37be49128564091afb542083b755e710af101..2d4338f1ba5bb1c0b727ec02ecb387659d296c78 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp >@@ -151,7 +151,7 @@ static Salt makeSalt() > return salt; > } > >-std::optional<Salt> readOrMakeSalt(const String& path) >+Optional<Salt> readOrMakeSalt(const String& path) > { > #if !OS(WINDOWS) > auto cpath = WebCore::FileSystem::fileSystemRepresentation(path); >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheData.h b/Source/WebKit/NetworkProcess/cache/NetworkCacheData.h >index 496108de63eb44de9f7ba58684efe2491da689bf..5bedc0ded911dc93eacd567e6f598d08ccc8f409 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheData.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheData.h >@@ -102,7 +102,7 @@ Data mapFile(const char* path); > > using Salt = std::array<uint8_t, 8>; > >-std::optional<Salt> readOrMakeSalt(const String& path); >+Optional<Salt> readOrMakeSalt(const String& path); > SHA1::Digest computeSHA1(const Data&, const Salt&); > > } >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.h b/Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.h >index deda86a44b61849d6dbb3d01d3420192e7729965..13e7090b058ac252c417e3d2af2548944890a97c 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.h >@@ -58,7 +58,7 @@ public: > const Vector<std::pair<String, String>>& varyingRequestHeaders() const { return m_varyingRequestHeaders; } > > WebCore::SharedBuffer* buffer() const; >- const std::optional<WebCore::ResourceRequest>& redirectRequest() const { return m_redirectRequest; } >+ const Optional<WebCore::ResourceRequest>& redirectRequest() const { return m_redirectRequest; } > > #if ENABLE(SHAREABLE_RESOURCE) > ShareableResource::Handle& shareableResourceHandle() const; >@@ -87,7 +87,7 @@ private: > WebCore::ResourceResponse m_response; > Vector<std::pair<String, String>> m_varyingRequestHeaders; > >- std::optional<WebCore::ResourceRequest> m_redirectRequest; >+ Optional<WebCore::ResourceRequest> m_redirectRequest; > mutable RefPtr<WebCore::SharedBuffer> m_buffer; > #if ENABLE(SHAREABLE_RESOURCE) > mutable ShareableResource::Handle m_shareableResourceHandle; >@@ -95,7 +95,7 @@ private: > > Storage::Record m_sourceStorageRecord { }; > >- std::optional<Seconds> m_maxAgeCap; >+ Optional<Seconds> m_maxAgeCap; > }; > > } >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp b/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp >index 6fad8590201e0c00afbe2a2fd6e81c0ffa8a8faf..7e7baf54e865214756e63b3976e2f3d394023421 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp >@@ -72,7 +72,7 @@ void SpeculativeLoad::willSendRedirectedRequest(ResourceRequest&& request, Resou > { > LOG(NetworkCacheSpeculativePreloading, "Speculative redirect %s -> %s", request.url().string().utf8().data(), redirectRequest.url().string().utf8().data()); > >- std::optional<Seconds> maxAgeCap; >+ Optional<Seconds> maxAgeCap; > #if ENABLE(RESOURCE_LOAD_STATISTICS) > if (auto networkStorageSession = WebCore::NetworkStorageSession::storageSession(PAL::SessionID::defaultSessionID())) > maxAgeCap = networkStorageSession->maxAgeCacheCap(request); >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp b/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp >index 6b9aadee59eb0dc045a42c856f88d30d5d8bfb63..bd9211a93026d4c3ac3ce4fcba7594f8bcca3680 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp >@@ -138,7 +138,7 @@ private: > class SpeculativeLoadManager::PreloadedEntry : private ExpiringEntry { > WTF_MAKE_FAST_ALLOCATED; > public: >- PreloadedEntry(std::unique_ptr<Entry> entry, std::optional<ResourceRequest>&& speculativeValidationRequest, WTF::Function<void()>&& lifetimeReachedHandler) >+ PreloadedEntry(std::unique_ptr<Entry> entry, Optional<ResourceRequest>&& speculativeValidationRequest, WTF::Function<void()>&& lifetimeReachedHandler) > : ExpiringEntry(WTFMove(lifetimeReachedHandler)) > , m_entry(WTFMove(entry)) > , m_speculativeValidationRequest(WTFMove(speculativeValidationRequest)) >@@ -150,12 +150,12 @@ public: > return WTFMove(m_entry); > } > >- const std::optional<ResourceRequest>& revalidationRequest() const { return m_speculativeValidationRequest; } >+ const Optional<ResourceRequest>& revalidationRequest() const { return m_speculativeValidationRequest; } > bool wasRevalidated() const { return !!m_speculativeValidationRequest; } > > private: > std::unique_ptr<Entry> m_entry; >- std::optional<ResourceRequest> m_speculativeValidationRequest; >+ Optional<ResourceRequest> m_speculativeValidationRequest; > }; > > class SpeculativeLoadManager::PendingFrameLoad : public RefCounted<PendingFrameLoad> { >@@ -399,7 +399,7 @@ void SpeculativeLoadManager::registerLoad(const GlobalFrameID& frameID, const Re > pendingFrameLoad->registerSubresourceLoad(request, resourceKey); > } > >-void SpeculativeLoadManager::addPreloadedEntry(std::unique_ptr<Entry> entry, const GlobalFrameID& frameID, std::optional<ResourceRequest>&& revalidationRequest) >+void SpeculativeLoadManager::addPreloadedEntry(std::unique_ptr<Entry> entry, const GlobalFrameID& frameID, Optional<ResourceRequest>&& revalidationRequest) > { > ASSERT(entry); > ASSERT(!entry->needsValidation()); >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h b/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h >index db6f4f236db15c8a8c5485a3af85dd75fd061876..3af4fdb8121fd7c5e918a039b400a5f3a3a86efa 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h >@@ -59,7 +59,7 @@ public: > private: > class PreloadedEntry; > >- void addPreloadedEntry(std::unique_ptr<Entry>, const GlobalFrameID&, std::optional<WebCore::ResourceRequest>&& revalidationRequest = std::nullopt); >+ void addPreloadedEntry(std::unique_ptr<Entry>, const GlobalFrameID&, Optional<WebCore::ResourceRequest>&& revalidationRequest = WTF::nullopt); > void preloadEntry(const Key&, const SubresourceInfo&, const GlobalFrameID&); > void retrieveEntryFromStorage(const SubresourceInfo&, RetrieveCompletionHandler&&); > void revalidateSubresource(const SubresourceInfo&, std::unique_ptr<Entry>, const GlobalFrameID&); >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp b/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp >index 16579ba8209eb658578cc2c43141c9350c856db3..d296afe8a96430d805738050d946631d388d175a 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.cpp >@@ -221,7 +221,7 @@ void Statistics::recordNotUsingCacheForRequest(uint64_t webPageID, const Key& ke > ASSERT(retrieveDecision != RetrieveDecision::Yes); > > auto hash = key.hashAsString(); >- queryWasEverRequested(hash, NeedUncachedReason::No, [this, hash, requestURL = request.url(), webPageID, retrieveDecision](bool wasEverRequested, const std::optional<StoreDecision>&) { >+ queryWasEverRequested(hash, NeedUncachedReason::No, [this, hash, requestURL = request.url(), webPageID, retrieveDecision](bool wasEverRequested, const Optional<StoreDecision>&) { > if (wasEverRequested) { > String diagnosticKey = retrieveDecisionToDiagnosticKey(retrieveDecision); > LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously requested but we are not using the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data()); >@@ -261,7 +261,7 @@ static String storeDecisionToDiagnosticKey(StoreDecision storeDecision) > void Statistics::recordRetrievalFailure(uint64_t webPageID, const Key& key, const WebCore::ResourceRequest& request) > { > auto hash = key.hashAsString(); >- queryWasEverRequested(hash, NeedUncachedReason::Yes, [this, hash, requestURL = request.url(), webPageID](bool wasPreviouslyRequested, const std::optional<StoreDecision>& storeDecision) { >+ queryWasEverRequested(hash, NeedUncachedReason::Yes, [this, hash, requestURL = request.url(), webPageID](bool wasPreviouslyRequested, const Optional<StoreDecision>& storeDecision) { > if (wasPreviouslyRequested) { > String diagnosticKey = storeDecisionToDiagnosticKey(storeDecision.value()); > LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously request but is not in the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data()); >@@ -355,7 +355,7 @@ void Statistics::queryWasEverRequested(const String& hash, NeedUncachedReason ne > // Query pending writes first. > bool wasAlreadyRequested = m_hashesToAdd.contains(hash); > if (wasAlreadyRequested && needUncachedReason == NeedUncachedReason::No) { >- completionHandler(true, std::nullopt); >+ completionHandler(true, WTF::nullopt); > return; > } > if (needUncachedReason == NeedUncachedReason::Yes && m_storeDecisionsToAdd.contains(hash)) { >@@ -369,7 +369,7 @@ void Statistics::queryWasEverRequested(const String& hash, NeedUncachedReason ne > m_activeQueries.add(WTFMove(everRequestedQuery)); > serialBackgroundIOQueue().dispatch([this, wasAlreadyRequested, &query] () mutable { > WebCore::SQLiteTransactionInProgressAutoCounter transactionCounter; >- std::optional<StoreDecision> storeDecision; >+ Optional<StoreDecision> storeDecision; > if (m_database.isOpen()) { > if (!wasAlreadyRequested) { > WebCore::SQLiteStatement statement(m_database, "SELECT hash FROM AlreadyRequested WHERE hash=?"_s); >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.h b/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.h >index 7771bff43544e8c73acaf0104f6b979eb45b4345..c52028fa63765520970da91775511ce4892cdcb6 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheStatistics.h >@@ -64,7 +64,7 @@ private: > void addStoreDecisionsToDatabase(const HashMap<String, NetworkCache::StoreDecision>&); > void writeTimerFired(); > >- typedef Function<void (bool wasEverRequested, const std::optional<StoreDecision>&)> RequestedCompletionHandler; >+ typedef Function<void (bool wasEverRequested, const Optional<StoreDecision>&)> RequestedCompletionHandler; > enum class NeedUncachedReason { No, Yes }; > void queryWasEverRequested(const String&, NeedUncachedReason, RequestedCompletionHandler&&); > void markAsRequested(const String& hash); >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp b/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp >index c810d135c1a973e7a09a690579b7b8c00619817e..1a8df36e70d5555c21670e0ab05388ddb6ed0fea 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp >@@ -522,7 +522,7 @@ static Data encodeRecordMetaData(const RecordMetaData& metaData) > return Data(encoder.buffer(), encoder.bufferSize()); > } > >-std::optional<BlobStorage::Blob> Storage::storeBodyAsBlob(WriteOperation& writeOperation) >+Optional<BlobStorage::Blob> Storage::storeBodyAsBlob(WriteOperation& writeOperation) > { > auto blobPath = blobPathForKey(writeOperation.record.key); > >@@ -547,7 +547,7 @@ std::optional<BlobStorage::Blob> Storage::storeBodyAsBlob(WriteOperation& writeO > return blob; > } > >-Data Storage::encodeRecord(const Record& record, std::optional<BlobStorage::Blob> blob) >+Data Storage::encodeRecord(const Record& record, Optional<BlobStorage::Blob> blob) > { > ASSERT(!blob || bytesEqual(blob.value().data, record.body)); > >@@ -813,7 +813,7 @@ void Storage::dispatchWriteOperation(std::unique_ptr<WriteOperation> writeOperat > ++writeOperation.activeCount; > > bool shouldStoreAsBlob = shouldStoreBodyAsBlob(writeOperation.record.body); >- auto blob = shouldStoreAsBlob ? storeBodyAsBlob(writeOperation) : std::nullopt; >+ auto blob = shouldStoreAsBlob ? storeBodyAsBlob(writeOperation) : WTF::nullopt; > > auto recordData = encodeRecord(writeOperation.record, blob); > >diff --git a/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h b/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h >index acd2fe4e1fa7fd1d3f9dc7b0ed13f0c827680428..8bf7c683bbf7f283e719f6cfbb1b8234098c023d 100644 >--- a/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h >+++ b/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h >@@ -55,7 +55,7 @@ public: > WallTime timeStamp; > Data header; > Data body; >- std::optional<SHA1::Digest> bodyHash; >+ Optional<SHA1::Digest> bodyHash; > > WTF_MAKE_FAST_ALLOCATED; > }; >@@ -147,8 +147,8 @@ private: > void finishWriteOperation(WriteOperation&, int error = 0); > > bool shouldStoreBodyAsBlob(const Data& bodyData); >- std::optional<BlobStorage::Blob> storeBodyAsBlob(WriteOperation&); >- Data encodeRecord(const Record&, std::optional<BlobStorage::Blob>); >+ Optional<BlobStorage::Blob> storeBodyAsBlob(WriteOperation&); >+ Data encodeRecord(const Record&, Optional<BlobStorage::Blob>); > void readRecord(ReadOperation&, const Data&); > > void updateFileModificationTime(const String& path); >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h >index 030fa52bb235f1e78ccff1f1da6ea7e0b0fe1897..84242585719eb1add3af8c34d5bd3cac26ab7195 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h >@@ -42,7 +42,7 @@ class NetworkSessionCocoa; > class NetworkDataTaskCocoa final : public NetworkDataTask { > friend class NetworkSessionCocoa; > public: >- static Ref<NetworkDataTask> create(NetworkSession& session, NetworkDataTaskClient& client, const WebCore::ResourceRequest& request, uint64_t frameID, uint64_t pageID, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, WebCore::ContentSniffingPolicy shouldContentSniff, WebCore::ContentEncodingSniffingPolicy shouldContentEncodingSniff, bool shouldClearReferrerOnHTTPSToHTTPRedirect, PreconnectOnly shouldPreconnectOnly, bool dataTaskIsForMainFrameNavigation, std::optional<NetworkActivityTracker> networkActivityTracker) >+ static Ref<NetworkDataTask> create(NetworkSession& session, NetworkDataTaskClient& client, const WebCore::ResourceRequest& request, uint64_t frameID, uint64_t pageID, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, WebCore::ContentSniffingPolicy shouldContentSniff, WebCore::ContentEncodingSniffingPolicy shouldContentEncodingSniff, bool shouldClearReferrerOnHTTPSToHTTPRedirect, PreconnectOnly shouldPreconnectOnly, bool dataTaskIsForMainFrameNavigation, Optional<NetworkActivityTracker> networkActivityTracker) > { > return adoptRef(*new NetworkDataTaskCocoa(session, client, request, frameID, pageID, storedCredentialsPolicy, shouldContentSniff, shouldContentEncodingSniff, shouldClearReferrerOnHTTPSToHTTPRedirect, shouldPreconnectOnly, dataTaskIsForMainFrameNavigation, networkActivityTracker)); > } >@@ -84,7 +84,7 @@ public: > String description() const override; > > private: >- NetworkDataTaskCocoa(NetworkSession&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, uint64_t frameID, uint64_t pageID, WebCore::StoredCredentialsPolicy, WebCore::ContentSniffingPolicy, WebCore::ContentEncodingSniffingPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, PreconnectOnly, bool dataTaskIsForMainFrameNavigation, std::optional<NetworkActivityTracker>); >+ NetworkDataTaskCocoa(NetworkSession&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, uint64_t frameID, uint64_t pageID, WebCore::StoredCredentialsPolicy, WebCore::ContentSniffingPolicy, WebCore::ContentEncodingSniffingPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, PreconnectOnly, bool dataTaskIsForMainFrameNavigation, Optional<NetworkActivityTracker>); > > bool tryPasswordBasedAuthentication(const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&); > void applySniffingPoliciesAndBindRequestToInferfaceIfNeeded(__strong NSURLRequest*&, bool shouldContentSniff, bool shouldContentEncodingSniff); >@@ -107,7 +107,7 @@ private: > #endif > > #if ENABLE(PROXIMITY_NETWORKING) >- std::optional<NetworkProximityAssertion::Token> m_proximityAssertionToken; >+ Optional<NetworkProximityAssertion::Token> m_proximityAssertionToken; > #endif > }; > >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >index c84141b8dd48ebe722e1d59b67e0c4b133892dea..58e10384885954c8f1566459754a45000413f0a7 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >@@ -162,7 +162,7 @@ static void updateTaskWithFirstPartyForSameSiteCookies(NSURLSessionDataTask* tas > #endif > } > >-NetworkDataTaskCocoa::NetworkDataTaskCocoa(NetworkSession& session, NetworkDataTaskClient& client, const WebCore::ResourceRequest& requestWithCredentials, uint64_t frameID, uint64_t pageID, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, WebCore::ContentSniffingPolicy shouldContentSniff, WebCore::ContentEncodingSniffingPolicy shouldContentEncodingSniff, bool shouldClearReferrerOnHTTPSToHTTPRedirect, PreconnectOnly shouldPreconnectOnly, bool dataTaskIsForMainFrameNavigation, std::optional<NetworkActivityTracker> networkActivityTracker) >+NetworkDataTaskCocoa::NetworkDataTaskCocoa(NetworkSession& session, NetworkDataTaskClient& client, const WebCore::ResourceRequest& requestWithCredentials, uint64_t frameID, uint64_t pageID, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, WebCore::ContentSniffingPolicy shouldContentSniff, WebCore::ContentEncodingSniffingPolicy shouldContentEncodingSniff, bool shouldClearReferrerOnHTTPSToHTTPRedirect, PreconnectOnly shouldPreconnectOnly, bool dataTaskIsForMainFrameNavigation, Optional<NetworkActivityTracker> networkActivityTracker) > : NetworkDataTask(session, client, requestWithCredentials, storedCredentialsPolicy, shouldClearReferrerOnHTTPSToHTTPRedirect, dataTaskIsForMainFrameNavigation) > , m_frameID(frameID) > , m_pageID(pageID) >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >index b1b7a8155f1ba191d92e86c824b523e764907c58..4871c213b86167d3626db44bb2518ab9b9f7bb56 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >+++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >@@ -443,7 +443,7 @@ void NetworkDataTaskCurl::appendCookieHeader(WebCore::ResourceRequest& request) > const auto& storageSession = m_session->networkStorageSession(); > const auto& cookieJar = storageSession.cookieStorage(); > auto includeSecureCookies = request.url().protocolIs("https") ? IncludeSecureCookies::Yes : IncludeSecureCookies::No; >- auto cookieHeaderField = cookieJar.cookieRequestHeaderFieldValue(storageSession, request.firstPartyForCookies(), WebCore::SameSiteInfo::create(request), request.url(), std::nullopt, std::nullopt, includeSecureCookies).first; >+ auto cookieHeaderField = cookieJar.cookieRequestHeaderFieldValue(storageSession, request.firstPartyForCookies(), WebCore::SameSiteInfo::create(request), request.url(), WTF::nullopt, WTF::nullopt, includeSecureCookies).first; > if (!cookieHeaderField.isEmpty()) > request.addHTTPHeaderField(HTTPHeaderName::Cookie, cookieHeaderField); > } >diff --git a/Source/WebKit/Platform/IPC/ArgumentCoder.h b/Source/WebKit/Platform/IPC/ArgumentCoder.h >index 9ecfdae070c4134ddead8c9c237b72d2633717ff..e3f6d8719f94956a06caae9539f6ff5736747eba 100644 >--- a/Source/WebKit/Platform/IPC/ArgumentCoder.h >+++ b/Source/WebKit/Platform/IPC/ArgumentCoder.h >@@ -45,9 +45,9 @@ template<typename U> > class UsesModernDecoder { > private: > template<typename T, T> struct Helper; >- template<typename T> static uint8_t check(Helper<std::optional<U> (*)(Decoder&), &T::decode>*); >+ template<typename T> static uint8_t check(Helper<Optional<U> (*)(Decoder&), &T::decode>*); > template<typename T> static uint16_t check(...); >- template<typename T> static uint8_t checkArgumentCoder(Helper<std::optional<U> (*)(Decoder&), &ArgumentCoder<T>::decode>*); >+ template<typename T> static uint8_t checkArgumentCoder(Helper<Optional<U> (*)(Decoder&), &ArgumentCoder<T>::decode>*); > template<typename T> static uint16_t checkArgumentCoder(...); > public: > static constexpr bool argumentCoderValue = sizeof(check<U>(nullptr)) == sizeof(uint8_t); >@@ -97,7 +97,7 @@ template<typename T> struct ArgumentCoder { > } > > template<typename U = T, std::enable_if_t<UsesModernDecoder<U>::argumentCoderValue>* = nullptr> >- static std::optional<U> decode(Decoder& decoder) >+ static Optional<U> decode(Decoder& decoder) > { > return U::decode(decoder); > } >diff --git a/Source/WebKit/Platform/IPC/ArgumentCoders.cpp b/Source/WebKit/Platform/IPC/ArgumentCoders.cpp >index fe919b819af4042d75f76a667a876f424d705823..02bf4dcd70edb411e8c535a3ab138085b68a1792 100644 >--- a/Source/WebKit/Platform/IPC/ArgumentCoders.cpp >+++ b/Source/WebKit/Platform/IPC/ArgumentCoders.cpp >@@ -47,12 +47,12 @@ bool ArgumentCoder<WallTime>::decode(Decoder& decoder, WallTime& time) > return true; > } > >-std::optional<WallTime> ArgumentCoder<WallTime>::decode(Decoder& decoder) >+Optional<WallTime> ArgumentCoder<WallTime>::decode(Decoder& decoder) > { >- std::optional<double> time; >+ Optional<double> time; > decoder >> time; > if (!time) >- return std::nullopt; >+ return WTF::nullopt; > return WallTime::fromRawSeconds(*time); > } > >@@ -170,11 +170,11 @@ bool ArgumentCoder<String>::decode(Decoder& decoder, String& result) > return decodeStringText<UChar>(decoder, length, result); > } > >-std::optional<String> ArgumentCoder<String>::decode(Decoder& decoder) >+Optional<String> ArgumentCoder<String>::decode(Decoder& decoder) > { > uint32_t length; > if (!decoder.decode(length)) >- return std::nullopt; >+ return WTF::nullopt; > > if (length == std::numeric_limits<uint32_t>::max()) { > // This is the null string. >@@ -183,16 +183,16 @@ std::optional<String> ArgumentCoder<String>::decode(Decoder& decoder) > > bool is8Bit; > if (!decoder.decode(is8Bit)) >- return std::nullopt; >+ return WTF::nullopt; > > String result; > if (is8Bit) { > if (!decodeStringText<LChar>(decoder, length, result)) >- return std::nullopt; >+ return WTF::nullopt; > return result; > } > if (!decodeStringText<UChar>(decoder, length, result)) >- return std::nullopt; >+ return WTF::nullopt; > return result; > } > >diff --git a/Source/WebKit/Platform/IPC/ArgumentCoders.h b/Source/WebKit/Platform/IPC/ArgumentCoders.h >index daea6269b90b9b952469e35b905d9f4f09f5339d..76896767850fe849fbeddbde7afdc8f3093755c2 100644 >--- a/Source/WebKit/Platform/IPC/ArgumentCoders.h >+++ b/Source/WebKit/Platform/IPC/ArgumentCoders.h >@@ -64,18 +64,18 @@ template<typename T> struct ArgumentCoder<OptionSet<T>> { > return true; > } > >- static std::optional<OptionSet<T>> decode(Decoder& decoder) >+ static Optional<OptionSet<T>> decode(Decoder& decoder) > { >- std::optional<uint64_t> value; >+ Optional<uint64_t> value; > decoder >> value; > if (!value) >- return std::nullopt; >+ return WTF::nullopt; > return OptionSet<T>::fromRaw(*value); > } > }; > >-template<typename T> struct ArgumentCoder<std::optional<T>> { >- static void encode(Encoder& encoder, const std::optional<T>& optional) >+template<typename T> struct ArgumentCoder<Optional<T>> { >+ static void encode(Encoder& encoder, const Optional<T>& optional) > { > if (!optional) { > encoder << false; >@@ -86,14 +86,14 @@ template<typename T> struct ArgumentCoder<std::optional<T>> { > encoder << optional.value(); > } > >- static bool decode(Decoder& decoder, std::optional<T>& optional) >+ static bool decode(Decoder& decoder, Optional<T>& optional) > { > bool isEngaged; > if (!decoder.decode(isEngaged)) > return false; > > if (!isEngaged) { >- optional = std::nullopt; >+ optional = WTF::nullopt; > return true; > } > >@@ -105,20 +105,20 @@ template<typename T> struct ArgumentCoder<std::optional<T>> { > return true; > } > >- static std::optional<std::optional<T>> decode(Decoder& decoder) >+ static Optional<Optional<T>> decode(Decoder& decoder) > { >- std::optional<bool> isEngaged; >+ Optional<bool> isEngaged; > decoder >> isEngaged; > if (!isEngaged) >- return std::nullopt; >+ return WTF::nullopt; > if (*isEngaged) { >- std::optional<T> value; >+ Optional<T> value; > decoder >> value; > if (!value) >- return std::nullopt; >- return std::optional<std::optional<T>>(WTFMove(*value)); >+ return WTF::nullopt; >+ return Optional<Optional<T>>(WTFMove(*value)); > } >- return std::optional<std::optional<T>>(std::optional<T>(std::nullopt)); >+ return Optional<Optional<T>>(Optional<T>(WTF::nullopt)); > } > }; > >@@ -143,17 +143,17 @@ template<typename T, typename U> struct ArgumentCoder<std::pair<T, U>> { > return true; > } > >- static std::optional<std::pair<T, U>> decode(Decoder& decoder) >+ static Optional<std::pair<T, U>> decode(Decoder& decoder) > { >- std::optional<T> first; >+ Optional<T> first; > decoder >> first; > if (!first) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<U> second; >+ Optional<U> second; > decoder >> second; > if (!second) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*first), WTFMove(*second) }}; > } >@@ -178,7 +178,7 @@ struct TupleCoder { > template<typename U = typename std::remove_reference<typename std::tuple_element<sizeof...(Elements) - index, std::tuple<Elements...>>::type>::type, std::enable_if_t<UsesModernDecoder<U>::value>* = nullptr> > static bool decode(Decoder& decoder, std::tuple<Elements...>& tuple) > { >- std::optional<U> optional; >+ Optional<U> optional; > decoder >> optional; > if (!optional) > return false; >@@ -246,7 +246,7 @@ template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t min > > static bool decode(Decoder& decoder, Vector<T, inlineCapacity, OverflowHandler, minCapacity>& vector) > { >- std::optional<Vector<T, inlineCapacity, OverflowHandler, minCapacity>> optional; >+ Optional<Vector<T, inlineCapacity, OverflowHandler, minCapacity>> optional; > decoder >> optional; > if (!optional) > return false; >@@ -254,18 +254,18 @@ template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t min > return true; > } > >- static std::optional<Vector<T, inlineCapacity, OverflowHandler, minCapacity>> decode(Decoder& decoder) >+ static Optional<Vector<T, inlineCapacity, OverflowHandler, minCapacity>> decode(Decoder& decoder) > { > uint64_t size; > if (!decoder.decode(size)) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<T, inlineCapacity, OverflowHandler, minCapacity> vector; > for (size_t i = 0; i < size; ++i) { >- std::optional<T> element; >+ Optional<T> element; > decoder >> element; > if (!element) >- return std::nullopt; >+ return WTF::nullopt; > vector.append(WTFMove(*element)); > } > vector.shrinkToFit(); >@@ -303,18 +303,18 @@ template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t min > return true; > } > >- static std::optional<Vector<T, inlineCapacity, OverflowHandler, minCapacity>> decode(Decoder& decoder) >+ static Optional<Vector<T, inlineCapacity, OverflowHandler, minCapacity>> decode(Decoder& decoder) > { > uint64_t size; > if (!decoder.decode(size)) >- return std::nullopt; >+ return WTF::nullopt; > > // Since we know the total size of the elements, we can allocate the vector in > // one fell swoop. Before allocating we must however make sure that the decoder buffer > // is big enough. > if (!decoder.bufferIsLargeEnoughToContain<T>(size)) { > decoder.markInvalid(); >- return std::nullopt; >+ return WTF::nullopt; > } > > Vector<T, inlineCapacity, OverflowHandler, minCapacity> vector; >@@ -364,28 +364,28 @@ template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTrai > return true; > } > >- static std::optional<HashMapType> decode(Decoder& decoder) >+ static Optional<HashMapType> decode(Decoder& decoder) > { > uint64_t hashMapSize; > if (!decoder.decode(hashMapSize)) >- return std::nullopt; >+ return WTF::nullopt; > > HashMapType hashMap; > for (uint64_t i = 0; i < hashMapSize; ++i) { >- std::optional<KeyArg> key; >+ Optional<KeyArg> key; > decoder >> key; > if (!key) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<MappedArg> value; >+ Optional<MappedArg> value; > decoder >> value; > if (!value) >- return std::nullopt; >+ return WTF::nullopt; > > if (!hashMap.add(WTFMove(key.value()), WTFMove(value.value())).isNewEntry) { > // The hash map already has the specified key, bail. > decoder.markInvalid(); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -405,7 +405,7 @@ template<typename KeyArg, typename HashArg, typename KeyTraitsArg> struct Argume > > static bool decode(Decoder& decoder, HashSetType& hashSet) > { >- std::optional<HashSetType> tempHashSet; >+ Optional<HashSetType> tempHashSet; > decoder >> tempHashSet; > if (!tempHashSet) > return false; >@@ -414,23 +414,23 @@ template<typename KeyArg, typename HashArg, typename KeyTraitsArg> struct Argume > return true; > } > >- static std::optional<HashSetType> decode(Decoder& decoder) >+ static Optional<HashSetType> decode(Decoder& decoder) > { > uint64_t hashSetSize; > if (!decoder.decode(hashSetSize)) >- return std::nullopt; >+ return WTF::nullopt; > > HashSetType hashSet; > for (uint64_t i = 0; i < hashSetSize; ++i) { >- std::optional<KeyArg> key; >+ Optional<KeyArg> key; > decoder >> key; > if (!key) >- return std::nullopt; >+ return WTF::nullopt; > > if (!hashSet.add(WTFMove(key.value())).isNewEntry) { > // The hash set already has the specified key, bail. > decoder.markInvalid(); >- return std::nullopt; >+ return WTF::nullopt; > } > } > >@@ -491,26 +491,26 @@ template<typename ValueType, typename ErrorType> struct ArgumentCoder<Expected<V > encoder << expected.value(); > } > >- static std::optional<Expected<ValueType, ErrorType>> decode(Decoder& decoder) >+ static Optional<Expected<ValueType, ErrorType>> decode(Decoder& decoder) > { >- std::optional<bool> hasValue; >+ Optional<bool> hasValue; > decoder >> hasValue; > if (!hasValue) >- return std::nullopt; >+ return WTF::nullopt; > > if (*hasValue) { >- std::optional<ValueType> value; >+ Optional<ValueType> value; > decoder >> value; > if (!value) >- return std::nullopt; >+ return WTF::nullopt; > > Expected<ValueType, ErrorType> expected(WTFMove(*value)); > return WTFMove(expected); > } >- std::optional<ErrorType> error; >+ Optional<ErrorType> error; > decoder >> error; > if (!error) >- return std::nullopt; >+ return WTF::nullopt; > return { makeUnexpected(WTFMove(*error)) }; > } > }; >@@ -526,13 +526,13 @@ struct VariantCoder { > VariantCoder<index - 1, Types...>::encode(encoder, variant, i); > } > >- static std::optional<WTF::Variant<Types...>> decode(Decoder& decoder, unsigned i) >+ static Optional<WTF::Variant<Types...>> decode(Decoder& decoder, unsigned i) > { > if (i == index) { >- std::optional<typename WTF::variant_alternative<index, WTF::Variant<Types...>>::type> optional; >+ Optional<typename WTF::variant_alternative<index, WTF::Variant<Types...>>::type> optional; > decoder >> optional; > if (!optional) >- return std::nullopt; >+ return WTF::nullopt; > return { WTFMove(*optional) }; > } > return VariantCoder<index - 1, Types...>::decode(decoder, i); >@@ -547,13 +547,13 @@ struct VariantCoder<0, Types...> { > encoder << WTF::get<0>(variant); > } > >- static std::optional<WTF::Variant<Types...>> decode(Decoder& decoder, unsigned i) >+ static Optional<WTF::Variant<Types...>> decode(Decoder& decoder, unsigned i) > { > ASSERT_UNUSED(i, !i); >- std::optional<typename WTF::variant_alternative<0, WTF::Variant<Types...>>::type> optional; >+ Optional<typename WTF::variant_alternative<0, WTF::Variant<Types...>>::type> optional; > decoder >> optional; > if (!optional) >- return std::nullopt; >+ return WTF::nullopt; > return { WTFMove(*optional) }; > } > }; >@@ -566,12 +566,12 @@ template<typename... Types> struct ArgumentCoder<WTF::Variant<Types...>> { > VariantCoder<sizeof...(Types) - 1, Types...>::encode(encoder, variant, i); > } > >- static std::optional<WTF::Variant<Types...>> decode(Decoder& decoder) >+ static Optional<WTF::Variant<Types...>> decode(Decoder& decoder) > { >- std::optional<unsigned> i; >+ Optional<unsigned> i; > decoder >> i; > if (!i) >- return std::nullopt; >+ return WTF::nullopt; > return VariantCoder<sizeof...(Types) - 1, Types...>::decode(decoder, *i); > } > }; >@@ -579,7 +579,7 @@ template<typename... Types> struct ArgumentCoder<WTF::Variant<Types...>> { > template<> struct ArgumentCoder<WallTime> { > static void encode(Encoder&, const WallTime&); > static bool decode(Decoder&, WallTime&); >- static std::optional<WallTime> decode(Decoder&); >+ static Optional<WallTime> decode(Decoder&); > }; > > template<> struct ArgumentCoder<AtomicString> { >@@ -595,7 +595,7 @@ template<> struct ArgumentCoder<CString> { > template<> struct ArgumentCoder<String> { > static void encode(Encoder&, const String&); > static bool decode(Decoder&, String&); >- static std::optional<String> decode(Decoder&); >+ static Optional<String> decode(Decoder&); > }; > > template<> struct ArgumentCoder<SHA1::Digest> { >diff --git a/Source/WebKit/Platform/IPC/Connection.cpp b/Source/WebKit/Platform/IPC/Connection.cpp >index 188d36cf7c210f8183fbd307ad27081698944fca..a4236cb86cd188e65a2def828b09690281fdecb7 100644 >--- a/Source/WebKit/Platform/IPC/Connection.cpp >+++ b/Source/WebKit/Platform/IPC/Connection.cpp >@@ -961,7 +961,7 @@ void Connection::dispatchMessage(Decoder& decoder) > { > RELEASE_ASSERT(isValid()); > if (decoder.messageReceiverName() == "AsyncReply") { >- std::optional<uint64_t> listenerID; >+ Optional<uint64_t> listenerID; > decoder >> listenerID; > if (!listenerID) { > ASSERT_NOT_REACHED(); >diff --git a/Source/WebKit/Platform/IPC/Connection.h b/Source/WebKit/Platform/IPC/Connection.h >index 0a7b33f30b47a3464f6640cdd01288e2ef7ba6bd..fd0015b6457e4a3f30f276a7fbd0e559463e3f3d 100644 >--- a/Source/WebKit/Platform/IPC/Connection.h >+++ b/Source/WebKit/Platform/IPC/Connection.h >@@ -179,7 +179,7 @@ public: > > template<typename T, typename... Args> void sendWithAsyncReply(T&& message, CompletionHandler<void(Args...)>&& args, uint64_t destinationID = 0); > template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { }); >- template<typename T> void sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler); >+ template<typename T> void sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(Optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler); > template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { }); > template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions = { }); > >@@ -434,7 +434,7 @@ void Connection::sendWithAsyncReply(T&& message, CompletionHandler<void(Args...) > } > > template<typename T> >-void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler) >+void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(Optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler) > { > uint64_t requestID = 0; > std::unique_ptr<Encoder> encoder = createSyncMessageEncoder(T::receiverName(), T::name(), destinationID, requestID); >@@ -450,7 +450,7 @@ void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDisp > } > } > >- replyHandler(std::nullopt); >+ replyHandler(WTF::nullopt); > }); > } > >diff --git a/Source/WebKit/Platform/IPC/Decoder.cpp b/Source/WebKit/Platform/IPC/Decoder.cpp >index 57b18a2046e3d200faab12b2a061b632c3a1a873..154c3d9da901ef7338c09a65cb06af0bf9207c93 100644 >--- a/Source/WebKit/Platform/IPC/Decoder.cpp >+++ b/Source/WebKit/Platform/IPC/Decoder.cpp >@@ -189,7 +189,7 @@ static void decodeValueFromBuffer(Type& value, const uint8_t*& bufferPosition) > } > > template<typename Type> >-Decoder& Decoder::getOptional(std::optional<Type>& optional) >+Decoder& Decoder::getOptional(Optional<Type>& optional) > { > Type result; > if (!alignBufferPosition(sizeof(result), sizeof(result))) >@@ -200,52 +200,52 @@ Decoder& Decoder::getOptional(std::optional<Type>& optional) > return *this; > } > >-Decoder& Decoder::operator>>(std::optional<bool>& optional) >+Decoder& Decoder::operator>>(Optional<bool>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<uint8_t>& optional) >+Decoder& Decoder::operator>>(Optional<uint8_t>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<uint16_t>& optional) >+Decoder& Decoder::operator>>(Optional<uint16_t>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<uint32_t>& optional) >+Decoder& Decoder::operator>>(Optional<uint32_t>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<uint64_t>& optional) >+Decoder& Decoder::operator>>(Optional<uint64_t>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<int16_t>& optional) >+Decoder& Decoder::operator>>(Optional<int16_t>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<int32_t>& optional) >+Decoder& Decoder::operator>>(Optional<int32_t>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<int64_t>& optional) >+Decoder& Decoder::operator>>(Optional<int64_t>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<float>& optional) >+Decoder& Decoder::operator>>(Optional<float>& optional) > { > return getOptional(optional); > } > >-Decoder& Decoder::operator>>(std::optional<double>& optional) >+Decoder& Decoder::operator>>(Optional<double>& optional) > { > return getOptional(optional); > } >diff --git a/Source/WebKit/Platform/IPC/Decoder.h b/Source/WebKit/Platform/IPC/Decoder.h >index b788244a4e47aa80bf667fb1b5d9e79cc67aafee..9471788826e0f146f0fe1686eb9b9c48e569abbd 100644 >--- a/Source/WebKit/Platform/IPC/Decoder.h >+++ b/Source/WebKit/Platform/IPC/Decoder.h >@@ -78,25 +78,25 @@ public: > bool decodeVariableLengthByteArray(DataReference&); > > bool decode(bool&); >- Decoder& operator>>(std::optional<bool>&); >+ Decoder& operator>>(Optional<bool>&); > bool decode(uint8_t&); >- Decoder& operator>>(std::optional<uint8_t>&); >+ Decoder& operator>>(Optional<uint8_t>&); > bool decode(uint16_t&); >- Decoder& operator>>(std::optional<uint16_t>&); >+ Decoder& operator>>(Optional<uint16_t>&); > bool decode(uint32_t&); >- Decoder& operator>>(std::optional<uint32_t>&); >+ Decoder& operator>>(Optional<uint32_t>&); > bool decode(uint64_t&); >- Decoder& operator>>(std::optional<uint64_t>&); >+ Decoder& operator>>(Optional<uint64_t>&); > bool decode(int16_t&); >- Decoder& operator>>(std::optional<int16_t>&); >+ Decoder& operator>>(Optional<int16_t>&); > bool decode(int32_t&); >- Decoder& operator>>(std::optional<int32_t>&); >+ Decoder& operator>>(Optional<int32_t>&); > bool decode(int64_t&); >- Decoder& operator>>(std::optional<int64_t>&); >+ Decoder& operator>>(Optional<int64_t>&); > bool decode(float&); >- Decoder& operator>>(std::optional<float>&); >+ Decoder& operator>>(Optional<float>&); > bool decode(double&); >- Decoder& operator>>(std::optional<double>&); >+ Decoder& operator>>(Optional<double>&); > > template<typename E> > auto decode(E& e) -> std::enable_if_t<std::is_enum<E>::value, bool> >@@ -112,9 +112,9 @@ public: > } > > template<typename E, std::enable_if_t<std::is_enum<E>::value>* = nullptr> >- Decoder& operator>>(std::optional<E>& optional) >+ Decoder& operator>>(Optional<E>& optional) > { >- std::optional<uint64_t> value; >+ Optional<uint64_t> value; > *this >> value; > if (value && isValidEnum<E>(*value)) > optional = static_cast<E>(*value); >@@ -151,7 +151,7 @@ public: > } > > template<typename T, std::enable_if_t<UsesModernDecoder<T>::value>* = nullptr> >- Decoder& operator>>(std::optional<T>& t) >+ Decoder& operator>>(Optional<T>& t) > { > t = ArgumentCoder<T>::decode(*this); > return *this; >@@ -164,7 +164,7 @@ public: > private: > bool alignBufferPosition(unsigned alignment, size_t); > bool bufferIsLargeEnoughToContain(unsigned alignment, size_t) const; >- template<typename Type> Decoder& getOptional(std::optional<Type>&); >+ template<typename Type> Decoder& getOptional(Optional<Type>&); > > const uint8_t* m_buffer; > const uint8_t* m_bufferPos; >diff --git a/Source/WebKit/Platform/IPC/FormDataReference.h b/Source/WebKit/Platform/IPC/FormDataReference.h >index a4d89bcbf6f32147e17711f09d4ea9eccf364d21..8a395a65713a19a32e33df8d6c89c93a684c0635 100644 >--- a/Source/WebKit/Platform/IPC/FormDataReference.h >+++ b/Source/WebKit/Platform/IPC/FormDataReference.h >@@ -67,23 +67,23 @@ public: > encoder << sandboxExtensionHandles; > } > >- static std::optional<FormDataReference> decode(Decoder& decoder) >+ static Optional<FormDataReference> decode(Decoder& decoder) > { >- std::optional<bool> hasFormData; >+ Optional<bool> hasFormData; > decoder >> hasFormData; > if (!hasFormData) >- return std::nullopt; >+ return WTF::nullopt; > if (!hasFormData.value()) > return FormDataReference { }; > > auto formData = WebCore::FormData::decode(decoder); > if (!formData) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WebKit::SandboxExtension::HandleArray> sandboxExtensionHandles; >+ Optional<WebKit::SandboxExtension::HandleArray> sandboxExtensionHandles; > decoder >> sandboxExtensionHandles; > if (!sandboxExtensionHandles) >- return std::nullopt; >+ return WTF::nullopt; > > for (size_t i = 0; i < sandboxExtensionHandles->size(); ++i) > WebKit::SandboxExtension::consumePermanently(sandboxExtensionHandles->at(i)); >diff --git a/Source/WebKit/Platform/IPC/HandleMessage.h b/Source/WebKit/Platform/IPC/HandleMessage.h >index 32c12cb60d512d6c9a4bf420ac078eca14fe3d73..393973077716c9386018da6e683feae128a94426 100644 >--- a/Source/WebKit/Platform/IPC/HandleMessage.h >+++ b/Source/WebKit/Platform/IPC/HandleMessage.h >@@ -190,7 +190,7 @@ void handleMessageDelayed(Connection& connection, Decoder& decoder, std::unique_ > template<typename T, typename C, typename MF> > void handleMessageAsync(Connection& connection, Decoder& decoder, C* object, MF function) > { >- std::optional<uint64_t> listenerID; >+ Optional<uint64_t> listenerID; > decoder >> listenerID; > if (!listenerID) { > ASSERT(decoder.isInvalid()); >diff --git a/Source/WebKit/Platform/LogInitialization.h b/Source/WebKit/Platform/LogInitialization.h >index 256a4597318d11adede075b1e1215fd63cfeaf81..e8b64ce2f5402fa5a0f1697696813396e3e6733b 100644 >--- a/Source/WebKit/Platform/LogInitialization.h >+++ b/Source/WebKit/Platform/LogInitialization.h >@@ -31,7 +31,7 @@ > > namespace WebKit { > >-void initializeLogChannelsIfNecessary(std::optional<String> = std::nullopt); >+void initializeLogChannelsIfNecessary(Optional<String> = WTF::nullopt); > String logLevelString(); > > } // namespace WebKit >diff --git a/Source/WebKit/Platform/Logging.cpp b/Source/WebKit/Platform/Logging.cpp >index 6ad6f0eb7e2c3b76c1b7edb28bf5edb40474424d..5f7d6eeef10004c2b3bdc8dabcebb1e12392260f 100644 >--- a/Source/WebKit/Platform/Logging.cpp >+++ b/Source/WebKit/Platform/Logging.cpp >@@ -44,7 +44,7 @@ namespace WebKit { > static const size_t logChannelCount = WTF_ARRAY_LENGTH(logChannels); > static bool logChannelsNeedInitialization = true; > >-void initializeLogChannelsIfNecessary(std::optional<String> logChannelString) >+void initializeLogChannelsIfNecessary(Optional<String> logChannelString) > { > if (!logChannelsNeedInitialization && !logChannelString) > return; >diff --git a/Source/WebKit/Platform/SharedMemory.h b/Source/WebKit/Platform/SharedMemory.h >index 1dc5afcfdaed4c2aca06bfb4374ebfc6653f8ded..769adc18796e38710b0c10f028ca9e5514f87765 100644 >--- a/Source/WebKit/Platform/SharedMemory.h >+++ b/Source/WebKit/Platform/SharedMemory.h >@@ -131,7 +131,7 @@ private: > #endif > > #if USE(UNIX_DOMAIN_SOCKETS) >- std::optional<int> m_fileDescriptor; >+ Optional<int> m_fileDescriptor; > bool m_isWrappingMap { false }; > #elif OS(DARWIN) > mach_port_t m_port { MACH_PORT_NULL }; >diff --git a/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp b/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >index b6f7fc3822f669efb57428e694b725a977b766b1..acfbe3cdbc1c3a951f72370bd5987e472e8d4c25 100644 >--- a/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >+++ b/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >@@ -103,7 +103,7 @@ bool ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction() > > const struct svm_model* ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel() > { >- static std::optional<struct svm_model*> corePredictionModel; >+ static Optional<struct svm_model*> corePredictionModel; > static dispatch_once_t onceToken; > dispatch_once(&onceToken, ^{ > auto path = storagePath(); >diff --git a/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp b/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp >index 9d5c8dbd2fbc562da0cf5365f22be5086da6e1f8..6f18da0b7d21748c4d001f6806d20ffc68d333bf 100644 >--- a/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp >+++ b/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp >@@ -187,7 +187,7 @@ RefPtr<SharedMemory> SharedMemory::map(const Handle& handle, Protection protecti > return nullptr; > > RefPtr<SharedMemory> instance = wrapMap(data, handle.m_attachment.size(), -1); >- instance->m_fileDescriptor = std::nullopt; >+ instance->m_fileDescriptor = WTF::nullopt; > instance->m_isWrappingMap = false; > return instance; > } >diff --git a/Source/WebKit/Scripts/webkit/MessageReceiverSuperclass-expected.cpp b/Source/WebKit/Scripts/webkit/MessageReceiverSuperclass-expected.cpp >index 9e6f5d2d8b6268e93423476d255007bc05203908..20748c8c3bf35966d440c31e49dd12676a43b048 100644 >--- a/Source/WebKit/Scripts/webkit/MessageReceiverSuperclass-expected.cpp >+++ b/Source/WebKit/Scripts/webkit/MessageReceiverSuperclass-expected.cpp >@@ -45,7 +45,7 @@ namespace WebPage { > > void TestAsyncMessage::callReply(IPC::Decoder& decoder, CompletionHandler<void(uint64_t&&)>&& completionHandler) > { >- std::optional<uint64_t> result; >+ Optional<uint64_t> result; > decoder >> result; > if (!result) { > ASSERT_NOT_REACHED(); >@@ -90,13 +90,13 @@ void TestAsyncMessageWithNoArguments::send(std::unique_ptr<IPC::Encoder>&& encod > > void TestAsyncMessageWithMultipleArguments::callReply(IPC::Decoder& decoder, CompletionHandler<void(bool&&, uint64_t&&)>&& completionHandler) > { >- std::optional<bool> flag; >+ Optional<bool> flag; > decoder >> flag; > if (!flag) { > ASSERT_NOT_REACHED(); > return; > } >- std::optional<uint64_t> value; >+ Optional<uint64_t> value; > decoder >> value; > if (!value) { > ASSERT_NOT_REACHED(); >@@ -119,7 +119,7 @@ void TestAsyncMessageWithMultipleArguments::send(std::unique_ptr<IPC::Encoder>&& > > #endif > >-void TestDelayedMessage::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const std::optional<WebKit::TestClassName>& optionalReply) >+void TestDelayedMessage::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const Optional<WebKit::TestClassName>& optionalReply) > { > *encoder << optionalReply; > connection.sendSyncReply(WTFMove(encoder)); >diff --git a/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h b/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h >index d63971c62277683502d38154e1feab073fab9707..bc41a73f410d55edea82a9da2cfd14d7acd072fe 100644 >--- a/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h >+++ b/Source/WebKit/Scripts/webkit/MessagesSuperclass-expected.h >@@ -180,9 +180,9 @@ public: > static IPC::StringReference name() { return IPC::StringReference("TestDelayedMessage"); } > static const bool isSync = true; > >- using DelayedReply = CompletionHandler<void(const std::optional<WebKit::TestClassName>& optionalReply)>; >- static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const std::optional<WebKit::TestClassName>& optionalReply); >- typedef std::tuple<std::optional<WebKit::TestClassName>&> Reply; >+ using DelayedReply = CompletionHandler<void(const Optional<WebKit::TestClassName>& optionalReply)>; >+ static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Optional<WebKit::TestClassName>& optionalReply); >+ typedef std::tuple<Optional<WebKit::TestClassName>&> Reply; > explicit TestDelayedMessage(bool value) > : m_arguments(value) > { >diff --git a/Source/WebKit/Scripts/webkit/messages.py b/Source/WebKit/Scripts/webkit/messages.py >index b52137b86566b372047eea70f03726e8833ba813..c481f337fbdbd15f702532c41c4105f39233dfa1 100644 >--- a/Source/WebKit/Scripts/webkit/messages.py >+++ b/Source/WebKit/Scripts/webkit/messages.py >@@ -328,7 +328,7 @@ def class_template_headers(template_string): > 'WebCore::RectEdges': {'headers': ['<WebCore/RectEdges.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, > 'HashMap': {'headers': ['<wtf/HashMap.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, > 'HashSet': {'headers': ['<wtf/HashSet.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, >- 'std::optional': {'headers': ['<wtf/Optional.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, >+ 'Optional': {'headers': ['<wtf/Optional.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, > 'OptionSet': {'headers': ['<wtf/OptionSet.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, > 'Vector': {'headers': ['<wtf/Vector.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, > 'std::pair': {'headers': ['<utility>'], 'argument_coder_headers': ['"ArgumentCoders.h"']}, >@@ -563,7 +563,7 @@ def generate_message_handler(file): > move_parameters = message.name, ', '.join([move_type(x.type) for x in message.reply_parameters]) > result.append('void %s::callReply(IPC::Decoder& decoder, CompletionHandler<void(%s)>&& completionHandler)\n{\n' % move_parameters) > for x in message.reply_parameters: >- result.append(' std::optional<%s> %s;\n' % (x.type, x.name)) >+ result.append(' Optional<%s> %s;\n' % (x.type, x.name)) > result.append(' decoder >> %s;\n' % x.name) > result.append(' if (!%s) {\n ASSERT_NOT_REACHED();\n return;\n }\n' % x.name) > result.append(' completionHandler(') >diff --git a/Source/WebKit/Scripts/webkit/messages_unittest.py b/Source/WebKit/Scripts/webkit/messages_unittest.py >index e8d8f00fbee2c8e799a2d5b9456844a204885e0a..02ff9198c5b6c70460c6b7e58999c8f4be08cebc 100644 >--- a/Source/WebKit/Scripts/webkit/messages_unittest.py >+++ b/Source/WebKit/Scripts/webkit/messages_unittest.py >@@ -285,7 +285,7 @@ _expected_superclass_results = { > ('bool', 'value'), > ), > 'reply_parameters': ( >- ('std::optional<WebKit::TestClassName>', 'optionalReply'), >+ ('Optional<WebKit::TestClassName>', 'optionalReply'), > ), > 'conditions': (None), > }, >diff --git a/Source/WebKit/Scripts/webkit/test-superclass-messages.in b/Source/WebKit/Scripts/webkit/test-superclass-messages.in >index c5a055d06107bb96edc35b07a2b9117a48ad9b16..a8299824aac0cdc6ed9d7ff96849164da08bc646 100644 >--- a/Source/WebKit/Scripts/webkit/test-superclass-messages.in >+++ b/Source/WebKit/Scripts/webkit/test-superclass-messages.in >@@ -28,5 +28,5 @@ messages -> WebPage : WebPageBase { > TestAsyncMessageWithMultipleArguments() -> (bool flag, uint64_t value) Async > #endif > TestSyncMessage(uint32_t param) -> (uint8_t reply) Sync >- TestDelayedMessage(bool value) -> (std::optional<WebKit::TestClassName> optionalReply) Delayed >+ TestDelayedMessage(bool value) -> (Optional<WebKit::TestClassName> optionalReply) Delayed > } >diff --git a/Source/WebKit/Shared/API/APIPageGroupHandle.cpp b/Source/WebKit/Shared/API/APIPageGroupHandle.cpp >index 84db40809ee5f17a9ab0b09cd2645bf1b7df6e15..db9bcd9db7a7bd9e4b1200372b490afdebfae444 100644 >--- a/Source/WebKit/Shared/API/APIPageGroupHandle.cpp >+++ b/Source/WebKit/Shared/API/APIPageGroupHandle.cpp >@@ -52,7 +52,7 @@ void PageGroupHandle::encode(IPC::Encoder& encoder) const > > bool PageGroupHandle::decode(IPC::Decoder& decoder, RefPtr<Object>& result) > { >- std::optional<WebKit::WebPageGroupData> webPageGroupData; >+ Optional<WebKit::WebPageGroupData> webPageGroupData; > decoder >> webPageGroupData; > if (!webPageGroupData) > return false; >diff --git a/Source/WebKit/Shared/API/APISecurityOrigin.h b/Source/WebKit/Shared/API/APISecurityOrigin.h >index b3893a158d78dfbcf2a7fba4a4838974646679cf..6ec00c462bce39aa9d184702911cae0680b910a8 100644 >--- a/Source/WebKit/Shared/API/APISecurityOrigin.h >+++ b/Source/WebKit/Shared/API/APISecurityOrigin.h >@@ -38,7 +38,7 @@ public: > return create(WebCore::SecurityOrigin::createFromString(string)); > } > >- static Ref<SecurityOrigin> create(const WTF::String& protocol, const WTF::String& host, std::optional<uint16_t> port) >+ static Ref<SecurityOrigin> create(const WTF::String& protocol, const WTF::String& host, Optional<uint16_t> port) > { > return create(WebCore::SecurityOrigin::create(protocol, host, port)); > } >diff --git a/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectInterface.mm b/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectInterface.mm >index e7d804f2a766151986cb88ba9191ea9bcd72b1bb..6e28a2a76c94c6f78e9f7e12ac90be8e5928106c 100644 >--- a/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectInterface.mm >+++ b/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectInterface.mm >@@ -53,7 +53,7 @@ struct MethodInfo { > CString replySignature; > Vector<HashSet<CFTypeRef>> allowedReplyClasses; > }; >- std::optional<ReplyInfo> replyInfo; >+ Optional<ReplyInfo> replyInfo; > }; > > @implementation _WKRemoteObjectInterface { >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.cpp b/Source/WebKit/Shared/AssistedNodeInformation.cpp >index 5134791800315060a9ce8ff2cbaed31e93f22a72..744148af53662bc69298dadc5778a239548b967b 100644 >--- a/Source/WebKit/Shared/AssistedNodeInformation.cpp >+++ b/Source/WebKit/Shared/AssistedNodeInformation.cpp >@@ -40,23 +40,23 @@ void OptionItem::encode(IPC::Encoder& encoder) const > encoder << parentGroupID; > } > >-std::optional<OptionItem> OptionItem::decode(IPC::Decoder& decoder) >+Optional<OptionItem> OptionItem::decode(IPC::Decoder& decoder) > { > OptionItem result; > if (!decoder.decode(result.text)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.isGroup)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.isSelected)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.disabled)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.parentGroupID)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.h b/Source/WebKit/Shared/AssistedNodeInformation.h >index 9b1c3b0145f83f794851774e96b8586ae72d8d19..6b04f49aabf63faf05c89eb1e2856ad0f7357793 100644 >--- a/Source/WebKit/Shared/AssistedNodeInformation.h >+++ b/Source/WebKit/Shared/AssistedNodeInformation.h >@@ -90,7 +90,7 @@ struct OptionItem { > int parentGroupID { 0 }; > > void encode(IPC::Encoder&) const; >- static std::optional<OptionItem> decode(IPC::Decoder&); >+ static Optional<OptionItem> decode(IPC::Decoder&); > }; > > struct AssistedNodeInformation { >diff --git a/Source/WebKit/Shared/CallbackID.h b/Source/WebKit/Shared/CallbackID.h >index 8f18d4dcf770cb901a99f63a9af55a46f6c5cee3..16c3359af2581169a93bbbcdd67865f35fb1e185 100644 >--- a/Source/WebKit/Shared/CallbackID.h >+++ b/Source/WebKit/Shared/CallbackID.h >@@ -75,12 +75,12 @@ public: > encoder << m_id; > } > >- template<class Decoder> static std::optional<CallbackID> decode(Decoder& decoder) >+ template<class Decoder> static Optional<CallbackID> decode(Decoder& decoder) > { >- std::optional<uint64_t> identifier; >+ Optional<uint64_t> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > RELEASE_ASSERT(isValidCallbackID(*identifier)); > return fromInteger(*identifier); > } >diff --git a/Source/WebKit/Shared/ChildProcess.h b/Source/WebKit/Shared/ChildProcess.h >index a72bc929dbd7c74c22669b82317a61ffabdf3769..6b96d48d7cbc96a35f37fd923bccd0343207a0ba 100644 >--- a/Source/WebKit/Shared/ChildProcess.h >+++ b/Source/WebKit/Shared/ChildProcess.h >@@ -152,7 +152,7 @@ private: > struct ChildProcessInitializationParameters { > String uiProcessName; > String clientIdentifier; >- std::optional<WebCore::ProcessIdentifier> processIdentifier; >+ Optional<WebCore::ProcessIdentifier> processIdentifier; > IPC::Connection::Identifier connectionIdentifier; > HashMap<String, String> extraInitializationData; > ChildProcess::ProcessType processType; >diff --git a/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h b/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h >index d85d38886ea0eb5ea13326aa550aee33844ad865..976d3812285deefbe30221ebeb345efde11cc2f0 100644 >--- a/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h >+++ b/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h >@@ -32,13 +32,13 @@ > namespace IPC { > > void encodeObject(Encoder&, id <NSSecureCoding>); >-std::optional<RetainPtr<id <NSSecureCoding>>> decodeObject(Decoder&, NSArray<Class> *allowedClasses); >+Optional<RetainPtr<id <NSSecureCoding>>> decodeObject(Decoder&, NSArray<Class> *allowedClasses); > >-template<typename T> std::optional<RetainPtr<T>> decode(Decoder&, Class allowedClass); >-template<typename T> std::optional<RetainPtr<T>> decode(Decoder&, NSArray<Class> *allowedClasses = @[ [T class] ]); >+template<typename T> Optional<RetainPtr<T>> decode(Decoder&, Class allowedClass); >+template<typename T> Optional<RetainPtr<T>> decode(Decoder&, NSArray<Class> *allowedClasses = @[ [T class] ]); > > template<typename T> >-std::optional<RetainPtr<T>> decode(Decoder& decoder, Class allowedClass) >+Optional<RetainPtr<T>> decode(Decoder& decoder, Class allowedClass) > { > return decode<T>(decoder, @[ allowedClass ]); > } >@@ -57,11 +57,11 @@ static inline bool isObjectClassAllowed(id object, NSArray<Class> *allowedClasse > #endif > > template<typename T> >-std::optional<RetainPtr<T>> decode(Decoder& decoder, NSArray<Class> *allowedClasses) >+Optional<RetainPtr<T>> decode(Decoder& decoder, NSArray<Class> *allowedClasses) > { > auto result = decodeObject(decoder, allowedClasses); > if (!result) >- return std::nullopt; >+ return WTF::nullopt; > > if (!*result) > return { nullptr }; >@@ -89,7 +89,7 @@ template<typename T> struct ArgumentCoder<RetainPtr<T>> { > } > > template <typename U = T, std::enable_if_t<ConformsToSecureCoding<U>::value>* = nullptr> >- static std::optional<RetainPtr<U>> decode(Decoder& decoder) >+ static Optional<RetainPtr<U>> decode(Decoder& decoder) > { > return IPC::decode<U>(decoder); > } >diff --git a/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm b/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm >index ca2049b1f39d78feebc26b452dcc9ca42bcfafba..cc4bcd33f2daff04f662c08ba0e91a47ddd62fa7 100644 >--- a/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm >+++ b/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm >@@ -42,11 +42,11 @@ void encodeObject(Encoder& encoder, id <NSSecureCoding> object) > IPC::encode(encoder, (__bridge CFDataRef)[archiver encodedData]); > } > >-std::optional<RetainPtr<id <NSSecureCoding>>> decodeObject(Decoder& decoder, NSArray<Class> *allowedClasses) >+Optional<RetainPtr<id <NSSecureCoding>>> decodeObject(Decoder& decoder, NSArray<Class> *allowedClasses) > { > RetainPtr<CFDataRef> data; > if (!decode(decoder, data)) >- return std::nullopt; >+ return WTF::nullopt; > > auto unarchiver = secureUnarchiverFromData((__bridge NSData *)data.get()); > @try { >@@ -55,7 +55,7 @@ std::optional<RetainPtr<id <NSSecureCoding>>> decodeObject(Decoder& decoder, NSA > return { result }; > } @catch (NSException *exception) { > LOG_ERROR("Failed to decode object of classes %@: %@", allowedClasses, exception); >- return std::nullopt; >+ return WTF::nullopt; > } @finally { > [unarchiver finishDecoding]; > } >diff --git a/Source/WebKit/Shared/Cocoa/DataDetectionResult.h b/Source/WebKit/Shared/Cocoa/DataDetectionResult.h >index a0888f91896b495da82f970b86ad510cf5ad3cef..736f90e108a60f7e55c9d8814177cc56163babc0 100644 >--- a/Source/WebKit/Shared/Cocoa/DataDetectionResult.h >+++ b/Source/WebKit/Shared/Cocoa/DataDetectionResult.h >@@ -38,7 +38,7 @@ struct DataDetectionResult { > RetainPtr<NSArray> results; > > void encode(IPC::Encoder&) const; >- static std::optional<DataDetectionResult> decode(IPC::Decoder&); >+ static Optional<DataDetectionResult> decode(IPC::Decoder&); > }; > > } >diff --git a/Source/WebKit/Shared/Cocoa/DataDetectionResult.mm b/Source/WebKit/Shared/Cocoa/DataDetectionResult.mm >index 8de67a170b25c5eacf3cadc36722616fba42f865..9d2a3cde8e2a34f3e55cfc4cc19c4801deff0e59 100644 >--- a/Source/WebKit/Shared/Cocoa/DataDetectionResult.mm >+++ b/Source/WebKit/Shared/Cocoa/DataDetectionResult.mm >@@ -44,11 +44,11 @@ void DataDetectionResult::encode(IPC::Encoder& encoder) const > encoder << results; > } > >-std::optional<DataDetectionResult> DataDetectionResult::decode(IPC::Decoder& decoder) >+Optional<DataDetectionResult> DataDetectionResult::decode(IPC::Decoder& decoder) > { > auto results = IPC::decode<NSArray>(decoder, @[ [NSArray class], getDDScannerResultClass() ]); > if (!results) >- return std::nullopt; >+ return WTF::nullopt; > > DataDetectionResult result; > result.results = WTFMove(*results); >diff --git a/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm b/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm >index 0dd5d3c41834483a2c2f8fff3075f7e1759c5698..960928fbb2128bf950ab9de0f16cc87ea959bcee 100644 >--- a/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm >+++ b/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm >@@ -42,11 +42,11 @@ void ArgumentCoder<WebCore::Payment>::encode(Encoder& encoder, const WebCore::Pa > encoder << payment.pkPayment(); > } > >-std::optional<WebCore::Payment> ArgumentCoder<WebCore::Payment>::decode(Decoder& decoder) >+Optional<WebCore::Payment> ArgumentCoder<WebCore::Payment>::decode(Decoder& decoder) > { > auto payment = IPC::decode<PKPayment>(decoder, PAL::getPKPaymentClass()); > if (!payment) >- return std::nullopt; >+ return WTF::nullopt; > > return Payment { WTFMove(*payment) }; > } >@@ -57,17 +57,17 @@ void ArgumentCoder<WebCore::PaymentAuthorizationResult>::encode(Encoder& encoder > encoder << result.errors; > } > >-std::optional<WebCore::PaymentAuthorizationResult> ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode(Decoder& decoder) >+Optional<WebCore::PaymentAuthorizationResult> ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode(Decoder& decoder) > { >- std::optional<PaymentAuthorizationStatus> status; >+ Optional<PaymentAuthorizationStatus> status; > decoder >> status; > if (!status) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<PaymentError>> errors; >+ Optional<Vector<PaymentError>> errors; > decoder >> errors; > if (!errors) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*status), WTFMove(*errors) }}; > } >@@ -77,11 +77,11 @@ void ArgumentCoder<WebCore::PaymentContact>::encode(Encoder& encoder, const WebC > encoder << paymentContact.pkContact(); > } > >-std::optional<WebCore::PaymentContact> ArgumentCoder<WebCore::PaymentContact>::decode(Decoder& decoder) >+Optional<WebCore::PaymentContact> ArgumentCoder<WebCore::PaymentContact>::decode(Decoder& decoder) > { > auto contact = IPC::decode<PKContact>(decoder, PAL::getPKContactClass()); > if (!contact) >- return std::nullopt; >+ return WTF::nullopt; > > return WebCore::PaymentContact { WTFMove(*contact) }; > } >@@ -93,22 +93,22 @@ void ArgumentCoder<WebCore::PaymentError>::encode(Encoder& encoder, const WebCor > encoder << error.contactField; > } > >-std::optional<WebCore::PaymentError> ArgumentCoder<WebCore::PaymentError>::decode(Decoder& decoder) >+Optional<WebCore::PaymentError> ArgumentCoder<WebCore::PaymentError>::decode(Decoder& decoder) > { >- std::optional<WebCore::PaymentError::Code> code; >+ Optional<WebCore::PaymentError::Code> code; > decoder >> code; > if (!code) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> message; >+ Optional<String> message; > decoder >> message; > if (!message) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<WebCore::PaymentError::ContactField>> contactField; >+ Optional<Optional<WebCore::PaymentError::ContactField>> contactField; > decoder >> contactField; > if (!contactField) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*code), WTFMove(*message), WTFMove(*contactField) }}; > } >@@ -118,11 +118,11 @@ void ArgumentCoder<WebCore::PaymentMerchantSession>::encode(Encoder& encoder, co > encoder << paymentMerchantSession.pkPaymentMerchantSession(); > } > >-std::optional<WebCore::PaymentMerchantSession> ArgumentCoder<WebCore::PaymentMerchantSession>::decode(Decoder& decoder) >+Optional<WebCore::PaymentMerchantSession> ArgumentCoder<WebCore::PaymentMerchantSession>::decode(Decoder& decoder) > { > auto paymentMerchantSession = IPC::decode<PKPaymentMerchantSession>(decoder, PAL::getPKPaymentMerchantSessionClass()); > if (!paymentMerchantSession) >- return std::nullopt; >+ return WTF::nullopt; > > return WebCore::PaymentMerchantSession { WTFMove(*paymentMerchantSession) }; > } >@@ -132,11 +132,11 @@ void ArgumentCoder<WebCore::PaymentMethod>::encode(Encoder& encoder, const WebCo > encoder << paymentMethod.pkPaymentMethod(); > } > >-std::optional<WebCore::PaymentMethod> ArgumentCoder<WebCore::PaymentMethod>::decode(Decoder& decoder) >+Optional<WebCore::PaymentMethod> ArgumentCoder<WebCore::PaymentMethod>::decode(Decoder& decoder) > { > auto paymentMethod = IPC::decode<PKPaymentMethod>(decoder, PAL::getPKPaymentMethodClass()); > if (!paymentMethod) >- return std::nullopt; >+ return WTF::nullopt; > > return PaymentMethod { WTFMove(*paymentMethod) }; > } >@@ -146,12 +146,12 @@ void ArgumentCoder<WebCore::PaymentMethodUpdate>::encode(Encoder& encoder, const > encoder << update.newTotalAndLineItems; > } > >-std::optional<WebCore::PaymentMethodUpdate> ArgumentCoder<WebCore::PaymentMethodUpdate>::decode(Decoder& decoder) >+Optional<WebCore::PaymentMethodUpdate> ArgumentCoder<WebCore::PaymentMethodUpdate>::decode(Decoder& decoder) > { >- std::optional<ApplePaySessionPaymentRequest::TotalAndLineItems> newTotalAndLineItems; >+ Optional<ApplePaySessionPaymentRequest::TotalAndLineItems> newTotalAndLineItems; > decoder >> newTotalAndLineItems; > if (!newTotalAndLineItems) >- return std::nullopt; >+ return WTF::nullopt; > return {{ WTFMove(*newTotalAndLineItems) }}; > } > >@@ -191,7 +191,7 @@ bool ArgumentCoder<ApplePaySessionPaymentRequest>::decode(Decoder& decoder, Appl > return false; > request.setRequiredBillingContactFields(requiredBillingContactFields); > >- std::optional<PaymentContact> billingContact; >+ Optional<PaymentContact> billingContact; > decoder >> billingContact; > if (!billingContact) > return false; >@@ -202,7 +202,7 @@ bool ArgumentCoder<ApplePaySessionPaymentRequest>::decode(Decoder& decoder, Appl > return false; > request.setRequiredShippingContactFields(requiredShippingContactFields); > >- std::optional<PaymentContact> shippingContact; >+ Optional<PaymentContact> shippingContact; > decoder >> shippingContact; > if (!shippingContact) > return false; >@@ -233,7 +233,7 @@ bool ArgumentCoder<ApplePaySessionPaymentRequest>::decode(Decoder& decoder, Appl > return false; > request.setLineItems(lineItems); > >- std::optional<ApplePaySessionPaymentRequest::LineItem> total; >+ Optional<ApplePaySessionPaymentRequest::LineItem> total; > decoder >> total; > if (!total) > return false; >@@ -289,15 +289,15 @@ void ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode(Encoder& enc > encoder << lineItem.amount; > } > >-std::optional<ApplePaySessionPaymentRequest::LineItem> ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode(Decoder& decoder) >+Optional<ApplePaySessionPaymentRequest::LineItem> ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode(Decoder& decoder) > { > WebCore::ApplePaySessionPaymentRequest::LineItem lineItem; > if (!decoder.decodeEnum(lineItem.type)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(lineItem.label)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(lineItem.amount)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(lineItem); > } >@@ -332,17 +332,17 @@ void ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::encode(Encode > encoder << shippingMethod.identifier; > } > >-std::optional<ApplePaySessionPaymentRequest::ShippingMethod> ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode(Decoder& decoder) >+Optional<ApplePaySessionPaymentRequest::ShippingMethod> ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode(Decoder& decoder) > { > ApplePaySessionPaymentRequest::ShippingMethod shippingMethod; > if (!decoder.decode(shippingMethod.label)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(shippingMethod.detail)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(shippingMethod.amount)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(shippingMethod.identifier)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(shippingMethod); > } > >@@ -352,17 +352,17 @@ void ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::encode(Enc > encoder << totalAndLineItems.lineItems; > } > >-std::optional<ApplePaySessionPaymentRequest::TotalAndLineItems> ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode(Decoder& decoder) >+Optional<ApplePaySessionPaymentRequest::TotalAndLineItems> ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode(Decoder& decoder) > { >- std::optional<ApplePaySessionPaymentRequest::LineItem> total; >+ Optional<ApplePaySessionPaymentRequest::LineItem> total; > decoder >> total; > if (!total) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<ApplePaySessionPaymentRequest::LineItem>> lineItems; >+ Optional<Vector<ApplePaySessionPaymentRequest::LineItem>> lineItems; > decoder >> lineItems; > if (!lineItems) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*total), WTFMove(*lineItems) }}; > } >@@ -374,22 +374,22 @@ void ArgumentCoder<WebCore::ShippingContactUpdate>::encode(Encoder& encoder, con > encoder << update.newTotalAndLineItems; > } > >-std::optional<WebCore::ShippingContactUpdate> ArgumentCoder<WebCore::ShippingContactUpdate>::decode(Decoder& decoder) >+Optional<WebCore::ShippingContactUpdate> ArgumentCoder<WebCore::ShippingContactUpdate>::decode(Decoder& decoder) > { >- std::optional<Vector<PaymentError>> errors; >+ Optional<Vector<PaymentError>> errors; > decoder >> errors; > if (!errors) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<ApplePaySessionPaymentRequest::ShippingMethod>> newShippingMethods; >+ Optional<Vector<ApplePaySessionPaymentRequest::ShippingMethod>> newShippingMethods; > decoder >> newShippingMethods; > if (!newShippingMethods) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<ApplePaySessionPaymentRequest::TotalAndLineItems> newTotalAndLineItems; >+ Optional<ApplePaySessionPaymentRequest::TotalAndLineItems> newTotalAndLineItems; > decoder >> newTotalAndLineItems; > if (!newTotalAndLineItems) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*errors), WTFMove(*newShippingMethods), WTFMove(*newTotalAndLineItems) }}; > } >@@ -399,12 +399,12 @@ void ArgumentCoder<WebCore::ShippingMethodUpdate>::encode(Encoder& encoder, cons > encoder << update.newTotalAndLineItems; > } > >-std::optional<WebCore::ShippingMethodUpdate> ArgumentCoder<WebCore::ShippingMethodUpdate>::decode(Decoder& decoder) >+Optional<WebCore::ShippingMethodUpdate> ArgumentCoder<WebCore::ShippingMethodUpdate>::decode(Decoder& decoder) > { >- std::optional<ApplePaySessionPaymentRequest::TotalAndLineItems> newTotalAndLineItems; >+ Optional<ApplePaySessionPaymentRequest::TotalAndLineItems> newTotalAndLineItems; > decoder >> newTotalAndLineItems; > if (!newTotalAndLineItems) >- return std::nullopt; >+ return WTF::nullopt; > return {{ WTFMove(*newTotalAndLineItems) }}; > } > >diff --git a/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.cpp b/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.cpp >index a5d5b74c59760b7b5ecdd023d1ace06c846dccd5..e74a2021b84ee516c39adaaf0158635a592d0af3 100644 >--- a/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.cpp >+++ b/Source/WebKit/Shared/Databases/IndexedDB/WebIDBResult.cpp >@@ -40,13 +40,13 @@ void WebIDBResult::encode(IPC::Encoder& encoder) const > > bool WebIDBResult::decode(IPC::Decoder& decoder, WebIDBResult& result) > { >- std::optional<WebCore::IDBResultData> resultData; >+ Optional<WebCore::IDBResultData> resultData; > decoder >> resultData; > if (!resultData) > return false; > result.m_resultData = WTFMove(*resultData); > >- std::optional<SandboxExtension::HandleArray> handles; >+ Optional<SandboxExtension::HandleArray> handles; > decoder >> handles; > if (!handles) > return false; >diff --git a/Source/WebKit/Shared/EditorState.cpp b/Source/WebKit/Shared/EditorState.cpp >index c8c8f89853e9abcc7e3f41504e01830345645e28..d319748c8da1818c99a58d6261baf6c9ab435b38 100644 >--- a/Source/WebKit/Shared/EditorState.cpp >+++ b/Source/WebKit/Shared/EditorState.cpp >@@ -203,7 +203,7 @@ bool EditorState::PostLayoutData::decode(IPC::Decoder& decoder, PostLayoutData& > return false; > #endif > >- std::optional<std::optional<FontAttributes>> optionalFontAttributes; >+ Optional<Optional<FontAttributes>> optionalFontAttributes; > decoder >> optionalFontAttributes; > if (!optionalFontAttributes) > return false; >diff --git a/Source/WebKit/Shared/EditorState.h b/Source/WebKit/Shared/EditorState.h >index 9e33906621ad942556fda03cce10cb2f6e41acfe..780ecf7beebfa38ba61bd51cc63e3e99c79abff3 100644 >--- a/Source/WebKit/Shared/EditorState.h >+++ b/Source/WebKit/Shared/EditorState.h >@@ -116,7 +116,7 @@ struct EditorState { > String stringForCandidateRequest; > #endif > >- std::optional<WebCore::FontAttributes> fontAttributes; >+ Optional<WebCore::FontAttributes> fontAttributes; > > bool canCut { false }; > bool canCopy { false }; >diff --git a/Source/WebKit/Shared/FrameInfoData.cpp b/Source/WebKit/Shared/FrameInfoData.cpp >index 3c9c9b3ddbe8d5cf2a6f297a3fe9e4ff91955545..9442374565816f4e88040ff084e0c1a3be531ff4 100644 >--- a/Source/WebKit/Shared/FrameInfoData.cpp >+++ b/Source/WebKit/Shared/FrameInfoData.cpp >@@ -44,7 +44,7 @@ bool FrameInfoData::decode(IPC::Decoder& decoder, FrameInfoData& result) > return false; > if (!decoder.decode(result.request)) > return false; >- std::optional<WebCore::SecurityOriginData> securityOrigin; >+ Optional<WebCore::SecurityOriginData> securityOrigin; > decoder >> securityOrigin; > if (!securityOrigin) > return false; >diff --git a/Source/WebKit/Shared/Gamepad/GamepadData.cpp b/Source/WebKit/Shared/Gamepad/GamepadData.cpp >index 905d827158349b3dcc0e005e57cd4a5cc946978f..fd0a953af2af1210e9abf30abe17c18f713d5ec6 100644 >--- a/Source/WebKit/Shared/Gamepad/GamepadData.cpp >+++ b/Source/WebKit/Shared/Gamepad/GamepadData.cpp >@@ -59,29 +59,29 @@ void GamepadData::encode(IPC::Encoder& encoder) const > encoder << m_index << m_id << m_axisValues << m_buttonValues << m_lastUpdateTime; > } > >-std::optional<GamepadData> GamepadData::decode(IPC::Decoder& decoder) >+Optional<GamepadData> GamepadData::decode(IPC::Decoder& decoder) > { > GamepadData data; > if (!decoder.decode(data.m_isNull)) >- return std::nullopt; >+ return WTF::nullopt; > > if (data.m_isNull) > return data; > > if (!decoder.decode(data.m_index)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(data.m_id)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(data.m_axisValues)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(data.m_buttonValues)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(data.m_lastUpdateTime)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(data); > } >diff --git a/Source/WebKit/Shared/Gamepad/GamepadData.h b/Source/WebKit/Shared/Gamepad/GamepadData.h >index e80e04b808a7735236ef207b4701cbb56d11f51f..7e7e622d4c216c97468535933946a4d4e55d7ece 100644 >--- a/Source/WebKit/Shared/Gamepad/GamepadData.h >+++ b/Source/WebKit/Shared/Gamepad/GamepadData.h >@@ -49,7 +49,7 @@ public: > GamepadData(unsigned index, const String& id, const Vector<double>& axisValues, const Vector<double>& buttonValues, MonotonicTime lastUpdateTime); > > void encode(IPC::Encoder&) const; >- static std::optional<GamepadData> decode(IPC::Decoder&); >+ static Optional<GamepadData> decode(IPC::Decoder&); > > bool isNull() const { return m_isNull; } > >diff --git a/Source/WebKit/Shared/LoadParameters.cpp b/Source/WebKit/Shared/LoadParameters.cpp >index 46249e791245fe6990a9570477615e9cedb2fc28..0881b90beae3bc57f02a32925b2bb027194d2ff5 100644 >--- a/Source/WebKit/Shared/LoadParameters.cpp >+++ b/Source/WebKit/Shared/LoadParameters.cpp >@@ -74,7 +74,7 @@ bool LoadParameters::decode(IPC::Decoder& decoder, LoadParameters& data) > > if (hasHTTPBody) { > // FormDataReference encoder / decoder takes care of passing and consuming the needed sandbox extensions. >- std::optional<IPC::FormDataReference> formDataReference; >+ Optional<IPC::FormDataReference> formDataReference; > decoder >> formDataReference; > if (!formDataReference) > return false; >@@ -82,7 +82,7 @@ bool LoadParameters::decode(IPC::Decoder& decoder, LoadParameters& data) > data.request.setHTTPBody(formDataReference->takeData()); > } > >- std::optional<SandboxExtension::Handle> sandboxExtensionHandle; >+ Optional<SandboxExtension::Handle> sandboxExtensionHandle; > decoder >> sandboxExtensionHandle; > if (!sandboxExtensionHandle) > return false; >@@ -106,7 +106,7 @@ bool LoadParameters::decode(IPC::Decoder& decoder, LoadParameters& data) > if (!decoder.decode(data.provisionalLoadErrorURLString)) > return false; > >- std::optional<std::optional<WebsitePoliciesData>> websitePolicies; >+ Optional<Optional<WebsitePoliciesData>> websitePolicies; > decoder >> websitePolicies; > if (!websitePolicies) > return false; >@@ -127,7 +127,7 @@ bool LoadParameters::decode(IPC::Decoder& decoder, LoadParameters& data) > if (!decoder.decodeEnum(data.lockBackForwardList)) > return false; > >- std::optional<String> clientRedirectSourceForHistory; >+ Optional<String> clientRedirectSourceForHistory; > decoder >> clientRedirectSourceForHistory; > if (!clientRedirectSourceForHistory) > return false; >diff --git a/Source/WebKit/Shared/LoadParameters.h b/Source/WebKit/Shared/LoadParameters.h >index eef1a610040a6ae5d2dd2d4a199264067064516c..108b19143557cf5f3c79dc25a2609dc39204ed2c 100644 >--- a/Source/WebKit/Shared/LoadParameters.h >+++ b/Source/WebKit/Shared/LoadParameters.h >@@ -61,7 +61,7 @@ struct LoadParameters { > String unreachableURLString; > String provisionalLoadErrorURLString; > >- std::optional<WebsitePoliciesData> websitePolicies; >+ Optional<WebsitePoliciesData> websitePolicies; > > uint64_t shouldOpenExternalURLsPolicy; > bool shouldTreatAsContinuingLoad { false }; >diff --git a/Source/WebKit/Shared/NavigationActionData.cpp b/Source/WebKit/Shared/NavigationActionData.cpp >index 672059e45a6c7516951e6bb63eb924e4b4fbdc37..f5e5abf952ba1a48e8e38bb56b32207ed5e5a34d 100644 >--- a/Source/WebKit/Shared/NavigationActionData.cpp >+++ b/Source/WebKit/Shared/NavigationActionData.cpp >@@ -55,89 +55,89 @@ void NavigationActionData::encode(IPC::Encoder& encoder) const > encoder << clientRedirectSourceForHistory; > } > >-std::optional<NavigationActionData> NavigationActionData::decode(IPC::Decoder& decoder) >+Optional<NavigationActionData> NavigationActionData::decode(IPC::Decoder& decoder) > { > WebCore::NavigationType navigationType; > if (!decoder.decodeEnum(navigationType)) >- return std::nullopt; >+ return WTF::nullopt; > > WebEvent::Modifiers modifiers; > if (!decoder.decodeEnum(modifiers)) >- return std::nullopt; >+ return WTF::nullopt; > > WebMouseEvent::Button mouseButton; > if (!decoder.decodeEnum(mouseButton)) >- return std::nullopt; >+ return WTF::nullopt; > > WebMouseEvent::SyntheticClickType syntheticClickType; > if (!decoder.decodeEnum(syntheticClickType)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> userGestureTokenIdentifier; >+ Optional<uint64_t> userGestureTokenIdentifier; > decoder >> userGestureTokenIdentifier; > if (!userGestureTokenIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> canHandleRequest; >+ Optional<bool> canHandleRequest; > decoder >> canHandleRequest; > if (!canHandleRequest) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy; > if (!decoder.decodeEnum(shouldOpenExternalURLsPolicy)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> downloadAttribute; >+ Optional<String> downloadAttribute; > decoder >> downloadAttribute; > if (!downloadAttribute) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::FloatPoint clickLocationInRootViewCoordinates; > if (!decoder.decode(clickLocationInRootViewCoordinates)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> isRedirect; >+ Optional<bool> isRedirect; > decoder >> isRedirect; > if (!isRedirect) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> treatAsSameOriginNavigation; >+ Optional<bool> treatAsSameOriginNavigation; > decoder >> treatAsSameOriginNavigation; > if (!treatAsSameOriginNavigation) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> hasOpenedFrames; >+ Optional<bool> hasOpenedFrames; > decoder >> hasOpenedFrames; > if (!hasOpenedFrames) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> openedByDOMWithOpener; >+ Optional<bool> openedByDOMWithOpener; > decoder >> openedByDOMWithOpener; > if (!openedByDOMWithOpener) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WebCore::SecurityOriginData> requesterOrigin; >+ Optional<WebCore::SecurityOriginData> requesterOrigin; > decoder >> requesterOrigin; > if (!requesterOrigin) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<WebCore::BackForwardItemIdentifier>> targetBackForwardItemIdentifier; >+ Optional<Optional<WebCore::BackForwardItemIdentifier>> targetBackForwardItemIdentifier; > decoder >> targetBackForwardItemIdentifier; > if (!targetBackForwardItemIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::LockHistory lockHistory; > if (!decoder.decodeEnum(lockHistory)) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::LockBackForwardList lockBackForwardList; > if (!decoder.decodeEnum(lockBackForwardList)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> clientRedirectSourceForHistory; >+ Optional<String> clientRedirectSourceForHistory; > decoder >> clientRedirectSourceForHistory; > if (!clientRedirectSourceForHistory) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(navigationType), WTFMove(modifiers), WTFMove(mouseButton), WTFMove(syntheticClickType), WTFMove(*userGestureTokenIdentifier), > WTFMove(*canHandleRequest), WTFMove(shouldOpenExternalURLsPolicy), WTFMove(*downloadAttribute), WTFMove(clickLocationInRootViewCoordinates), >diff --git a/Source/WebKit/Shared/NavigationActionData.h b/Source/WebKit/Shared/NavigationActionData.h >index 1285586471fe41e31bfb79b0813d1c6994d89d9f..06fff846d686b067d98971c724827bf30896bbc7 100644 >--- a/Source/WebKit/Shared/NavigationActionData.h >+++ b/Source/WebKit/Shared/NavigationActionData.h >@@ -40,7 +40,7 @@ namespace WebKit { > > struct NavigationActionData { > void encode(IPC::Encoder&) const; >- static std::optional<NavigationActionData> decode(IPC::Decoder&); >+ static Optional<NavigationActionData> decode(IPC::Decoder&); > > WebCore::NavigationType navigationType { WebCore::NavigationType::Other }; > WebEvent::Modifiers modifiers { }; >@@ -56,7 +56,7 @@ struct NavigationActionData { > bool hasOpenedFrames { false }; > bool openedByDOMWithOpener { false }; > WebCore::SecurityOriginData requesterOrigin; >- std::optional<WebCore::BackForwardItemIdentifier> targetBackForwardItemIdentifier; >+ Optional<WebCore::BackForwardItemIdentifier> targetBackForwardItemIdentifier; > WebCore::LockHistory lockHistory; > WebCore::LockBackForwardList lockBackForwardList; > WTF::String clientRedirectSourceForHistory; >diff --git a/Source/WebKit/Shared/PlatformPopupMenuData.cpp b/Source/WebKit/Shared/PlatformPopupMenuData.cpp >index b948819e6f0e6495eee0e710d9b5b57e767fb26c..49e113186e4f3801e7caac256fd63c9629fae13d 100644 >--- a/Source/WebKit/Shared/PlatformPopupMenuData.cpp >+++ b/Source/WebKit/Shared/PlatformPopupMenuData.cpp >@@ -99,11 +99,11 @@ bool PlatformPopupMenuData::decode(IPC::Decoder& decoder, PlatformPopupMenuData& > return true; > } > >-std::optional<PlatformPopupMenuData> PlatformPopupMenuData::decode(IPC::Decoder& decoder) >+Optional<PlatformPopupMenuData> PlatformPopupMenuData::decode(IPC::Decoder& decoder) > { > PlatformPopupMenuData data; > if (!decode(decoder, data)) >- return std::nullopt; >+ return WTF::nullopt; > return data; > } > >diff --git a/Source/WebKit/Shared/PlatformPopupMenuData.h b/Source/WebKit/Shared/PlatformPopupMenuData.h >index 59949870ecc423cc998c16e3a8e75918e3b80d04..9be89c3660a785c3d76c49610776fad44ccbca8e 100644 >--- a/Source/WebKit/Shared/PlatformPopupMenuData.h >+++ b/Source/WebKit/Shared/PlatformPopupMenuData.h >@@ -42,7 +42,7 @@ struct PlatformPopupMenuData { > > void encode(IPC::Encoder&) const; > static bool decode(IPC::Decoder&, PlatformPopupMenuData&); >- static std::optional<PlatformPopupMenuData> decode(IPC::Decoder&); >+ static Optional<PlatformPopupMenuData> decode(IPC::Decoder&); > > #if PLATFORM(COCOA) > FontInfo fontInfo; >diff --git a/Source/WebKit/Shared/Plugins/NPIdentifierData.cpp b/Source/WebKit/Shared/Plugins/NPIdentifierData.cpp >index 925171e9c754f4fce5ae3aad971187cca640d581..f013ac29f4bb62d38a52561ecd4b764b660f3c98 100644 >--- a/Source/WebKit/Shared/Plugins/NPIdentifierData.cpp >+++ b/Source/WebKit/Shared/Plugins/NPIdentifierData.cpp >@@ -75,20 +75,20 @@ void NPIdentifierData::encode(IPC::Encoder& encoder) const > encoder << m_number; > } > >-std::optional<NPIdentifierData> NPIdentifierData::decode(IPC::Decoder& decoder) >+Optional<NPIdentifierData> NPIdentifierData::decode(IPC::Decoder& decoder) > { > NPIdentifierData result; > if (!decoder.decode(result.m_isString)) >- return std::nullopt; >+ return WTF::nullopt; > > if (result.m_isString) { > if (!decoder.decode(result.m_string)) >- return std::nullopt; >+ return WTF::nullopt; > return result; > } > > if (!decoder.decode(result.m_number)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > } > >diff --git a/Source/WebKit/Shared/Plugins/NPIdentifierData.h b/Source/WebKit/Shared/Plugins/NPIdentifierData.h >index c4aa24f11016fa16ce19ce54380c4d79444faf92..08ea7463f8aa85edbdb2128ae26a0b77dca2dc8e 100644 >--- a/Source/WebKit/Shared/Plugins/NPIdentifierData.h >+++ b/Source/WebKit/Shared/Plugins/NPIdentifierData.h >@@ -45,7 +45,7 @@ public: > NPIdentifier createNPIdentifier() const; > > void encode(IPC::Encoder&) const; >- static std::optional<NPIdentifierData> decode(IPC::Decoder&); >+ static Optional<NPIdentifierData> decode(IPC::Decoder&); > > private: > bool m_isString; >diff --git a/Source/WebKit/Shared/Plugins/NPVariantData.cpp b/Source/WebKit/Shared/Plugins/NPVariantData.cpp >index 07dddbc611f45af6028df1ddfabebe3085150cf2..62afd4065cc0ae4d25872e912de99250039b625f 100644 >--- a/Source/WebKit/Shared/Plugins/NPVariantData.cpp >+++ b/Source/WebKit/Shared/Plugins/NPVariantData.cpp >@@ -147,12 +147,12 @@ void NPVariantData::encode(IPC::Encoder& encoder) const > } > } > >-std::optional<NPVariantData> NPVariantData::decode(IPC::Decoder& decoder) >+Optional<NPVariantData> NPVariantData::decode(IPC::Decoder& decoder) > { > NPVariantData result; > uint32_t type; > if (!decoder.decode(type)) >- return std::nullopt; >+ return WTF::nullopt; > > // We special-case LocalNPObjectID and RemoteNPObjectID here so a LocalNPObjectID is > // decoded as a RemoteNPObjectID and vice versa. >@@ -171,31 +171,31 @@ std::optional<NPVariantData> NPVariantData::decode(IPC::Decoder& decoder) > return WTFMove(result); > case NPVariantData::Bool: > if (!decoder.decode(result.m_boolValue)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > case NPVariantData::Int32: > if (!decoder.decode(result.m_int32Value)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > case NPVariantData::Double: > if (!decoder.decode(result.m_doubleValue)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > case NPVariantData::String: > if (!decoder.decode(result.m_stringValue)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > case NPVariantData::LocalNPObjectID: > if (!decoder.decode(result.m_localNPObjectIDValue)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > case NPVariantData::RemoteNPObjectID: > if (!decoder.decode(result.m_remoteNPObjectIDValue)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(result); > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/Plugins/NPVariantData.h b/Source/WebKit/Shared/Plugins/NPVariantData.h >index c58e2d504bad9b746d6374257905cce38fb73bfc..61e94d2985a3541948ef0d5065ace74b5cbe4f14 100644 >--- a/Source/WebKit/Shared/Plugins/NPVariantData.h >+++ b/Source/WebKit/Shared/Plugins/NPVariantData.h >@@ -98,7 +98,7 @@ public: > } > > void encode(IPC::Encoder&) const; >- static std::optional<NPVariantData> decode(IPC::Decoder&); >+ static Optional<NPVariantData> decode(IPC::Decoder&); > > private: > uint32_t m_type; >diff --git a/Source/WebKit/Shared/RTCNetwork.cpp b/Source/WebKit/Shared/RTCNetwork.cpp >index 09096ab3f1e996c33cbe4fbe51ca901ed899c340..0f96e22bef9efdcc3e8a98c1c52758524bbdfe6f 100644 >--- a/Source/WebKit/Shared/RTCNetwork.cpp >+++ b/Source/WebKit/Shared/RTCNetwork.cpp >@@ -60,12 +60,12 @@ rtc::Network RTCNetwork::value() const > return network; > } > >-auto RTCNetwork::IPAddress::decode(IPC::Decoder& decoder) -> std::optional<IPAddress> >+auto RTCNetwork::IPAddress::decode(IPC::Decoder& decoder) -> Optional<IPAddress> > { > IPAddress result; > int family; > if (!decoder.decode(family)) >- return std::nullopt; >+ return WTF::nullopt; > > ASSERT(family == AF_INET || family == AF_INET6 || family == AF_UNSPEC); > >@@ -74,17 +74,17 @@ auto RTCNetwork::IPAddress::decode(IPC::Decoder& decoder) -> std::optional<IPAdd > > IPC::DataReference data; > if (!decoder.decode(data)) >- return std::nullopt; >+ return WTF::nullopt; > > if (family == AF_INET) { > if (data.size() != sizeof(in_addr)) >- return std::nullopt; >+ return WTF::nullopt; > result.value = rtc::IPAddress(*reinterpret_cast<const in_addr*>(data.data())); > return WTFMove(result); > } > > if (data.size() != sizeof(in6_addr)) >- return std::nullopt; >+ return WTF::nullopt; > result.value = rtc::IPAddress(*reinterpret_cast<const in6_addr*>(data.data())); > return WTFMove(result); > } >@@ -119,33 +119,33 @@ rtc::SocketAddress RTCNetwork::isolatedCopy(const rtc::SocketAddress& value) > return rtc::SocketAddress(copy); > } > >-auto RTCNetwork::SocketAddress::decode(IPC::Decoder& decoder) -> std::optional<SocketAddress> >+auto RTCNetwork::SocketAddress::decode(IPC::Decoder& decoder) -> Optional<SocketAddress> > { > SocketAddress result; > uint16_t port; > if (!decoder.decode(port)) >- return std::nullopt; >+ return WTF::nullopt; > int scopeId; > if (!decoder.decode(scopeId)) >- return std::nullopt; >+ return WTF::nullopt; > result.value.SetPort(port); > result.value.SetScopeID(scopeId); > > IPC::DataReference hostname; > if (!decoder.decode(hostname)) >- return std::nullopt; >+ return WTF::nullopt; > result.value.SetIP(std::string(reinterpret_cast<const char*>(hostname.data()), hostname.size())); > > bool isUnresolved; > if (!decoder.decode(isUnresolved)) >- return std::nullopt; >+ return WTF::nullopt; > if (isUnresolved) > return result; > >- std::optional<IPAddress> ipAddress; >+ Optional<IPAddress> ipAddress; > decoder >> ipAddress; > if (!ipAddress) >- return std::nullopt; >+ return WTF::nullopt; > result.value.SetResolvedIP(ipAddress->value); > return result; > } >@@ -166,48 +166,48 @@ void RTCNetwork::SocketAddress::encode(IPC::Encoder& encoder) const > encoder << RTCNetwork::IPAddress(value.ipaddr()); > } > >-std::optional<RTCNetwork> RTCNetwork::decode(IPC::Decoder& decoder) >+Optional<RTCNetwork> RTCNetwork::decode(IPC::Decoder& decoder) > { > RTCNetwork result; > IPC::DataReference name, description; > if (!decoder.decode(name)) >- return std::nullopt; >+ return WTF::nullopt; > result.name = std::string(reinterpret_cast<const char*>(name.data()), name.size()); > if (!decoder.decode(description)) >- return std::nullopt; >+ return WTF::nullopt; > result.description = std::string(reinterpret_cast<const char*>(description.data()), description.size()); >- std::optional<IPAddress> prefix; >+ Optional<IPAddress> prefix; > decoder >> prefix; > if (!prefix) >- return std::nullopt; >+ return WTF::nullopt; > result.prefix = WTFMove(*prefix); > if (!decoder.decode(result.prefixLength)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.type)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.id)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.preference)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.active)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.ignored)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.scopeID)) >- return std::nullopt; >+ return WTF::nullopt; > > uint64_t length; > if (!decoder.decode(length)) >- return std::nullopt; >+ return WTF::nullopt; > result.ips.reserve(length); > for (size_t index = 0; index < length; ++index) { >- std::optional<IPAddress> address; >+ Optional<IPAddress> address; > decoder >> address; > if (!address) >- return std::nullopt; >+ return WTF::nullopt; > int flags; > if (!decoder.decode(flags)) >- return std::nullopt; >+ return WTF::nullopt; > result.ips.push_back({ address->value, flags }); > } > return result; >diff --git a/Source/WebKit/Shared/RTCNetwork.h b/Source/WebKit/Shared/RTCNetwork.h >index eca1dfd8163bfb66ebb022ecb670aed390f40339..75544a00284d2aaafb9207e54db4127162958f95 100644 >--- a/Source/WebKit/Shared/RTCNetwork.h >+++ b/Source/WebKit/Shared/RTCNetwork.h >@@ -45,14 +45,14 @@ struct RTCNetwork { > rtc::Network value() const; > > void encode(IPC::Encoder&) const; >- static std::optional<RTCNetwork> decode(IPC::Decoder&); >+ static Optional<RTCNetwork> decode(IPC::Decoder&); > > struct IPAddress { > IPAddress() = default; > explicit IPAddress(const rtc::IPAddress& address): value(address) { } > > void encode(IPC::Encoder&) const; >- static std::optional<IPAddress> decode(IPC::Decoder&); >+ static Optional<IPAddress> decode(IPC::Decoder&); > > rtc::IPAddress value; > }; >@@ -64,7 +64,7 @@ struct RTCNetwork { > explicit SocketAddress(const rtc::SocketAddress& address): value(address) { } > > void encode(IPC::Encoder&) const; >- static std::optional<SocketAddress> decode(IPC::Decoder&); >+ static Optional<SocketAddress> decode(IPC::Decoder&); > > rtc::SocketAddress value; > }; >diff --git a/Source/WebKit/Shared/RTCPacketOptions.cpp b/Source/WebKit/Shared/RTCPacketOptions.cpp >index 938b69e7cb4b6eefce60d2dcec52d9c98295fdec..83caf4e2fefa6eeed29b0b57a59e672eb8213ce3 100644 >--- a/Source/WebKit/Shared/RTCPacketOptions.cpp >+++ b/Source/WebKit/Shared/RTCPacketOptions.cpp >@@ -46,47 +46,47 @@ void RTCPacketOptions::encode(IPC::Encoder& encoder) const > encoder << options.packet_time_params.srtp_packet_index; > } > >-std::optional<RTCPacketOptions> RTCPacketOptions::decode(IPC::Decoder& decoder) >+Optional<RTCPacketOptions> RTCPacketOptions::decode(IPC::Decoder& decoder) > { > rtc::PacketTimeUpdateParams params; > rtc::PacketOptions options; > > rtc::DiffServCodePoint dscp; > if (!decoder.decodeEnum(dscp)) >- return std::nullopt; >+ return WTF::nullopt; > options.dscp = dscp; > >- std::optional<int32_t> packetId; >+ Optional<int32_t> packetId; > decoder >> packetId; > if (!packetId) >- return std::nullopt; >+ return WTF::nullopt; > options.packet_id = packetId.value(); > >- std::optional<int> rtpSendtimeExtensionId; >+ Optional<int> rtpSendtimeExtensionId; > decoder >> rtpSendtimeExtensionId; > if (!rtpSendtimeExtensionId) >- return std::nullopt; >+ return WTF::nullopt; > params.rtp_sendtime_extension_id = rtpSendtimeExtensionId.value(); > >- std::optional<int64_t> srtpAuthTagLength; >+ Optional<int64_t> srtpAuthTagLength; > decoder >> srtpAuthTagLength; > if (!srtpAuthTagLength) >- return std::nullopt; >+ return WTF::nullopt; > params.srtp_auth_tag_len = srtpAuthTagLength.value(); > > if (params.srtp_auth_tag_len > 0) { > IPC::DataReference srtpAuthKey; > if (!decoder.decode(srtpAuthKey)) >- return std::nullopt; >+ return WTF::nullopt; > > params.srtp_auth_key = std::vector<char>(static_cast<size_t>(srtpAuthKey.size())); > memcpy(params.srtp_auth_key.data(), reinterpret_cast<const char*>(srtpAuthKey.data()), srtpAuthKey.size() * sizeof(char)); > } > >- std::optional<int64_t> srtpPacketIndex; >+ Optional<int64_t> srtpPacketIndex; > decoder >> srtpPacketIndex; > if (!srtpPacketIndex) >- return std::nullopt; >+ return WTF::nullopt; > params.srtp_packet_index = srtpPacketIndex.value(); > > options.packet_time_params = WTFMove(params); >diff --git a/Source/WebKit/Shared/RTCPacketOptions.h b/Source/WebKit/Shared/RTCPacketOptions.h >index 82b921b548aba2815e6bfb63fb1b0619323d643c..21ee0d0034cf076f0f650a5836657deeb44aa9d8 100644 >--- a/Source/WebKit/Shared/RTCPacketOptions.h >+++ b/Source/WebKit/Shared/RTCPacketOptions.h >@@ -40,7 +40,7 @@ namespace WebKit { > > struct RTCPacketOptions { > void encode(IPC::Encoder&) const; >- static std::optional<RTCPacketOptions> decode(IPC::Decoder&); >+ static Optional<RTCPacketOptions> decode(IPC::Decoder&); > > rtc::PacketOptions options; > }; >diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h >index 757f70afdf71d81824648de64540bd2429c058fa..c7acbbcc7ead8f80f6ece5d3249417be2692f43a 100644 >--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h >+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h >@@ -98,7 +98,7 @@ public: > LayerCreationProperties(); > > void encode(IPC::Encoder&) const; >- static std::optional<LayerCreationProperties> decode(IPC::Decoder&); >+ static Optional<LayerCreationProperties> decode(IPC::Decoder&); > > WebCore::GraphicsLayer::PlatformLayerID layerID; > WebCore::PlatformCALayer::LayerType type; >@@ -274,7 +274,7 @@ public: > const EditorState& editorState() const { return m_editorState.value(); } > void setEditorState(const EditorState& editorState) { m_editorState = editorState; } > >- std::optional<DynamicViewportSizeUpdateID> dynamicViewportSizeUpdateID() const { return m_dynamicViewportSizeUpdateID; } >+ Optional<DynamicViewportSizeUpdateID> dynamicViewportSizeUpdateID() const { return m_dynamicViewportSizeUpdateID; } > void setDynamicViewportSizeUpdateID(DynamicViewportSizeUpdateID resizeID) { m_dynamicViewportSizeUpdateID = resizeID; } > > private: >@@ -312,8 +312,8 @@ private: > bool m_viewportMetaTagCameFromImageDocument { false }; > bool m_isInStableState { false }; > >- std::optional<EditorState> m_editorState; >- std::optional<DynamicViewportSizeUpdateID> m_dynamicViewportSizeUpdateID; >+ Optional<EditorState> m_editorState; >+ Optional<DynamicViewportSizeUpdateID> m_dynamicViewportSizeUpdateID; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >index f38e75d1526badb7f52ded2565427edf16b661ce..6688a036ee2c144b87e1e51242f330e81b5481ba 100644 >--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >@@ -56,23 +56,23 @@ void RemoteLayerTreeTransaction::LayerCreationProperties::encode(IPC::Encoder& e > encoder << hostingDeviceScaleFactor; > } > >-auto RemoteLayerTreeTransaction::LayerCreationProperties::decode(IPC::Decoder& decoder) -> std::optional<LayerCreationProperties> >+auto RemoteLayerTreeTransaction::LayerCreationProperties::decode(IPC::Decoder& decoder) -> Optional<LayerCreationProperties> > { > LayerCreationProperties result; > if (!decoder.decode(result.layerID)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(result.type)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.embeddedViewID)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.hostingContextID)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.hostingDeviceScaleFactor)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >@@ -678,7 +678,7 @@ bool RemoteLayerTreeTransaction::decode(IPC::Decoder& decoder, RemoteLayerTreeTr > if (!decoder.decode(result.m_isInStableState)) > return false; > >- std::optional<Vector<TransactionCallbackID>> callbackIDs; >+ Optional<Vector<TransactionCallbackID>> callbackIDs; > decoder >> callbackIDs; > if (!callbackIDs) > return false; >diff --git a/Source/WebKit/Shared/SandboxExtension.h b/Source/WebKit/Shared/SandboxExtension.h >index 116b9c83be90fd924a72015ce954d3d817b8f0f7..ddfacb2f2e37616b5114be8dea2c17318c48108c 100644 >--- a/Source/WebKit/Shared/SandboxExtension.h >+++ b/Source/WebKit/Shared/SandboxExtension.h >@@ -63,7 +63,7 @@ public: > ~Handle(); > > void encode(IPC::Encoder&) const; >- static std::optional<Handle> decode(IPC::Decoder&); >+ static Optional<Handle> decode(IPC::Decoder&); > > private: > friend class SandboxExtension; >@@ -85,7 +85,7 @@ public: > const Handle& operator[](size_t i) const; > size_t size() const; > void encode(IPC::Encoder&) const; >- static std::optional<HandleArray> decode(IPC::Decoder&); >+ static Optional<HandleArray> decode(IPC::Decoder&); > > private: > #if ENABLE(SANDBOX_EXTENSIONS) >@@ -122,7 +122,7 @@ private: > inline SandboxExtension::Handle::Handle() { } > inline SandboxExtension::Handle::~Handle() { } > inline void SandboxExtension::Handle::encode(IPC::Encoder&) const { } >-inline std::optional<SandboxExtension::Handle> SandboxExtension::Handle::decode(IPC::Decoder&) { return SandboxExtension::Handle { }; } >+inline Optional<SandboxExtension::Handle> SandboxExtension::Handle::decode(IPC::Decoder&) { return SandboxExtension::Handle { }; } > inline SandboxExtension::HandleArray::HandleArray() { } > inline SandboxExtension::HandleArray::~HandleArray() { } > inline void SandboxExtension::HandleArray::allocate(size_t) { } >@@ -130,7 +130,7 @@ inline size_t SandboxExtension::HandleArray::size() const { return 0; } > inline const SandboxExtension::Handle& SandboxExtension::HandleArray::operator[](size_t) const { return m_emptyHandle; } > inline SandboxExtension::Handle& SandboxExtension::HandleArray::operator[](size_t) { return m_emptyHandle; } > inline void SandboxExtension::HandleArray::encode(IPC::Encoder&) const { } >-inline auto SandboxExtension::HandleArray::decode(IPC::Decoder&) -> std::optional<HandleArray> { return {{ }}; } >+inline auto SandboxExtension::HandleArray::decode(IPC::Decoder&) -> Optional<HandleArray> { return {{ }}; } > inline RefPtr<SandboxExtension> SandboxExtension::create(Handle&&) { return nullptr; } > inline bool SandboxExtension::createHandle(const String&, Type, Handle&) { return true; } > inline bool SandboxExtension::createHandleWithoutResolvingPath(const String&, Type, Handle&) { return true; } >diff --git a/Source/WebKit/Shared/SessionState.cpp b/Source/WebKit/Shared/SessionState.cpp >index c2c2a3a2ab212c1c3bd57798b98dfa83b868ca65..b6c42098978a8aad08995851010de482b42df742 100644 >--- a/Source/WebKit/Shared/SessionState.cpp >+++ b/Source/WebKit/Shared/SessionState.cpp >@@ -66,23 +66,23 @@ static bool isValidEnum(HTTPBody::Element::Type type) > return false; > } > >-auto HTTPBody::Element::decode(IPC::Decoder& decoder) -> std::optional<Element> >+auto HTTPBody::Element::decode(IPC::Decoder& decoder) -> Optional<Element> > { > Element result; > if (!decoder.decodeEnum(result.type) || !isValidEnum(result.type)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.data)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.filePath)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.fileStart)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.fileLength)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.expectedFileModificationTime)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.blobURLString)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >@@ -133,53 +133,53 @@ void FrameState::encode(IPC::Encoder& encoder) const > encoder << children; > } > >-std::optional<FrameState> FrameState::decode(IPC::Decoder& decoder) >+Optional<FrameState> FrameState::decode(IPC::Decoder& decoder) > { > FrameState result; > if (!decoder.decode(result.urlString)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.originalURLString)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.referrer)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.target)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.documentState)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.stateObjectData)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.documentSequenceNumber)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.itemSequenceNumber)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.scrollPosition)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.shouldRestoreScrollPosition)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.pageScaleFactor)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.httpBody)) >- return std::nullopt; >+ return WTF::nullopt; > > #if PLATFORM(IOS_FAMILY) > if (!decoder.decode(result.exposedContentRect)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.unobscuredContentRect)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.minimumLayoutSizeInScrollViewCoordinates)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.contentSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.scaleIsInitial)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > if (!decoder.decode(result.children)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >@@ -198,7 +198,7 @@ bool PageState::decode(IPC::Decoder& decoder, PageState& result) > { > if (!decoder.decode(result.title)) > return false; >- std::optional<FrameState> mainFrameState; >+ Optional<FrameState> mainFrameState; > decoder >> mainFrameState; > if (!mainFrameState) > return false; >@@ -228,17 +228,17 @@ void BackForwardListItemState::encode(IPC::Encoder& encoder) const > encoder << pageState; > } > >-std::optional<BackForwardListItemState> BackForwardListItemState::decode(IPC::Decoder& decoder) >+Optional<BackForwardListItemState> BackForwardListItemState::decode(IPC::Decoder& decoder) > { > BackForwardListItemState result; > > auto identifier = BackForwardItemIdentifier::decode(decoder); > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > result.identifier = *identifier; > > if (!decoder.decode(result.pageState)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >@@ -249,16 +249,16 @@ void BackForwardListState::encode(IPC::Encoder& encoder) const > encoder << currentIndex; > } > >-std::optional<BackForwardListState> BackForwardListState::decode(IPC::Decoder& decoder) >+Optional<BackForwardListState> BackForwardListState::decode(IPC::Decoder& decoder) > { >- std::optional<Vector<BackForwardListItemState>> items; >+ Optional<Vector<BackForwardListItemState>> items; > decoder >> items; > if (!items) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint32_t> currentIndex; >+ Optional<uint32_t> currentIndex; > if (!decoder.decode(currentIndex)) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*items), WTFMove(currentIndex) }}; > } >diff --git a/Source/WebKit/Shared/SessionState.h b/Source/WebKit/Shared/SessionState.h >index 92afdc598a2b37f91197adf897c61cf594165c3b..e7bfbb4643f9e398e52c12862d634ca950472e2c 100644 >--- a/Source/WebKit/Shared/SessionState.h >+++ b/Source/WebKit/Shared/SessionState.h >@@ -51,7 +51,7 @@ bool isValidEnum(WebCore::ShouldOpenExternalURLsPolicy); > struct HTTPBody { > struct Element { > void encode(IPC::Encoder&) const; >- static std::optional<Element> decode(IPC::Decoder&); >+ static Optional<Element> decode(IPC::Decoder&); > > enum class Type { > Data, >@@ -68,8 +68,8 @@ struct HTTPBody { > // File. > String filePath; > int64_t fileStart; >- std::optional<int64_t> fileLength; >- std::optional<WallTime> expectedFileModificationTime; >+ Optional<int64_t> fileLength; >+ Optional<WallTime> expectedFileModificationTime; > > // Blob. > String blobURLString; >@@ -84,7 +84,7 @@ struct HTTPBody { > > struct FrameState { > void encode(IPC::Encoder&) const; >- static std::optional<FrameState> decode(IPC::Decoder&); >+ static Optional<FrameState> decode(IPC::Decoder&); > > String urlString; > String originalURLString; >@@ -92,7 +92,7 @@ struct FrameState { > String target; > > Vector<String> documentState; >- std::optional<Vector<uint8_t>> stateObjectData; >+ Optional<Vector<uint8_t>> stateObjectData; > > int64_t documentSequenceNumber { 0 }; > int64_t itemSequenceNumber { 0 }; >@@ -101,7 +101,7 @@ struct FrameState { > bool shouldRestoreScrollPosition { true }; > float pageScaleFactor { 0 }; > >- std::optional<HTTPBody> httpBody; >+ Optional<HTTPBody> httpBody; > > // FIXME: These should not be per frame. > #if PLATFORM(IOS_FAMILY) >@@ -127,7 +127,7 @@ struct PageState { > > struct BackForwardListItemState { > void encode(IPC::Encoder&) const; >- static std::optional<BackForwardListItemState> decode(IPC::Decoder&); >+ static Optional<BackForwardListItemState> decode(IPC::Decoder&); > > WebCore::BackForwardItemIdentifier identifier; > >@@ -139,10 +139,10 @@ struct BackForwardListItemState { > > struct BackForwardListState { > void encode(IPC::Encoder&) const; >- static std::optional<BackForwardListState> decode(IPC::Decoder&); >+ static Optional<BackForwardListState> decode(IPC::Decoder&); > > Vector<BackForwardListItemState> items; >- std::optional<uint32_t> currentIndex; >+ Optional<uint32_t> currentIndex; > }; > > struct SessionState { >diff --git a/Source/WebKit/Shared/TouchBarMenuItemData.cpp b/Source/WebKit/Shared/TouchBarMenuItemData.cpp >index 3cdee82d0adf3435c8ed9cfcd7dbd4639f810180..6b7086b6855a8b63eaa5d8b9bc2e70557b5dd29a 100644 >--- a/Source/WebKit/Shared/TouchBarMenuItemData.cpp >+++ b/Source/WebKit/Shared/TouchBarMenuItemData.cpp >@@ -53,19 +53,19 @@ void TouchBarMenuItemData::encode(IPC::Encoder& encoder) const > encoder << priority; > } > >-std::optional<TouchBarMenuItemData> TouchBarMenuItemData::decode(IPC::Decoder& decoder) >+Optional<TouchBarMenuItemData> TouchBarMenuItemData::decode(IPC::Decoder& decoder) > { > TouchBarMenuItemData result; > if (!decoder.decodeEnum(result.type)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.identifier)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.priority)) >- return std::nullopt; >+ return WTF::nullopt; > >- return std::make_optional(WTFMove(result)); >+ return makeOptional(WTFMove(result)); > } > > } >diff --git a/Source/WebKit/Shared/TouchBarMenuItemData.h b/Source/WebKit/Shared/TouchBarMenuItemData.h >index 238e6363774e7b53af86e0ac1376ff1b205c3a0c..2d6819c4e1c60374c31cba9377d1be35e2b4dd62 100644 >--- a/Source/WebKit/Shared/TouchBarMenuItemData.h >+++ b/Source/WebKit/Shared/TouchBarMenuItemData.h >@@ -49,7 +49,7 @@ struct TouchBarMenuItemData { > explicit TouchBarMenuItemData(const TouchBarMenuItemData&) = default; > > void encode(IPC::Encoder&) const; >- static std::optional<TouchBarMenuItemData> decode(IPC::Decoder&); >+ static Optional<TouchBarMenuItemData> decode(IPC::Decoder&); > > ItemType type { ItemType::Button }; > String identifier; >diff --git a/Source/WebKit/Shared/URLSchemeTaskParameters.cpp b/Source/WebKit/Shared/URLSchemeTaskParameters.cpp >index aee450f851c4d12cab5c2a19943d1edf970e5f66..9e30a77aea7ec005a7623a36e44a97d78af29ec7 100644 >--- a/Source/WebKit/Shared/URLSchemeTaskParameters.cpp >+++ b/Source/WebKit/Shared/URLSchemeTaskParameters.cpp >@@ -44,30 +44,30 @@ void URLSchemeTaskParameters::encode(IPC::Encoder& encoder) const > encoder << false; > } > >-std::optional<URLSchemeTaskParameters> URLSchemeTaskParameters::decode(IPC::Decoder& decoder) >+Optional<URLSchemeTaskParameters> URLSchemeTaskParameters::decode(IPC::Decoder& decoder) > { >- std::optional<uint64_t> handlerIdentifier; >+ Optional<uint64_t> handlerIdentifier; > decoder >> handlerIdentifier; > if (!handlerIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> taskIdentifier; >+ Optional<uint64_t> taskIdentifier; > decoder >> taskIdentifier; > if (!taskIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::ResourceRequest request; > if (!decoder.decode(request)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> hasHTTPBody; >+ Optional<bool> hasHTTPBody; > decoder >> hasHTTPBody; > if (!hasHTTPBody) >- return std::nullopt; >+ return WTF::nullopt; > if (*hasHTTPBody) { > RefPtr<WebCore::FormData> formData = WebCore::FormData::decode(decoder); > if (!formData) >- return std::nullopt; >+ return WTF::nullopt; > request.setHTTPBody(WTFMove(formData)); > } > >diff --git a/Source/WebKit/Shared/URLSchemeTaskParameters.h b/Source/WebKit/Shared/URLSchemeTaskParameters.h >index 720ba1c2a6acb58b58a98d3130c561b93a54a5b4..5fd93a958d9cfbb08e85cebf423ea55bb5289b6b 100644 >--- a/Source/WebKit/Shared/URLSchemeTaskParameters.h >+++ b/Source/WebKit/Shared/URLSchemeTaskParameters.h >@@ -40,7 +40,7 @@ struct URLSchemeTaskParameters { > WebCore::ResourceRequest request; > > void encode(IPC::Encoder&) const; >- static std::optional<URLSchemeTaskParameters> decode(IPC::Decoder&); >+ static Optional<URLSchemeTaskParameters> decode(IPC::Decoder&); > }; > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/WebCompiledContentRuleListData.cpp b/Source/WebKit/Shared/WebCompiledContentRuleListData.cpp >index 514c8f0be431d77c70d662acad52dc82193bf1ff..bb80b092b2627432578e7da01ab0763c12f3c513 100644 >--- a/Source/WebKit/Shared/WebCompiledContentRuleListData.cpp >+++ b/Source/WebKit/Shared/WebCompiledContentRuleListData.cpp >@@ -49,32 +49,32 @@ void WebCompiledContentRuleListData::encode(IPC::Encoder& encoder) const > encoder << topURLFiltersBytecodeSize; > } > >-std::optional<WebCompiledContentRuleListData> WebCompiledContentRuleListData::decode(IPC::Decoder& decoder) >+Optional<WebCompiledContentRuleListData> WebCompiledContentRuleListData::decode(IPC::Decoder& decoder) > { > WebCompiledContentRuleListData compiledContentRuleListData; > SharedMemory::Handle handle; > if (!decoder.decode(handle)) >- return std::nullopt; >+ return WTF::nullopt; > compiledContentRuleListData.data = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly); > > if (!decoder.decode(compiledContentRuleListData.conditionsApplyOnlyToDomainOffset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.actionsOffset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.actionsSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.filtersWithoutConditionsBytecodeOffset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.filtersWithoutConditionsBytecodeSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.filtersWithConditionsBytecodeOffset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.filtersWithConditionsBytecodeSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.topURLFiltersBytecodeOffset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(compiledContentRuleListData.topURLFiltersBytecodeSize)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(compiledContentRuleListData); > } >diff --git a/Source/WebKit/Shared/WebCompiledContentRuleListData.h b/Source/WebKit/Shared/WebCompiledContentRuleListData.h >index f4383aa0145588e7624ee549ca8db064e3510474..5c6eb8d6e7b07fbf84dadcc9051c6aa9266b28a8 100644 >--- a/Source/WebKit/Shared/WebCompiledContentRuleListData.h >+++ b/Source/WebKit/Shared/WebCompiledContentRuleListData.h >@@ -58,7 +58,7 @@ public: > } > > void encode(IPC::Encoder&) const; >- static std::optional<WebCompiledContentRuleListData> decode(IPC::Decoder&); >+ static Optional<WebCompiledContentRuleListData> decode(IPC::Decoder&); > > RefPtr<SharedMemory> data; > NetworkCache::Data fileData; >diff --git a/Source/WebKit/Shared/WebContextMenuItemData.cpp b/Source/WebKit/Shared/WebContextMenuItemData.cpp >index fdb4499e28ce6546d87d2ff36867643c69ce7ab9..17dc4ced098785923ab522cae5d4eb9e1864815a 100644 >--- a/Source/WebKit/Shared/WebContextMenuItemData.cpp >+++ b/Source/WebKit/Shared/WebContextMenuItemData.cpp >@@ -108,32 +108,32 @@ void WebContextMenuItemData::encode(IPC::Encoder& encoder) const > encoder << m_submenu; > } > >-std::optional<WebContextMenuItemData> WebContextMenuItemData::decode(IPC::Decoder& decoder) >+Optional<WebContextMenuItemData> WebContextMenuItemData::decode(IPC::Decoder& decoder) > { > WebCore::ContextMenuItemType type; > if (!decoder.decodeEnum(type)) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::ContextMenuAction action; > if (!decoder.decodeEnum(action)) >- return std::nullopt; >+ return WTF::nullopt; > > String title; > if (!decoder.decode(title)) >- return std::nullopt; >+ return WTF::nullopt; > > bool checked; > if (!decoder.decode(checked)) >- return std::nullopt; >+ return WTF::nullopt; > > bool enabled; > if (!decoder.decode(enabled)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<WebContextMenuItemData>> submenu; >+ Optional<Vector<WebContextMenuItemData>> submenu; > decoder >> submenu; > if (!submenu) >- return std::nullopt; >+ return WTF::nullopt; > > switch (type) { > case WebCore::ActionType: >@@ -146,7 +146,7 @@ std::optional<WebContextMenuItemData> WebContextMenuItemData::decode(IPC::Decode > break; > } > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > > Vector<WebContextMenuItemData> kitItems(const Vector<WebCore::ContextMenuItem>& coreItemVector) >diff --git a/Source/WebKit/Shared/WebContextMenuItemData.h b/Source/WebKit/Shared/WebContextMenuItemData.h >index 25ef165939536e941966db8cf65a2a8187208a6a..45e31ae333a7b7a59ff4c15d8f5c93fbc92e9445 100644 >--- a/Source/WebKit/Shared/WebContextMenuItemData.h >+++ b/Source/WebKit/Shared/WebContextMenuItemData.h >@@ -61,7 +61,7 @@ public: > void setUserData(API::Object*); > > void encode(IPC::Encoder&) const; >- static std::optional<WebContextMenuItemData> decode(IPC::Decoder&); >+ static Optional<WebContextMenuItemData> decode(IPC::Decoder&); > > private: > WebCore::ContextMenuItemType m_type; >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index ad227c2517ac86320c8c2d3f915adf6f2dabd9ec..e64b0071169c97c041e9032177d2b7c9da47a301 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -222,17 +222,17 @@ void ArgumentCoder<DOMCacheEngine::CacheInfo>::encode(Encoder& encoder, const DO > encoder << info.name; > } > >-auto ArgumentCoder<DOMCacheEngine::CacheInfo>::decode(Decoder& decoder) -> std::optional<DOMCacheEngine::CacheInfo> >+auto ArgumentCoder<DOMCacheEngine::CacheInfo>::decode(Decoder& decoder) -> Optional<DOMCacheEngine::CacheInfo> > { >- std::optional<uint64_t> identifier; >+ Optional<uint64_t> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> name; >+ Optional<String> name; > decoder >> name; > if (!name) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*identifier), WTFMove(*name) }}; > } >@@ -264,64 +264,64 @@ void ArgumentCoder<DOMCacheEngine::Record>::encode(Encoder& encoder, const DOMCa > }); > } > >-std::optional<DOMCacheEngine::Record> ArgumentCoder<DOMCacheEngine::Record>::decode(Decoder& decoder) >+Optional<DOMCacheEngine::Record> ArgumentCoder<DOMCacheEngine::Record>::decode(Decoder& decoder) > { > uint64_t identifier; > if (!decoder.decode(identifier)) >- return std::nullopt; >+ return WTF::nullopt; > > FetchHeaders::Guard requestHeadersGuard; > if (!decoder.decode(requestHeadersGuard)) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::ResourceRequest request; > if (!decoder.decode(request)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WebCore::FetchOptions> options; >+ Optional<WebCore::FetchOptions> options; > decoder >> options; > if (!options) >- return std::nullopt; >+ return WTF::nullopt; > > String referrer; > if (!decoder.decode(referrer)) >- return std::nullopt; >+ return WTF::nullopt; > > FetchHeaders::Guard responseHeadersGuard; > if (!decoder.decode(responseHeadersGuard)) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::ResourceResponse response; > if (!decoder.decode(response)) >- return std::nullopt; >+ return WTF::nullopt; > > uint64_t updateResponseCounter; > if (!decoder.decode(updateResponseCounter)) >- return std::nullopt; >+ return WTF::nullopt; > > uint64_t responseBodySize; > if (!decoder.decode(responseBodySize)) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::DOMCacheEngine::ResponseBody responseBody; > bool hasSharedBufferBody; > if (!decoder.decode(hasSharedBufferBody)) >- return std::nullopt; >+ return WTF::nullopt; > > if (hasSharedBufferBody) { > RefPtr<SharedBuffer> buffer; > if (!decodeSharedBuffer(decoder, buffer)) >- return std::nullopt; >+ return WTF::nullopt; > if (buffer) > responseBody = buffer.releaseNonNull(); > } else { > bool hasFormDataBody; > if (!decoder.decode(hasFormDataBody)) >- return std::nullopt; >+ return WTF::nullopt; > if (hasFormDataBody) { > auto formData = FormData::decode(decoder); > if (!formData) >- return std::nullopt; >+ return WTF::nullopt; > responseBody = formData.releaseNonNull(); > } > } >@@ -550,11 +550,11 @@ bool ArgumentCoder<FloatPoint>::decode(Decoder& decoder, FloatPoint& floatPoint) > return SimpleArgumentCoder<FloatPoint>::decode(decoder, floatPoint); > } > >-std::optional<FloatPoint> ArgumentCoder<FloatPoint>::decode(Decoder& decoder) >+Optional<FloatPoint> ArgumentCoder<FloatPoint>::decode(Decoder& decoder) > { > FloatPoint floatPoint; > if (!SimpleArgumentCoder<FloatPoint>::decode(decoder, floatPoint)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(floatPoint); > } > >@@ -579,11 +579,11 @@ bool ArgumentCoder<FloatRect>::decode(Decoder& decoder, FloatRect& floatRect) > return SimpleArgumentCoder<FloatRect>::decode(decoder, floatRect); > } > >-std::optional<FloatRect> ArgumentCoder<FloatRect>::decode(Decoder& decoder) >+Optional<FloatRect> ArgumentCoder<FloatRect>::decode(Decoder& decoder) > { > FloatRect floatRect; > if (!SimpleArgumentCoder<FloatRect>::decode(decoder, floatRect)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(floatRect); > } > >@@ -626,11 +626,11 @@ void ArgumentCoder<FloatQuad>::encode(Encoder& encoder, const FloatQuad& floatQu > SimpleArgumentCoder<FloatQuad>::encode(encoder, floatQuad); > } > >-std::optional<FloatQuad> ArgumentCoder<FloatQuad>::decode(Decoder& decoder) >+Optional<FloatQuad> ArgumentCoder<FloatQuad>::decode(Decoder& decoder) > { > FloatQuad floatQuad; > if (!SimpleArgumentCoder<FloatQuad>::decode(decoder, floatQuad)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(floatQuad); > } > >@@ -644,11 +644,11 @@ bool ArgumentCoder<ViewportArguments>::decode(Decoder& decoder, ViewportArgument > return SimpleArgumentCoder<ViewportArguments>::decode(decoder, viewportArguments); > } > >-std::optional<ViewportArguments> ArgumentCoder<ViewportArguments>::decode(Decoder& decoder) >+Optional<ViewportArguments> ArgumentCoder<ViewportArguments>::decode(Decoder& decoder) > { > ViewportArguments viewportArguments; > if (!SimpleArgumentCoder<ViewportArguments>::decode(decoder, viewportArguments)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(viewportArguments); > } > #endif // PLATFORM(IOS_FAMILY) >@@ -664,11 +664,11 @@ bool ArgumentCoder<IntPoint>::decode(Decoder& decoder, IntPoint& intPoint) > return SimpleArgumentCoder<IntPoint>::decode(decoder, intPoint); > } > >-std::optional<WebCore::IntPoint> ArgumentCoder<IntPoint>::decode(Decoder& decoder) >+Optional<WebCore::IntPoint> ArgumentCoder<IntPoint>::decode(Decoder& decoder) > { > IntPoint intPoint; > if (!SimpleArgumentCoder<IntPoint>::decode(decoder, intPoint)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(intPoint); > } > >@@ -682,11 +682,11 @@ bool ArgumentCoder<IntRect>::decode(Decoder& decoder, IntRect& intRect) > return SimpleArgumentCoder<IntRect>::decode(decoder, intRect); > } > >-std::optional<IntRect> ArgumentCoder<IntRect>::decode(Decoder& decoder) >+Optional<IntRect> ArgumentCoder<IntRect>::decode(Decoder& decoder) > { > IntRect rect; > if (!decode(decoder, rect)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(rect); > } > >@@ -700,11 +700,11 @@ bool ArgumentCoder<IntSize>::decode(Decoder& decoder, IntSize& intSize) > return SimpleArgumentCoder<IntSize>::decode(decoder, intSize); > } > >-std::optional<IntSize> ArgumentCoder<IntSize>::decode(Decoder& decoder) >+Optional<IntSize> ArgumentCoder<IntSize>::decode(Decoder& decoder) > { > IntSize intSize; > if (!SimpleArgumentCoder<IntSize>::decode(decoder, intSize)) >- return std::nullopt; >+ return WTF::nullopt; > return WTFMove(intSize); > } > >@@ -835,11 +835,11 @@ bool ArgumentCoder<Path>::decode(Decoder& decoder, Path& path) > return true; > } > >-std::optional<Path> ArgumentCoder<Path>::decode(Decoder& decoder) >+Optional<Path> ArgumentCoder<Path>::decode(Decoder& decoder) > { > Path path; > if (!decode(decoder, path)) >- return std::nullopt; >+ return WTF::nullopt; > > return path; > } >@@ -849,24 +849,24 @@ void ArgumentCoder<RecentSearch>::encode(Encoder& encoder, const RecentSearch& r > encoder << recentSearch.string << recentSearch.time; > } > >-std::optional<RecentSearch> ArgumentCoder<RecentSearch>::decode(Decoder& decoder) >+Optional<RecentSearch> ArgumentCoder<RecentSearch>::decode(Decoder& decoder) > { >- std::optional<String> string; >+ Optional<String> string; > decoder >> string; > if (!string) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WallTime> time; >+ Optional<WallTime> time; > decoder >> time; > if (!time) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*string), WTFMove(*time) }}; > } > > template<> struct ArgumentCoder<Region::Span> { > static void encode(Encoder&, const Region::Span&); >- static std::optional<Region::Span> decode(Decoder&); >+ static Optional<Region::Span> decode(Decoder&); > }; > > void ArgumentCoder<Region::Span>::encode(Encoder& encoder, const Region::Span& span) >@@ -875,15 +875,15 @@ void ArgumentCoder<Region::Span>::encode(Encoder& encoder, const Region::Span& s > encoder << (uint64_t)span.segmentIndex; > } > >-std::optional<Region::Span> ArgumentCoder<Region::Span>::decode(Decoder& decoder) >+Optional<Region::Span> ArgumentCoder<Region::Span>::decode(Decoder& decoder) > { > Region::Span span; > if (!decoder.decode(span.y)) >- return std::nullopt; >+ return WTF::nullopt; > > uint64_t segmentIndex; > if (!decoder.decode(segmentIndex)) >- return std::nullopt; >+ return WTF::nullopt; > > span.segmentIndex = segmentIndex; > return WTFMove(span); >@@ -942,15 +942,15 @@ void ArgumentCoder<MimeClassInfo>::encode(Encoder& encoder, const MimeClassInfo& > encoder << mimeClassInfo.type << mimeClassInfo.desc << mimeClassInfo.extensions; > } > >-std::optional<MimeClassInfo> ArgumentCoder<MimeClassInfo>::decode(Decoder& decoder) >+Optional<MimeClassInfo> ArgumentCoder<MimeClassInfo>::decode(Decoder& decoder) > { > MimeClassInfo mimeClassInfo; > if (!decoder.decode(mimeClassInfo.type)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(mimeClassInfo.desc)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(mimeClassInfo.extensions)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(mimeClassInfo); > } >@@ -970,26 +970,26 @@ void ArgumentCoder<PluginInfo>::encode(Encoder& encoder, const PluginInfo& plugi > #endif > } > >-std::optional<WebCore::PluginInfo> ArgumentCoder<PluginInfo>::decode(Decoder& decoder) >+Optional<WebCore::PluginInfo> ArgumentCoder<PluginInfo>::decode(Decoder& decoder) > { > PluginInfo pluginInfo; > if (!decoder.decode(pluginInfo.name)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(pluginInfo.file)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(pluginInfo.desc)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(pluginInfo.mimes)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(pluginInfo.isApplicationPlugin)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decodeEnum(pluginInfo.clientLoadPolicy)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(pluginInfo.bundleIdentifier)) >- return std::nullopt; >+ return WTF::nullopt; > #if PLATFORM(MAC) > if (!decoder.decode(pluginInfo.versionString)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > return WTFMove(pluginInfo); >@@ -1335,59 +1335,59 @@ void ArgumentCoder<SelectionRect>::encode(Encoder& encoder, const SelectionRect& > encoder << selectionRect.isHorizontal(); > } > >-std::optional<SelectionRect> ArgumentCoder<SelectionRect>::decode(Decoder& decoder) >+Optional<SelectionRect> ArgumentCoder<SelectionRect>::decode(Decoder& decoder) > { > SelectionRect selectionRect; > IntRect rect; > if (!decoder.decode(rect)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setRect(rect); > > uint32_t direction; > if (!decoder.decode(direction)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setDirection((TextDirection)direction); > > int intValue; > if (!decoder.decode(intValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setMinX(intValue); > > if (!decoder.decode(intValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setMaxX(intValue); > > if (!decoder.decode(intValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setMaxY(intValue); > > if (!decoder.decode(intValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setLineNumber(intValue); > > bool boolValue; > if (!decoder.decode(boolValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setIsLineBreak(boolValue); > > if (!decoder.decode(boolValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setIsFirstOnLine(boolValue); > > if (!decoder.decode(boolValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setIsLastOnLine(boolValue); > > if (!decoder.decode(boolValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setContainsStart(boolValue); > > if (!decoder.decode(boolValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setContainsEnd(boolValue); > > if (!decoder.decode(boolValue)) >- return std::nullopt; >+ return WTF::nullopt; > selectionRect.setIsHorizontal(boolValue); > > return WTFMove(selectionRect); >@@ -1507,11 +1507,11 @@ bool ArgumentCoder<Color>::decode(Decoder& decoder, Color& color) > return true; > } > >-std::optional<Color> ArgumentCoder<Color>::decode(Decoder& decoder) >+Optional<Color> ArgumentCoder<Color>::decode(Decoder& decoder) > { > Color color; > if (!decode(decoder, color)) >- return std::nullopt; >+ return WTF::nullopt; > > return color; > } >@@ -1577,18 +1577,18 @@ void ArgumentCoder<CompositionUnderline>::encode(Encoder& encoder, const Composi > encoder << underline.color; > } > >-std::optional<CompositionUnderline> ArgumentCoder<CompositionUnderline>::decode(Decoder& decoder) >+Optional<CompositionUnderline> ArgumentCoder<CompositionUnderline>::decode(Decoder& decoder) > { > CompositionUnderline underline; > > if (!decoder.decode(underline.startOffset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(underline.endOffset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(underline.thick)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(underline.color)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(underline); > } >@@ -1621,11 +1621,11 @@ bool ArgumentCoder<DatabaseDetails>::decode(Decoder& decoder, DatabaseDetails& d > if (!decoder.decode(currentUsage)) > return false; > >- std::optional<WallTime> creationTime; >+ Optional<WallTime> creationTime; > if (!decoder.decode(creationTime)) > return false; > >- std::optional<WallTime> modificationTime; >+ Optional<WallTime> modificationTime; > if (!decoder.decode(modificationTime)) > return false; > >@@ -1849,22 +1849,22 @@ void ArgumentCoder<DictationAlternative>::encode(Encoder& encoder, const Dictati > encoder << dictationAlternative.dictationContext; > } > >-std::optional<DictationAlternative> ArgumentCoder<DictationAlternative>::decode(Decoder& decoder) >+Optional<DictationAlternative> ArgumentCoder<DictationAlternative>::decode(Decoder& decoder) > { >- std::optional<unsigned> rangeStart; >+ Optional<unsigned> rangeStart; > decoder >> rangeStart; > if (!rangeStart) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<unsigned> rangeLength; >+ Optional<unsigned> rangeLength; > decoder >> rangeLength; > if (!rangeLength) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> dictationContext; >+ Optional<uint64_t> dictationContext; > decoder >> dictationContext; > if (!dictationContext) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*rangeStart), WTFMove(*rangeLength), WTFMove(*dictationContext) }}; > } >@@ -1942,27 +1942,27 @@ void ArgumentCoder<GrammarDetail>::encode(Encoder& encoder, const GrammarDetail& > encoder << detail.userDescription; > } > >-std::optional<GrammarDetail> ArgumentCoder<GrammarDetail>::decode(Decoder& decoder) >+Optional<GrammarDetail> ArgumentCoder<GrammarDetail>::decode(Decoder& decoder) > { >- std::optional<int> location; >+ Optional<int> location; > decoder >> location; > if (!location) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> length; >+ Optional<int> length; > decoder >> length; > if (!length) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<String>> guesses; >+ Optional<Vector<String>> guesses; > decoder >> guesses; > if (!guesses) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> userDescription; >+ Optional<String> userDescription; > decoder >> userDescription; > if (!userDescription) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*location), WTFMove(*length), WTFMove(*guesses), WTFMove(*userDescription) }}; > } >@@ -2006,31 +2006,31 @@ void ArgumentCoder<TextCheckingResult>::encode(Encoder& encoder, const TextCheck > encoder << result.replacement; > } > >-std::optional<TextCheckingResult> ArgumentCoder<TextCheckingResult>::decode(Decoder& decoder) >+Optional<TextCheckingResult> ArgumentCoder<TextCheckingResult>::decode(Decoder& decoder) > { > TextCheckingType type; > if (!decoder.decodeEnum(type)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> location; >+ Optional<int> location; > decoder >> location; > if (!location) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> length; >+ Optional<int> length; > decoder >> length; > if (!length) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<GrammarDetail>> details; >+ Optional<Vector<GrammarDetail>> details; > decoder >> details; > if (!details) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> replacement; >+ Optional<String> replacement; > decoder >> replacement; > if (!replacement) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(type), WTFMove(*location), WTFMove(*length), WTFMove(*details), WTFMove(*replacement) }}; > } >@@ -2405,33 +2405,33 @@ void ArgumentCoder<BlobPart>::encode(Encoder& encoder, const BlobPart& blobPart) > } > } > >-std::optional<BlobPart> ArgumentCoder<BlobPart>::decode(Decoder& decoder) >+Optional<BlobPart> ArgumentCoder<BlobPart>::decode(Decoder& decoder) > { > BlobPart blobPart; > >- std::optional<uint32_t> type; >+ Optional<uint32_t> type; > decoder >> type; > if (!type) >- return std::nullopt; >+ return WTF::nullopt; > > switch (*type) { > case BlobPart::Data: { >- std::optional<Vector<uint8_t>> data; >+ Optional<Vector<uint8_t>> data; > decoder >> data; > if (!data) >- return std::nullopt; >+ return WTF::nullopt; > blobPart = BlobPart(WTFMove(*data)); > break; > } > case BlobPart::Blob: { > URL url; > if (!decoder.decode(url)) >- return std::nullopt; >+ return WTF::nullopt; > blobPart = BlobPart(url); > break; > } > default: >- return std::nullopt; >+ return WTF::nullopt; > } > > return WTFMove(blobPart); >@@ -2453,43 +2453,43 @@ void ArgumentCoder<TextIndicatorData>::encode(Encoder& encoder, const TextIndica > encodeOptionalImage(encoder, textIndicatorData.contentImageWithoutSelection.get()); > } > >-std::optional<TextIndicatorData> ArgumentCoder<TextIndicatorData>::decode(Decoder& decoder) >+Optional<TextIndicatorData> ArgumentCoder<TextIndicatorData>::decode(Decoder& decoder) > { > TextIndicatorData textIndicatorData; > if (!decoder.decode(textIndicatorData.selectionRectInRootViewCoordinates)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(textIndicatorData.textBoundingRectInRootViewCoordinates)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(textIndicatorData.textRectsInBoundingRectCoordinates)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(textIndicatorData.contentImageWithoutSelectionRectInRootViewCoordinates)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(textIndicatorData.contentImageScaleFactor)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(textIndicatorData.estimatedBackgroundColor)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(textIndicatorData.presentationTransition)) >- return std::nullopt; >+ return WTF::nullopt; > > uint64_t options; > if (!decoder.decode(options)) >- return std::nullopt; >+ return WTF::nullopt; > textIndicatorData.options = static_cast<TextIndicatorOptions>(options); > > if (!decodeOptionalImage(decoder, textIndicatorData.contentImage)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decodeOptionalImage(decoder, textIndicatorData.contentImageWithHighlight)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decodeOptionalImage(decoder, textIndicatorData.contentImageWithoutSelection)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(textIndicatorData); > } >@@ -2564,7 +2564,7 @@ bool ArgumentCoder<DictionaryPopupInfo>::decode(IPC::Decoder& decoder, Dictionar > if (!decoder.decode(result.origin)) > return false; > >- std::optional<TextIndicatorData> textIndicator; >+ Optional<TextIndicatorData> textIndicator; > decoder >> textIndicator; > if (!textIndicator) > return false; >@@ -2659,81 +2659,81 @@ void ArgumentCoder<ResourceLoadStatistics>::encode(Encoder& encoder, const WebCo > > } > >-std::optional<ResourceLoadStatistics> ArgumentCoder<ResourceLoadStatistics>::decode(Decoder& decoder) >+Optional<ResourceLoadStatistics> ArgumentCoder<ResourceLoadStatistics>::decode(Decoder& decoder) > { > ResourceLoadStatistics statistics; > if (!decoder.decode(statistics.highLevelDomain)) >- return std::nullopt; >+ return WTF::nullopt; > > double lastSeenTimeAsDouble; > if (!decoder.decode(lastSeenTimeAsDouble)) >- return std::nullopt; >+ return WTF::nullopt; > statistics.lastSeen = WallTime::fromRawSeconds(lastSeenTimeAsDouble); > > // User interaction > if (!decoder.decode(statistics.hadUserInteraction)) >- return std::nullopt; >+ return WTF::nullopt; > > double mostRecentUserInteractionTimeAsDouble; > if (!decoder.decode(mostRecentUserInteractionTimeAsDouble)) >- return std::nullopt; >+ return WTF::nullopt; > statistics.mostRecentUserInteractionTime = WallTime::fromRawSeconds(mostRecentUserInteractionTimeAsDouble); > > if (!decoder.decode(statistics.grandfathered)) >- return std::nullopt; >+ return WTF::nullopt; > > // Storage access > if (!decoder.decode(statistics.storageAccessUnderTopFrameOrigins)) >- return std::nullopt; >+ return WTF::nullopt; > > // Top frame stats > if (!decoder.decode(statistics.topFrameUniqueRedirectsTo)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.topFrameUniqueRedirectsFrom)) >- return std::nullopt; >+ return WTF::nullopt; > > // Subframe stats > if (!decoder.decode(statistics.subframeUnderTopFrameOrigins)) >- return std::nullopt; >+ return WTF::nullopt; > > // Subresource stats > if (!decoder.decode(statistics.subresourceUnderTopFrameOrigins)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.subresourceUniqueRedirectsTo)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.subresourceUniqueRedirectsFrom)) >- return std::nullopt; >+ return WTF::nullopt; > > // Prevalent Resource > if (!decoder.decode(statistics.isPrevalentResource)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.isVeryPrevalentResource)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.dataRecordsRemoved)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.fontsFailedToLoad)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.fontsSuccessfullyLoaded)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.topFrameRegistrableDomainsWhichAccessedWebAPIs)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.canvasActivityRecord)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.navigatorFunctionsAccessed)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(statistics.screenFunctionsAccessed)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(statistics); > } >@@ -2748,7 +2748,7 @@ void ArgumentCoder<MediaConstraints>::encode(Encoder& encoder, const WebCore::Me > > bool ArgumentCoder<MediaConstraints>::decode(Decoder& decoder, WebCore::MediaConstraints& constraints) > { >- std::optional<WebCore::MediaTrackConstraintSetMap> mandatoryConstraints; >+ Optional<WebCore::MediaTrackConstraintSetMap> mandatoryConstraints; > decoder >> mandatoryConstraints; > if (!mandatoryConstraints) > return false; >@@ -2806,14 +2806,14 @@ bool ArgumentCoder<ServiceWorkerOrClientData>::decode(Decoder& decoder, ServiceW > if (!decoder.decode(isServiceWorkerData)) > return false; > if (isServiceWorkerData) { >- std::optional<ServiceWorkerData> workerData; >+ Optional<ServiceWorkerData> workerData; > decoder >> workerData; > if (!workerData) > return false; > > data = WTFMove(*workerData); > } else { >- std::optional<ServiceWorkerClientData> clientData; >+ Optional<ServiceWorkerClientData> clientData; > decoder >> clientData; > if (!clientData) > return false; >@@ -2839,14 +2839,14 @@ bool ArgumentCoder<ServiceWorkerOrClientIdentifier>::decode(Decoder& decoder, Se > if (!decoder.decode(isServiceWorkerIdentifier)) > return false; > if (isServiceWorkerIdentifier) { >- std::optional<ServiceWorkerIdentifier> workerIdentifier; >+ Optional<ServiceWorkerIdentifier> workerIdentifier; > decoder >> workerIdentifier; > if (!workerIdentifier) > return false; > > identifier = WTFMove(*workerIdentifier); > } else { >- std::optional<ServiceWorkerClientIdentifier> clientIdentifier; >+ Optional<ServiceWorkerClientIdentifier> clientIdentifier; > decoder >> clientIdentifier; > if (!clientIdentifier) > return false; >@@ -2865,16 +2865,16 @@ void ArgumentCoder<ScrollOffsetRange<float>>::encode(Encoder& encoder, const Scr > encoder << range.end; > } > >-auto ArgumentCoder<ScrollOffsetRange<float>>::decode(Decoder& decoder) -> std::optional<WebCore::ScrollOffsetRange<float>> >+auto ArgumentCoder<ScrollOffsetRange<float>>::decode(Decoder& decoder) -> Optional<WebCore::ScrollOffsetRange<float>> > { > WebCore::ScrollOffsetRange<float> range; > float start; > if (!decoder.decode(start)) >- return std::nullopt; >+ return WTF::nullopt; > > float end; > if (!decoder.decode(end)) >- return std::nullopt; >+ return WTF::nullopt; > > range.start = start; > range.end = end; >@@ -2889,17 +2889,17 @@ void ArgumentCoder<MediaSelectionOption>::encode(Encoder& encoder, const MediaSe > encoder << option.type; > } > >-std::optional<MediaSelectionOption> ArgumentCoder<MediaSelectionOption>::decode(Decoder& decoder) >+Optional<MediaSelectionOption> ArgumentCoder<MediaSelectionOption>::decode(Decoder& decoder) > { >- std::optional<String> displayName; >+ Optional<String> displayName; > decoder >> displayName; > if (!displayName) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<MediaSelectionOption::Type> type; >+ Optional<MediaSelectionOption::Type> type; > decoder >> type; > if (!type) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*displayName), WTFMove(*type) }}; > } >@@ -2973,41 +2973,41 @@ void ArgumentCoder<FontAttributes>::encode(Encoder& encoder, const FontAttribute > #endif > } > >-std::optional<FontAttributes> ArgumentCoder<FontAttributes>::decode(Decoder& decoder) >+Optional<FontAttributes> ArgumentCoder<FontAttributes>::decode(Decoder& decoder) > { > FontAttributes attributes; > > if (!decoder.decode(attributes.backgroundColor)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(attributes.foregroundColor)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(attributes.fontShadow)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(attributes.hasUnderline)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(attributes.hasStrikeThrough)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(attributes.textLists)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(attributes.horizontalAlignment)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(attributes.subscriptOrSuperscript)) >- return std::nullopt; >+ return WTF::nullopt; > > #if PLATFORM(COCOA) > bool hasFont = false; > if (!decoder.decode(hasFont)) >- return std::nullopt; >+ return WTF::nullopt; > > if (hasFont && !IPC::decode(decoder, attributes.font)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > return attributes; >@@ -3020,19 +3020,19 @@ void ArgumentCoder<SerializedAttachmentData>::encode(IPC::Encoder& encoder, cons > encoder << data.identifier << data.mimeType << IPC::SharedBufferDataReference { data.data.get() }; > } > >-std::optional<SerializedAttachmentData> ArgumentCoder<WebCore::SerializedAttachmentData>::decode(IPC::Decoder& decoder) >+Optional<SerializedAttachmentData> ArgumentCoder<WebCore::SerializedAttachmentData>::decode(IPC::Decoder& decoder) > { > String identifier; > if (!decoder.decode(identifier)) >- return std::nullopt; >+ return WTF::nullopt; > > String mimeType; > if (!decoder.decode(mimeType)) >- return std::nullopt; >+ return WTF::nullopt; > > IPC::DataReference data; > if (!decoder.decode(data)) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(identifier), WTFMove(mimeType), WebCore::SharedBuffer::create(data.data(), data.size()) }}; > } >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.h b/Source/WebKit/Shared/WebCoreArgumentCoders.h >index 3a3ea994910869f57ca2886f9f7dd5c48e799038..66387a6af81dcf93aa5735f0619698c0a7252f5c 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.h >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.h >@@ -190,12 +190,12 @@ template<> struct ArgumentCoder<WebCore::CacheQueryOptions> { > > template<> struct ArgumentCoder<WebCore::DOMCacheEngine::CacheInfo> { > static void encode(Encoder&, const WebCore::DOMCacheEngine::CacheInfo&); >- static std::optional<WebCore::DOMCacheEngine::CacheInfo> decode(Decoder&); >+ static Optional<WebCore::DOMCacheEngine::CacheInfo> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::DOMCacheEngine::Record> { > static void encode(Encoder&, const WebCore::DOMCacheEngine::Record&); >- static std::optional<WebCore::DOMCacheEngine::Record> decode(Decoder&); >+ static Optional<WebCore::DOMCacheEngine::Record> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::EventTrackingRegions> { >@@ -236,7 +236,7 @@ template<> struct ArgumentCoder<WebCore::CertificateInfo> { > template<> struct ArgumentCoder<WebCore::FloatPoint> { > static void encode(Encoder&, const WebCore::FloatPoint&); > static bool decode(Decoder&, WebCore::FloatPoint&); >- static std::optional<WebCore::FloatPoint> decode(Decoder&); >+ static Optional<WebCore::FloatPoint> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::FloatPoint3D> { >@@ -247,7 +247,7 @@ template<> struct ArgumentCoder<WebCore::FloatPoint3D> { > template<> struct ArgumentCoder<WebCore::FloatRect> { > static void encode(Encoder&, const WebCore::FloatRect&); > static bool decode(Decoder&, WebCore::FloatRect&); >- static std::optional<WebCore::FloatRect> decode(Decoder&); >+ static Optional<WebCore::FloatRect> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::FloatBoxExtent> { >@@ -268,32 +268,32 @@ template<> struct ArgumentCoder<WebCore::FloatRoundedRect> { > #if PLATFORM(IOS_FAMILY) > template<> struct ArgumentCoder<WebCore::FloatQuad> { > static void encode(Encoder&, const WebCore::FloatQuad&); >- static std::optional<WebCore::FloatQuad> decode(Decoder&); >+ static Optional<WebCore::FloatQuad> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::ViewportArguments> { > static void encode(Encoder&, const WebCore::ViewportArguments&); > static bool decode(Decoder&, WebCore::ViewportArguments&); >- static std::optional<WebCore::ViewportArguments> decode(Decoder&); >+ static Optional<WebCore::ViewportArguments> decode(Decoder&); > }; > #endif // PLATFORM(IOS_FAMILY) > > template<> struct ArgumentCoder<WebCore::IntPoint> { > static void encode(Encoder&, const WebCore::IntPoint&); > static bool decode(Decoder&, WebCore::IntPoint&); >- static std::optional<WebCore::IntPoint> decode(Decoder&); >+ static Optional<WebCore::IntPoint> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::IntRect> { > static void encode(Encoder&, const WebCore::IntRect&); > static bool decode(Decoder&, WebCore::IntRect&); >- static std::optional<WebCore::IntRect> decode(Decoder&); >+ static Optional<WebCore::IntRect> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::IntSize> { > static void encode(Encoder&, const WebCore::IntSize&); > static bool decode(Decoder&, WebCore::IntSize&); >- static std::optional<WebCore::IntSize> decode(Decoder&); >+ static Optional<WebCore::IntSize> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::LayoutSize> { >@@ -309,7 +309,7 @@ template<> struct ArgumentCoder<WebCore::LayoutPoint> { > template<> struct ArgumentCoder<WebCore::Path> { > static void encode(Encoder&, const WebCore::Path&); > static bool decode(Decoder&, WebCore::Path&); >- static std::optional<WebCore::Path> decode(Decoder&); >+ static Optional<WebCore::Path> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::Region> { >@@ -329,12 +329,12 @@ template<> struct ArgumentCoder<WebCore::ViewportAttributes> { > > template<> struct ArgumentCoder<WebCore::MimeClassInfo> { > static void encode(Encoder&, const WebCore::MimeClassInfo&); >- static std::optional<WebCore::MimeClassInfo> decode(Decoder&); >+ static Optional<WebCore::MimeClassInfo> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PluginInfo> { > static void encode(Encoder&, const WebCore::PluginInfo&); >- static std::optional<WebCore::PluginInfo> decode(Decoder&); >+ static Optional<WebCore::PluginInfo> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::AuthenticationChallenge> { >@@ -383,7 +383,7 @@ template<> struct ArgumentCoder<WebCore::WindowFeatures> { > template<> struct ArgumentCoder<WebCore::Color> { > static void encode(Encoder&, const WebCore::Color&); > static bool decode(Decoder&, WebCore::Color&); >- static std::optional<WebCore::Color> decode(Decoder&); >+ static Optional<WebCore::Color> decode(Decoder&); > }; > > #if ENABLE(DRAG_SUPPORT) >@@ -402,14 +402,14 @@ template<> struct ArgumentCoder<WTF::MachSendRight> { > > template<> struct ArgumentCoder<WebCore::KeypressCommand> { > static void encode(Encoder&, const WebCore::KeypressCommand&); >- static std::optional<WebCore::KeypressCommand> decode(Decoder&); >+ static Optional<WebCore::KeypressCommand> decode(Decoder&); > }; > #endif > > #if PLATFORM(IOS_FAMILY) > template<> struct ArgumentCoder<WebCore::SelectionRect> { > static void encode(Encoder&, const WebCore::SelectionRect&); >- static std::optional<WebCore::SelectionRect> decode(Decoder&); >+ static Optional<WebCore::SelectionRect> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::Highlight> { >@@ -455,13 +455,13 @@ template<> struct ArgumentCoder<WebCore::PasteboardWebContent> { > #if USE(CURL) > template<> struct ArgumentCoder<WebCore::CurlProxySettings> { > static void encode(Encoder&, const WebCore::CurlProxySettings&); >- static std::optional<WebCore::CurlProxySettings> decode(Decoder&); >+ static Optional<WebCore::CurlProxySettings> decode(Decoder&); > }; > #endif > > template<> struct ArgumentCoder<WebCore::CompositionUnderline> { > static void encode(Encoder&, const WebCore::CompositionUnderline&); >- static std::optional<WebCore::CompositionUnderline> decode(Decoder&); >+ static Optional<WebCore::CompositionUnderline> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::DatabaseDetails> { >@@ -478,7 +478,7 @@ template<> struct ArgumentCoder<WebCore::DataListSuggestionInformation> { > > template<> struct ArgumentCoder<WebCore::DictationAlternative> { > static void encode(Encoder&, const WebCore::DictationAlternative&); >- static std::optional<WebCore::DictationAlternative> decode(Decoder&); >+ static Optional<WebCore::DictationAlternative> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::FileChooserSettings> { >@@ -498,7 +498,7 @@ template<> struct ArgumentCoder<WebCore::ShareDataWithParsedURL> { > > template<> struct ArgumentCoder<WebCore::GrammarDetail> { > static void encode(Encoder&, const WebCore::GrammarDetail&); >- static std::optional<WebCore::GrammarDetail> decode(Decoder&); >+ static Optional<WebCore::GrammarDetail> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::TextCheckingRequestData> { >@@ -508,7 +508,7 @@ template<> struct ArgumentCoder<WebCore::TextCheckingRequestData> { > > template<> struct ArgumentCoder<WebCore::TextCheckingResult> { > static void encode(Encoder&, const WebCore::TextCheckingResult&); >- static std::optional<WebCore::TextCheckingResult> decode(Decoder&); >+ static Optional<WebCore::TextCheckingResult> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::UserStyleSheet> { >@@ -545,7 +545,7 @@ bool decodeFilterOperation(Decoder&, RefPtr<WebCore::FilterOperation>&); > > template<> struct ArgumentCoder<WebCore::BlobPart> { > static void encode(Encoder&, const WebCore::BlobPart&); >- static std::optional<WebCore::BlobPart> decode(Decoder&); >+ static Optional<WebCore::BlobPart> decode(Decoder&); > }; > > #if ENABLE(CONTENT_FILTERING) >@@ -564,7 +564,7 @@ template<> struct ArgumentCoder<WebCore::MediaSessionMetadata> { > > template<> struct ArgumentCoder<WebCore::TextIndicatorData> { > static void encode(Encoder&, const WebCore::TextIndicatorData&); >- static std::optional<WebCore::TextIndicatorData> decode(Decoder&); >+ static Optional<WebCore::TextIndicatorData> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::DictionaryPopupInfo> { >@@ -583,7 +583,7 @@ template<> struct ArgumentCoder<WebCore::MediaPlaybackTargetContext> { > > template<> struct ArgumentCoder<WebCore::RecentSearch> { > static void encode(Encoder&, const WebCore::RecentSearch&); >- static std::optional<WebCore::RecentSearch> decode(Decoder&); >+ static Optional<WebCore::RecentSearch> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::ExceptionDetails> { >@@ -593,44 +593,44 @@ template<> struct ArgumentCoder<WebCore::ExceptionDetails> { > > template<> struct ArgumentCoder<WebCore::ResourceLoadStatistics> { > static void encode(Encoder&, const WebCore::ResourceLoadStatistics&); >- static std::optional<WebCore::ResourceLoadStatistics> decode(Decoder&); >+ static Optional<WebCore::ResourceLoadStatistics> decode(Decoder&); > }; > > #if ENABLE(APPLE_PAY) > > template<> struct ArgumentCoder<WebCore::Payment> { > static void encode(Encoder&, const WebCore::Payment&); >- static std::optional<WebCore::Payment> decode(Decoder&); >+ static Optional<WebCore::Payment> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PaymentAuthorizationResult> { > static void encode(Encoder&, const WebCore::PaymentAuthorizationResult&); >- static std::optional<WebCore::PaymentAuthorizationResult> decode(Decoder&); >+ static Optional<WebCore::PaymentAuthorizationResult> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PaymentContact> { > static void encode(Encoder&, const WebCore::PaymentContact&); >- static std::optional<WebCore::PaymentContact> decode(Decoder&); >+ static Optional<WebCore::PaymentContact> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PaymentError> { > static void encode(Encoder&, const WebCore::PaymentError&); >- static std::optional<WebCore::PaymentError> decode(Decoder&); >+ static Optional<WebCore::PaymentError> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PaymentMerchantSession> { > static void encode(Encoder&, const WebCore::PaymentMerchantSession&); >- static std::optional<WebCore::PaymentMerchantSession> decode(Decoder&); >+ static Optional<WebCore::PaymentMerchantSession> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PaymentMethod> { > static void encode(Encoder&, const WebCore::PaymentMethod&); >- static std::optional<WebCore::PaymentMethod> decode(Decoder&); >+ static Optional<WebCore::PaymentMethod> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PaymentMethodUpdate> { > static void encode(Encoder&, const WebCore::PaymentMethodUpdate&); >- static std::optional<WebCore::PaymentMethodUpdate> decode(Decoder&); >+ static Optional<WebCore::PaymentMethodUpdate> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest> { >@@ -645,7 +645,7 @@ template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ContactF > > template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::LineItem> { > static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::LineItem&); >- static std::optional<WebCore::ApplePaySessionPaymentRequest::LineItem> decode(Decoder&); >+ static Optional<WebCore::ApplePaySessionPaymentRequest::LineItem> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities> { >@@ -655,22 +655,22 @@ template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::Merchant > > template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> { > static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); >- static std::optional<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> decode(Decoder&); >+ static Optional<WebCore::ApplePaySessionPaymentRequest::ShippingMethod> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> { > static void encode(Encoder&, const WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems&); >- static std::optional<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> decode(Decoder&); >+ static Optional<WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::ShippingContactUpdate> { > static void encode(Encoder&, const WebCore::ShippingContactUpdate&); >- static std::optional<WebCore::ShippingContactUpdate> decode(Decoder&); >+ static Optional<WebCore::ShippingContactUpdate> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::ShippingMethodUpdate> { > static void encode(Encoder&, const WebCore::ShippingMethodUpdate&); >- static std::optional<WebCore::ShippingMethodUpdate> decode(Decoder&); >+ static Optional<WebCore::ShippingMethodUpdate> decode(Decoder&); > }; > > #endif >@@ -709,14 +709,14 @@ template<> struct ArgumentCoder<WebCore::ServiceWorkerOrClientIdentifier> { > > template<> struct ArgumentCoder<WebCore::ScrollOffsetRange<float>> { > static void encode(Encoder&, const WebCore::ScrollOffsetRange<float>&); >- static std::optional<WebCore::ScrollOffsetRange<float>> decode(Decoder&); >+ static Optional<WebCore::ScrollOffsetRange<float>> decode(Decoder&); > }; > > #endif > > template<> struct ArgumentCoder<WebCore::MediaSelectionOption> { > static void encode(Encoder&, const WebCore::MediaSelectionOption&); >- static std::optional<WebCore::MediaSelectionOption> decode(Decoder&); >+ static Optional<WebCore::MediaSelectionOption> decode(Decoder&); > }; > > template<> struct ArgumentCoder<WebCore::PromisedAttachmentInfo> { >@@ -731,14 +731,14 @@ template<> struct ArgumentCoder<Vector<RefPtr<WebCore::SecurityOrigin>>> { > > template<> struct ArgumentCoder<WebCore::FontAttributes> { > static void encode(Encoder&, const WebCore::FontAttributes&); >- static std::optional<WebCore::FontAttributes> decode(Decoder&); >+ static Optional<WebCore::FontAttributes> decode(Decoder&); > }; > > #if ENABLE(ATTACHMENT_ELEMENT) > > template<> struct ArgumentCoder<WebCore::SerializedAttachmentData> { > static void encode(Encoder&, const WebCore::SerializedAttachmentData&); >- static std::optional<WebCore::SerializedAttachmentData> decode(Decoder&); >+ static Optional<WebCore::SerializedAttachmentData> decode(Decoder&); > }; > > #endif // ENABLE(ATTACHMENT_ELEMENT) >diff --git a/Source/WebKit/Shared/WebEvent.h b/Source/WebKit/Shared/WebEvent.h >index 6c18f8c23ebe74dd483972060328bfc410052062..ff38638f4d20b1f5deef5293f2530aa4923fd9e6 100644 >--- a/Source/WebKit/Shared/WebEvent.h >+++ b/Source/WebKit/Shared/WebEvent.h >@@ -367,7 +367,7 @@ public: > #endif > > void encode(IPC::Encoder&) const; >- static std::optional<WebPlatformTouchPoint> decode(IPC::Decoder&); >+ static Optional<WebPlatformTouchPoint> decode(IPC::Decoder&); > > private: > unsigned m_identifier; >@@ -460,7 +460,7 @@ public: > void setState(TouchPointState state) { m_state = state; } > > void encode(IPC::Encoder&) const; >- static std::optional<WebPlatformTouchPoint> decode(IPC::Decoder&); >+ static Optional<WebPlatformTouchPoint> decode(IPC::Decoder&); > > private: > uint32_t m_id; >diff --git a/Source/WebKit/Shared/WebGeolocationPosition.h b/Source/WebKit/Shared/WebGeolocationPosition.h >index 418ac363147e4409e42dffc1ad81b14b1c528e26..c1fcca7cbb58be44069a71eb982a815e29c636c4 100644 >--- a/Source/WebKit/Shared/WebGeolocationPosition.h >+++ b/Source/WebKit/Shared/WebGeolocationPosition.h >@@ -47,10 +47,10 @@ public: > double latitude() const { return m_corePosition.latitude; } > double longitude() const { return m_corePosition.longitude; } > double accuracy() const { return m_corePosition.accuracy; } >- std::optional<double> altitude() const { return m_corePosition.altitude; } >- std::optional<double> altitudeAccuracy() const { return m_corePosition.altitudeAccuracy; } >- std::optional<double> heading() const { return m_corePosition.heading; } >- std::optional<double> speed() const { return m_corePosition.speed; } >+ Optional<double> altitude() const { return m_corePosition.altitude; } >+ Optional<double> altitudeAccuracy() const { return m_corePosition.altitudeAccuracy; } >+ Optional<double> heading() const { return m_corePosition.heading; } >+ Optional<double> speed() const { return m_corePosition.speed; } > > const WebCore::GeolocationPosition& corePosition() const { return m_corePosition; } > >diff --git a/Source/WebKit/Shared/WebHitTestResultData.cpp b/Source/WebKit/Shared/WebHitTestResultData.cpp >index ada3f51a2cf971d98bd887b84c159a0e9cb35186..866e92cc4a60e2329df1b6ed2eaa490881690f6a 100644 >--- a/Source/WebKit/Shared/WebHitTestResultData.cpp >+++ b/Source/WebKit/Shared/WebHitTestResultData.cpp >@@ -159,7 +159,7 @@ bool WebHitTestResultData::decode(IPC::Decoder& decoder, WebHitTestResultData& h > return false; > > if (hasLinkTextIndicator) { >- std::optional<WebCore::TextIndicatorData> indicatorData; >+ Optional<WebCore::TextIndicatorData> indicatorData; > decoder >> indicatorData; > if (!indicatorData) > return false; >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.cpp b/Source/WebKit/Shared/WebPageCreationParameters.cpp >index 3ea064ab0afc050084ad734632bdcaeccf9a9e19..806cb0301e8c519903b4be05edf7aad42c0ddc13 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebPageCreationParameters.cpp >@@ -122,229 +122,229 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const > #endif > } > >-std::optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decoder& decoder) >+Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decoder& decoder) > { > WebPageCreationParameters parameters; > if (!decoder.decode(parameters.viewSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.activityState)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.store)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decodeEnum(parameters.drawingAreaType)) >- return std::nullopt; >- std::optional<WebPageGroupData> pageGroupData; >+ return WTF::nullopt; >+ Optional<WebPageGroupData> pageGroupData; > decoder >> pageGroupData; > if (!pageGroupData) >- return std::nullopt; >+ return WTF::nullopt; > parameters.pageGroupData = WTFMove(*pageGroupData); > if (!decoder.decode(parameters.drawsBackground)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.isEditable)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.underlayColor)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.useFixedLayout)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.fixedLayoutSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.alwaysShowsHorizontalScroller)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.alwaysShowsVerticalScroller)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decodeEnum(parameters.paginationMode)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.paginationBehavesLikeColumns)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.pageLength)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.gapBetweenPages)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.paginationLineGridEnabled)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> userAgent; >+ Optional<String> userAgent; > decoder >> userAgent; > if (!userAgent) >- return std::nullopt; >+ return WTF::nullopt; > parameters.userAgent = WTFMove(*userAgent); > >- std::optional<Vector<BackForwardListItemState>> itemStates; >+ Optional<Vector<BackForwardListItemState>> itemStates; > decoder >> itemStates; > if (!itemStates) >- return std::nullopt; >+ return WTF::nullopt; > parameters.itemStates = WTFMove(*itemStates); > > if (!decoder.decode(parameters.sessionID)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> userContentControllerIdentifier; >+ Optional<uint64_t> userContentControllerIdentifier; > decoder >> userContentControllerIdentifier; > if (!userContentControllerIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > parameters.userContentControllerID = makeObjectIdentifier<UserContentControllerIdentifierType>(*userContentControllerIdentifier); > > if (!decoder.decode(parameters.visitedLinkTableID)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.websiteDataStoreID)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.canRunBeforeUnloadConfirmPanel)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.canRunModal)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.deviceScaleFactor)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.viewScaleFactor)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.topContentInset)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.mediaVolume)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.muted)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.mayStartMediaWhenInWindow)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.viewLayoutSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.autoSizingShouldExpandToViewHeight)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.viewportSizeForCSSViewportUnits)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decodeEnum(parameters.scrollPinningBehavior)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<uint32_t>> scrollbarOverlayStyle; >+ Optional<Optional<uint32_t>> scrollbarOverlayStyle; > decoder >> scrollbarOverlayStyle; > if (!scrollbarOverlayStyle) >- return std::nullopt; >+ return WTF::nullopt; > parameters.scrollbarOverlayStyle = WTFMove(*scrollbarOverlayStyle); > > if (!decoder.decode(parameters.backgroundExtendsBeyondPage)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decodeEnum(parameters.layerHostingMode)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.mimeTypesWithCustomContentProviders)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.controlledByAutomation)) >- return std::nullopt; >+ return WTF::nullopt; > > #if PLATFORM(MAC) > if (!decoder.decode(parameters.colorSpace)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.useSystemAppearance)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.useDarkAppearance)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.shouldDelayAttachingDrawingArea)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > #if PLATFORM(IOS_FAMILY) > if (!decoder.decode(parameters.screenSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.availableScreenSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.overrideScreenSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.textAutosizingWidth)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.ignoresViewportScaleLimits)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.viewportConfigurationViewLayoutSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.viewportConfigurationLayoutSizeScaleFactor)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.viewportConfigurationViewSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.maximumUnobscuredSize)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.deviceOrientation)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > #if PLATFORM(COCOA) > if (!decoder.decode(parameters.smartInsertDeleteEnabled)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.additionalSupportedImageTypes)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > if (!decoder.decode(parameters.appleMailPaginationQuirkEnabled)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(parameters.appleMailLinesClampEnabled)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(parameters.shouldScaleViewToFitDocument)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(parameters.userInterfaceLayoutDirection)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(parameters.observedLayoutMilestones)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(parameters.overrideContentSecurityPolicy)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<double>> cpuLimit; >+ Optional<Optional<double>> cpuLimit; > decoder >> cpuLimit; > if (!cpuLimit) >- return std::nullopt; >+ return WTF::nullopt; > parameters.cpuLimit = WTFMove(*cpuLimit); > > if (!decoder.decode(parameters.urlSchemeHandlers)) >- return std::nullopt; >+ return WTF::nullopt; > > #if ENABLE(APPLICATION_MANIFEST) >- std::optional<std::optional<WebCore::ApplicationManifest>> applicationManifest; >+ Optional<Optional<WebCore::ApplicationManifest>> applicationManifest; > decoder >> applicationManifest; > if (!applicationManifest) >- return std::nullopt; >+ return WTF::nullopt; > parameters.applicationManifest = WTFMove(*applicationManifest); > #endif > #if ENABLE(SERVICE_WORKER) > if (!decoder.decode(parameters.hasRegisteredServiceWorkers)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > > if (!decoder.decode(parameters.needsFontAttributes)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(parameters.iceCandidateFilteringEnabled)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(parameters.enumeratingAllNetworkInterfacesEnabled)) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<std::pair<uint64_t, String>>> userContentWorlds; >+ Optional<Vector<std::pair<uint64_t, String>>> userContentWorlds; > decoder >> userContentWorlds; > if (!userContentWorlds) >- return std::nullopt; >+ return WTF::nullopt; > parameters.userContentWorlds = WTFMove(*userContentWorlds); > >- std::optional<Vector<WebUserScriptData>> userScripts; >+ Optional<Vector<WebUserScriptData>> userScripts; > decoder >> userScripts; > if (!userScripts) >- return std::nullopt; >+ return WTF::nullopt; > parameters.userScripts = WTFMove(*userScripts); > >- std::optional<Vector<WebUserStyleSheetData>> userStyleSheets; >+ Optional<Vector<WebUserStyleSheetData>> userStyleSheets; > decoder >> userStyleSheets; > if (!userStyleSheets) >- return std::nullopt; >+ return WTF::nullopt; > parameters.userStyleSheets = WTFMove(*userStyleSheets); > >- std::optional<Vector<WebScriptMessageHandlerData>> messageHandlers; >+ Optional<Vector<WebScriptMessageHandlerData>> messageHandlers; > decoder >> messageHandlers; > if (!messageHandlers) >- return std::nullopt; >+ return WTF::nullopt; > parameters.messageHandlers = WTFMove(*messageHandlers); > > #if ENABLE(CONTENT_EXTENSIONS) >- std::optional<Vector<std::pair<String, WebCompiledContentRuleListData>>> contentRuleLists; >+ Optional<Vector<std::pair<String, WebCompiledContentRuleListData>>> contentRuleLists; > decoder >> contentRuleLists; > if (!contentRuleLists) >- return std::nullopt; >+ return WTF::nullopt; > parameters.contentRuleLists = WTFMove(*contentRuleLists); > #endif > >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h >index 4f71d4dbd2f2784af623037a99235904a099aa9a..0dc4f2fbbfbd0c2ff67d78f7fa396d5e3c9da43e 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.h >+++ b/Source/WebKit/Shared/WebPageCreationParameters.h >@@ -63,7 +63,7 @@ namespace WebKit { > > struct WebPageCreationParameters { > void encode(IPC::Encoder&) const; >- static std::optional<WebPageCreationParameters> decode(IPC::Decoder&); >+ static Optional<WebPageCreationParameters> decode(IPC::Decoder&); > > WebCore::IntSize viewSize; > >@@ -114,13 +114,13 @@ struct WebPageCreationParameters { > > WebCore::IntSize viewLayoutSize; > bool autoSizingShouldExpandToViewHeight; >- std::optional<WebCore::IntSize> viewportSizeForCSSViewportUnits; >+ Optional<WebCore::IntSize> viewportSizeForCSSViewportUnits; > > WebCore::ScrollPinningBehavior scrollPinningBehavior; > >- // FIXME: This should be std::optional<WebCore::ScrollbarOverlayStyle>, but we would need to >+ // FIXME: This should be Optional<WebCore::ScrollbarOverlayStyle>, but we would need to > // correctly handle enums inside Optionals when encoding and decoding. >- std::optional<uint32_t> scrollbarOverlayStyle; >+ Optional<uint32_t> scrollbarOverlayStyle; > > bool backgroundExtendsBeyondPage; > >@@ -160,12 +160,12 @@ struct WebPageCreationParameters { > OptionSet<WebCore::LayoutMilestone> observedLayoutMilestones; > > String overrideContentSecurityPolicy; >- std::optional<double> cpuLimit; >+ Optional<double> cpuLimit; > > HashMap<String, uint64_t> urlSchemeHandlers; > > #if ENABLE(APPLICATION_MANIFEST) >- std::optional<WebCore::ApplicationManifest> applicationManifest; >+ Optional<WebCore::ApplicationManifest> applicationManifest; > #endif > > #if ENABLE(SERVICE_WORKER) >diff --git a/Source/WebKit/Shared/WebPageGroupData.cpp b/Source/WebKit/Shared/WebPageGroupData.cpp >index e0842bd90a16da8c4da6384520fd6e0cff1ef3c7..9639d015c2f94e67b767228ad23b1d9c43b35007 100644 >--- a/Source/WebKit/Shared/WebPageGroupData.cpp >+++ b/Source/WebKit/Shared/WebPageGroupData.cpp >@@ -37,22 +37,22 @@ void WebPageGroupData::encode(IPC::Encoder& encoder) const > encoder << userContentControllerIdentifier.toUInt64(); > } > >-std::optional<WebPageGroupData> WebPageGroupData::decode(IPC::Decoder& decoder) >+Optional<WebPageGroupData> WebPageGroupData::decode(IPC::Decoder& decoder) > { >- std::optional<String> identifier; >+ Optional<String> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> pageGroupID; >+ Optional<uint64_t> pageGroupID; > decoder >> pageGroupID; > if (!pageGroupID) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> userContentControllerIdentifier; >+ Optional<uint64_t> userContentControllerIdentifier; > decoder >> userContentControllerIdentifier; > if (!userContentControllerIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*identifier), WTFMove(*pageGroupID), makeObjectIdentifier<UserContentControllerIdentifierType>(*userContentControllerIdentifier) }}; > } >diff --git a/Source/WebKit/Shared/WebPageGroupData.h b/Source/WebKit/Shared/WebPageGroupData.h >index 79eae45ea0dd930423251f8007b01bcbc2e5f5f8..1dbe56540c27c87623c65b5dd255449037c2ddeb 100644 >--- a/Source/WebKit/Shared/WebPageGroupData.h >+++ b/Source/WebKit/Shared/WebPageGroupData.h >@@ -37,7 +37,7 @@ namespace WebKit { > > struct WebPageGroupData { > void encode(IPC::Encoder&) const; >- static std::optional<WebPageGroupData> decode(IPC::Decoder&); >+ static Optional<WebPageGroupData> decode(IPC::Decoder&); > > String identifier; > uint64_t pageGroupID; >diff --git a/Source/WebKit/Shared/WebPlatformTouchPoint.cpp b/Source/WebKit/Shared/WebPlatformTouchPoint.cpp >index 2355fca00ec03dab869e337a64eba3173193cad7..b2b99d2320c28ac496c74f8ff3f4e469fba75f5f 100644 >--- a/Source/WebKit/Shared/WebPlatformTouchPoint.cpp >+++ b/Source/WebKit/Shared/WebPlatformTouchPoint.cpp >@@ -65,23 +65,23 @@ void WebPlatformTouchPoint::encode(IPC::Encoder& encoder) const > encoder << m_force; > } > >-std::optional<WebPlatformTouchPoint> WebPlatformTouchPoint::decode(IPC::Decoder& decoder) >+Optional<WebPlatformTouchPoint> WebPlatformTouchPoint::decode(IPC::Decoder& decoder) > { > WebPlatformTouchPoint result; > if (!decoder.decode(result.m_id)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_state)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_screenPosition)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_position)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_radius)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_rotationAngle)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_force)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >diff --git a/Source/WebKit/Shared/WebPopupItem.cpp b/Source/WebKit/Shared/WebPopupItem.cpp >index 19073e7abbf751483d7af8b94b351229b10743b0..860f5b0cf614947af3e44f7cc9b43182ac019227 100644 >--- a/Source/WebKit/Shared/WebPopupItem.cpp >+++ b/Source/WebKit/Shared/WebPopupItem.cpp >@@ -76,43 +76,43 @@ void WebPopupItem::encode(IPC::Encoder& encoder) const > encoder << m_isSelected; > } > >-std::optional<WebPopupItem> WebPopupItem::decode(IPC::Decoder& decoder) >+Optional<WebPopupItem> WebPopupItem::decode(IPC::Decoder& decoder) > { > Type type; > if (!decoder.decodeEnum(type)) >- return std::nullopt; >+ return WTF::nullopt; > > String text; > if (!decoder.decode(text)) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::TextDirection textDirection; > if (!decoder.decodeEnum(textDirection)) >- return std::nullopt; >+ return WTF::nullopt; > > bool hasTextDirectionOverride; > if (!decoder.decode(hasTextDirectionOverride)) >- return std::nullopt; >+ return WTF::nullopt; > > String toolTip; > if (!decoder.decode(toolTip)) >- return std::nullopt; >+ return WTF::nullopt; > > String accessibilityText; > if (!decoder.decode(accessibilityText)) >- return std::nullopt; >+ return WTF::nullopt; > > bool isEnabled; > if (!decoder.decode(isEnabled)) >- return std::nullopt; >+ return WTF::nullopt; > > bool isLabel; > if (!decoder.decode(isLabel)) >- return std::nullopt; >+ return WTF::nullopt; > > bool isSelected; > if (!decoder.decode(isSelected)) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ type, text, textDirection, hasTextDirectionOverride, toolTip, accessibilityText, isEnabled, isLabel, isSelected }}; > } >diff --git a/Source/WebKit/Shared/WebPopupItem.h b/Source/WebKit/Shared/WebPopupItem.h >index 7a51454ad268e693762cd48ce02bea06c5f558ca..fed2fe48809ee3599e4927b6bf86d565794a6272 100644 >--- a/Source/WebKit/Shared/WebPopupItem.h >+++ b/Source/WebKit/Shared/WebPopupItem.h >@@ -46,7 +46,7 @@ struct WebPopupItem { > WebPopupItem(Type, const String& text, WebCore::TextDirection, bool hasTextDirectionOverride, const String& toolTip, const String& accessibilityText, bool isEnabled, bool isLabel, bool isSelected); > > void encode(IPC::Encoder&) const; >- static std::optional<WebPopupItem> decode(IPC::Decoder&); >+ static Optional<WebPopupItem> decode(IPC::Decoder&); > > Type m_type; > String m_text; >diff --git a/Source/WebKit/Shared/WebPreferencesStore.cpp b/Source/WebKit/Shared/WebPreferencesStore.cpp >index 67a068782f133ac1706226ecedcdb5100c32cda4..503628e9e3487ef6475f45f89b9cd698e7e002dd 100644 >--- a/Source/WebKit/Shared/WebPreferencesStore.cpp >+++ b/Source/WebKit/Shared/WebPreferencesStore.cpp >@@ -52,13 +52,13 @@ void WebPreferencesStore::encode(IPC::Encoder& encoder) const > > bool WebPreferencesStore::decode(IPC::Decoder& decoder, WebPreferencesStore& result) > { >- std::optional<HashMap<String, Value>> values; >+ Optional<HashMap<String, Value>> values; > decoder >> values; > if (!values) > return false; > result.m_values = WTFMove(*values); > >- std::optional<HashMap<String, Value>> overriddenDefaults; >+ Optional<HashMap<String, Value>> overriddenDefaults; > decoder >> overriddenDefaults; > if (!overriddenDefaults) > return false; >diff --git a/Source/WebKit/Shared/WebProcessCreationParameters.cpp b/Source/WebKit/Shared/WebProcessCreationParameters.cpp >index 475f208a949f2abc424611244cfe271d0e17325d..25ef64624c130da1972dc84523deffa6a03d9389 100644 >--- a/Source/WebKit/Shared/WebProcessCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebProcessCreationParameters.cpp >@@ -167,13 +167,13 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > if (!decoder.decode(parameters.injectedBundlePath)) > return false; > >- std::optional<SandboxExtension::Handle> injectedBundlePathExtensionHandle; >+ Optional<SandboxExtension::Handle> injectedBundlePathExtensionHandle; > decoder >> injectedBundlePathExtensionHandle; > if (!injectedBundlePathExtensionHandle) > return false; > parameters.injectedBundlePathExtensionHandle = WTFMove(*injectedBundlePathExtensionHandle); > >- std::optional<SandboxExtension::HandleArray> additionalSandboxExtensionHandles; >+ Optional<SandboxExtension::HandleArray> additionalSandboxExtensionHandles; > decoder >> additionalSandboxExtensionHandles; > if (!additionalSandboxExtensionHandles) > return false; >@@ -185,7 +185,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > if (!decoder.decode(parameters.applicationCacheFlatFileSubdirectoryName)) > return false; > >- std::optional<SandboxExtension::Handle> applicationCacheDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> applicationCacheDirectoryExtensionHandle; > decoder >> applicationCacheDirectoryExtensionHandle; > if (!applicationCacheDirectoryExtensionHandle) > return false; >@@ -194,7 +194,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > if (!decoder.decode(parameters.webSQLDatabaseDirectory)) > return false; > >- std::optional<SandboxExtension::Handle> webSQLDatabaseDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> webSQLDatabaseDirectoryExtensionHandle; > decoder >> webSQLDatabaseDirectoryExtensionHandle; > if (!webSQLDatabaseDirectoryExtensionHandle) > return false; >@@ -203,7 +203,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > if (!decoder.decode(parameters.mediaCacheDirectory)) > return false; > >- std::optional<SandboxExtension::Handle> mediaCacheDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> mediaCacheDirectoryExtensionHandle; > decoder >> mediaCacheDirectoryExtensionHandle; > if (!mediaCacheDirectoryExtensionHandle) > return false; >@@ -212,7 +212,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > if (!decoder.decode(parameters.javaScriptConfigurationDirectory)) > return false; > >- std::optional<SandboxExtension::Handle> javaScriptConfigurationDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> javaScriptConfigurationDirectoryExtensionHandle; > decoder >> javaScriptConfigurationDirectoryExtensionHandle; > if (!javaScriptConfigurationDirectoryExtensionHandle) > return false; >@@ -220,19 +220,19 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > > #if PLATFORM(IOS_FAMILY) > >- std::optional<SandboxExtension::Handle> cookieStorageDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> cookieStorageDirectoryExtensionHandle; > decoder >> cookieStorageDirectoryExtensionHandle; > if (!cookieStorageDirectoryExtensionHandle) > return false; > parameters.cookieStorageDirectoryExtensionHandle = WTFMove(*cookieStorageDirectoryExtensionHandle); > >- std::optional<SandboxExtension::Handle> containerCachesDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> containerCachesDirectoryExtensionHandle; > decoder >> containerCachesDirectoryExtensionHandle; > if (!containerCachesDirectoryExtensionHandle) > return false; > parameters.containerCachesDirectoryExtensionHandle = WTFMove(*containerCachesDirectoryExtensionHandle); > >- std::optional<SandboxExtension::Handle> containerTemporaryDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> containerTemporaryDirectoryExtensionHandle; > decoder >> containerTemporaryDirectoryExtensionHandle; > if (!containerTemporaryDirectoryExtensionHandle) > return false; >@@ -246,7 +246,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > if (!decoder.decode(parameters.webKitLoggingChannels)) > return false; > >- std::optional<SandboxExtension::Handle> mediaKeyStorageDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> mediaKeyStorageDirectoryExtensionHandle; > decoder >> mediaKeyStorageDirectoryExtensionHandle; > if (!mediaKeyStorageDirectoryExtensionHandle) > return false; >@@ -254,7 +254,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > > #if ENABLE(MEDIA_STREAM) > >- std::optional<SandboxExtension::Handle> audioCaptureExtensionHandle; >+ Optional<SandboxExtension::Handle> audioCaptureExtensionHandle; > decoder >> audioCaptureExtensionHandle; > if (!audioCaptureExtensionHandle) > return false; >@@ -337,7 +337,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > if (!decoder.decode(parameters.uiProcessBundleResourcePath)) > return false; > >- std::optional<SandboxExtension::Handle> uiProcessBundleResourcePathExtensionHandle; >+ Optional<SandboxExtension::Handle> uiProcessBundleResourcePathExtensionHandle; > decoder >> uiProcessBundleResourcePathExtensionHandle; > if (!uiProcessBundleResourcePathExtensionHandle) > return false; >@@ -415,7 +415,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > #endif > > #if PLATFORM(MAC) >- std::optional<WebCore::ScreenProperties> screenProperties; >+ Optional<WebCore::ScreenProperties> screenProperties; > decoder >> screenProperties; > if (!screenProperties) > return false; >diff --git a/Source/WebKit/Shared/WebUserContentControllerDataTypes.cpp b/Source/WebKit/Shared/WebUserContentControllerDataTypes.cpp >index 10b3c99d3c7992bf05f5376bdfb3d968a4dde3ae..db7d33c8d55bc97b931a0af458849d242511fd9f 100644 >--- a/Source/WebKit/Shared/WebUserContentControllerDataTypes.cpp >+++ b/Source/WebKit/Shared/WebUserContentControllerDataTypes.cpp >@@ -37,21 +37,21 @@ void WebUserScriptData::encode(IPC::Encoder& encoder) const > encoder << userScript; > } > >-std::optional<WebUserScriptData> WebUserScriptData::decode(IPC::Decoder& decoder) >+Optional<WebUserScriptData> WebUserScriptData::decode(IPC::Decoder& decoder) > { >- std::optional<uint64_t> identifier; >+ Optional<uint64_t> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> worldIdentifier; >+ Optional<uint64_t> worldIdentifier; > decoder >> worldIdentifier; > if (!worldIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::UserScript userScript; > if (!decoder.decode(userScript)) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*identifier), WTFMove(*worldIdentifier), WTFMove(userScript) }}; > } >@@ -63,21 +63,21 @@ void WebUserStyleSheetData::encode(IPC::Encoder& encoder) const > encoder << userStyleSheet; > } > >-std::optional<WebUserStyleSheetData> WebUserStyleSheetData::decode(IPC::Decoder& decoder) >+Optional<WebUserStyleSheetData> WebUserStyleSheetData::decode(IPC::Decoder& decoder) > { >- std::optional<uint64_t> identifier; >+ Optional<uint64_t> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> worldIdentifier; >+ Optional<uint64_t> worldIdentifier; > decoder >> worldIdentifier; > if (!worldIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::UserStyleSheet userStyleSheet; > if (!decoder.decode(userStyleSheet)) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*identifier), WTFMove(*worldIdentifier), WTFMove(userStyleSheet) }}; > } >@@ -90,22 +90,22 @@ void WebScriptMessageHandlerData::encode(IPC::Encoder& encoder) const > encoder << name; > } > >-std::optional<WebScriptMessageHandlerData> WebScriptMessageHandlerData::decode(IPC::Decoder& decoder) >+Optional<WebScriptMessageHandlerData> WebScriptMessageHandlerData::decode(IPC::Decoder& decoder) > { >- std::optional<uint64_t> identifier; >+ Optional<uint64_t> identifier; > decoder >> identifier; > if (!identifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<uint64_t> worldIdentifier; >+ Optional<uint64_t> worldIdentifier; > decoder >> worldIdentifier; > if (!worldIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> name; >+ Optional<String> name; > decoder >> name; > if (!name) >- return std::nullopt; >+ return WTF::nullopt; > > return {{ WTFMove(*identifier), WTFMove(*worldIdentifier), WTFMove(*name) }}; > } >diff --git a/Source/WebKit/Shared/WebUserContentControllerDataTypes.h b/Source/WebKit/Shared/WebUserContentControllerDataTypes.h >index 5293c4335e61299c90226505848f858f22de6322..5cdae552ef18d4893871e4cb64017f5e7a4069a9 100644 >--- a/Source/WebKit/Shared/WebUserContentControllerDataTypes.h >+++ b/Source/WebKit/Shared/WebUserContentControllerDataTypes.h >@@ -37,7 +37,7 @@ namespace WebKit { > > struct WebUserScriptData { > void encode(IPC::Encoder&) const; >- static std::optional<WebUserScriptData> decode(IPC::Decoder&); >+ static Optional<WebUserScriptData> decode(IPC::Decoder&); > > uint64_t identifier; > uint64_t worldIdentifier; >@@ -46,7 +46,7 @@ struct WebUserScriptData { > > struct WebUserStyleSheetData { > void encode(IPC::Encoder&) const; >- static std::optional<WebUserStyleSheetData> decode(IPC::Decoder&); >+ static Optional<WebUserStyleSheetData> decode(IPC::Decoder&); > > uint64_t identifier; > uint64_t worldIdentifier; >@@ -55,7 +55,7 @@ struct WebUserStyleSheetData { > > struct WebScriptMessageHandlerData { > void encode(IPC::Encoder&) const; >- static std::optional<WebScriptMessageHandlerData> decode(IPC::Decoder&); >+ static Optional<WebScriptMessageHandlerData> decode(IPC::Decoder&); > > uint64_t identifier; > uint64_t worldIdentifier; >diff --git a/Source/WebKit/Shared/WebsiteData/WebsiteData.cpp b/Source/WebKit/Shared/WebsiteData/WebsiteData.cpp >index bf014a69ddf26293d9619cfc745ea042df36eaad..c6c9b774a6ca5fd59389834029bd6e48beed6999 100644 >--- a/Source/WebKit/Shared/WebsiteData/WebsiteData.cpp >+++ b/Source/WebKit/Shared/WebsiteData/WebsiteData.cpp >@@ -39,21 +39,21 @@ void WebsiteData::Entry::encode(IPC::Encoder& encoder) const > encoder << size; > } > >-auto WebsiteData::Entry::decode(IPC::Decoder& decoder) -> std::optional<Entry> >+auto WebsiteData::Entry::decode(IPC::Decoder& decoder) -> Optional<Entry> > { > Entry result; > >- std::optional<WebCore::SecurityOriginData> securityOriginData; >+ Optional<WebCore::SecurityOriginData> securityOriginData; > decoder >> securityOriginData; > if (!securityOriginData) >- return std::nullopt; >+ return WTF::nullopt; > result.origin = WTFMove(*securityOriginData); > > if (!decoder.decodeEnum(result.type)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(result.size)) >- return std::nullopt; >+ return WTF::nullopt; > > return WTFMove(result); > } >diff --git a/Source/WebKit/Shared/WebsiteData/WebsiteData.h b/Source/WebKit/Shared/WebsiteData/WebsiteData.h >index df1ef8bb3cac12e7c120826b8700f738c6829294..b608f4f2a40a0e4689b0c3fc833a44e428f4bf01 100644 >--- a/Source/WebKit/Shared/WebsiteData/WebsiteData.h >+++ b/Source/WebKit/Shared/WebsiteData/WebsiteData.h >@@ -46,7 +46,7 @@ struct WebsiteData { > uint64_t size; > > void encode(IPC::Encoder&) const; >- static std::optional<WebsiteData::Entry> decode(IPC::Decoder&); >+ static Optional<WebsiteData::Entry> decode(IPC::Decoder&); > }; > > Vector<Entry> entries; >diff --git a/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp b/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp >index a50152758031b3c2aa29274e2431eb769fbccd8b..d961ea18d11e3ff79930bdbb57580e809df6e78e 100644 >--- a/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp >+++ b/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp >@@ -51,59 +51,59 @@ void WebsiteDataStoreParameters::encode(IPC::Encoder& encoder) const > #endif > } > >-std::optional<WebsiteDataStoreParameters> WebsiteDataStoreParameters::decode(IPC::Decoder& decoder) >+Optional<WebsiteDataStoreParameters> WebsiteDataStoreParameters::decode(IPC::Decoder& decoder) > { > WebsiteDataStoreParameters parameters; > >- std::optional<NetworkSessionCreationParameters> networkSessionParameters; >+ Optional<NetworkSessionCreationParameters> networkSessionParameters; > decoder >> networkSessionParameters; > if (!networkSessionParameters) >- return std::nullopt; >+ return WTF::nullopt; > parameters.networkSessionParameters = WTFMove(*networkSessionParameters); > >- std::optional<Vector<uint8_t>> uiProcessCookieStorageIdentifier; >+ Optional<Vector<uint8_t>> uiProcessCookieStorageIdentifier; > decoder >> uiProcessCookieStorageIdentifier; > if (!uiProcessCookieStorageIdentifier) >- return std::nullopt; >+ return WTF::nullopt; > parameters.uiProcessCookieStorageIdentifier = WTFMove(*uiProcessCookieStorageIdentifier); > >- std::optional<SandboxExtension::Handle> cookieStoragePathExtensionHandle; >+ Optional<SandboxExtension::Handle> cookieStoragePathExtensionHandle; > decoder >> cookieStoragePathExtensionHandle; > if (!cookieStoragePathExtensionHandle) >- return std::nullopt; >+ return WTF::nullopt; > parameters.cookieStoragePathExtensionHandle = WTFMove(*cookieStoragePathExtensionHandle); > >- std::optional<Vector<WebCore::Cookie>> pendingCookies; >+ Optional<Vector<WebCore::Cookie>> pendingCookies; > decoder >> pendingCookies; > if (!pendingCookies) >- return std::nullopt; >+ return WTF::nullopt; > parameters.pendingCookies = WTFMove(*pendingCookies); > > #if ENABLE(INDEXED_DATABASE) >- std::optional<String> indexedDatabaseDirectory; >+ Optional<String> indexedDatabaseDirectory; > decoder >> indexedDatabaseDirectory; > if (!indexedDatabaseDirectory) >- return std::nullopt; >+ return WTF::nullopt; > parameters.indexedDatabaseDirectory = WTFMove(*indexedDatabaseDirectory); > >- std::optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> indexedDatabaseDirectoryExtensionHandle; > decoder >> indexedDatabaseDirectoryExtensionHandle; > if (!indexedDatabaseDirectoryExtensionHandle) >- return std::nullopt; >+ return WTF::nullopt; > parameters.indexedDatabaseDirectoryExtensionHandle = WTFMove(*indexedDatabaseDirectoryExtensionHandle); > #endif > > #if ENABLE(SERVICE_WORKER) >- std::optional<String> serviceWorkerRegistrationDirectory; >+ Optional<String> serviceWorkerRegistrationDirectory; > decoder >> serviceWorkerRegistrationDirectory; > if (!serviceWorkerRegistrationDirectory) >- return std::nullopt; >+ return WTF::nullopt; > parameters.serviceWorkerRegistrationDirectory = WTFMove(*serviceWorkerRegistrationDirectory); > >- std::optional<SandboxExtension::Handle> serviceWorkerRegistrationDirectoryExtensionHandle; >+ Optional<SandboxExtension::Handle> serviceWorkerRegistrationDirectoryExtensionHandle; > decoder >> serviceWorkerRegistrationDirectoryExtensionHandle; > if (!serviceWorkerRegistrationDirectoryExtensionHandle) >- return std::nullopt; >+ return WTF::nullopt; > parameters.serviceWorkerRegistrationDirectoryExtensionHandle = WTFMove(*serviceWorkerRegistrationDirectoryExtensionHandle); > #endif > >diff --git a/Source/WebKit/Shared/WebsiteDataStoreParameters.h b/Source/WebKit/Shared/WebsiteDataStoreParameters.h >index ff7b0706c10de61bb368428d943da5a6cfb14f34..ee44cd695a34f81925c7bb874e46dde3a5197b51 100644 >--- a/Source/WebKit/Shared/WebsiteDataStoreParameters.h >+++ b/Source/WebKit/Shared/WebsiteDataStoreParameters.h >@@ -49,7 +49,7 @@ struct WebsiteDataStoreParameters { > static WebsiteDataStoreParameters privateSessionParameters(PAL::SessionID); > > void encode(IPC::Encoder&) const; >- static std::optional<WebsiteDataStoreParameters> decode(IPC::Decoder&); >+ static Optional<WebsiteDataStoreParameters> decode(IPC::Decoder&); > > Vector<uint8_t> uiProcessCookieStorageIdentifier; > SandboxExtension::Handle cookieStoragePathExtensionHandle; >diff --git a/Source/WebKit/Shared/WebsitePoliciesData.cpp b/Source/WebKit/Shared/WebsitePoliciesData.cpp >index df6d3ae2c187da405b548d6774a85d295edada1e..03d727f80b4a56e337844af2246f238c4c5a880b 100644 >--- a/Source/WebKit/Shared/WebsitePoliciesData.cpp >+++ b/Source/WebKit/Shared/WebsitePoliciesData.cpp >@@ -45,42 +45,42 @@ void WebsitePoliciesData::encode(IPC::Encoder& encoder) const > encoder << customUserAgent; > } > >-std::optional<WebsitePoliciesData> WebsitePoliciesData::decode(IPC::Decoder& decoder) >+Optional<WebsitePoliciesData> WebsitePoliciesData::decode(IPC::Decoder& decoder) > { >- std::optional<bool> contentBlockersEnabled; >+ Optional<bool> contentBlockersEnabled; > decoder >> contentBlockersEnabled; > if (!contentBlockersEnabled) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WebsiteAutoplayPolicy> autoplayPolicy; >+ Optional<WebsiteAutoplayPolicy> autoplayPolicy; > decoder >> autoplayPolicy; > if (!autoplayPolicy) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<OptionSet<WebsiteAutoplayQuirk>> allowedAutoplayQuirks; >+ Optional<OptionSet<WebsiteAutoplayQuirk>> allowedAutoplayQuirks; > decoder >> allowedAutoplayQuirks; > if (!allowedAutoplayQuirks) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<WebCore::HTTPHeaderField>> customHeaderFields; >+ Optional<Vector<WebCore::HTTPHeaderField>> customHeaderFields; > decoder >> customHeaderFields; > if (!customHeaderFields) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<WebsitePopUpPolicy> popUpPolicy; >+ Optional<WebsitePopUpPolicy> popUpPolicy; > decoder >> popUpPolicy; > if (!popUpPolicy) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<std::optional<WebsiteDataStoreParameters>> websiteDataStoreParameters; >+ Optional<Optional<WebsiteDataStoreParameters>> websiteDataStoreParameters; > decoder >> websiteDataStoreParameters; > if (!websiteDataStoreParameters) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> customUserAgent; >+ Optional<String> customUserAgent; > decoder >> customUserAgent; > if (!customUserAgent) >- return std::nullopt; >+ return WTF::nullopt; > > return { { > WTFMove(*contentBlockersEnabled), >diff --git a/Source/WebKit/Shared/WebsitePoliciesData.h b/Source/WebKit/Shared/WebsitePoliciesData.h >index 7944c466ec60e1637a5a93428a17fa6da64d2427..c36f6f41360fc0459ba0c699882dbb6dea724493 100644 >--- a/Source/WebKit/Shared/WebsitePoliciesData.h >+++ b/Source/WebKit/Shared/WebsitePoliciesData.h >@@ -51,11 +51,11 @@ struct WebsitePoliciesData { > WebsiteAutoplayPolicy autoplayPolicy { WebsiteAutoplayPolicy::Default }; > Vector<WebCore::HTTPHeaderField> customHeaderFields; > WebsitePopUpPolicy popUpPolicy { WebsitePopUpPolicy::Default }; >- std::optional<WebsiteDataStoreParameters> websiteDataStoreParameters; >+ Optional<WebsiteDataStoreParameters> websiteDataStoreParameters; > String customUserAgent; > > void encode(IPC::Encoder&) const; >- static std::optional<WebsitePoliciesData> decode(IPC::Decoder&); >+ static Optional<WebsitePoliciesData> decode(IPC::Decoder&); > }; > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp b/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp >index 9de3978d66af25ac29dfb6c6a46c1520dd609430..825f875c8d699388fbd3332c82ca030c099bbd80 100644 >--- a/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp >+++ b/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp >@@ -190,22 +190,22 @@ void ArgumentCoder<CurlProxySettings>::encode(Encoder& encoder, const CurlProxyS > encoder << settings.ignoreHosts(); > } > >-std::optional<CurlProxySettings> ArgumentCoder<CurlProxySettings>::decode(Decoder& decoder) >+Optional<CurlProxySettings> ArgumentCoder<CurlProxySettings>::decode(Decoder& decoder) > { > CurlProxySettings::Mode mode; > if (!decoder.decode(mode)) >- return std::nullopt; >+ return WTF::nullopt; > > if (mode != CurlProxySettings::Mode::Custom) > return CurlProxySettings { mode }; > > URL url; > if (!decoder.decode(url)) >- return std::nullopt; >+ return WTF::nullopt; > > String ignoreHosts; > if (!decoder.decode(ignoreHosts)) >- return std::nullopt; >+ return WTF::nullopt; > > return CurlProxySettings { WTFMove(url), WTFMove(ignoreHosts) }; > } >diff --git a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >index d0aa85196cd75ed98fdb9714ad4e63f606bf09ed..fd703104869411b1203f3c86ea26ee56c5562541 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >+++ b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >@@ -150,7 +150,7 @@ bool InteractionInformationAtPosition::decode(IPC::Decoder& decoder, Interaction > if (!decoder.decode(result.textAfter)) > return false; > >- std::optional<WebCore::TextIndicatorData> linkIndicator; >+ Optional<WebCore::TextIndicatorData> linkIndicator; > decoder >> linkIndicator; > if (!linkIndicator) > return false; >diff --git a/Source/WebKit/Shared/ios/WebPlatformTouchPointIOS.cpp b/Source/WebKit/Shared/ios/WebPlatformTouchPointIOS.cpp >index 47dd9a05fd31e0230d84304eb44f73e934f61163..7b5eb372880d8662544334cd4697276d543de45b 100644 >--- a/Source/WebKit/Shared/ios/WebPlatformTouchPointIOS.cpp >+++ b/Source/WebKit/Shared/ios/WebPlatformTouchPointIOS.cpp >@@ -49,30 +49,30 @@ void WebPlatformTouchPoint::encode(IPC::Encoder& encoder) const > #endif > } > >-std::optional<WebPlatformTouchPoint> WebPlatformTouchPoint::decode(IPC::Decoder& decoder) >+Optional<WebPlatformTouchPoint> WebPlatformTouchPoint::decode(IPC::Decoder& decoder) > { > WebPlatformTouchPoint result; > if (!decoder.decode(result.m_identifier)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_location)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_phase)) >- return std::nullopt; >+ return WTF::nullopt; > #if ENABLE(IOS_TOUCH_EVENTS) > if (!decoder.decode(result.m_radiusX)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_radiusY)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_rotationAngle)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_force)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_altitudeAngle)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_azimuthAngle)) >- return std::nullopt; >+ return WTF::nullopt; > if (!decoder.decode(result.m_touchType)) >- return std::nullopt; >+ return WTF::nullopt; > #endif > return WTFMove(result); > } >diff --git a/Source/WebKit/Shared/mac/ChildProcessMac.mm b/Source/WebKit/Shared/mac/ChildProcessMac.mm >index 756dacf6c0cab94f285e6c0d05dadb996bfa73a8..20c4a9c1a42776e667110b6160a882593388f5a1 100644 >--- a/Source/WebKit/Shared/mac/ChildProcessMac.mm >+++ b/Source/WebKit/Shared/mac/ChildProcessMac.mm >@@ -193,12 +193,12 @@ static OSStatus enableSandboxStyleFileQuarantine() > } > > #if USE(CACHE_COMPILED_SANDBOX) >-static std::optional<Vector<char>> fileContents(const String& path, bool shouldLock = false, OptionSet<FileSystem::FileLockMode> lockMode = FileSystem::FileLockMode::Exclusive) >+static Optional<Vector<char>> fileContents(const String& path, bool shouldLock = false, OptionSet<FileSystem::FileLockMode> lockMode = FileSystem::FileLockMode::Exclusive) > { > FileHandle file = shouldLock ? FileHandle(path, FileSystem::FileOpenMode::Read, lockMode) : FileHandle(path, FileSystem::FileOpenMode::Read); > file.open(); > if (!file) >- return std::nullopt; >+ return WTF::nullopt; > > char chunk[4096]; > constexpr size_t chunkSize = WTF_ARRAY_LENGTH(chunk); >@@ -230,7 +230,7 @@ constexpr const char* processStorageClass(ChildProcess::ProcessType type) > } > #endif // USE(APPLE_INTERNAL_SDK) > >-static std::optional<CString> setAndSerializeSandboxParameters(const SandboxInitializationParameters& initializationParameters, const SandboxParametersPtr& sandboxParameters, const String& profileOrProfilePath, bool isProfilePath) >+static Optional<CString> setAndSerializeSandboxParameters(const SandboxInitializationParameters& initializationParameters, const SandboxParametersPtr& sandboxParameters, const String& profileOrProfilePath, bool isProfilePath) > { > StringBuilder builder; > for (size_t i = 0; i < initializationParameters.count(); ++i) { >@@ -248,7 +248,7 @@ static std::optional<CString> setAndSerializeSandboxParameters(const SandboxInit > if (isProfilePath) { > auto contents = fileContents(profileOrProfilePath); > if (!contents) >- return std::nullopt; >+ return WTF::nullopt; > builder.append(contents->data(), contents->size()); > } else > builder.append(profileOrProfilePath); >diff --git a/Source/WebKit/Shared/mac/ObjCObjectGraph.mm b/Source/WebKit/Shared/mac/ObjCObjectGraph.mm >index 47eec8735804cc969ca70b6bb01b6f6125bab0b7..9ddef9a80373cb6903f2cae815bc9db57a060082 100644 >--- a/Source/WebKit/Shared/mac/ObjCObjectGraph.mm >+++ b/Source/WebKit/Shared/mac/ObjCObjectGraph.mm >@@ -113,7 +113,7 @@ enum class ObjCType { > #endif > }; > >-static std::optional<ObjCType> typeFromObject(id object) >+static Optional<ObjCType> typeFromObject(id object) > { > ASSERT(object); > >@@ -139,7 +139,7 @@ static std::optional<ObjCType> typeFromObject(id object) > ALLOW_DEPRECATED_DECLARATIONS_END > #endif > >- return std::nullopt; >+ return WTF::nullopt; > } > > void ObjCObjectGraph::encode(IPC::Encoder& encoder, id object) >diff --git a/Source/WebKit/Shared/mac/PDFContextMenu.h b/Source/WebKit/Shared/mac/PDFContextMenu.h >index 7b27411906c5dec57cc7a665d0388584eaabc5d7..08fbe42b8d965f9b8f8b407cfa62cfc7d65efe41 100644 >--- a/Source/WebKit/Shared/mac/PDFContextMenu.h >+++ b/Source/WebKit/Shared/mac/PDFContextMenu.h >@@ -41,37 +41,37 @@ struct PDFContextMenuItem { > encoder << title << enabled << separator << state << hasAction << tag; > } > >- template<class Decoder> static std::optional<PDFContextMenuItem> decode(Decoder& decoder) >+ template<class Decoder> static Optional<PDFContextMenuItem> decode(Decoder& decoder) > { >- std::optional<String> title; >+ Optional<String> title; > decoder >> title; > if (!title) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> enabled; >+ Optional<bool> enabled; > decoder >> enabled; > if (!enabled) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> separator; >+ Optional<bool> separator; > decoder >> separator; > if (!separator) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> state; >+ Optional<int> state; > decoder >> state; > if (!state) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<bool> hasAction; >+ Optional<bool> hasAction; > decoder >> hasAction; > if (!hasAction) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<int> tag; >+ Optional<int> tag; > decoder >> tag; > if (!tag) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*title), WTFMove(*enabled), WTFMove(*separator), WTFMove(*state), WTFMove(*hasAction), WTFMove(*tag) } }; > } >@@ -86,17 +86,17 @@ struct PDFContextMenu { > encoder << m_point << m_items; > } > >- template<class Decoder> static std::optional<PDFContextMenu> decode(Decoder& decoder) >+ template<class Decoder> static Optional<PDFContextMenu> decode(Decoder& decoder) > { >- std::optional<WebCore::IntPoint> point; >+ Optional<WebCore::IntPoint> point; > decoder >> point; > if (!point) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<Vector<PDFContextMenuItem>> items; >+ Optional<Vector<PDFContextMenuItem>> items; > decoder >> items; > if (!items) >- return std::nullopt; >+ return WTF::nullopt; > > return { { WTFMove(*point), WTFMove(*items) } }; > } >diff --git a/Source/WebKit/Shared/mac/SandboxExtensionMac.mm b/Source/WebKit/Shared/mac/SandboxExtensionMac.mm >index 3f23ad24662c348697c2703a59ea66f204a8ef37..0cec985c785c773659772d24f1b6d576d71d75e1 100644 >--- a/Source/WebKit/Shared/mac/SandboxExtensionMac.mm >+++ b/Source/WebKit/Shared/mac/SandboxExtensionMac.mm >@@ -134,11 +134,11 @@ void SandboxExtension::Handle::encode(IPC::Encoder& encoder) const > m_sandboxExtension = 0; > } > >-auto SandboxExtension::Handle::decode(IPC::Decoder& decoder) -> std::optional<Handle> >+auto SandboxExtension::Handle::decode(IPC::Decoder& decoder) -> Optional<Handle> > { > IPC::DataReference dataReference; > if (!decoder.decode(dataReference)) >- return std::nullopt; >+ return WTF::nullopt; > > if (dataReference.isEmpty()) > return {{ }}; >@@ -190,19 +190,19 @@ void SandboxExtension::HandleArray::encode(IPC::Encoder& encoder) const > encoder << handle; > } > >-std::optional<SandboxExtension::HandleArray> SandboxExtension::HandleArray::decode(IPC::Decoder& decoder) >+Optional<SandboxExtension::HandleArray> SandboxExtension::HandleArray::decode(IPC::Decoder& decoder) > { >- std::optional<uint64_t> size; >+ Optional<uint64_t> size; > decoder >> size; > if (!size) >- return std::nullopt; >+ return WTF::nullopt; > SandboxExtension::HandleArray handles; > handles.allocate(*size); > for (size_t i = 0; i < *size; ++i) { >- std::optional<SandboxExtension::Handle> handle; >+ Optional<SandboxExtension::Handle> handle; > decoder >> handle; > if (!handle) >- return std::nullopt; >+ return WTF::nullopt; > handles[i] = WTFMove(*handle); > } > return WTFMove(handles); >diff --git a/Source/WebKit/Shared/mac/SecItemShim.cpp b/Source/WebKit/Shared/mac/SecItemShim.cpp >index 5384dbcd59568955eba5817e21e24f61c07ef341..8e08639e1829331d7a821f9a6a2f442f061fe669 100644 >--- a/Source/WebKit/Shared/mac/SecItemShim.cpp >+++ b/Source/WebKit/Shared/mac/SecItemShim.cpp >@@ -72,9 +72,9 @@ static WorkQueue& workQueue() > return *workQueue; > } > >-static std::optional<SecItemResponseData> sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0) >+static Optional<SecItemResponseData> sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0) > { >- std::optional<SecItemResponseData> response; >+ Optional<SecItemResponseData> response; > > BinarySemaphore semaphore; > >diff --git a/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm b/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm >index 5fda7bf66c9c224c2295738e848e1debfbcce42d..21c006776a66741ab94ae69180bf6b410f994930 100644 >--- a/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm >+++ b/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm >@@ -533,17 +533,17 @@ void ArgumentCoder<WebCore::KeypressCommand>::encode(Encoder& encoder, const Web > encoder << keypressCommand.commandName << keypressCommand.text; > } > >-std::optional<WebCore::KeypressCommand> ArgumentCoder<WebCore::KeypressCommand>::decode(Decoder& decoder) >+Optional<WebCore::KeypressCommand> ArgumentCoder<WebCore::KeypressCommand>::decode(Decoder& decoder) > { >- std::optional<String> commandName; >+ Optional<String> commandName; > decoder >> commandName; > if (!commandName) >- return std::nullopt; >+ return WTF::nullopt; > >- std::optional<String> text; >+ Optional<String> text; > decoder >> text; > if (!text) >- return std::nullopt; >+ return WTF::nullopt; > > WebCore::KeypressCommand command; > command.commandName = WTFMove(*commandName); >diff --git a/Source/WebKit/Shared/mac/WebHitTestResultData.mm b/Source/WebKit/Shared/mac/WebHitTestResultData.mm >index 5881343e8b500416f52d5dfc7427ce4186d549d5..6ea9b6b4e537158827ffaf7b3edd546c3cf608a8 100644 >--- a/Source/WebKit/Shared/mac/WebHitTestResultData.mm >+++ b/Source/WebKit/Shared/mac/WebHitTestResultData.mm >@@ -83,7 +83,7 @@ bool WebHitTestResultData::platformDecode(IPC::Decoder& decoder, WebHitTestResul > return false; > > if (hasDetectedDataTextIndicator) { >- std::optional<WebCore::TextIndicatorData> indicatorData; >+ Optional<WebCore::TextIndicatorData> indicatorData; > decoder >> indicatorData; > if (!indicatorData) > return false; >diff --git a/Source/WebKit/UIProcess/API/APIAttachment.cpp b/Source/WebKit/UIProcess/API/APIAttachment.cpp >index cf4c62e79279feb0cebd21d03b43bfd9016dd72a..a0b2ef7e85fa66e4863218476e0d64a36cb629d3 100644 >--- a/Source/WebKit/UIProcess/API/APIAttachment.cpp >+++ b/Source/WebKit/UIProcess/API/APIAttachment.cpp >@@ -91,9 +91,9 @@ WTF::String Attachment::fileName() const > return { }; > } > >-std::optional<uint64_t> Attachment::fileSizeForDisplay() const >+Optional<uint64_t> Attachment::fileSizeForDisplay() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > > RefPtr<WebCore::SharedBuffer> Attachment::enclosingImageData() const >diff --git a/Source/WebKit/UIProcess/API/APIAttachment.h b/Source/WebKit/UIProcess/API/APIAttachment.h >index 75a6bde65a5ad1af098a2092cdc1654377fbbae4..86ed05d8bab8678c1c0c6f121c94cc373dc4c038 100644 >--- a/Source/WebKit/UIProcess/API/APIAttachment.h >+++ b/Source/WebKit/UIProcess/API/APIAttachment.h >@@ -82,7 +82,7 @@ public: > bool isEmpty() const; > > RefPtr<WebCore::SharedBuffer> enclosingImageData() const; >- std::optional<uint64_t> fileSizeForDisplay() const; >+ Optional<uint64_t> fileSizeForDisplay() const; > > void setHasEnclosingImage(bool hasEnclosingImage) { m_hasEnclosingImage = hasEnclosingImage; } > bool hasEnclosingImage() const { return m_hasEnclosingImage; } >diff --git a/Source/WebKit/UIProcess/API/APIAutomationSessionClient.h b/Source/WebKit/UIProcess/API/APIAutomationSessionClient.h >index 379c8857be94b619555edffec4c3a9a6e1779484..da82e88c5452ec0bb05435afde0f849256beb5cd 100644 >--- a/Source/WebKit/UIProcess/API/APIAutomationSessionClient.h >+++ b/Source/WebKit/UIProcess/API/APIAutomationSessionClient.h >@@ -63,7 +63,7 @@ public: > virtual void acceptCurrentJavaScriptDialogOnPage(WebKit::WebAutomationSession&, WebKit::WebPageProxy&) { } > virtual WTF::String messageOfCurrentJavaScriptDialogOnPage(WebKit::WebAutomationSession&, WebKit::WebPageProxy&) { return WTF::String(); } > virtual void setUserInputForCurrentJavaScriptPromptOnPage(WebKit::WebAutomationSession&, WebKit::WebPageProxy&, const WTF::String&) { } >- virtual std::optional<JavaScriptDialogType> typeOfCurrentJavaScriptDialogOnPage(WebKit::WebAutomationSession&, WebKit::WebPageProxy&) { return std::nullopt; } >+ virtual Optional<JavaScriptDialogType> typeOfCurrentJavaScriptDialogOnPage(WebKit::WebAutomationSession&, WebKit::WebPageProxy&) { return WTF::nullopt; } > }; > > } // namespace API >diff --git a/Source/WebKit/UIProcess/API/APINavigation.h b/Source/WebKit/UIProcess/API/APINavigation.h >index f9e71056d04a4afda5657d9fabcc9e07775ffe91..841d5ac544055ee986c189961e6b139eded15972 100644 >--- a/Source/WebKit/UIProcess/API/APINavigation.h >+++ b/Source/WebKit/UIProcess/API/APINavigation.h >@@ -93,14 +93,14 @@ public: > const WebCore::ResourceRequest& originalRequest() const { return m_originalRequest; } > void setCurrentRequest(WebCore::ResourceRequest&&, WebCore::ProcessIdentifier); > const WebCore::ResourceRequest& currentRequest() const { return m_currentRequest; } >- std::optional<WebCore::ProcessIdentifier> currentRequestProcessIdentifier() const { return m_currentRequestProcessIdentifier; } >+ Optional<WebCore::ProcessIdentifier> currentRequestProcessIdentifier() const { return m_currentRequestProcessIdentifier; } > > bool currentRequestIsRedirect() const { return m_lastNavigationAction.isRedirect; } > > void setTargetItem(WebKit::WebBackForwardListItem& item) { m_targetItem = &item; } > WebKit::WebBackForwardListItem* targetItem() const { return m_targetItem.get(); } > WebKit::WebBackForwardListItem* fromItem() const { return m_fromItem.get(); } >- std::optional<WebCore::FrameLoadType> backForwardFrameLoadType() const { return m_backForwardFrameLoadType; } >+ Optional<WebCore::FrameLoadType> backForwardFrameLoadType() const { return m_backForwardFrameLoadType; } > > void appendRedirectionURL(const WTF::URL&); > Vector<WTF::URL> takeRedirectChain() { return WTFMove(m_redirectChain); } >@@ -150,12 +150,12 @@ private: > uint64_t m_navigationID; > WebCore::ResourceRequest m_originalRequest; > WebCore::ResourceRequest m_currentRequest; >- std::optional<WebCore::ProcessIdentifier> m_currentRequestProcessIdentifier; >+ Optional<WebCore::ProcessIdentifier> m_currentRequestProcessIdentifier; > Vector<WTF::URL> m_redirectChain; > > RefPtr<WebKit::WebBackForwardListItem> m_targetItem; > RefPtr<WebKit::WebBackForwardListItem> m_fromItem; >- std::optional<WebCore::FrameLoadType> m_backForwardFrameLoadType; >+ Optional<WebCore::FrameLoadType> m_backForwardFrameLoadType; > std::unique_ptr<SubstituteData> m_substituteData; > WebKit::NavigationActionData m_lastNavigationAction; > WebKit::FrameInfoData m_originatingFrameInfo; >diff --git a/Source/WebKit/UIProcess/API/APINavigationAction.h b/Source/WebKit/UIProcess/API/APINavigationAction.h >index 30871c7a09554d5cb8a7ed4ab82cbb148cde7874..182499c8cffb096a7347da382748fa2cc86f5f01 100644 >--- a/Source/WebKit/UIProcess/API/APINavigationAction.h >+++ b/Source/WebKit/UIProcess/API/APINavigationAction.h >@@ -44,7 +44,7 @@ public: > > FrameInfo* sourceFrame() const { return m_sourceFrame.get(); } > FrameInfo* targetFrame() const { return m_targetFrame.get(); } >- std::optional<WTF::String> targetFrameName() const { return m_targetFrameName; } >+ Optional<WTF::String> targetFrameName() const { return m_targetFrameName; } > > const WebCore::ResourceRequest& request() const { return m_request; } > const WTF::URL& originalURL() const { return !m_originalURL.isNull() ? m_originalURL : m_request.url(); } >@@ -66,7 +66,7 @@ public: > Navigation* mainFrameNavigation() const { return m_mainFrameNavigation.get(); } > > private: >- NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WTF::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction, API::Navigation* mainFrameNavigation) >+ NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, Optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WTF::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction, API::Navigation* mainFrameNavigation) > : m_sourceFrame(sourceFrame) > , m_targetFrame(targetFrame) > , m_targetFrameName(targetFrameName) >@@ -79,14 +79,14 @@ private: > { > } > >- NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WTF::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction) >+ NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, Optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WTF::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction) > : NavigationAction(WTFMove(navigationActionData), sourceFrame, targetFrame, targetFrameName, WTFMove(request), originalURL, shouldOpenAppLinks, WTFMove(userInitiatedAction), nullptr) > { > } > > RefPtr<FrameInfo> m_sourceFrame; > RefPtr<FrameInfo> m_targetFrame; >- std::optional<WTF::String> m_targetFrameName; >+ Optional<WTF::String> m_targetFrameName; > > WebCore::ResourceRequest m_request; > WTF::URL m_originalURL; >diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.h b/Source/WebKit/UIProcess/API/APIPageConfiguration.h >index 67ac5c66d895168c310de053b3a09c01ef067a76..b5fa6ff307ef8eb9c1f5ea406041c56c75e3a6cc 100644 >--- a/Source/WebKit/UIProcess/API/APIPageConfiguration.h >+++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.h >@@ -95,7 +95,7 @@ public: > bool initialCapitalizationEnabled() { return m_initialCapitalizationEnabled; } > void setInitialCapitalizationEnabled(bool initialCapitalizationEnabled) { m_initialCapitalizationEnabled = initialCapitalizationEnabled; } > >- std::optional<double> cpuLimit() const { return m_cpuLimit; } >+ Optional<double> cpuLimit() const { return m_cpuLimit; } > void setCPULimit(double cpuLimit) { m_cpuLimit = cpuLimit; } > > bool waitsForPaintAfterViewDidMoveToWindow() const { return m_waitsForPaintAfterViewDidMoveToWindow; } >@@ -147,7 +147,7 @@ private: > bool m_waitsForPaintAfterViewDidMoveToWindow { true }; > bool m_drawsBackground { true }; > bool m_controlledByAutomation { false }; >- std::optional<double> m_cpuLimit; >+ Optional<double> m_cpuLimit; > > WTF::String m_overrideContentSecurityPolicy; > >diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h >index 9881bd86d58f091aee39facda6936670ce676858..4ceba880bdd87faf9c5e41ac071f4efdcff60458 100644 >--- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h >+++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h >@@ -212,11 +212,11 @@ private: > bool m_shouldCaptureVideoInUIProcess { false }; > bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS }; > ProcessID m_presentingApplicationPID { getCurrentProcessID() }; >- std::optional<bool> m_processSwapsOnNavigationFromClient; >+ Optional<bool> m_processSwapsOnNavigationFromClient; > bool m_processSwapsOnNavigationFromExperimentalFeatures { false }; > bool m_alwaysKeepAndReuseSwappedProcesses { false }; > bool m_processSwapsOnWindowOpenWithOpener { false }; >- std::optional<bool> m_isAutomaticProcessWarmingEnabledByClient; >+ Optional<bool> m_isAutomaticProcessWarmingEnabledByClient; > bool m_clientWouldBenefitFromAutomaticProcessPrewarming { false }; > WTF::String m_customWebContentServiceBundleIdentifier; > bool m_isJITEnabled { true }; >diff --git a/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp b/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp >index f4414425a9d4abfacbba3876fe7c4c29cc45100c..61a89fb53e9c64c747cc507341e44719c3bc9c1f 100644 >--- a/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp >+++ b/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp >@@ -53,7 +53,7 @@ void WebsitePolicies::setWebsiteDataStore(RefPtr<WebsiteDataStore>&& websiteData > > WebKit::WebsitePoliciesData WebsitePolicies::data() > { >- std::optional<WebKit::WebsiteDataStoreParameters> parameters; >+ Optional<WebKit::WebsiteDataStoreParameters> parameters; > if (m_websiteDataStore) > parameters = m_websiteDataStore->websiteDataStore().parameters(); > return { contentBlockersEnabled(), allowedAutoplayQuirks(), autoplayPolicy(), customHeaderFields(), popUpPolicy(), WTFMove(parameters), m_customUserAgent }; >diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp >index 2ce38bbf789738dc5a41e8350880faba978ec642..ec561dd577535912183d798f28d72ed8a752bb17 100644 >--- a/Source/WebKit/UIProcess/API/C/WKPage.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp >@@ -1474,7 +1474,7 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient > > auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); > bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo->request().url(), resourceRequest.url()); >- auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, std::nullopt, WTFMove(resourceRequest), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); >+ auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, WTF::nullopt, WTFMove(resourceRequest), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); > > auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); > >@@ -2691,7 +2691,7 @@ ProcessID WKPageGetProcessIdentifier(WKPageRef page) > void WKPageGetApplicationManifest_b(WKPageRef page, WKPageGetApplicationManifestBlock block) > { > #if ENABLE(APPLICATION_MANIFEST) >- toImpl(page)->getApplicationManifest([block](const std::optional<WebCore::ApplicationManifest> &manifest, CallbackBase::Error) { >+ toImpl(page)->getApplicationManifest([block](const Optional<WebCore::ApplicationManifest> &manifest, CallbackBase::Error) { > block(); > }); > #else // ENABLE(APPLICATION_MANIFEST) >diff --git a/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm b/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm >index 29ec69a16bbb73d48a75eef1f718c871b8f05640..1653afe29e4e37e78f2ffc5b6d317333e0a82290 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm >@@ -112,13 +112,13 @@ void Attachment::setFileWrapperAndUpdateContentType(NSFileWrapper *fileWrapper, > setFileWrapper(fileWrapper); > } > >-std::optional<uint64_t> Attachment::fileSizeForDisplay() const >+Optional<uint64_t> Attachment::fileSizeForDisplay() const > { > auto fileWrapper = this->fileWrapper(); > > if (![fileWrapper isRegularFile]) { > // FIXME: We should display a size estimate for directory-type file wrappers. >- return std::nullopt; >+ return WTF::nullopt; > } > > if (auto fileSize = [[fileWrapper fileAttributes][NSFileSize] unsignedLongLongValue]) >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index ba2048eabaab68cd733825c64f8b920fab96441e..53d8121b20fbd50a10c010ad9f5d79b68dfcee70 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -219,7 +219,7 @@ WKWebView* fromWebPageProxy(WebKit::WebPageProxy& page) > } > > #if PLATFORM(MAC) >-static _WKOverlayScrollbarStyle toAPIScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> coreScrollbarStyle) >+static _WKOverlayScrollbarStyle toAPIScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle> coreScrollbarStyle) > { > if (!coreScrollbarStyle) > return _WKOverlayScrollbarStyleAutomatic; >@@ -236,7 +236,7 @@ static _WKOverlayScrollbarStyle toAPIScrollbarStyle(std::optional<WebCore::Scrol > return _WKOverlayScrollbarStyleAutomatic; > } > >-static std::optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOverlayScrollbarStyle scrollbarStyle) >+static Optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOverlayScrollbarStyle scrollbarStyle) > { > switch (scrollbarStyle) { > case _WKOverlayScrollbarStyleDark: >@@ -248,7 +248,7 @@ static std::optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOve > case _WKOverlayScrollbarStyleAutomatic: > break; > } >- return std::nullopt; >+ return WTF::nullopt; > } > #endif > >@@ -268,7 +268,7 @@ @implementation WKWebView { > > WeakObjCPtr<id <_WKInputDelegate>> _inputDelegate; > >- std::optional<BOOL> _resolutionForShareSheetImmediateCompletionForTesting; >+ Optional<BOOL> _resolutionForShareSheetImmediateCompletionForTesting; > RetainPtr<WKSafeBrowsingWarning> _safeBrowsingWarning; > > #if PLATFORM(IOS_FAMILY) >@@ -283,10 +283,10 @@ @implementation WKWebView { > > BOOL _overridesViewLayoutSize; > CGSize _viewLayoutSizeOverride; >- std::optional<WebCore::FloatSize> _lastSentViewLayoutSize; >+ Optional<WebCore::FloatSize> _lastSentViewLayoutSize; > BOOL _overridesMaximumUnobscuredSize; > CGSize _maximumUnobscuredSizeOverride; >- std::optional<WebCore::FloatSize> _lastSentMaximumUnobscuredSize; >+ Optional<WebCore::FloatSize> _lastSentMaximumUnobscuredSize; > CGRect _inputViewBounds; > CGFloat _viewportMetaTagWidth; > BOOL _viewportMetaTagWidthWasExplicit; >@@ -307,7 +307,7 @@ @implementation WKWebView { > > UIInterfaceOrientation _interfaceOrientationOverride; > BOOL _overridesInterfaceOrientation; >- std::optional<int32_t> _lastSentDeviceOrientation; >+ Optional<int32_t> _lastSentDeviceOrientation; > > BOOL _allowsViewportShrinkToFit; > >@@ -320,15 +320,15 @@ @implementation WKWebView { > CGFloat _animatedResizeOriginalContentWidth; > RetainPtr<UIView> _resizeAnimationView; > CGFloat _lastAdjustmentForScroller; >- std::optional<CGRect> _frozenVisibleContentRect; >- std::optional<CGRect> _frozenUnobscuredContentRect; >+ Optional<CGRect> _frozenVisibleContentRect; >+ Optional<CGRect> _frozenUnobscuredContentRect; > > BOOL _commitDidRestoreScrollPosition; >- std::optional<WebCore::FloatPoint> _scrollOffsetToRestore; >+ Optional<WebCore::FloatPoint> _scrollOffsetToRestore; > WebCore::FloatBoxExtent _obscuredInsetsWhenSaved; > >- std::optional<WebCore::FloatPoint> _unobscuredCenterToRestore; >- std::optional<uint64_t> _firstTransactionIDAfterPageRestore; >+ Optional<WebCore::FloatPoint> _unobscuredCenterToRestore; >+ Optional<uint64_t> _firstTransactionIDAfterPageRestore; > double _scaleToRestore; > > std::unique_ptr<WebKit::ViewGestureController> _gestureController; >@@ -1753,21 +1753,21 @@ - (void)_processWillSwapOrDidExit > _waitingForCommitAfterAnimatedResize = NO; > _animatedResizeOriginalContentWidth = 0; > [_contentView setHidden:NO]; >- _scrollOffsetToRestore = std::nullopt; >- _unobscuredCenterToRestore = std::nullopt; >+ _scrollOffsetToRestore = WTF::nullopt; >+ _unobscuredCenterToRestore = WTF::nullopt; > _scrollViewBackgroundColor = WebCore::Color(); > _delayUpdateVisibleContentRects = NO; > _hadDelayedUpdateVisibleContentRects = NO; > _currentlyAdjustingScrollViewInsetsForKeyboard = NO; >- _lastSentViewLayoutSize = std::nullopt; >- _lastSentMaximumUnobscuredSize = std::nullopt; >- _lastSentDeviceOrientation = std::nullopt; >+ _lastSentViewLayoutSize = WTF::nullopt; >+ _lastSentMaximumUnobscuredSize = WTF::nullopt; >+ _lastSentDeviceOrientation = WTF::nullopt; > >- _frozenVisibleContentRect = std::nullopt; >- _frozenUnobscuredContentRect = std::nullopt; >+ _frozenVisibleContentRect = WTF::nullopt; >+ _frozenUnobscuredContentRect = WTF::nullopt; > > _firstPaintAfterCommitLoadTransactionID = 0; >- _firstTransactionIDAfterPageRestore = std::nullopt; >+ _firstTransactionIDAfterPageRestore = WTF::nullopt; > > _hasScheduledVisibleRectUpdate = NO; > _commitDidRestoreScrollPosition = NO; >@@ -1953,7 +1953,7 @@ - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTree > if (_firstTransactionIDAfterPageRestore && layerTreeTransaction.transactionID() >= _firstTransactionIDAfterPageRestore.value()) { > if (_scrollOffsetToRestore) { > WebCore::FloatPoint scaledScrollOffset = _scrollOffsetToRestore.value(); >- _scrollOffsetToRestore = std::nullopt; >+ _scrollOffsetToRestore = WTF::nullopt; > > if (areEssentiallyEqualAsFloat(contentZoomScale(self), _scaleToRestore)) { > scaledScrollOffset.scale(_scaleToRestore); >@@ -1968,7 +1968,7 @@ - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTree > > if (_unobscuredCenterToRestore) { > WebCore::FloatPoint unobscuredCenterToRestore = _unobscuredCenterToRestore.value(); >- _unobscuredCenterToRestore = std::nullopt; >+ _unobscuredCenterToRestore = WTF::nullopt; > > if (areEssentiallyEqualAsFloat(contentZoomScale(self), _scaleToRestore)) { > CGRect unobscuredRect = UIEdgeInsetsInsetRect(self.bounds, _obscuredInsets); >@@ -1987,7 +1987,7 @@ - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTree > if (_gestureController) > _gestureController->didRestoreScrollPosition(); > >- _firstTransactionIDAfterPageRestore = std::nullopt; >+ _firstTransactionIDAfterPageRestore = WTF::nullopt; > } > > if (needUpdateVisibleContentRects) >@@ -2012,7 +2012,7 @@ - (void)_couldNotRestorePageState > _gestureController->didRestoreScrollPosition(); > } > >-- (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)obscuredInsets scale:(double)scale >+- (void)_restorePageScrollPosition:(Optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)obscuredInsets scale:(double)scale > { > if (_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) > return; >@@ -2024,13 +2024,13 @@ - (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPos > if (scrollPosition) > _scrollOffsetToRestore = WebCore::ScrollableArea::scrollOffsetFromPosition(WebCore::FloatPoint(scrollPosition.value()), WebCore::toFloatSize(scrollOrigin)); > else >- _scrollOffsetToRestore = std::nullopt; >+ _scrollOffsetToRestore = WTF::nullopt; > > _obscuredInsetsWhenSaved = obscuredInsets; > _scaleToRestore = scale; > } > >-- (void)_restorePageStateToUnobscuredCenter:(std::optional<WebCore::FloatPoint>)center scale:(double)scale >+- (void)_restorePageStateToUnobscuredCenter:(Optional<WebCore::FloatPoint>)center scale:(double)scale > { > if (_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) > return; >@@ -3223,8 +3223,8 @@ - (void)_navigationGestureDidBegin > > - (void)_navigationGestureDidEnd > { >- _frozenVisibleContentRect = std::nullopt; >- _frozenUnobscuredContentRect = std::nullopt; >+ _frozenVisibleContentRect = WTF::nullopt; >+ _frozenUnobscuredContentRect = WTF::nullopt; > } > > - (void)_showPasswordViewWithDocumentName:(NSString *)documentName passwordHandler:(void (^)(NSString *))passwordHandler >@@ -4329,7 +4329,7 @@ + (BOOL)handlesURLScheme:(NSString *)urlScheme > return WebCore::SchemeRegistry::isBuiltinScheme(urlScheme); > } > >-- (std::optional<BOOL>)_resolutionForShareSheetImmediateCompletionForTesting >+- (Optional<BOOL>)_resolutionForShareSheetImmediateCompletionForTesting > { > return _resolutionForShareSheetImmediateCompletionForTesting; > } >@@ -4947,7 +4947,7 @@ - (void)_getContentsAsStringWithCompletionHandler:(void (^)(NSString *, NSError > - (void)_getApplicationManifestWithCompletionHandler:(void (^)(_WKApplicationManifest *))completionHandler > { > #if ENABLE(APPLICATION_MANIFEST) >- _page->getApplicationManifest([completionHandler = makeBlockPtr(completionHandler)](const std::optional<WebCore::ApplicationManifest>& manifest, WebKit::CallbackBase::Error error) { >+ _page->getApplicationManifest([completionHandler = makeBlockPtr(completionHandler)](const Optional<WebCore::ApplicationManifest>& manifest, WebKit::CallbackBase::Error error) { > UNUSED_PARAM(error); > if (completionHandler) { > if (manifest) { >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >index 1d15194cbfba9a9d6aa27479cc7ba5ae86b3b75a..ff0bae7f1ca273f57ab99e43e8058b4c26530cc1 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >@@ -94,8 +94,8 @@ struct PrintInfo; > - (void)_layerTreeCommitComplete; > > - (void)_couldNotRestorePageState; >-- (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)insets scale:(double)scale; >-- (void)_restorePageStateToUnobscuredCenter:(std::optional<WebCore::FloatPoint>)center scale:(double)scale; // FIXME: needs scroll origin? >+- (void)_restorePageScrollPosition:(Optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)insets scale:(double)scale; >+- (void)_restorePageStateToUnobscuredCenter:(Optional<WebCore::FloatPoint>)center scale:(double)scale; // FIXME: needs scroll origin? > > - (RefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot; > >@@ -183,7 +183,7 @@ struct PrintInfo; > - (void)_showSafeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&)completionHandler; > - (void)_clearSafeBrowsingWarning; > >-- (std::optional<BOOL>)_resolutionForShareSheetImmediateCompletionForTesting; >+- (Optional<BOOL>)_resolutionForShareSheetImmediateCompletionForTesting; > > - (WKPageRef)_pageForTesting; > - (WebKit::WebPageProxy*)_page; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h >index c6b3eb552a1b5ede50d8b0612145622f0d4b36af..69f7b154be0dd240f627d7dadc27ff1619d03f27 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h >@@ -38,7 +38,7 @@ template<> struct WrapperTraits<API::WebsiteDataRecord> { > using WrapperClass = WKWebsiteDataRecord; > }; > >-static inline std::optional<WebsiteDataType> toWebsiteDataType(NSString *websiteDataType) >+static inline Optional<WebsiteDataType> toWebsiteDataType(NSString *websiteDataType) > { > if ([websiteDataType isEqualToString:WKWebsiteDataTypeCookies]) > return WebsiteDataType::Cookies; >@@ -76,7 +76,7 @@ static inline std::optional<WebsiteDataType> toWebsiteDataType(NSString *website > return WebsiteDataType::ResourceLoadStatistics; > if ([websiteDataType isEqualToString:_WKWebsiteDataTypeCredentials]) > return WebsiteDataType::Credentials; >- return std::nullopt; >+ return WTF::nullopt; > } > > static inline OptionSet<WebKit::WebsiteDataType> toWebsiteDataTypes(NSSet *websiteDataTypes) >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp b/Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp >index 298339ee532531be0977e649ec1297676457a89b..d2af64bad86a8a33f1335472581b702e41a67ec2 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp >@@ -163,14 +163,14 @@ private: > webkitWebViewSetCurrentScriptDialogUserInput(webView, userInput); > } > >- std::optional<API::AutomationSessionClient::JavaScriptDialogType> typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy& page) override >+ Optional<API::AutomationSessionClient::JavaScriptDialogType> typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy& page) override > { > auto* webView = webkitWebContextGetWebViewForPage(m_session->priv->webContext, &page); > if (!webView) >- return std::nullopt; >+ return WTF::nullopt; > auto dialogType = webkitWebViewGetCurrentScriptDialogType(webView); > if (!dialogType) >- return std::nullopt; >+ return WTF::nullopt; > switch (dialogType.value()) { > case WEBKIT_SCRIPT_DIALOG_ALERT: > return API::AutomationSessionClient::JavaScriptDialogType::Alert; >@@ -183,7 +183,7 @@ private: > } > > ASSERT_NOT_REACHED(); >- return std::nullopt; >+ return WTF::nullopt; > } > > WebKitAutomationSession* m_session; >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp b/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >index 88336b3dc4684988ac77d169da6a595e61e59e55..e4d065f918b3520818d906376ffca776693fc291 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >@@ -87,7 +87,7 @@ WebKitSecurityOrigin* webkit_security_origin_new(const gchar* protocol, const gc > g_return_val_if_fail(protocol, nullptr); > g_return_val_if_fail(host, nullptr); > >- std::optional<uint16_t> optionalPort; >+ Optional<uint16_t> optionalPort; > if (port) > optionalPort = port; > >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp >index 1c7688690781f2a09c0c8b7b48f78e8eee55690f..b08ce1d0afc9b94f102645d19c660688e252c43c 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp >@@ -53,7 +53,7 @@ private: > void createNewPage(WebPageProxy& page, Ref<API::FrameInfo>&& frameInfo, WebCore::ResourceRequest&& resourceRequest, WebCore::WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, CompletionHandler<void(RefPtr<WebPageProxy>&&)>&& completionHandler) final > { > auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); >- WebKitNavigationAction navigationAction(API::NavigationAction::create(WTFMove(navigationActionData), frameInfo.ptr(), nullptr, std::nullopt, WTFMove(resourceRequest), URL { }, false, WTFMove(userInitiatedActivity))); >+ WebKitNavigationAction navigationAction(API::NavigationAction::create(WTFMove(navigationActionData), frameInfo.ptr(), nullptr, WTF::nullopt, WTFMove(resourceRequest), URL { }, false, WTFMove(userInitiatedActivity))); > completionHandler(webkitWebViewCreateNewPage(m_webView, windowFeatures, &navigationAction)); > } > >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >index f5d4fb6883b86bc2e3fa0d8578484fffa0d55ace..67201d89eaa1f3f20df8b91f1da15d9c258b638f 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp >@@ -2258,10 +2258,10 @@ void webkitWebViewDismissCurrentScriptDialog(WebKitWebView* webView) > webkitScriptDialogDismiss(webView->priv->currentScriptDialog); > } > >-std::optional<WebKitScriptDialogType> webkitWebViewGetCurrentScriptDialogType(WebKitWebView* webView) >+Optional<WebKitScriptDialogType> webkitWebViewGetCurrentScriptDialogType(WebKitWebView* webView) > { > if (!webView->priv->currentScriptDialog) >- return std::nullopt; >+ return WTF::nullopt; > > return static_cast<WebKitScriptDialogType>(webView->priv->currentScriptDialog->type); > } >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h >index 1e599fc65f6902f641e303f8e578b0e0d3a460aa..e9ef60c577c4541b872092d732444a7eabad9a4d 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h >@@ -62,7 +62,7 @@ String webkitWebViewGetCurrentScriptDialogMessage(WebKitWebView*); > void webkitWebViewSetCurrentScriptDialogUserInput(WebKitWebView*, const String&); > void webkitWebViewAcceptCurrentScriptDialog(WebKitWebView*); > void webkitWebViewDismissCurrentScriptDialog(WebKitWebView*); >-std::optional<WebKitScriptDialogType> webkitWebViewGetCurrentScriptDialogType(WebKitWebView*); >+Optional<WebKitScriptDialogType> webkitWebViewGetCurrentScriptDialogType(WebKitWebView*); > void webkitWebViewMakePermissionRequest(WebKitWebView*, WebKitPermissionRequest*); > void webkitWebViewMakePolicyDecision(WebKitWebView*, WebKitPolicyDecisionType, WebKitPolicyDecision*); > void webkitWebViewMouseTargetChanged(WebKitWebView*, const WebKit::WebHitTestResultData&, WebKit::WebEvent::Modifiers); >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.cpp >index 202dd09c22abccd7a62d51f56e6c209ccc811812..8b11eac6dd8ae3fd722b23e3407ede7726824a77 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.cpp >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.cpp >@@ -34,7 +34,7 @@ WebKitPopupMenu::WebKitPopupMenu(GtkWidget* webView, WebPopupMenuProxy::Client& > > static void menuCloseCallback(WebKitPopupMenu* popupMenu) > { >- popupMenu->activateItem(std::nullopt); >+ popupMenu->activateItem(WTF::nullopt); > } > > void WebKitPopupMenu::showPopupMenu(const IntRect& rect, TextDirection direction, double pageScaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData& platformData, int32_t selectedIndex) >@@ -68,7 +68,7 @@ void WebKitPopupMenu::cancelTracking() > m_menu = nullptr; > } > >-void WebKitPopupMenu::activateItem(std::optional<unsigned> itemIndex) >+void WebKitPopupMenu::activateItem(Optional<unsigned> itemIndex) > { > WebPopupMenuProxyGtk::activateItem(itemIndex); > if (m_menu) { >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.h b/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.h >index 8e8aedba64b36114acc7234ee7d0915dcd2f6cda..84ba68857c3270cf21a9cc60ade35d7831317ac5 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.h >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitPopupMenu.h >@@ -34,7 +34,7 @@ public: > } > ~WebKitPopupMenu() = default; > >- void activateItem(std::optional<unsigned> itemIndex) override; >+ void activateItem(Optional<unsigned> itemIndex) override; > > private: > WebKitPopupMenu(GtkWidget*, WebPopupMenuProxy::Client&); >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp >index e59435d2c536a5f9aa1c36b857c04e826d5e8cbd..d7d0a6d49840af7124090b5b28458c0b02ce617d 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp >@@ -808,7 +808,7 @@ static gboolean webkitWebViewBaseButtonReleaseEvent(GtkWidget* widget, GdkEventB > return GDK_EVENT_STOP; > } > >-static void webkitWebViewBaseHandleWheelEvent(WebKitWebViewBase* webViewBase, GdkEvent* event, std::optional<WebWheelEvent::Phase> phase = std::nullopt, std::optional<WebWheelEvent::Phase> momentum = std::nullopt) >+static void webkitWebViewBaseHandleWheelEvent(WebKitWebViewBase* webViewBase, GdkEvent* event, Optional<WebWheelEvent::Phase> phase = WTF::nullopt, Optional<WebWheelEvent::Phase> momentum = WTF::nullopt) > { > WebKitWebViewBasePrivate* priv = webViewBase->priv; > ASSERT(!priv->dialog); >diff --git a/Source/WebKit/UIProcess/API/mac/WKView.mm b/Source/WebKit/UIProcess/API/mac/WKView.mm >index 13967212e3e53510d4b1c70f00cb29d8b149c193..c7670b68d20022c1cc449d6ad26de7de764178c9 100644 >--- a/Source/WebKit/UIProcess/API/mac/WKView.mm >+++ b/Source/WebKit/UIProcess/API/mac/WKView.mm >@@ -1456,7 +1456,7 @@ - (CGFloat)_totalHeightOfBanners > return _data->_impl->totalHeightOfBanners(); > } > >-static std::optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOverlayScrollbarStyle scrollbarStyle) >+static Optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOverlayScrollbarStyle scrollbarStyle) > { > switch (scrollbarStyle) { > case _WKOverlayScrollbarStyleDark: >@@ -1470,10 +1470,10 @@ static std::optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOve > break; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > >-static _WKOverlayScrollbarStyle toAPIScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> coreScrollbarStyle) >+static _WKOverlayScrollbarStyle toAPIScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle> coreScrollbarStyle) > { > if (!coreScrollbarStyle) > return _WKOverlayScrollbarStyleAutomatic; >diff --git a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp >index edae083e9e9845a42aada68c035323d237042bb1..3edbb8f7c63fa582b71a00b4b34e21f621727bc4 100644 >--- a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp >+++ b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp >@@ -139,7 +139,7 @@ void WebPaymentCoordinatorProxy::completeMerchantValidation(const WebCore::Payme > m_merchantValidationState = MerchantValidationState::ValidationComplete; > } > >-void WebPaymentCoordinatorProxy::completeShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>& update) >+void WebPaymentCoordinatorProxy::completeShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>& update) > { > // It's possible that the payment has been canceled already. > if (m_state == State::Idle) >@@ -152,7 +152,7 @@ void WebPaymentCoordinatorProxy::completeShippingMethodSelection(const std::opti > m_state = State::Active; > } > >-void WebPaymentCoordinatorProxy::completeShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>& update) >+void WebPaymentCoordinatorProxy::completeShippingContactSelection(const Optional<WebCore::ShippingContactUpdate>& update) > { > // It's possible that the payment has been canceled already. > if (m_state == State::Idle) >@@ -165,7 +165,7 @@ void WebPaymentCoordinatorProxy::completeShippingContactSelection(const std::opt > m_state = State::Active; > } > >-void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>& update) >+void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const Optional<WebCore::PaymentMethodUpdate>& update) > { > // It's possible that the payment has been canceled already. > if (m_state == State::Idle) >@@ -178,7 +178,7 @@ void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const std::optio > m_state = State::Active; > } > >-void WebPaymentCoordinatorProxy::completePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>& result) >+void WebPaymentCoordinatorProxy::completePaymentSession(const Optional<WebCore::PaymentAuthorizationResult>& result) > { > // It's possible that the payment has been canceled already. > if (!canCompletePayment()) >diff --git a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h >index 1fbcd345613c07d4ee919a7de4595d0a256ceee2..1b16e9f9fc7ab0c644b9e152b1ae598916f76e7b 100644 >--- a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h >+++ b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h >@@ -84,10 +84,10 @@ private: > void openPaymentSetup(const String& merchantIdentifier, const String& domainName, uint64_t requestID); > void showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest&, bool& result); > void completeMerchantValidation(const WebCore::PaymentMerchantSession&); >- void completeShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>&); >- void completeShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>&); >- void completePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>&); >- void completePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>&); >+ void completeShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>&); >+ void completeShippingContactSelection(const Optional<WebCore::ShippingContactUpdate>&); >+ void completePaymentMethodSelection(const Optional<WebCore::PaymentMethodUpdate>&); >+ void completePaymentSession(const Optional<WebCore::PaymentAuthorizationResult>&); > void abortPaymentSession(); > void cancelPaymentSession(); > >@@ -104,10 +104,10 @@ private: > void platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler); > void platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, WTF::Function<void(bool)>&& completionHandler); > void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&); >- void platformCompleteShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>&); >- void platformCompleteShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>&); >- void platformCompletePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>&); >- void platformCompletePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>&); >+ void platformCompleteShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>&); >+ void platformCompleteShippingContactSelection(const Optional<WebCore::ShippingContactUpdate>&); >+ void platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentMethodUpdate>&); >+ void platformCompletePaymentSession(const Optional<WebCore::PaymentAuthorizationResult>&); > > WebPageProxy& m_webPageProxy; > >diff --git a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in >index 864b73b5874fb8f949179b5345ece2b0d4a81e86..f60664dd58516677a8e3e0ff05441d9cbb022436 100644 >--- a/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in >+++ b/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in >@@ -33,10 +33,10 @@ messages -> WebPaymentCoordinatorProxy { > > ShowPaymentUI(String originatingURLString, Vector<String> linkIconURLStrings, WebCore::ApplePaySessionPaymentRequest paymentRequest) -> (bool result) LegacySync > CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession) >- CompleteShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate> update) >- CompleteShippingContactSelection(std::optional<WebCore::ShippingContactUpdate> update) >- CompletePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate> update) >- CompletePaymentSession(std::optional<WebCore::PaymentAuthorizationResult> result) >+ CompleteShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate> update) >+ CompleteShippingContactSelection(Optional<WebCore::ShippingContactUpdate> update) >+ CompletePaymentMethodSelection(Optional<WebCore::PaymentMethodUpdate> update) >+ CompletePaymentSession(Optional<WebCore::PaymentAuthorizationResult> result) > AbortPaymentSession() > CancelPaymentSession() > } >diff --git a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >index a675ebdea975105ed4b9ea2bc50701d6aa1b408d..eaf5bcd7442a141ce76cb15ed6aab6b321f4d54d 100644 >--- a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >+++ b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >@@ -644,7 +644,7 @@ static RetainPtr<NSArray> toNSErrors(const Vector<WebCore::PaymentError>& errors > return result; > } > #else >-static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const std::optional<WebCore::PaymentAuthorizationResult>& result) >+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const Optional<WebCore::PaymentAuthorizationResult>& result) > { > if (!result) > return PKPaymentAuthorizationStatusSuccess; >@@ -684,7 +684,7 @@ static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const std::op > } > #endif > >-void WebPaymentCoordinatorProxy::platformCompletePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>& result) >+void WebPaymentCoordinatorProxy::platformCompletePaymentSession(const Optional<WebCore::PaymentAuthorizationResult>& result) > { > ASSERT(m_paymentAuthorizationViewController); > ASSERT(m_paymentAuthorizationViewControllerDelegate); >@@ -710,7 +710,7 @@ void WebPaymentCoordinatorProxy::platformCompleteMerchantValidation(const WebCor > m_paymentAuthorizationViewControllerDelegate->_sessionBlock = nullptr; > } > >-void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>& update) >+void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>& update) > { > ASSERT(m_paymentAuthorizationViewController); > ASSERT(m_paymentAuthorizationViewControllerDelegate); >@@ -728,7 +728,7 @@ void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(const s > } > > #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000) >-static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const std::optional<WebCore::ShippingContactUpdate>& update) >+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const Optional<WebCore::ShippingContactUpdate>& update) > { > if (!update || update->errors.isEmpty()) > return PKPaymentAuthorizationStatusSuccess; >@@ -755,7 +755,7 @@ static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const std::op > } > #endif > >-void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>& update) >+void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(const Optional<WebCore::ShippingContactUpdate>& update) > { > ASSERT(m_paymentAuthorizationViewController); > ASSERT(m_paymentAuthorizationViewControllerDelegate); >@@ -779,7 +779,7 @@ void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(const > m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion = nullptr; > } > >-void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>& update) >+void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentMethodUpdate>& update) > { > ASSERT(m_paymentAuthorizationViewController); > ASSERT(m_paymentAuthorizationViewControllerDelegate); >diff --git a/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp b/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp >index 448b2715626823d71dfae3a2a8359562cca3069a..dbe8397209da168db119baf460c5f2d8b695ff3f 100644 >--- a/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp >+++ b/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp >@@ -117,7 +117,7 @@ void SimulatedInputDispatcher::keyFrameTransitionDurationTimerFired() > > if (isKeyFrameTransitionComplete()) { > auto finish = std::exchange(m_keyFrameTransitionCompletionHandler, nullptr); >- finish(std::nullopt); >+ finish(WTF::nullopt); > } > } > >@@ -138,11 +138,11 @@ void SimulatedInputDispatcher::transitionToNextKeyFrame() > { > ++m_keyframeIndex; > if (m_keyframeIndex == m_keyframes.size()) { >- finishDispatching(std::nullopt); >+ finishDispatching(WTF::nullopt); > return; > } > >- transitionBetweenKeyFrames(m_keyframes[m_keyframeIndex - 1], m_keyframes[m_keyframeIndex], [this, protectedThis = makeRef(*this)](std::optional<AutomationCommandError> error) { >+ transitionBetweenKeyFrames(m_keyframes[m_keyframeIndex - 1], m_keyframes[m_keyframeIndex], [this, protectedThis = makeRef(*this)](Optional<AutomationCommandError> error) { > if (error) { > finishDispatching(error); > return; >@@ -156,7 +156,7 @@ void SimulatedInputDispatcher::transitionToNextInputSourceState() > { > if (isKeyFrameTransitionComplete()) { > auto finish = std::exchange(m_keyFrameTransitionCompletionHandler, nullptr); >- finish(std::nullopt); >+ finish(WTF::nullopt); > return; > } > >@@ -168,7 +168,7 @@ void SimulatedInputDispatcher::transitionToNextInputSourceState() > auto& postStateEntry = nextKeyFrame.states[m_inputSourceStateIndex]; > SimulatedInputSource& inputSource = postStateEntry.first; > >- transitionInputSourceToState(inputSource, postStateEntry.second, [this, protectedThis = makeRef(*this)](std::optional<AutomationCommandError> error) { >+ transitionInputSourceToState(inputSource, postStateEntry.second, [this, protectedThis = makeRef(*this)](Optional<AutomationCommandError> error) { > if (error) { > auto finish = std::exchange(m_keyFrameTransitionCompletionHandler, nullptr); > finish(error); >@@ -196,33 +196,33 @@ void SimulatedInputDispatcher::transitionBetweenKeyFrames(const SimulatedInputKe > transitionToNextInputSourceState(); > } > >-void SimulatedInputDispatcher::resolveLocation(const WebCore::IntPoint& currentLocation, std::optional<WebCore::IntPoint> location, MouseMoveOrigin origin, std::optional<String> nodeHandle, Function<void (std::optional<WebCore::IntPoint>, std::optional<AutomationCommandError>)>&& completionHandler) >+void SimulatedInputDispatcher::resolveLocation(const WebCore::IntPoint& currentLocation, Optional<WebCore::IntPoint> location, MouseMoveOrigin origin, Optional<String> nodeHandle, Function<void (Optional<WebCore::IntPoint>, Optional<AutomationCommandError>)>&& completionHandler) > { > if (!location) { >- completionHandler(currentLocation, std::nullopt); >+ completionHandler(currentLocation, WTF::nullopt); > return; > } > > switch (origin) { > case MouseMoveOrigin::Viewport: >- completionHandler(location.value(), std::nullopt); >+ completionHandler(location.value(), WTF::nullopt); > break; > case MouseMoveOrigin::Pointer: { > WebCore::IntPoint destination(currentLocation); > destination.moveBy(location.value()); >- completionHandler(destination, std::nullopt); >+ completionHandler(destination, WTF::nullopt); > break; > } > case MouseMoveOrigin::Element: { >- m_client.viewportInViewCenterPointOfElement(m_page, m_frameID.value(), nodeHandle.value(), [destination = location.value(), completionHandler = WTFMove(completionHandler)](std::optional<WebCore::IntPoint> inViewCenterPoint, std::optional<AutomationCommandError> error) mutable { >+ m_client.viewportInViewCenterPointOfElement(m_page, m_frameID.value(), nodeHandle.value(), [destination = location.value(), completionHandler = WTFMove(completionHandler)](Optional<WebCore::IntPoint> inViewCenterPoint, Optional<AutomationCommandError> error) mutable { > if (error) { >- completionHandler(std::nullopt, error); >+ completionHandler(WTF::nullopt, error); > return; > } > > ASSERT(inViewCenterPoint); > destination.moveBy(inViewCenterPoint.value()); >- completionHandler(destination, std::nullopt); >+ completionHandler(destination, WTF::nullopt); > }); > break; > } >@@ -237,7 +237,7 @@ void SimulatedInputDispatcher::transitionInputSourceToState(SimulatedInputSource > > LOG(Automation, "SimulatedInputDispatcher[%p]: transition started between input source states: [%d.%d] --> %d.%d", this, m_keyframeIndex - 1, m_inputSourceStateIndex, m_keyframeIndex, m_inputSourceStateIndex); > >- AutomationCompletionHandler eventDispatchFinished = [this, &inputSource, &newState, completionHandler = WTFMove(completionHandler)](std::optional<AutomationCommandError> error) mutable { >+ AutomationCompletionHandler eventDispatchFinished = [this, &inputSource, &newState, completionHandler = WTFMove(completionHandler)](Optional<AutomationCommandError> error) mutable { > if (error) { > completionHandler(error); > return; >@@ -250,16 +250,16 @@ void SimulatedInputDispatcher::transitionInputSourceToState(SimulatedInputSource > #endif > > inputSource.state = newState; >- completionHandler(std::nullopt); >+ completionHandler(WTF::nullopt); > }; > > switch (inputSource.type) { > case SimulatedInputSourceType::Null: > // The maximum duration is handled at the keyframe level by m_keyFrameTransitionDurationTimer. >- eventDispatchFinished(std::nullopt); >+ eventDispatchFinished(WTF::nullopt); > break; > case SimulatedInputSourceType::Mouse: { >- resolveLocation(a.location.value_or(WebCore::IntPoint()), b.location, b.origin.value_or(MouseMoveOrigin::Viewport), b.nodeHandle, [this, &a, &b, eventDispatchFinished = WTFMove(eventDispatchFinished)](std::optional<WebCore::IntPoint> location, std::optional<AutomationCommandError> error) mutable { >+ resolveLocation(a.location.value_or(WebCore::IntPoint()), b.location, b.origin.value_or(MouseMoveOrigin::Viewport), b.nodeHandle, [this, &a, &b, eventDispatchFinished = WTFMove(eventDispatchFinished)](Optional<WebCore::IntPoint> location, Optional<AutomationCommandError> error) mutable { > if (error) { > eventDispatchFinished(error); > return; >@@ -284,7 +284,7 @@ void SimulatedInputDispatcher::transitionInputSourceToState(SimulatedInputSource > // FIXME: This does not interpolate mousemoves per the "perform a pointer move" algorithm (§17.4 Dispatching Actions). > m_client.simulateMouseInteraction(m_page, MouseInteraction::Move, b.pressedMouseButton.value_or(MouseButton::NoButton), b.location.value(), WTFMove(eventDispatchFinished)); > } else >- eventDispatchFinished(std::nullopt); >+ eventDispatchFinished(WTF::nullopt); > }); > break; > } >@@ -326,7 +326,7 @@ void SimulatedInputDispatcher::transitionInputSourceToState(SimulatedInputSource > } > } > } else >- eventDispatchFinished(std::nullopt); >+ eventDispatchFinished(WTF::nullopt); > break; > case SimulatedInputSourceType::Touch: > // Not supported yet. >@@ -370,14 +370,14 @@ void SimulatedInputDispatcher::cancel() > finishDispatching(AUTOMATION_COMMAND_ERROR_WITH_NAME(InternalError)); > } > >-void SimulatedInputDispatcher::finishDispatching(std::optional<AutomationCommandError> error) >+void SimulatedInputDispatcher::finishDispatching(Optional<AutomationCommandError> error) > { > m_keyFrameTransitionDurationTimer.stop(); > > LOG(Automation, "SimulatedInputDispatcher[%p]: finished all input simulation at [%u.%u]", this, m_keyframeIndex, m_inputSourceStateIndex); > > auto finish = std::exchange(m_runCompletionHandler, nullptr); >- m_frameID = std::nullopt; >+ m_frameID = WTF::nullopt; > m_keyframes.clear(); > m_inputSources.clear(); > m_keyframeIndex = 0; >diff --git a/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h b/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h >index dd3d04f38d1d991044aa8f5cbe28801aff1cf18a..47733ac744103280070e41ffe241fb0ddda6735a 100644 >--- a/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h >+++ b/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h >@@ -46,7 +46,7 @@ enum class VirtualKey; > namespace WebKit { > > class AutomationCommandError; >-using AutomationCompletionHandler = WTF::CompletionHandler<void(std::optional<AutomationCommandError>)>; >+using AutomationCompletionHandler = WTF::CompletionHandler<void(Optional<AutomationCommandError>)>; > > class WebPageProxy; > >@@ -66,13 +66,13 @@ enum class SimulatedInputSourceType { > }; > > struct SimulatedInputSourceState { >- std::optional<CharKey> pressedCharKey; >+ Optional<CharKey> pressedCharKey; > VirtualKeySet pressedVirtualKeys; >- std::optional<MouseButton> pressedMouseButton; >- std::optional<MouseMoveOrigin> origin; >- std::optional<String> nodeHandle; >- std::optional<WebCore::IntPoint> location; >- std::optional<Seconds> duration; >+ Optional<MouseButton> pressedMouseButton; >+ Optional<MouseMoveOrigin> origin; >+ Optional<String> nodeHandle; >+ Optional<WebCore::IntPoint> location; >+ Optional<Seconds> duration; > > static SimulatedInputSourceState emptyStateForSourceType(SimulatedInputSourceType); > }; >@@ -117,7 +117,7 @@ public: > virtual ~Client() { } > virtual void simulateMouseInteraction(WebPageProxy&, MouseInteraction, WebMouseEvent::Button, const WebCore::IntPoint& locationInView, AutomationCompletionHandler&&) = 0; > virtual void simulateKeyboardInteraction(WebPageProxy&, KeyboardInteraction, WTF::Variant<VirtualKey, CharKey>&&, AutomationCompletionHandler&&) = 0; >- virtual void viewportInViewCenterPointOfElement(WebPageProxy&, uint64_t frameID, const String& nodeHandle, Function<void (std::optional<WebCore::IntPoint>, std::optional<AutomationCommandError>)>&&) = 0; >+ virtual void viewportInViewCenterPointOfElement(WebPageProxy&, uint64_t frameID, const String& nodeHandle, Function<void (Optional<WebCore::IntPoint>, Optional<AutomationCommandError>)>&&) = 0; > }; > > static Ref<SimulatedInputDispatcher> create(WebPageProxy& page, SimulatedInputDispatcher::Client& client) >@@ -140,17 +140,17 @@ private: > > void transitionToNextInputSourceState(); > void transitionInputSourceToState(SimulatedInputSource&, SimulatedInputSourceState& newState, AutomationCompletionHandler&&); >- void finishDispatching(std::optional<AutomationCommandError>); >+ void finishDispatching(Optional<AutomationCommandError>); > > void keyFrameTransitionDurationTimerFired(); > bool isKeyFrameTransitionComplete() const; > >- void resolveLocation(const WebCore::IntPoint& currentLocation, std::optional<WebCore::IntPoint> location, MouseMoveOrigin, std::optional<String> nodeHandle, Function<void (std::optional<WebCore::IntPoint>, std::optional<AutomationCommandError>)>&&); >+ void resolveLocation(const WebCore::IntPoint& currentLocation, Optional<WebCore::IntPoint> location, MouseMoveOrigin, Optional<String> nodeHandle, Function<void (Optional<WebCore::IntPoint>, Optional<AutomationCommandError>)>&&); > > WebPageProxy& m_page; > SimulatedInputDispatcher::Client& m_client; > >- std::optional<uint64_t> m_frameID; >+ Optional<uint64_t> m_frameID; > AutomationCompletionHandler m_runCompletionHandler; > AutomationCompletionHandler m_keyFrameTransitionCompletionHandler; > RunLoop::Timer<SimulatedInputDispatcher> m_keyFrameTransitionDurationTimer; >diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >index f2932c47d02c3d761c888d438dc0c34a53ac32c7..370b21ed6da03232aacaeb8204fcb657ae6b690a 100644 >--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >@@ -187,14 +187,14 @@ String WebAutomationSession::handleForWebPageProxy(const WebPageProxy& webPagePr > return handle; > } > >-std::optional<uint64_t> WebAutomationSession::webFrameIDForHandle(const String& handle) >+Optional<uint64_t> WebAutomationSession::webFrameIDForHandle(const String& handle) > { > if (handle.isEmpty()) > return 0; > > auto iter = m_handleWebFrameMap.find(handle); > if (iter == m_handleWebFrameMap.end()) >- return std::nullopt; >+ return WTF::nullopt; > > return iter->value; > } >@@ -331,7 +331,7 @@ void WebAutomationSession::switchToBrowsingContext(const String& browsingContext > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- std::optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); >+ Optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > >@@ -346,8 +346,8 @@ void WebAutomationSession::switchToBrowsingContext(const String& browsingContext > > void WebAutomationSession::setWindowFrameOfBrowsingContext(const String& handle, const JSON::Object* optionalOriginObject, const JSON::Object* optionalSizeObject, Ref<SetWindowFrameOfBrowsingContextCallback>&& callback) > { >- std::optional<float> x; >- std::optional<float> y; >+ Optional<float> x; >+ Optional<float> y; > if (optionalOriginObject) { > if (!(x = optionalOriginObject->getNumber<float>("x"_s))) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(MissingParameter, "The 'x' parameter was not found or invalid."); >@@ -362,8 +362,8 @@ void WebAutomationSession::setWindowFrameOfBrowsingContext(const String& handle, > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The 'y' parameter had an invalid value."); > } > >- std::optional<float> width; >- std::optional<float> height; >+ Optional<float> width; >+ Optional<float> height; > if (optionalSizeObject) { > if (!(width = optionalSizeObject->getNumber<float>("width"_s))) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(MissingParameter, "The 'width' parameter was not found or invalid."); >@@ -397,14 +397,14 @@ void WebAutomationSession::setWindowFrameOfBrowsingContext(const String& handle, > }); > } > >-static std::optional<Inspector::Protocol::Automation::PageLoadStrategy> pageLoadStrategyFromStringParameter(const String* optionalPageLoadStrategyString) >+static Optional<Inspector::Protocol::Automation::PageLoadStrategy> pageLoadStrategyFromStringParameter(const String* optionalPageLoadStrategyString) > { > if (!optionalPageLoadStrategyString) > return defaultPageLoadStrategy; > > auto parsedPageLoadStrategy = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::PageLoadStrategy>(*optionalPageLoadStrategyString); > if (!parsedPageLoadStrategy) >- return std::nullopt; >+ return WTF::nullopt; > return parsedPageLoadStrategy; > } > >@@ -428,7 +428,7 @@ void WebAutomationSession::waitForNavigationToComplete(const String& browsingCon > && page->pageLoadState().isLoading() && m_client->isShowingJavaScriptDialogOnPage(*this, *page); > > if (optionalFrameHandle && !optionalFrameHandle->isEmpty()) { >- std::optional<uint64_t> frameID = webFrameIDForHandle(*optionalFrameHandle); >+ Optional<uint64_t> frameID = webFrameIDForHandle(*optionalFrameHandle); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > WebFrameProxy* frame = page->process().webFrame(frameID.value()); >@@ -633,14 +633,14 @@ void WebAutomationSession::willShowJavaScriptDialog(WebPageProxy& page) > if (!m_pendingMouseEventsFlushedCallbacksPerPage.isEmpty()) { > for (auto key : copyToVector(m_pendingMouseEventsFlushedCallbacksPerPage.keys())) { > auto callback = m_pendingMouseEventsFlushedCallbacksPerPage.take(key); >- callback(std::nullopt); >+ callback(WTF::nullopt); > } > } > > if (!m_pendingKeyboardEventsFlushedCallbacksPerPage.isEmpty()) { > for (auto key : copyToVector(m_pendingKeyboardEventsFlushedCallbacksPerPage.keys())) { > auto callback = m_pendingKeyboardEventsFlushedCallbacksPerPage.take(key); >- callback(std::nullopt); >+ callback(WTF::nullopt); > } > } > }); >@@ -761,13 +761,13 @@ void WebAutomationSession::inspectorFrontendLoaded(const WebPageProxy& page) > void WebAutomationSession::mouseEventsFlushedForPage(const WebPageProxy& page) > { > if (auto callback = m_pendingMouseEventsFlushedCallbacksPerPage.take(page.pageID())) >- callback(std::nullopt); >+ callback(WTF::nullopt); > } > > void WebAutomationSession::keyboardEventsFlushedForPage(const WebPageProxy& page) > { > if (auto callback = m_pendingKeyboardEventsFlushedCallbacksPerPage.take(page.pageID())) >- callback(std::nullopt); >+ callback(WTF::nullopt); > } > > void WebAutomationSession::willClosePage(const WebPageProxy& page) >@@ -783,7 +783,7 @@ void WebAutomationSession::willClosePage(const WebPageProxy& page) > callback(AUTOMATION_COMMAND_ERROR_WITH_NAME(WindowNotFound)); > > // Then tell the input dispatcher to cancel so timers are stopped, and let it go out of scope. >- std::optional<Ref<SimulatedInputDispatcher>> inputDispatcher = m_inputDispatchersByPage.take(page.pageID()); >+ Optional<Ref<SimulatedInputDispatcher>> inputDispatcher = m_inputDispatchersByPage.take(page.pageID()); > if (inputDispatcher.has_value()) > inputDispatcher.value()->cancel(); > } >@@ -876,7 +876,7 @@ void WebAutomationSession::evaluateJavaScriptFunction(const String& browsingCont > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- std::optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); >+ Optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > >@@ -919,7 +919,7 @@ void WebAutomationSession::resolveChildFrameHandle(const String& browsingContext > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- std::optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); >+ Optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > >@@ -962,7 +962,7 @@ void WebAutomationSession::resolveParentFrameHandle(const String& browsingContex > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- std::optional<uint64_t> frameID = webFrameIDForHandle(frameHandle); >+ Optional<uint64_t> frameID = webFrameIDForHandle(frameHandle); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > >@@ -984,7 +984,7 @@ void WebAutomationSession::didResolveParentFrame(uint64_t callbackID, uint64_t f > callback->sendSuccess(handleForWebFrameID(frameID)); > } > >-static std::optional<CoordinateSystem> protocolStringToCoordinateSystem(const String& coordinateSystemString) >+static Optional<CoordinateSystem> protocolStringToCoordinateSystem(const String& coordinateSystemString) > { > if (coordinateSystemString == "Page") > return CoordinateSystem::Page; >@@ -992,7 +992,7 @@ static std::optional<CoordinateSystem> protocolStringToCoordinateSystem(const St > return CoordinateSystem::LayoutViewport; > if (coordinateSystemString == "VisualViewport") > return CoordinateSystem::VisualViewport; >- return std::nullopt; >+ return WTF::nullopt; > } > > void WebAutomationSession::computeElementLayout(const String& browsingContextHandle, const String& frameHandle, const String& nodeHandle, const bool* optionalScrollIntoViewIfNeeded, const String& coordinateSystemString, Ref<ComputeElementLayoutCallback>&& callback) >@@ -1001,11 +1001,11 @@ void WebAutomationSession::computeElementLayout(const String& browsingContextHan > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- std::optional<uint64_t> frameID = webFrameIDForHandle(frameHandle); >+ Optional<uint64_t> frameID = webFrameIDForHandle(frameHandle); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > >- std::optional<CoordinateSystem> coordinateSystem = protocolStringToCoordinateSystem(coordinateSystemString); >+ Optional<CoordinateSystem> coordinateSystem = protocolStringToCoordinateSystem(coordinateSystemString); > if (!coordinateSystem) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'coordinateSystem' is invalid."); > >@@ -1017,12 +1017,12 @@ void WebAutomationSession::computeElementLayout(const String& browsingContextHan > page->process().send(Messages::WebAutomationSessionProxy::ComputeElementLayout(page->pageID(), frameID.value(), nodeHandle, scrollIntoViewIfNeeded, coordinateSystem.value(), callbackID), 0); > } > >-void WebAutomationSession::didComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, std::optional<WebCore::IntPoint> inViewCenterPoint, bool isObscured, const String& errorType) >+void WebAutomationSession::didComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, Optional<WebCore::IntPoint> inViewCenterPoint, bool isObscured, const String& errorType) > { > if (callbackID % 2 == 1) { > ASSERT(inViewCenterPoint); > if (auto callback = m_viewportInViewCenterPointOfElementCallbacks.take(callbackID)) { >- std::optional<AutomationCommandError> error; >+ Optional<AutomationCommandError> error; > if (!errorType.isEmpty()) > error = AUTOMATION_COMMAND_ERROR_WITH_MESSAGE(errorType); > callback(inViewCenterPoint, error); >@@ -1073,7 +1073,7 @@ void WebAutomationSession::selectOptionElement(const String& browsingContextHand > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- std::optional<uint64_t> frameID = webFrameIDForHandle(frameHandle); >+ Optional<uint64_t> frameID = webFrameIDForHandle(frameHandle); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > >@@ -1447,7 +1447,7 @@ SimulatedInputSource* WebAutomationSession::inputSourceForType(SimulatedInputSou > } > > // SimulatedInputDispatcher::Client API >-void WebAutomationSession::viewportInViewCenterPointOfElement(WebPageProxy& page, uint64_t frameID, const String& nodeHandle, Function<void (std::optional<WebCore::IntPoint>, std::optional<AutomationCommandError>)>&& completionHandler) >+void WebAutomationSession::viewportInViewCenterPointOfElement(WebPageProxy& page, uint64_t frameID, const String& nodeHandle, Function<void (Optional<WebCore::IntPoint>, Optional<AutomationCommandError>)>&& completionHandler) > { > // Start at 3 and use only odd numbers to not conflict with m_nextComputeElementLayoutCallbackID. > uint64_t callbackID = m_nextViewportInViewCenterPointOfElementCallbackID += 2; >@@ -1456,7 +1456,7 @@ void WebAutomationSession::viewportInViewCenterPointOfElement(WebPageProxy& page > page.process().send(Messages::WebAutomationSessionProxy::ComputeElementLayout(page.pageID(), frameID, nodeHandle, false, CoordinateSystem::LayoutViewport, callbackID), 0); > } > >-void WebAutomationSession::simulateMouseInteraction(WebPageProxy& page, MouseInteraction interaction, WebMouseEvent::Button mouseButton, const WebCore::IntPoint& locationInViewport, CompletionHandler<void(std::optional<AutomationCommandError>)>&& completionHandler) >+void WebAutomationSession::simulateMouseInteraction(WebPageProxy& page, MouseInteraction interaction, WebMouseEvent::Button mouseButton, const WebCore::IntPoint& locationInViewport, CompletionHandler<void(Optional<AutomationCommandError>)>&& completionHandler) > { > WebCore::IntPoint locationInView = WebCore::IntPoint(locationInViewport.x(), locationInViewport.y() + page.topContentInset()); > page.getWindowFrameWithCallback([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler), page = makeRef(page), interaction, mouseButton, locationInView](WebCore::FloatRect windowFrame) mutable { >@@ -1468,7 +1468,7 @@ void WebAutomationSession::simulateMouseInteraction(WebPageProxy& page, MouseInt > } > > // Bridge the flushed callback to our command's completion handler. >- auto mouseEventsFlushedCallback = [completionHandler = WTFMove(completionHandler)](std::optional<AutomationCommandError> error) mutable { >+ auto mouseEventsFlushedCallback = [completionHandler = WTFMove(completionHandler)](Optional<AutomationCommandError> error) mutable { > completionHandler(error); > }; > >@@ -1482,17 +1482,17 @@ void WebAutomationSession::simulateMouseInteraction(WebPageProxy& page, MouseInt > // If the event does not hit test anything in the window, then it may not have been delivered. > if (callbackInMap && !page->isProcessingMouseEvents()) { > auto callbackToCancel = m_pendingMouseEventsFlushedCallbacksPerPage.take(page->pageID()); >- callbackToCancel(std::nullopt); >+ callbackToCancel(WTF::nullopt); > } > > // Otherwise, wait for mouseEventsFlushedCallback to run when all events are handled. > }); > } > >-void WebAutomationSession::simulateKeyboardInteraction(WebPageProxy& page, KeyboardInteraction interaction, WTF::Variant<VirtualKey, CharKey>&& key, CompletionHandler<void(std::optional<AutomationCommandError>)>&& completionHandler) >+void WebAutomationSession::simulateKeyboardInteraction(WebPageProxy& page, KeyboardInteraction interaction, WTF::Variant<VirtualKey, CharKey>&& key, CompletionHandler<void(Optional<AutomationCommandError>)>&& completionHandler) > { > // Bridge the flushed callback to our command's completion handler. >- auto keyboardEventsFlushedCallback = [completionHandler = WTFMove(completionHandler)](std::optional<AutomationCommandError> error) mutable { >+ auto keyboardEventsFlushedCallback = [completionHandler = WTFMove(completionHandler)](Optional<AutomationCommandError> error) mutable { > completionHandler(error); > }; > >@@ -1507,7 +1507,7 @@ void WebAutomationSession::simulateKeyboardInteraction(WebPageProxy& page, Keybo > // This happens in some corner cases on macOS, such as releasing a key while Command is pressed. > if (callbackInMap && !page.isProcessingKeyboardEvents()) { > auto callbackToCancel = m_pendingKeyboardEventsFlushedCallbacksPerPage.take(page.pageID()); >- callbackToCancel(std::nullopt); >+ callbackToCancel(WTF::nullopt); > } > > // Otherwise, wait for keyboardEventsFlushedCallback to run when all events are handled. >@@ -1594,7 +1594,7 @@ void WebAutomationSession::performMouseInteraction(const String& handle, const J > if (!parsedButton) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "The parameter 'button' is invalid."); > >- auto mouseEventsFlushedCallback = [protectedThis = WTFMove(protectedThis), callback = WTFMove(callback), page = page.copyRef(), x, y](std::optional<AutomationCommandError> error) { >+ auto mouseEventsFlushedCallback = [protectedThis = WTFMove(protectedThis), callback = WTFMove(callback), page = page.copyRef(), x, y](Optional<AutomationCommandError> error) { > if (error) > callback->sendFailure(error.value().toProtocolString()); > else { >@@ -1617,7 +1617,7 @@ void WebAutomationSession::performMouseInteraction(const String& handle, const J > // In W3C-only code paths, we can reject any pointer actions whose coordinates are outside the viewport rect. > if (callbackInMap && !page->isProcessingMouseEvents()) { > auto callbackToCancel = m_pendingMouseEventsFlushedCallbacksPerPage.take(page->pageID()); >- callbackToCancel(std::nullopt); >+ callbackToCancel(WTF::nullopt); > } > }); > #endif // USE(APPKIT) || PLATFORM(GTK) || PLATFORM(WPE) >@@ -1654,7 +1654,7 @@ void WebAutomationSession::performKeyboardInteractions(const String& handle, con > String virtualKeyString; > bool foundVirtualKey = interactionObject->getString("key"_s, virtualKeyString); > if (foundVirtualKey) { >- std::optional<VirtualKey> virtualKey = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::VirtualKey>(virtualKeyString); >+ Optional<VirtualKey> virtualKey = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::VirtualKey>(virtualKeyString); > if (!virtualKey) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "An interaction in the 'interactions' parameter has an invalid 'key' value."); > >@@ -1688,7 +1688,7 @@ void WebAutomationSession::performKeyboardInteractions(const String& handle, con > if (!actionsToPerform.size()) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InternalError, "No actions to perform."); > >- auto keyboardEventsFlushedCallback = [protectedThis = makeRef(*this), callback = WTFMove(callback), page = makeRef(*page)](std::optional<AutomationCommandError> error) { >+ auto keyboardEventsFlushedCallback = [protectedThis = makeRef(*this), callback = WTFMove(callback), page = makeRef(*page)](Optional<AutomationCommandError> error) { > if (error) > callback->sendFailure(error.value().toProtocolString()); > else >@@ -1821,7 +1821,7 @@ void WebAutomationSession::performInteractionSequence(const String& handle, cons > if (!(*it)->asString(pressedVirtualKeyString)) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "Encountered a non-string virtual key value."); > >- std::optional<VirtualKey> parsedVirtualKey = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::VirtualKey>(pressedVirtualKeyString); >+ Optional<VirtualKey> parsedVirtualKey = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::VirtualKey>(pressedVirtualKeyString); > if (!parsedVirtualKey) > ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(InvalidParameter, "Encountered an unknown virtual key value."); > else >@@ -1872,7 +1872,7 @@ void WebAutomationSession::performInteractionSequence(const String& handle, cons > } > > // Delegate the rest of §17.4 Dispatching Actions to the dispatcher. >- inputDispatcher.run(frameID.value(), WTFMove(keyFrames), m_inputSources, [protectedThis = makeRef(*this), callback = WTFMove(callback)](std::optional<AutomationCommandError> error) { >+ inputDispatcher.run(frameID.value(), WTFMove(keyFrames), m_inputSources, [protectedThis = makeRef(*this), callback = WTFMove(callback)](Optional<AutomationCommandError> error) { > if (error) > callback->sendFailure(error.value().toProtocolString()); > else >@@ -1900,7 +1900,7 @@ void WebAutomationSession::cancelInteractionSequence(const String& handle, const > SimulatedInputDispatcher& inputDispatcher = inputDispatcherForPage(*page); > inputDispatcher.cancel(); > >- inputDispatcher.run(frameID.value(), WTFMove(keyFrames), m_inputSources, [protectedThis = makeRef(*this), callback = WTFMove(callback)](std::optional<AutomationCommandError> error) { >+ inputDispatcher.run(frameID.value(), WTFMove(keyFrames), m_inputSources, [protectedThis = makeRef(*this), callback = WTFMove(callback)](Optional<AutomationCommandError> error) { > if (error) > callback->sendFailure(error.value().toProtocolString()); > else >@@ -1915,7 +1915,7 @@ void WebAutomationSession::takeScreenshot(const String& handle, const String* op > if (!page) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(WindowNotFound); > >- std::optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); >+ Optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString()); > if (!frameID) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(FrameNotFound); > >@@ -1940,7 +1940,7 @@ void WebAutomationSession::didTakeScreenshot(uint64_t callbackID, const Shareabl > return; > } > >- std::optional<String> base64EncodedData = platformGetBase64EncodedPNGData(imageDataHandle); >+ Optional<String> base64EncodedData = platformGetBase64EncodedPNGData(imageDataHandle); > if (!base64EncodedData) > ASYNC_FAIL_WITH_PREDEFINED_ERROR(InternalError); > >@@ -1964,9 +1964,9 @@ void WebAutomationSession::platformSimulateKeyboardInteraction(WebPageProxy&, Ke > #endif // !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE) > > #if !PLATFORM(COCOA) && !USE(CAIRO) >-std::optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle&) >+Optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle&) > { >- return std::nullopt; >+ return WTF::nullopt; > } > #endif // !PLATFORM(COCOA) && !USE(CAIRO) > >diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h >index c70004576c9e6a919bbc234aa689661239e7fbc3..0cfc12ce77723685881c80cfc19925810fbdd50a 100644 >--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h >+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h >@@ -80,7 +80,7 @@ class WebProcessPool; > class AutomationCommandError { > public: > Inspector::Protocol::Automation::ErrorMessage type; >- std::optional<String> message { std::nullopt }; >+ Optional<String> message { WTF::nullopt }; > > AutomationCommandError(Inspector::Protocol::Automation::ErrorMessage type) > : type(type) { } >@@ -92,7 +92,7 @@ public: > String toProtocolString(); > }; > >-using AutomationCompletionHandler = WTF::CompletionHandler<void(std::optional<AutomationCommandError>)>; >+using AutomationCompletionHandler = WTF::CompletionHandler<void(Optional<AutomationCommandError>)>; > > class WebAutomationSession final : public API::ObjectImpl<API::Object::Type::AutomationSession>, public IPC::MessageReceiver > #if ENABLE(REMOTE_INSPECTOR) >@@ -138,7 +138,7 @@ public: > // SimulatedInputDispatcher::Client API > void simulateMouseInteraction(WebPageProxy&, MouseInteraction, WebMouseEvent::Button, const WebCore::IntPoint& locationInView, AutomationCompletionHandler&&) final; > void simulateKeyboardInteraction(WebPageProxy&, KeyboardInteraction, WTF::Variant<VirtualKey, CharKey>&&, AutomationCompletionHandler&&) final; >- void viewportInViewCenterPointOfElement(WebPageProxy&, uint64_t frameID, const String& nodeHandle, Function<void (std::optional<WebCore::IntPoint>, std::optional<AutomationCommandError>)>&&) final; >+ void viewportInViewCenterPointOfElement(WebPageProxy&, uint64_t frameID, const String& nodeHandle, Function<void (Optional<WebCore::IntPoint>, Optional<AutomationCommandError>)>&&) final; > > // Inspector::AutomationBackendDispatcherHandler API > // NOTE: the set of declarations included in this interface depend on the "platform" property in Automation.json >@@ -202,7 +202,7 @@ private: > Ref<Inspector::Protocol::Automation::BrowsingContext> buildBrowsingContextForPage(WebPageProxy&, WebCore::FloatRect windowFrame); > void getNextContext(Ref<WebAutomationSession>&&, Vector<Ref<WebPageProxy>>&&, Ref<JSON::ArrayOf<Inspector::Protocol::Automation::BrowsingContext>>, Ref<WebAutomationSession::GetBrowsingContextsCallback>&&); > >- std::optional<uint64_t> webFrameIDForHandle(const String&); >+ Optional<uint64_t> webFrameIDForHandle(const String&); > String handleForWebFrameID(uint64_t frameID); > String handleForWebFrameProxy(const WebFrameProxy&); > >@@ -224,7 +224,7 @@ private: > void didEvaluateJavaScriptFunction(uint64_t callbackID, const String& result, const String& errorType); > void didResolveChildFrame(uint64_t callbackID, uint64_t frameID, const String& errorType); > void didResolveParentFrame(uint64_t callbackID, uint64_t frameID, const String& errorType); >- void didComputeElementLayout(uint64_t callbackID, WebCore::IntRect, std::optional<WebCore::IntPoint>, bool isObscured, const String& errorType); >+ void didComputeElementLayout(uint64_t callbackID, WebCore::IntRect, Optional<WebCore::IntPoint>, bool isObscured, const String& errorType); > void didSelectOptionElement(uint64_t callbackID, const String& errorType); > void didTakeScreenshot(uint64_t callbackID, const ShareableBitmap::Handle&, const String& errorType); > void didGetCookiesForFrame(uint64_t callbackID, Vector<WebCore::Cookie>, const String& errorType); >@@ -237,14 +237,14 @@ private: > // Simulates key presses to produce the codepoints in a string. One or more code points are delivered atomically at grapheme cluster boundaries. > void platformSimulateKeySequence(WebPageProxy&, const String&); > // Get base64 encoded PNG data from a bitmap. >- std::optional<String> platformGetBase64EncodedPNGData(const ShareableBitmap::Handle&); >+ Optional<String> platformGetBase64EncodedPNGData(const ShareableBitmap::Handle&); > > #if PLATFORM(COCOA) > // The type parameter of the NSArray argument is platform-dependent. > void sendSynthesizedEventsToPage(WebPageProxy&, NSArray *eventsToSend); > >- std::optional<unichar> charCodeForVirtualKey(Inspector::Protocol::Automation::VirtualKey) const; >- std::optional<unichar> charCodeIgnoringModifiersForVirtualKey(Inspector::Protocol::Automation::VirtualKey) const; >+ Optional<unichar> charCodeForVirtualKey(Inspector::Protocol::Automation::VirtualKey) const; >+ Optional<unichar> charCodeIgnoringModifiersForVirtualKey(Inspector::Protocol::Automation::VirtualKey) const; > #endif > > WebProcessPool* m_processPool { nullptr }; >@@ -267,8 +267,8 @@ private: > HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingNormalNavigationInBrowsingContextCallbacksPerFrame; > HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingEagerNavigationInBrowsingContextCallbacksPerFrame; > HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>> m_pendingInspectorCallbacksPerPage; >- HashMap<uint64_t, Function<void(std::optional<AutomationCommandError>)>> m_pendingKeyboardEventsFlushedCallbacksPerPage; >- HashMap<uint64_t, Function<void(std::optional<AutomationCommandError>)>> m_pendingMouseEventsFlushedCallbacksPerPage; >+ HashMap<uint64_t, Function<void(Optional<AutomationCommandError>)>> m_pendingKeyboardEventsFlushedCallbacksPerPage; >+ HashMap<uint64_t, Function<void(Optional<AutomationCommandError>)>> m_pendingMouseEventsFlushedCallbacksPerPage; > > uint64_t m_nextEvaluateJavaScriptCallbackID { 1 }; > HashMap<uint64_t, RefPtr<Inspector::AutomationBackendDispatcherHandler::EvaluateJavaScriptFunctionCallback>> m_evaluateJavaScriptFunctionCallbacks; >@@ -285,7 +285,7 @@ private: > > // Start at 3 and use only odd numbers to not conflict with m_nextComputeElementLayoutCallbackID. > uint64_t m_nextViewportInViewCenterPointOfElementCallbackID { 3 }; >- HashMap<uint64_t, Function<void(std::optional<WebCore::IntPoint>, std::optional<AutomationCommandError>)>> m_viewportInViewCenterPointOfElementCallbacks; >+ HashMap<uint64_t, Function<void(Optional<WebCore::IntPoint>, Optional<AutomationCommandError>)>> m_viewportInViewCenterPointOfElementCallbacks; > > uint64_t m_nextScreenshotCallbackID { 1 }; > HashMap<uint64_t, RefPtr<Inspector::AutomationBackendDispatcherHandler::TakeScreenshotCallback>> m_screenshotCallbacks; >diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.messages.in b/Source/WebKit/UIProcess/Automation/WebAutomationSession.messages.in >index bc473b6e01e16115485be838725f1560dfbef7ef..e989baaf20858b4155e66516701264f31ba24a64 100644 >--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.messages.in >+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.messages.in >@@ -26,7 +26,7 @@ messages -> WebAutomationSession { > DidResolveChildFrame(uint64_t callbackID, uint64_t frameID, String errorType) > DidResolveParentFrame(uint64_t callbackID, uint64_t frameID, String errorType) > >- DidComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, std::optional<WebCore::IntPoint> inViewCenterPoint, bool isObscured, String errorType) >+ DidComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, Optional<WebCore::IntPoint> inViewCenterPoint, bool isObscured, String errorType) > > DidSelectOptionElement(uint64_t callbackID, String errorType) > >diff --git a/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp b/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp >index f15ba68d1dfdca0056cc6cddf27cf6d72d1161d1..828bfb225a7fe78083216b0261fd8f11bb23b0b2 100644 >--- a/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp >+++ b/Source/WebKit/UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp >@@ -33,15 +33,15 @@ > namespace WebKit { > using namespace WebCore; > >-std::optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle& handle) >+Optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle& handle) > { > RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(handle, SharedMemory::Protection::ReadOnly); > if (!bitmap) >- return std::nullopt; >+ return WTF::nullopt; > > auto surface = bitmap->createCairoSurface(); > if (!surface) >- return std::nullopt; >+ return WTF::nullopt; > > Vector<unsigned char> pngData; > cairo_surface_write_to_png_stream(surface.get(), [](void* userData, const unsigned char* data, unsigned length) -> cairo_status_t { >@@ -51,7 +51,7 @@ std::optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(cons > }, &pngData); > > if (pngData.isEmpty()) >- return std::nullopt; >+ return WTF::nullopt; > > return base64Encode(pngData); > } >diff --git a/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm b/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm >index 67f1222a746c672c687d2afbd278c1db53898bcb..37b0cb7a83043df031316c6483c20933b30766bd 100644 >--- a/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm >+++ b/Source/WebKit/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm >@@ -37,17 +37,17 @@ > namespace WebKit { > using namespace WebCore; > >-std::optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle& imageDataHandle) >+Optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(const ShareableBitmap::Handle& imageDataHandle) > { > RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(imageDataHandle, SharedMemory::Protection::ReadOnly); > if (!bitmap) >- return std::nullopt; >+ return WTF::nullopt; > > RetainPtr<CGImageRef> cgImage = bitmap->makeCGImage(); > RetainPtr<NSMutableData> imageData = adoptNS([[NSMutableData alloc] init]); > RetainPtr<CGImageDestinationRef> destination = adoptCF(CGImageDestinationCreateWithData((CFMutableDataRef)imageData.get(), kUTTypePNG, 1, 0)); > if (!destination) >- return std::nullopt; >+ return WTF::nullopt; > > CGImageDestinationAddImage(destination.get(), cgImage.get(), 0); > CGImageDestinationFinalize(destination.get()); >@@ -55,7 +55,7 @@ std::optional<String> WebAutomationSession::platformGetBase64EncodedPNGData(cons > return String([imageData base64EncodedStringWithOptions:0]); > } > >-std::optional<unichar> WebAutomationSession::charCodeForVirtualKey(Inspector::Protocol::Automation::VirtualKey key) const >+Optional<unichar> WebAutomationSession::charCodeForVirtualKey(Inspector::Protocol::Automation::VirtualKey key) const > { > switch (key) { > case Inspector::Protocol::Automation::VirtualKey::Shift: >@@ -63,7 +63,7 @@ std::optional<unichar> WebAutomationSession::charCodeForVirtualKey(Inspector::Pr > case Inspector::Protocol::Automation::VirtualKey::Alternate: > case Inspector::Protocol::Automation::VirtualKey::Meta: > case Inspector::Protocol::Automation::VirtualKey::Command: >- return std::nullopt; >+ return WTF::nullopt; > case Inspector::Protocol::Automation::VirtualKey::Help: > return NSHelpFunctionKey; > case Inspector::Protocol::Automation::VirtualKey::Backspace: >@@ -167,11 +167,11 @@ std::optional<unichar> WebAutomationSession::charCodeForVirtualKey(Inspector::Pr > case Inspector::Protocol::Automation::VirtualKey::Function12: > return NSF12FunctionKey; > default: >- return std::nullopt; >+ return WTF::nullopt; > } > } > >-std::optional<unichar> WebAutomationSession::charCodeIgnoringModifiersForVirtualKey(Inspector::Protocol::Automation::VirtualKey key) const >+Optional<unichar> WebAutomationSession::charCodeIgnoringModifiersForVirtualKey(Inspector::Protocol::Automation::VirtualKey key) const > { > switch (key) { > case Inspector::Protocol::Automation::VirtualKey::NumberPadMultiply: >diff --git a/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm b/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm >index ad00c1f74531db5d8035c20750436294d933ec8a..c87f5674346f5abe2e6a850ddb27a7f4a34c4770 100644 >--- a/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm >+++ b/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm >@@ -72,8 +72,8 @@ void WebAutomationSession::platformSimulateKeyboardInteraction(WebPageProxy& pag > // UIKit does not send key codes for virtual keys even for a hardware keyboard. > // Instead, it sends single unichars and WebCore maps these to "windows" key codes. > // Synthesize a single unichar such that the correct key code is inferred. >- std::optional<unichar> charCode; >- std::optional<unichar> charCodeIgnoringModifiers; >+ Optional<unichar> charCode; >+ Optional<unichar> charCodeIgnoringModifiers; > > // Figure out the effects of sticky modifiers. > WTF::switchOn(key, >diff --git a/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm b/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm >index daeaa4fdac42f7e6d3454671b35422d9b30e39f4..1937518dbf32b7b28e10686e28d583d6c3a97863 100644 >--- a/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm >+++ b/Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm >@@ -574,8 +574,8 @@ void WebAutomationSession::platformSimulateKeyboardInteraction(WebPageProxy& pag > bool isStickyModifier = false; > NSEventModifierFlags changedModifiers = 0; > int keyCode = 0; >- std::optional<unichar> charCode; >- std::optional<unichar> charCodeIgnoringModifiers; >+ Optional<unichar> charCode; >+ Optional<unichar> charCodeIgnoringModifiers; > > WTF::switchOn(key, > [&] (VirtualKey virtualKey) { >diff --git a/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h b/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h >index 32e95d8b5f2d1e4f03541279b6bc4c8053c294d1..db88499429c44593591d9a5624247b7a4fddafbe 100644 >--- a/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h >+++ b/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.h >@@ -56,7 +56,7 @@ private: > void acceptCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy&) override; > String messageOfCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy&) override; > void setUserInputForCurrentJavaScriptPromptOnPage(WebAutomationSession&, WebPageProxy&, const String&) override; >- std::optional<API::AutomationSessionClient::JavaScriptDialogType> typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy&) override; >+ Optional<API::AutomationSessionClient::JavaScriptDialogType> typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession&, WebPageProxy&) override; > > WeakObjCPtr<id <_WKAutomationSessionDelegate>> m_delegate; > >diff --git a/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm b/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm >index efb1e6be0296e0343e84c215ea0a0527626fb08a..38b6a17fe4d57079e49a03af51a98a9520dcef86 100644 >--- a/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm >+++ b/Source/WebKit/UIProcess/Cocoa/AutomationSessionClient.mm >@@ -201,11 +201,11 @@ void AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage(WebAu > [m_delegate.get() _automationSession:wrapper(session) setUserInput:value forCurrentJavaScriptDialogOnPage:toAPI(&page)]; > } > >-static std::optional<API::AutomationSessionClient::JavaScriptDialogType> toImpl(_WKAutomationSessionJavaScriptDialogType type) >+static Optional<API::AutomationSessionClient::JavaScriptDialogType> toImpl(_WKAutomationSessionJavaScriptDialogType type) > { > switch (type) { > case _WKAutomationSessionJavaScriptDialogTypeNone: >- return std::nullopt; >+ return WTF::nullopt; > case _WKAutomationSessionJavaScriptDialogTypePrompt: > return API::AutomationSessionClient::JavaScriptDialogType::Prompt; > case _WKAutomationSessionJavaScriptDialogTypeConfirm: >@@ -215,7 +215,7 @@ static std::optional<API::AutomationSessionClient::JavaScriptDialogType> toImpl( > } > } > >-std::optional<API::AutomationSessionClient::JavaScriptDialogType> AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession& session, WebPageProxy& page) >+Optional<API::AutomationSessionClient::JavaScriptDialogType> AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage(WebAutomationSession& session, WebPageProxy& page) > { > if (m_delegateMethods.typeOfCurrentJavaScriptDialogForWebView) > return toImpl([m_delegate.get() _automationSession:wrapper(session) typeOfCurrentJavaScriptDialogForWebView:fromWebPageProxy(page)]); >diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >index ce84a8884789735d1a132b1eb6ea6de2803a786d..f25c6323fb1e48a1c8e4e21f09da4a97b891fa88 100644 >--- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >+++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >@@ -234,7 +234,7 @@ void UIDelegate::UIClient::createNewPage(WebPageProxy& page, Ref<API::FrameInfo> > > auto userInitiatedActivity = page.process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); > bool shouldOpenAppLinks = !hostsAreEqual(sourceFrameInfo->request().url(), request.url()); >- auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, std::nullopt, WTFMove(request), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); >+ auto apiNavigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.ptr(), nullptr, WTF::nullopt, WTFMove(request), URL(), shouldOpenAppLinks, WTFMove(userInitiatedActivity)); > > auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); > >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >index 01a19fd358a8c45e5c0d94b73b3ed42a88c727e3..d91134854d4759ffea8fde256e6f938029e13855 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >@@ -277,8 +277,8 @@ public: > _WKRectEdge rubberBandingEnabled(); > void setRubberBandingEnabled(_WKRectEdge); > >- void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle); >- std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const; >+ void setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle); >+ Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const; > > void beginDeferringViewInWindowChanges(); > // FIXME: Merge these two? >@@ -779,7 +779,7 @@ private: > String m_promisedFilename; > String m_promisedURL; > >- std::optional<NSInteger> m_spellCheckerDocumentTag; >+ Optional<NSInteger> m_spellCheckerDocumentTag; > > CGFloat m_totalHeightOfBanners { 0 }; > >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index 153650840a0036b3360d4079448ee07059a313b2..2de5e54540ada2d7302288772652caf573138059 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -1868,7 +1868,7 @@ void WebViewImpl::updateViewExposedRect() > exposedRect = CGRectUnion(m_contentPreparationRect, exposedRect); > > if (auto drawingArea = m_page->drawingArea()) >- drawingArea->setViewExposedRect(m_clipsToVisibleRect ? std::optional<WebCore::FloatRect>(exposedRect) : std::nullopt); >+ drawingArea->setViewExposedRect(m_clipsToVisibleRect ? Optional<WebCore::FloatRect>(exposedRect) : WTF::nullopt); > } > > void WebViewImpl::setClipsToVisibleRect(bool clipsToVisibleRect) >@@ -2324,12 +2324,12 @@ NSColor *WebViewImpl::pageExtendedBackgroundColor() const > return WebCore::nsColor(color); > } > >-void WebViewImpl::setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle) >+void WebViewImpl::setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle) > { > m_page->setOverlayScrollbarStyle(scrollbarStyle); > } > >-std::optional<WebCore::ScrollbarOverlayStyle> WebViewImpl::overlayScrollbarStyle() const >+Optional<WebCore::ScrollbarOverlayStyle> WebViewImpl::overlayScrollbarStyle() const > { > return m_page->overlayScrollbarStyle(); > } >diff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.cpp b/Source/WebKit/UIProcess/DrawingAreaProxy.cpp >index 3efa1de9a92693d9077ad49aabd3ccdc0f9dff03..79568df167ec7c7c50afebdcd03113771ebe4181 100644 >--- a/Source/WebKit/UIProcess/DrawingAreaProxy.cpp >+++ b/Source/WebKit/UIProcess/DrawingAreaProxy.cpp >@@ -73,7 +73,7 @@ MachSendRight DrawingAreaProxy::createFence() > #endif > > #if PLATFORM(MAC) >-void DrawingAreaProxy::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect) >+void DrawingAreaProxy::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect) > { > if (!m_webPageProxy.isValid()) > return; >diff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.h b/Source/WebKit/UIProcess/DrawingAreaProxy.h >index a1a2daa82a4c1178de067dc2c60c0306cc122822..86fb13d97642b4f79d71d2b04294673c3a27e184 100644 >--- a/Source/WebKit/UIProcess/DrawingAreaProxy.h >+++ b/Source/WebKit/UIProcess/DrawingAreaProxy.h >@@ -77,8 +77,8 @@ public: > virtual void commitTransientZoom(double, WebCore::FloatPoint) { } > > #if PLATFORM(MAC) >- virtual void setViewExposedRect(std::optional<WebCore::FloatRect>); >- std::optional<WebCore::FloatRect> viewExposedRect() const { return m_viewExposedRect; } >+ virtual void setViewExposedRect(Optional<WebCore::FloatRect>); >+ Optional<WebCore::FloatRect> viewExposedRect() const { return m_viewExposedRect; } > void viewExposedRectChangedTimerFired(); > #endif > >@@ -136,8 +136,8 @@ private: > > #if PLATFORM(MAC) > RunLoop::Timer<DrawingAreaProxy> m_viewExposedRectChangedTimer; >- std::optional<WebCore::FloatRect> m_viewExposedRect; >- std::optional<WebCore::FloatRect> m_lastSentViewExposedRect; >+ Optional<WebCore::FloatRect> m_viewExposedRect; >+ Optional<WebCore::FloatRect> m_lastSentViewExposedRect; > #endif // PLATFORM(MAC) > #endif > }; >diff --git a/Source/WebKit/UIProcess/GenericCallback.h b/Source/WebKit/UIProcess/GenericCallback.h >index ef5f8ded1c64bf754f1b765fd314fc4411ff8b37..7f073061255c4060015ea065e54fd50231266fd0 100644 >--- a/Source/WebKit/UIProcess/GenericCallback.h >+++ b/Source/WebKit/UIProcess/GenericCallback.h >@@ -105,7 +105,7 @@ public: > if (!m_callback) > return; > >- auto callback = std::exchange(m_callback, std::nullopt); >+ auto callback = std::exchange(m_callback, WTF::nullopt); > callback.value()(returnValue..., Error::None); > } > >@@ -121,7 +121,7 @@ public: > if (!m_callback) > return; > >- auto callback = std::exchange(m_callback, std::nullopt); >+ auto callback = std::exchange(m_callback, WTF::nullopt); > callback.value()(typename std::remove_reference<T>::type()..., error); > } > >@@ -139,7 +139,7 @@ private: > return &tag; > } > >- std::optional<CallbackFunction> m_callback; >+ Optional<CallbackFunction> m_callback; > > #ifndef NDEBUG > Ref<Thread> m_originThread { Thread::current() }; >diff --git a/Source/WebKit/UIProcess/LegacySessionStateCodingNone.cpp b/Source/WebKit/UIProcess/LegacySessionStateCodingNone.cpp >index c22ec6e1b6aca7aa9b7a745169788eaba3013853..df9ec28e3040af6c10a5840d7a6d1ff4ca89bb9e 100644 >--- a/Source/WebKit/UIProcess/LegacySessionStateCodingNone.cpp >+++ b/Source/WebKit/UIProcess/LegacySessionStateCodingNone.cpp >@@ -48,7 +48,7 @@ RefPtr<API::Data> encodeLegacySessionState(const SessionState& sessionState) > bool decodeLegacySessionState(const uint8_t* data, size_t dataSize, SessionState& sessionState) > { > IPC::Decoder decoder(data, dataSize, nullptr, Vector<IPC::Attachment>()); >- std::optional<BackForwardListState> backForwardListState; >+ Optional<BackForwardListState> backForwardListState; > decoder >> backForwardListState; > if (!backForwardListState) > return false; >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >index 9d31b59e8881f732abc532ef4c6265f3c43df22e..4a791f35c30face474d459f1f22225f86d9595da 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >@@ -419,7 +419,7 @@ void NetworkProcessProxy::didUpdateBlockCookies(uint64_t callbackId) > m_updateBlockCookiesCallbackMap.take(callbackId)(); > } > >-void NetworkProcessProxy::setAgeCapForClientSideCookies(PAL::SessionID sessionID, std::optional<Seconds> seconds, CompletionHandler<void()>&& completionHandler) >+void NetworkProcessProxy::setAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds, CompletionHandler<void()>&& completionHandler) > { > if (!canSendMessage()) { > completionHandler(); >@@ -447,7 +447,7 @@ void NetworkProcessProxy::hasStorageAccessForFrame(PAL::SessionID sessionID, con > send(Messages::NetworkProcess::HasStorageAccessForFrame(sessionID, resourceDomain, firstPartyDomain, frameID, pageID, contextId), 0); > } > >-void NetworkProcessProxy::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, WTF::CompletionHandler<void(bool)>&& callback) >+void NetworkProcessProxy::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, WTF::CompletionHandler<void(bool)>&& callback) > { > auto contextId = generateCallbackID(); > auto addResult = m_storageAccessResponseCallbackMap.add(contextId, WTFMove(callback)); >@@ -719,7 +719,7 @@ void NetworkProcessProxy::getSandboxExtensionsForBlobFiles(const Vector<String>& > #if ENABLE(SERVICE_WORKER) > void NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess(SecurityOriginData&& origin) > { >- m_processPool.establishWorkerContextConnectionToNetworkProcess(*this, WTFMove(origin), std::nullopt); >+ m_processPool.establishWorkerContextConnectionToNetworkProcess(*this, WTFMove(origin), WTF::nullopt); > } > > void NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcessForExplicitSession(SecurityOriginData&& origin, PAL::SessionID sessionID) >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >index 7e492387e85e024393ba16e9425db39e66c87ade..4fe5ce7a456edb5b432c018f377b39243cfa547e 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >@@ -78,10 +78,10 @@ public: > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > void updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID, const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); >- void setAgeCapForClientSideCookies(PAL::SessionID, std::optional<Seconds>, CompletionHandler<void()>&&); >+ void setAgeCapForClientSideCookies(PAL::SessionID, Optional<Seconds>, CompletionHandler<void()>&&); > void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); > void getAllStorageAccessEntries(PAL::SessionID, CompletionHandler<void(Vector<String>&& domains)>&&); >- void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); >+ void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); > void removeAllStorageAccess(PAL::SessionID, CompletionHandler<void()>&&); > void setCacheMaxAgeCapForPrevalentResources(PAL::SessionID, Seconds, CompletionHandler<void()>&&); > void resetCacheMaxAgeCapForPrevalentResources(PAL::SessionID, CompletionHandler<void()>&&); >diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h >index c5179af75eedc2a1da87c7014b48301894d104e2..c1be5630897c38fad37a73548d36ffac811e3d65 100644 >--- a/Source/WebKit/UIProcess/PageClient.h >+++ b/Source/WebKit/UIProcess/PageClient.h >@@ -358,8 +358,8 @@ public: > virtual void layerTreeCommitComplete() = 0; > > virtual void couldNotRestorePageState() = 0; >- virtual void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) = 0; >- virtual void restorePageCenterAndScale(std::optional<WebCore::FloatPoint> center, double scale) = 0; >+ virtual void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) = 0; >+ virtual void restorePageCenterAndScale(Optional<WebCore::FloatPoint> center, double scale) = 0; > > virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) = 0; > virtual void stopAssistingNode() = 0; >@@ -448,7 +448,7 @@ public: > #if ENABLE(DATA_INTERACTION) > virtual void didHandleStartDataInteractionRequest(bool started) = 0; > virtual void didHandleAdditionalDragItemsRequest(bool added) = 0; >- virtual void didConcludeEditDataInteraction(std::optional<WebCore::TextIndicatorData>) = 0; >+ virtual void didConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData>) = 0; > virtual void didChangeDataInteractionCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) = 0; > #endif > >diff --git a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp >index 5132b83bfaaaa13f476a663651cd36200664aef9..6603b41045cb0ac2d400324c1393d71f45692a2d 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp >+++ b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp >@@ -229,10 +229,10 @@ bool PluginInfoStore::isSupportedPlugin(const String& mimeType, const URL& plugi > }) != notFound; > } > >-std::optional<Vector<SupportedPluginIdentifier>> PluginInfoStore::supportedPluginIdentifiers() >+Optional<Vector<SupportedPluginIdentifier>> PluginInfoStore::supportedPluginIdentifiers() > { > if (!m_supportedPlugins) >- return std::nullopt; >+ return WTF::nullopt; > > return WTF::map(*m_supportedPlugins, [] (auto&& item) { > return SupportedPluginIdentifier { item.matchingDomain, item.identifier }; >diff --git a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h >index 55597f344bf5139b9f5673c30f88c728157af99e..695d4782775500a62127ac846c8c6c21a0ee8671 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h >+++ b/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h >@@ -60,9 +60,9 @@ public: > static PluginModuleLoadPolicy defaultLoadPolicyForPlugin(const PluginModuleInfo&); > > bool isSupportedPlugin(const String& mimeType, const URL& pluginURL, const String& frameURLString, const URL& pageURL); >- std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers(); >+ Optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers(); > void addSupportedPlugin(String&& matchingDomain, String&& identifier, HashSet<String>&& mimeTypes, HashSet<String> extensions); >- void clearSupportedPlugins() { m_supportedPlugins = std::nullopt; } >+ void clearSupportedPlugins() { m_supportedPlugins = WTF::nullopt; } > > static bool shouldAllowPluginToRunUnsandboxed(const String& pluginBundleIdentifier); > >@@ -102,7 +102,7 @@ private: > }; > static bool isSupportedPlugin(const SupportedPlugin&, const String& mimeType, const URL& pluginURL); > >- std::optional<Vector<SupportedPlugin>> m_supportedPlugins; >+ Optional<Vector<SupportedPlugin>> m_supportedPlugins; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h >index d02a0eed0dad2134b427e4468c8591b269d57d07..32f28864fca10d58d3f2c0e11656daaa5eee9318 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h >@@ -70,7 +70,7 @@ private: > void dispatchAfterEnsuringDrawing(WTF::Function<void (CallbackBase::Error)>&&) override; > > #if PLATFORM(MAC) >- void setViewExposedRect(std::optional<WebCore::FloatRect>) override; >+ void setViewExposedRect(Optional<WebCore::FloatRect>) override; > #endif > > #if PLATFORM(IOS_FAMILY) >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm >index eb3e53af210269e417afae9c180004d223246802..35946bb3dc7c91e66c0cf7856732346008ba0678 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm >@@ -275,7 +275,7 @@ void RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd(uint64_t layerI > static const float indicatorInset = 10; > > #if PLATFORM(MAC) >-void RemoteLayerTreeDrawingAreaProxy::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect) >+void RemoteLayerTreeDrawingAreaProxy::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect) > { > DrawingAreaProxy::setViewExposedRect(viewExposedRect); > updateDebugIndicatorPosition(); >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >index ea73ca2f233e8f2131a4dab809179d81c138e84f..4117771a123852414fba5492c558ba65051757b6 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >@@ -164,7 +164,7 @@ void RemoteScrollingCoordinatorProxy::currentSnapPointIndicesDidChange(WebCore:: > } > > // This comes from the scrolling tree. >-void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) >+void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) > { > // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects() > // so don't send them here. >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h >index 2ffc17ed7f5f5c2f87391677179d843c805f85a6..4eddab69021e2d4e6d4752b2a9aac370fed972f6 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h >@@ -54,7 +54,7 @@ public: > bool visualViewportEnabled() const { return m_scrollingTree && m_scrollingTree->visualViewportEnabled(); } > > // Inform the web process that the scroll position changed (called from the scrolling tree) >- void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, const std::optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction); >+ void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, const Optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction); > void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll); > > WebCore::TrackingType eventTrackingTypeForPoint(const AtomicString& eventName, WebCore::IntPoint) const; >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >index ad91c920cb4e93f2f74d49ea447e3628b179637e..0ca7e4c659fb03b162c6e16d7b5a35730acb0906 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >@@ -99,7 +99,7 @@ void RemoteScrollingTree::scrollingTreeNodeDidEndScroll() > > #endif > >-void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) >+void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction) > { > m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition, layoutViewportOrigin, scrollingLayerPositionAction); > } >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h >index 45ecf0cc44b6682419e9e8aec953def64ff07b9f..969f560ae182e3e0d0ec95e18af8d3c9b4fa7631 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h >@@ -45,7 +45,7 @@ public: > > const RemoteScrollingCoordinatorProxy& scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; } > >- void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, const std::optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction = WebCore::ScrollingLayerPositionAction::Sync) override; >+ void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, const Optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction = WebCore::ScrollingLayerPositionAction::Sync) override; > void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll) override; > > void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) override; >diff --git a/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp b/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp >index 97512dda9cb16f9c0a99c0e771edec27ee3dde17..7e718320324cc6b9b6444a7c6f6b241d8bafd010 100644 >--- a/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp >+++ b/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp >@@ -448,7 +448,7 @@ void ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener(String&& > #if !RELEASE_LOG_DISABLED > RELEASE_LOG_INFO_IF(m_debugLoggingEnabled, ResourceLoadStatisticsDebug, "[Temporary combatibility fix] Storage access was granted for %{public}s under opener page from %{public}s, with user interaction in the opened window.", primaryDomainInNeedOfStorageAccess.utf8().data(), openerPrimaryDomain.utf8().data()); > #endif >- grantStorageAccessInternal(WTFMove(primaryDomainInNeedOfStorageAccess), WTFMove(openerPrimaryDomain), std::nullopt, openerPageID, false, [](bool) { }); >+ grantStorageAccessInternal(WTFMove(primaryDomainInNeedOfStorageAccess), WTFMove(openerPrimaryDomain), WTF::nullopt, openerPageID, false, [](bool) { }); > } > > void ResourceLoadStatisticsMemoryStore::grantStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, bool userWasPromptedNow, CompletionHandler<void(bool)>&& completionHandler) >@@ -465,7 +465,7 @@ void ResourceLoadStatisticsMemoryStore::grantStorageAccess(String&& subFrameHost > grantStorageAccessInternal(WTFMove(subFramePrimaryDomain), WTFMove(topFramePrimaryDomain), frameID, pageID, userWasPromptedNow, WTFMove(completionHandler)); > } > >-void ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal(String&& subFramePrimaryDomain, String&& topFramePrimaryDomain, std::optional<uint64_t> frameID, uint64_t pageID, bool userWasPromptedNowOrEarlier, CompletionHandler<void(bool)>&& callback) >+void ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal(String&& subFramePrimaryDomain, String&& topFramePrimaryDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPromptedNowOrEarlier, CompletionHandler<void(bool)>&& callback) > { > ASSERT(!RunLoop::isMain()); > >@@ -587,7 +587,7 @@ void ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest > { > ASSERT(!RunLoop::isMain()); > >- m_pendingStatisticsProcessingRequestIdentifier = std::nullopt; >+ m_pendingStatisticsProcessingRequestIdentifier = WTF::nullopt; > } > > void ResourceLoadStatisticsMemoryStore::logFrameNavigation(const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, const String& sourcePrimaryDomain, const String& targetHost, const String& mainFrameHost, bool isRedirect, bool isMainFrame) >diff --git a/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h b/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h >index 65b3f18f20af65a2202bc455886e00883e301f02..f3a9a7b96a00d85d0c1ea7b1caa61c72bd1db0c4 100644 >--- a/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h >+++ b/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h >@@ -144,7 +144,7 @@ private: > void setDebugLogggingEnabled(bool enabled) { m_debugLoggingEnabled = enabled; } > void setDataRecordsBeingRemoved(bool); > void scheduleStatisticsProcessingRequestIfNecessary(); >- void grantStorageAccessInternal(String&& subFrameHost, String&& topFrameHost, std::optional<uint64_t> frameID, uint64_t pageID, bool userWasPromptedNowOrEarlier, CompletionHandler<void(bool)>&&); >+ void grantStorageAccessInternal(String&& subFrameHost, String&& topFrameHost, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPromptedNowOrEarlier, CompletionHandler<void(bool)>&&); > void markAsPrevalentIfHasRedirectedToPrevalent(WebCore::ResourceLoadStatistics&); > bool isPrevalentDueToDebugMode(WebCore::ResourceLoadStatistics&); > Vector<String> ensurePrevalentResourcesForDebugMode(); >@@ -164,7 +164,7 @@ private: > struct Parameters { > size_t pruneEntriesDownTo { 800 }; > size_t maxStatisticsEntries { 1000 }; >- std::optional<Seconds> timeToLiveUserInteraction; >+ Optional<Seconds> timeToLiveUserInteraction; > Seconds minimumTimeBetweenDataRecordsRemoval { 1_h }; > Seconds grandfatheringTime { 24_h * 7 }; > Seconds cacheMaxAgeCapTime { 24_h * 7 }; >@@ -197,7 +197,7 @@ private: > MonotonicTime m_lastTimeDataRecordsWereRemoved; > > uint64_t m_lastStatisticsProcessingRequestIdentifier { 0 }; >- std::optional<uint64_t> m_pendingStatisticsProcessingRequestIdentifier; >+ Optional<uint64_t> m_pendingStatisticsProcessingRequestIdentifier; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp b/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp >index 9e8fe42a8aaf0a12cf1e58a978dc6b51cf4bfbb8..86206bac9dbacad641c092f8324fd6df02eb92df 100644 >--- a/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp >@@ -75,7 +75,7 @@ void ServiceWorkerProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& > launchOptions.extraInitializationData.add("security-origin"_s, securityOrigin().toString()); > } > >-void ServiceWorkerProcessProxy::start(const WebPreferencesStore& store, std::optional<PAL::SessionID> initialSessionID) >+void ServiceWorkerProcessProxy::start(const WebPreferencesStore& store, Optional<PAL::SessionID> initialSessionID) > { > send(Messages::WebProcess::EstablishWorkerContextConnectionToNetworkProcess { processPool().defaultPageGroup().pageGroupID(), m_serviceWorkerPageID, store, initialSessionID.value_or(PAL::SessionID::defaultSessionID()) }, 0); > } >diff --git a/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.h b/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.h >index cbdefdc38056b12dfc6b5f1c0ddd840c1ea6fe85..92d183a2c7b2badd138c3ef77efc4d26406b5af7 100644 >--- a/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.h >+++ b/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.h >@@ -43,7 +43,7 @@ public: > > void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, Ref<AuthenticationChallengeProxy>&&); > >- void start(const WebPreferencesStore&, std::optional<PAL::SessionID> initialSessionID); >+ void start(const WebPreferencesStore&, Optional<PAL::SessionID> initialSessionID); > void setUserAgent(const String&); > void updatePreferencesStore(const WebPreferencesStore&); > >diff --git a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp >index 6595f9c0af33c9bac38c16e6fa3b3dbeca745f86..74d0993a49ec054a2dee136d14e26ce7b10a2d77 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp >@@ -46,7 +46,7 @@ const size_t maxTransportNumber = 1; > const unsigned maxTimeOutValue = 120000; > > // FIXME(188624, 188625): Support NFC and BLE authenticators. >-static AuthenticatorManager::TransportSet collectTransports(const std::optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria>& authenticatorSelection) >+static AuthenticatorManager::TransportSet collectTransports(const Optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria>& authenticatorSelection) > { > AuthenticatorManager::TransportSet result; > if (!authenticatorSelection || !authenticatorSelection->authenticatorAttachment) { >@@ -218,7 +218,7 @@ void AuthenticatorManager::startDiscovery(const TransportSet& transports) > } > } > >-void AuthenticatorManager::initTimeOutTimer(const std::optional<unsigned>& timeOutInMs) >+void AuthenticatorManager::initTimeOutTimer(const Optional<unsigned>& timeOutInMs) > { > using namespace AuthenticatorManagerInternal; > >diff --git a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h >index 2437ed6171839dd872d80323781429ea539a4ed5..7fc4a1ebd901a6cc44f3f4068eb6b37cfe48541a 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h >@@ -76,7 +76,7 @@ private: > virtual void respondReceivedInternal(Respond&&); > > void startDiscovery(const TransportSet&); >- void initTimeOutTimer(const std::optional<unsigned>& timeOutInMs); >+ void initTimeOutTimer(const Optional<unsigned>& timeOutInMs); > void timeOutTimerFired(); > > // Request: We only allow one request per time. >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.cpp b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.cpp >index 4ef22e701c83424c0b739462f1b101dab3c6f12f..b7fc80862581a99f5196a712c57a4fc0ca19a2c3 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.cpp >@@ -174,7 +174,7 @@ void MockHidConnection::parseRequest() > } > > m_currentChannel = m_requestMessage->channelId(); >- m_requestMessage = std::nullopt; >+ m_requestMessage = WTF::nullopt; > if (m_configuration.hid->fastDataArrival) > feedReports(); > } >@@ -200,7 +200,7 @@ void MockHidConnection::feedReports() > return; > } > >- std::optional<FidoHidMessage> message; >+ Optional<FidoHidMessage> message; > if (m_stage == Mock::Stage::Info && m_subStage == Mock::SubStage::Msg) { > auto infoData = encodeAsCBOR(AuthenticatorGetInfoResponse({ ProtocolVersion::kCtap }, Vector<uint8_t>(kAaguidLength, 0u))); > infoData.insert(0, static_cast<uint8_t>(CtapDeviceResponseCode::kSuccess)); // Prepend status code. >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.h b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.h >index 316477e8804d2d3972773ad807c38d3de06a0ebf..e0bf86b2fd1e265bfc0276819e9ebcdcc1133948 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidConnection.h >@@ -59,7 +59,7 @@ private: > void continueFeedReports(); > > MockWebAuthenticationConfiguration m_configuration; >- std::optional<fido::FidoHidMessage> m_requestMessage; >+ Optional<fido::FidoHidMessage> m_requestMessage; > MockWebAuthenticationConfiguration::Hid::Stage m_stage { MockWebAuthenticationConfiguration::Hid::Stage::Info }; > MockWebAuthenticationConfiguration::Hid::SubStage m_subStage { MockWebAuthenticationConfiguration::Hid::SubStage::Init }; > uint32_t m_currentChannel { fido::kHidBroadcastChannel }; >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h >index 305efd871754dbf737a68610d8dec03d7f4b234d..78867a5fc666b97db9070294e4ef9bcd0d82237c 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h >@@ -71,8 +71,8 @@ struct MockWebAuthenticationConfiguration { > }; > > bool silentFailure { false }; >- std::optional<Local> local; >- std::optional<Hid> hid; >+ Optional<Local> local; >+ Optional<Hid> hid; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.cpp b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.cpp >index f2155890f5c24ee45d97fa026ae71b1b6027dd65..6f2862032bc5b64e309c74d76d98c20b256272a8 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.cpp >@@ -72,7 +72,7 @@ void CtapHidDriver::Worker::write(HidConnection::DataSent sent) > // FIXME(192061) > LOG_ERROR("Start writing data."); > if (sent != HidConnection::DataSent::Yes) { >- returnMessage(std::nullopt); >+ returnMessage(WTF::nullopt); > return; > } > >@@ -111,7 +111,7 @@ void CtapHidDriver::Worker::read(const Vector<uint8_t>& data) > } else { > if (!m_responseMessage->addContinuationPacket(data)) { > LOG_ERROR("Couldn't parse a hid continuation packet."); >- returnMessage(std::nullopt); >+ returnMessage(WTF::nullopt); > return; > } > } >@@ -128,7 +128,7 @@ void CtapHidDriver::Worker::read(const Vector<uint8_t>& data) > } > } > >-void CtapHidDriver::Worker::returnMessage(std::optional<fido::FidoHidMessage>&& message) >+void CtapHidDriver::Worker::returnMessage(Optional<fido::FidoHidMessage>&& message) > { > // FIXME(192061) > LOG_ERROR("Start returning data."); >@@ -158,7 +158,7 @@ void CtapHidDriver::transact(Vector<uint8_t>&& data, ResponseCallback&& callback > cryptographicallyRandomValues(m_nonce.data(), m_nonce.size()); > auto initCommand = FidoHidMessage::create(m_channelId, FidoHidDeviceCommand::kInit, m_nonce); > ASSERT(initCommand); >- m_worker->transact(WTFMove(*initCommand), [weakThis = makeWeakPtr(*this)](std::optional<FidoHidMessage>&& response) mutable { >+ m_worker->transact(WTFMove(*initCommand), [weakThis = makeWeakPtr(*this)](Optional<FidoHidMessage>&& response) mutable { > ASSERT(RunLoop::isMain()); > if (!weakThis) > return; >@@ -166,7 +166,7 @@ void CtapHidDriver::transact(Vector<uint8_t>&& data, ResponseCallback&& callback > }); > } > >-void CtapHidDriver::continueAfterChannelAllocated(std::optional<FidoHidMessage>&& message) >+void CtapHidDriver::continueAfterChannelAllocated(Optional<FidoHidMessage>&& message) > { > ASSERT(m_state == State::AllocateChannel); > if (!message) { >@@ -199,7 +199,7 @@ void CtapHidDriver::continueAfterChannelAllocated(std::optional<FidoHidMessage>& > LOG_ERROR("Start sending the request."); > auto cmd = FidoHidMessage::create(m_channelId, FidoHidDeviceCommand::kCbor, m_requestData); > ASSERT(cmd); >- m_worker->transact(WTFMove(*cmd), [weakThis = makeWeakPtr(*this)](std::optional<FidoHidMessage>&& response) mutable { >+ m_worker->transact(WTFMove(*cmd), [weakThis = makeWeakPtr(*this)](Optional<FidoHidMessage>&& response) mutable { > ASSERT(RunLoop::isMain()); > if (!weakThis) > return; >@@ -207,7 +207,7 @@ void CtapHidDriver::continueAfterChannelAllocated(std::optional<FidoHidMessage>& > }); > } > >-void CtapHidDriver::continueAfterResponseReceived(std::optional<fido::FidoHidMessage>&& message) >+void CtapHidDriver::continueAfterResponseReceived(Optional<fido::FidoHidMessage>&& message) > { > ASSERT(m_state == State::Ready); > ASSERT(!message || message->channelId() == m_channelId); >diff --git a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.h b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.h >index 4923a3c18f846d41d34d64da5ba9912e0e750778..de05026894fefe1e953e039d0cc88f346db5a426 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidDriver.h >@@ -67,7 +67,7 @@ private: > WTF_MAKE_FAST_ALLOCATED; > WTF_MAKE_NONCOPYABLE(Worker); > public: >- using MessageCallback = Function<void(std::optional<fido::FidoHidMessage>&&)>; >+ using MessageCallback = Function<void(Optional<fido::FidoHidMessage>&&)>; > > enum class State : uint8_t { > Idle, >@@ -83,17 +83,17 @@ private: > private: > void write(HidConnection::DataSent); > void read(const Vector<uint8_t>&); >- void returnMessage(std::optional<fido::FidoHidMessage>&&); >+ void returnMessage(Optional<fido::FidoHidMessage>&&); > > UniqueRef<HidConnection> m_connection; > State m_state { State::Idle }; >- std::optional<fido::FidoHidMessage> m_requestMessage; >- std::optional<fido::FidoHidMessage> m_responseMessage; >+ Optional<fido::FidoHidMessage> m_requestMessage; >+ Optional<fido::FidoHidMessage> m_responseMessage; > MessageCallback m_callback; > }; > >- void continueAfterChannelAllocated(std::optional<fido::FidoHidMessage>&&); >- void continueAfterResponseReceived(std::optional<fido::FidoHidMessage>&&); >+ void continueAfterChannelAllocated(Optional<fido::FidoHidMessage>&&); >+ void continueAfterResponseReceived(Optional<fido::FidoHidMessage>&&); > void returnResponse(Vector<uint8_t>&&); > > UniqueRef<Worker> m_worker; >diff --git a/Source/WebKit/UIProcess/WebBackForwardList.cpp b/Source/WebKit/UIProcess/WebBackForwardList.cpp >index 22ca4c3db4f6d031e6069783c1d78bcff6fe19dc..7ae26b2f3b832df30abf5cf2b24d1be6231a5407 100644 >--- a/Source/WebKit/UIProcess/WebBackForwardList.cpp >+++ b/Source/WebKit/UIProcess/WebBackForwardList.cpp >@@ -82,7 +82,7 @@ void WebBackForwardList::pageClosed() > > m_page = nullptr; > m_entries.clear(); >- m_currentIndex = std::nullopt; >+ m_currentIndex = WTF::nullopt; > } > > void WebBackForwardList::addItem(Ref<WebBackForwardListItem>&& newItem) >@@ -114,7 +114,7 @@ void WebBackForwardList::addItem(Ref<WebBackForwardListItem>&& newItem) > m_entries.remove(0); > > if (m_entries.isEmpty()) >- m_currentIndex = std::nullopt; >+ m_currentIndex = WTF::nullopt; > else > --*m_currentIndex; > } >@@ -340,7 +340,7 @@ void WebBackForwardList::removeAllItems() > } > > m_entries.clear(); >- m_currentIndex = std::nullopt; >+ m_currentIndex = WTF::nullopt; > m_page->didChangeBackForwardList(nullptr, WTFMove(removedItems)); > } > >@@ -368,7 +368,7 @@ void WebBackForwardList::clear() > } > > m_entries.clear(); >- m_currentIndex = std::nullopt; >+ m_currentIndex = WTF::nullopt; > m_page->didChangeBackForwardList(nullptr, WTFMove(removedItems)); > > return; >@@ -391,7 +391,7 @@ void WebBackForwardList::clear() > if (currentItem) > m_entries.append(currentItem.releaseNonNull()); > else >- m_currentIndex = std::nullopt; >+ m_currentIndex = WTF::nullopt; > m_page->didChangeBackForwardList(nullptr, WTFMove(removedItems)); > } > >@@ -418,7 +418,7 @@ BackForwardListState WebBackForwardList::backForwardListState(WTF::Function<bool > } > > if (backForwardListState.items.isEmpty()) >- backForwardListState.currentIndex = std::nullopt; >+ backForwardListState.currentIndex = WTF::nullopt; > else if (backForwardListState.items.size() <= backForwardListState.currentIndex.value()) > backForwardListState.currentIndex = backForwardListState.items.size() - 1; > >@@ -437,7 +437,7 @@ void WebBackForwardList::restoreFromState(BackForwardListState backForwardListSt > backForwardListItemState.identifier = { Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }; > items.uncheckedAppend(WebBackForwardListItem::create(WTFMove(backForwardListItemState), m_page->pageID())); > } >- m_currentIndex = backForwardListState.currentIndex ? std::optional<size_t>(*backForwardListState.currentIndex) : std::nullopt; >+ m_currentIndex = backForwardListState.currentIndex ? Optional<size_t>(*backForwardListState.currentIndex) : WTF::nullopt; > m_entries = WTFMove(items); > > LOG(BackForward, "(Back/Forward) WebBackForwardList %p restored from state (has %zu entries)", this, m_entries.size()); >diff --git a/Source/WebKit/UIProcess/WebBackForwardList.h b/Source/WebKit/UIProcess/WebBackForwardList.h >index e7d86d758f6d8d90c505b764366dc6f4c4c141f2..a6135698628a60b23bba8c86a56ec64b078cf253 100644 >--- a/Source/WebKit/UIProcess/WebBackForwardList.h >+++ b/Source/WebKit/UIProcess/WebBackForwardList.h >@@ -86,7 +86,7 @@ private: > > WebPageProxy* m_page; > BackForwardListItemVector m_entries; >- std::optional<size_t> m_currentIndex; >+ Optional<size_t> m_currentIndex; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >index 2ad99f6592d9b470021ad6e87191ed3aaa9c450f..e98a0fd4b52f444c7e187c638bbe697e10892b96 100644 >--- a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >+++ b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >@@ -60,8 +60,8 @@ public: > private: > WebFramePolicyListenerProxy(Reply&&, ShouldExpectSafeBrowsingResult); > >- std::optional<std::pair<RefPtr<API::WebsitePolicies>, ProcessSwapRequestedByClient>> m_policyResult; >- std::optional<RefPtr<SafeBrowsingWarning>> m_safeBrowsingWarning; >+ Optional<std::pair<RefPtr<API::WebsitePolicies>, ProcessSwapRequestedByClient>> m_policyResult; >+ Optional<RefPtr<SafeBrowsingWarning>> m_safeBrowsingWarning; > Reply m_reply; > }; > >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 50224ed1d166e5b9878df95bac909cac4fc2b27f..121c23362f268d83f6d07480a20b8fd40f7e9b11 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -741,7 +741,7 @@ void WebPageProxy::reattachToWebProcess() > finishAttachingToWebProcess(); > } > >-bool WebPageProxy::suspendCurrentPageIfPossible(API::Navigation& navigation, std::optional<uint64_t> mainFrameID, ProcessSwapRequestedByClient processSwapRequestedByClient) >+bool WebPageProxy::suspendCurrentPageIfPossible(API::Navigation& navigation, Optional<uint64_t> mainFrameID, ProcessSwapRequestedByClient processSwapRequestedByClient) > { > if (!mainFrameID) > return false; >@@ -859,7 +859,7 @@ RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessForReload() > auto navigation = m_navigationState->createReloadNavigation(); > > // We allow stale content when reloading a WebProcess that's been killed or crashed. >- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No, std::nullopt), m_pageID); >+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), m_backForwardList->currentItem()->itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No, WTF::nullopt), m_pageID); > m_process->responsivenessTimer().start(); > > return WTFMove(navigation); >@@ -878,7 +878,7 @@ RefPtr<API::Navigation> WebPageProxy::reattachToWebProcessWithItem(WebBackForwar > > auto navigation = m_navigationState->createBackForwardNavigation(item, m_backForwardList->currentItem(), FrameLoadType::IndexedBackForward); > >- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item.itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No, std::nullopt), m_pageID); >+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item.itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No, WTF::nullopt), m_pageID); > m_process->responsivenessTimer().start(); > > return WTFMove(navigation); >@@ -1049,7 +1049,7 @@ RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, Sho > return WTFMove(navigation); > } > >-void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& websitePolicies) >+void WebPageProxy::loadRequestWithNavigation(API::Navigation& navigation, ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies) > { > ASSERT(!m_isClosed); > >@@ -1134,7 +1134,7 @@ RefPtr<API::Navigation> WebPageProxy::loadData(const IPC::DataReference& data, c > return WTFMove(navigation); > } > >-void WebPageProxy::loadDataWithNavigation(API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& websitePolicies) >+void WebPageProxy::loadDataWithNavigation(API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies) > { > ASSERT(!m_isClosed); > >@@ -1332,7 +1332,7 @@ RefPtr<API::Navigation> WebPageProxy::goToBackForwardItem(WebBackForwardListItem > if (!m_backForwardList->currentItem()->itemIsInSameDocument(item)) > navigation = m_navigationState->createBackForwardNavigation(item, m_backForwardList->currentItem(), frameLoadType); > >- m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item.itemID(), frameLoadType, ShouldTreatAsContinuingLoad::No, std::nullopt), m_pageID); >+ m_process->send(Messages::WebPage::GoToBackForwardItem(navigation ? navigation->navigationID() : 0, item.itemID(), frameLoadType, ShouldTreatAsContinuingLoad::No, WTF::nullopt), m_pageID); > m_process->responsivenessTimer().start(); > > return navigation; >@@ -2595,7 +2595,7 @@ void WebPageProxy::centerSelectionInVisibleArea() > > class WebPageProxy::PolicyDecisionSender : public RefCounted<PolicyDecisionSender> { > public: >- using SendFunction = CompletionHandler<void(WebPolicyAction, uint64_t newNavigationID, DownloadID, std::optional<WebsitePoliciesData>)>; >+ using SendFunction = CompletionHandler<void(WebPolicyAction, uint64_t newNavigationID, DownloadID, Optional<WebsitePoliciesData>)>; > static Ref<PolicyDecisionSender> create(SendFunction&& sendFunction) > { > return adoptRef(*new PolicyDecisionSender(WTFMove(sendFunction))); >@@ -2615,7 +2615,7 @@ private: > > void WebPageProxy::receivedNavigationPolicyDecision(WebPolicyAction policyAction, API::Navigation* navigation, ProcessSwapRequestedByClient processSwapRequestedByClient, WebFrameProxy& frame, API::WebsitePolicies* policies, Ref<PolicyDecisionSender>&& sender) > { >- std::optional<WebsitePoliciesData> data; >+ Optional<WebsitePoliciesData> data; > if (policies) { > data = policies->data(); > if (policies->websiteDataStore()) >@@ -2642,17 +2642,17 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebPolicyAction policyAction > RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "%p - WebPageProxy::decidePolicyForNavigationAction, keep using process %i for navigation, reason: %{public}s", this, processIdentifier(), reason.utf8().data()); > > bool shouldProcessSwap = processForNavigation.ptr() != &process(); >- receivedPolicyDecision(policyAction, navigation.ptr(), shouldProcessSwap ? std::nullopt : WTFMove(data), WTFMove(sender)); >+ receivedPolicyDecision(policyAction, navigation.ptr(), shouldProcessSwap ? WTF::nullopt : WTFMove(data), WTFMove(sender)); > > if (shouldProcessSwap) > continueNavigationInNewProcess(navigation, destinationSuspendedPage ? process().processPool().takeSuspendedPage(*destinationSuspendedPage) : nullptr, WTFMove(processForNavigation), processSwapRequestedByClient, WTFMove(data)); > }); > } > >-void WebPageProxy::receivedPolicyDecision(WebPolicyAction action, API::Navigation* navigation, std::optional<WebsitePoliciesData>&& websitePolicies, Ref<PolicyDecisionSender>&& sender) >+void WebPageProxy::receivedPolicyDecision(WebPolicyAction action, API::Navigation* navigation, Optional<WebsitePoliciesData>&& websitePolicies, Ref<PolicyDecisionSender>&& sender) > { > if (!isValid()) { >- sender->send(WebPolicyAction::Ignore, 0, DownloadID(), std::nullopt); >+ sender->send(WebPolicyAction::Ignore, 0, DownloadID(), WTF::nullopt); > return; > } > >@@ -2681,12 +2681,12 @@ void WebPageProxy::receivedPolicyDecision(WebPolicyAction action, API::Navigatio > sender->send(action, navigation ? navigation->navigationID() : 0, downloadID, WTFMove(websitePolicies)); > } > >-void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, std::unique_ptr<SuspendedPageProxy>&& suspendedPageProxy, Ref<WebProcessProxy>&& process, ProcessSwapRequestedByClient processSwapRequestedByClient, std::optional<WebsitePoliciesData>&& websitePolicies) >+void WebPageProxy::continueNavigationInNewProcess(API::Navigation& navigation, std::unique_ptr<SuspendedPageProxy>&& suspendedPageProxy, Ref<WebProcessProxy>&& process, ProcessSwapRequestedByClient processSwapRequestedByClient, Optional<WebsitePoliciesData>&& websitePolicies) > { > LOG(Loading, "Continuing navigation %" PRIu64 " '%s' in a new web process", navigation.navigationID(), navigation.loggingString()); > > Ref<WebProcessProxy> previousProcess = m_process.copyRef(); >- std::optional<uint64_t> mainFrameIDInPreviousProcess = m_mainFrame ? std::make_optional(m_mainFrame->frameID()) : std::nullopt; >+ Optional<uint64_t> mainFrameIDInPreviousProcess = m_mainFrame ? makeOptional(m_mainFrame->frameID()) : WTF::nullopt; > auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : URL(); > > ASSERT(m_process.ptr() != process.ptr()); >@@ -3074,7 +3074,7 @@ void WebPageProxy::setCustomDeviceScaleFactor(float customScaleFactor) > if (customScaleFactor) > m_customDeviceScaleFactor = customScaleFactor; > else >- m_customDeviceScaleFactor = std::nullopt; >+ m_customDeviceScaleFactor = WTF::nullopt; > > if (deviceScaleFactor() != oldScaleFactor) > m_drawingArea->deviceScaleFactorDidChange(); >@@ -3889,7 +3889,7 @@ void WebPageProxy::clearLoadDependentCallbacks() > } > } > >-void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, std::optional<HasInsecureContent> hasInsecureContent, const UserData& userData) >+void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, Optional<HasInsecureContent> hasInsecureContent, const UserData& userData) > { > LOG(Loading, "(Loading) WebPageProxy %" PRIu64 " didCommitLoadForFrame in navigation %" PRIu64, m_pageID, m_navigationID); > LOG(BackForward, "(Back/Forward) After load commit, back/forward list is now:%s", m_backForwardList->loggingString()); >@@ -4315,7 +4315,7 @@ void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy& frame, WebCore > > #if ENABLE(CONTENT_FILTERING) > if (frame.didHandleContentFilterUnblockNavigation(request)) >- return receivedPolicyDecision(WebPolicyAction::Ignore, m_navigationState->navigation(newNavigationID), std::nullopt, WTFMove(sender)); >+ return receivedPolicyDecision(WebPolicyAction::Ignore, m_navigationState->navigation(newNavigationID), WTF::nullopt, WTFMove(sender)); > #else > UNUSED_PARAM(newNavigationID); > #endif >@@ -4379,7 +4379,7 @@ void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy& frame, WebCore > auto userInitiatedActivity = m_process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); > bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision && destinationFrameInfo->isMainFrame() && !hostsAreEqual(URL({ }, m_mainFrame->url()), request.url()) && navigationActionData.navigationType != WebCore::NavigationType::BackForward; > >- auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), std::nullopt, WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity), mainFrameNavigation); >+ auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), WTF::nullopt, WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity), mainFrameNavigation); > > m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navigationAction), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get()); > } >@@ -4406,7 +4406,7 @@ void WebPageProxy::decidePolicyForNavigationActionSync(uint64_t frameID, bool is > decidePolicyForNavigationAction(*frame, WTFMove(frameSecurityOrigin), navigationID, WTFMove(navigationActionData), WTFMove(frameInfoData), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(redirectResponse), userData, sender.copyRef()); > > // If the client did not respond synchronously, proceed with the load. >- sender->send(WebPolicyAction::Use, navigationID, DownloadID(), std::nullopt); >+ sender->send(WebPolicyAction::Use, navigationID, DownloadID(), WTF::nullopt); > } > > void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, NavigationActionData&& navigationActionData, ResourceRequest&& request, const String& frameName, uint64_t listenerID, const UserData& userData) >@@ -4421,7 +4421,7 @@ void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const Securi > // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away. > RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No); > ASSERT_UNUSED(safeBrowsingWarning, !safeBrowsingWarning); >- receivedPolicyDecision(policyAction, nullptr, std::nullopt, PolicyDecisionSender::create([this, protectedThis = WTFMove(protectedThis), frameID, listenerID] (auto... args) { >+ receivedPolicyDecision(policyAction, nullptr, WTF::nullopt, PolicyDecisionSender::create([this, protectedThis = WTFMove(protectedThis), frameID, listenerID] (auto... args) { > m_process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, args...), m_pageID); > })); > }, ShouldExpectSafeBrowsingResult::No)); >@@ -4459,7 +4459,7 @@ void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const SecurityOrigi > // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away. > RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No); > ASSERT_UNUSED(safeBrowsingWarning, !safeBrowsingWarning); >- receivedPolicyDecision(policyAction, navigation.get(), std::nullopt, PolicyDecisionSender::create([this, protectedThis = WTFMove(protectedThis), frameID, listenerID] (auto... args) { >+ receivedPolicyDecision(policyAction, navigation.get(), WTF::nullopt, PolicyDecisionSender::create([this, protectedThis = WTFMove(protectedThis), frameID, listenerID] (auto... args) { > m_process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, args...), m_pageID); > })); > }, ShouldExpectSafeBrowsingResult::No)); >@@ -5216,13 +5216,13 @@ void WebPageProxy::backForwardGoToItem(const BackForwardItemIdentifier& itemID, > m_backForwardList->goToItem(*item); > } > >-void WebPageProxy::backForwardItemAtIndex(int32_t index, std::optional<BackForwardItemIdentifier>& itemID) >+void WebPageProxy::backForwardItemAtIndex(int32_t index, Optional<BackForwardItemIdentifier>& itemID) > { > WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index); > if (item) > itemID = item->itemID(); > else >- itemID = std::nullopt; >+ itemID = WTF::nullopt; > } > > void WebPageProxy::backForwardBackListCount(uint32_t& count) >@@ -6030,7 +6030,7 @@ void WebPageProxy::editingRangeCallback(const EditingRange& range, CallbackID ca > } > > #if ENABLE(APPLICATION_MANIFEST) >-void WebPageProxy::applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>& manifestOrNull, CallbackID callbackID) >+void WebPageProxy::applicationManifestCallback(const Optional<WebCore::ApplicationManifest>& manifestOrNull, CallbackID callbackID) > { > auto callback = m_callbacks.take<ApplicationManifestCallback>(callbackID); > if (!callback) >@@ -6563,7 +6563,7 @@ WebPageCreationParameters WebPageProxy::creationParameters() > if (m_scrollbarOverlayStyle) > parameters.scrollbarOverlayStyle = m_scrollbarOverlayStyle.value(); > else >- parameters.scrollbarOverlayStyle = std::nullopt; >+ parameters.scrollbarOverlayStyle = WTF::nullopt; > parameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage; > parameters.layerHostingMode = m_layerHostingMode; > parameters.controlledByAutomation = m_controlledByAutomation; >@@ -6619,7 +6619,7 @@ WebPageCreationParameters WebPageProxy::creationParameters() > #endif > > #if ENABLE(APPLICATION_MANIFEST) >- parameters.applicationManifest = m_configuration->applicationManifest() ? std::optional<WebCore::ApplicationManifest>(m_configuration->applicationManifest()->applicationManifest()) : std::nullopt; >+ parameters.applicationManifest = m_configuration->applicationManifest() ? Optional<WebCore::ApplicationManifest>(m_configuration->applicationManifest()->applicationManifest()) : WTF::nullopt; > #endif > > parameters.needsFontAttributes = m_needsFontAttributes; >@@ -7258,7 +7258,7 @@ void WebPageProxy::setScrollPinningBehavior(ScrollPinningBehavior pinning) > m_process->send(Messages::WebPage::SetScrollPinningBehavior(pinning), m_pageID); > } > >-void WebPageProxy::setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle) >+void WebPageProxy::setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle) > { > if (!m_scrollbarOverlayStyle && !scrollbarStyle) > return; >@@ -7268,7 +7268,7 @@ void WebPageProxy::setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOver > > m_scrollbarOverlayStyle = scrollbarStyle; > >- std::optional<uint32_t> scrollbarStyleForMessage; >+ Optional<uint32_t> scrollbarStyleForMessage; > if (scrollbarStyle) > scrollbarStyleForMessage = static_cast<ScrollbarOverlayStyle>(scrollbarStyle.value()); > >@@ -8253,10 +8253,10 @@ void WebPageProxy::writeBlobToFilePath(const URL& url, const String& path, Funct > } > > #if ENABLE(APPLICATION_MANIFEST) >-void WebPageProxy::getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&& callbackFunction) >+void WebPageProxy::getApplicationManifest(Function<void(const Optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&& callbackFunction) > { > if (!isValid()) { >- callbackFunction(std::nullopt, CallbackBase::Error::Unknown); >+ callbackFunction(WTF::nullopt, CallbackBase::Error::Unknown); > return; > } > >@@ -8305,7 +8305,7 @@ void WebPageProxy::reportPageLoadResult(const ResourceError& error) > return; > > auto pageLoadTime = MonotonicTime::now() - *m_pageLoadStart; >- m_pageLoadStart = std::nullopt; >+ m_pageLoadStart = WTF::nullopt; > > CompletionCondition condition { CompletionCondition::Success }; > if (error.isCancellation()) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 9df6390f90fabc2172384d00ce67395bc490f5df..c781f70c1e5d7de7ea6f899fd71a8bc303fb3df2 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -299,7 +299,7 @@ typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback; > typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback; > > #if ENABLE(APPLICATION_MANIFEST) >-typedef GenericCallback<const std::optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback; >+typedef GenericCallback<const Optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback; > #endif > > #if PLATFORM(MAC) >@@ -568,7 +568,7 @@ public: > > void setBaseWritingDirection(WebCore::WritingDirection); > >- std::optional<WebCore::FontAttributes> cachedFontAttributesAtSelectionStart() const { return m_cachedFontAttributesAtSelectionStart; } >+ Optional<WebCore::FontAttributes> cachedFontAttributesAtSelectionStart() const { return m_cachedFontAttributesAtSelectionStart; } > > #if PLATFORM(COCOA) > const TouchBarMenuData& touchBarMenuData() const { return m_touchBarMenuData; } >@@ -612,7 +612,7 @@ public: > void setMaximumUnobscuredSize(const WebCore::FloatSize&); > void setDeviceOrientation(int32_t); > int32_t deviceOrientation() const { return m_deviceOrientation; } >- void setOverrideViewportArguments(const std::optional<WebCore::ViewportArguments>&); >+ void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&); > void willCommitLayerTree(uint64_t transactionID); > > void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&); >@@ -675,7 +675,7 @@ public: > void didHandleAdditionalDragItemsRequest(bool added); > void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition); > void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition); >- void didConcludeEditDataInteraction(std::optional<WebCore::TextIndicatorData>); >+ void didConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData>); > #endif > #endif > #if ENABLE(DATA_DETECTION) >@@ -962,7 +962,7 @@ public: > #endif > > class PolicyDecisionSender; >- void receivedPolicyDecision(WebPolicyAction, API::Navigation*, std::optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&); >+ void receivedPolicyDecision(WebPolicyAction, API::Navigation*, Optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&); > void receivedNavigationPolicyDecision(WebPolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&); > > void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&); >@@ -1107,7 +1107,7 @@ public: > #endif > > #if ENABLE(PDFKIT_PLUGIN) >- void showPDFContextMenu(const WebKit::PDFContextMenu&, std::optional<int32_t>& selectedIndex); >+ void showPDFContextMenu(const WebKit::PDFContextMenu&, Optional<int32_t>& selectedIndex); > #endif > WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; } > >@@ -1188,8 +1188,8 @@ public: > void setScrollPinningBehavior(WebCore::ScrollPinningBehavior); > WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; } > >- void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle>); >- std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; } >+ void setOverlayScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle>); >+ Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; } > > // When the state of the window changes such that the WebPage needs immediate update, the UIProcess sends a new > // ActivityStateChangeID to the WebProcess through the SetActivityState message. The UIProcess will wait till it >@@ -1383,7 +1383,7 @@ public: > #endif > > #if ENABLE(APPLICATION_MANIFEST) >- void getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&); >+ void getApplicationManifest(Function<void(const Optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&); > #endif > > void writeBlobToFilePath(const URL& blobURL, const String& path, Function<void(bool success)>&&); >@@ -1419,7 +1419,7 @@ private: > void updateThrottleState(); > void updateHiddenPageThrottlingAutoIncreases(); > >- bool suspendCurrentPageIfPossible(API::Navigation&, std::optional<uint64_t> mainFrameID, ProcessSwapRequestedByClient); >+ bool suspendCurrentPageIfPossible(API::Navigation&, Optional<uint64_t> mainFrameID, ProcessSwapRequestedByClient); > > enum class ResetStateReason { > PageInvalidated, >@@ -1464,7 +1464,7 @@ private: > void didCancelClientRedirectForFrame(uint64_t frameID); > void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, URL&&); > void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&); >- void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&); >+ void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&); > void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&); > void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&); > void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&); >@@ -1576,8 +1576,8 @@ private: > RefPtr<API::Navigation> reattachToWebProcessForReload(); > RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&); > >- void loadDataWithNavigation(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& = std::nullopt); >- void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& = std::nullopt); >+ void loadDataWithNavigation(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt); >+ void loadRequestWithNavigation(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt); > > void requestNotificationPermission(uint64_t notificationID, const String& originString); > void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, WebCore::NotificationDirection, const String& originString, uint64_t notificationID); >@@ -1609,7 +1609,7 @@ private: > // Back/Forward list management > void backForwardAddItem(BackForwardListItemState&&); > void backForwardGoToItem(const WebCore::BackForwardItemIdentifier&, SandboxExtension::Handle&); >- void backForwardItemAtIndex(int32_t index, std::optional<WebCore::BackForwardItemIdentifier>&); >+ void backForwardItemAtIndex(int32_t index, Optional<WebCore::BackForwardItemIdentifier>&); > void backForwardBackListCount(uint32_t& count); > void backForwardForwardListCount(uint32_t& count); > void backForwardClear(); >@@ -1701,7 +1701,7 @@ private: > void unsignedCallback(uint64_t, CallbackID); > void editingRangeCallback(const EditingRange&, CallbackID); > #if ENABLE(APPLICATION_MANIFEST) >- void applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>&, CallbackID); >+ void applicationManifestCallback(const Optional<WebCore::ApplicationManifest>&, CallbackID); > #endif > #if PLATFORM(COCOA) > void machSendRightCallback(const WTF::MachSendRight&, CallbackID); >@@ -1768,8 +1768,8 @@ private: > float textAutosizingWidth(); > > void couldNotRestorePageState(); >- void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale); >- void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double scale); >+ void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale); >+ void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double scale); > > void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius); > >@@ -1893,7 +1893,7 @@ private: > > void reportPageLoadResult(const WebCore::ResourceError& = { }); > >- void continueNavigationInNewProcess(API::Navigation&, std::unique_ptr<SuspendedPageProxy>&&, Ref<WebProcessProxy>&&, ProcessSwapRequestedByClient, std::optional<WebsitePoliciesData>&&); >+ void continueNavigationInNewProcess(API::Navigation&, std::unique_ptr<SuspendedPageProxy>&&, Ref<WebProcessProxy>&&, ProcessSwapRequestedByClient, Optional<WebsitePoliciesData>&&); > > void setNeedsFontAttributes(bool); > void updateFontAttributesAfterEditorStateChange(); >@@ -2022,7 +2022,7 @@ private: > ProcessThrottler::ForegroundActivityToken m_activityToken; > #endif > bool m_initialCapitalizationEnabled { false }; >- std::optional<double> m_cpuLimit; >+ Optional<double> m_cpuLimit; > Ref<WebBackForwardList> m_backForwardList; > > bool m_maintainsInactiveSelection { false }; >@@ -2046,7 +2046,7 @@ private: > double m_pluginScaleFactor { 1 }; > double m_viewScaleFactor { 1 }; > float m_intrinsicDeviceScaleFactor { 1 }; >- std::optional<float> m_customDeviceScaleFactor; >+ Optional<float> m_customDeviceScaleFactor; > float m_topContentInset { 0 }; > > LayerHostingMode m_layerHostingMode { LayerHostingMode::InProcess }; >@@ -2210,7 +2210,7 @@ private: > bool m_suppressVisibilityUpdates { false }; > bool m_autoSizingShouldExpandToViewHeight { false }; > WebCore::IntSize m_viewLayoutSize; >- std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits; >+ Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits; > > // Visual viewports > WebCore::LayoutSize m_baseLayoutViewportSize; >@@ -2240,7 +2240,7 @@ private: > VisibleWebPageToken m_visiblePageToken; > > WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin }; >- std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle; >+ Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle; > > uint64_t m_navigationID { 0 }; > ActivityStateChangeID m_currentActivityStateChangeID { ActivityStateChangeAsynchronous }; >@@ -2275,7 +2275,7 @@ private: > WebCore::FloatSize m_maximumUnobscuredSize; > #endif > >- std::optional<WebCore::FontAttributes> m_cachedFontAttributesAtSelectionStart; >+ Optional<WebCore::FontAttributes> m_cachedFontAttributesAtSelectionStart; > > #if ENABLE(POINTER_LOCK) > bool m_isPointerLockPending { false }; >@@ -2298,9 +2298,9 @@ private: > std::unique_ptr<WebPageDebuggable> m_inspectorDebuggable; > #endif > >- std::optional<SpellDocumentTag> m_spellDocumentTag; >+ Optional<SpellDocumentTag> m_spellDocumentTag; > >- std::optional<MonotonicTime> m_pageLoadStart; >+ Optional<MonotonicTime> m_pageLoadStart; > HashSet<String> m_previouslyVisitedPaths; > > RunLoop::Timer<WebPageProxy> m_resetRecentCrashCountTimer; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in >index 128e6e95073a1119fd91f779d9f97ae82e80cffc..b11fcb1d6a968a5cce72a4d84af9d06658a017e3 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in >@@ -107,7 +107,7 @@ messages -> WebPageProxy { > # Policy messages > DecidePolicyForResponse(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, bool canShowMIMEType, uint64_t listenerID, WebKit::UserData userData) > DecidePolicyForNavigationActionAsync(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData, uint64_t listenerID) >- DecidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData) -> (enum:uint8_t WebKit::WebPolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) Delayed >+ DecidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData) -> (enum:uint8_t WebKit::WebPolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, Optional<WebKit::WebsitePoliciesData> websitePolicies) Delayed > DecidePolicyForNewWindowAction(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, struct WebKit::NavigationActionData navigationActionData, WebCore::ResourceRequest request, String frameName, uint64_t listenerID, WebKit::UserData userData) > UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::UserData userData) > >@@ -131,7 +131,7 @@ messages -> WebPageProxy { > DidCancelClientRedirectForFrame(uint64_t frameID) > DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, URL url) > DidFailProvisionalLoadForFrame(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, String provisionalURL, WebCore::ResourceError error, WebKit::UserData userData) >- DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebKit::UserData userData) >+ DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebKit::UserData userData) > DidFailLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceError error, WebKit::UserData userData) > DidFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, WebKit::UserData userData) > DidFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, WebKit::UserData userData) >@@ -177,7 +177,7 @@ messages -> WebPageProxy { > UnsignedCallback(uint64_t result, WebKit::CallbackID callbackID) > RectForCharacterRangeCallback(WebCore::IntRect rect, struct WebKit::EditingRange actualRange, WebKit::CallbackID callbackID) > #if ENABLE(APPLICATION_MANIFEST) >- ApplicationManifestCallback(std::optional<WebCore::ApplicationManifest> manifest, WebKit::CallbackID callbackID) >+ ApplicationManifestCallback(Optional<WebCore::ApplicationManifest> manifest, WebKit::CallbackID callbackID) > #endif > #if PLATFORM(MAC) > AttributedStringForCharacterRangeCallback(struct WebKit::AttributedString string, struct WebKit::EditingRange actualRange, WebKit::CallbackID callbackID) >@@ -226,7 +226,7 @@ messages -> WebPageProxy { > # BackForward messages > BackForwardAddItem(struct WebKit::BackForwardListItemState itemState) > BackForwardGoToItem(struct WebCore::BackForwardItemIdentifier itemID) -> (WebKit::SandboxExtension::Handle sandboxExtensionHandle) LegacySync >- BackForwardItemAtIndex(int32_t itemIndex) -> (std::optional<WebCore::BackForwardItemIdentifier> itemID) LegacySync >+ BackForwardItemAtIndex(int32_t itemIndex) -> (Optional<WebCore::BackForwardItemIdentifier> itemID) LegacySync > BackForwardBackListCount() -> (uint32_t count) LegacySync > BackForwardForwardListCount() -> (uint32_t count) LegacySync > BackForwardClear() >@@ -329,7 +329,7 @@ messages -> WebPageProxy { > #if ENABLE(DATA_INTERACTION) > DidHandleStartDataInteractionRequest(bool started) > DidHandleAdditionalDragItemsRequest(bool added) >- DidConcludeEditDataInteraction(std::optional<WebCore::TextIndicatorData> textIndicator) >+ DidConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData> textIndicator) > #endif > > #if PLATFORM(COCOA) >@@ -399,8 +399,8 @@ messages -> WebPageProxy { > > #if PLATFORM(IOS_FAMILY) > CouldNotRestorePageState() >- RestorePageState(std::optional<WebCore::FloatPoint> scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::RectEdges<float> obscuredInsetsOnSave, double scale) >- RestorePageCenterAndScale(std::optional<WebCore::FloatPoint> unobscuredCenter, double scale) >+ RestorePageState(Optional<WebCore::FloatPoint> scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::RectEdges<float> obscuredInsetsOnSave, double scale) >+ RestorePageCenterAndScale(Optional<WebCore::FloatPoint> unobscuredCenter, double scale) > DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector<WebCore::FloatQuad> geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius) > > StartAssistingNode(struct WebKit::AssistedNodeInformation information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, WebKit::UserData userData) >@@ -436,7 +436,7 @@ messages -> WebPageProxy { > #endif > > #if ENABLE(PDFKIT_PLUGIN) >- ShowPDFContextMenu(struct WebKit::PDFContextMenu contextMenu) -> (std::optional<int32_t> selectedItem) LegacySync >+ ShowPDFContextMenu(struct WebKit::PDFContextMenu contextMenu) -> (Optional<int32_t> selectedItem) LegacySync > #endif > > #if ENABLE(NETSCAPE_PLUGIN_API) >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index e973c98b30f01bb0ad1d04ac24ae1a00eab65894..b877debe9e344a258b615600da92a36e26c109c5 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -620,7 +620,7 @@ void WebProcessPool::getNetworkProcessConnection(WebProcessProxy& webProcessProx > } > > #if ENABLE(SERVICE_WORKER) >-void WebProcessPool::establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy& proxy, SecurityOriginData&& securityOrigin, std::optional<PAL::SessionID> sessionID) >+void WebProcessPool::establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy& proxy, SecurityOriginData&& securityOrigin, Optional<PAL::SessionID> sessionID) > { > ASSERT_UNUSED(proxy, &proxy == m_networkProcess.get()); > >diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h >index 076794df0cef8c1ffe95aaa4bc083b6f53bacb07..240c526869438ea52d34e03bc2892a61771bec62 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.h >+++ b/Source/WebKit/UIProcess/WebProcessPool.h >@@ -345,7 +345,7 @@ public: > void getNetworkProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&); > > #if ENABLE(SERVICE_WORKER) >- void establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy&, WebCore::SecurityOriginData&&, std::optional<PAL::SessionID>); >+ void establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy&, WebCore::SecurityOriginData&&, Optional<PAL::SessionID>); > ServiceWorkerProcessProxy* serviceWorkerProcessProxyFromPageID(uint64_t pageID) const; > const HashMap<WebCore::SecurityOriginData, ServiceWorkerProcessProxy*>& serviceWorkerProxies() const { return m_serviceWorkerProcesses; } > void setAllowsAnySSLCertificateForServiceWorker(bool allows) { m_allowsAnySSLCertificateForServiceWorker = allows; } >@@ -559,7 +559,7 @@ private: > bool m_allowsAnySSLCertificateForServiceWorker { false }; > bool m_shouldDisableServiceWorkerProcessTerminationDelay { false }; > String m_serviceWorkerUserAgent; >- std::optional<WebPreferencesStore> m_serviceWorkerPreferences; >+ Optional<WebPreferencesStore> m_serviceWorkerPreferences; > HashMap<String, bool> m_mayHaveRegisteredServiceWorkers; > #endif > >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp >index dd567f8b73cc064f36cac62d6d47ade3c93684c1..db1fd58b93dff5865d13fc541b6e5d8746eb8e0a 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp >@@ -597,7 +597,7 @@ void WebProcessProxy::updateBackForwardItem(const BackForwardListItemState& item > } > > #if ENABLE(NETSCAPE_PLUGIN_API) >-void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vector<PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginIdentifier>>& supportedPluginIdentifiers) >+void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vector<PluginInfo>& applicationPlugins, Optional<Vector<WebCore::SupportedPluginIdentifier>>& supportedPluginIdentifiers) > { > if (refresh) > m_processPool->pluginInfoStore().refresh(); >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h >index 2361ae773a77efecbfa5649aee762e596e7bda97..75f65a7f7eb1acc819991ce4f9f6986c95b61ff3 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.h >+++ b/Source/WebKit/UIProcess/WebProcessProxy.h >@@ -283,7 +283,7 @@ private: > > // Plugins > #if ENABLE(NETSCAPE_PLUGIN_API) >- void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins, Vector<WebCore::PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&); >+ void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins, Vector<WebCore::PluginInfo>& applicationPlugins, Optional<Vector<WebCore::SupportedPluginIdentifier>>&); > #endif // ENABLE(NETSCAPE_PLUGIN_API) > #if ENABLE(NETSCAPE_PLUGIN_API) > void getPluginProcessConnection(uint64_t pluginProcessToken, Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&&); >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.messages.in b/Source/WebKit/UIProcess/WebProcessProxy.messages.in >index 6a98f4e96047dabf164a7610a87f2a9f6860b48a..dd057fa85e42bd653ca9e86dd23c2152e2827270 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebProcessProxy.messages.in >@@ -33,7 +33,7 @@ messages -> WebProcessProxy LegacyReceiver { > > # Plugin messages. > #if ENABLE(NETSCAPE_PLUGIN_API) >- GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins, Vector<WebCore::PluginInfo> applicationPlugins, struct std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers) LegacySync >+ GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins, Vector<WebCore::PluginInfo> applicationPlugins, struct Optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers) LegacySync > GetPluginProcessConnection(uint64_t pluginProcessToken) -> (IPC::Attachment connectionHandle, bool supportsAsynchronousInitialization) Delayed > #endif > GetNetworkProcessConnection() -> (IPC::Attachment connectionHandle) Delayed >diff --git a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >index 69af382347692eb3726cec04b2215262d0d6db66..451e7108d7810e41a56473408c2511dfa10fbbc3 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >@@ -309,7 +309,7 @@ void WebResourceLoadStatisticsStore::grantStorageAccess(String&& subFrameHost, S > }); > } > >-void WebResourceLoadStatisticsStore::callGrantStorageAccessHandler(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain, std::optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback) >+void WebResourceLoadStatisticsStore::callGrantStorageAccessHandler(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback) > { > ASSERT(RunLoop::isMain()); > >diff --git a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >index e92e57de60a7b738aa273d233c45dfdcf10b6c70..581704a4ef299dc083d279f534c77281cfa76b4e 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >@@ -131,7 +131,7 @@ public: > > void setStatisticsTestingCallback(WTF::Function<void(const String&)>&& callback) { m_statisticsTestingCallback = WTFMove(callback); } > void logTestingEvent(const String&); >- void callGrantStorageAccessHandler(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain, std::optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&&); >+ void callGrantStorageAccessHandler(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&&); > void removeAllStorageAccess(CompletionHandler<void()>&&); > void callUpdatePrevalentDomainsToBlockCookiesForHandler(const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); > void callRemoveDomainsHandler(const Vector<String>& domains); >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataRecord.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataRecord.h >index 61749a7b2c3bd5d2c5f9f4c0fa995a7be6d90624..ccf30a79abd0582ea0081ba3dff302bc7e83b4c2 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataRecord.h >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataRecord.h >@@ -62,7 +62,7 @@ struct WebsiteDataRecord { > uint64_t totalSize; > HashMap<unsigned, uint64_t> typeSizes; > }; >- std::optional<Size> size; >+ Optional<Size> size; > > HashSet<WebCore::SecurityOriginData> origins; > HashSet<String> cookieHostNames; >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >index 14960d3380ff93e5643f2ba93faa3f60cc2aa34a..62aca6d9d740860bb31f4cf6ab755da23e578704 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >@@ -1263,7 +1263,7 @@ void WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor(const Vector<Stri > } > } > >-void WebsiteDataStore::setAgeCapForClientSideCookies(std::optional<Seconds> seconds, CompletionHandler<void()>&& completionHandler) >+void WebsiteDataStore::setAgeCapForClientSideCookies(Optional<Seconds> seconds, CompletionHandler<void()>&& completionHandler) > { > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >@@ -1297,7 +1297,7 @@ void WebsiteDataStore::getAllStorageAccessEntries(uint64_t pageID, CompletionHan > networkProcess.getAllStorageAccessEntries(m_sessionID, WTFMove(completionHandler)); > } > >-void WebsiteDataStore::grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool wasGranted)>&& completionHandler) >+void WebsiteDataStore::grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool wasGranted)>&& completionHandler) > { > auto* webPage = WebProcessProxy::webPage(pageID); > if (!webPage) { >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >index 40f575aba4c290f78c531bfb5a9d047a94d79d7f..7c5343e2158594079c2086829c09bbf7bd13cc2d 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >@@ -117,10 +117,10 @@ public: > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > void updatePrevalentDomainsToBlockCookiesFor(const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); >- void setAgeCapForClientSideCookies(std::optional<Seconds>, CompletionHandler<void()>&&); >+ void setAgeCapForClientSideCookies(Optional<Seconds>, CompletionHandler<void()>&&); > void hasStorageAccessForFrameHandler(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool hasAccess)>&&); > void getAllStorageAccessEntries(uint64_t pageID, CompletionHandler<void(Vector<String>&& domains)>&&); >- void grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool wasGranted)>&&); >+ void grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool wasGranted)>&&); > void removeAllStorageAccessHandler(CompletionHandler<void()>&&); > void removePrevalentDomains(const Vector<String>& domains); > void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&&); >diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp >index 09eeb55371a35446487510303b8b5858c7f4cbee..27d72c1c47e45f96f8a7f68f5021d8cba2b5a166 100644 >--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp >+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp >@@ -45,8 +45,8 @@ > namespace WebKit { > using namespace WebCore; > >-static std::optional<int> s_damageEventBase; >-static std::optional<int> s_damageErrorBase; >+static Optional<int> s_damageEventBase; >+static Optional<int> s_damageErrorBase; > > class XDamageNotifier { > WTF_MAKE_NONCOPYABLE(XDamageNotifier); >diff --git a/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp b/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp >index 61ce2bf3c53d546640d4a97ae5387f2c217351aa..45760eeeed9ff4cce74ccdd7278d7cfd7f5ecea7 100644 >--- a/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp >+++ b/Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp >@@ -61,7 +61,7 @@ HardwareAccelerationManager::HardwareAccelerationManager() > #if USE(REDIRECTED_XCOMPOSITE_WINDOW) > if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) { > auto& display = downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()); >- std::optional<int> damageBase, errorBase; >+ Optional<int> damageBase, errorBase; > if (!display.supportsXComposite() || !display.supportsXDamage(damageBase, errorBase)) { > m_canUseHardwareAcceleration = false; > return; >diff --git a/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp >index b518e1e36d0ae72e6ec28804287524ca91be1929..a6b1c9136a702c8335279d6d52fcf70b7dc660d9 100644 >--- a/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp >+++ b/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp >@@ -66,7 +66,7 @@ void WebPopupMenuProxyGtk::selectItem(unsigned itemIndex) > m_selectedItem = itemIndex; > } > >-void WebPopupMenuProxyGtk::activateItem(std::optional<unsigned> itemIndex) >+void WebPopupMenuProxyGtk::activateItem(Optional<unsigned> itemIndex) > { > if (m_client) > m_client->valueChangedForPopupMenu(this, itemIndex.value_or(m_selectedItem.value_or(-1))); >@@ -348,7 +348,7 @@ void WebPopupMenuProxyGtk::hidePopupMenu() > m_device = nullptr; > } > >- activateItem(std::nullopt); >+ activateItem(WTF::nullopt); > > if (m_currentSearchString) { > g_string_free(m_currentSearchString, TRUE); >@@ -368,14 +368,14 @@ void WebPopupMenuProxyGtk::cancelTracking() > hidePopupMenu(); > } > >-std::optional<unsigned> WebPopupMenuProxyGtk::typeAheadFindIndex(GdkEventKey* event) >+Optional<unsigned> WebPopupMenuProxyGtk::typeAheadFindIndex(GdkEventKey* event) > { > gunichar keychar = gdk_keyval_to_unicode(event->keyval); > if (!g_unichar_isprint(keychar)) >- return std::nullopt; >+ return WTF::nullopt; > > if (event->time < m_previousKeyEventTime) >- return std::nullopt; >+ return WTF::nullopt; > > static const uint32_t typeaheadTimeoutMs = 1000; > if (event->time - m_previousKeyEventTime > typeaheadTimeoutMs) { >@@ -409,7 +409,7 @@ std::optional<unsigned> WebPopupMenuProxyGtk::typeAheadFindIndex(GdkEventKey* ev > GUniquePtr<char> normalizedPrefix(g_utf8_normalize(m_currentSearchString->str, prefixLength, G_NORMALIZE_ALL)); > GUniquePtr<char> prefix(normalizedPrefix ? g_utf8_casefold(normalizedPrefix.get(), -1) : nullptr); > if (!prefix) >- return std::nullopt; >+ return WTF::nullopt; > > model = gtk_tree_view_get_model(GTK_TREE_VIEW(m_treeView)); > for (unsigned i = 0; i < itemCount; i++, index = (index + 1) % itemCount) { >@@ -432,7 +432,7 @@ std::optional<unsigned> WebPopupMenuProxyGtk::typeAheadFindIndex(GdkEventKey* ev > return index; > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > bool WebPopupMenuProxyGtk::typeAheadFind(GdkEventKey* event) >diff --git a/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.h b/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.h >index 19645609f8b922286f8dce987ea3dad0982dc74b..87d0b6f6dc01bcc8468ff3c70e367c1d7b9a6940 100644 >--- a/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.h >+++ b/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.h >@@ -54,7 +54,7 @@ public: > void cancelTracking() override; > > virtual void selectItem(unsigned itemIndex); >- virtual void activateItem(std::optional<unsigned> itemIndex); >+ virtual void activateItem(Optional<unsigned> itemIndex); > > protected: > WebPopupMenuProxyGtk(GtkWidget*, WebPopupMenuProxy::Client&); >@@ -65,7 +65,7 @@ private: > void createPopupMenu(const Vector<WebPopupItem>&, int32_t selectedIndex); > void show(); > bool activateItemAtPath(GtkTreePath*); >- std::optional<unsigned> typeAheadFindIndex(GdkEventKey*); >+ Optional<unsigned> typeAheadFindIndex(GdkEventKey*); > bool typeAheadFind(GdkEventKey*); > > static gboolean buttonPressEventCallback(GtkWidget*, GdkEventButton*, WebPopupMenuProxyGtk*); >@@ -78,7 +78,7 @@ private: > GdkDevice* m_device { nullptr }; > > Vector<GUniquePtr<GtkTreePath>> m_paths; >- std::optional<unsigned> m_selectedItem; >+ Optional<unsigned> m_selectedItem; > > // Typeahead find. > gunichar m_repeatingCharacter { '\0' }; >diff --git a/Source/WebKit/UIProcess/ios/DragDropInteractionState.h b/Source/WebKit/UIProcess/ios/DragDropInteractionState.h >index b0102177437f3f214945a7a34e58a3dfe2417488..f1849a252cd9972c6e02b78bfd91cc79a380e17f 100644 >--- a/Source/WebKit/UIProcess/ios/DragDropInteractionState.h >+++ b/Source/WebKit/UIProcess/ios/DragDropInteractionState.h >@@ -49,8 +49,8 @@ struct DragSourceState { > CGPoint adjustedOrigin { CGPointZero }; > CGRect dragPreviewFrameInRootViewCoordinates { CGRectZero }; > RetainPtr<UIImage> image; >- std::optional<WebCore::TextIndicatorData> indicatorData; >- std::optional<WebCore::Path> visiblePath; >+ Optional<WebCore::TextIndicatorData> indicatorData; >+ Optional<WebCore::Path> visiblePath; > String linkTitle; > URL linkURL; > bool possiblyNeedsDragPreviewUpdate { true }; >@@ -94,7 +94,7 @@ public: > > private: > void updatePreviewsForActiveDragSources(); >- std::optional<DragSourceState> activeDragSourceForItem(UIDragItem *) const; >+ Optional<DragSourceState> activeDragSourceForItem(UIDragItem *) const; > > CGPoint m_lastGlobalPosition { CGPointZero }; > CGPoint m_adjustedPositionForDragEnd { CGPointZero }; >@@ -106,7 +106,7 @@ private: > BlockPtr<void()> m_dragCancelSetDownBlock; > BlockPtr<void(NSArray<UIDragItem *> *)> m_addDragItemCompletionBlock; > >- std::optional<DragSourceState> m_stagedDragSource; >+ Optional<DragSourceState> m_stagedDragSource; > Vector<DragSourceState> m_activeDragSources; > }; > >diff --git a/Source/WebKit/UIProcess/ios/DragDropInteractionState.mm b/Source/WebKit/UIProcess/ios/DragDropInteractionState.mm >index d0af0ac336a8af3d9afbff59e925db17dca5db86..0670c459c6a851c407bc9b276811ba8ddec68156 100644 >--- a/Source/WebKit/UIProcess/ios/DragDropInteractionState.mm >+++ b/Source/WebKit/UIProcess/ios/DragDropInteractionState.mm >@@ -152,17 +152,17 @@ static bool canUpdatePreviewForActiveDragSource(const DragSourceState& source) > return false; > } > >-std::optional<DragSourceState> DragDropInteractionState::activeDragSourceForItem(UIDragItem *item) const >+Optional<DragSourceState> DragDropInteractionState::activeDragSourceForItem(UIDragItem *item) const > { > if (![item.privateLocalContext isKindOfClass:[NSNumber class]]) >- return std::nullopt; >+ return WTF::nullopt; > > auto identifier = [(NSNumber *)item.privateLocalContext integerValue]; > for (auto& source : m_activeDragSources) { > if (source.itemIdentifier == identifier) > return source; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > bool DragDropInteractionState::anyActiveDragSourceIs(WebCore::DragSourceAction action) const >@@ -261,7 +261,7 @@ void DragDropInteractionState::clearStagedDragSource(DidBecomeActive didBecomeAc > { > if (didBecomeActive == DidBecomeActive::Yes) > m_activeDragSources.append(stagedDragSource()); >- m_stagedDragSource = std::nullopt; >+ m_stagedDragSource = WTF::nullopt; > } > > void DragDropInteractionState::dragAndDropSessionsDidEnd() >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >index 6f14b4071290885498b928d1bc6df4e241bfbfa3..305a3716a4d06a97d3fd2795f3f280c3e7f8be0f 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >@@ -135,8 +135,8 @@ private: > void layerTreeCommitComplete() override; > > void couldNotRestorePageState() override; >- void restorePageState(std::optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatBoxExtent&, double) override; >- void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double) override; >+ void restorePageState(Optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatBoxExtent&, double) override; >+ void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double) override; > > void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) override; > void stopAssistingNode() override; >@@ -221,7 +221,7 @@ private: > void didHandleStartDataInteractionRequest(bool started) override; > void didHandleAdditionalDragItemsRequest(bool added) override; > void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& image) override; >- void didConcludeEditDataInteraction(std::optional<WebCore::TextIndicatorData>) override; >+ void didConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData>) override; > void didChangeDataInteractionCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) override; > #endif > >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >index dc0cd36c00629dd51421d98596ab32da55b3f6dc..422a65a53e5b041f84ec434368f92f4b73e8affd 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >@@ -540,12 +540,12 @@ void PageClientImpl::couldNotRestorePageState() > [m_webView _couldNotRestorePageState]; > } > >-void PageClientImpl::restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) >+void PageClientImpl::restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) > { > [m_webView _restorePageScrollPosition:scrollPosition scrollOrigin:scrollOrigin previousObscuredInset:obscuredInsetsOnSave scale:scale]; > } > >-void PageClientImpl::restorePageCenterAndScale(std::optional<WebCore::FloatPoint> center, double scale) >+void PageClientImpl::restorePageCenterAndScale(Optional<WebCore::FloatPoint> center, double scale) > { > [m_webView _restorePageStateToUnobscuredCenter:center scale:scale]; > } >@@ -829,7 +829,7 @@ void PageClientImpl::startDrag(const DragItem& item, const ShareableBitmap::Hand > [m_contentView _startDrag:ShareableBitmap::create(image)->makeCGImageCopy() item:item]; > } > >-void PageClientImpl::didConcludeEditDataInteraction(std::optional<TextIndicatorData> data) >+void PageClientImpl::didConcludeEditDataInteraction(Optional<TextIndicatorData> data) > { > [m_contentView _didConcludeEditDataInteraction:data]; > } >diff --git a/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h b/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h >index 4d1f8bdf2a7f5ff42180bbf3094554f2853c5244..1b54abf36f0416b7c32942f17021cdbd5fb5d5fd 100644 >--- a/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h >+++ b/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h >@@ -42,7 +42,7 @@ struct InteractionInformationAtPosition; > > @protocol WKActionSheetAssistantDelegate <NSObject> > @required >-- (std::optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant; >+- (Optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant; > - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant performAction:(WebKit::SheetAction)action; > - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant openElementAtLocation:(CGPoint)location; > - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect; >diff --git a/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm b/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm >index 27b359350a0b2fc43084ccb97c0be960d5d08bd0..148349ab3b0cfe3eef1b0d859eff2c978f15f7e7 100644 >--- a/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm >+++ b/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm >@@ -89,7 +89,7 @@ @implementation WKActionSheetAssistant { > WeakObjCPtr<id <WKActionSheetAssistantDelegate>> _delegate; > RetainPtr<WKActionSheet> _interactionSheet; > RetainPtr<_WKActivatedElementInfo> _elementInfo; >- std::optional<WebKit::InteractionInformationAtPosition> _positionInformation; >+ Optional<WebKit::InteractionInformationAtPosition> _positionInformation; > WeakObjCPtr<UIView> _view; > BOOL _needsLinkIndicator; > BOOL _isPresentingDDUserInterface; >@@ -628,7 +628,7 @@ - (void)cleanupSheet > [_interactionSheet setSheetDelegate:nil]; > _interactionSheet = nil; > _elementInfo = nil; >- _positionInformation = std::nullopt; >+ _positionInformation = WTF::nullopt; > _needsLinkIndicator = NO; > _isPresentingDDUserInterface = NO; > _hasPendingActionSheet = NO; >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >index e794e3c631ddeb53a1a469b7909429b4cba3bc61..55ef7bc1911089c1b349778f51e99b3b7ca65714 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >@@ -270,10 +270,10 @@ struct WKAutoCorrectionData { > > WebKit::WKSelectionDrawingInfo _lastSelectionDrawingInfo; > >- std::optional<WebKit::InteractionInformationRequest> _outstandingPositionInformationRequest; >+ Optional<WebKit::InteractionInformationRequest> _outstandingPositionInformationRequest; > > uint64_t _positionInformationCallbackDepth; >- Vector<std::optional<InteractionInformationRequestAndCallback>> _pendingPositionInformationHandlers; >+ Vector<Optional<InteractionInformationRequestAndCallback>> _pendingPositionInformationHandlers; > > std::unique_ptr<WebKit::InputViewUpdateDeferrer> _inputViewUpdateDeferrer; > >@@ -431,7 +431,7 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW) > - (void)_didHandleStartDataInteractionRequest:(BOOL)started; > - (void)_didHandleAdditionalDragItemsRequest:(BOOL)added; > - (void)_startDrag:(RetainPtr<CGImageRef>)image item:(const WebCore::DragItem&)item; >-- (void)_didConcludeEditDataInteraction:(std::optional<WebCore::TextIndicatorData>)data; >+- (void)_didConcludeEditDataInteraction:(Optional<WebCore::TextIndicatorData>)data; > - (void)_didChangeDataInteractionCaretRect:(CGRect)previousRect currentRect:(CGRect)rect; > #endif > >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 026f1f7a8762b9894a338c2c4878ffa38462d870..f223332dc49949889a076a4c03cfbf69b9d56333 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -762,7 +762,7 @@ - (void)cleanupInteraction > [_formInputSession invalidate]; > _formInputSession = nil; > [_highlightView removeFromSuperview]; >- _outstandingPositionInformationRequest = std::nullopt; >+ _outstandingPositionInformationRequest = WTF::nullopt; > > _focusRequiresStrongPasswordAssistance = NO; > >@@ -1668,7 +1668,7 @@ - (void)_invokeAndRemovePendingHandlersValidForCurrentPositionInformation > if (![self _currentPositionInformationIsValidForRequest:requestAndHandler->first]) > continue; > >- _pendingPositionInformationHandlers[index] = std::nullopt; >+ _pendingPositionInformationHandlers[index] = WTF::nullopt; > > if (requestAndHandler->second) > requestAndHandler->second(updatedPositionInformation); >@@ -2133,7 +2133,7 @@ - (void)clearSelection > > - (void)_positionInformationDidChange:(const WebKit::InteractionInformationAtPosition&)info > { >- _outstandingPositionInformationRequest = std::nullopt; >+ _outstandingPositionInformationRequest = WTF::nullopt; > > WebKit::InteractionInformationAtPosition newInfo = info; > newInfo.mergeCompatibleOptionalInformation(_positionInformation); >@@ -5147,13 +5147,13 @@ - (BOOL)isAnyTouchOverActiveArea:(NSSet *)touches > > #pragma mark - Implementation of WKActionSheetAssistantDelegate. > >-- (std::optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant >+- (Optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant > { > WebKit::InteractionInformationRequest request(_positionInformation.request.point); > request.includeSnapshot = true; > request.includeLinkIndicator = assistant.needsLinkIndicator; > if (![self ensurePositionInformationIsUpToDate:request]) >- return std::nullopt; >+ return WTF::nullopt; > > return _positionInformation; > } >@@ -5453,7 +5453,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop > return extractItemProvidersFromDragItems(session.items); > } > >-- (void)_didConcludeEditDataInteraction:(std::optional<WebCore::TextIndicatorData>)data >+- (void)_didConcludeEditDataInteraction:(Optional<WebCore::TextIndicatorData>)data > { > if (!data) > return; >diff --git a/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm b/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm >index 9930ea1527eb35b965a82c0af5bc5377654cc7ca..e30fa8b74b1452af10d60d0096a9ba386bbb4359 100644 >--- a/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm >+++ b/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm >@@ -99,7 +99,7 @@ @implementation WKKeyboardScrollingAnimator { > id <WKKeyboardScrollableInternal> _scrollable; > RetainPtr<CADisplayLink> _displayLink; > >- std::optional<WebKit::KeyboardScroll> _currentScroll; >+ Optional<WebKit::KeyboardScroll> _currentScroll; > > BOOL _hasPressedScrollingKey; > >@@ -187,16 +187,16 @@ static WebCore::PhysicalBoxSide boxSide(WebKit::ScrollingDirection direction) > } > } > >-- (std::optional<WebKit::KeyboardScroll>)keyboardScrollForEvent:(::WebEvent *)event >+- (Optional<WebKit::KeyboardScroll>)keyboardScrollForEvent:(::WebEvent *)event > { > static const unsigned kWebSpaceKey = 0x20; > > if (![_scrollable isKeyboardScrollable]) >- return std::nullopt; >+ return WTF::nullopt; > > NSString *charactersIgnoringModifiers = event.charactersIgnoringModifiers; > if (!charactersIgnoringModifiers.length) >- return std::nullopt; >+ return WTF::nullopt; > > enum class Key : uint8_t { Other, LeftArrow, RightArrow, UpArrow, DownArrow, PageUp, PageDown, Space }; > >@@ -223,7 +223,7 @@ - (std::optional<WebKit::KeyboardScroll>)keyboardScrollForEvent:(::WebEvent *)ev > }(); > > if (key == Key::Other) >- return std::nullopt; >+ return WTF::nullopt; > > BOOL shiftPressed = event.modifierFlags & WebEventFlagMaskShiftKey; > BOOL altPressed = event.modifierFlags & WebEventFlagMaskOptionKey; >@@ -375,7 +375,7 @@ - (void)stopAnimatedScroll > // out to that point. > _idealPosition = [_scrollable boundedContentOffset:farthestPointInDirection(_currentPosition + displacement, _idealPositionForMinimumTravel, _currentScroll->direction)]; > >- _currentScroll = std::nullopt; >+ _currentScroll = WTF::nullopt; > > #if !ENABLE(ANIMATED_KEYBOARD_SCROLLING) > [self stopRepeatTimer]; >diff --git a/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm b/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm >index aea0d6d39f62d71d967446e68227ebd7f283ad14..551ec32a62d56e37a3cf066a55e4bdb1468eddbc 100644 >--- a/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm >@@ -752,7 +752,7 @@ - (void)annotation:(UIPDFAnnotation *)annotation isBeingPressedAtPoint:(CGPoint) > > #pragma mark WKActionSheetAssistantDelegate > >-- (std::optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant >+- (Optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant > { > return _positionInformation; > } >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index df275b2e165e2ab0b678d6c187fac0b962642811..1d525764b3f7b6e4074c34ca8ad6c8ba306aad31 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -59,7 +59,7 @@ @implementation WKPDFView { > NSUInteger _findStringCount; > NSUInteger _findStringMaxCount; > RetainPtr<UIView> _fixedOverlayView; >- std::optional<NSUInteger> _focusedSearchResultIndex; >+ Optional<NSUInteger> _focusedSearchResultIndex; > NSInteger _focusedSearchResultPendingOffset; > RetainPtr<PDFHostViewController> _hostViewController; > CGSize _overlaidAccessoryViewsInset; >@@ -250,7 +250,7 @@ - (void)_resetFind > _findString = nil; > _findStringCount = 0; > _findStringMaxCount = 0; >- _focusedSearchResultIndex = std::nullopt; >+ _focusedSearchResultIndex = WTF::nullopt; > _focusedSearchResultPendingOffset = 0; > } > >@@ -493,7 +493,7 @@ - (void)pdfHostViewControllerExtensionProcessDidCrash:(PDFHostViewController *)c > > #pragma mark WKActionSheetAssistantDelegate > >-- (std::optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant >+- (Optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant > { > return _positionInformation; > } >diff --git a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >index 7c890adfe610030fd835cd2041e90b9896b28afd..68aa2b1015c0dcebbd25523401a754b3f25d3b23 100644 >--- a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >@@ -349,7 +349,7 @@ void WebPageProxy::setDeviceOrientation(int32_t deviceOrientation) > } > } > >-void WebPageProxy::setOverrideViewportArguments(const std::optional<ViewportArguments>& viewportArguments) >+void WebPageProxy::setOverrideViewportArguments(const Optional<ViewportArguments>& viewportArguments) > { > if (isValid()) > m_process->send(Messages::WebPage::SetOverrideViewportArguments(viewportArguments), m_pageID); >@@ -878,12 +878,12 @@ void WebPageProxy::couldNotRestorePageState() > pageClient().couldNotRestorePageState(); > } > >-void WebPageProxy::restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) >+void WebPageProxy::restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) > { > pageClient().restorePageState(scrollPosition, scrollOrigin, obscuredInsetsOnSave, scale); > } > >-void WebPageProxy::restorePageCenterAndScale(std::optional<WebCore::FloatPoint> center, double scale) >+void WebPageProxy::restorePageCenterAndScale(Optional<WebCore::FloatPoint> center, double scale) > { > pageClient().restorePageCenterAndScale(center, scale); > } >@@ -1127,7 +1127,7 @@ void WebPageProxy::requestAdditionalItemsForDragSession(const IntPoint& clientPo > m_process->send(Messages::WebPage::RequestAdditionalItemsForDragSession(clientPosition, globalPosition), m_pageID); > } > >-void WebPageProxy::didConcludeEditDataInteraction(std::optional<TextIndicatorData> data) >+void WebPageProxy::didConcludeEditDataInteraction(Optional<TextIndicatorData> data) > { > pageClient().didConcludeEditDataInteraction(data); > } >diff --git a/Source/WebKit/UIProcess/ios/forms/WKFocusedFormControlView.mm b/Source/WebKit/UIProcess/ios/forms/WKFocusedFormControlView.mm >index 26b01d49528fb7686d74a04264e85fea06dfb4cf..d72adab423e58c20062a18c1bef2a6e8e3b3f718 100644 >--- a/Source/WebKit/UIProcess/ios/forms/WKFocusedFormControlView.mm >+++ b/Source/WebKit/UIProcess/ios/forms/WKFocusedFormControlView.mm >@@ -79,7 +79,7 @@ @implementation WKFocusedFormControlView { > WeakObjCPtr<id <WKFocusedFormControlViewDelegate>> _delegate; > RetainPtr<NSString> _submitActionName; > RetainPtr<PUICCrownInputSequencer> _crownInputSequencer; >- std::optional<CGPoint> _initialScrollViewContentOffset; >+ Optional<CGPoint> _initialScrollViewContentOffset; > BOOL _hasPendingFocusRequest; > } > >@@ -127,7 +127,7 @@ - (instancetype)initWithFrame:(CGRect)frame delegate:(id <WKFocusedFormControlVi > [self addSubview:_submitButtonBackgroundView.get()]; > > _hasPendingFocusRequest = NO; >- _initialScrollViewContentOffset = std::nullopt; >+ _initialScrollViewContentOffset = WTF::nullopt; > > return self; > } >diff --git a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >index aabe284abdf516622dd30e0a49101945dcb52279..0dffb16ce689ee29ff49062d5dab9fb9ff5d09f7 100644 >--- a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >+++ b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >@@ -717,7 +717,7 @@ - (void)_completedExitFullScreen > > _viewState.applyTo(webView.get()); > if (auto* page = [webView _page]) >- page->setOverrideViewportArguments(std::nullopt); >+ page->setOverrideViewportArguments(WTF::nullopt); > > [webView setNeedsLayout]; > [webView layoutIfNeeded]; >diff --git a/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp b/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >index ef4db8e8f77ed01f377be7f614d65ea3b4f3fdd9..01c6069a7582be0f889afac044fcfa72e5e3df5a 100644 >--- a/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >+++ b/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >@@ -706,13 +706,13 @@ public: > #endif > > template<typename T> >- auto operator>>(std::optional<T>& value) -> typename std::enable_if<std::is_enum<T>::value, HistoryEntryDataDecoder&>::type >+ auto operator>>(Optional<T>& value) -> typename std::enable_if<std::is_enum<T>::value, HistoryEntryDataDecoder&>::type > { > uint32_t underlyingEnumValue; > *this >> underlyingEnumValue; > > if (!isValid() || !isValidEnum(static_cast<T>(underlyingEnumValue))) >- value = std::nullopt; >+ value = WTF::nullopt; > else > value = static_cast<T>(underlyingEnumValue); > >@@ -792,7 +792,7 @@ private: > > static void decodeFormDataElement(HistoryEntryDataDecoder& decoder, HTTPBody::Element& formDataElement) > { >- std::optional<FormDataElementType> elementType; >+ Optional<FormDataElementType> elementType; > decoder >> elementType; > if (!elementType) > return; >@@ -1069,7 +1069,7 @@ static bool decodeV1SessionHistory(CFDictionaryRef sessionHistoryDictionary, Bac > auto currentIndexNumber = dynamic_cf_cast<CFNumberRef>(CFDictionaryGetValue(sessionHistoryDictionary, sessionHistoryCurrentIndexKey)); > if (!currentIndexNumber) { > // No current index means the dictionary represents an empty session. >- backForwardListState.currentIndex = std::nullopt; >+ backForwardListState.currentIndex = WTF::nullopt; > backForwardListState.items = { }; > return true; > } >diff --git a/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm b/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm >index 20edfcf4c8ee2179cb6b356d7284c12225b2ea91..a93f0b49624f7d25b575e62e0a4486c85f7312aa 100644 >--- a/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm >+++ b/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm >@@ -55,13 +55,13 @@ @end > > @interface WKDataListSuggestionTable : NSTableView { > RetainPtr<NSScrollView> _enclosingScrollView; >- std::optional<size_t> _activeRow; >+ Optional<size_t> _activeRow; > } > > - (id)initWithElementRect:(const WebCore::IntRect&)rect; > - (void)setVisibleRect:(NSRect)rect; > - (void)setActiveRow:(size_t)row; >-- (std::optional<size_t>)currentActiveRow; >+- (Optional<size_t>)currentActiveRow; > - (void)reload; > @end > >@@ -265,7 +265,7 @@ - (void)setVisibleRect:(NSRect)rect > [_enclosingScrollView setFrame:NSMakeRect(dropdownShadowHeight, dropdownShadowHeight, NSWidth(rect) - dropdownShadowHeight * 2, NSHeight(rect) - dropdownShadowHeight)]; > } > >-- (std::optional<size_t>)currentActiveRow >+- (Optional<size_t>)currentActiveRow > { > return _activeRow; > } >@@ -286,7 +286,7 @@ - (void)setActiveRow:(size_t)row > > - (void)reload > { >- _activeRow = std::nullopt; >+ _activeRow = WTF::nullopt; > [self reloadData]; > } > >@@ -336,7 +336,7 @@ - (id)initWithInformation:(WebCore::DataListSuggestionInformation&&)information > > - (String)currentSelectedString > { >- std::optional<size_t> selectedRow = [_table currentActiveRow]; >+ Optional<size_t> selectedRow = [_table currentActiveRow]; > if (selectedRow && selectedRow.value() < _suggestions.size()) > return _suggestions.at(selectedRow.value()); > >@@ -354,7 +354,7 @@ - (void)updateWithInformation:(WebCore::DataListSuggestionInformation&&)informat > - (void)moveSelectionByDirection:(const String&)direction > { > size_t size = _suggestions.size(); >- std::optional<size_t> oldSelection = [_table currentActiveRow]; >+ Optional<size_t> oldSelection = [_table currentActiveRow]; > > size_t newSelection; > if (oldSelection) { >@@ -426,7 +426,7 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn > > [result setText:_suggestions.at(row)]; > >- std::optional<size_t> currentActiveRow = [_table currentActiveRow]; >+ Optional<size_t> currentActiveRow = [_table currentActiveRow]; > if (currentActiveRow && static_cast<size_t>(row) == currentActiveRow.value()) > result.active = YES; > >diff --git a/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm b/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm >index ca5a27c8c79bb9a287e1b256a6819cf9a7398657..084af87079463ff9cfd89176b01b643c6c5774e0 100644 >--- a/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm >+++ b/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm >@@ -548,7 +548,7 @@ void WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication(const String& > } > > #if ENABLE(PDFKIT_PLUGIN) >-void WebPageProxy::showPDFContextMenu(const WebKit::PDFContextMenu& contextMenu, std::optional<int32_t>& selectedIndex) >+void WebPageProxy::showPDFContextMenu(const WebKit::PDFContextMenu& contextMenu, Optional<int32_t>& selectedIndex) > { > if (!contextMenu.m_items.size()) > return; >diff --git a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >index 9b8c008d16d758f8dd71f56023373ba0bd73f3e4..3fcccb488fd6cc05f00e1368d5b1d1e318a3ea21 100644 >--- a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >+++ b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >@@ -83,12 +83,12 @@ const WebPaymentCoordinator::AvailablePaymentNetworksSet& WebPaymentCoordinator: > return *m_availablePaymentNetworks; > } > >-std::optional<String> WebPaymentCoordinator::validatedPaymentNetwork(const String& paymentNetwork) >+Optional<String> WebPaymentCoordinator::validatedPaymentNetwork(const String& paymentNetwork) > { > auto& paymentNetworks = availablePaymentNetworks(); > auto result = paymentNetworks.find(paymentNetwork); > if (result == paymentNetworks.end()) >- return std::nullopt; >+ return WTF::nullopt; > return *result; > } > >@@ -149,22 +149,22 @@ void WebPaymentCoordinator::completeMerchantValidation(const WebCore::PaymentMer > m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteMerchantValidation(paymentMerchantSession)); > } > >-void WebPaymentCoordinator::completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&& update) >+void WebPaymentCoordinator::completeShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate>&& update) > { > m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingMethodSelection(update)); > } > >-void WebPaymentCoordinator::completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&& update) >+void WebPaymentCoordinator::completeShippingContactSelection(Optional<WebCore::ShippingContactUpdate>&& update) > { > m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingContactSelection(update)); > } > >-void WebPaymentCoordinator::completePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate>&& update) >+void WebPaymentCoordinator::completePaymentMethodSelection(Optional<WebCore::PaymentMethodUpdate>&& update) > { > m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentMethodSelection(update)); > } > >-void WebPaymentCoordinator::completePaymentSession(std::optional<WebCore::PaymentAuthorizationResult>&& result) >+void WebPaymentCoordinator::completePaymentSession(Optional<WebCore::PaymentAuthorizationResult>&& result) > { > m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentSession(result)); > } >diff --git a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >index fb74d30ff95f3f72a554aa1d0a1e351797f2e844..2fe5ec7cb24f424f30657af1ae1bc66f85705fb5 100644 >--- a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >+++ b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >@@ -56,16 +56,16 @@ public: > private: > // WebCore::PaymentCoordinatorClient. > bool supportsVersion(unsigned version) override; >- std::optional<String> validatedPaymentNetwork(const String&) override; >+ Optional<String> validatedPaymentNetwork(const String&) override; > bool canMakePayments() override; > void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) override; > void openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) override; > bool showPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&) override; > void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override; >- void completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&&) override; >- void completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&&) override; >- void completePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate>&&) override; >- void completePaymentSession(std::optional<WebCore::PaymentAuthorizationResult>&&) override; >+ void completeShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate>&&) override; >+ void completeShippingContactSelection(Optional<WebCore::ShippingContactUpdate>&&) override; >+ void completePaymentMethodSelection(Optional<WebCore::PaymentMethodUpdate>&&) override; >+ void completePaymentSession(Optional<WebCore::PaymentAuthorizationResult>&&) override; > > void abortPaymentSession() override; > void cancelPaymentSession() override; >@@ -95,7 +95,7 @@ private: > HashMap<uint64_t, WTF::Function<void (bool)>> m_pendingCanMakePaymentsWithActiveCardCallbacks; > HashMap<uint64_t, WTF::Function<void (bool)>> m_pendingOpenPaymentSetupCallbacks; > >- std::optional<AvailablePaymentNetworksSet> m_availablePaymentNetworks; >+ Optional<AvailablePaymentNetworksSet> m_availablePaymentNetworks; > > #if USE(APPLE_INTERNAL_SDK) > #import <WebKitAdditions/WebPaymentCoordinatorAdditions.h> >diff --git a/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp b/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp >index efa0341402a0af37bb12e3e9f434fcf2c5233fc6..ac5b71bf338137c11f170cd3e9c1c801301f4b77 100644 >--- a/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp >+++ b/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp >@@ -477,13 +477,13 @@ void WebAutomationSessionProxy::focusFrame(uint64_t pageID, uint64_t frameID) > coreDOMWindow->focus(true); > } > >-static std::optional<WebCore::FloatPoint> elementInViewClientCenterPoint(WebCore::Element& element, bool& isObscured) >+static Optional<WebCore::FloatPoint> elementInViewClientCenterPoint(WebCore::Element& element, bool& isObscured) > { > // §11.1 Element Interactability. > // https://www.w3.org/TR/webdriver/#dfn-in-view-center-point > auto* clientRect = element.getClientRects()->item(0); > if (!clientRect) >- return std::nullopt; >+ return WTF::nullopt; > > auto clientCenterPoint = WebCore::FloatPoint::narrowPrecision(0.5 * (clientRect->left() + clientRect->right()), 0.5 * (clientRect->top() + clientRect->bottom())); > auto elementList = element.treeScope().elementsFromPoint(clientCenterPoint.x(), clientCenterPoint.y()); >@@ -497,7 +497,7 @@ static std::optional<WebCore::FloatPoint> elementInViewClientCenterPoint(WebCore > > auto index = elementList.findMatching([&element] (auto& item) { return item.get() == &element; }); > if (index == notFound) >- return std::nullopt; >+ return WTF::nullopt; > > if (index) { > // Element is not the first one in the list. >@@ -539,7 +539,7 @@ void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t f > WebPage* page = WebProcess::singleton().webPage(pageID); > if (!page) { > String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound); >- WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, std::nullopt, false, windowNotFoundErrorType), 0); >+ WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, WTF::nullopt, false, windowNotFoundErrorType), 0); > return; > } > >@@ -549,13 +549,13 @@ void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t f > > WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page->mainWebFrame(); > if (!frame || !frame->coreFrame() || !frame->coreFrame()->view()) { >- WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, std::nullopt, false, frameNotFoundErrorType), 0); >+ WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, WTF::nullopt, false, frameNotFoundErrorType), 0); > return; > } > > WebCore::Element* coreElement = elementForNodeHandle(*frame, nodeHandle); > if (!coreElement) { >- WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, std::nullopt, false, nodeNotFoundErrorType), 0); >+ WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, WTF::nullopt, false, nodeNotFoundErrorType), 0); > return; > } > >@@ -568,7 +568,7 @@ void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t f > } > > if (coordinateSystem == CoordinateSystem::VisualViewport) { >- WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, std::nullopt, false, notImplementedErrorType), 0); >+ WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, WTF::nullopt, false, notImplementedErrorType), 0); > return; > } > >@@ -590,10 +590,10 @@ void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t f > break; > } > >- std::optional<WebCore::IntPoint> resultInViewCenterPoint; >+ Optional<WebCore::IntPoint> resultInViewCenterPoint; > bool isObscured = false; > if (containerElement) { >- std::optional<WebCore::FloatPoint> frameInViewCenterPoint = elementInViewClientCenterPoint(*containerElement, isObscured); >+ Optional<WebCore::FloatPoint> frameInViewCenterPoint = elementInViewClientCenterPoint(*containerElement, isObscured); > if (frameInViewCenterPoint.has_value()) { > WebCore::IntPoint rootInViewCenterPoint = mainView->rootViewToContents(frameView->contentsToRootView(WebCore::IntPoint(frameInViewCenterPoint.value()))); > switch (coordinateSystem) { >diff --git a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp >index 55865e45032a8a361398a22311ac2c05ba509fcf..22a00adb0702d3c4c8593a4e79bcafacec933968 100644 >--- a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp >+++ b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp >@@ -132,7 +132,7 @@ void WebCacheStorageConnection::clearMemoryRepresentation(const WebCore::ClientO > connection().send(Messages::CacheStorageEngineConnection::ClearMemoryRepresentation(m_sessionID, requestIdentifier, origin), 0); > } > >-void WebCacheStorageConnection::clearMemoryRepresentationCompleted(uint64_t requestIdentifier, std::optional<Error>&& result) >+void WebCacheStorageConnection::clearMemoryRepresentationCompleted(uint64_t requestIdentifier, Optional<Error>&& result) > { > if (auto callback = m_clearRepresentationCallbacks.take(requestIdentifier)) > callback(WTFMove(result)); >diff --git a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h >index d2e0df2d860922a3b1e356be921e7801986dc756..84d9e4de5b812bef3824f27fb53c7804156d220c 100644 >--- a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h >+++ b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h >@@ -75,7 +75,7 @@ private: > void putRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError&&); > > void engineRepresentationCompleted(uint64_t requestIdentifier, const String& representation); >- void clearMemoryRepresentationCompleted(uint64_t requestIdentifier, std::optional<WebCore::DOMCacheEngine::Error>&&); >+ void clearMemoryRepresentationCompleted(uint64_t requestIdentifier, Optional<WebCore::DOMCacheEngine::Error>&&); > > WebCacheStorageProvider& m_provider; > PAL::SessionID m_sessionID; >diff --git a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in >index 5c0963c14b453334bfd1af6bfda7682d38c95a1c..6ea5a149a17fbbbe08afd6d3c420a6f672b51400 100644 >--- a/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in >+++ b/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in >@@ -30,5 +30,5 @@ messages -> WebCacheStorageConnection { > PutRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError result); > > EngineRepresentationCompleted(uint64_t requestIdentifier, String representation); >- ClearMemoryRepresentationCompleted(uint64_t requestIdentifier, std::optional<WebCore::DOMCacheEngine::Error> error); >+ ClearMemoryRepresentationCompleted(uint64_t requestIdentifier, Optional<WebCore::DOMCacheEngine::Error> error); > } >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm >index a57e57733e39bcaea398a5fb18b118465eb37465..a3ec2628725cebe37237d9a1e58118c0c7fb7c61 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm >@@ -64,7 +64,7 @@ - (UIImage *)renderedImageWithOptions:(WKSnapshotOptions)options > > - (UIImage *)renderedImageWithOptions:(WKSnapshotOptions)options width:(NSNumber *)width > { >- std::optional<float> optionalWidth; >+ Optional<float> optionalWidth; > if (width) > optionalWidth = width.floatValue; > >@@ -84,7 +84,7 @@ - (NSImage *)renderedImageWithOptions:(WKSnapshotOptions)options > > - (NSImage *)renderedImageWithOptions:(WKSnapshotOptions)options width:(NSNumber *)width > { >- std::optional<float> optionalWidth; >+ Optional<float> optionalWidth; > if (width) > optionalWidth = width.floatValue; > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >index bbe3cc9bfd0711ed7e755ee43e27fffc752aa969..ffa6288af92bc7c7f46e9932e3b3e65652923f74 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp >@@ -773,7 +773,7 @@ WKArrayRef WKBundlePageCopyOriginsWithApplicationCache(WKBundlePageRef page) > > void WKBundlePageSetEventThrottlingBehaviorOverride(WKBundlePageRef page, WKEventThrottlingBehavior* behavior) > { >- std::optional<WebCore::EventThrottlingBehavior> behaviorValue; >+ Optional<WebCore::EventThrottlingBehavior> behaviorValue; > if (behavior) { > switch (*behavior) { > case kWKEventThrottlingBehaviorResponsive: >@@ -790,7 +790,7 @@ void WKBundlePageSetEventThrottlingBehaviorOverride(WKBundlePageRef page, WKEven > > void WKBundlePageSetCompositingPolicyOverride(WKBundlePageRef page, WKCompositingPolicy* policy) > { >- std::optional<WebCore::CompositingPolicy> policyValue; >+ Optional<WebCore::CompositingPolicy> policyValue; > if (policy) { > switch (*policy) { > case kWKCompositingPolicyNormal: >diff --git a/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp b/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp >index 94316a106bb8b896c38589c1f72c49dc4c2daaae..74fbb46eb24f6bc09f6c423acdc36632be26a84e 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp >@@ -134,7 +134,7 @@ IntRect InjectedBundleNodeHandle::renderRect(bool* isReplaced) > return m_node->pixelSnappedRenderRect(isReplaced); > } > >-static RefPtr<WebImage> imageForRect(FrameView* frameView, const IntRect& paintingRect, const std::optional<float>& bitmapWidth, SnapshotOptions options) >+static RefPtr<WebImage> imageForRect(FrameView* frameView, const IntRect& paintingRect, const Optional<float>& bitmapWidth, SnapshotOptions options) > { > if (paintingRect.isEmpty()) > return nullptr; >@@ -183,7 +183,7 @@ static RefPtr<WebImage> imageForRect(FrameView* frameView, const IntRect& painti > return snapshot; > } > >-RefPtr<WebImage> InjectedBundleNodeHandle::renderedImage(SnapshotOptions options, bool shouldExcludeOverflow, const std::optional<float>& bitmapWidth) >+RefPtr<WebImage> InjectedBundleNodeHandle::renderedImage(SnapshotOptions options, bool shouldExcludeOverflow, const Optional<float>& bitmapWidth) > { > Frame* frame = m_node->document().frame(); > if (!frame) >diff --git a/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h b/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h >index bbab83f5861d883c1768ddd896a644174024db8e..94222a97412332f7e1be049b3c95b4f5d3653045 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h >@@ -62,7 +62,7 @@ public: > // Note: These should only be operations that are not exposed to JavaScript. > WebCore::IntRect elementBounds(); > WebCore::IntRect renderRect(bool*); >- RefPtr<WebImage> renderedImage(SnapshotOptions, bool shouldExcludeOverflow, const std::optional<float>& bitmapWidth = std::nullopt); >+ RefPtr<WebImage> renderedImage(SnapshotOptions, bool shouldExcludeOverflow, const Optional<float>& bitmapWidth = WTF::nullopt); > RefPtr<InjectedBundleRangeHandle> visibleRange(); > void setHTMLInputElementValueForUser(const String&); > void setHTMLInputElementSpellcheckEnabled(bool); >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp >index 980eb60e5595b6d9090dd2407d47ed4c95b8ca17..822baaf9dd2b19c4ab5c665917bbfb477353e045 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp >@@ -37,21 +37,21 @@ > namespace WebKit { > using namespace WebCore; > >-static WebMouseEvent::Button mouseButtonForMouseEventData(const std::optional<NavigationAction::MouseEventData>& mouseEventData) >+static WebMouseEvent::Button mouseButtonForMouseEventData(const Optional<NavigationAction::MouseEventData>& mouseEventData) > { > if (mouseEventData && mouseEventData->buttonDown && mouseEventData->isTrusted) > return static_cast<WebMouseEvent::Button>(mouseEventData->button); > return WebMouseEvent::NoButton; > } > >-static WebMouseEvent::SyntheticClickType syntheticClickTypeForMouseEventData(const std::optional<NavigationAction::MouseEventData>& mouseEventData) >+static WebMouseEvent::SyntheticClickType syntheticClickTypeForMouseEventData(const Optional<NavigationAction::MouseEventData>& mouseEventData) > { > if (mouseEventData && mouseEventData->buttonDown && mouseEventData->isTrusted) > return static_cast<WebMouseEvent::SyntheticClickType>(mouseEventData->syntheticClickType); > return WebMouseEvent::NoTap; > } > >-static FloatPoint clickLocationInRootViewCoordinatesForMouseEventData(const std::optional<NavigationAction::MouseEventData>& mouseEventData) >+static FloatPoint clickLocationInRootViewCoordinatesForMouseEventData(const Optional<NavigationAction::MouseEventData>& mouseEventData) > { > if (mouseEventData && mouseEventData->buttonDown && mouseEventData->isTrusted) > return mouseEventData->locationInRootViewCoordinates; >diff --git a/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp b/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp >index bb90de11fa7e0a6ef516ced25f63abfbc1a4c0e8..0be5bf34f7cf84f194bb310617cdbcd308e03aee 100644 >--- a/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp >+++ b/Source/WebKit/WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp >@@ -50,7 +50,7 @@ bool MediaDeviceSandboxExtensions::decode(IPC::Decoder& decoder, MediaDeviceSand > if (!decoder.decode(result.m_ids)) > return false; > >- std::optional<SandboxExtension::HandleArray> handles; >+ Optional<SandboxExtension::HandleArray> handles; > decoder >> handles; > if (!handles) > return false; >diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >index c75a6a58c85cde370e201506d5102ccb1d0256ef..1623b200908be20a26d90f2102a0a85e667a3379 100644 >--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >@@ -474,17 +474,17 @@ static bool shouldClearReferrerOnHTTPSToHTTPRedirect(Frame* frame) > return true; > } > >-std::optional<WebLoaderStrategy::SyncLoadResult> WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler(FrameLoader& frameLoader, ResourceLoadIdentifier identifier, const ResourceRequest& request) >+Optional<WebLoaderStrategy::SyncLoadResult> WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler(FrameLoader& frameLoader, ResourceLoadIdentifier identifier, const ResourceRequest& request) > { > auto* webFrameLoaderClient = toWebFrameLoaderClient(frameLoader.client()); > auto* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : nullptr; > auto* webPage = webFrame ? webFrame->page() : nullptr; > if (!webPage) >- return std::nullopt; >+ return WTF::nullopt; > > auto* handler = webPage->urlSchemeHandlerForScheme(request.url().protocol().toStringWithoutCopying()); > if (!handler) >- return std::nullopt; >+ return WTF::nullopt; > > LOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::scheduleLoad, sync load to URL '%s' will be handled by a UIProcess URL scheme handler.", request.url().string().utf8().data()); > >diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h >index e62052b0dbd0ceff73a206cfe73f895420ac632f..7e11820866a52c69bfe29800f3b2f810f3839507 100644 >--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h >+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h >@@ -96,7 +96,7 @@ private: > WebCore::ResourceError error; > Vector<char> data; > }; >- std::optional<SyncLoadResult> tryLoadingSynchronouslyUsingURLSchemeHandler(WebCore::FrameLoader&, ResourceLoadIdentifier, const WebCore::ResourceRequest&); >+ Optional<SyncLoadResult> tryLoadingSynchronouslyUsingURLSchemeHandler(WebCore::FrameLoader&, ResourceLoadIdentifier, const WebCore::ResourceRequest&); > > WebCore::ResourceResponse responseFromResourceLoadIdentifier(uint64_t resourceLoadIdentifier) final; > Vector<WebCore::NetworkTransactionInformation> intermediateLoadInformationFromResourceLoadIdentifier(uint64_t resourceLoadIdentifier) final; >diff --git a/Source/WebKit/WebProcess/Network/WebSocketStream.cpp b/Source/WebKit/WebProcess/Network/WebSocketStream.cpp >index 1d5e229ac23da3087e46d935565aaa4d67b5a026..f3fd61b2301fb9f3e02a7fe08c509317e9fac9bd 100644 >--- a/Source/WebKit/WebProcess/Network/WebSocketStream.cpp >+++ b/Source/WebKit/WebProcess/Network/WebSocketStream.cpp >@@ -105,7 +105,7 @@ void WebSocketStream::platformSend(const uint8_t* data, size_t length, Function< > m_sendDataCallbacks.add(dataIdentifier, WTFMove(completionHandler)); > } > >-void WebSocketStream::platformSendHandshake(const uint8_t* data, size_t length, const std::optional<CookieRequestHeaderFieldProxy>& headerFieldProxy, Function<void(bool, bool)>&& completionHandler) >+void WebSocketStream::platformSendHandshake(const uint8_t* data, size_t length, const Optional<CookieRequestHeaderFieldProxy>& headerFieldProxy, Function<void(bool, bool)>&& completionHandler) > { > static uint64_t nextDataIdentifier = 1; > uint64_t dataIdentifier = nextDataIdentifier++; >diff --git a/Source/WebKit/WebProcess/Network/WebSocketStream.h b/Source/WebKit/WebProcess/Network/WebSocketStream.h >index 389a0b98b7598cc668be8db45f1711b8fe8f770e..22f01e4036e1c58bfb83216239c7a7def55fe1fd 100644 >--- a/Source/WebKit/WebProcess/Network/WebSocketStream.h >+++ b/Source/WebKit/WebProcess/Network/WebSocketStream.h >@@ -53,7 +53,7 @@ public: > > // SocketStreamHandle > void platformSend(const uint8_t*, size_t, Function<void(bool)>&&) final; >- void platformSendHandshake(const uint8_t*, size_t, const std::optional<WebCore::CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&); >+ void platformSendHandshake(const uint8_t*, size_t, const Optional<WebCore::CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&); > void platformClose() final; > size_t bufferedAmount() final; > >diff --git a/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h b/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h >index ce705b60f1d8bc837ba145f65368ae88a1c4957c..5974a8ca43eaab3ba51611fb15244ae31b59de91 100644 >--- a/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h >+++ b/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h >@@ -95,7 +95,7 @@ private: > State m_state { STATE_BINDING }; > > static const unsigned MAX_SOCKET_OPTION { rtc::Socket::OPT_RTP_SENDTIME_EXTN_ID + 1 }; >- std::optional<int> m_options[MAX_SOCKET_OPTION]; >+ Optional<int> m_options[MAX_SOCKET_OPTION]; > > Deque<size_t> m_beingSentPacketSizes; > size_t m_availableSendingBytes { 65536 }; >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index c2cba090fbbdb2d9a190b1aff8fe355cd6fc3264..e88845740a88c66b31df7e2e4cd5268aca1c512c 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -1620,7 +1620,7 @@ bool PDFPlugin::handleContextMenuEvent(const WebMouseEvent& event) > } > PDFContextMenu contextMenu { point, WTFMove(items) }; > >- std::optional<int> selectedIndex = -1; >+ Optional<int> selectedIndex = -1; > webPage->sendSync(Messages::WebPageProxy::ShowPDFContextMenu(contextMenu), Messages::WebPageProxy::ShowPDFContextMenu::Reply(selectedIndex)); > > if (selectedIndex && *selectedIndex >= 0 && *selectedIndex < itemCount) >diff --git a/Source/WebKit/WebProcess/Plugins/PluginView.cpp b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >index 4495c991122d0843dab0c84da60ba5a7c97ba6c8..554c18c95c53df243d18ab786bb2ff7673625304 100644 >--- a/Source/WebKit/WebProcess/Plugins/PluginView.cpp >+++ b/Source/WebKit/WebProcess/Plugins/PluginView.cpp >@@ -1193,7 +1193,7 @@ void PluginView::performFrameLoadURLRequest(URLRequest* request) > return; > } > >- UserGestureIndicator gestureIndicator(request->allowPopups() ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt); >+ UserGestureIndicator gestureIndicator(request->allowPopups() ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt); > > // First, try to find a target frame. > Frame* targetFrame = frame->loader().findFrameForNavigation(request->target()); >@@ -1477,7 +1477,7 @@ bool PluginView::evaluate(NPObject* npObject, const String& scriptString, NPVari > // protect the plug-in view from destruction. > NPRuntimeObjectMap::PluginProtector pluginProtector(&m_npRuntimeObjectMap); > >- UserGestureIndicator gestureIndicator(allowPopups ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt); >+ UserGestureIndicator gestureIndicator(allowPopups ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt); > return m_npRuntimeObjectMap.evaluate(npObject, scriptString, result); > } > >diff --git a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp >index 3f70b1e87b9afe8f3f065a419ccdb952ceffce64..5455b30f40e2dc0f7e3d51248167cbe630c9f46f 100644 >--- a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp >+++ b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp >@@ -99,7 +99,7 @@ void WebPluginInfoProvider::refreshPlugins() > #endif > } > >-Vector<PluginInfo> WebPluginInfoProvider::pluginInfo(Page& page, std::optional<Vector<SupportedPluginIdentifier>>& supportedPluginIdentifiers) >+Vector<PluginInfo> WebPluginInfoProvider::pluginInfo(Page& page, Optional<Vector<SupportedPluginIdentifier>>& supportedPluginIdentifiers) > { > #if ENABLE(NETSCAPE_PLUGIN_API) > populatePluginCache(page); >@@ -117,7 +117,7 @@ Vector<PluginInfo> WebPluginInfoProvider::pluginInfo(Page& page, std::optional<V > > Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(Page& page, const URL& url) > { >- std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers; >+ Optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers; > auto plugins = pluginInfo(page, supportedPluginIdentifiers); > > plugins.removeAllMatching([&] (auto& plugin) { >@@ -171,7 +171,7 @@ void WebPluginInfoProvider::populatePluginCache(const WebCore::Page& page) > #endif > > #if PLATFORM(MAC) >-std::optional<WebCore::PluginLoadClientPolicy> WebPluginInfoProvider::pluginLoadClientPolicyForHost(const String& host, const WebCore::PluginInfo& info) const >+Optional<WebCore::PluginLoadClientPolicy> WebPluginInfoProvider::pluginLoadClientPolicyForHost(const String& host, const WebCore::PluginInfo& info) const > { > String hostToLookUp = host; > String identifier = info.bundleIdentifier; >@@ -188,7 +188,7 @@ std::optional<WebCore::PluginLoadClientPolicy> WebPluginInfoProvider::pluginLoad > } > } > if (policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& policiesByIdentifier = policiesByIdentifierIterator->value; > >@@ -202,7 +202,7 @@ std::optional<WebCore::PluginLoadClientPolicy> WebPluginInfoProvider::pluginLoad > } > > if (identifierPolicyIterator == policiesByIdentifier.end()) >- return std::nullopt; >+ return WTF::nullopt; > > auto& versionsToPolicies = identifierPolicyIterator->value; > >@@ -216,7 +216,7 @@ std::optional<WebCore::PluginLoadClientPolicy> WebPluginInfoProvider::pluginLoad > } > > if (policyIterator == versionsToPolicies.end()) >- return std::nullopt; >+ return WTF::nullopt; > > return policyIterator->value; > } >diff --git a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h >index 84642d7fc011f8cacf641bb1aee8f282393c07e8..3f9a0b8f8be88bef2e2a2b0bd3b5506f519eed41 100644 >--- a/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h >+++ b/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h >@@ -45,7 +45,7 @@ public: > private: > WebPluginInfoProvider(); > >- Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; >+ Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, Optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; > Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const URL&) final; > void refreshPlugins() override; > >@@ -54,7 +54,7 @@ private: > #endif // ENABLE(NETSCAPE_PLUGIN_API) > > #if PLATFORM(MAC) >- std::optional<WebCore::PluginLoadClientPolicy> pluginLoadClientPolicyForHost(const String&, const WebCore::PluginInfo&) const; >+ Optional<WebCore::PluginLoadClientPolicy> pluginLoadClientPolicyForHost(const String&, const WebCore::PluginInfo&) const; > String longestMatchedWildcardHostForHost(const String& host) const; > bool replaceHostWithMatchedWildcardHost(String& host, const String& identifier) const; > >@@ -68,7 +68,7 @@ private: > bool m_shouldRefreshPlugins { false }; > Vector<WebCore::PluginInfo> m_cachedPlugins; > Vector<WebCore::PluginInfo> m_cachedApplicationPlugins; >- std::optional<Vector<WebCore::SupportedPluginIdentifier>> m_cachedSupportedPluginIdentifiers; >+ Optional<Vector<WebCore::SupportedPluginIdentifier>> m_cachedSupportedPluginIdentifiers; > #endif > }; > >diff --git a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >index ada110232b1a09fde856b4d0959d216e7e93909a..30f0322facb1aab752c1ac3865af3c24d0adb27f 100644 >--- a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >+++ b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >@@ -84,7 +84,7 @@ void ServiceWorkerClientFetch::start() > } > > // https://fetch.spec.whatwg.org/#http-fetch step 3.3 >-std::optional<ResourceError> ServiceWorkerClientFetch::validateResponse(const ResourceResponse& response) >+Optional<ResourceError> ServiceWorkerClientFetch::validateResponse(const ResourceResponse& response) > { > // FIXME: make a better error reporting. > if (response.type() == ResourceResponse::Type::Error) >@@ -101,7 +101,7 @@ std::optional<ResourceError> ServiceWorkerClientFetch::validateResponse(const Re > if ((options.redirect != FetchOptions::Redirect::Follow || options.mode == FetchOptions::Mode::Navigate) && response.isRedirected()) > return ResourceError { errorDomainWebKitInternal, 0, response.url(), "Response served by service worker has redirections"_s, ResourceError::Type::AccessControl }; > >- return std::nullopt; >+ return WTF::nullopt; > } > > void ServiceWorkerClientFetch::didReceiveResponse(ResourceResponse&& response) >diff --git a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h >index aec641e97b8a7cd79fea60c421b717ea565e67fc..736b3ac03bc7229be9e4ead365ad9c7255cc4125 100644 >--- a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h >+++ b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h >@@ -59,7 +59,7 @@ public: > private: > ServiceWorkerClientFetch(WebServiceWorkerProvider&, Ref<WebCore::ResourceLoader>&&, WebCore::FetchIdentifier, Ref<WebSWClientConnection>&&, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&&); > >- std::optional<WebCore::ResourceError> validateResponse(const WebCore::ResourceResponse&); >+ Optional<WebCore::ResourceError> validateResponse(const WebCore::ResourceResponse&); > > void didReceiveResponse(WebCore::ResourceResponse&&); > void didReceiveData(const IPC::DataReference&, int64_t encodedDataLength); >diff --git a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp >index 9861591c06589fb611ed2236a7fe40037e79c5da..574c920ec30562405bdfbd7a9ee927bd597462cf 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp >+++ b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp >@@ -93,7 +93,7 @@ void WebSWClientConnection::postMessageToServiceWorker(ServiceWorkerIdentifier d > WebProcess::singleton().send(Messages::WebProcessPool::PostMessageToServiceWorker(destinationIdentifier, WTFMove(message), sourceIdentifier, serverConnectionIdentifier()), 0); > } > >-void WebSWClientConnection::registerServiceWorkerClient(const SecurityOrigin& topOrigin, const WebCore::ServiceWorkerClientData& data, const std::optional<WebCore::ServiceWorkerRegistrationIdentifier>& controllingServiceWorkerRegistrationIdentifier) >+void WebSWClientConnection::registerServiceWorkerClient(const SecurityOrigin& topOrigin, const WebCore::ServiceWorkerClientData& data, const Optional<WebCore::ServiceWorkerRegistrationIdentifier>& controllingServiceWorkerRegistrationIdentifier) > { > send(Messages::WebSWServerConnection::RegisterServiceWorkerClient { topOrigin.data(), data, controllingServiceWorkerRegistrationIdentifier }); > } >@@ -128,7 +128,7 @@ void WebSWClientConnection::setSWOriginTableIsImported() > m_tasksPendingOriginImport.takeFirst()(); > } > >-void WebSWClientConnection::didMatchRegistration(uint64_t matchingRequest, std::optional<ServiceWorkerRegistrationData>&& result) >+void WebSWClientConnection::didMatchRegistration(uint64_t matchingRequest, Optional<ServiceWorkerRegistrationData>&& result) > { > ASSERT(isMainThread()); > >@@ -149,7 +149,7 @@ void WebSWClientConnection::matchRegistration(SecurityOriginData&& topOrigin, co > ASSERT(isMainThread()); > > if (!mayHaveServiceWorkerRegisteredForOrigin(topOrigin)) { >- callback(std::nullopt); >+ callback(WTF::nullopt); > return; > } > >@@ -217,7 +217,7 @@ void WebSWClientConnection::connectionToServerLost() > { > auto registrationTasks = WTFMove(m_ongoingMatchRegistrationTasks); > for (auto& callback : registrationTasks.values()) >- callback(std::nullopt); >+ callback(WTF::nullopt); > > auto getRegistrationTasks = WTFMove(m_ongoingGetRegistrationsTasks); > for (auto& callback : getRegistrationTasks.values()) >diff --git a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >index dcd6da5806bb332c24ffec8518ee5096cbae7f83..b92eebff90f9bcd34488da7e4967b9d34989251b 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >+++ b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >@@ -76,11 +76,11 @@ private: > void scheduleJobInServer(const WebCore::ServiceWorkerJobData&) final; > void finishFetchingScriptInServer(const WebCore::ServiceWorkerFetchResult&) final; > void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destinationIdentifier, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source) final; >- void registerServiceWorkerClient(const WebCore::SecurityOrigin& topOrigin, const WebCore::ServiceWorkerClientData&, const std::optional<WebCore::ServiceWorkerRegistrationIdentifier>&) final; >+ void registerServiceWorkerClient(const WebCore::SecurityOrigin& topOrigin, const WebCore::ServiceWorkerClientData&, const Optional<WebCore::ServiceWorkerRegistrationIdentifier>&) final; > void unregisterServiceWorkerClient(WebCore::DocumentIdentifier) final; > > void matchRegistration(WebCore::SecurityOriginData&& topOrigin, const URL& clientURL, RegistrationCallback&&) final; >- void didMatchRegistration(uint64_t matchRequestIdentifier, std::optional<WebCore::ServiceWorkerRegistrationData>&&); >+ void didMatchRegistration(uint64_t matchRequestIdentifier, Optional<WebCore::ServiceWorkerRegistrationData>&&); > void didGetRegistrations(uint64_t matchRequestIdentifier, Vector<WebCore::ServiceWorkerRegistrationData>&&); > void whenRegistrationReady(const WebCore::SecurityOrigin& topOrigin, const URL& clientURL, WhenRegistrationReadyCallback&&) final; > void registrationReady(uint64_t callbackID, WebCore::ServiceWorkerRegistrationData&&); >diff --git a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in >index b9c66368efec4254583ae2e6b5549d81dc73752a..5a4ace4e09b954a1fc2741a3ca97779096658c6c 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in >+++ b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in >@@ -28,7 +28,7 @@ messages -> WebSWClientConnection { > RegistrationJobResolvedInServer(WebCore::ServiceWorkerJobIdentifier jobDataIdentifier, struct WebCore::ServiceWorkerRegistrationData registration, enum:bool WebCore::ShouldNotifyWhenResolved shouldNotifyWhenResolved) > UnregistrationJobResolvedInServer(WebCore::ServiceWorkerJobIdentifier jobDataIdentifier, bool unregistrationResult) > StartScriptFetchForServer(WebCore::ServiceWorkerJobIdentifier jobDataIdentifier, WebCore::ServiceWorkerRegistrationKey registrationKey, WebCore::FetchOptions::Cache cachePolicy) >- UpdateRegistrationState(WebCore::ServiceWorkerRegistrationIdentifier identifier, enum:uint8_t WebCore::ServiceWorkerRegistrationState state, std::optional<WebCore::ServiceWorkerData> serviceWorkerIdentifier) >+ UpdateRegistrationState(WebCore::ServiceWorkerRegistrationIdentifier identifier, enum:uint8_t WebCore::ServiceWorkerRegistrationState state, Optional<WebCore::ServiceWorkerData> serviceWorkerIdentifier) > UpdateWorkerState(WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, enum:uint8_t WebCore::ServiceWorkerState state) > FireUpdateFoundEvent(WebCore::ServiceWorkerRegistrationIdentifier identifier) > SetRegistrationLastUpdateTime(WebCore::ServiceWorkerRegistrationIdentifier identifier, WallTime lastUpdateTime) >@@ -39,7 +39,7 @@ messages -> WebSWClientConnection { > SetSWOriginTableSharedMemory(WebKit::SharedMemory::Handle handle) > PostMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, struct WebCore::MessageWithMessagePorts message, struct WebCore::ServiceWorkerData source, String sourceOrigin) > >- DidMatchRegistration(uint64_t matchRequestIdentifier, std::optional<WebCore::ServiceWorkerRegistrationData> data) >+ DidMatchRegistration(uint64_t matchRequestIdentifier, Optional<WebCore::ServiceWorkerRegistrationData> data) > DidGetRegistrations(uint64_t matchRequestIdentifier, Vector<WebCore::ServiceWorkerRegistrationData> registrations) > RegistrationReady(uint64_t registrationReadyRequestIdentifier, struct WebCore::ServiceWorkerRegistrationData data) > } >diff --git a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp >index 04e9aa7d9977a6f076aef6ccd0bce16a411fb358..ef65c42e3b02032413c89a1150958a070fbecd32 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp >+++ b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp >@@ -94,8 +94,8 @@ private: > bool shouldUseCredentialStorage(DocumentLoader*, unsigned long) final { return true; } > > PAL::SessionID sessionID() const final { return m_sessionID; } >- std::optional<uint64_t> pageID() const final { return m_pageID; } >- std::optional<uint64_t> frameID() const final { return m_frameID; } >+ Optional<uint64_t> pageID() const final { return m_pageID; } >+ Optional<uint64_t> frameID() const final { return m_frameID; } > String userAgent(const URL&) final { return m_userAgent; } > > WebSWContextManagerConnection& m_connection; >@@ -168,7 +168,7 @@ void WebSWContextManagerConnection::removeFrameLoaderClient(ServiceWorkerFrameLo > ASSERT_UNUSED(result, result); > } > >-void WebSWContextManagerConnection::serviceWorkerStartedWithMessage(std::optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const String& exceptionMessage) >+void WebSWContextManagerConnection::serviceWorkerStartedWithMessage(Optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const String& exceptionMessage) > { > if (exceptionMessage.isEmpty()) > m_connectionToNetworkProcess->send(Messages::WebSWServerToContextConnection::ScriptContextStarted(jobDataIdentifier, serviceWorkerIdentifier), 0); >@@ -225,7 +225,7 @@ void WebSWContextManagerConnection::startFetch(SWServerConnectionIdentifier serv > } > > auto client = WebServiceWorkerFetchTaskClient::create(m_connectionToNetworkProcess.copyRef(), serviceWorkerIdentifier, serverConnectionIdentifier, fetchIdentifier); >- std::optional<ServiceWorkerClientIdentifier> clientId; >+ Optional<ServiceWorkerClientIdentifier> clientId; > if (options.clientIdentifier) > clientId = ServiceWorkerClientIdentifier { serverConnectionIdentifier, options.clientIdentifier.value() }; > >@@ -265,7 +265,7 @@ void WebSWContextManagerConnection::postMessageToServiceWorkerClient(const Servi > WebProcess::singleton().send(Messages::WebProcessPool::PostMessageToServiceWorkerClient(destinationIdentifier, WTFMove(message), sourceIdentifier, sourceOrigin), 0); > } > >-void WebSWContextManagerConnection::didFinishInstall(std::optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, bool wasSuccessful) >+void WebSWContextManagerConnection::didFinishInstall(Optional<ServiceWorkerJobDataIdentifier> jobDataIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, bool wasSuccessful) > { > m_connectionToNetworkProcess->send(Messages::WebSWServerToContextConnection::DidFinishInstall(jobDataIdentifier, serviceWorkerIdentifier, wasSuccessful), 0); > } >@@ -304,7 +304,7 @@ void WebSWContextManagerConnection::findClientByIdentifier(WebCore::ServiceWorke > m_connectionToNetworkProcess->send(Messages::WebSWServerToContextConnection::FindClientByIdentifier { requestIdentifier, serviceWorkerIdentifier, clientIdentifier }, 0); > } > >-void WebSWContextManagerConnection::findClientByIdentifierCompleted(uint64_t requestIdentifier, std::optional<ServiceWorkerClientData>&& clientData, bool hasSecurityError) >+void WebSWContextManagerConnection::findClientByIdentifierCompleted(uint64_t requestIdentifier, Optional<ServiceWorkerClientData>&& clientData, bool hasSecurityError) > { > if (auto callback = m_findClientByIdentifierRequests.take(requestIdentifier)) { > if (hasSecurityError) { >diff --git a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >index d9794699c91dc5d756dc33bdb2545c5f5dc0414d..307f087ba58fba0e5bb0c330fe84169a879dab27 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >+++ b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >@@ -64,7 +64,7 @@ private: > > // WebCore::SWContextManager::Connection. > void postMessageToServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier& destinationIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin) final; >- void didFinishInstall(std::optional<WebCore::ServiceWorkerJobDataIdentifier>, WebCore::ServiceWorkerIdentifier, bool wasSuccessful) final; >+ void didFinishInstall(Optional<WebCore::ServiceWorkerJobDataIdentifier>, WebCore::ServiceWorkerIdentifier, bool wasSuccessful) final; > void didFinishActivation(WebCore::ServiceWorkerIdentifier) final; > void setServiceWorkerHasPendingEvents(WebCore::ServiceWorkerIdentifier, bool) final; > void workerTerminated(WebCore::ServiceWorkerIdentifier) final; >@@ -75,7 +75,7 @@ private: > void setScriptResource(WebCore::ServiceWorkerIdentifier, const URL&, const WebCore::ServiceWorkerContextData::ImportedScript&) final; > > // IPC messages. >- void serviceWorkerStartedWithMessage(std::optional<WebCore::ServiceWorkerJobDataIdentifier>, WebCore::ServiceWorkerIdentifier, const String& exceptionMessage) final; >+ void serviceWorkerStartedWithMessage(Optional<WebCore::ServiceWorkerJobDataIdentifier>, WebCore::ServiceWorkerIdentifier, const String& exceptionMessage) final; > void installServiceWorker(const WebCore::ServiceWorkerContextData&, PAL::SessionID); > void startFetch(WebCore::SWServerConnectionIdentifier, WebCore::ServiceWorkerIdentifier, WebCore::FetchIdentifier, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&, String&& referrer); > void cancelFetch(WebCore::SWServerConnectionIdentifier, WebCore::ServiceWorkerIdentifier, WebCore::FetchIdentifier); >@@ -84,7 +84,7 @@ private: > void fireActivateEvent(WebCore::ServiceWorkerIdentifier); > void terminateWorker(WebCore::ServiceWorkerIdentifier); > void syncTerminateWorker(WebCore::ServiceWorkerIdentifier, Messages::WebSWContextManagerConnection::SyncTerminateWorker::DelayedReply&&); >- void findClientByIdentifierCompleted(uint64_t requestIdentifier, std::optional<WebCore::ServiceWorkerClientData>&&, bool hasSecurityError); >+ void findClientByIdentifierCompleted(uint64_t requestIdentifier, Optional<WebCore::ServiceWorkerClientData>&&, bool hasSecurityError); > void matchAllCompleted(uint64_t matchAllRequestIdentifier, Vector<WebCore::ServiceWorkerClientData>&&); > void claimCompleted(uint64_t claimRequestIdentifier); > void didFinishSkipWaiting(uint64_t callbackID); >diff --git a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in >index be0d593a68a791f14586f6f950c2d679ebe5e01b..04e07a8f0abc65417a3ac28aad616335779cb692 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in >+++ b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in >@@ -31,7 +31,7 @@ messages -> WebSWContextManagerConnection { > FireActivateEvent(WebCore::ServiceWorkerIdentifier identifier) > TerminateWorker(WebCore::ServiceWorkerIdentifier identifier) > SyncTerminateWorker(WebCore::ServiceWorkerIdentifier identifier) -> () Delayed >- FindClientByIdentifierCompleted(uint64_t clientIdRequestIdentifier, std::optional<WebCore::ServiceWorkerClientData> data, bool hasSecurityError) >+ FindClientByIdentifierCompleted(uint64_t clientIdRequestIdentifier, Optional<WebCore::ServiceWorkerClientData> data, bool hasSecurityError) > MatchAllCompleted(uint64_t matchAllRequestIdentifier, Vector<WebCore::ServiceWorkerClientData> clientsData) > ClaimCompleted(uint64_t claimRequestIdentifier) > DidFinishSkipWaiting(uint64_t callbackID) >diff --git a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp >index 2d3705493914fa179a4ef54e50ff69354d6809a4..6f4300678105eb34c456dd48e4c50ce1ce00449a 100644 >--- a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp >+++ b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp >@@ -93,7 +93,7 @@ void WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish(Ref<FormData>& > m_blobLoader.emplace(*this); > auto loader = serviceWorkerThreadProxy->createBlobLoader(*m_blobLoader, blobURL); > if (!loader) { >- m_blobLoader = std::nullopt; >+ m_blobLoader = WTF::nullopt; > didFail(internalError(blobURL)); > return; > } >@@ -114,7 +114,7 @@ void WebServiceWorkerFetchTaskClient::didFinishBlobLoading() > { > didFinish(); > >- std::exchange(m_blobLoader, std::nullopt); >+ std::exchange(m_blobLoader, WTF::nullopt); > } > > void WebServiceWorkerFetchTaskClient::didFail(const ResourceError& error) >diff --git a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h >index 36e05ac97b10241757acd7c4ea2555a13d8f5951..53303c8da6c14f0316996fd13aa57aaaef6478e8 100644 >--- a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h >+++ b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h >@@ -78,7 +78,7 @@ private: > WebCore::SWServerConnectionIdentifier m_serverConnectionIdentifier; > WebCore::ServiceWorkerIdentifier m_serviceWorkerIdentifier; > WebCore::FetchIdentifier m_fetchIdentifier; >- std::optional<BlobLoader> m_blobLoader; >+ Optional<BlobLoader> m_blobLoader; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index b31b117f0edab398b25124064e16227faf786255..0264d74bda0323f8ed4e904e3159ed2e647ca3fe 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -1061,7 +1061,7 @@ void WebChromeClient::recommendedScrollbarStyleDidChange(ScrollbarStyle newStyle > m_page.send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(static_cast<int32_t>(newStyle))); > } > >-std::optional<ScrollbarOverlayStyle> WebChromeClient::preferredScrollbarOverlayStyle() >+Optional<ScrollbarOverlayStyle> WebChromeClient::preferredScrollbarOverlayStyle() > { > return m_page.scrollbarOverlayStyle(); > } >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >index 4315126b0648e3447fc0b9cfbc88023c001bfca9..9473ca3c83c47450ec4ff096210fe07c9b0f540c 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >@@ -298,7 +298,7 @@ private: > void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&) final; > void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle newStyle) final; > >- std::optional<WebCore::ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() final; >+ Optional<WebCore::ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() final; > > WebCore::Color underlayColor() const final; > >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index d05fc996c1d4ed9f756fc885e93cd65b2c45d02c..ca08f488e975be36614bbb3cc5d339b810470cca 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -112,20 +112,20 @@ WebFrameLoaderClient::~WebFrameLoaderClient() > { > } > >-std::optional<uint64_t> WebFrameLoaderClient::pageID() const >+Optional<uint64_t> WebFrameLoaderClient::pageID() const > { > if (m_frame && m_frame->page()) > return m_frame->page()->pageID(); > >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<uint64_t> WebFrameLoaderClient::frameID() const >+Optional<uint64_t> WebFrameLoaderClient::frameID() const > { > if (m_frame) > return m_frame->frameID(); > >- return std::nullopt; >+ return WTF::nullopt; > } > > PAL::SessionID WebFrameLoaderClient::sessionID() const >@@ -503,7 +503,7 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& ti > webPage->send(Messages::WebPageProxy::DidReceiveTitleForFrame(m_frame->frameID(), truncatedTitle.string, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))); > } > >-void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent> hasInsecureContent) >+void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent> hasInsecureContent) > { > WebPage* webPage = m_frame->page(); > if (!webPage) >@@ -893,7 +893,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const Navigat > uint64_t newNavigationID; > WebPolicyAction policyAction; > DownloadID downloadID; >- std::optional<WebsitePoliciesData> websitePolicies; >+ Optional<WebsitePoliciesData> websitePolicies; > > if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForNavigationActionSync(m_frame->frameID(), m_frame->isMainFrame(), SecurityOriginData::fromFrame(coreFrame), documentLoader->navigationID(), navigationActionData, originatingFrameInfoData, originatingPageID, navigationAction.resourceRequest(), request, IPC::FormDataReference { request.httpBody() }, redirectResponse, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForNavigationActionSync::Reply(policyAction, newNavigationID, downloadID, websitePolicies))) { > m_frame->didReceivePolicyDecision(listenerID, WebPolicyAction::Ignore, 0, { }, { }); >@@ -1861,7 +1861,7 @@ void WebFrameLoaderClient::didCreateWindow(DOMWindow& window) > } > > #if ENABLE(APPLICATION_MANIFEST) >-void WebFrameLoaderClient::finishedLoadingApplicationManifest(uint64_t callbackIdentifier, const std::optional<WebCore::ApplicationManifest>& manifest) >+void WebFrameLoaderClient::finishedLoadingApplicationManifest(uint64_t callbackIdentifier, const Optional<WebCore::ApplicationManifest>& manifest) > { > WebPage* webPage = m_frame->page(); > if (!webPage) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >index 7fb514770128e73f4c2eef4301bbcae9a6985e01..c988177b15445b37fe9196c38de7f2c2160dc0df 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >@@ -51,8 +51,8 @@ public: > > void applyToDocumentLoader(WebsitePoliciesData&&); > >- std::optional<uint64_t> pageID() const final; >- std::optional<uint64_t> frameID() const final; >+ Optional<uint64_t> pageID() const final; >+ Optional<uint64_t> frameID() const final; > PAL::SessionID sessionID() const final; > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >@@ -111,7 +111,7 @@ private: > void dispatchWillClose() final; > void dispatchDidStartProvisionalLoad(CompletionHandler<void()>&&) final; > void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) final; >- void dispatchDidCommitLoad(std::optional<WebCore::HasInsecureContent>) final; >+ void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) final; > void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) final; > void dispatchDidFailLoad(const WebCore::ResourceError&) final; > void dispatchDidFinishDocumentLoad() final; >@@ -273,7 +273,7 @@ private: > void didCreateWindow(WebCore::DOMWindow&) final; > > #if ENABLE(APPLICATION_MANIFEST) >- void finishedLoadingApplicationManifest(uint64_t, const std::optional<WebCore::ApplicationManifest>&) final; >+ void finishedLoadingApplicationManifest(uint64_t, const Optional<WebCore::ApplicationManifest>&) final; > #endif > > WebFrame* m_frame; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.cpp >index bf4820a0a1de0ad0a21b7467ee27416e6c32a056..826b7ac01213d09640d3869faee814c0efbfd34e 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.cpp >@@ -63,10 +63,10 @@ void WebGeolocationClient::setEnableHighAccuracy(bool enabled) > WebProcess::singleton().supplement<WebGeolocationManager>()->setEnableHighAccuracyForPage(m_page, enabled); > } > >-std::optional<GeolocationPosition> WebGeolocationClient::lastPosition() >+Optional<GeolocationPosition> WebGeolocationClient::lastPosition() > { > // FIXME: Implement this. >- return std::nullopt; >+ return WTF::nullopt; > } > > void WebGeolocationClient::requestPermission(Geolocation& geolocation) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.h >index cfe8d424859d8f1170fa89e7694060b7820d3905..30f5ad6b4bc2a638d6037f8ec973809df6e56b18 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.h >@@ -47,7 +47,7 @@ private: > void stopUpdating() override; > void setEnableHighAccuracy(bool) override; > >- std::optional<WebCore::GeolocationPosition> lastPosition() override; >+ Optional<WebCore::GeolocationPosition> lastPosition() override; > > void requestPermission(WebCore::Geolocation&) override; > void cancelPermissionRequest(WebCore::Geolocation&) override; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >index f9b0ceef9cf0bfaf34f64da8b31607847142a0a3..5b6f4e4b2dc9dad78fe0e68e3da8212af86a2436 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp >@@ -107,7 +107,7 @@ BlobRegistry* WebPlatformStrategies::createBlobRegistry() > > // CookiesStrategy > >-std::pair<String, bool> WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > String cookieString; > bool secureCookiesAccessed = false; >@@ -117,7 +117,7 @@ std::pair<String, bool> WebPlatformStrategies::cookiesForDOM(const NetworkStorag > return { cookieString, secureCookiesAccessed }; > } > >-void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& cookieString) >+void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& cookieString) > { > WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(session.sessionID(), firstParty, sameSiteInfo, url, frameID, pageID, cookieString), 0); > } >@@ -130,12 +130,12 @@ bool WebPlatformStrategies::cookiesEnabled(const NetworkStorageSession& session) > return result; > } > >-std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > return cookieRequestHeaderFieldValue(session.sessionID(), firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > String cookieString; > bool secureCookiesAccessed = false; >@@ -144,7 +144,7 @@ std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(PAL > return { cookieString, secureCookiesAccessed }; > } > >-bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) >+bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) > { > if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(session.sessionID(), firstParty, sameSiteInfo, url, frameID, pageID), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0)) > return false; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h >index d69337b7a7804bf15333603ace74083c48ae071d..5770554a5be36c1bdea85ebb6616e6091a321a91 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h >@@ -47,12 +47,12 @@ private: > WebCore::BlobRegistry* createBlobRegistry() override; > > // WebCore::CookiesStrategy >- std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) override; >+ std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String&) override; > bool cookiesEnabled(const WebCore::NetworkStorageSession&) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; > void deleteCookie(const WebCore::NetworkStorageSession&, const URL&, const String&) override; > > // WebCore::PasteboardStrategy >diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.h b/Source/WebKit/WebProcess/WebPage/DrawingArea.h >index af555caf6ec7a9450d9389f8ca30f760ac04d382..f9c89174a4a37bf4db22c1d2c42624cf9df2a742 100644 >--- a/Source/WebKit/WebProcess/WebPage/DrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.h >@@ -92,8 +92,8 @@ public: > virtual void mainFrameContentSizeChanged(const WebCore::IntSize&) { } > > #if PLATFORM(COCOA) >- virtual void setViewExposedRect(std::optional<WebCore::FloatRect>) = 0; >- virtual std::optional<WebCore::FloatRect> viewExposedRect() const = 0; >+ virtual void setViewExposedRect(Optional<WebCore::FloatRect>) = 0; >+ virtual Optional<WebCore::FloatRect> viewExposedRect() const = 0; > > virtual void acceleratedAnimationDidStart(uint64_t /*layerID*/, const String& /*key*/, MonotonicTime /*startTime*/) { } > virtual void acceleratedAnimationDidEnd(uint64_t /*layerID*/, const String& /*key*/) { } >diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in b/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in >index 3fd9862e4cab0ca3aa8376c69f3106cc6c5a51bc..023304051429df930ae678f3907615dd98e3d121 100644 >--- a/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in >@@ -29,7 +29,7 @@ messages -> DrawingArea { > UpdateGeometry(WebCore::IntSize viewSize, bool flushSynchronously, MachSendRight fencePort) > SetDeviceScaleFactor(float deviceScaleFactor) > SetColorSpace(struct WebKit::ColorSpaceData colorSpace) >- SetViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect) >+ SetViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect) > > AdjustTransientZoom(double scale, WebCore::FloatPoint origin) > CommitTransientZoom(double scale, WebCore::FloatPoint origin) >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h >index a3ba308e7521383a40220d85f3fa172b170cea65..85320ab998a5720d8e1cff15939a8570274d0aab 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h >@@ -230,7 +230,7 @@ public: > } > > void encode(IPC::Encoder&) const; >- static std::optional<KeyframeValue> decode(IPC::Decoder&); >+ static Optional<KeyframeValue> decode(IPC::Decoder&); > > private: > KeyframeType keyType; >@@ -262,7 +262,7 @@ public: > } > > void encode(IPC::Encoder&) const; >- static std::optional<Properties> decode(IPC::Decoder&); >+ static Optional<Properties> decode(IPC::Decoder&); > > String keyPath; > PlatformCAAnimation::AnimationType animationType; >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm >index d4b3d17c8e1b37dd011ad8809f41bb31e125e895..1def0940b1d2df47daa6656d1b26ebfdb87f488e 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm >@@ -120,32 +120,32 @@ void PlatformCAAnimationRemote::KeyframeValue::encode(IPC::Encoder& encoder) con > } > } > >-std::optional<PlatformCAAnimationRemote::KeyframeValue> PlatformCAAnimationRemote::KeyframeValue::decode(IPC::Decoder& decoder) >+Optional<PlatformCAAnimationRemote::KeyframeValue> PlatformCAAnimationRemote::KeyframeValue::decode(IPC::Decoder& decoder) > { > PlatformCAAnimationRemote::KeyframeValue value; > if (!decoder.decodeEnum(value.keyType)) >- return std::nullopt; >+ return WTF::nullopt; > > switch (value.keyType) { > case NumberKeyType: > if (!decoder.decode(value.number)) >- return std::nullopt; >+ return WTF::nullopt; > break; > case ColorKeyType: > if (!decoder.decode(value.color)) >- return std::nullopt; >+ return WTF::nullopt; > break; > case PointKeyType: > if (!decoder.decode(value.point)) >- return std::nullopt; >+ return WTF::nullopt; > break; > case TransformKeyType: > if (!decoder.decode(value.transform)) >- return std::nullopt; >+ return WTF::nullopt; > break; > case FilterKeyType: > if (!decodeFilterOperation(decoder, value.filter)) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > >@@ -197,60 +197,60 @@ void PlatformCAAnimationRemote::Properties::encode(IPC::Encoder& encoder) const > } > } > >-std::optional<PlatformCAAnimationRemote::Properties> PlatformCAAnimationRemote::Properties::decode(IPC::Decoder& decoder) >+Optional<PlatformCAAnimationRemote::Properties> PlatformCAAnimationRemote::Properties::decode(IPC::Decoder& decoder) > { > PlatformCAAnimationRemote::Properties properties; > if (!decoder.decode(properties.keyPath)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(properties.animationType)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.beginTime)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.duration)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.timeOffset)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.repeatCount)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.speed)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(properties.fillMode)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decodeEnum(properties.valueFunction)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.autoReverses)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.removedOnCompletion)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.additive)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.reverseTimingFunctions)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.hasExplicitBeginTime)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.keyValues)) >- return std::nullopt; >+ return WTF::nullopt; > > if (!decoder.decode(properties.keyTimes)) >- return std::nullopt; >+ return WTF::nullopt; > > uint64_t numTimingFunctions; > if (!decoder.decode(numTimingFunctions)) >- return std::nullopt; >+ return WTF::nullopt; > > if (numTimingFunctions) { > properties.timingFunctions.reserveInitialCapacity(numTimingFunctions); >@@ -259,32 +259,32 @@ std::optional<PlatformCAAnimationRemote::Properties> PlatformCAAnimationRemote:: > > TimingFunction::TimingFunctionType type; > if (!decoder.decodeEnum(type)) >- return std::nullopt; >+ return WTF::nullopt; > > RefPtr<TimingFunction> timingFunction; > switch (type) { > case TimingFunction::LinearFunction: > timingFunction = LinearTimingFunction::create(); > if (!decoder.decode(*static_cast<LinearTimingFunction*>(timingFunction.get()))) >- return std::nullopt; >+ return WTF::nullopt; > break; > > case TimingFunction::CubicBezierFunction: > timingFunction = CubicBezierTimingFunction::create(); > if (!decoder.decode(*static_cast<CubicBezierTimingFunction*>(timingFunction.get()))) >- return std::nullopt; >+ return WTF::nullopt; > break; > > case TimingFunction::StepsFunction: > timingFunction = StepsTimingFunction::create(); > if (!decoder.decode(*static_cast<StepsTimingFunction*>(timingFunction.get()))) >- return std::nullopt; >+ return WTF::nullopt; > break; > > case TimingFunction::SpringFunction: > timingFunction = SpringTimingFunction::create(); > if (!decoder.decode(*static_cast<SpringTimingFunction*>(timingFunction.get()))) >- return std::nullopt; >+ return WTF::nullopt; > break; > } > >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h >index a86346e5e1e55ede0dd8a82e1a7045dbf2e9c0fc..ccfaab8fd46b8bef6828de5bc43ae4cca87f033d 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h >@@ -86,8 +86,8 @@ private: > void forceRepaint() override; > bool forceRepaintAsync(CallbackID) override { return false; } > >- void setViewExposedRect(std::optional<WebCore::FloatRect>) override; >- std::optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; } >+ void setViewExposedRect(Optional<WebCore::FloatRect>) override; >+ Optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; } > > void acceleratedAnimationDidStart(uint64_t layerID, const String& key, MonotonicTime startTime) override; > void acceleratedAnimationDidEnd(uint64_t layerID, const String& key) override; >@@ -145,8 +145,8 @@ private: > > WebCore::IntSize m_viewSize; > >- std::optional<WebCore::FloatRect> m_viewExposedRect; >- std::optional<WebCore::FloatRect> m_scrolledViewExposedRect; >+ Optional<WebCore::FloatRect> m_viewExposedRect; >+ Optional<WebCore::FloatRect> m_scrolledViewExposedRect; > > WebCore::Timer m_layerFlushTimer; > bool m_isFlushingSuspended { false }; >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >index 80bd2139587b315df176d620b4589dc36599a2f6..6e5d531591c43defb031367348878897ca3d439e 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >@@ -215,7 +215,7 @@ void RemoteLayerTreeDrawingArea::acceleratedAnimationDidEnd(uint64_t layerID, co > m_remoteLayerTreeContext->animationDidEnd(layerID, key); > } > >-void RemoteLayerTreeDrawingArea::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect) >+void RemoteLayerTreeDrawingArea::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect) > { > m_viewExposedRect = viewExposedRect; > updateScrolledExposedRect(); >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm >index 18ef16481b45644a6d06f1a3b0e87dd06e031d43..9bc51caba9a4007ce74dda0e1cdba4a53543db6d 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm >@@ -96,7 +96,7 @@ void RemoteScrollingCoordinator::buildTransaction(RemoteScrollingCoordinatorTran > // Notification from the UI process that we scrolled. > void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool syncLayerPosition) > { >- scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, std::nullopt, false /* FIXME */, syncLayerPosition ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set); >+ scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, WTF::nullopt, false /* FIXME */, syncLayerPosition ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set); > } > > void RemoteScrollingCoordinator::currentSnapPointIndicesChangedForNode(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical) >diff --git a/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp b/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp >index 1f0d81ad94bea8b068379f1b0f1f6a1148cbf772..c3a79786a0ac04889eb881a7f523b2c412753db2 100644 >--- a/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp >+++ b/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp >@@ -138,7 +138,7 @@ struct FontSizeAndCount { > unsigned count; > }; > >-std::optional<std::pair<double, double>> ViewGestureGeometryCollector::computeTextLegibilityScales(double& viewportMinimumScale, double& viewportMaximumScale) >+Optional<std::pair<double, double>> ViewGestureGeometryCollector::computeTextLegibilityScales(double& viewportMinimumScale, double& viewportMaximumScale) > { > static const unsigned fontSizeBinningInterval = 2; > static const double maximumNumberOfTextRunsToConsider = 200; >@@ -153,7 +153,7 @@ std::optional<std::pair<double, double>> ViewGestureGeometryCollector::computeTe > > auto document = makeRefPtr(m_webPage.mainFrame()->document()); > if (!document) >- return std::nullopt; >+ return WTF::nullopt; > > document->updateLayoutIgnorePendingStylesheets(); > >diff --git a/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.h b/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.h >index 42b6d1c31a4321118a2df9436fcbbc81527f3e16..6fb456632b705e67d9315875a8f7300e63577dcb 100644 >--- a/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.h >+++ b/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.h >@@ -65,7 +65,7 @@ private: > void computeMinimumAndMaximumViewportScales(double& viewportMinimumScale, double& viewportMaximumScale) const; > > #if PLATFORM(IOS_FAMILY) >- std::optional<std::pair<double, double>> computeTextLegibilityScales(double& viewportMinimumScale, double& viewportMaximumScale); >+ Optional<std::pair<double, double>> computeTextLegibilityScales(double& viewportMinimumScale, double& viewportMaximumScale); > #endif > > WebPage& m_webPage; >@@ -74,7 +74,7 @@ private: > uint64_t m_renderTreeSizeNotificationThreshold; > #endif > #if PLATFORM(IOS_FAMILY) >- std::optional<std::pair<double, double>> m_cachedTextLegibilityScales; >+ Optional<std::pair<double, double>> m_cachedTextLegibilityScales; > #endif > }; > >diff --git a/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp b/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp >index 417624d219f10de8058376b2adeca9de2256a8bf..211d601ef0b44f52aa2de963e8453f86c52f8fd4 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp >@@ -115,7 +115,7 @@ RefPtr<HistoryItem> WebBackForwardListProxy::itemAtIndex(int itemIndex) > if (!m_page) > return nullptr; > >- std::optional<BackForwardItemIdentifier> itemID; >+ Optional<BackForwardItemIdentifier> itemID; > if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::BackForwardItemAtIndex(itemIndex), Messages::WebPageProxy::BackForwardItemAtIndex::Reply(itemID), m_page->pageID())) > return nullptr; > >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >index 189d1a188b24b6446d0527df8650f0a1a386810b..f40b84b47a8267881dcbe277fa5c1bf5cb4200e3 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >@@ -270,7 +270,7 @@ static WebCore::PolicyAction toPolicyAction(WebPolicyAction policyAction) > return WebCore::PolicyAction::Ignore; > } > >-void WebFrame::didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction action, uint64_t navigationID, DownloadID downloadID, std::optional<WebsitePoliciesData>&& websitePolicies) >+void WebFrame::didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction action, uint64_t navigationID, DownloadID downloadID, Optional<WebsitePoliciesData>&& websitePolicies) > { > if (!m_coreFrame || !m_policyListenerID || listenerID != m_policyListenerID || !m_policyFunction) { > if (action == WebPolicyAction::Suspend) >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.h b/Source/WebKit/WebProcess/WebPage/WebFrame.h >index 82bcb6d879dd24e9faa52fa3566b7d5b66a2fff1..6199e0ba4a3fc88c8e6af1fc708ea5f2d37012ff 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.h >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.h >@@ -87,7 +87,7 @@ public: > enum class ForNavigationAction { No, Yes }; > uint64_t setUpPolicyListener(WebCore::FramePolicyFunction&&, ForNavigationAction); > void invalidatePolicyListener(); >- void didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction, uint64_t navigationID, DownloadID, std::optional<WebsitePoliciesData>&&); >+ void didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction, uint64_t navigationID, DownloadID, Optional<WebsitePoliciesData>&&); > > uint64_t setUpWillSubmitFormListener(CompletionHandler<void()>&&); > void continueWillSubmitForm(uint64_t); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index be6befb8147865fc0e81e81223b6c496ab7f1bd5..a87c529e44441327a00a98c0254f11fac2a46cd6 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -538,7 +538,7 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters) > if (parameters.scrollbarOverlayStyle) > m_scrollbarOverlayStyle = static_cast<ScrollbarOverlayStyle>(parameters.scrollbarOverlayStyle.value()); > else >- m_scrollbarOverlayStyle = std::optional<ScrollbarOverlayStyle>(); >+ m_scrollbarOverlayStyle = Optional<ScrollbarOverlayStyle>(); > > setTopContentInset(parameters.topContentInset); > >@@ -1379,7 +1379,7 @@ void WebPage::loadRequest(LoadParameters&& loadParameters) > ASSERT(!m_pendingWebsitePolicies); > } > >-void WebPage::loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& websitePolicies, Ref<SharedBuffer>&& sharedBuffer, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& unreachableURL, const UserData& userData) >+void WebPage::loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies, Ref<SharedBuffer>&& sharedBuffer, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& unreachableURL, const UserData& userData) > { > SendStopResponsivenessTimer stopper; > >@@ -1481,7 +1481,7 @@ void WebPage::reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExten > } > } > >-void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemIdentifier& backForwardItemID, FrameLoadType backForwardType, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&& websitePolicies) >+void WebPage::goToBackForwardItem(uint64_t navigationID, const BackForwardItemIdentifier& backForwardItemID, FrameLoadType backForwardType, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies) > { > SendStopResponsivenessTimer stopper; > >@@ -3029,7 +3029,7 @@ void WebPage::setSessionID(PAL::SessionID sessionID) > m_page->setSessionID(sessionID); > } > >-void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction policyAction, uint64_t navigationID, const DownloadID& downloadID, std::optional<WebsitePoliciesData>&& websitePolicies) >+void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction policyAction, uint64_t navigationID, const DownloadID& downloadID, Optional<WebsitePoliciesData>&& websitePolicies) > { > WebFrame* frame = WebProcess::singleton().webFrame(frameID); > if (!frame) >@@ -3174,7 +3174,7 @@ KeyboardUIMode WebPage::keyboardUIMode() > return static_cast<KeyboardUIMode>((fullKeyboardAccessEnabled ? KeyboardAccessFull : KeyboardAccessDefault) | (m_tabToLinks ? KeyboardAccessTabsToLinks : 0)); > } > >-void WebPage::runJavaScript(const String& script, bool forceUserGesture, std::optional<String> worldName, CallbackID callbackID) >+void WebPage::runJavaScript(const String& script, bool forceUserGesture, Optional<String> worldName, CallbackID callbackID) > { > // NOTE: We need to be careful when running scripts that the objects we depend on don't > // disappear during script execution. >@@ -3200,7 +3200,7 @@ void WebPage::runJavaScript(const String& script, bool forceUserGesture, std::op > > void WebPage::runJavaScriptInMainFrame(const String& script, bool forceUserGesture, CallbackID callbackID) > { >- runJavaScript(script, forceUserGesture, std::nullopt, callbackID); >+ runJavaScript(script, forceUserGesture, WTF::nullopt, callbackID); > } > > void WebPage::runJavaScriptInMainFrameScriptWorld(const String& script, bool forceUserGesture, const String& worldName, CallbackID callbackID) >@@ -3498,7 +3498,7 @@ void WebPage::willCommitLayerTree(RemoteLayerTreeTransaction& layerTransaction) > layerTransaction.setAllowsUserScaling(allowsUserScaling()); > if (m_pendingDynamicViewportSizeUpdateID) { > layerTransaction.setDynamicViewportSizeUpdateID(*m_pendingDynamicViewportSizeUpdateID); >- m_pendingDynamicViewportSizeUpdateID = std::nullopt; >+ m_pendingDynamicViewportSizeUpdateID = WTF::nullopt; > } > if (m_lastTransactionPageScaleFactor != layerTransaction.pageScaleFactor()) { > m_lastTransactionPageScaleFactor = layerTransaction.pageScaleFactor(); >@@ -5410,7 +5410,7 @@ void WebPage::setAutoSizingShouldExpandToViewHeight(bool shouldExpand) > corePage()->mainFrame().view()->setAutoSizeFixedMinimumHeight(shouldExpand ? m_viewSize.height() : 0); > } > >-void WebPage::setViewportSizeForCSSViewportUnits(std::optional<WebCore::IntSize> viewportSize) >+void WebPage::setViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize> viewportSize) > { > if (m_viewportSizeForCSSViewportUnits == viewportSize) > return; >@@ -5968,12 +5968,12 @@ void WebPage::setScrollPinningBehavior(uint32_t pinning) > m_page->mainFrame().view()->setScrollPinningBehavior(m_scrollPinningBehavior); > } > >-void WebPage::setScrollbarOverlayStyle(std::optional<uint32_t> scrollbarStyle) >+void WebPage::setScrollbarOverlayStyle(Optional<uint32_t> scrollbarStyle) > { > if (scrollbarStyle) > m_scrollbarOverlayStyle = static_cast<ScrollbarOverlayStyle>(scrollbarStyle.value()); > else >- m_scrollbarOverlayStyle = std::optional<ScrollbarOverlayStyle>(); >+ m_scrollbarOverlayStyle = Optional<ScrollbarOverlayStyle>(); > m_page->mainFrame().view()->recalculateScrollbarOverlayStyle(); > } > >@@ -5989,7 +5989,7 @@ Ref<DocumentLoader> WebPage::createDocumentLoader(Frame& frame, const ResourceRe > > if (m_pendingWebsitePolicies) { > WebsitePoliciesData::applyToDocumentLoader(WTFMove(*m_pendingWebsitePolicies), documentLoader); >- m_pendingWebsitePolicies = std::nullopt; >+ m_pendingWebsitePolicies = WTF::nullopt; > } > } > >@@ -6376,14 +6376,14 @@ void WebPage::didCompleteShareSheet(bool wasGranted, ShareSheetCallbackID callba > > #if ENABLE(ATTACHMENT_ELEMENT) > >-void WebPage::insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID callbackID) >+void WebPage::insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID callbackID) > { > auto& frame = m_page->focusController().focusedOrMainFrame(); > frame.editor().insertAttachment(identifier, WTFMove(fileSize), fileName, contentType); > send(Messages::WebPageProxy::VoidCallback(callbackID)); > } > >-void WebPage::updateAttachmentAttributes(const String& identifier, std::optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID callbackID) >+void WebPage::updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID callbackID) > { > if (auto attachment = attachmentElementWithIdentifier(identifier)) { > attachment->document().updateLayout(); >@@ -6413,20 +6413,20 @@ void WebPage::getApplicationManifest(CallbackID callbackID) > DocumentLoader* loader = mainFrameDocument ? mainFrameDocument->loader() : nullptr; > > if (!loader) { >- send(Messages::WebPageProxy::ApplicationManifestCallback(std::nullopt, callbackID)); >+ send(Messages::WebPageProxy::ApplicationManifestCallback(WTF::nullopt, callbackID)); > return; > } > > auto coreCallbackID = loader->loadApplicationManifest(); > if (!coreCallbackID) { >- send(Messages::WebPageProxy::ApplicationManifestCallback(std::nullopt, callbackID)); >+ send(Messages::WebPageProxy::ApplicationManifestCallback(WTF::nullopt, callbackID)); > return; > } > > m_applicationManifestFetchCallbackMap.add(coreCallbackID, callbackID.toInteger()); > } > >-void WebPage::didFinishLoadingApplicationManifest(uint64_t coreCallbackID, const std::optional<WebCore::ApplicationManifest>& manifest) >+void WebPage::didFinishLoadingApplicationManifest(uint64_t coreCallbackID, const Optional<WebCore::ApplicationManifest>& manifest) > { > auto callbackID = CallbackID::fromInteger(m_applicationManifestFetchCallbackMap.take(coreCallbackID)); > send(Messages::WebPageProxy::ApplicationManifestCallback(manifest, callbackID)); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 4770868074548087b73c36c658b0edfb4e0a6b24..d69fabac912562b22125c6a2b90312dcfdec3424 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -921,9 +921,9 @@ public: > void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&, double scaleFactor, double minimumEffectiveDeviceWidth); > void setMaximumUnobscuredSize(const WebCore::FloatSize&); > void setDeviceOrientation(int32_t); >- void setOverrideViewportArguments(const std::optional<WebCore::ViewportArguments>&); >+ void setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>&); > void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, DynamicViewportSizeUpdateID); >- std::optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const; >+ Optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const; > void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp); > bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; } > void willStartUserTriggeredZooming(); >@@ -990,8 +990,8 @@ public: > void setAutoSizingShouldExpandToViewHeight(bool shouldExpand); > bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; } > >- void setViewportSizeForCSSViewportUnits(std::optional<WebCore::IntSize>); >- std::optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; } >+ void setViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize>); >+ Optional<WebCore::IntSize> viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits; } > > bool canShowMIMEType(const String& MIMEType) const; > bool canShowResponse(const WebCore::ResourceResponse&) const; >@@ -1022,8 +1022,8 @@ public: > WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; } > void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning); > >- std::optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; } >- void setScrollbarOverlayStyle(std::optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle); >+ Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; } >+ void setScrollbarOverlayStyle(Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle); > > Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&); > void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&); >@@ -1096,7 +1096,7 @@ public: > WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&); > void stopAllURLSchemeTasks(); > >- std::optional<double> cpuLimit() const { return m_cpuLimit; } >+ Optional<double> cpuLimit() const { return m_cpuLimit; } > > static PluginView* pluginViewForFrame(WebCore::Frame*); > >@@ -1113,13 +1113,13 @@ public: > void didCompleteShareSheet(bool wasCompleted, ShareSheetCallbackID contextId); > > #if ENABLE(ATTACHMENT_ELEMENT) >- void insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID); >- void updateAttachmentAttributes(const String& identifier, std::optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID); >+ void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID); >+ void updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID); > #endif > > #if ENABLE(APPLICATION_MANIFEST) > void getApplicationManifest(CallbackID); >- void didFinishLoadingApplicationManifest(uint64_t, const std::optional<WebCore::ApplicationManifest>&); >+ void didFinishLoadingApplicationManifest(uint64_t, const Optional<WebCore::ApplicationManifest>&); > #endif > > void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers); >@@ -1196,7 +1196,7 @@ private: > > String sourceForFrame(WebFrame*); > >- void loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&); >+ void loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&); > > // Actions > void tryClose(); >@@ -1206,7 +1206,7 @@ private: > void loadAlternateHTML(LoadParameters&&); > void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint); > void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&); >- void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, std::optional<WebsitePoliciesData>&&); >+ void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&); > void tryRestoreScrollPosition(); > void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID); > void updateIsInWindow(bool isInitialState = false); >@@ -1278,7 +1278,7 @@ private: > void getSelectionAsWebArchiveData(CallbackID); > void getSourceForFrame(uint64_t frameID, CallbackID); > void getWebArchiveOfFrame(uint64_t frameID, CallbackID); >- void runJavaScript(const String&, bool forceUserGesture, std::optional<String> worldName, CallbackID); >+ void runJavaScript(const String&, bool forceUserGesture, Optional<String> worldName, CallbackID); > void runJavaScriptInMainFrame(const String&, bool forceUserGesture, CallbackID); > void runJavaScriptInMainFrameScriptWorld(const String&, bool forceUserGesture, const String& worldName, CallbackID); > void forceRepaint(CallbackID); >@@ -1294,7 +1294,7 @@ private: > bool parentProcessHasServiceWorkerEntitlement() const { return true; } > #endif > >- void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction, uint64_t navigationID, const DownloadID&, std::optional<WebsitePoliciesData>&&); >+ void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction, uint64_t navigationID, const DownloadID&, Optional<WebsitePoliciesData>&&); > void continueWillSubmitForm(uint64_t frameID, uint64_t listenerID); > void setUserAgent(const String&); > void setCustomTextEncodingName(const String&); >@@ -1667,7 +1667,7 @@ private: > > WebCore::IntSize m_viewLayoutSize; > bool m_autoSizingShouldExpandToViewHeight { false }; >- std::optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits; >+ Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits; > > bool m_userIsInteracting { false }; > bool m_isAssistingNodeDueToUserInteraction { false }; >@@ -1723,7 +1723,7 @@ private: > WebCore::FloatPoint m_pendingSyntheticClickLocation; > WebCore::FloatRect m_previousExposedContentRect; > uint64_t m_currentAssistedNodeIdentifier { 0 }; >- std::optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID; >+ Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID; > double m_lastTransactionPageScaleFactor { 0 }; > uint64_t m_lastTransactionIDWithScaleChange { 0 }; > #endif >@@ -1739,7 +1739,7 @@ private: > unsigned m_maximumRenderingSuppressionToken { 0 }; > > WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin }; >- std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle; >+ Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle; > > bool m_useAsyncScrolling { false }; > >@@ -1750,7 +1750,7 @@ private: > PAL::HysteresisActivity m_userActivityHysteresis; > > uint64_t m_pendingNavigationID { 0 }; >- std::optional<WebsitePoliciesData> m_pendingWebsitePolicies; >+ Optional<WebsitePoliciesData> m_pendingWebsitePolicies; > > bool m_mainFrameProgressCompleted { false }; > bool m_shouldDispatchFakeMouseMoveEvents { true }; >@@ -1775,7 +1775,7 @@ private: > WebCore::UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { WebCore::UserInterfaceLayoutDirection::LTR }; > > const String m_overrideContentSecurityPolicy; >- const std::optional<double> m_cpuLimit; >+ const Optional<double> m_cpuLimit; > > HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap; > HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap; >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index 529aa78280b92fb8b61f59710b4761d8253933af..bc9e3ec085cfd2996d91832f7e40d3ec3b61bd42 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -48,7 +48,7 @@ messages -> WebPage LegacyReceiver { > SetViewportConfigurationViewLayoutSize(WebCore::FloatSize size, double scaleFactor, double minimumEffectiveDeviceWidth) > SetMaximumUnobscuredSize(WebCore::FloatSize size) > SetDeviceOrientation(int32_t deviceOrientation) >- SetOverrideViewportArguments(std::optional<WebCore::ViewportArguments> arguments) >+ SetOverrideViewportArguments(Optional<WebCore::ViewportArguments> arguments) > DynamicViewportSizeUpdate(WebCore::FloatSize viewLayoutSize, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, WebCore::RectEdges<float> targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID) > > HandleTap(WebCore::IntPoint point, uint64_t lastLayerTreeTransactionId) >@@ -145,7 +145,7 @@ messages -> WebPage LegacyReceiver { > ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity) > CenterSelectionInVisibleArea() > >- GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum:uint8_t WebCore::FrameLoadType backForwardType, enum:bool WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebKit::WebsitePoliciesData> websitePolicies) >+ GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum:uint8_t WebCore::FrameLoadType backForwardType, enum:bool WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<WebKit::WebsitePoliciesData> websitePolicies) > TryRestoreScrollPosition() > > LoadURLInFrame(URL url, uint64_t frameID) >@@ -167,7 +167,7 @@ messages -> WebPage LegacyReceiver { > DidRemoveBackForwardItem(struct WebCore::BackForwardItemIdentifier backForwardItemID) > > UpdateWebsitePolicies(struct WebKit::WebsitePoliciesData websitePolicies) >- DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, enum:uint8_t WebKit::WebPolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) >+ DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, enum:uint8_t WebKit::WebPolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, Optional<WebKit::WebsitePoliciesData> websitePolicies) > ContinueWillSubmitForm(uint64_t frameID, uint64_t listenerID) > > ClearSelection() >@@ -439,7 +439,7 @@ messages -> WebPage LegacyReceiver { > SetViewLayoutSize(WebCore::IntSize viewLayoutSize) > SetAutoSizingShouldExpandToViewHeight(bool shouldExpand) > >- SetViewportSizeForCSSViewportUnits(std::optional<WebCore::IntSize> viewportSize) >+ SetViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize> viewportSize) > > #if PLATFORM(COCOA) > HandleAlternativeTextUIResult(String result) >@@ -450,7 +450,7 @@ messages -> WebPage LegacyReceiver { > #endif > > SetScrollPinningBehavior(uint32_t pinning) >- SetScrollbarOverlayStyle(std::optional<uint32_t> scrollbarStyle) >+ SetScrollbarOverlayStyle(Optional<uint32_t> scrollbarStyle) > > GetBytecodeProfile(WebKit::CallbackID callbackID) > >@@ -532,8 +532,8 @@ messages -> WebPage LegacyReceiver { > #endif > > #if ENABLE(ATTACHMENT_ELEMENT) >- InsertAttachment(String identifier, std::optional<uint64_t> fileSize, String fileName, String contentType, WebKit::CallbackID callbackID) >- UpdateAttachmentAttributes(String identifier, std::optional<uint64_t> fileSize, String contentType, String fileName, IPC::SharedBufferDataReference enclosingImageData, WebKit::CallbackID callbackID) >+ InsertAttachment(String identifier, Optional<uint64_t> fileSize, String fileName, String contentType, WebKit::CallbackID callbackID) >+ UpdateAttachmentAttributes(String identifier, Optional<uint64_t> fileSize, String contentType, String fileName, IPC::SharedBufferDataReference enclosingImageData, WebKit::CallbackID callbackID) > #endif > > #if ENABLE(APPLICATION_MANIFEST) >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 9df618a4d9ad8e9b1d63206c60051dafb76db235..9f91731f43bfb11224757efb1017e4625c148f7f 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -341,7 +341,7 @@ void WebPage::restorePageState(const HistoryItem& historyItem) > float boundedScale = std::min<float>(m_viewportConfiguration.maximumScale(), std::max<float>(m_viewportConfiguration.minimumScale(), historyItem.pageScaleFactor())); > scalePage(boundedScale, IntPoint()); > >- std::optional<FloatPoint> scrollPosition; >+ Optional<FloatPoint> scrollPosition; > if (historyItem.shouldRestoreScrollPosition()) { > m_drawingArea->setExposedContentRect(historyItem.exposedContentRect()); > scrollPosition = FloatPoint(historyItem.scrollPosition()); >@@ -354,7 +354,7 @@ void WebPage::restorePageState(const HistoryItem& historyItem) > > double newScale = scaleAfterViewportWidthChange(historyItem.pageScaleFactor(), !historyItem.scaleIsInitial(), m_viewportConfiguration, currentMinimumLayoutSizeInScrollViewCoordinates.width(), newContentSize, oldContentSize, visibleHorizontalFraction); > >- std::optional<FloatPoint> newCenter; >+ Optional<FloatPoint> newCenter; > if (historyItem.shouldRestoreScrollPosition()) { > if (!oldContentSize.isEmpty() && !newContentSize.isEmpty() && newContentSize != oldContentSize) > newCenter = relativeCenterAfterContentSizeChange(historyItem.unobscuredContentRect(), oldContentSize, newContentSize); >@@ -674,7 +674,7 @@ void WebPage::requestAdditionalItemsForDragSession(const IntPoint& clientPositio > > void WebPage::didConcludeEditDataInteraction() > { >- std::optional<TextIndicatorData> textIndicatorData; >+ Optional<TextIndicatorData> textIndicatorData; > > static auto defaultEditDataInteractionTextIndicatorOptions = TextIndicatorOptionIncludeSnapshotOfAllVisibleContentWithoutSelection | TextIndicatorOptionExpandClipBeyondVisibleRect | TextIndicatorOptionPaintAllContent | TextIndicatorOptionIncludeMarginIfRangeMatchesSelection | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionComputeEstimatedBackgroundColor| TextIndicatorOptionUseSelectionRectForSizing | TextIndicatorOptionIncludeSnapshotWithSelectionHighlight; > auto& frame = m_page->focusController().focusedOrMainFrame(); >@@ -2590,7 +2590,7 @@ void WebPage::setDeviceOrientation(int32_t deviceOrientation) > m_page->mainFrame().orientationChanged(); > } > >-void WebPage::setOverrideViewportArguments(const std::optional<WebCore::ViewportArguments>& arguments) >+void WebPage::setOverrideViewportArguments(const Optional<WebCore::ViewportArguments>& arguments) > { > if (auto* document = m_page->mainFrame().document()) > document->setOverrideViewportArguments(arguments); >@@ -2925,11 +2925,11 @@ static inline void adjustVelocityDataForBoundedScale(double& horizontalVelocity, > scaleChangeRate = 0; > } > >-std::optional<float> WebPage::scaleFromUIProcess(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo) const >+Optional<float> WebPage::scaleFromUIProcess(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo) const > { > auto transactionIDForLastScaleFromUIProcess = visibleContentRectUpdateInfo.lastLayerTreeTransactionID(); > if (m_lastTransactionIDWithScaleChange > transactionIDForLastScaleFromUIProcess) >- return std::nullopt; >+ return WTF::nullopt; > > float scaleFromUIProcess = visibleContentRectUpdateInfo.scale(); > float currentScale = m_page->pageScaleFactor(); >@@ -2943,7 +2943,7 @@ std::optional<float> WebPage::scaleFromUIProcess(const VisibleContentRectUpdateI > > scaleFromUIProcess = std::min<float>(m_viewportConfiguration.maximumScale(), std::max<float>(m_viewportConfiguration.minimumScale(), scaleFromUIProcess)); > if (areEssentiallyEqualAsFloat(currentScale, scaleFromUIProcess)) >- return std::nullopt; >+ return WTF::nullopt; > > return scaleFromUIProcess; > } >@@ -3041,7 +3041,7 @@ void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visi > if (visibleContentRectUpdateInfo.unobscuredContentRect() != visibleContentRectUpdateInfo.unobscuredContentRectRespectingInputViewBounds()) > frameView.setVisualViewportOverrideRect(LayoutRect(visibleContentRectUpdateInfo.unobscuredContentRectRespectingInputViewBounds())); > else >- frameView.setVisualViewportOverrideRect(std::nullopt); >+ frameView.setVisualViewportOverrideRect(WTF::nullopt); > > LOG_WITH_STREAM(VisibleRects, stream << "WebPage::updateVisibleContentRects - setLayoutViewportOverrideRect " << visibleContentRectUpdateInfo.customFixedPositionRect()); > frameView.setLayoutViewportOverrideRect(LayoutRect(visibleContentRectUpdateInfo.customFixedPositionRect())); >diff --git a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h >index b1ed5c1fc81d333814bb003dae62692f2c64a51f..debb9907e63b9c05595f126d90d5d00b677dba71 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h >+++ b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h >@@ -72,8 +72,8 @@ private: > void updatePreferences(const WebPreferencesStore&) override; > void mainFrameContentSizeChanged(const WebCore::IntSize&) override; > >- void setViewExposedRect(std::optional<WebCore::FloatRect>) override; >- std::optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; } >+ void setViewExposedRect(Optional<WebCore::FloatRect>) override; >+ Optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; } > > bool supportsAsyncScrolling() override { return true; } > >@@ -148,8 +148,8 @@ private: > > bool m_isPaintingSuspended; > >- std::optional<WebCore::FloatRect> m_viewExposedRect; >- std::optional<WebCore::FloatRect> m_scrolledViewExposedRect; >+ Optional<WebCore::FloatRect> m_viewExposedRect; >+ Optional<WebCore::FloatRect> m_scrolledViewExposedRect; > > WebCore::IntSize m_lastSentIntrinsicContentSize; > bool m_inUpdateGeometry; >diff --git a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >index d2555c19908aba66a24c1c1bdd156f2d3d290483..d58dd9c4c7aae279239154883d82e3df381219ee 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >@@ -558,7 +558,7 @@ void TiledCoreAnimationDrawingArea::resumePainting() > [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidResumeNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]]; > } > >-void TiledCoreAnimationDrawingArea::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect) >+void TiledCoreAnimationDrawingArea::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect) > { > m_viewExposedRect = viewExposedRect; > updateScrolledExposedRect(); >diff --git a/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.cpp b/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.cpp >index 510be22da312fb4c52206e6aad30d32fa9de87ec..9fb0104dee70616545846a2f21ae167cf682e5ba 100644 >--- a/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.cpp >+++ b/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.cpp >@@ -48,7 +48,7 @@ void CompositingManager::establishConnection(WebPage& webPage) > int CompositingManager::releaseConnectionFd() > { > int fd = m_connectionFd.value_or(-1); >- m_connectionFd = std::nullopt; >+ m_connectionFd = WTF::nullopt; > return fd; > } > >diff --git a/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.h b/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.h >index bd2f2f614392e981b7abae139ed260efaca9835c..d6adf2c756c9600868e55c885c82880d6130f05b 100644 >--- a/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.h >+++ b/Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.h >@@ -42,7 +42,7 @@ public: > int releaseConnectionFd(); > > private: >- std::optional<int> m_connectionFd; >+ Optional<int> m_connectionFd; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h >index 9172ee1c7a631127e392102a9b523cc7f3e692ae..e6308ff4a34fb4d93102e3b823db057f54c72daa 100644 >--- a/Source/WebKit/WebProcess/WebProcess.h >+++ b/Source/WebKit/WebProcess/WebProcess.h >@@ -465,7 +465,7 @@ private: > bool m_suppressMemoryPressureHandler { false }; > #if PLATFORM(MAC) > std::unique_ptr<WebCore::CPUMonitor> m_cpuMonitor; >- std::optional<double> m_cpuLimit; >+ Optional<double> m_cpuLimit; > > enum class ProcessType { Inspector, ServiceWorker, PrewarmedWebContent, WebContent }; > ProcessType m_processType { ProcessType::WebContent }; >diff --git a/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp b/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp >index 5e5e159fd43ea9a779239d8bd98b407f12bf2c97..de25c69e9129d5d3181dd7bab7fd54b3ffaf948e 100644 >--- a/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp >+++ b/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp >@@ -190,7 +190,7 @@ private: > > uint64_t m_id; > UserMediaCaptureManager& m_manager; >- mutable std::optional<RealtimeMediaSourceCapabilities> m_capabilities; >+ mutable Optional<RealtimeMediaSourceCapabilities> m_capabilities; > RealtimeMediaSourceSettings m_settings; > > CAAudioStreamDescription m_description; >diff --git a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >index 2f2496bf4ab188ce0f8033a27ae8fbfce279f380..c2ea1c3fbc14c3aa21f285267a9e4e79a41b0441 100644 >--- a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >+++ b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >@@ -521,13 +521,13 @@ void WebProcess::getActivePagesOriginsForTesting(CompletionHandler<void(Vector<S > void WebProcess::updateCPULimit() > { > #if PLATFORM(MAC) >- std::optional<double> cpuLimit; >+ Optional<double> cpuLimit; > > // Use the largest limit among all pages in this process. > for (auto& page : m_pageMap.values()) { > auto pageCPULimit = page->cpuLimit(); > if (!pageCPULimit) { >- cpuLimit = std::nullopt; >+ cpuLimit = WTF::nullopt; > break; > } > if (!cpuLimit || pageCPULimit > cpuLimit.value()) >@@ -547,7 +547,7 @@ void WebProcess::updateCPUMonitorState(CPUMonitorUpdateReason reason) > #if PLATFORM(MAC) > if (!m_cpuLimit) { > if (m_cpuMonitor) >- m_cpuMonitor->setCPULimit(std::nullopt); >+ m_cpuMonitor->setCPULimit(WTF::nullopt); > return; > } > >@@ -559,7 +559,7 @@ void WebProcess::updateCPUMonitorState(CPUMonitorUpdateReason reason) > } else if (reason == CPUMonitorUpdateReason::VisibilityHasChanged) { > // If the visibility has changed, stop the CPU monitor before setting its limit. This is needed because the CPU usage can vary wildly based on visibility and we would > // not want to report that a process has exceeded its background CPU limit even though most of the CPU time was used while the process was visible. >- m_cpuMonitor->setCPULimit(std::nullopt); >+ m_cpuMonitor->setCPULimit(WTF::nullopt); > } > m_cpuMonitor->setCPULimit(m_cpuLimit.value()); > #else >diff --git a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm >index 3912101561f5ffdf8941e9a71bfbe4b828f84b15..86b36c13465cfa4c1c7c77788a9eb63a4cc63906 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMHTMLOptionsCollection.mm >@@ -90,7 +90,7 @@ - (void)add:(DOMHTMLOptionElement *)option index:(unsigned)index > WebCore::JSMainThreadNullState state; > if (!option) > raiseTypeErrorException(); >- raiseOnDOMError(IMPL->add(core(option), std::optional<WebCore::HTMLOptionsCollection::HTMLElementOrInt> { static_cast<int>(index) })); >+ raiseOnDOMError(IMPL->add(core(option), Optional<WebCore::HTMLOptionsCollection::HTMLElementOrInt> { static_cast<int>(index) })); > } > > - (void)remove:(unsigned)index >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >index 883b9207207e248dd47a30bc0c7621e7068b7c32..608d9411a99fead500f4e19d2c77129fd84da942 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >@@ -886,7 +886,7 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri > Strong<JSGlobalObject> globalObject(vm, frame->script().globalObject(pluginWorld())); > ExecState* exec = globalObject->globalExec(); > >- UserGestureIndicator gestureIndicator(allowPopups ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt); >+ UserGestureIndicator gestureIndicator(allowPopups ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt); > > JSValue result = JSC::evaluate(exec, JSC::makeSource(script, { })); > >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >index 9a745d9383f7447f542df5045e2445b3853e0880..32c368fdea94a2fb028a2c503047a9ea0e75c09b 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >@@ -669,7 +669,7 @@ - (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect > ASSERT(_eventHandler); > { > JSC::JSLock::DropAllLocks dropAllLocks(commonVM()); >- UserGestureIndicator gestureIndicator(_eventHandler->currentEventIsUserGesture() ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt); >+ UserGestureIndicator gestureIndicator(_eventHandler->currentEventIsUserGesture() ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt); > acceptedEvent = [_pluginPackage.get() pluginFuncs]->event(plugin, event); > } > [self didCallPlugInFunction]; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >index 99910382b4fea44bb8584fafab9fbeccedf6d712..0a4217847d41fe0b9810dc639b60dc606866a9b9 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h >@@ -63,8 +63,8 @@ private: > void frameLoaderDestroyed() final; > bool hasWebView() const final; // mainly for assertions > >- std::optional<uint64_t> pageID() const final; >- std::optional<uint64_t> frameID() const final; >+ Optional<uint64_t> pageID() const final; >+ Optional<uint64_t> frameID() const final; > PAL::SessionID sessionID() const final; > > void makeRepresentation(WebCore::DocumentLoader*) final; >@@ -116,7 +116,7 @@ private: > void dispatchWillClose() final; > void dispatchDidStartProvisionalLoad(CompletionHandler<void()>&&) final; > void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) final; >- void dispatchDidCommitLoad(std::optional<WebCore::HasInsecureContent>) final; >+ void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) final; > void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) final; > void dispatchDidFailLoad(const WebCore::ResourceError&) final; > void dispatchDidFinishDocumentLoad() final; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >index ec8e58cf207bbcb04822ed2b15dead06762a567d..601885eb8d44e619bd542bac5d0406f2e23f0eda 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >@@ -204,14 +204,14 @@ WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame) > { > } > >-std::optional<uint64_t> WebFrameLoaderClient::pageID() const >+Optional<uint64_t> WebFrameLoaderClient::pageID() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<uint64_t> WebFrameLoaderClient::frameID() const >+Optional<uint64_t> WebFrameLoaderClient::frameID() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > > PAL::SessionID WebFrameLoaderClient::sessionID() const >@@ -700,7 +700,7 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& ti > } > } > >-void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent>) >+void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent>) > { > // Tell the client we've committed this URL. > ASSERT([m_webFrame->_private->webFrameView documentView] != nil); >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.h >index 72a350e93288a16e308295beaf7c2bcea7060d58..ffe299312eb480bafb5f0eac4352f243f96e00f7 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.h >@@ -47,7 +47,7 @@ public: > void setEnableHighAccuracy(bool) override { } > #endif > >- std::optional<WebCore::GeolocationPosition> lastPosition() override; >+ Optional<WebCore::GeolocationPosition> lastPosition() override; > > void requestPermission(WebCore::Geolocation&) override; > void cancelPermissionRequest(WebCore::Geolocation&) override { }; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm >index d1051f2d4d18762e675129c030c3d5ec92baecf6..cb083bfc120cc69ab286ae284417538d2ab2c472 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm >@@ -132,7 +132,7 @@ void WebGeolocationClient::requestPermission(Geolocation& geolocation) > END_BLOCK_OBJC_EXCEPTIONS; > } > >-std::optional<GeolocationPosition> WebGeolocationClient::lastPosition() >+Optional<GeolocationPosition> WebGeolocationClient::lastPosition() > { > return core([[m_webView _geolocationProvider] lastPosition]); > } >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >index 077d014d3e535c7a8abb3468e1d654e9fe9be275..09da2ee9eff4c0a7a7ebf21e30b44054eea6c049 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >@@ -37,16 +37,16 @@ private: > ~WebPaymentCoordinatorClient(); > > bool supportsVersion(unsigned) override; >- std::optional<String> validatedPaymentNetwork(const String&) override; >+ Optional<String> validatedPaymentNetwork(const String&) override; > bool canMakePayments() override; > void canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void (bool)>&& completionHandler) override; > void openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) override; > bool showPaymentUI(const URL&, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&) override; > void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override; >- void completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&&) override; >- void completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&&) override; >- void completePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate>&&) override; >- void completePaymentSession(std::optional<WebCore::PaymentAuthorizationResult>&&) override; >+ void completeShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate>&&) override; >+ void completeShippingContactSelection(Optional<WebCore::ShippingContactUpdate>&&) override; >+ void completePaymentMethodSelection(Optional<WebCore::PaymentMethodUpdate>&&) override; >+ void completePaymentSession(Optional<WebCore::PaymentAuthorizationResult>&&) override; > void abortPaymentSession() override; > void cancelPaymentSession() override; > void paymentCoordinatorDestroyed() override; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >index 30e06caf931ae066c369b735113d9c48a7bdc0d4..3b33f49f2190ca5bcdcd941930b0ca63be6b1ba4 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >@@ -43,9 +43,9 @@ bool WebPaymentCoordinatorClient::supportsVersion(unsigned) > return false; > } > >-std::optional<String> WebPaymentCoordinatorClient::validatedPaymentNetwork(const String&) >+Optional<String> WebPaymentCoordinatorClient::validatedPaymentNetwork(const String&) > { >- return std::nullopt; >+ return WTF::nullopt; > } > > bool WebPaymentCoordinatorClient::canMakePayments() >@@ -76,19 +76,19 @@ void WebPaymentCoordinatorClient::completeMerchantValidation(const WebCore::Paym > { > } > >-void WebPaymentCoordinatorClient::completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&&) >+void WebPaymentCoordinatorClient::completeShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate>&&) > { > } > >-void WebPaymentCoordinatorClient::completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&&) >+void WebPaymentCoordinatorClient::completeShippingContactSelection(Optional<WebCore::ShippingContactUpdate>&&) > { > } > >-void WebPaymentCoordinatorClient::completePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate>&&) >+void WebPaymentCoordinatorClient::completePaymentMethodSelection(Optional<WebCore::PaymentMethodUpdate>&&) > { > } > >-void WebPaymentCoordinatorClient::completePaymentSession(std::optional<WebCore::PaymentAuthorizationResult>&&) >+void WebPaymentCoordinatorClient::completePaymentSession(Optional<WebCore::PaymentAuthorizationResult>&&) > { > } > >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h >index 37e714389d704647b91ee0d6607bd78470df5e03..fe356632ba46558dda5f4d4bf4715fd57949270a 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h >@@ -48,12 +48,12 @@ private: > WebCore::BlobRegistry* createBlobRegistry() override; > > // WebCore::CookiesStrategy >- std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&) override; >+ std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String&) override; > bool cookiesEnabled(const WebCore::NetworkStorageSession&) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<WebCore::Cookie>&) override; > void deleteCookie(const WebCore::NetworkStorageSession&, const URL&, const String&) override; > > // WebCore::PasteboardStrategy >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm >index 01925eee82ce4100fd42374937868fc1564bd448..541c753b113fccfc493ca668db727dfcab521afd 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm >@@ -72,12 +72,12 @@ BlobRegistry* WebPlatformStrategies::createBlobRegistry() > return new WebCore::BlobRegistryImpl; > } > >-std::pair<String, bool> WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > return session.cookiesForDOM(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& cookieString) >+void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& cookieString) > { > session.setCookiesFromDOM(firstParty, sameSiteInfo, url, frameID, pageID, cookieString); > } >@@ -87,18 +87,18 @@ bool WebPlatformStrategies::cookiesEnabled(const NetworkStorageSession& session) > return session.cookiesEnabled(); > } > >-std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > return session.cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > auto& session = sessionID.isEphemeral() ? WebFrameNetworkingContext::ensurePrivateBrowsingSession() : NetworkStorageSession::defaultStorageSession(); > return session.cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) >+bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) > { > return session.getRawCookies(firstParty, sameSiteInfo, url, frameID, pageID, rawCookies); > } >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h >index 525ee2fcdeea16c5c6f9dfe8135ed7d1c5ebbd0f..0e918d5541ac326bfaee907e7cf05106194a2478 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h >@@ -34,7 +34,7 @@ public: > > private: > void refreshPlugins() override; >- Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; >+ Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, Optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; > Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const URL&) final; > > WebPluginInfoProvider(); >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm >index b06da6f0f0c357b00ba87491cb17bfd2fa94e362..554651cabf31aa0e52499fe6d0a44ad5bc3fd358 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm >@@ -55,7 +55,7 @@ void WebPluginInfoProvider::refreshPlugins() > [[WebPluginDatabase sharedDatabaseIfExists] refresh]; > } > >-Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& page, std::optional<Vector<SupportedPluginIdentifier>>&) >+Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& page, Optional<Vector<SupportedPluginIdentifier>>&) > { > Vector<WebCore::PluginInfo> plugins; > >@@ -76,6 +76,6 @@ Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& pag > > Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const URL&) > { >- std::optional<Vector<SupportedPluginIdentifier>> supportedPluginIdentifiers; >+ Optional<Vector<SupportedPluginIdentifier>> supportedPluginIdentifiers; > return pluginInfo(page, supportedPluginIdentifiers); > } >diff --git a/Source/WebKitLegacy/mac/WebView/WebDeviceOrientation.mm b/Source/WebKitLegacy/mac/WebView/WebDeviceOrientation.mm >index 170c3523c7c15536c28e7b5f98a33a3699480f92..63376e688afbae9ccc6a8b44ea531950616c805c 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebDeviceOrientation.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebDeviceOrientation.mm >@@ -60,10 +60,10 @@ DeviceOrientationData* core(WebDeviceOrientation* orientation) > return orientation ? orientation->m_internal->m_orientation.get() : 0; > } > >-static std::optional<double> convert(bool canProvide, double value) >+static Optional<double> convert(bool canProvide, double value) > { > if (!canProvide) >- return std::nullopt; >+ return WTF::nullopt; > return value; > } > >@@ -75,9 +75,9 @@ - (id)initWithCanProvideAlpha:(bool)canProvideAlpha alpha:(double)alpha canProvi > #if PLATFORM(IOS_FAMILY) > // We don't use this API, but make sure that it compiles with the new > // compass parameters. >- m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:DeviceOrientationData::create(convert(canProvideAlpha, alpha), convert(canProvideBeta, beta), convert(canProvideGamma, gamma), std::nullopt, std::nullopt)]; >+ m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:DeviceOrientationData::create(convert(canProvideAlpha, alpha), convert(canProvideBeta, beta), convert(canProvideGamma, gamma), WTF::nullopt, WTF::nullopt)]; > #else >- m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:DeviceOrientationData::create(convert(canProvideAlpha, alpha), convert(canProvideBeta, beta), convert(canProvideGamma, gamma), std::nullopt)]; >+ m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:DeviceOrientationData::create(convert(canProvideAlpha, alpha), convert(canProvideBeta, beta), convert(canProvideGamma, gamma), WTF::nullopt)]; > #endif > return self; > } >diff --git a/Source/WebKitLegacy/mac/WebView/WebGeolocationPosition.mm b/Source/WebKitLegacy/mac/WebView/WebGeolocationPosition.mm >index 37459c6b85847c6135aa861b514a10d64a86a1b0..d15f5f9c69eb4e6a7f3ed9faf6eef395cec1bd8a 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebGeolocationPosition.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebGeolocationPosition.mm >@@ -56,10 +56,10 @@ @end > > @implementation WebGeolocationPosition > >-std::optional<GeolocationPosition> core(WebGeolocationPosition *position) >+Optional<GeolocationPosition> core(WebGeolocationPosition *position) > { > if (!position) >- return std::nullopt; >+ return WTF::nullopt; > return position->_internal->_position; > } > >diff --git a/Source/WebKitLegacy/mac/WebView/WebGeolocationPositionInternal.h b/Source/WebKitLegacy/mac/WebView/WebGeolocationPositionInternal.h >index 26c32b126df24325fdce99b7b86a8c75982cd7f5..3476302f2d6ec36220339042f4fb2bbeb9725791 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebGeolocationPositionInternal.h >+++ b/Source/WebKitLegacy/mac/WebView/WebGeolocationPositionInternal.h >@@ -30,5 +30,5 @@ namespace WebCore { > class GeolocationPosition; > } > >-std::optional<WebCore::GeolocationPosition> core(WebGeolocationPosition *); >+Optional<WebCore::GeolocationPosition> core(WebGeolocationPosition *); > >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index 9c3c2bb99cc0c6cd3053798ddb6644c9e7db8142..aaf528c9fa9c823bac10ce07e1ca59c9344f387e 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -231,7 +231,7 @@ - (void)setMenuController:(WebCore::ContextMenuController*)menuController; > - (void)forwardContextMenuAction:(id)sender; > @end > >-static std::optional<ContextMenuAction> toAction(NSInteger tag) >+static Optional<ContextMenuAction> toAction(NSInteger tag) > { > if (tag >= ContextMenuItemBaseCustomTag && tag <= ContextMenuItemLastCustomTag) { > // Just pass these through. >@@ -406,14 +406,14 @@ static std::optional<ContextMenuAction> toAction(NSInteger tag) > case WebMenuItemTagDictationAlternative: > return ContextMenuItemTagDictationAlternative; > } >- return std::nullopt; >+ return WTF::nullopt; > } > >-static std::optional<NSInteger> toTag(ContextMenuAction action) >+static Optional<NSInteger> toTag(ContextMenuAction action) > { > switch (action) { > case ContextMenuItemTagNoAction: >- return std::nullopt; >+ return WTF::nullopt; > > case ContextMenuItemTagOpenLinkInNewWindow: > return WebMenuItemTagOpenLinkInNewWindow; >@@ -596,7 +596,7 @@ static std::optional<NSInteger> toTag(ContextMenuAction action) > ASSERT_NOT_REACHED(); > } > >- return std::nullopt; >+ return WTF::nullopt; > } > > @implementation WebMenuTarget >diff --git a/Source/WebKitLegacy/win/CFDictionaryPropertyBag.cpp b/Source/WebKitLegacy/win/CFDictionaryPropertyBag.cpp >index 4502b86285d20c85f8d75056e2f9332243e7218b..4fbc2e00f55dfe3125b335f83b10a9952c242392 100644 >--- a/Source/WebKitLegacy/win/CFDictionaryPropertyBag.cpp >+++ b/Source/WebKitLegacy/win/CFDictionaryPropertyBag.cpp >@@ -190,4 +190,4 @@ HRESULT CFDictionaryPropertyBag::Write(_In_ LPCOLESTR pszPropName, _In_ VARIANT* > return S_OK; > } > return E_FAIL; >-} >\ No newline at end of file >+} >diff --git a/Source/WebKitLegacy/win/Plugins/PluginView.cpp b/Source/WebKitLegacy/win/Plugins/PluginView.cpp >index f855dd263f79cdfd41b646595022a8c44cca2f45..95fbc5ef7b3c98db176c3d6419f0e31c281ef178 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginView.cpp >+++ b/Source/WebKitLegacy/win/Plugins/PluginView.cpp >@@ -404,7 +404,7 @@ void PluginView::performRequest(PluginRequest* request) > URL requestURL = request->frameLoadRequest().resourceRequest().url(); > String jsString = scriptStringIfJavaScriptURL(requestURL); > >- UserGestureIndicator gestureIndicator(request->shouldAllowPopups() ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt); >+ UserGestureIndicator gestureIndicator(request->shouldAllowPopups() ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : WTF::nullopt); > > if (jsString.isNull()) { > // if this is not a targeted request, create a stream for it. otherwise, >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >index 193e02b05018ef58fe416fcbfb675ede3fc5896c..808720764d764dbada5503bff8c6a2dc24eb4f4a 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -121,14 +121,14 @@ void WebFrameLoaderClient::frameLoaderDestroyed() > { > } > >-std::optional<uint64_t> WebFrameLoaderClient::pageID() const >+Optional<uint64_t> WebFrameLoaderClient::pageID() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > >-std::optional<uint64_t> WebFrameLoaderClient::frameID() const >+Optional<uint64_t> WebFrameLoaderClient::frameID() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > > PAL::SessionID WebFrameLoaderClient::sessionID() const >@@ -437,7 +437,7 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& ti > frameLoadDelegate->didReceiveTitle(webView, BString(title.string), m_webFrame); > } > >-void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent>) >+void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent>) > { > WebView* webView = m_webFrame->webView(); > COMPtr<IWebFrameLoadDelegate> frameLoadDelegate; >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >index f8d74885f06c54a43387693338c0e06324d98acb..2056ae312a53cdcdb24bcb0baad6f75c87265e61 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h >@@ -51,8 +51,8 @@ public: > > void dispatchDidFailToStartPlugin(const WebCore::PluginView*) const; > >- std::optional<uint64_t> pageID() const final; >- std::optional<uint64_t> frameID() const final; >+ Optional<uint64_t> pageID() const final; >+ Optional<uint64_t> frameID() const final; > PAL::SessionID sessionID() const final; > > bool hasWebView() const override; >@@ -93,7 +93,7 @@ public: > void dispatchWillClose() override; > void dispatchDidStartProvisionalLoad(CompletionHandler<void()>&&) override; > void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override; >- void dispatchDidCommitLoad(std::optional<WebCore::HasInsecureContent>) override; >+ void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) override; > void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) override; > void dispatchDidFailLoad(const WebCore::ResourceError&) override; > void dispatchDidFinishDocumentLoad() override; >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.cpp >index ba3f341ed1ed71fe9a50f3fa45af4591f394375f..27d785e085bf70cd7fa9f6711f984ac1ece98aa8 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.cpp >@@ -64,14 +64,14 @@ void WebGeolocationClient::stopUpdating() > provider->unregisterWebView(m_webView.get()); > } > >-std::optional<GeolocationPosition> WebGeolocationClient::lastPosition() >+Optional<GeolocationPosition> WebGeolocationClient::lastPosition() > { > COMPtr<IWebGeolocationProvider> provider; > if (FAILED(m_webView->geolocationProvider(&provider))) >- return std::nullopt; >+ return WTF::nullopt; > COMPtr<IWebGeolocationPosition> position; > if (FAILED(provider->lastPosition(&position))) >- return std::nullopt; >+ return WTF::nullopt; > return core(position.get()); > } > >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.h >index f62f5c0de13af833e6cb867f732ef5595fb98655..eb9758bd42107d2f9a854e4e688166a6f515fb9f 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebGeolocationClient.h >@@ -43,7 +43,7 @@ public: > void startUpdating() final; > void stopUpdating() final; > void setEnableHighAccuracy(bool) final { } >- std::optional<WebCore::GeolocationPosition> lastPosition() final; >+ Optional<WebCore::GeolocationPosition> lastPosition() final; > > void requestPermission(WebCore::Geolocation&) final; > void cancelPermissionRequest(WebCore::Geolocation&) final { } >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp >index 7eb6c5641816720130387129c116371f78cef0cf..f6abd996126a9622c4b0fd3620d6459930fff320 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp >@@ -69,12 +69,12 @@ BlobRegistry* WebPlatformStrategies::createBlobRegistry() > return new BlobRegistryImpl; > } > >-std::pair<String, bool> WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > return session.cookiesForDOM(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String& cookieString) >+void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String& cookieString) > { > session.setCookiesFromDOM(firstParty, sameSiteInfo, url, frameID, pageID, cookieString); > } >@@ -84,18 +84,18 @@ bool WebPlatformStrategies::cookiesEnabled(const NetworkStorageSession& session) > return session.cookiesEnabled(); > } > >-std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > return session.cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) >+std::pair<String, bool> WebPlatformStrategies::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) > { > auto& session = sessionID.isEphemeral() ? WebFrameNetworkingContext::ensurePrivateBrowsingSession() : NetworkStorageSession::defaultStorageSession(); > return session.cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); > } > >-bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<Cookie>& rawCookies) >+bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& rawCookies) > { > return session.getRawCookies(firstParty, sameSiteInfo, url, frameID, pageID, rawCookies); > } >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h >index be24cb8a56859cd43ce19f0a17bbf81da7c99f1a..f411c2c7ba8a458cb151ded10c1eaade5cb663e5 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h >@@ -45,11 +45,11 @@ private: > virtual WebCore::BlobRegistry* createBlobRegistry(); > > // WebCore::CookiesStrategy >- std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- virtual void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, const String&); >+ std::pair<String, bool> cookiesForDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ virtual void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String&); > virtual bool cookiesEnabled(const WebCore::NetworkStorageSession&); >- std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >- virtual bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<uint64_t> frameID, std::optional<uint64_t> pageID, Vector<WebCore::Cookie>&); >+ std::pair<String, bool> cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ std::pair<String, bool> cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) override; >+ virtual bool getRawCookies(const WebCore::NetworkStorageSession&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<WebCore::Cookie>&); > virtual void deleteCookie(const WebCore::NetworkStorageSession&, const URL&, const String&); > }; >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp >index d310d2910087009e89bafef5f0e01276194dde42..8271ce71d519d6bc0d40b101f64190a8bf090bac 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp >@@ -49,7 +49,7 @@ void WebPluginInfoProvider::refreshPlugins() > PluginDatabase::installedPlugins()->refresh(); > } > >-Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& page, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) >+Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& page, Optional<Vector<WebCore::SupportedPluginIdentifier>>&) > { > Vector<WebCore::PluginInfo> outPlugins; > const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins(); >@@ -86,6 +86,6 @@ Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& pag > > Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const URL&) > { >- std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginNames; >+ Optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginNames; > return pluginInfo(page, supportedPluginNames); > } >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h >index 10f766e06044d159b0a1cd9394921e7612d57924..271878ff9cf03ca01fbdbe401650cef6a1d32a81 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h >@@ -36,7 +36,7 @@ public: > > private: > void refreshPlugins() final; >- Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; >+ Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, Optional<Vector<WebCore::SupportedPluginIdentifier>>&) final; > Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&i, const URL&) final; > #if PLATFORM(MAC) > void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString) final; >diff --git a/Source/WebKitLegacy/win/WebGeolocationPosition.cpp b/Source/WebKitLegacy/win/WebGeolocationPosition.cpp >index 0d6b784e07503108c03867058e16b395cbf8fed8..5c202ec4b4f67c640cf7b3b3056aad635698a6ed 100644 >--- a/Source/WebKitLegacy/win/WebGeolocationPosition.cpp >+++ b/Source/WebKitLegacy/win/WebGeolocationPosition.cpp >@@ -85,14 +85,14 @@ HRESULT WebGeolocationPosition::initWithTimestamp(double timestamp, double latit > return S_OK; > } > >-std::optional<GeolocationPosition> core(IWebGeolocationPosition* position) >+Optional<GeolocationPosition> core(IWebGeolocationPosition* position) > { > if (!position) >- return std::nullopt; >+ return WTF::nullopt; > > COMPtr<WebGeolocationPosition> webGeolocationPosition(Query, position); > if (!webGeolocationPosition) >- return std::nullopt; >+ return WTF::nullopt; > > return webGeolocationPosition->impl(); > } >diff --git a/Source/WebKitLegacy/win/WebGeolocationPosition.h b/Source/WebKitLegacy/win/WebGeolocationPosition.h >index 0e4468e62b2b04300bab357a33d69548346d23fe..f5d8f67d2a99c3434cb9539bbaaef2a1e42ccb08 100644 >--- a/Source/WebKitLegacy/win/WebGeolocationPosition.h >+++ b/Source/WebKitLegacy/win/WebGeolocationPosition.h >@@ -45,13 +45,13 @@ public: > // IWebGeolocationPosition > virtual HRESULT STDMETHODCALLTYPE initWithTimestamp(double timestamp, double latitude, double longitude, double accuracy); > >- const std::optional<WebCore::GeolocationPosition>& impl() const { return m_position; } >+ const Optional<WebCore::GeolocationPosition>& impl() const { return m_position; } > > private: > ULONG m_refCount { 0 }; >- std::optional<WebCore::GeolocationPosition> m_position; >+ Optional<WebCore::GeolocationPosition> m_position; > }; > >-std::optional<WebCore::GeolocationPosition> core(IWebGeolocationPosition*); >+Optional<WebCore::GeolocationPosition> core(IWebGeolocationPosition*); > > #endif // WebGeolocationPosition_h >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index ce5083cbb81f701a3b02482fd3640a286f73bd55..aa1c1ddedb8f5bc637bffaaea1e85569a12484ca 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2018-12-15 Chris Dumez <cdumez@apple.com> >+ >+ wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from >+ https://bugs.webkit.org/show_bug.cgi?id=192728 >+ <rdar://problem/46746779> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ wtf_optional >+ >+ * DumpRenderTree/*: >+ * MiniBrowser/*: >+ * TestRunnerShared/*: >+ * TestWebKitAPI/*: >+ * WebGPUAPIStructure/*: >+ * WebKitTestRunner/*: >+ > 2018-12-17 David Kilzer <ddkilzer@apple.com> > > clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools >diff --git a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >index 90b42ebfa460885b2b4b2a8643fa31ba2481ddde..398034a4c20e39acaef269ce94589484824c2b96 100644 >--- a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >+++ b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >@@ -253,12 +253,12 @@ double UIScriptController::maximumZoomScale() const > return gWebScrollView.maximumZoomScale; > } > >-std::optional<bool> UIScriptController::stableStateOverride() const >+Optional<bool> UIScriptController::stableStateOverride() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > >-void UIScriptController::setStableStateOverride(std::optional<bool>) >+void UIScriptController::setStableStateOverride(Optional<bool>) > { > } > >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >index 5de612c59f367c4d094c8fb3178286ed3bdcbff0..ae4b2134f1d2e7ffa127af2b21bbac8102f100f6 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >@@ -184,7 +184,7 @@ volatile bool done; > NavigationController* gNavigationController = nullptr; > RefPtr<TestRunner> gTestRunner; > >-std::optional<TestOptions> mainFrameTestOptions; >+Optional<TestOptions> mainFrameTestOptions; > WebFrame *mainFrame = nil; > // This is the topmost frame that is loading, during a given load, or nil when no load is > // in progress. Usually this is the same as the main frame, but not always. In the case >diff --git a/Tools/DumpRenderTree/mac/EventSendingController.h b/Tools/DumpRenderTree/mac/EventSendingController.h >index 6f18f5b12b5c869465a8cf6205d75e75177f3118..2f8934f5df153fe433fad36192d81c4e063269a6 100644 >--- a/Tools/DumpRenderTree/mac/EventSendingController.h >+++ b/Tools/DumpRenderTree/mac/EventSendingController.h >@@ -57,4 +57,4 @@ @interface EventSendingController : NSObject <DOMEventListener> > @end > > extern NSPoint lastMousePosition; >-extern NSPoint lastClickPosition; >\ No newline at end of file >+extern NSPoint lastClickPosition; >diff --git a/Tools/MiniBrowser/win/Common.cpp b/Tools/MiniBrowser/win/Common.cpp >index 4d1617380afbf2d6ab1b6894e4d6a0212a2e5291..ed49dc4a678c9ff72dc82dae60411aaa3dc513e7 100644 >--- a/Tools/MiniBrowser/win/Common.cpp >+++ b/Tools/MiniBrowser/win/Common.cpp >@@ -204,7 +204,7 @@ bool askProxySettings(HWND hwnd, ProxySettings& settings) > return dialog.run(hInst, hwnd, IDD_PROXY); > } > >-std::optional<Credential> askCredential(HWND hwnd, const std::wstring& realm) >+Optional<Credential> askCredential(HWND hwnd, const std::wstring& realm) > { > struct AuthDialog : public Dialog { > std::wstring realm; >@@ -228,7 +228,7 @@ std::optional<Credential> askCredential(HWND hwnd, const std::wstring& realm) > > if (dialog.run(hInst, hwnd, IDD_AUTH)) > return dialog.credential; >- return std::nullopt; >+ return WTF::nullopt; > } > > CommandLineOptions parseCommandLine() >diff --git a/Tools/MiniBrowser/win/Common.h b/Tools/MiniBrowser/win/Common.h >index 15bc4ddcf2c4dc25980fc2b97d19f89a8af8b0ae..d8ccb28ce834d807f01ad212c8a8f47b75b88e86 100644 >--- a/Tools/MiniBrowser/win/Common.h >+++ b/Tools/MiniBrowser/win/Common.h >@@ -62,7 +62,7 @@ void computeFullDesktopFrame(); > bool getAppDataFolder(_bstr_t& directory); > CommandLineOptions parseCommandLine(); > void createCrashReport(EXCEPTION_POINTERS*); >-std::optional<Credential> askCredential(HWND, const std::wstring& realm); >+Optional<Credential> askCredential(HWND, const std::wstring& realm); > bool askProxySettings(HWND, ProxySettings&); > > extern HINSTANCE hInst; >diff --git a/Tools/TestRunnerShared/Bindings/JSWrappable.h b/Tools/TestRunnerShared/Bindings/JSWrappable.h >index e79208caee3ba5fec65b728b3613a016a5a208af..7e2ba6c15bc7b4e58d2d81f25d852d41703060f0 100644 >--- a/Tools/TestRunnerShared/Bindings/JSWrappable.h >+++ b/Tools/TestRunnerShared/Bindings/JSWrappable.h >@@ -37,14 +37,14 @@ public: > virtual JSClassRef wrapperClass() = 0; > }; > >-inline JSValueRef JSValueMakeBooleanOrNull(JSContextRef context, std::optional<bool> value) >+inline JSValueRef JSValueMakeBooleanOrNull(JSContextRef context, Optional<bool> value) > { > return value ? JSValueMakeBoolean(context, value.value()) : JSValueMakeNull(context); > } > >-inline std::optional<bool> JSValueToNullableBoolean(JSContextRef context, JSValueRef value) >+inline Optional<bool> JSValueToNullableBoolean(JSContextRef context, JSValueRef value) > { >- return JSValueIsUndefined(context, value) || JSValueIsNull(context, value) ? std::nullopt : std::optional<bool>(JSValueToBoolean(context, value)); >+ return JSValueIsUndefined(context, value) || JSValueIsNull(context, value) ? WTF::nullopt : Optional<bool>(JSValueToBoolean(context, value)); > } > > inline JSValueRef JSValueMakeStringOrNull(JSContextRef context, JSStringRef stringOrNull) >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >index f877dcedc53a9f65d51d568af57b14cb4569ed4d..c9587c42e9f03efa8994d54d39019e7678ec6b78 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >@@ -380,12 +380,12 @@ double UIScriptController::maximumZoomScale() const > return 1; > } > >-std::optional<bool> UIScriptController::stableStateOverride() const >+Optional<bool> UIScriptController::stableStateOverride() const > { >- return std::nullopt; >+ return WTF::nullopt; > } > >-void UIScriptController::setStableStateOverride(std::optional<bool>) >+void UIScriptController::setStableStateOverride(Optional<bool>) > { > } > >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >index 7621470f7fd6a12ed755496927a8c9ae4a24dfdf..54086d6dcf717b3391e9cba119d1366befd94f1d 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >@@ -156,8 +156,8 @@ public: > double minimumZoomScale() const; > double maximumZoomScale() const; > >- std::optional<bool> stableStateOverride() const; >- void setStableStateOverride(std::optional<bool>); >+ Optional<bool> stableStateOverride() const; >+ void setStableStateOverride(Optional<bool>); > > JSObjectRef contentVisibleRect() const; > >diff --git a/Tools/TestWebKitAPI/Tests/WTF/Function.cpp b/Tools/TestWebKitAPI/Tests/WTF/Function.cpp >index 79357c53b8921dfbb8fdd52d8bf20f2ffe14e40d..fcf8e6bb38a2d3bf5052eb523578ed3189381d90 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/Function.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/Function.cpp >@@ -190,12 +190,12 @@ struct FunctionDestructionChecker { > } > > Function<unsigned()>& function; >- static std::optional<bool> functionAsBool; >- static std::optional<unsigned> functionResult; >+ static Optional<bool> functionAsBool; >+ static Optional<unsigned> functionResult; > }; > >-std::optional<bool> FunctionDestructionChecker::functionAsBool; >-std::optional<unsigned> FunctionDestructionChecker::functionResult; >+Optional<bool> FunctionDestructionChecker::functionAsBool; >+Optional<unsigned> FunctionDestructionChecker::functionResult; > > TEST(WTF_Function, AssignBeforeDestroy) > { >@@ -209,8 +209,8 @@ TEST(WTF_Function, AssignBeforeDestroy) > EXPECT_TRUE(static_cast<bool>(FunctionDestructionChecker::functionResult)); > EXPECT_TRUE(FunctionDestructionChecker::functionAsBool.value()); > EXPECT_EQ(1U, FunctionDestructionChecker::functionResult.value()); >- FunctionDestructionChecker::functionAsBool = std::nullopt; >- FunctionDestructionChecker::functionResult = std::nullopt; >+ FunctionDestructionChecker::functionAsBool = WTF::nullopt; >+ FunctionDestructionChecker::functionResult = WTF::nullopt; > > a = FunctionDestructionChecker(a); > a = MoveOnly { 2 }; >@@ -218,8 +218,8 @@ TEST(WTF_Function, AssignBeforeDestroy) > EXPECT_TRUE(static_cast<bool>(FunctionDestructionChecker::functionResult)); > EXPECT_TRUE(FunctionDestructionChecker::functionAsBool.value()); > EXPECT_EQ(2U, FunctionDestructionChecker::functionResult.value()); >- FunctionDestructionChecker::functionAsBool = std::nullopt; >- FunctionDestructionChecker::functionResult = std::nullopt; >+ FunctionDestructionChecker::functionAsBool = WTF::nullopt; >+ FunctionDestructionChecker::functionResult = WTF::nullopt; > } > > static int returnThree() >diff --git a/Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp b/Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp >index f5e9f3487f8d98db96934b853cfb0767ca81847a..17319f2c17abeaec9e1564ff19d7472cf0985bb9 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp >@@ -168,7 +168,7 @@ TEST(WTF, Hasher_multiple) > EXPECT_EQ(zero32BitHash, computeHash(std::array<int, 1> { { 0 } })); > EXPECT_EQ(zero32BitHash, computeHash(Vector<int> { 0 })); > EXPECT_EQ(zero32BitHash, computeHash(Vector<int, 1> { 0 })); >- EXPECT_EQ(zero32BitHash, computeHash(std::optional<int> { std::nullopt })); >+ EXPECT_EQ(zero32BitHash, computeHash(Optional<int> { WTF::nullopt })); > EXPECT_EQ(zero32BitHash, computeHash(std::make_tuple(0))); > > EXPECT_EQ(one64BitHash, computeHash(1, 0)); >@@ -176,7 +176,7 @@ TEST(WTF, Hasher_multiple) > EXPECT_EQ(one64BitHash, computeHash(std::make_pair(1, 0))); > EXPECT_EQ(one64BitHash, computeHash(std::array<int, 2> { { 1, 0 } })); > EXPECT_EQ(one64BitHash, computeHash({ 1, 0 })); >- EXPECT_EQ(one64BitHash, computeHash(std::optional<int> { 0 })); >+ EXPECT_EQ(one64BitHash, computeHash(Optional<int> { 0 })); > EXPECT_EQ(one64BitHash, computeHash(Vector<int> { { 1, 0 } })); > EXPECT_EQ(one64BitHash, computeHash(Vector<int, 1> { { 1, 0 } })); > >diff --git a/Tools/TestWebKitAPI/Tests/WTF/Markable.cpp b/Tools/TestWebKitAPI/Tests/WTF/Markable.cpp >index ee4384882e31e22f78000ca22f2232d0146f819b..2b23a8ed0960379efc6faf01d457755472ad1f22 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/Markable.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/Markable.cpp >@@ -39,7 +39,7 @@ TEST(WTF_Markable, Disengaged) > } > > { >- Markable<int, IntegralMarkableTraits<int, 42>> optional { std::nullopt }; >+ Markable<int, IntegralMarkableTraits<int, 42>> optional { WTF::nullopt }; > > EXPECT_FALSE(static_cast<bool>(optional)); > } >@@ -57,7 +57,7 @@ TEST(WTF_Markable, Engaged) > EXPECT_TRUE(static_cast<bool>(optional)); > EXPECT_EQ(41, optional.value()); > >- optional = std::nullopt; >+ optional = WTF::nullopt; > EXPECT_FALSE(static_cast<bool>(optional)); > > optional = 42; >@@ -121,40 +121,40 @@ TEST(WTF_Markable, Destructor) > TEST(WTF_Markable, FromOptional) > { > { >- std::optional<int> from; >+ Optional<int> from; > EXPECT_FALSE(static_cast<bool>(from)); > Markable<int, IntegralMarkableTraits<int, 42>> optional = from; > EXPECT_FALSE(static_cast<bool>(optional)); > } > { >- std::optional<int> from { 42 }; >+ Optional<int> from { 42 }; > EXPECT_TRUE(static_cast<bool>(from)); > Markable<int, IntegralMarkableTraits<int, 42>> optional = from; > // We convert this to nullopt. > EXPECT_FALSE(static_cast<bool>(optional)); > } > { >- std::optional<int> from { 43 }; >+ Optional<int> from { 43 }; > EXPECT_TRUE(static_cast<bool>(from)); > Markable<int, IntegralMarkableTraits<int, 42>> optional = from; > EXPECT_TRUE(static_cast<bool>(optional)); > EXPECT_EQ(optional.value(), 43); > } > { >- std::optional<int> from; >+ Optional<int> from; > EXPECT_FALSE(static_cast<bool>(from)); > Markable<int, IntegralMarkableTraits<int, 42>> optional { WTFMove(from) }; > EXPECT_FALSE(static_cast<bool>(optional)); > } > { >- std::optional<int> from { 42 }; >+ Optional<int> from { 42 }; > EXPECT_TRUE(static_cast<bool>(from)); > Markable<int, IntegralMarkableTraits<int, 42>> optional { WTFMove(from) }; > // We convert this to nullopt. > EXPECT_FALSE(static_cast<bool>(optional)); > } > { >- std::optional<int> from { 43 }; >+ Optional<int> from { 43 }; > EXPECT_TRUE(static_cast<bool>(from)); > Markable<int, IntegralMarkableTraits<int, 42>> optional { WTFMove(from) }; > EXPECT_TRUE(static_cast<bool>(optional)); >@@ -167,40 +167,40 @@ TEST(WTF_Markable, ToOptional) > { > Markable<int, IntegralMarkableTraits<int, 42>> optional; > EXPECT_FALSE(static_cast<bool>(optional)); >- std::optional<int> to = optional; >+ Optional<int> to = optional; > EXPECT_FALSE(static_cast<bool>(to)); > } > { > Markable<int, IntegralMarkableTraits<int, 42>> optional { 42 }; > EXPECT_FALSE(static_cast<bool>(optional)); > // We convert this to nullopt. >- std::optional<int> to = optional; >+ Optional<int> to = optional; > EXPECT_FALSE(static_cast<bool>(to)); > } > { > Markable<int, IntegralMarkableTraits<int, 42>> optional { 43 }; > EXPECT_TRUE(static_cast<bool>(optional)); >- std::optional<int> to = optional; >+ Optional<int> to = optional; > EXPECT_TRUE(static_cast<bool>(to)); > EXPECT_EQ(to.value(), 43); > } > { > Markable<int, IntegralMarkableTraits<int, 42>> optional; > EXPECT_FALSE(static_cast<bool>(optional)); >- std::optional<int> to { WTFMove(optional) }; >+ Optional<int> to { WTFMove(optional) }; > EXPECT_FALSE(static_cast<bool>(to)); > } > { > Markable<int, IntegralMarkableTraits<int, 42>> optional { 42 }; > EXPECT_FALSE(static_cast<bool>(optional)); > // We convert this to nullopt. >- std::optional<int> to { WTFMove(optional) }; >+ Optional<int> to { WTFMove(optional) }; > EXPECT_FALSE(static_cast<bool>(to)); > } > { > Markable<int, IntegralMarkableTraits<int, 42>> optional { 43 }; > EXPECT_TRUE(static_cast<bool>(optional)); >- std::optional<int> to { WTFMove(optional) }; >+ Optional<int> to { WTFMove(optional) }; > EXPECT_TRUE(static_cast<bool>(to)); > EXPECT_EQ(to.value(), 43); > } >@@ -247,13 +247,13 @@ TEST(WTF_Markable, MoveOptional) > int m_value; > }; > { >- std::optional<OnlyMovable> from { std::in_place, 20 }; >+ Optional<OnlyMovable> from { std::in_place, 20 }; > EXPECT_TRUE(static_cast<bool>(from)); > EXPECT_EQ(from.value().value(), 20); > Markable<OnlyMovable, OnlyMovable> compact = WTFMove(from); > EXPECT_TRUE(static_cast<bool>(compact)); > EXPECT_EQ(compact.value().value(), 20); >- std::optional<OnlyMovable> to = WTFMove(compact); >+ Optional<OnlyMovable> to = WTFMove(compact); > EXPECT_TRUE(static_cast<bool>(to)); > EXPECT_EQ(to.value().value(), 20); > } >diff --git a/Tools/TestWebKitAPI/Tests/WTF/Optional.cpp b/Tools/TestWebKitAPI/Tests/WTF/Optional.cpp >index a70881f35c982707d8736d691cdaa2f7709e20ed..2726004f84e603d01b1aa0d6f6ed80ae764ef301 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/Optional.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/Optional.cpp >@@ -32,13 +32,13 @@ namespace TestWebKitAPI { > TEST(WTF_Optional, Disengaged) > { > { >- std::optional<int> optional; >+ Optional<int> optional; > > EXPECT_FALSE(static_cast<bool>(optional)); > } > > { >- std::optional<int> optional { std::nullopt }; >+ Optional<int> optional { WTF::nullopt }; > > EXPECT_FALSE(static_cast<bool>(optional)); > } >@@ -46,7 +46,7 @@ TEST(WTF_Optional, Disengaged) > > TEST(WTF_Optional, Engaged) > { >- std::optional<int> optional { 10 }; >+ Optional<int> optional { 10 }; > > EXPECT_TRUE(static_cast<bool>(optional)); > EXPECT_EQ(10, optional.value()); >@@ -64,7 +64,7 @@ TEST(WTF_Optional, Destructor) > }; > > { >- std::optional<A> optional { std::in_place }; >+ Optional<A> optional { std::in_place }; > > EXPECT_TRUE(static_cast<bool>(optional)); > } >@@ -75,7 +75,7 @@ TEST(WTF_Optional, Destructor) > TEST(WTF_Optional, Callback) > { > bool called = false; >- std::optional<int> a; >+ Optional<int> a; > int result = valueOrCompute(a, [&] { > called = true; > return 300; >@@ -95,22 +95,22 @@ TEST(WTF_Optional, Callback) > > TEST(WTF_Optional, Equality) > { >- std::optional<int> unengaged1; >- std::optional<int> unengaged2; >+ Optional<int> unengaged1; >+ Optional<int> unengaged2; > >- std::optional<int> engaged1 { 1 }; >- std::optional<int> engaged2 { 2 }; >- std::optional<int> engagedx2 { 2 }; >+ Optional<int> engaged1 { 1 }; >+ Optional<int> engaged2 { 2 }; >+ Optional<int> engagedx2 { 2 }; > > EXPECT_TRUE(unengaged1 == unengaged2); > EXPECT_FALSE(engaged1 == engaged2); > EXPECT_FALSE(engaged1 == unengaged1); > EXPECT_TRUE(engaged2 == engagedx2); > >- EXPECT_TRUE(unengaged1 == std::nullopt); >- EXPECT_FALSE(engaged1 == std::nullopt); >- EXPECT_TRUE(std::nullopt == unengaged1); >- EXPECT_FALSE(std::nullopt == engaged1); >+ EXPECT_TRUE(unengaged1 == WTF::nullopt); >+ EXPECT_FALSE(engaged1 == WTF::nullopt); >+ EXPECT_TRUE(WTF::nullopt == unengaged1); >+ EXPECT_FALSE(WTF::nullopt == engaged1); > > EXPECT_TRUE(engaged1 == 1); > EXPECT_TRUE(1 == engaged1); >@@ -120,22 +120,22 @@ TEST(WTF_Optional, Equality) > > TEST(WTF_Optional, Inequality) > { >- std::optional<int> unengaged1; >- std::optional<int> unengaged2; >+ Optional<int> unengaged1; >+ Optional<int> unengaged2; > >- std::optional<int> engaged1 { 1 }; >- std::optional<int> engaged2 { 2 }; >- std::optional<int> engagedx2 { 2 }; >+ Optional<int> engaged1 { 1 }; >+ Optional<int> engaged2 { 2 }; >+ Optional<int> engagedx2 { 2 }; > > EXPECT_FALSE(unengaged1 != unengaged2); > EXPECT_TRUE(engaged1 != engaged2); > EXPECT_TRUE(engaged1 != unengaged1); > EXPECT_FALSE(engaged2 != engagedx2); > >- EXPECT_FALSE(unengaged1 != std::nullopt); >- EXPECT_TRUE(engaged1 != std::nullopt); >- EXPECT_FALSE(std::nullopt != unengaged1); >- EXPECT_TRUE(std::nullopt != engaged1); >+ EXPECT_FALSE(unengaged1 != WTF::nullopt); >+ EXPECT_TRUE(engaged1 != WTF::nullopt); >+ EXPECT_FALSE(WTF::nullopt != unengaged1); >+ EXPECT_TRUE(WTF::nullopt != engaged1); > > EXPECT_FALSE(engaged1 != 1); > EXPECT_TRUE(engaged1 != 2); >@@ -146,5 +146,93 @@ TEST(WTF_Optional, Inequality) > EXPECT_TRUE(1 != unengaged1); > } > >+TEST(WTF_Optional, MoveSemanticsConstructor) >+{ >+ { >+ Optional<int> unengaged1 { }; >+ EXPECT_FALSE(!!unengaged1); >+ >+ Optional<int> unengaged2(std::move(unengaged1)); >+ EXPECT_FALSE(!!unengaged1); >+ EXPECT_FALSE(!!unengaged2); >+ } >+ >+ { >+ Optional<int> engagedToUnengaged { 2 }; >+ EXPECT_TRUE(!!engagedToUnengaged); >+ EXPECT_EQ(2, engagedToUnengaged.value()); >+ >+ Optional<int> engaged(std::move(engagedToUnengaged)); >+ EXPECT_FALSE(!!engagedToUnengaged); >+ EXPECT_TRUE(!!engaged); >+ EXPECT_EQ(2, engaged.value()); >+ } >+} >+ >+TEST(WTF_Optional, MoveSemanticsAssignment) >+{ >+ { >+ Optional<int> unengaged1 { }; >+ EXPECT_FALSE(!!unengaged1); >+ >+ Optional<int> unengaged2; >+ EXPECT_FALSE(!!unengaged2); >+ >+ unengaged2 = std::move(unengaged1); >+ EXPECT_FALSE(!!unengaged1); >+ EXPECT_FALSE(!!unengaged2); >+ } >+ >+ { >+ Optional<int> engagedToUnengaged { 3 }; >+ EXPECT_TRUE(!!engagedToUnengaged); >+ EXPECT_EQ(3, engagedToUnengaged.value()); >+ >+ engagedToUnengaged = std::move(WTF::nullopt); >+ EXPECT_FALSE(!!engagedToUnengaged); >+ } >+ >+ { >+ Optional<int> engagedToUnengaged { 4 }; >+ EXPECT_TRUE(!!engagedToUnengaged); >+ EXPECT_EQ(4, engagedToUnengaged.value()); >+ >+ Optional<int> unengagedToEngaged; >+ EXPECT_FALSE(!!unengagedToEngaged); >+ >+ unengagedToEngaged = std::move(engagedToUnengaged); >+ EXPECT_FALSE(!!engagedToUnengaged); >+ EXPECT_TRUE(!!unengagedToEngaged); >+ EXPECT_EQ(4, unengagedToEngaged.value()); >+ } >+ >+ { >+ Optional<int> engagedToUnengaged { 5 }; >+ EXPECT_TRUE(!!engagedToUnengaged); >+ EXPECT_EQ(5, engagedToUnengaged.value()); >+ >+ Optional<int> unengaged; >+ EXPECT_FALSE(!!unengaged); >+ >+ engagedToUnengaged = std::move(unengaged); >+ EXPECT_FALSE(!!engagedToUnengaged); >+ EXPECT_FALSE(!!unengaged); >+ } >+ >+ { >+ Optional<int> engagedToUnengaged { 6 }; >+ EXPECT_TRUE(!!engagedToUnengaged); >+ EXPECT_EQ(6, engagedToUnengaged.value()); >+ >+ Optional<int> engagedToEngaged { 7 }; >+ EXPECT_TRUE(!!engagedToEngaged); >+ EXPECT_EQ(7, engagedToEngaged.value()); >+ >+ engagedToEngaged = std::move(engagedToUnengaged); >+ EXPECT_FALSE(!!engagedToUnengaged); >+ EXPECT_TRUE(!!engagedToEngaged); >+ EXPECT_EQ(6, engagedToEngaged.value()); >+ } >+} > > } // namespace TestWebKitAPI >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp b/Tools/TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp >index 5fee1f7cbebdecc2a3b64b36ca92f56b145a9a2b..15dcb2076bbe27dc94f065329473cf3b68d1eb05 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp >@@ -105,7 +105,7 @@ TEST(AbortableTaskQueue, SyncTasks) > > auto backgroundThreadFunction = [&]() { > EXPECT_FALSE(isMainThread()); >- std::optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([&]() -> FancyResponse { >+ Optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([&]() -> FancyResponse { > EXPECT_TRUE(isMainThread()); > currentStep++; > EXPECT_EQ(1, currentStep); >@@ -117,7 +117,7 @@ TEST(AbortableTaskQueue, SyncTasks) > EXPECT_TRUE(response); > EXPECT_FALSE(destructedResponseFlag); > EXPECT_EQ(100, response->fancyInt); >- response = std::nullopt; >+ response = WTF::nullopt; > EXPECT_TRUE(destructedResponseFlag); > RunLoop::main().dispatch([&]() { > testFinished = true; >@@ -203,7 +203,7 @@ TEST(AbortableTaskQueue, Abort) > EXPECT_TRUE(false); > }); > // This call must return immediately because we are aborting. >- std::optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([]() -> FancyResponse { >+ Optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([]() -> FancyResponse { > // This task should not have been able to run under the scheduling of this test. > EXPECT_TRUE(false); > return FancyResponse(100); >@@ -245,7 +245,7 @@ TEST(AbortableTaskQueue, AbortBeforeSyncTaskRun) > auto backgroundThreadFunction = [&]() { > EXPECT_FALSE(isMainThread()); > >- std::optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([]() -> FancyResponse { >+ Optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([]() -> FancyResponse { > // This task should not have been able to run under the scheduling of this test. > EXPECT_TRUE(false); > return FancyResponse(100); >@@ -284,7 +284,7 @@ TEST(AbortableTaskQueue, AbortedBySyncTaskHandler) > currentStep++; > EXPECT_EQ(1, currentStep); > >- std::optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([&]() -> FancyResponse { >+ Optional<FancyResponse> response = taskQueue.enqueueTaskAndWait<FancyResponse>([&]() -> FancyResponse { > currentStep++; > EXPECT_EQ(2, currentStep); > taskQueue.startAborting(); >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp b/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp >index 0a929a0f6a4465c1a3f2593175e97a32eb4b3669..fdeb501b74a7de2e3becb60520a7829a0e2ef121 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp >@@ -63,7 +63,7 @@ TEST(CBORReaderTest, TestReadUint) > }; > > for (const UintTestCase& testCase : kUintTestCases) { >- std::optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >+ Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); > ASSERT_TRUE(cbor.has_value()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::Unsigned); > EXPECT_EQ(cbor.value().getInteger(), testCase.value); >@@ -108,7 +108,7 @@ TEST(CBORReaderTest, TestUintEncodedWithNonMinimumByteLength) > > CBORReader::DecoderError errorCode; > for (const auto& nonMinimalUint : nonMinimalUintEncodings) { >- std::optional<CBORValue> cbor = CBORReader::read(nonMinimalUint, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(nonMinimalUint, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::NonMinimalCBOREncoding); > } >@@ -134,7 +134,7 @@ TEST(CBORReaderTest, TestReadNegativeInt) > }; > > for (const NegativeIntTestCase& testCase : kNegativeIntTestCases) { >- std::optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >+ Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); > ASSERT_TRUE(cbor.has_value()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::Negative); > EXPECT_EQ(cbor.value().getInteger(), testCase.negativeInt); >@@ -154,7 +154,7 @@ TEST(CBORReaderTest, TestReadBytes) > }; > > for (const ByteTestCase& testCase : kByteStringTestCases) { >- std::optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >+ Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); > ASSERT_TRUE(cbor.has_value()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::ByteString); > EXPECT_TRUE(cbor.value().getByteString() == testCase.value); >@@ -179,7 +179,7 @@ TEST(CBORReaderTest, TestReadString) > }; > > for (const StringTestCase& testCase : kStringTestCases) { >- std::optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >+ Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); > ASSERT_TRUE(cbor.has_value()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::String); > EXPECT_TRUE(cbor.value().getString() == testCase.value); >@@ -207,7 +207,7 @@ TEST(CBORReaderTest, TestReadStringWithNUL) > }; > > for (const auto& testCase : kStringTestCases) { >- std::optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >+ Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); > ASSERT_TRUE(cbor.has_value()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::String); > EXPECT_TRUE(cbor.value().getString() == testCase.value); >@@ -224,7 +224,7 @@ TEST(CBORReaderTest, TestReadStringWithInvalidByteSequenceAfterNUL) > 0x63, 0x00, 0x00, 0xA6 > }; > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(stringWithInvalidContinuationByte, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(stringWithInvalidContinuationByte, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::InvalidUTF8); > } >@@ -238,7 +238,7 @@ TEST(CBORReaderTest, TestReadArray) > 0x18, 0x18, 0x19, > }; > >- std::optional<CBORValue> cbor = CBORReader::read(kArrayTestCaseCBOR); >+ Optional<CBORValue> cbor = CBORReader::read(kArrayTestCaseCBOR); > ASSERT_TRUE(cbor.has_value()); > const CBORValue cborArray = WTFMove(cbor.value()); > ASSERT_TRUE(cborArray.type() == CBORValue::Type::Array); >@@ -268,7 +268,7 @@ TEST(CBORReaderTest, TestReadMapWithMapValue) > 0x62, 0x41, 0x41, // "AA" > }; > >- std::optional<CBORValue> cbor = CBORReader::read(kMapTestCaseCBOR); >+ Optional<CBORValue> cbor = CBORReader::read(kMapTestCaseCBOR); > ASSERT_TRUE(cbor.has_value()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); >@@ -312,7 +312,7 @@ TEST(CBORReaderTest, TestReadMapWithIntegerKeys) > 0x61, 0x64, // value : "d" > }; > >- std::optional<CBORValue> cbor = CBORReader::read(kMapWithIntegerKeyCBOR); >+ Optional<CBORValue> cbor = CBORReader::read(kMapWithIntegerKeyCBOR); > ASSERT_TRUE(cbor.has_value()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); >@@ -352,7 +352,7 @@ TEST(CBORReaderTest, TestReadMapWithArray) > 0x03, > }; > >- std::optional<CBORValue> cbor = CBORReader::read(kMapArrayTestCaseCBOR); >+ Optional<CBORValue> cbor = CBORReader::read(kMapArrayTestCaseCBOR); > ASSERT_TRUE(cbor.has_value()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); >@@ -391,7 +391,7 @@ TEST(CBORReaderTest, TestReadNestedMap) > 0x03, > }; > >- std::optional<CBORValue> cbor = CBORReader::read(kNestedMapTestCase); >+ Optional<CBORValue> cbor = CBORReader::read(kNestedMapTestCase); > ASSERT_TRUE(cbor.has_value()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); >@@ -428,11 +428,11 @@ TEST(CBORReaderTest, TestIntegerRange) > 0x3b, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF > }; > >- std::optional<CBORValue> maxPositiveInt = CBORReader::read(kMaxPositiveInt); >+ Optional<CBORValue> maxPositiveInt = CBORReader::read(kMaxPositiveInt); > ASSERT_TRUE(maxPositiveInt.has_value()); > EXPECT_EQ(maxPositiveInt.value().getInteger(), INT64_MAX); > >- std::optional<CBORValue> minNegativeInt = CBORReader::read(kMinNegativeInt); >+ Optional<CBORValue> minNegativeInt = CBORReader::read(kMinNegativeInt); > ASSERT_TRUE(minNegativeInt.has_value()); > EXPECT_EQ(minNegativeInt.value().getInteger(), INT64_MIN); > } >@@ -448,11 +448,11 @@ TEST(CBORReaderTest, TestIntegerOutOfRangeError) > }; > > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> positiveIntOutOfRangeCBOR = CBORReader::read(kOutOfRangePositiveInt, &errorCode); >+ Optional<CBORValue> positiveIntOutOfRangeCBOR = CBORReader::read(kOutOfRangePositiveInt, &errorCode); > EXPECT_FALSE(positiveIntOutOfRangeCBOR); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::OutOfRangeIntegerValue); > >- std::optional<CBORValue> negativeIntOutOfRangeCBOR = CBORReader::read(kOutOfRangeNegativeInt, &errorCode); >+ Optional<CBORValue> negativeIntOutOfRangeCBOR = CBORReader::read(kOutOfRangeNegativeInt, &errorCode); > EXPECT_FALSE(negativeIntOutOfRangeCBOR); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::OutOfRangeIntegerValue); > } >@@ -470,7 +470,7 @@ TEST(CBORReaderTest, TestReadSimpleValue) > }; > > for (const auto& testCase : kSimpleValueTestCases) { >- std::optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >+ Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); > ASSERT_TRUE(cbor.has_value()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::SimpleValue); > ASSERT_TRUE(cbor.value().getSimpleValue() == testCase.value); >@@ -490,7 +490,7 @@ TEST(CBORReaderTest, TestReadUnsupportedFloatingPointNumbers) > > for (const auto& unsupported_floating_point : floatingPointCbors) { > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(unsupported_floating_point, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(unsupported_floating_point, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnsupportedFloatingPointValue); > } >@@ -516,7 +516,7 @@ TEST(CBORReaderTest, TestIncompleteCBORDataError) > > for (const auto& incomplete_data : incompleteCborList) { > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(incomplete_data, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(incomplete_data, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::IncompleteCBORData); > } >@@ -537,7 +537,7 @@ TEST(CBORReaderTest, TestUnsupportedMapKeyFormatError) > }; > > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(kMapWithUintKey, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(kMapWithUintKey, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::IncorrectMapKeyType); > } >@@ -566,7 +566,7 @@ TEST(CBORReaderTest, TestUnknownAdditionalInfoError) > > for (const auto& incorrect_cbor : kUnknownAdditionalInfoList) { > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(incorrect_cbor, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(incorrect_cbor, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnknownAdditionalInfo); > } >@@ -589,7 +589,7 @@ TEST(CBORReaderTest, TestTooMuchNestingError) > > for (const auto& zeroDepthData : kZeroDepthCBORList) { > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(zeroDepthData, &errorCode, 0); >+ Optional<CBORValue> cbor = CBORReader::read(zeroDepthData, &errorCode, 0); > EXPECT_TRUE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError); > } >@@ -609,11 +609,11 @@ TEST(CBORReaderTest, TestTooMuchNestingError) > }; > > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cborSingleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 1); >+ Optional<CBORValue> cborSingleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 1); > EXPECT_FALSE(cborSingleLayerMax.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::TooMuchNesting); > >- std::optional<CBORValue> cborDoubleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 2); >+ Optional<CBORValue> cborDoubleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 2); > EXPECT_TRUE(cborDoubleLayerMax.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError); > } >@@ -646,7 +646,7 @@ TEST(CBORReaderTest, TestOutOfOrderKeyError) > > CBORReader::DecoderError errorCode; > for (const auto& unsortedMap : kMapsWithUnsortedKeys) { >- std::optional<CBORValue> cbor = >+ Optional<CBORValue> cbor = > CBORReader::read(unsortedMap, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::OutOfOrderKey); >@@ -678,7 +678,7 @@ TEST(CBORReaderTest, TestDuplicateKeyError) > > CBORReader::DecoderError errorCode; > >- std::optional<CBORValue> cbor = CBORReader::read(kMapWithDuplicateKey, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(kMapWithDuplicateKey, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::DuplicateKey); > } >@@ -698,14 +698,14 @@ TEST(CBORReaderTest, TestIncorrectStringEncodingError) > > CBORReader::DecoderError errorCode; > for (const auto& cbor_byte : utf8CharacterEncodings) { >- std::optional<CBORValue> correctlyEncodedCbor = CBORReader::read(cbor_byte, &errorCode); >+ Optional<CBORValue> correctlyEncodedCbor = CBORReader::read(cbor_byte, &errorCode); > EXPECT_TRUE(correctlyEncodedCbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError); > } > > // Incorrect UTF8 encoding referenced by section 3.5.3 of the stress test. > Vector<uint8_t> impossible_utf_byte { 0x64, 0xfe, 0xfe, 0xff, 0xff }; >- std::optional<CBORValue> incorrectlyEncodedCbor = CBORReader::read(impossible_utf_byte, &errorCode); >+ Optional<CBORValue> incorrectlyEncodedCbor = CBORReader::read(impossible_utf_byte, &errorCode); > EXPECT_FALSE(incorrectlyEncodedCbor); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::InvalidUTF8); > } >@@ -727,7 +727,7 @@ TEST(CBORReaderTest, TestExtraneousCBORDataError) > > for (const auto& extraneous_cborData : zeroPaddedCborList) { > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(extraneous_cborData, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(extraneous_cborData, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::ExtraneousData); > } >@@ -758,7 +758,7 @@ TEST(CBORReaderTest, TestUnsupportedSimplevalue) > > for (const auto& unsupportedSimpleVal : unsupportedSimpleValues) { > CBORReader::DecoderError errorCode; >- std::optional<CBORValue> cbor = CBORReader::read(unsupportedSimpleVal, &errorCode); >+ Optional<CBORValue> cbor = CBORReader::read(unsupportedSimpleVal, &errorCode); > EXPECT_FALSE(cbor.has_value()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnsupportedSimpleValue); > } >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp b/Tools/TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp >index f439dad4ec1a908007417cd2a7e6c61dd135fa64..8cb4427a6d27af0cc0aa08e234e680c9f6bc005c 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp >@@ -59,7 +59,7 @@ TEST(CTAPRequestTest, TestConstructMakeCredentialRequestParam) > Vector<PublicKeyCredentialCreationOptions::Parameters> params { { PublicKeyCredentialType::PublicKey, 7 }, { PublicKeyCredentialType::PublicKey, 257 } }; > PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria selection { PublicKeyCredentialCreationOptions::AuthenticatorAttachment::Platform, true, UserVerificationRequirement::Preferred }; > >- PublicKeyCredentialCreationOptions options { rp, user, { }, params, std::nullopt, { }, selection }; >+ PublicKeyCredentialCreationOptions options { rp, user, { }, params, WTF::nullopt, { }, selection }; > Vector<uint8_t> hash; > hash.append(TestData::kClientDataHash, sizeof(TestData::kClientDataHash)); > auto serializedData = encodeMakeCredenitalRequestAsCBOR(hash, options, AuthenticatorSupportedOptions::UserVerificationAvailability::kSupportedButNotConfigured); >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp b/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp >index aad16b8604179ca43a9773795854b575773afc9a..da5f4ff5898a9f09c8b8395a55de738f168c909f 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp >@@ -77,8 +77,8 @@ private: > > TEST_F(SecurityOriginTest, SecurityOriginConstructors) > { >- Ref<SecurityOrigin> o1 = SecurityOrigin::create("http", "example.com", std::optional<uint16_t>(80)); >- Ref<SecurityOrigin> o2 = SecurityOrigin::create("http", "example.com", std::optional<uint16_t>()); >+ Ref<SecurityOrigin> o1 = SecurityOrigin::create("http", "example.com", Optional<uint16_t>(80)); >+ Ref<SecurityOrigin> o2 = SecurityOrigin::create("http", "example.com", Optional<uint16_t>()); > Ref<SecurityOrigin> o3 = SecurityOrigin::createFromString("http://example.com"); > Ref<SecurityOrigin> o4 = SecurityOrigin::createFromString("http://example.com:80"); > Ref<SecurityOrigin> o5 = SecurityOrigin::create(URL(URL(), "http://example.com")); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm >index 2e89e3608bd59273dd138f34d9529e2e2ab0be49..788c8cb7a20ae3cf289c3131a09e19d175c66813 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm >@@ -59,8 +59,8 @@ static bool receivedAlert; > static bool finishedNavigation; > > #if PLATFORM(MAC) >-static std::optional<_WKAutoplayEvent> receivedAutoplayEvent; >-static std::optional<_WKAutoplayEventFlags> receivedAutoplayEventFlags; >+static Optional<_WKAutoplayEvent> receivedAutoplayEvent; >+static Optional<_WKAutoplayEventFlags> receivedAutoplayEventFlags; > #endif > > static size_t alertCount; >@@ -354,7 +354,7 @@ TEST(WebKit, WebsitePoliciesPlayAfterPreventedAutoplay) > > NSPoint playButtonClickPoint = NSMakePoint(20, 256); > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > NSURLRequest *jsPlayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"js-play-with-controls" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; > [webView loadRequest:jsPlayRequest]; > [webView waitForMessage:@"loaded"]; >@@ -365,7 +365,7 @@ TEST(WebKit, WebsitePoliciesPlayAfterPreventedAutoplay) > runUntilReceivesAutoplayEvent(kWKAutoplayEventDidPlayMediaPreventedFromAutoplaying); > ASSERT_TRUE(*receivedAutoplayEventFlags & kWKAutoplayEventFlagsHasAudio); > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadHTMLString:@"" baseURL:nil]; > > NSURLRequest *autoplayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"autoplay-with-controls" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >@@ -379,7 +379,7 @@ TEST(WebKit, WebsitePoliciesPlayAfterPreventedAutoplay) > runUntilReceivesAutoplayEvent(kWKAutoplayEventDidPlayMediaPreventedFromAutoplaying); > ASSERT_TRUE(*receivedAutoplayEventFlags & kWKAutoplayEventFlagsHasAudio); > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadHTMLString:@"" baseURL:nil]; > > NSURLRequest *noAutoplayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"no-autoplay-with-controls" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >@@ -388,9 +388,9 @@ TEST(WebKit, WebsitePoliciesPlayAfterPreventedAutoplay) > [webView mouseDownAtPoint:playButtonClickPoint simulatePressure:NO]; > [webView mouseUpAtPoint:playButtonClickPoint]; > [webView waitForMessage:@"played"]; >- ASSERT_TRUE(receivedAutoplayEvent == std::nullopt); >+ ASSERT_TRUE(receivedAutoplayEvent == WTF::nullopt); > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadHTMLString:@"" baseURL:nil]; > > [delegate setAutoplayPolicyForURL:^(NSURL *) { >@@ -420,7 +420,7 @@ TEST(WebKit, WebsitePoliciesPlayingWithoutInterference) > [webView setNavigationDelegate:delegate.get()]; > [webView setUIDelegate:delegate.get()]; > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > NSURLRequest *jsPlayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"js-autoplay-audio" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; > [webView loadRequest:jsPlayRequest]; > runUntilReceivesAutoplayEvent(kWKAutoplayEventDidAutoplayMediaPastThresholdWithoutUserInterference); >@@ -439,20 +439,20 @@ TEST(WebKit, WebsitePoliciesUserInterferenceWithPlaying) > [webView setNavigationDelegate:delegate.get()]; > [webView setUIDelegate:delegate.get()]; > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > NSURLRequest *jsPlayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"js-play-with-controls" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; > [webView loadRequest:jsPlayRequest]; > [webView waitForMessage:@"playing"]; >- ASSERT_TRUE(receivedAutoplayEvent == std::nullopt); >+ ASSERT_TRUE(receivedAutoplayEvent == WTF::nullopt); > > WKPageSetMuted([webView _pageForTesting], kWKMediaAudioMuted); > runUntilReceivesAutoplayEvent(kWKAutoplayEventUserDidInterfereWithPlayback); > ASSERT_TRUE(*receivedAutoplayEventFlags & kWKAutoplayEventFlagsHasAudio); > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadRequest:jsPlayRequest]; > [webView waitForMessage:@"playing"]; >- ASSERT_TRUE(receivedAutoplayEvent == std::nullopt); >+ ASSERT_TRUE(receivedAutoplayEvent == WTF::nullopt); > > const NSPoint muteButtonClickPoint = NSMakePoint(80, 256); > [webView mouseDownAtPoint:muteButtonClickPoint simulatePressure:NO]; >@@ -460,10 +460,10 @@ TEST(WebKit, WebsitePoliciesUserInterferenceWithPlaying) > runUntilReceivesAutoplayEvent(kWKAutoplayEventUserDidInterfereWithPlayback); > ASSERT_TRUE(*receivedAutoplayEventFlags & kWKAutoplayEventFlagsHasAudio); > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadRequest:jsPlayRequest]; > [webView waitForMessage:@"playing"]; >- ASSERT_TRUE(receivedAutoplayEvent == std::nullopt); >+ ASSERT_TRUE(receivedAutoplayEvent == WTF::nullopt); > > const NSPoint playButtonClickPoint = NSMakePoint(20, 256); > [webView mouseDownAtPoint:playButtonClickPoint simulatePressure:NO]; >@@ -498,7 +498,7 @@ struct ParsedRange { > if (min <= max) > range = std::make_pair(min, max); > } >- std::optional<std::pair<size_t, size_t>> range; >+ Optional<std::pair<size_t, size_t>> range; > }; > > @interface TestSchemeHandler : NSObject <WKURLSchemeHandler> >@@ -602,7 +602,7 @@ TEST(WebKit, WebsitePoliciesUpdates) > [webView _updateWebsitePolicies:policies]; > > // A script should no longer be able to autoplay media. >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView stringByEvaluatingJavaScript:@"playVideo()"]; > runUntilReceivesAutoplayEvent(kWKAutoplayEventDidPreventFromAutoplaying); > } >@@ -664,7 +664,7 @@ TEST(WebKit, WebsitePoliciesAutoplayQuirks) > [webView waitForMessage:@"did-not-play"]; > [webView waitForMessage:@"on-pause"]; > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadHTMLString:@"" baseURL:nil]; > > NSURLRequest *requestWithAudioInFrame = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"autoplay-check-in-iframe" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >@@ -682,7 +682,7 @@ TEST(WebKit, WebsitePoliciesAutoplayQuirks) > [webView waitForMessage:@"did-not-play"]; > [webView waitForMessage:@"on-pause"]; > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadHTMLString:@"" baseURL:nil]; > > NSURLRequest *requestThatInheritsGesture = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"autoplay-inherits-gesture-from-document" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >@@ -722,7 +722,7 @@ TEST(WebKit, WebsitePoliciesAutoplayQuirksAsyncPolicyDelegate) > [webView waitForMessage:@"did-not-play"]; > [webView waitForMessage:@"on-pause"]; > >- receivedAutoplayEvent = std::nullopt; >+ receivedAutoplayEvent = WTF::nullopt; > [webView loadHTMLString:@"" baseURL:nil]; > > NSURLRequest *requestWithAudioInFrame = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"autoplay-check-in-iframe" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.cpp b/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.cpp >index ed3a2e0579ffd526a05a84ef390e2fed32ccb62f..e6960ebe608cb6c92d776a7800a6d2f4b2dc7b34 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.cpp >@@ -64,4 +64,4 @@ namespace WebGPU { > SamplerHolder::SamplerHolder(SamplerHolder&& other) : device(device), sampler(sampler) { > other.sampler = nullptr; > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.h b/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.h >index ba59d1dab00e3861e09a3da87d3c81b961d3d9e1..8fd69455b008e9d957ebe2307a1d2cc8c941e3f9 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.h >+++ b/Tools/WebGPUAPIStructure/WebGPU-Common/WebGPU.h >@@ -368,4 +368,4 @@ namespace WebGPU { > virtual void returnTexture(Texture&) = 0; > virtual void returnSampler(Sampler&) = 0; > }; >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.cpp >index 9fcfde4786750582f69c578cef8216a6ef7fc1eb..58590b0fef3ecc24ee9947685ea028fa4b45a7fd 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.cpp >@@ -53,4 +53,4 @@ namespace WebGPU { > insertTexture(src); > insertTexture(dst); > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.h b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.h >index e58221aadf7619b11065aa11844090efb0430cab..76b779b7b40f760cc95a6bd4bb0acf5514458765 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.h >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.h >@@ -43,4 +43,4 @@ namespace WebGPU { > private: > void copyTexture(Texture& source, Texture& destination, unsigned int sourceX, unsigned int sourceY, unsigned int destinationX, unsigned int destinationY, unsigned int width, unsigned int height) override; > }; >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.cpp >index 35c44a9683ec22fd132a62c9a36e4c68d088082e..b0ff237555b04521b17aa5651275da533d4fb659 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.cpp >@@ -45,4 +45,4 @@ namespace WebGPU { > void ComputePassImpl::dispatch(unsigned int width, unsigned int height, unsigned int depth) { > commandBuffer->dispatch(width, height, depth); > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.h b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.h >index d1408d9303d752ac017930dc097c7699489010e1..0838a14eabf2f11db360ac51ae88f52066616ce9 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.h >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.h >@@ -45,4 +45,4 @@ namespace WebGPU { > void setResources(unsigned int index, const std::vector<WebGPU::ResourceReference>&) override; > void dispatch(unsigned int width, unsigned int height, unsigned int depth) override; > }; >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputeStateImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputeStateImpl.cpp >index d6b2bb401c56c948f452d5fffed00c0b8221d911..dcc0db868023262bb81480be9b7ac4f75d3ae80f 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputeStateImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/ComputeStateImpl.cpp >@@ -28,4 +28,4 @@ > namespace WebGPU { > ComputeStateImpl::ComputeStateImpl(vk::UniquePipeline&& pipeline, std::vector<vk::UniqueDescriptorSetLayout>&& descriptorSetLayouts, vk::UniquePipelineLayout&& pipelineLayout) : pipeline(std::move(pipeline)), descriptorSetLayouts(std::move(descriptorSetLayouts)), pipelineLayout(std::move(pipelineLayout)) { > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.cpp >index 1263972b26ce5f3207f4ec5d130cc86c5d71f352..700df1288d9a6f4767f2cb0c5337d9b5ce111d6c 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.cpp >@@ -83,4 +83,4 @@ namespace WebGPU { > readPromises[i].set_value(data); > } > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.h b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.h >index 292ef57e3980318d728745fa0d28e325d5fbcd81..8a9358c0dbf4fd0c1a0ecbe274f0cef7b6d99d6b 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.h >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.h >@@ -55,4 +55,4 @@ namespace WebGPU { > std::vector<std::reference_wrapper<BufferImpl>> buffersToRead; > std::vector<boost::promise<std::vector<uint8_t>>> readPromises; > }; >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.cpp >index 8345abdb363d4a40d15cdd4ca6a09ed030954b4c..b176f7a8bb1484cdeb29929be345c4bf24e6beae 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.cpp >@@ -179,4 +179,4 @@ namespace WebGPU { > if (samplers.find(reference) == samplers.end()) > samplers.insert(std::move(reference)); > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.h b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.h >index 38c4f84c0213fd45f950bb3d95e7155d5f9d372d..7f174a08867243fc03e986208649b46d4f7b4bb9 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.h >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.h >@@ -118,4 +118,4 @@ namespace WebGPU { > std::unordered_set<ResourceReference<TextureImpl>, ResourceReferenceHash<TextureImpl>> textures; > std::unordered_set<ResourceReference<SamplerImpl>, ResourceReferenceHash<SamplerImpl>> samplers; > }; >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/RenderStateImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/RenderStateImpl.cpp >index bd7cf606ab8ea4bf2bb1ad2c279bee343b541ec6..2a7f127df9d69cb7068b0214824c60834f95339c 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/RenderStateImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/RenderStateImpl.cpp >@@ -28,4 +28,4 @@ > namespace WebGPU { > RenderStateImpl::RenderStateImpl(vk::UniquePipeline&& pipeline, std::vector<vk::UniqueDescriptorSetLayout>&& descriptorSetLayouts, vk::UniquePipelineLayout&& pipelineLayout, vk::UniqueRenderPass&& compatibleRenderPass) : pipeline(std::move(pipeline)), descriptorSetLayouts(std::move(descriptorSetLayouts)), pipelineLayout(std::move(pipelineLayout)), compatibleRenderPass(std::move(compatibleRenderPass)) { > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/SamplerImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/SamplerImpl.cpp >index c615e8926edb509909151bf9ef103f8ca9e23fe5..62887244df7694280868be431dadc90c5373d6a2 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/SamplerImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/SamplerImpl.cpp >@@ -33,4 +33,4 @@ namespace WebGPU { > if (--referenceCount == 0) > returnToDevice(*this); > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/TextureImpl.cpp b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/TextureImpl.cpp >index b46d86ae0d03dc9722b2fb2fbb8bfd7e66a5cbb7..10b360593956d104f6932872653759dab3b35915 100644 >--- a/Tools/WebGPUAPIStructure/WebGPU-Vulkan/TextureImpl.cpp >+++ b/Tools/WebGPUAPIStructure/WebGPU-Vulkan/TextureImpl.cpp >@@ -33,4 +33,4 @@ namespace WebGPU { > if (--referenceCount == 0) > returnToDevice(*this); > } >-} >\ No newline at end of file >+} >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >index 8822f15d0a5e7f91a3bba47fdbed0eadf0282a2c..13a37e3f87aa2abe949c461b37e6c661ab6a0b50 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >@@ -301,7 +301,7 @@ void TestRunner::execCommand(JSStringRef name, JSStringRef showUI, JSStringRef v > WKBundlePageExecuteEditingCommand(InjectedBundle::singleton().page()->page(), toWK(name).get(), toWK(value).get()); > } > >-static std::optional<WKFindOptions> findOptionsFromArray(JSValueRef optionsArrayAsValue) >+static Optional<WKFindOptions> findOptionsFromArray(JSValueRef optionsArrayAsValue) > { > auto& injectedBundle = InjectedBundle::singleton(); > WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(injectedBundle.page()->page()); >@@ -310,7 +310,7 @@ static std::optional<WKFindOptions> findOptionsFromArray(JSValueRef optionsArray > JSObjectRef optionsArray = JSValueToObject(context, optionsArrayAsValue, 0); > JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0); > if (!JSValueIsNumber(context, lengthValue)) >- return std::nullopt; >+ return WTF::nullopt; > > WKFindOptions options = 0; > size_t length = static_cast<size_t>(JSValueToNumber(context, lengthValue, 0)); >diff --git a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >index 50e7aebddee7d2a3da2f8c0aaaa4d46fb98340e8..80b9380ffc5381b099db4fdb5643a0178fd78c8f 100644 >--- a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >+++ b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >@@ -823,7 +823,7 @@ static inline bool shouldWrapWithShiftKeyEventForCharacter(NSString *key) > return false; > } > >-static std::optional<uint32_t> keyCodeForDOMFunctionKey(NSString *key) >+static Optional<uint32_t> keyCodeForDOMFunctionKey(NSString *key) > { > // Compare the input string with the function-key names defined by the DOM spec (i.e. "F1",...,"F24"). > // If the input string is a function-key name, set its key code. On iOS the key codes for the first 12 >@@ -836,7 +836,7 @@ static std::optional<uint32_t> keyCodeForDOMFunctionKey(NSString *key) > if ([key isEqualToString:[NSString stringWithFormat:@"F%d", i]]) > return kHIDUsage_KeyboardF13 + i - 1; > } >- return std::nullopt; >+ return WTF::nullopt; > } > > static inline uint32_t hidUsageCodeForCharacter(NSString *key) >diff --git a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >index a9d54ad6d2540064da32867690462d0026a642ac..f656e6d8a3c285e91ed7cba09eafa37794713ab5 100644 >--- a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >+++ b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >@@ -549,16 +549,16 @@ double UIScriptController::maximumZoomScale() const > return webView.scrollView.maximumZoomScale; > } > >-std::optional<bool> UIScriptController::stableStateOverride() const >+Optional<bool> UIScriptController::stableStateOverride() const > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); > if (webView._stableStateOverride) > return webView._stableStateOverride.boolValue; > >- return std::nullopt; >+ return WTF::nullopt; > } > >-void UIScriptController::setStableStateOverride(std::optional<bool> overrideValue) >+void UIScriptController::setStableStateOverride(Optional<bool> overrideValue) > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); > if (overrideValue)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192728
:
357360
|
357374
|
357376
|
357377
|
357379
|
357407
|
357409
|
357411
|
357413
|
357414
|
357415
|
357416
|
357417
|
357444
|
357445
|
357492
|
357514
|
357519
|
357521
|
357534
|
357769
|
357772