<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[225499] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/225499">225499</a></dd>
<dt>Author</dt> <dd>jfbastien@apple.com</dd>
<dt>Date</dt> <dd>2017-12-04 15:34:57 -0800 (Mon, 04 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update std::expected to match libc++ coding style
https://bugs.webkit.org/show_bug.cgi?id=180264

Reviewed by Alex Christensen.

Source/JavaScriptCore:

Update various uses of Expected.

* wasm/WasmModule.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseImport):
(JSC::Wasm::ModuleParser::parseTableHelper):
(JSC::Wasm::ModuleParser::parseTable):
(JSC::Wasm::ModuleParser::parseMemoryHelper):
* wasm/WasmParser.h:
* wasm/generateWasmValidateInlinesHeader.py:
(loadMacro):
(storeMacro):
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::createStub):
* wasm/js/JSWebAssemblyModule.h:

Source/WebCore:

Update various uses of Expected, mostly renaming valueOr and
hasValue to the STL naming convention.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::retrieveRecords):
(WebCore::DOMCache::batchDeleteOperation):
(WebCore::DOMCache::batchPutOperation):
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::open):
(WebCore::DOMCacheStorage::remove):
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doRemove):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
(WebCore::recordsDataOrErrorFromRecords):
(WebCore::recordsOrErrorFromRecordsData):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestScriptWithCache const):
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList):
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::loadRule):
(WebCore::ContentExtensions::loadEncodedRules):
(WebCore::ContentExtensions::parseRuleList):
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::cachedFont):
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::loadBestFitImage):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::loadImage):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/CallbackResult.h:
(WebCore::CallbackResult<ReturnType>::type const):
(WebCore::CallbackResult<ReturnType>::releaseReturnValue):
* dom/Element.cpp:
(WebCore::Element::getIntegralAttribute const):
(WebCore::Element::getUnsignedIntegralAttribute const):
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::hasException const):
(WebCore::ExceptionOr<void>::hasException const):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
(WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLNonNegativeInteger):
* html/parser/HTMLParserIdioms.h:
(WebCore::limitToOnlyHTMLNonNegative):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
(WebCore::LinkLoader::loadLink):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::load):
* loader/cache/CachedSVGDocumentReference.cpp:
(WebCore::CachedSVGDocumentReference::load):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Host):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::requestImageResource):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::loadFont):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateExternalDocument):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::loadSheet):

Source/WebKit:

Update various uses of Expected, mostly renaming valueOr and
hasValue to the STL naming convention.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::open):
(WebKit::CacheStorage::Engine::retrieveCaches):
(WebKit::CacheStorage::Engine::retrieveRecords):
(WebKit::CacheStorage::Engine::putRecords):
(WebKit::CacheStorage::Engine::deleteMatchingRecords):
(WebKit::CacheStorage::Engine::fetchEntries):
(WebKit::CacheStorage::Engine::clearMemoryRepresentation):
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
(WebKit::CacheStorage::Cache::updateRecordToDisk):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):
(WebKit::CacheStorage::Caches::readCachesFromDisk):
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createResolver):
* Platform/IPC/ArgumentCoders.h:

Source/WTF:

As of https://wg21.link/p0323r4 std::expected is on its way to the
Library Fundamentals v3 TS (LEWG and EWG voted for this, but LWG
hasn't done wording review yet, hence "on its way"). The API is
therefore pretty close to what will be in the TS, and I've gotten
requests for an easily usable implementation of std::expected. I
talked to our clang team and they'll help me migrate our
implementation to libc++, but our implementation has to look more
like libc++ than it does now. Once in libc++ I'll maintain changes
on both sides to make sure neither is out-of-date for too long.

- Fork std::unexpected into its own header.
- Add mild support for an exception-based implementation, but
  don't do noexcept yet.
- Rename everything to follow STL style, and keep a global using
  or variable alias where possible to reduce WebKit code churn.
- Minor API updates to remove things that aren't in the proposal
  anymore.

* wtf/Expected.h:
(std::experimental::fundamentals_v3::bad_expected_access<void>::bad_expected_access):
(std::experimental::fundamentals_v3::bad_expected_access::bad_expected_access):
(std::experimental::fundamentals_v3::bad_expected_access::error):
(std::experimental::fundamentals_v3::bad_expected_access::error const):
(std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
(std::experimental::fundamentals_v3::__expected_detail::base::base):
(std::experimental::fundamentals_v3::__expected_detail::base::~base):
(std::experimental::fundamentals_v3::expected::expected):
(std::experimental::fundamentals_v3::expected::operator=):
(std::experimental::fundamentals_v3::expected::swap):
(std::experimental::fundamentals_v3::expected::operator-> const):
(std::experimental::fundamentals_v3::expected::operator->):
(std::experimental::fundamentals_v3::expected::operator* const):
(std::experimental::fundamentals_v3::expected::operator*):
(std::experimental::fundamentals_v3::expected::has_value const):
(std::experimental::fundamentals_v3::expected::value const):
(std::experimental::fundamentals_v3::expected::value):
(std::experimental::fundamentals_v3::expected::error const):
(std::experimental::fundamentals_v3::expected::error):
(std::experimental::fundamentals_v3::expected::value_or const):
(std::experimental::fundamentals_v3::expected::value_or):
(std::experimental::fundamentals_v3::operator==):
(std::experimental::fundamentals_v3::operator!=):
(std::experimental::fundamentals_v3::swap):
(WTF::Unexpected::Unexpected): Deleted.
(WTF::Unexpected::value const): Deleted.
(WTF::Unexpected::value): Deleted.
(WTF::operator==): Deleted.
(WTF::operator!=): Deleted.
(WTF::makeUnexpected): Deleted.
(WTF::ExpectedDetail::Throw): Deleted.
(WTF::ExpectedDetail::destroy): Deleted.
(WTF::ExpectedDetail::std::is_trivially_destructible<T>::value): Deleted.
(WTF::ExpectedDetail::ConstexprBase::ConstexprBase): Deleted.
(WTF::ExpectedDetail::Base::Base): Deleted.
(WTF::ExpectedDetail::Base::~Base): Deleted.
(WTF::Expected::Expected): Deleted.
(WTF::Expected::operator=): Deleted.
(WTF::Expected::swap): Deleted.
(WTF::Expected::operator-> const): Deleted.
(WTF::Expected::operator->): Deleted.
(WTF::Expected::operator* const): Deleted.
(WTF::Expected::operator*): Deleted.
(WTF::Expected::operator bool const): Deleted.
(WTF::Expected::hasValue const): Deleted.
(WTF::Expected::value const): Deleted.
(WTF::Expected::value): Deleted.
(WTF::Expected::error const): Deleted.
(WTF::Expected::error): Deleted.
(WTF::Expected::getUnexpected const): Deleted.
(WTF::Expected::valueOr const): Deleted.
(WTF::Expected::valueOr): Deleted.
(WTF::swap): Deleted.
(WTF::makeExpected): Deleted.
(WTF::makeExpectedFromError): Deleted.
* wtf/Forward.h:
* wtf/Optional.h:
* wtf/StdLibExtras.h:
* wtf/Unexpected.h: Added.
(std::experimental::fundamentals_v3::unexpected::unexpected):
(std::experimental::fundamentals_v3::unexpected::value const):
(std::experimental::fundamentals_v3::unexpected::value):
(std::experimental::fundamentals_v3::operator==):
(std::experimental::fundamentals_v3::operator!=):
(makeUnexpected):

Tools:

Update tests according to name changes as well as removal of
now-gone APIs.

* TestWebKitAPI/Tests/WTF/Expected.cpp:
(std::experimental::fundamentals_v3::operator<<):
(TestWebKitAPI::TEST):
(WTF::operator<<): Deleted.
* TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:
(TestWebKitAPI::testParseHTMLInteger):
(TestWebKitAPI::testParseHTMLNonNegativeInteger):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmModuleh">trunk/Source/JavaScriptCore/wasm/WasmModule.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmModuleParsercpp">trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmParserh">trunk/Source/JavaScriptCore/wasm/WasmParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmgenerateWasmValidateInlinesHeaderpy">trunk/Source/JavaScriptCore/wasm/generateWasmValidateInlinesHeader.py</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyModulecpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyModuleh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfExpectedh">trunk/Source/WTF/wtf/Expected.h</a></li>
<li><a href="#trunkSourceWTFwtfForwardh">trunk/Source/WTF/wtf/Forward.h</a></li>
<li><a href="#trunkSourceWTFwtfOptionalh">trunk/Source/WTF/wtf/Optional.h</a></li>
<li><a href="#trunkSourceWTFwtfStdLibExtrash">trunk/Source/WTF/wtf/StdLibExtras.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulescacheDOMCachecpp">trunk/Source/WebCore/Modules/cache/DOMCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulescacheDOMCacheStoragecpp">trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulescacheWorkerCacheStorageConnectioncpp">trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsCachedScriptFetchercpp">trunk/Source/WebCore/bindings/js/CachedScriptFetcher.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionCompilercpp">trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionParsercpp">trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSrcValuecpp">trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSImageSetValuecpp">trunk/Source/WebCore/css/CSSImageSetValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSImageValuecpp">trunk/Source/WebCore/css/CSSImageValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleRuleImportcpp">trunk/Source/WebCore/css/StyleRuleImport.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCallbackResulth">trunk/Source/WebCore/dom/CallbackResult.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomExceptionOrh">trunk/Source/WebCore/dom/ExceptionOr.h</a></li>
<li><a href="#trunkSourceWebCoredomProcessingInstructioncpp">trunk/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementcpp">trunk/Source/WebCore/html/HTMLTextAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomscpp">trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomsh">trunk/Source/WebCore/html/parser/HTMLParserIdioms.h</a></li>
<li><a href="#trunkSourceWebCoreloaderCrossOriginPreflightCheckercpp">trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentThreadableLoadercpp">trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderImageLoadercpp">trunk/Source/WebCore/loader/ImageLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderLinkLoadercpp">trunk/Source/WebCore/loader/LinkLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderMediaResourceLoadercpp">trunk/Source/WebCore/loader/MediaResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderTextTrackLoadercpp">trunk/Source/WebCore/loader/TextTrackLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedSVGDocumentReferencecpp">trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconLoadercpp">trunk/Source/WebCore/loader/icon/IconLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformURLParsercpp">trunk/Source/WebCore/platform/URLParser.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfWebCoreAVCFResourceLoadercpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcWebCoreAVFResourceLoadermm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFEImageElementcpp">trunk/Source/WebCore/svg/SVGFEImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontFaceUriElementcpp">trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGUseElementcpp">trunk/Source/WebCore/svg/SVGUseElement.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXSLImportRulecpp">trunk/Source/WebCore/xml/XSLImportRule.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEnginecpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineCachecpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineCachescpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesswebrtcNetworkRTCProvidercpp">trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp</a></li>
<li><a href="#trunkSourceWebKitPlatformIPCArgumentCodersh">trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFExpectedcpp">trunk/Tools/TestWebKitAPI/Tests/WTF/Expected.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreHTMLParserIdiomscpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWTFwtfUnexpectedh">trunk/Source/WTF/wtf/Unexpected.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/JavaScriptCore/ChangeLog       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2017-12-04  JF Bastien  <jfbastien@apple.com>
+
+        Update std::expected to match libc++ coding style
+        https://bugs.webkit.org/show_bug.cgi?id=180264
+
+        Reviewed by Alex Christensen.
+
+        Update various uses of Expected.
+
+        * wasm/WasmModule.h:
+        * wasm/WasmModuleParser.cpp:
+        (JSC::Wasm::ModuleParser::parseImport):
+        (JSC::Wasm::ModuleParser::parseTableHelper):
+        (JSC::Wasm::ModuleParser::parseTable):
+        (JSC::Wasm::ModuleParser::parseMemoryHelper):
+        * wasm/WasmParser.h:
+        * wasm/generateWasmValidateInlinesHeader.py:
+        (loadMacro):
+        (storeMacro):
+        * wasm/js/JSWebAssemblyModule.cpp:
+        (JSC::JSWebAssemblyModule::createStub):
+        * wasm/js/JSWebAssemblyModule.h:
+
</ins><span class="cx"> 2017-12-04  Saam Barati  <sbarati@apple.com>
</span><span class="cx"> 
</span><span class="cx">         We need to leave room on the top of the stack for the FTL TailCall slow path so it doesn't overwrite things we want to retrieve when doing a stack walk when throwing an exception
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmModuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmModule.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmModule.h    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/JavaScriptCore/wasm/WasmModule.h       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> class Module : public ThreadSafeRefCounted<Module> {
</span><span class="cx"> public:
</span><del>-    using ValidationResult = WTF::Expected<RefPtr<Module>, String>;
</del><ins>+    using ValidationResult = Expected<RefPtr<Module>, String>;
</ins><span class="cx">     typedef void CallbackType(ValidationResult&&);
</span><span class="cx">     using AsyncValidationCallback = RefPtr<SharedTask<CallbackType>>;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmModuleParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx">             bool isImport = true;
</span><span class="cx">             PartialResult result = parseTableHelper(isImport);
</span><span class="cx">             if (UNLIKELY(!result))
</span><del>-                return result.getUnexpected();
</del><ins>+                return makeUnexpected(WTFMove(result.error()));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case ExternalKind::Memory: {
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx">             bool isImport = true;
</span><span class="cx">             PartialResult result = parseMemoryHelper(isImport);
</span><span class="cx">             if (UNLIKELY(!result))
</span><del>-                return result.getUnexpected();
</del><ins>+                return makeUnexpected(WTFMove(result.error()));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case ExternalKind::Global: {
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx">     std::optional<uint32_t> maximum;
</span><span class="cx">     PartialResult limits = parseResizableLimits(initial, maximum);
</span><span class="cx">     if (UNLIKELY(!limits))
</span><del>-        return limits.getUnexpected();
</del><ins>+        return makeUnexpected(WTFMove(limits.error()));
</ins><span class="cx">     WASM_PARSER_FAIL_IF(initial > maxTableEntries, "Table's initial page count of ", initial, " is too big, maximum ", maxTableEntries);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!maximum || *maximum >= initial);
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx">     bool isImport = false;
</span><span class="cx">     PartialResult result = parseTableHelper(isImport);
</span><span class="cx">     if (UNLIKELY(!result))
</span><del>-        return result.getUnexpected();
</del><ins>+        return makeUnexpected(WTFMove(result.error()));
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx">         std::optional<uint32_t> maximum;
</span><span class="cx">         PartialResult limits = parseResizableLimits(initial, maximum);
</span><span class="cx">         if (UNLIKELY(!limits))
</span><del>-            return limits.getUnexpected();
</del><ins>+            return makeUnexpected(WTFMove(limits.error()));
</ins><span class="cx">         ASSERT(!maximum || *maximum >= initial);
</span><span class="cx">         WASM_PARSER_FAIL_IF(!PageCount::isValid(initial), "Memory's initial page count of ", initial, " is invalid");
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmParser.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmParser.h    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/JavaScriptCore/wasm/WasmParser.h       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -97,10 +97,10 @@
</span><span class="cx">         return fail(__VA_ARGS__);                \
</span><span class="cx">     } while (0)
</span><span class="cx"> 
</span><del>-#define WASM_FAIL_IF_HELPER_FAILS(helper) do {   \
-        auto helperResult = helper;              \
-        if (UNLIKELY(!helperResult))             \
-            return helperResult.getUnexpected(); \
</del><ins>+#define WASM_FAIL_IF_HELPER_FAILS(helper) do {                      \
+        auto helperResult = helper;                                 \
+        if (UNLIKELY(!helperResult))                                \
+            return makeUnexpected(WTFMove(helperResult.error()));   \
</ins><span class="cx">     } while (0)
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmgenerateWasmValidateInlinesHeaderpy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/generateWasmValidateInlinesHeader.py (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/generateWasmValidateInlinesHeader.py    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/JavaScriptCore/wasm/generateWasmValidateInlinesHeader.py       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> #!/usr/bin/env python
</span><span class="cx"> 
</span><del>-# Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> template<> auto Validate::addOp<OpType::""" + toCpp(name) + """>(ExpressionType value, ExpressionType& result) -> Result
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(value != """ + cppType(op["parameter"][0]) + """))
</span><del>-        return Unexpected<Result::ErrorType>("validation failed: """ + name + """ value type mismatch");
</del><ins>+        return Unexpected<Result::error_type>("validation failed: """ + name + """ value type mismatch");
</ins><span class="cx"> 
</span><span class="cx">     result = """ + cppType(op["return"][0]) + """;
</span><span class="cx">     return { };
</span><span class="lines">@@ -77,10 +77,10 @@
</span><span class="cx"> template<> auto Validate::addOp<OpType::""" + toCpp(name) + """>(ExpressionType left, ExpressionType right, ExpressionType& result) -> Result
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(left != """ + cppType(op["parameter"][0]) + """))
</span><del>-        return Unexpected<Result::ErrorType>("validation failed: """ + name + """ left value type mismatch");
</del><ins>+        return Unexpected<Result::error_type>("validation failed: """ + name + """ left value type mismatch");
</ins><span class="cx"> 
</span><span class="cx">     if (UNLIKELY(right != """ + cppType(op["parameter"][1]) + """))
</span><del>-        return Unexpected<Result::ErrorType>("validation failed: """ + name + """ right value type mismatch");
</del><ins>+        return Unexpected<Result::error_type>("validation failed: """ + name + """ right value type mismatch");
</ins><span class="cx"> 
</span><span class="cx">     result = """ + cppType(op["return"][0]) + """;
</span><span class="cx">     return { };
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">     return """
</span><span class="cx">     case LoadOpType::""" + toCpp(name) + """: {
</span><span class="cx">         if (UNLIKELY(pointer != """ + cppType(op["parameter"][0]) + """))
</span><del>-            return Unexpected<Result::ErrorType>("validation failed: """ + name + """ pointer type mismatch");
</del><ins>+            return Unexpected<Result::error_type>("validation failed: """ + name + """ pointer type mismatch");
</ins><span class="cx"> 
</span><span class="cx">         result = """ + cppType(op["return"][0]) + """;
</span><span class="cx">         return { };
</span><span class="lines">@@ -104,10 +104,10 @@
</span><span class="cx">     return """
</span><span class="cx">     case StoreOpType::""" + toCpp(name) + """: {
</span><span class="cx">         if (UNLIKELY(pointer != """ + cppType(op["parameter"][0]) + """))
</span><del>-            return Unexpected<Result::ErrorType>("validation failed: """ + name + """ pointer type mismatch");
</del><ins>+            return Unexpected<Result::error_type>("validation failed: """ + name + """ pointer type mismatch");
</ins><span class="cx"> 
</span><span class="cx">         if (UNLIKELY(value != """ + cppType(op["parameter"][1]) + """))
</span><del>-            return Unexpected<Result::ErrorType>("validation failed: """ + name + """ value type mismatch");
</del><ins>+            return Unexpected<Result::error_type>("validation failed: """ + name + """ value type mismatch");
</ins><span class="cx"> 
</span><span class="cx">         return { };
</span><span class="cx">     }"""
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx"> auto Validate::load(LoadOpType op, ExpressionType pointer, ExpressionType& result, uint32_t) -> Result
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(!hasMemory()))
</span><del>-        return Unexpected<Result::ErrorType>("validation failed: load instruction without memory");
</del><ins>+        return Unexpected<Result::error_type>("validation failed: load instruction without memory");
</ins><span class="cx"> 
</span><span class="cx">     switch (op) {
</span><span class="cx"> """ + loadCases + """
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> auto Validate::store(StoreOpType op, ExpressionType pointer, ExpressionType value, uint32_t) -> Result
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(!hasMemory()))
</span><del>-        return Unexpected<Result::ErrorType>("validation failed: store instruction without memory");
</del><ins>+        return Unexpected<Result::error_type>("validation failed: store instruction without memory");
</ins><span class="cx"> 
</span><span class="cx">     switch (op) {
</span><span class="cx"> """ + storeCases + """
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyModulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> JSWebAssemblyModule* JSWebAssemblyModule::createStub(VM& vm, ExecState* exec, Structure* structure, Wasm::Module::ValidationResult&& result)
</span><span class="cx"> {
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><del>-    if (!result.hasValue()) {
</del><ins>+    if (!result.has_value()) {
</ins><span class="cx">         throwException(exec, scope, JSWebAssemblyCompileError::create(exec, vm, structure->globalObject()->WebAssemblyCompileErrorStructure(), result.error()));
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyModuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h        2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h   2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> 
</span><span class="cx">     DECLARE_EXPORT_INFO;
</span><span class="cx"> 
</span><del>-    JS_EXPORT_PRIVATE static JSWebAssemblyModule* createStub(VM&, ExecState*, Structure*, WTF::Expected<RefPtr<Wasm::Module>, String>&&);
</del><ins>+    JS_EXPORT_PRIVATE static JSWebAssemblyModule* createStub(VM&, ExecState*, Structure*, Expected<RefPtr<Wasm::Module>, String>&&);
</ins><span class="cx">     static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
</span><span class="cx"> 
</span><span class="cx">     const Wasm::ModuleInformation& moduleInformation() const;
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WTF/ChangeLog  2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,3 +1,95 @@
</span><ins>+2017-12-04  JF Bastien  <jfbastien@apple.com>
+
+        Update std::expected to match libc++ coding style
+        https://bugs.webkit.org/show_bug.cgi?id=180264
+
+        Reviewed by Alex Christensen.
+
+        As of https://wg21.link/p0323r4 std::expected is on its way to the
+        Library Fundamentals v3 TS (LEWG and EWG voted for this, but LWG
+        hasn't done wording review yet, hence "on its way"). The API is
+        therefore pretty close to what will be in the TS, and I've gotten
+        requests for an easily usable implementation of std::expected. I
+        talked to our clang team and they'll help me migrate our
+        implementation to libc++, but our implementation has to look more
+        like libc++ than it does now. Once in libc++ I'll maintain changes
+        on both sides to make sure neither is out-of-date for too long.
+
+        - Fork std::unexpected into its own header.
+        - Add mild support for an exception-based implementation, but
+          don't do noexcept yet.
+        - Rename everything to follow STL style, and keep a global using
+          or variable alias where possible to reduce WebKit code churn.
+        - Minor API updates to remove things that aren't in the proposal
+          anymore.
+
+        * wtf/Expected.h:
+        (std::experimental::fundamentals_v3::bad_expected_access<void>::bad_expected_access):
+        (std::experimental::fundamentals_v3::bad_expected_access::bad_expected_access):
+        (std::experimental::fundamentals_v3::bad_expected_access::error):
+        (std::experimental::fundamentals_v3::bad_expected_access::error const):
+        (std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
+        (std::experimental::fundamentals_v3::__expected_detail::base::base):
+        (std::experimental::fundamentals_v3::__expected_detail::base::~base):
+        (std::experimental::fundamentals_v3::expected::expected):
+        (std::experimental::fundamentals_v3::expected::operator=):
+        (std::experimental::fundamentals_v3::expected::swap):
+        (std::experimental::fundamentals_v3::expected::operator-> const):
+        (std::experimental::fundamentals_v3::expected::operator->):
+        (std::experimental::fundamentals_v3::expected::operator* const):
+        (std::experimental::fundamentals_v3::expected::operator*):
+        (std::experimental::fundamentals_v3::expected::has_value const):
+        (std::experimental::fundamentals_v3::expected::value const):
+        (std::experimental::fundamentals_v3::expected::value):
+        (std::experimental::fundamentals_v3::expected::error const):
+        (std::experimental::fundamentals_v3::expected::error):
+        (std::experimental::fundamentals_v3::expected::value_or const):
+        (std::experimental::fundamentals_v3::expected::value_or):
+        (std::experimental::fundamentals_v3::operator==):
+        (std::experimental::fundamentals_v3::operator!=):
+        (std::experimental::fundamentals_v3::swap):
+        (WTF::Unexpected::Unexpected): Deleted.
+        (WTF::Unexpected::value const): Deleted.
+        (WTF::Unexpected::value): Deleted.
+        (WTF::operator==): Deleted.
+        (WTF::operator!=): Deleted.
+        (WTF::makeUnexpected): Deleted.
+        (WTF::ExpectedDetail::Throw): Deleted.
+        (WTF::ExpectedDetail::destroy): Deleted.
+        (WTF::ExpectedDetail::std::is_trivially_destructible<T>::value): Deleted.
+        (WTF::ExpectedDetail::ConstexprBase::ConstexprBase): Deleted.
+        (WTF::ExpectedDetail::Base::Base): Deleted.
+        (WTF::ExpectedDetail::Base::~Base): Deleted.
+        (WTF::Expected::Expected): Deleted.
+        (WTF::Expected::operator=): Deleted.
+        (WTF::Expected::swap): Deleted.
+        (WTF::Expected::operator-> const): Deleted.
+        (WTF::Expected::operator->): Deleted.
+        (WTF::Expected::operator* const): Deleted.
+        (WTF::Expected::operator*): Deleted.
+        (WTF::Expected::operator bool const): Deleted.
+        (WTF::Expected::hasValue const): Deleted.
+        (WTF::Expected::value const): Deleted.
+        (WTF::Expected::value): Deleted.
+        (WTF::Expected::error const): Deleted.
+        (WTF::Expected::error): Deleted.
+        (WTF::Expected::getUnexpected const): Deleted.
+        (WTF::Expected::valueOr const): Deleted.
+        (WTF::Expected::valueOr): Deleted.
+        (WTF::swap): Deleted.
+        (WTF::makeExpected): Deleted.
+        (WTF::makeExpectedFromError): Deleted.
+        * wtf/Forward.h:
+        * wtf/Optional.h:
+        * wtf/StdLibExtras.h:
+        * wtf/Unexpected.h: Added.
+        (std::experimental::fundamentals_v3::unexpected::unexpected):
+        (std::experimental::fundamentals_v3::unexpected::value const):
+        (std::experimental::fundamentals_v3::unexpected::value):
+        (std::experimental::fundamentals_v3::operator==):
+        (std::experimental::fundamentals_v3::operator!=):
+        (makeUnexpected):
+
</ins><span class="cx"> 2017-12-03  Tomas Popela  <tpopela@redhat.com>
</span><span class="cx"> 
</span><span class="cx">         Build fails on x86_64 and arm64 with BMalloc disabled
</span></span></pre></div>
<a id="trunkSourceWTFwtfExpectedh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Expected.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Expected.h  2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WTF/wtf/Expected.h     2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -23,171 +23,331 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-// WTF::Expected is based on std::expected, as described here: http://wg21.link/p0323r1
-// The specification expects to throw. This implementation doesn't support exceptions, uses RELEASE_ASSERT instead.
</del><ins>+// Implementation of Library Fundamentals v3's std::expected, as described here: http://wg21.link/p0323r4
</ins><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+/*
+    expected synopsis
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v3 {
+    // ?.?.4, Expected for object types
+    template <class T, class E>
+        class expected;
+
+    // ?.?.5, Expected specialization for void
+    template <class E>
+        class expected<void,E>;
+
+    // ?.?.6, unexpect tag
+    struct unexpect_t {
+       unexpect_t() = default;
+    };
+    inline constexpr unexpect_t unexpect{};
+
+    // ?.?.7, class bad_expected_access
+    template <class E>
+       class bad_expected_access;
+
+    // ?.?.8, Specialization for void.
+    template <>
+       class bad_expected_access<void>;
+
+    // ?.?.9, Expected relational operators
+    template <class T, class E>
+        constexpr bool operator==(const expected<T, E>&, const expected<T, E>&);
+    template <class T, class E>
+        constexpr bool operator!=(const expected<T, E>&, const expected<T, E>&);
+
+    // ?.?.10, Comparison with T
+    template <class T, class E>
+      constexpr bool operator==(const expected<T, E>&, const T&);
+    template <class T, class E>
+      constexpr bool operator==(const T&, const expected<T, E>&);
+    template <class T, class E>
+      constexpr bool operator!=(const expected<T, E>&, const T&);
+    template <class T, class E>
+      constexpr bool operator!=(const T&, const expected<T, E>&);
+
+    // ?.?.10, Comparison with unexpected<E>
+    template <class T, class E>
+      constexpr bool operator==(const expected<T, E>&, const unexpected<E>&);
+    template <class T, class E>
+      constexpr bool operator==(const unexpected<E>&, const expected<T, E>&);
+    template <class T, class E>
+      constexpr bool operator!=(const expected<T, E>&, const unexpected<E>&);
+    template <class T, class E>
+      constexpr bool operator!=(const unexpected<E>&, const expected<T, E>&);
+
+    // ?.?.11, Specialized algorithms
+    void swap(expected<T, E>&, expected<T, E>&) noexcept(see below);
+
+    template <class T, class E>
+    class expected
+    {
+    public:
+        typedef T value_type;
+        typedef E error_type;
+        typedef unexpected<E> unexpected_type;
+    
+        template <class U>
+            struct rebind {
+            using type = expected<U, error_type>;
+          };
+    
+        // ?.?.4.1, constructors
+        constexpr expected();
+        constexpr expected(const expected&);
+        constexpr expected(expected&&) noexcept(see below);
+        template <class U, class G>
+            EXPLICIT constexpr expected(const expected<U, G>&);
+        template <class U, class G>
+            EXPLICIT constexpr expected(expected<U, G>&&);
+    
+        template <class U = T>
+            EXPLICIT constexpr expected(U&& v);
+    
+        template <class... Args>
+            constexpr explicit expected(in_place_t, Args&&...);
+        template <class U, class... Args>
+            constexpr explicit expected(in_place_t, initializer_list<U>, Args&&...);
+        template <class G = E>
+            constexpr expected(unexpected<G> const&);
+        template <class G = E>
+            constexpr expected(unexpected<G> &&);
+        template <class... Args>
+            constexpr explicit expected(unexpect_t, Args&&...);
+        template <class U, class... Args>
+            constexpr explicit expected(unexpect_t, initializer_list<U>, Args&&...);
+    
+        // ?.?.4.2, destructor
+        ~expected();
+    
+        // ?.?.4.3, assignment
+        expected& operator=(const expected&);
+        expected& operator=(expected&&) noexcept(see below);
+        template <class U = T> expected& operator=(U&&);
+        template <class G = E>
+            expected& operator=(const unexpected<G>&);
+        template <class G = E>
+            expected& operator=(unexpected<G>&&) noexcept(see below);
+    
+        template <class... Args>
+            void emplace(Args&&...);
+        template <class U, class... Args>
+            void emplace(initializer_list<U>, Args&&...);
+    
+        // ?.?.4.4, swap
+        void swap(expected&) noexcept(see below);
+    
+        // ?.?.4.5, observers
+        constexpr const T* operator ->() const;
+        constexpr T* operator ->();
+        constexpr const T& operator *() const&;
+        constexpr T& operator *() &;
+        constexpr const T&& operator *() const &&;
+        constexpr T&& operator *() &&;
+        constexpr explicit operator bool() const noexcept;
+        constexpr bool has_value() const noexcept;
+        constexpr const T& value() const&;
+        constexpr T& value() &;
+        constexpr const T&& value() const &&;
+        constexpr T&& value() &&;
+        constexpr const E& error() const&;
+        constexpr E& error() &;
+        constexpr const E&& error() const &&;
+        constexpr E&& error() &&;
+        template <class U>
+            constexpr T value_or(U&&) const&;
+        template <class U>
+            T value_or(U&&) &&;
+    
+    private:
+        bool has_val; // exposition only
+        union
+        {
+            value_type val; // exposition only
+            unexpected_type unexpect; // exposition only
+        };
+    };
+
+}}}
+
+*/
+
</ins><span class="cx"> #include <cstdlib>
</span><span class="cx"> #include <initializer_list>
</span><span class="cx"> #include <type_traits>
</span><span class="cx"> #include <utility>
</span><span class="cx"> #include <wtf/Assertions.h>
</span><ins>+#include <wtf/Compiler.h>
</ins><span class="cx"> #include <wtf/Optional.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><ins>+#include <wtf/Unexpected.h>
</ins><span class="cx"> 
</span><del>-namespace WTF {
</del><ins>+namespace std {
+namespace experimental {
+inline namespace fundamentals_v3 {
</ins><span class="cx"> 
</span><del>-template<class E>
-class Unexpected {
-public:
-    Unexpected() = delete;
-    constexpr explicit Unexpected(const E& e) : val(e) { }
-    constexpr explicit Unexpected(E&& e) : val(std::forward<E>(e)) { }
-    constexpr const E& value() const & { return val; }
-    RELAXED_CONSTEXPR E& value() & { return val; }
-    RELAXED_CONSTEXPR E&& value() && { return WTFMove(val); }
-
-private:
-    E val;
</del><ins>+struct unexpected_t {
+    unexpected_t() = default;
</ins><span class="cx"> };
</span><ins>+#if __cplusplus < 201703L
+#define __EXPECTED_INLINE_VARIABLE static const
+#else
+#define __EXPECTED_INLINE_VARIABLE inline
+#endif
</ins><span class="cx"> 
</span><del>-template<class E> constexpr bool operator==(const Unexpected<E>& lhs, const Unexpected<E>& rhs) { return lhs.value() == rhs.value(); }
-template<class E> constexpr bool operator!=(const Unexpected<E>& lhs, const Unexpected<E>& rhs) { return lhs.value() != rhs.value(); }
</del><ins>+__EXPECTED_INLINE_VARIABLE constexpr unexpected_t unexpect { };
</ins><span class="cx"> 
</span><del>-template<class E> constexpr Unexpected<std::decay_t<E>> makeUnexpected(E&& v) { return Unexpected<typename std::decay<E>::type>(std::forward<E>(v)); }
</del><ins>+template<class E> class bad_expected_access;
</ins><span class="cx"> 
</span><del>-struct UnexpectTag {
-    UnexpectTag() = default;
</del><ins>+template<>
+class bad_expected_access<void> : public std::exception {
+public:
+    explicit bad_expected_access() { }
</ins><span class="cx"> };
</span><del>-constexpr UnexpectTag Unexpect { }; // FIXME This is an inline variable for C++17 and later.
</del><span class="cx"> 
</span><del>-// FIXME this should just be std::in_place_t which we also define in optional and variant.
-struct InPlaceTag {
-    InPlaceTag() = default;
</del><ins>+template<class E>
+class bad_expected_access : public bad_expected_access<void> {
+public:
+    explicit bad_expected_access(E val) : val(val) { }
+    virtual const char* what() const noexcept override { return std::exception::what(); }
+    E& error() & { return val; }
+    const E& error() const& { return val; }
+    E&& error() && { return std::move(val); }
+    const E&&  error() const&& { return std::move(val); }
+
+private:
+    E val;
</ins><span class="cx"> };
</span><del>-constexpr InPlaceTag InPlace { };
</del><span class="cx"> 
</span><del>-namespace ExpectedDetail {
</del><ins>+namespace __expected_detail {
</ins><span class="cx"> 
</span><del>-// Invoked where std::Expected would instead throw.
-inline NO_RETURN_DUE_TO_CRASH void Throw() { RELEASE_ASSERT_NOT_REACHED(); }
</del><ins>+#if COMPILER_SUPPORTS(EXCEPTIONS)
+#define __EXPECTED_THROW(__exception) (throw __exception)
+#else
+inline NO_RETURN_DUE_TO_CRASH void __expected_terminate() { RELEASE_ASSERT_NOT_REACHED(); }
+#define __EXPECTED_THROW(...) __expected_detail::__expected_terminate()
+#endif
</ins><span class="cx"> 
</span><del>-static constexpr enum class ValueTagType { } ValueTag { };
-static constexpr enum class ErrorTagType { } ErrorTag { };
</del><ins>+__EXPECTED_INLINE_VARIABLE constexpr enum class value_tag_t { } value_tag { };
+__EXPECTED_INLINE_VARIABLE constexpr enum class error_tag_t { } error_tag { };
</ins><span class="cx"> 
</span><span class="cx"> template<class T, std::enable_if_t<std::is_trivially_destructible<T>::value>* = nullptr> void destroy(T&) { }
</span><span class="cx"> template<class T, std::enable_if_t<!std::is_trivially_destructible<T>::value && (std::is_class<T>::value || std::is_union<T>::value)>* = nullptr> void destroy(T& t) { t.~T(); }
</span><span class="cx"> 
</span><span class="cx"> template<class T, class E>
</span><del>-union ConstexprStorage {
-    typedef T ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
</del><ins>+union constexpr_storage {
+    typedef T value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
</ins><span class="cx">     char dummy;
</span><del>-    ValueType val;
-    ErrorType err;
-    constexpr ConstexprStorage() : dummy() { }
-    constexpr ConstexprStorage(ValueTagType) : val() { }
-    constexpr ConstexprStorage(ErrorTagType) : err() { }
-    constexpr ConstexprStorage(ValueTagType, const ValueType& v) : val(v) { }
-    constexpr ConstexprStorage(ErrorTagType, const ErrorType& e) : err(e) { }
-    ~ConstexprStorage() = default;
</del><ins>+    value_type val;
+    error_type err;
+    constexpr constexpr_storage() : dummy() { }
+    constexpr constexpr_storage(value_tag_t) : val() { }
+    constexpr constexpr_storage(error_tag_t) : err() { }
+    constexpr constexpr_storage(value_tag_t, const value_type& v) : val(v) { }
+    constexpr constexpr_storage(error_tag_t, const error_type& e) : err(e) { }
+    ~constexpr_storage() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class T, class E>
</span><del>-union Storage {
-    typedef T ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
</del><ins>+union storage {
+    typedef T value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
</ins><span class="cx">     char dummy;
</span><del>-    ValueType val;
-    ErrorType err;
-    constexpr Storage() : dummy() { }
-    constexpr Storage(ValueTagType) : val() { }
-    constexpr Storage(ErrorTagType) : err() { }
-    constexpr Storage(ValueTagType, const ValueType& val) : val(val) { }
-    constexpr Storage(ValueTagType, ValueType&& val) : val(std::forward<ValueType>(val)) { }
-    constexpr Storage(ErrorTagType, const ErrorType& err) : err(err) { }
-    constexpr Storage(ErrorTagType, ErrorType&& err) : err(std::forward<ErrorType>(err)) { }
-    ~Storage() { }
</del><ins>+    value_type val;
+    error_type err;
+    constexpr storage() : dummy() { }
+    constexpr storage(value_tag_t) : val() { }
+    constexpr storage(error_tag_t) : err() { }
+    constexpr storage(value_tag_t, const value_type& val) : val(val) { }
+    constexpr storage(value_tag_t, value_type&& val) : val(std::forward<value_type>(val)) { }
+    constexpr storage(error_tag_t, const error_type& err) : err(err) { }
+    constexpr storage(error_tag_t, error_type&& err) : err(std::forward<error_type>(err)) { }
+    ~storage() { }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class E>
</span><del>-union ConstexprStorage<void, E> {
-    typedef void ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
</del><ins>+union constexpr_storage<void, E> {
+    typedef void value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
</ins><span class="cx">     char dummy;
</span><del>-    ErrorType err;
-    constexpr ConstexprStorage() : dummy() { }
-    constexpr ConstexprStorage(ValueTagType) : dummy() { }
-    constexpr ConstexprStorage(ErrorTagType) : err() { }
-    constexpr ConstexprStorage(ErrorTagType, const ErrorType& e) : err(e) { }
-    ~ConstexprStorage() = default;
</del><ins>+    error_type err;
+    constexpr constexpr_storage() : dummy() { }
+    constexpr constexpr_storage(value_tag_t) : dummy() { }
+    constexpr constexpr_storage(error_tag_t) : err() { }
+    constexpr constexpr_storage(error_tag_t, const error_type& e) : err(e) { }
+    ~constexpr_storage() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class E>
</span><del>-union Storage<void, E> {
-    typedef void ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
</del><ins>+union storage<void, E> {
+    typedef void value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
</ins><span class="cx">     char dummy;
</span><del>-    ErrorType err;
-    constexpr Storage() : dummy() { }
-    constexpr Storage(ValueTagType) : dummy() { }
-    constexpr Storage(ErrorTagType) : err() { }
-    constexpr Storage(ErrorTagType, const ErrorType& err) : err(err) { }
-    constexpr Storage(ErrorTagType, ErrorType&& err) : err(std::forward<ErrorType>(err)) { }
-    ~Storage() { }
</del><ins>+    error_type err;
+    constexpr storage() : dummy() { }
+    constexpr storage(value_tag_t) : dummy() { }
+    constexpr storage(error_tag_t) : err() { }
+    constexpr storage(error_tag_t, const error_type& err) : err(err) { }
+    constexpr storage(error_tag_t, error_type&& err) : err(std::forward<error_type>(err)) { }
+    ~storage() { }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class T, class E>
</span><del>-struct ConstexprBase {
-    typedef T ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
-    ConstexprStorage<ValueType, ErrorType> s;
</del><ins>+struct constexpr_base {
+    typedef T value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
+    constexpr_storage<value_type, error_type> s;
</ins><span class="cx">     bool has;
</span><del>-    constexpr ConstexprBase() : s(), has(true) { }
-    constexpr ConstexprBase(ValueTagType tag) : s(tag), has(true) { }
-    constexpr ConstexprBase(ErrorTagType tag) : s(tag), has(false) { }
-    constexpr ConstexprBase(ValueTagType tag, const ValueType& val) : s(tag, val), has(true) { }
-    constexpr ConstexprBase(ErrorTagType tag, const ErrorType& err) : s(tag, err), has(false) { }
-    ~ConstexprBase() = default;
</del><ins>+    constexpr constexpr_base() : s(), has(true) { }
+    constexpr constexpr_base(value_tag_t tag) : s(tag), has(true) { }
+    constexpr constexpr_base(error_tag_t tag) : s(tag), has(false) { }
+    constexpr constexpr_base(value_tag_t tag, const value_type& val) : s(tag, val), has(true) { }
+    constexpr constexpr_base(error_tag_t tag, const error_type& err) : s(tag, err), has(false) { }
+    ~constexpr_base() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class T, class E>
</span><del>-struct Base {
-    typedef T ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
-    Storage<ValueType, ErrorType> s;
</del><ins>+struct base {
+    typedef T value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
+    storage<value_type, error_type> s;
</ins><span class="cx">     bool has;
</span><del>-    constexpr Base() : s(), has(true) { }
-    constexpr Base(ValueTagType tag) : s(tag), has(true) { }
-    constexpr Base(ErrorTagType tag) : s(tag), has(false) { }
-    constexpr Base(ValueTagType tag, const ValueType& val) : s(tag, val), has(true) { }
-    constexpr Base(ValueTagType tag, ValueType&& val) : s(tag, std::forward<ValueType>(val)), has(true) { }
-    constexpr Base(ErrorTagType tag, const ErrorType& err) : s(tag, err), has(false) { }
-    constexpr Base(ErrorTagType tag, ErrorType&& err) : s(tag, std::forward<ErrorType>(err)), has(false) { }
-    Base(const Base& o)
</del><ins>+    constexpr base() : s(), has(true) { }
+    constexpr base(value_tag_t tag) : s(tag), has(true) { }
+    constexpr base(error_tag_t tag) : s(tag), has(false) { }
+    constexpr base(value_tag_t tag, const value_type& val) : s(tag, val), has(true) { }
+    constexpr base(value_tag_t tag, value_type&& val) : s(tag, std::forward<value_type>(val)), has(true) { }
+    constexpr base(error_tag_t tag, const error_type& err) : s(tag, err), has(false) { }
+    constexpr base(error_tag_t tag, error_type&& err) : s(tag, std::forward<error_type>(err)), has(false) { }
+    base(const base& o)
</ins><span class="cx">         : has(o.has)
</span><span class="cx">     {
</span><span class="cx">         if (has)
</span><del>-            ::new (&s.val) ValueType(o.s.val);
</del><ins>+            ::new (&s.val) value_type(o.s.val);
</ins><span class="cx">         else
</span><del>-            ::new (&s.err) ErrorType(o.s.err);
</del><ins>+            ::new (&s.err) error_type(o.s.err);
</ins><span class="cx">     }
</span><del>-    Base(Base&& o)
</del><ins>+    base(base&& o)
</ins><span class="cx">         : has(o.has)
</span><span class="cx">     {
</span><span class="cx">         if (has)
</span><del>-            ::new (&s.val) ValueType(WTFMove(o.s.val));
</del><ins>+            ::new (&s.val) value_type(std::move(o.s.val));
</ins><span class="cx">         else
</span><del>-            ::new (&s.err) ErrorType(WTFMove(o.s.err));
</del><ins>+            ::new (&s.err) error_type(std::move(o.s.err));
</ins><span class="cx">     }
</span><del>-    ~Base()
</del><ins>+    ~base()
</ins><span class="cx">     {
</span><span class="cx">         if (has)
</span><span class="cx">             destroy(s.val);
</span><span class="lines">@@ -197,45 +357,45 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class E>
</span><del>-struct ConstexprBase<void, E> {
-    typedef void ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
-    ConstexprStorage<ValueType, ErrorType> s;
</del><ins>+struct constexpr_base<void, E> {
+    typedef void value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
+    constexpr_storage<value_type, error_type> s;
</ins><span class="cx">     bool has;
</span><del>-    constexpr ConstexprBase() : s(), has(true) { }
-    constexpr ConstexprBase(ValueTagType tag) : s(tag), has(true) { }
-    constexpr ConstexprBase(ErrorTagType tag) : s(tag), has(false) { }
-    constexpr ConstexprBase(ErrorTagType tag, const ErrorType& err) : s(tag, err), has(false) { }
-    constexpr ConstexprBase(ErrorTagType tag, ErrorType&& err) : s(tag, std::forward<ErrorType>(err)), has(false) { }
-    ~ConstexprBase() = default;
</del><ins>+    constexpr constexpr_base() : s(), has(true) { }
+    constexpr constexpr_base(value_tag_t tag) : s(tag), has(true) { }
+    constexpr constexpr_base(error_tag_t tag) : s(tag), has(false) { }
+    constexpr constexpr_base(error_tag_t tag, const error_type& err) : s(tag, err), has(false) { }
+    constexpr constexpr_base(error_tag_t tag, error_type&& err) : s(tag, std::forward<error_type>(err)), has(false) { }
+    ~constexpr_base() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class E>
</span><del>-struct Base<void, E> {
-    typedef void ValueType;
-    typedef E ErrorType;
-    typedef Unexpected<E> UnexpectedType;
-    Storage<ValueType, ErrorType> s;
</del><ins>+struct base<void, E> {
+    typedef void value_type;
+    typedef E error_type;
+    typedef unexpected<E> unexpected_type;
+    storage<value_type, error_type> s;
</ins><span class="cx">     bool has;
</span><del>-    constexpr Base() : s(), has(true) { }
-    constexpr Base(ValueTagType tag) : s(tag), has(true) { }
-    constexpr Base(ErrorTagType tag) : s(tag), has(false) { }
-    constexpr Base(ErrorTagType tag, const ErrorType& err) : s(tag, err), has(false) { }
-    constexpr Base(ErrorTagType tag, ErrorType&& err) : s(tag, std::forward<ErrorType>(err)), has(false) { }
-    Base(const Base& o)
</del><ins>+    constexpr base() : s(), has(true) { }
+    constexpr base(value_tag_t tag) : s(tag), has(true) { }
+    constexpr base(error_tag_t tag) : s(tag), has(false) { }
+    constexpr base(error_tag_t tag, const error_type& err) : s(tag, err), has(false) { }
+    constexpr base(error_tag_t tag, error_type&& err) : s(tag, std::forward<error_type>(err)), has(false) { }
+    base(const base& o)
</ins><span class="cx">         : has(o.has)
</span><span class="cx">     {
</span><span class="cx">         if (!has)
</span><del>-            ::new (&s.err) ErrorType(o.s.err);
</del><ins>+            ::new (&s.err) error_type(o.s.err);
</ins><span class="cx">     }
</span><del>-    Base(Base&& o)
</del><ins>+    base(base&& o)
</ins><span class="cx">         : has(o.has)
</span><span class="cx">     {
</span><span class="cx">         if (!has)
</span><del>-            ::new (&s.err) ErrorType(WTFMove(o.s.err));
</del><ins>+            ::new (&s.err) error_type(std::move(o.s.err));
</ins><span class="cx">     }
</span><del>-    ~Base()
</del><ins>+    ~base()
</ins><span class="cx">     {
</span><span class="cx">         if (!has)
</span><span class="cx">             destroy(s.err);
</span><span class="lines">@@ -243,145 +403,144 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class T, class E>
</span><del>-using BaseSelect = typename std::conditional<
</del><ins>+using base_select = typename std::conditional<
</ins><span class="cx">     ((std::is_void<T>::value || std::is_trivially_destructible<T>::value)
</span><span class="cx">         && std::is_trivially_destructible<E>::value),
</span><del>-    ConstexprBase<typename std::remove_const<T>::type, typename std::remove_const<E>::type>,
-    Base<typename std::remove_const<T>::type, typename std::remove_const<E>::type>
</del><ins>+    constexpr_base<typename std::remove_const<T>::type, typename std::remove_const<E>::type>,
+    base<typename std::remove_const<T>::type, typename std::remove_const<E>::type>
</ins><span class="cx"> >::type;
</span><span class="cx"> 
</span><del>-} // namespace ExpectedDetail
</del><ins>+} // namespace __expected_detail
</ins><span class="cx"> 
</span><span class="cx"> template<class T, class E>
</span><del>-class Expected : private ExpectedDetail::BaseSelect<T, E> {
-    typedef ExpectedDetail::BaseSelect<T, E> base;
</del><ins>+class expected : private __expected_detail::base_select<T, E> {
+    typedef __expected_detail::base_select<T, E> base;
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    typedef typename base::ValueType ValueType;
-    typedef typename base::ErrorType ErrorType;
-    typedef typename base::UnexpectedType UnexpectedType;
</del><ins>+    typedef typename base::value_type value_type;
+    typedef typename base::error_type error_type;
+    typedef typename base::unexpected_type unexpected_type;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    typedef Expected<ValueType, ErrorType> type;
</del><ins>+    typedef expected<value_type, error_type> type;
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     template<class U> struct rebind {
</span><del>-        using type = Expected<U, ErrorType>;
</del><ins>+        using type = expected<U, error_type>;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><del>-    constexpr Expected() : base(ExpectedDetail::ValueTag) { }
-    Expected(const Expected&) = default;
-    Expected(Expected&&) = default;
</del><ins>+    constexpr expected() : base(__expected_detail::value_tag) { }
+    expected(const expected&) = default;
+    expected(expected&&) = default;
</ins><span class="cx"> 
</span><del>-    constexpr Expected(const ValueType& e) : base(ExpectedDetail::ValueTag, e) { }
-    constexpr Expected(ValueType&& e) : base(ExpectedDetail::ValueTag, std::forward<ValueType>(e)) { }
-    template<class... Args> constexpr explicit Expected(InPlaceTag, Args&&... args) : base(ExpectedDetail::ValueTag, ValueType(std::forward<Args>(args)...)) { }
-    // template<class U, class... Args> constexpr explicit Expected(in_place_t, std::initializer_list<U>, Args&&...);
-    constexpr Expected(const UnexpectedType& u) : base(ExpectedDetail::ErrorTag, u.value()) { }
-    constexpr Expected(UnexpectedType&& u) : base(ExpectedDetail::ErrorTag, std::forward<UnexpectedType>(u).value()) { }
-    template<class Err> constexpr Expected(const Unexpected<Err>& u) : base(ExpectedDetail::ErrorTag, u.value()) { }
-    template<class Err> constexpr Expected(Unexpected<Err>&& u) : base(ExpectedDetail::ErrorTag, std::forward<Err>(u.value())) { }
-    template<class... Args> constexpr explicit Expected(UnexpectTag, Args&&... args) : base(ExpectedDetail::ValueTag, UnexpectedType(std::forward<Args>(args)...)) { }
-    // template<class U, class... Args> constexpr explicit Expected(UnexpectTag, std::initializer_list<U>, Args&&...);
</del><ins>+    constexpr expected(const value_type& e) : base(__expected_detail::value_tag, e) { }
+    constexpr expected(value_type&& e) : base(__expected_detail::value_tag, std::forward<value_type>(e)) { }
+    template<class... Args> constexpr explicit expected(std::in_place_t, Args&&... args) : base(__expected_detail::value_tag, value_type(std::forward<Args>(args)...)) { }
+    // template<class U, class... Args> constexpr explicit expected(in_place_t, std::initializer_list<U>, Args&&...);
+    constexpr expected(const unexpected_type& u) : base(__expected_detail::error_tag, u.value()) { }
+    constexpr expected(unexpected_type&& u) : base(__expected_detail::error_tag, std::forward<unexpected_type>(u).value()) { }
+    template<class Err> constexpr expected(const unexpected<Err>& u) : base(__expected_detail::error_tag, u.value()) { }
+    template<class Err> constexpr expected(unexpected<Err>&& u) : base(__expected_detail::error_tag, std::forward<Err>(u.value())) { }
+    template<class... Args> constexpr explicit expected(unexpected_t, Args&&... args) : base(__expected_detail::value_tag, unexpected_type(std::forward<Args>(args)...)) { }
+    // template<class U, class... Args> constexpr explicit expected(unexpected_t, std::initializer_list<U>, Args&&...);
</ins><span class="cx"> 
</span><del>-    ~Expected() = default;
</del><ins>+    ~expected() = default;
</ins><span class="cx"> 
</span><del>-    Expected& operator=(const Expected& e) { type(e).swap(*this); return *this; }
-    Expected& operator=(Expected&& e) { type(WTFMove(e)).swap(*this); return *this; }
-    template<class U> Expected& operator=(U&& u) { type(WTFMove(u)).swap(*this); return *this; }
-    Expected& operator=(const UnexpectedType& u) { type(u).swap(*this); return *this; }
-    Expected& operator=(UnexpectedType&& u) { type(WTFMove(u)).swap(*this); return *this; }
</del><ins>+    expected& operator=(const expected& e) { type(e).swap(*this); return *this; }
+    expected& operator=(expected&& e) { type(std::move(e)).swap(*this); return *this; }
+    template<class U> expected& operator=(U&& u) { type(std::move(u)).swap(*this); return *this; }
+    expected& operator=(const unexpected_type& u) { type(u).swap(*this); return *this; }
+    expected& operator=(unexpected_type&& u) { type(std::move(u)).swap(*this); return *this; }
</ins><span class="cx">     // template<class... Args> void emplace(Args&&...);
</span><span class="cx">     // template<class U, class... Args> void emplace(std::initializer_list<U>, Args&&...);
</span><span class="cx"> 
</span><del>-    void swap(Expected& o)
</del><ins>+    void swap(expected& o)
</ins><span class="cx">     {
</span><span class="cx">         using std::swap;
</span><span class="cx">         if (base::has && o.has)
</span><span class="cx">             swap(base::s.val, o.s.val);
</span><span class="cx">         else if (base::has && !o.has) {
</span><del>-            ErrorType e(WTFMove(o.s.err));
-            ExpectedDetail::destroy(o.s.err);
-            ::new (&o.s.val) ValueType(WTFMove(base::s.val));
-            ExpectedDetail::destroy(base::s.val);
-            ::new (&base::s.err) ErrorType(WTFMove(e));
</del><ins>+            error_type e(std::move(o.s.err));
+            __expected_detail::destroy(o.s.err);
+            ::new (&o.s.val) value_type(std::move(base::s.val));
+            __expected_detail::destroy(base::s.val);
+            ::new (&base::s.err) error_type(std::move(e));
</ins><span class="cx">             swap(base::has, o.has);
</span><span class="cx">         } else if (!base::has && o.has) {
</span><del>-            ValueType v(WTFMove(o.s.val));
-            ExpectedDetail::destroy(o.s.val);
-            ::new (&o.s.err) ErrorType(WTFMove(base::s.err));
-            ExpectedDetail::destroy(base::s.err);
-            ::new (&base::s.val) ValueType(WTFMove(v));
</del><ins>+            value_type v(std::move(o.s.val));
+            __expected_detail::destroy(o.s.val);
+            ::new (&o.s.err) error_type(std::move(base::s.err));
+            __expected_detail::destroy(base::s.err);
+            ::new (&base::s.val) value_type(std::move(v));
</ins><span class="cx">             swap(base::has, o.has);
</span><span class="cx">         } else
</span><span class="cx">             swap(base::s.err, o.s.err);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    constexpr const ValueType* operator->() const { return &base::s.val; }
-    ValueType* operator->() { return &base::s.val; }
-    constexpr const ValueType& operator*() const & { return base::s.val; }
-    ValueType& operator*() & { return base::s.val; }
-    constexpr const ValueType&& operator*() const && { return WTFMove(base::s.val); }
-    RELAXED_CONSTEXPR ValueType&& operator*() && { return WTFMove(base::s.val); }
</del><ins>+    constexpr const value_type* operator->() const { return &base::s.val; }
+    value_type* operator->() { return &base::s.val; }
+    constexpr const value_type& operator*() const & { return base::s.val; }
+    value_type& operator*() & { return base::s.val; }
+    constexpr const value_type&& operator*() const && { return std::move(base::s.val); }
+    RELAXED_CONSTEXPR value_type&& operator*() && { return std::move(base::s.val); }
</ins><span class="cx">     constexpr explicit operator bool() const { return base::has; }
</span><del>-    constexpr bool hasValue() const { return base::has; }
-    constexpr const ValueType& value() const & { return base::has ? base::s.val : (ExpectedDetail::Throw(), base::s.val); }
-    RELAXED_CONSTEXPR ValueType& value() & { return base::has ? base::s.val : (ExpectedDetail::Throw(), base::s.val); }
-    constexpr const ValueType&& value() const && { return WTFMove(base::has ? base::s.val : (ExpectedDetail::Throw(), base::s.val)); }
-    RELAXED_CONSTEXPR ValueType&& value() && { return WTFMove(base::has ? base::s.val : (ExpectedDetail::Throw(), base::s.val)); }
-    constexpr const ErrorType& error() const & { return !base::has ? base::s.err : (ExpectedDetail::Throw(), base::s.err); }
-    ErrorType& error() & { return !base::has ? base::s.err : (ExpectedDetail::Throw(), base::s.err); }
-    RELAXED_CONSTEXPR ErrorType&& error() && { return WTFMove(!base::has ? base::s.err : (ExpectedDetail::Throw(), base::s.err)); }
-    constexpr const ErrorType&& error() const && { return WTFMove(!base::has ? base::s.err : (ExpectedDetail::Throw(), base::s.err)); }
-    constexpr UnexpectedType getUnexpected() const { return UnexpectedType(base::s.err); }
-    template<class U> constexpr ValueType valueOr(U&& u) const & { return base::has ? **this : static_cast<ValueType>(std::forward<U>(u)); }
-    template<class U> ValueType valueOr(U&& u) && { return base::has ? WTFMove(**this) : static_cast<ValueType>(std::forward<U>(u)); }
</del><ins>+    constexpr bool has_value() const { return base::has; }
+    constexpr const value_type& value() const & { return base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val); }
+    RELAXED_CONSTEXPR value_type& value() & { return base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val); }
+    constexpr const value_type&& value() const && { return std::move(base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val)); }
+    RELAXED_CONSTEXPR value_type&& value() && { return std::move(base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val)); }
+    constexpr const error_type& error() const & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
+    error_type& error() & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
+    RELAXED_CONSTEXPR error_type&& error() && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
+    constexpr const error_type&& error() const && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
+    template<class U> constexpr value_type value_or(U&& u) const & { return base::has ? **this : static_cast<value_type>(std::forward<U>(u)); }
+    template<class U> value_type value_or(U&& u) && { return base::has ? std::move(**this) : static_cast<value_type>(std::forward<U>(u)); }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template<class E>
</span><del>-class Expected<void, E> : private ExpectedDetail::BaseSelect<void, E> {
-    typedef ExpectedDetail::BaseSelect<void, E> base;
</del><ins>+class expected<void, E> : private __expected_detail::base_select<void, E> {
+    typedef __expected_detail::base_select<void, E> base;
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    typedef typename base::ValueType ValueType;
-    typedef typename base::ErrorType ErrorType;
-    typedef typename base::UnexpectedType UnexpectedType;
</del><ins>+    typedef typename base::value_type value_type;
+    typedef typename base::error_type error_type;
+    typedef typename base::unexpected_type unexpected_type;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    typedef Expected<ValueType, ErrorType> type;
</del><ins>+    typedef expected<value_type, error_type> type;
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     template<class U> struct rebind {
</span><del>-        using type = Expected<U, ErrorType>;
</del><ins>+        using type = expected<U, error_type>;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><del>-    constexpr Expected() : base(ExpectedDetail::ValueTag) { }
-    Expected(const Expected&) = default;
-    Expected(Expected&&) = default;
-    // constexpr explicit Expected(in_place_t);
-    constexpr Expected(UnexpectedType const& u) : base(ExpectedDetail::ErrorTag, u.value()) { }
-    constexpr Expected(UnexpectedType&& u) : base(ExpectedDetail::ErrorTag, std::forward<UnexpectedType>(u).value()) { }
-    template<class Err> constexpr Expected(Unexpected<Err> const& u) : base(ExpectedDetail::ErrorTag, u.value()) { }
</del><ins>+    constexpr expected() : base(__expected_detail::value_tag) { }
+    expected(const expected&) = default;
+    expected(expected&&) = default;
+    // constexpr explicit expected(in_place_t);
+    constexpr expected(unexpected_type const& u) : base(__expected_detail::error_tag, u.value()) { }
+    constexpr expected(unexpected_type&& u) : base(__expected_detail::error_tag, std::forward<unexpected_type>(u).value()) { }
+    template<class Err> constexpr expected(unexpected<Err> const& u) : base(__expected_detail::error_tag, u.value()) { }
</ins><span class="cx"> 
</span><del>-    ~Expected() = default;
</del><ins>+    ~expected() = default;
</ins><span class="cx"> 
</span><del>-    Expected& operator=(const Expected& e) { type(e).swap(*this); return *this; }
-    Expected& operator=(Expected&& e) { type(WTFMove(e)).swap(*this); return *this; }
-    Expected& operator=(const UnexpectedType& u) { type(u).swap(*this); return *this; } // Not in the current paper.
-    Expected& operator=(UnexpectedType&& u) { type(WTFMove(u)).swap(*this); return *this; } // Not in the current paper.
</del><ins>+    expected& operator=(const expected& e) { type(e).swap(*this); return *this; }
+    expected& operator=(expected&& e) { type(std::move(e)).swap(*this); return *this; }
+    expected& operator=(const unexpected_type& u) { type(u).swap(*this); return *this; } // Not in the current paper.
+    expected& operator=(unexpected_type&& u) { type(std::move(u)).swap(*this); return *this; } // Not in the current paper.
</ins><span class="cx">     // void emplace();
</span><span class="cx"> 
</span><del>-    void swap(Expected& o)
</del><ins>+    void swap(expected& o)
</ins><span class="cx">     {
</span><span class="cx">         using std::swap;
</span><span class="cx">         if (base::has && o.has) {
</span><span class="cx">             // Do nothing.
</span><span class="cx">         } else if (base::has && !o.has) {
</span><del>-            ErrorType e(WTFMove(o.s.err));
-            ::new (&base::s.err) ErrorType(e);
</del><ins>+            error_type e(std::move(o.s.err));
+            ::new (&base::s.err) error_type(e);
</ins><span class="cx">             swap(base::has, o.has);
</span><span class="cx">         } else if (!base::has && o.has) {
</span><del>-            ::new (&o.s.err) ErrorType(WTFMove(base::s.err));
</del><ins>+            ::new (&o.s.err) error_type(std::move(base::s.err));
</ins><span class="cx">             swap(base::has, o.has);
</span><span class="cx">         } else
</span><span class="cx">             swap(base::s.err, o.s.err);
</span><span class="lines">@@ -388,48 +547,31 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     constexpr explicit operator bool() const { return base::has; }
</span><del>-    constexpr bool hasValue() const { return base::has; }
-    void value() const { !base::has ? ExpectedDetail::Throw() : void(); }
-    constexpr const E& error() const & { return !base::has ? base::s.err : (ExpectedDetail::Throw(), base::s.err); }
-    E& error() & { return !base::has ? base::s.err : (ExpectedDetail::Throw(), base::s.err); }
-    RELAXED_CONSTEXPR E&& error() && { return WTFMove(!base::has ? base::s.err : (ExpectedDetail::Throw(), base::s.err)); }
-    constexpr UnexpectedType getUnexpected() const { return UnexpectedType(base::s.err); }
</del><ins>+    constexpr bool has_value() const { return base::has; }
+    void value() const { !base::has ? __EXPECTED_THROW(bad_expected_access<void>()) : void(); }
+    constexpr const E& error() const & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
+    E& error() & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
+    RELAXED_CONSTEXPR E&& error() && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<class T, class E> constexpr bool operator==(const Expected<T, E>& x, const Expected<T, E>& y) { return bool(x) == bool(y) && (x ? x.value() == y.value() : x.error() == y.error()); }
-template<class T, class E> constexpr bool operator!=(const Expected<T, E>& x, const Expected<T, E>& y) { return !(x == y); }
</del><ins>+template<class T, class E> constexpr bool operator==(const expected<T, E>& x, const expected<T, E>& y) { return bool(x) == bool(y) && (x ? x.value() == y.value() : x.error() == y.error()); }
+template<class T, class E> constexpr bool operator!=(const expected<T, E>& x, const expected<T, E>& y) { return !(x == y); }
</ins><span class="cx"> 
</span><del>-template<class E> constexpr bool operator==(const Expected<void, E>& x, const Expected<void, E>& y) { return bool(x) == bool(y) && (x ? true : x.error() == y.error()); }
</del><ins>+template<class E> constexpr bool operator==(const expected<void, E>& x, const expected<void, E>& y) { return bool(x) == bool(y) && (x ? true : x.error() == y.error()); }
</ins><span class="cx"> 
</span><del>-template<class T, class E> constexpr bool operator==(const Expected<T, E>& x, const T& y) { return x == Expected<T, E>(y); }
-template<class T, class E> constexpr bool operator==(const T& x, const Expected<T, E>& y) { return Expected<T, E>(x) == y; }
-template<class T, class E> constexpr bool operator!=(const Expected<T, E>& x, const T& y) { return x != Expected<T, E>(y); }
-template<class T, class E> constexpr bool operator!=(const T& x, const Expected<T, E>& y) { return Expected<T, E>(x) != y; }
</del><ins>+template<class T, class E> constexpr bool operator==(const expected<T, E>& x, const T& y) { return x == expected<T, E>(y); }
+template<class T, class E> constexpr bool operator==(const T& x, const expected<T, E>& y) { return expected<T, E>(x) == y; }
+template<class T, class E> constexpr bool operator!=(const expected<T, E>& x, const T& y) { return x != expected<T, E>(y); }
+template<class T, class E> constexpr bool operator!=(const T& x, const expected<T, E>& y) { return expected<T, E>(x) != y; }
</ins><span class="cx"> 
</span><del>-template<class T, class E> constexpr bool operator==(const Expected<T, E>& x, const Unexpected<E>& y) { return x == Expected<T, E>(y); }
-template<class T, class E> constexpr bool operator==(const Unexpected<E>& x, const Expected<T, E>& y) { return Expected<T, E>(x) == y; }
-template<class T, class E> constexpr bool operator!=(const Expected<T, E>& x, const Unexpected<E>& y) { return x != Expected<T, E>(y); }
-template<class T, class E> constexpr bool operator!=(const Unexpected<E>& x, const Expected<T, E>& y) { return Expected<T, E>(x) != y; }
</del><ins>+template<class T, class E> constexpr bool operator==(const expected<T, E>& x, const unexpected<E>& y) { return x == expected<T, E>(y); }
+template<class T, class E> constexpr bool operator==(const unexpected<E>& x, const expected<T, E>& y) { return expected<T, E>(x) == y; }
+template<class T, class E> constexpr bool operator!=(const expected<T, E>& x, const unexpected<E>& y) { return x != expected<T, E>(y); }
+template<class T, class E> constexpr bool operator!=(const unexpected<E>& x, const expected<T, E>& y) { return expected<T, E>(x) != y; }
</ins><span class="cx"> 
</span><del>-template<typename T, typename E> void swap(Expected<T, E>& x, Expected<T, E>& y) { x.swap(y); }
</del><ins>+template<typename T, typename E> void swap(expected<T, E>& x, expected<T, E>& y) { x.swap(y); }
</ins><span class="cx"> 
</span><del>-// Note: this isn't in the current proposal because it relies on C++17 deduction guides instead.
-template<class T, class E = std::nullopt_t> constexpr Expected<std::decay_t<T>, E> makeExpected(T&& v)
-{
-    return Expected<typename std::decay<T>::type, E>(std::forward<T>(v));
-}
-template<class T, class E> constexpr Expected<T, std::decay_t<E>> makeExpectedFromError(E&& e) { return Expected<T, std::decay_t<E>>(makeUnexpected(e)); }
-template<class T, class E, class U> constexpr Expected<T, E> makeExpectedFromError(U&& u) { return Expected<T, E>(makeUnexpected(E { std::forward<U>(u) } )); }
-// template<class F, class E = std::nullopt_t> constexpr Expected<typename std::result_of<F>::type, E> makeExpected_from_call(F f);
</del><ins>+}}} // namespace std::experimental::fundamentals_v3
</ins><span class="cx"> 
</span><del>-inline Expected<void, std::nullopt_t> makeExpected() { return Expected<void, std::nullopt_t>(); }
-
-} // namespace WTF
-
-using WTF::InPlace;
-using WTF::Unexpected;
-using WTF::makeUnexpected;
-using WTF::Unexpect;
-using WTF::Expected;
-using WTF::makeExpected;
-using WTF::makeExpectedFromError;
</del><ins>+__EXPECTED_INLINE_VARIABLE constexpr std::experimental::unexpected_t& unexpect = std::experimental::unexpect;
+template<class T, class E> using Expected = std::experimental::expected<T, E>;
</ins></span></pre></div>
<a id="trunkSourceWTFwtfForwardh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Forward.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Forward.h   2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WTF/wtf/Forward.h      2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -60,7 +60,6 @@
</span><span class="cx"> template<typename> struct HashTraits;
</span><span class="cx"> 
</span><span class="cx"> template<typename...> class Variant;
</span><del>-template<class, class> class Expected;
</del><span class="cx"> template<typename, size_t = 0, typename = CrashOnOverflow, size_t = 16, typename = FastMalloc> class Vector;
</span><span class="cx"> template<typename Value, typename = typename DefaultHash<Value>::Hash, typename = HashTraits<Value>> class HashCountedSet;
</span><span class="cx"> template<typename KeyArg, typename MappedArg, typename = typename DefaultHash<KeyArg>::Hash, typename = HashTraits<KeyArg>, typename = HashTraits<MappedArg>> class HashMap;
</span><span class="lines">@@ -68,12 +67,18 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+namespace std {
+namespace experimental {
+inline namespace fundamentals_v3 {
+template<class, class> class expected;
+template<class> class unexpected;
+}}} // namespace std::experimental::fundamentals_v3
+
</ins><span class="cx"> using WTF::AtomicString;
</span><span class="cx"> using WTF::AtomicStringImpl;
</span><span class="cx"> using WTF::BinarySemaphore;
</span><span class="cx"> using WTF::CString;
</span><span class="cx"> using WTF::CompletionHandler;
</span><del>-using WTF::Expected;
</del><span class="cx"> using WTF::Function;
</span><span class="cx"> using WTF::FunctionDispatcher;
</span><span class="cx"> using WTF::HashCountedSet;
</span><span class="lines">@@ -97,3 +102,6 @@
</span><span class="cx"> using WTF::TextStream;
</span><span class="cx"> using WTF::Variant;
</span><span class="cx"> using WTF::Vector;
</span><ins>+
+template<class T, class E> using Expected = std::experimental::expected<T, E>;
+template<class E> using Unexpected = std::experimental::unexpected<E>;
</ins></span></pre></div>
<a id="trunkSourceWTFwtfOptionalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Optional.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Optional.h  2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WTF/wtf/Optional.h     2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -282,10 +282,6 @@
</span><span class="cx"> constexpr struct trivial_init_t{} trivial_init{};
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-// 20.5.6, In-place construction
-constexpr struct in_place_t{} in_place{};
-
-
</del><span class="cx"> // 20.5.7, Disengaged state indicator
</span><span class="cx"> struct nullopt_t
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWTFwtfStdLibExtrash"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/StdLibExtras.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/StdLibExtras.h      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WTF/wtf/StdLibExtras.h 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -525,6 +525,29 @@
</span><span class="cx"> template<class... _Args> struct conjunction : wtf_conjunction_impl<_Args...> { };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if __cplusplus < 201703L
+
+// These are inline variable for C++17 and later.
+#define __IN_PLACE_INLINE_VARIABLE static const
+
+struct in_place_t {
+    explicit in_place_t() = default;
+};
+__IN_PLACE_INLINE_VARIABLE constexpr in_place_t in_place { };
+
+template <class T> struct in_place_type_t {
+    explicit in_place_type_t() = default;
+};
+template <class T>
+__IN_PLACE_INLINE_VARIABLE constexpr in_place_type_t<T> in_place_type { };
+
+template <size_t I> struct in_place_index_t {
+    explicit in_place_index_t() = default;
+};
+template <size_t I>
+__IN_PLACE_INLINE_VARIABLE constexpr in_place_index_t<I> in_place_index { };
+#endif // __cplusplus < 201703L
+
</ins><span class="cx"> } // namespace std
</span><span class="cx"> 
</span><span class="cx"> #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value)
</span></span></pre></div>
<a id="trunkSourceWTFwtfUnexpectedh"></a>
<div class="addfile"><h4>Added: trunk/Source/WTF/wtf/Unexpected.h (0 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Unexpected.h                                (rev 0)
+++ trunk/Source/WTF/wtf/Unexpected.h   2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2016-2017 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.
+ */
+
+// Implementation of Library Fundamentals v3's std::expected, as described here: http://wg21.link/p0323r4
+
+#pragma once
+
+/*
+    unexpected synopsis
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v3 {
+    // ?.?.3, Unexpected object type
+    template <class E>
+      class unexpected;
+
+    // ?.?.4, Unexpected relational operators
+    template <class E>
+        constexpr bool
+        operator==(const unexpected<E>&, const unexpected<E>&);
+    template <class E>
+        constexpr bool
+        operator!=(const unexpected<E>&, const unexpected<E>&);
+
+    template <class E>
+    class unexpected {
+    public:
+        unexpected() = delete;
+        constexpr explicit unexpected(const E&);
+        constexpr explicit unexpected(E&&);
+        constexpr const E& value() const &;
+        constexpr E& value() &;
+        constexpr E&& value() &&;
+        constexpr E const&& value() const&&;
+    private:
+        E val; // exposition only
+    };
+
+}}}
+
+*/
+
+#include <cstdlib>
+#include <utility>
+#include <wtf/StdLibExtras.h>
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v3 {
+
+template<class E>
+class unexpected {
+public:
+    unexpected() = delete;
+    constexpr explicit unexpected(const E& e) : val(e) { }
+    constexpr explicit unexpected(E&& e) : val(std::forward<E>(e)) { }
+    constexpr const E& value() const & { return val; }
+    RELAXED_CONSTEXPR E& value() & { return val; }
+    RELAXED_CONSTEXPR E&& value() && { return WTFMove(val); }
+    RELAXED_CONSTEXPR const E&& value() const && { return WTFMove(val); }
+
+private:
+    E val;
+};
+
+template<class E> constexpr bool operator==(const unexpected<E>& lhs, const unexpected<E>& rhs) { return lhs.value() == rhs.value(); }
+template<class E> constexpr bool operator!=(const unexpected<E>& lhs, const unexpected<E>& rhs) { return lhs.value() != rhs.value(); }
+
+}}} // namespace std::experimental::fundamentals_v3
+
+template<class E> using Unexpected = std::experimental::unexpected<E>;
+
+// Not in the std::expected spec, but useful to work around lack of C++17 deduction guides.
+template<class E> constexpr Unexpected<std::decay_t<E>> makeUnexpected(E&& v) { return Unexpected<typename std::decay<E>::type>(std::forward<E>(v)); }
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/ChangeLog      2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,3 +1,101 @@
</span><ins>+2017-12-04  JF Bastien  <jfbastien@apple.com>
+
+        Update std::expected to match libc++ coding style
+        https://bugs.webkit.org/show_bug.cgi?id=180264
+
+        Reviewed by Alex Christensen.
+
+        Update various uses of Expected, mostly renaming valueOr and
+        hasValue to the STL naming convention.
+
+        * Modules/cache/DOMCache.cpp:
+        (WebCore::DOMCache::retrieveRecords):
+        (WebCore::DOMCache::batchDeleteOperation):
+        (WebCore::DOMCache::batchPutOperation):
+        * Modules/cache/DOMCacheStorage.cpp:
+        (WebCore::DOMCacheStorage::retrieveCaches):
+        (WebCore::DOMCacheStorage::open):
+        (WebCore::DOMCacheStorage::remove):
+        * Modules/cache/WorkerCacheStorageConnection.cpp:
+        (WebCore::WorkerCacheStorageConnection::doRemove):
+        (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
+        (WebCore::recordsDataOrErrorFromRecords):
+        (WebCore::recordsOrErrorFromRecordsData):
+        * bindings/js/CachedScriptFetcher.cpp:
+        (WebCore::CachedScriptFetcher::requestScriptWithCache const):
+        * contentextensions/ContentExtensionCompiler.cpp:
+        (WebCore::ContentExtensions::compileRuleList):
+        * contentextensions/ContentExtensionParser.cpp:
+        (WebCore::ContentExtensions::getDomainList):
+        (WebCore::ContentExtensions::loadTrigger):
+        (WebCore::ContentExtensions::loadRule):
+        (WebCore::ContentExtensions::loadEncodedRules):
+        (WebCore::ContentExtensions::parseRuleList):
+        * css/CSSFontFaceSrcValue.cpp:
+        (WebCore::CSSFontFaceSrcValue::cachedFont):
+        * css/CSSImageSetValue.cpp:
+        (WebCore::CSSImageSetValue::loadBestFitImage):
+        * css/CSSImageValue.cpp:
+        (WebCore::CSSImageValue::loadImage):
+        * css/StyleRuleImport.cpp:
+        (WebCore::StyleRuleImport::requestStyleSheet):
+        * dom/CallbackResult.h:
+        (WebCore::CallbackResult<ReturnType>::type const):
+        (WebCore::CallbackResult<ReturnType>::releaseReturnValue):
+        * dom/Element.cpp:
+        (WebCore::Element::getIntegralAttribute const):
+        (WebCore::Element::getUnsignedIntegralAttribute const):
+        * dom/ExceptionOr.h:
+        (WebCore::ExceptionOr<ReturnType>::hasException const):
+        (WebCore::ExceptionOr<void>::hasException const):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::maxLengthAttributeChanged):
+        (WebCore::HTMLInputElement::minLengthAttributeChanged):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
+        (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::parseHTMLNonNegativeInteger):
+        * html/parser/HTMLParserIdioms.h:
+        (WebCore::limitToOnlyHTMLNonNegative):
+        * loader/CrossOriginPreflightChecker.cpp:
+        (WebCore::CrossOriginPreflightChecker::startPreflight):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::loadMainResource):
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::loadRequest):
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::updateFromElement):
+        * loader/LinkLoader.cpp:
+        (WebCore::LinkLoader::preloadIfNeeded):
+        (WebCore::LinkLoader::loadLink):
+        * loader/MediaResourceLoader.cpp:
+        (WebCore::MediaResourceLoader::requestResource):
+        * loader/TextTrackLoader.cpp:
+        (WebCore::TextTrackLoader::load):
+        * loader/cache/CachedSVGDocumentReference.cpp:
+        (WebCore::CachedSVGDocumentReference::load):
+        * loader/icon/IconLoader.cpp:
+        (WebCore::IconLoader::startLoading):
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::parseIPv4Host):
+        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
+        (WebCore::WebCoreAVCFResourceLoader::startLoading):
+        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+        (WebCore::WebCoreAVFResourceLoader::startLoading):
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::requestImageResource):
+        * svg/SVGFontFaceUriElement.cpp:
+        (WebCore::SVGFontFaceUriElement::loadFont):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::updateExternalDocument):
+        * xml/XSLImportRule.cpp:
+        (WebCore::XSLImportRule::loadSheet):
+
</ins><span class="cx"> 2017-12-04  Zalan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheDOMCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/DOMCache.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/DOMCache.cpp  2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/Modules/cache/DOMCache.cpp     2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -420,12 +420,12 @@
</span><span class="cx"> 
</span><span class="cx">     m_connection->retrieveRecords(m_identifier, retrieveURL, [this, callback = WTFMove(callback)](RecordsOrError&& result) {
</span><span class="cx">         if (!m_isStopped) {
</span><del>-            if (!result.hasValue()) {
</del><ins>+            if (!result.has_value()) {
</ins><span class="cx">                 callback(DOMCacheEngine::errorToException(result.error()));
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if (result.hasValue())
</del><ins>+            if (result.has_value())
</ins><span class="cx">                 updateRecords(WTFMove(result.value()));
</span><span class="cx">             callback(std::nullopt);
</span><span class="cx">         }
</span><span class="lines">@@ -469,7 +469,7 @@
</span><span class="cx">     setPendingActivity(this);
</span><span class="cx">     m_connection->batchDeleteOperation(m_identifier, request.internalRequest(), WTFMove(options), [this, callback = WTFMove(callback)](RecordIdentifiersOrError&& result) {
</span><span class="cx">         if (!m_isStopped) {
</span><del>-            if (!result.hasValue())
</del><ins>+            if (!result.has_value())
</ins><span class="cx">                 callback(DOMCacheEngine::errorToException(result.error()));
</span><span class="cx">             else
</span><span class="cx">                 callback(!result.value().isEmpty());
</span><span class="lines">@@ -512,7 +512,7 @@
</span><span class="cx">     setPendingActivity(this);
</span><span class="cx">     m_connection->batchPutOperation(m_identifier, WTFMove(records), [this, callback = WTFMove(callback)](RecordIdentifiersOrError&& result) {
</span><span class="cx">         if (!m_isStopped) {
</span><del>-            if (!result.hasValue())
</del><ins>+            if (!result.has_value())
</ins><span class="cx">                 callback(DOMCacheEngine::errorToException(result.error()));
</span><span class="cx">             else
</span><span class="cx">                 callback({ });
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheDOMCacheStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp   2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp      2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">     setPendingActivity(this);
</span><span class="cx">     m_connection->retrieveCaches(origin, m_updateCounter, [this, callback = WTFMove(callback)](CacheInfosOrError&& result) mutable {
</span><span class="cx">         if (!m_isStopped) {
</span><del>-            if (!result.hasValue()) {
</del><ins>+            if (!result.has_value()) {
</ins><span class="cx">                 callback(DOMCacheEngine::errorToException(result.error()));
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx">         setPendingActivity(this);
</span><span class="cx">         m_connection->open(origin, name, [this, name, promise = WTFMove(promise)](const CacheIdentifierOrError& result) mutable {
</span><span class="cx">             if (!m_isStopped) {
</span><del>-                if (!result.hasValue())
</del><ins>+                if (!result.has_value())
</ins><span class="cx">                     promise.reject(DOMCacheEngine::errorToException(result.error()));
</span><span class="cx">                 else {
</span><span class="cx">                     if (result.value().hadStorageError)
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx">         setPendingActivity(this);
</span><span class="cx">         m_connection->remove(m_caches[position]->identifier(), [this, name, promise = WTFMove(promise)](const CacheIdentifierOrError& result) mutable {
</span><span class="cx">             if (!m_isStopped) {
</span><del>-                if (!result.hasValue())
</del><ins>+                if (!result.has_value())
</ins><span class="cx">                     promise.reject(DOMCacheEngine::errorToException(result.error()));
</span><span class="cx">                 else {
</span><span class="cx">                     if (result.value().hadStorageError)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheWorkerCacheStorageConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> {
</span><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, cacheIdentifier] () mutable {
</span><span class="cx">         mainThreadConnection->remove(cacheIdentifier, [workerThread = WTFMove(workerThread), requestIdentifier, cacheIdentifier] (const CacheIdentifierOrError& result) mutable {
</span><del>-            ASSERT_UNUSED(cacheIdentifier, !result.hasValue() || result.value().identifier == cacheIdentifier);
</del><ins>+            ASSERT_UNUSED(cacheIdentifier, !result.has_value() || result.value().identifier == cacheIdentifier);
</ins><span class="cx">             workerThread->runLoop().postTaskForMode([requestIdentifier, result] (auto& scope) mutable {
</span><span class="cx">                 downcast<WorkerGlobalScope>(scope).cacheStorageConnection().removeCompleted(requestIdentifier, result);
</span><span class="cx">             }, WorkerRunLoop::defaultMode());
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, origin = origin.isolatedCopy(), updateCounter] () mutable {
</span><span class="cx">         mainThreadConnection->retrieveCaches(origin, updateCounter, [workerThread = WTFMove(workerThread), requestIdentifier] (CacheInfosOrError&& result) mutable {
</span><span class="cx">             CacheInfosOrError isolatedResult;
</span><del>-            if (!result.hasValue())
</del><ins>+            if (!result.has_value())
</ins><span class="cx">                 isolatedResult = WTFMove(result);
</span><span class="cx">             else
</span><span class="cx">                 isolatedResult = result.value().isolatedCopy();
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline Expected<Vector<CrossThreadRecordData>, Error> recordsDataOrErrorFromRecords(const RecordsOrError& result)
</span><span class="cx"> {
</span><del>-    if (!result.hasValue())
</del><ins>+    if (!result.has_value())
</ins><span class="cx">         return makeUnexpected(result.error());
</span><span class="cx"> 
</span><span class="cx">     return recordsDataFromRecords(result.value());
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline RecordsOrError recordsOrErrorFromRecordsData(Expected<Vector<CrossThreadRecordData>, Error>&& recordsData)
</span><span class="cx"> {
</span><del>-    if (!recordsData.hasValue())
</del><ins>+    if (!recordsData.has_value())
</ins><span class="cx">         return makeUnexpected(recordsData.error());
</span><span class="cx">     return recordsFromRecordsData(WTFMove(recordsData.value()));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsCachedScriptFetchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/CachedScriptFetcher.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/CachedScriptFetcher.cpp 2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/bindings/js/CachedScriptFetcher.cpp    2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     if (!m_initiatorName.isNull())
</span><span class="cx">         request.setInitiator(m_initiatorName);
</span><span class="cx"> 
</span><del>-    return document.cachedResourceLoader().requestScript(WTFMove(request)).valueOr(nullptr);
</del><ins>+    return document.cachedResourceLoader().requestScript(WTFMove(request)).value_or(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -287,7 +287,7 @@
</span><span class="cx"> std::error_code compileRuleList(ContentExtensionCompilationClient& client, String&& ruleJSON)
</span><span class="cx"> {
</span><span class="cx">     auto ruleList = parseRuleList(WTFMove(ruleJSON));
</span><del>-    if (!ruleList.hasValue())
</del><ins>+    if (!ruleList.has_value())
</ins><span class="cx">         return ruleList.error();
</span><span class="cx">     Vector<ContentExtensionRule> parsedRuleList = WTFMove(ruleList.value());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp        2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp   2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> static Expected<Vector<String>, std::error_code> getDomainList(ExecState& exec, const JSObject* arrayObject)
</span><span class="cx"> {
</span><span class="cx">     auto strings = getStringList(exec, arrayObject);
</span><del>-    if (!strings.hasValue())
</del><ins>+    if (!strings.has_value())
</ins><span class="cx">         return strings;
</span><span class="cx">     for (auto& domain : strings.value()) {
</span><span class="cx">         // Domains should be punycode encoded lower case.
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx">     const JSValue ifDomainValue = triggerObject.get(&exec, Identifier::fromString(&exec, "if-domain"));
</span><span class="cx">     if (!scope.exception() && ifDomainValue.isObject()) {
</span><span class="cx">         auto ifDomain = getDomainList(exec, asObject(ifDomainValue));
</span><del>-        if (!ifDomain.hasValue())
</del><ins>+        if (!ifDomain.has_value())
</ins><span class="cx">             return makeUnexpected(ifDomain.error());
</span><span class="cx">         trigger.conditions = WTFMove(ifDomain.value());
</span><span class="cx">         if (trigger.conditions.isEmpty())
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">         if (trigger.conditionType != Trigger::ConditionType::None)
</span><span class="cx">             return makeUnexpected(ContentExtensionError::JSONMultipleConditions);
</span><span class="cx">         auto unlessDomain = getDomainList(exec, asObject(unlessDomainValue));
</span><del>-        if (!unlessDomain.hasValue())
</del><ins>+        if (!unlessDomain.has_value())
</ins><span class="cx">             return makeUnexpected(unlessDomain.error());
</span><span class="cx">         trigger.conditions = WTFMove(unlessDomain.value());
</span><span class="cx">         if (trigger.conditions.isEmpty())
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">         if (trigger.conditionType != Trigger::ConditionType::None)
</span><span class="cx">             return makeUnexpected(ContentExtensionError::JSONMultipleConditions);
</span><span class="cx">         auto ifTopURL = getStringList(exec, asObject(ifTopURLValue));
</span><del>-        if (!ifTopURL.hasValue())
</del><ins>+        if (!ifTopURL.has_value())
</ins><span class="cx">             return makeUnexpected(ifTopURL.error());
</span><span class="cx">         trigger.conditions = WTFMove(ifTopURL.value());
</span><span class="cx">         if (trigger.conditions.isEmpty())
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">         if (trigger.conditionType != Trigger::ConditionType::None)
</span><span class="cx">             return makeUnexpected(ContentExtensionError::JSONMultipleConditions);
</span><span class="cx">         auto unlessTopURL = getStringList(exec, asObject(unlessTopURLValue));
</span><del>-        if (!unlessTopURL.hasValue())
</del><ins>+        if (!unlessTopURL.has_value())
</ins><span class="cx">             return makeUnexpected(unlessTopURL.error());
</span><span class="cx">         trigger.conditions = WTFMove(unlessTopURL.value());
</span><span class="cx">         if (trigger.conditions.isEmpty())
</span><span class="lines">@@ -288,11 +288,11 @@
</span><span class="cx"> static Expected<std::optional<ContentExtensionRule>, std::error_code> loadRule(ExecState& exec, const JSObject& ruleObject)
</span><span class="cx"> {
</span><span class="cx">     auto trigger = loadTrigger(exec, ruleObject);
</span><del>-    if (!trigger.hasValue())
</del><ins>+    if (!trigger.has_value())
</ins><span class="cx">         return makeUnexpected(trigger.error());
</span><span class="cx"> 
</span><span class="cx">     auto action = loadAction(exec, ruleObject);
</span><del>-    if (!action.hasValue())
</del><ins>+    if (!action.has_value())
</ins><span class="cx">         return makeUnexpected(action.error());
</span><span class="cx"> 
</span><span class="cx">     if (action.value())
</span><span class="lines">@@ -340,7 +340,7 @@
</span><span class="cx">             return makeUnexpected(ContentExtensionError::JSONInvalidRule);
</span><span class="cx"> 
</span><span class="cx">         auto rule = loadRule(exec, *ruleObject);
</span><del>-        if (!rule.hasValue())
</del><ins>+        if (!rule.has_value())
</ins><span class="cx">             return makeUnexpected(rule.error());
</span><span class="cx">         if (rule.value())
</span><span class="cx">             ruleList.append(*rule.value());
</span><span class="lines">@@ -364,7 +364,7 @@
</span><span class="cx"> 
</span><span class="cx">     vm = nullptr;
</span><span class="cx"> 
</span><del>-    if (!ruleList.hasValue())
</del><ins>+    if (!ruleList.has_value())
</ins><span class="cx">         return makeUnexpected(ruleList.error());
</span><span class="cx"> 
</span><span class="cx">     if (ruleList->isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSrcValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp 2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp    2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx"> 
</span><span class="cx">     CachedResourceRequest request(ResourceRequest(document->completeURL(m_resource)), options);
</span><span class="cx">     request.setInitiator(cachedResourceRequestInitiators().css);
</span><del>-    m_cachedFont = document->cachedResourceLoader().requestFont(WTFMove(request), isSVG).valueOr(nullptr);
</del><ins>+    m_cachedFont = document->cachedResourceLoader().requestFont(WTFMove(request), isSVG).value_or(nullptr);
</ins><span class="cx">     return m_cachedFont.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSImageSetValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSImageSetValue.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSImageSetValue.cpp    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/css/CSSImageSetValue.cpp       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">         if (options.mode == FetchOptions::Mode::Cors)
</span><span class="cx">             request.updateForAccessControl(*document);
</span><span class="cx"> 
</span><del>-        m_cachedImage = loader.requestImage(WTFMove(request)).valueOr(nullptr);
</del><ins>+        m_cachedImage = loader.requestImage(WTFMove(request)).value_or(nullptr);
</ins><span class="cx">         m_bestFitImageScaleFactor = image.scaleFactor;
</span><span class="cx">     }
</span><span class="cx">     return { m_cachedImage.get(), m_bestFitImageScaleFactor };
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSImageValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSImageValue.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSImageValue.cpp       2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/css/CSSImageValue.cpp  2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * (C) 1999-2003 Lars Knoll (knoll@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">             ASSERT(loader.document());
</span><span class="cx">             request.updateForAccessControl(*loader.document());
</span><span class="cx">         }
</span><del>-        m_cachedImage = loader.requestImage(WTFMove(request)).valueOr(nullptr);
</del><ins>+        m_cachedImage = loader.requestImage(WTFMove(request)).value_or(nullptr);
</ins><span class="cx">     }
</span><span class="cx">     return m_cachedImage.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleRuleImportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleRuleImport.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleRuleImport.cpp     2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/css/StyleRuleImport.cpp        2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * (C) 1999-2003 Lars Knoll (knoll@kde.org)
</span><span class="cx">  * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2002-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">         request.setOptions(ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, StoredCredentialsPolicy::Use, ClientCredentialPolicy::MayAskClientForCredentials, FetchOptions::Credentials::Include, SkipSecurityCheck, FetchOptions::Mode::NoCors, DoNotIncludeCertificateInfo, ContentSecurityPolicyImposition::SkipPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::AllowCaching));
</span><span class="cx">         m_cachedSheet = document->cachedResourceLoader().requestUserCSSStyleSheet(WTFMove(request));
</span><span class="cx">     } else
</span><del>-        m_cachedSheet = document->cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)).valueOr(nullptr);
</del><ins>+        m_cachedSheet = document->cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)).value_or(nullptr);
</ins><span class="cx">     if (m_cachedSheet) {
</span><span class="cx">         // if the import rule is issued dynamically, the sheet may be
</span><span class="cx">         // removed from the pending sheet count, so let the doc know
</span></span></pre></div>
<a id="trunkSourceWebCoredomCallbackResulth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CallbackResult.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CallbackResult.h        2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/dom/CallbackResult.h   2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -71,12 +71,12 @@
</span><span class="cx"> 
</span><span class="cx"> template<typename ReturnType> inline CallbackResultType CallbackResult<ReturnType>::type() const
</span><span class="cx"> {
</span><del>-    return m_value.hasValue() ? CallbackResultType::Success : m_value.error();
</del><ins>+    return m_value.has_value() ? CallbackResultType::Success : m_value.error();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename ReturnType> inline auto CallbackResult<ReturnType>::releaseReturnValue() -> ReturnType&&
</span><span class="cx"> {
</span><del>-    ASSERT(m_value.hasValue());
</del><ins>+    ASSERT(m_value.has_value());
</ins><span class="cx">     return WTFMove(m_value.value());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp     2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/dom/Element.cpp        2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -3041,7 +3041,7 @@
</span><span class="cx"> 
</span><span class="cx"> int Element::getIntegralAttribute(const QualifiedName& attributeName) const
</span><span class="cx"> {
</span><del>-    return parseHTMLInteger(getAttribute(attributeName)).valueOr(0);
</del><ins>+    return parseHTMLInteger(getAttribute(attributeName)).value_or(0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Element::setIntegralAttribute(const QualifiedName& attributeName, int value)
</span><span class="lines">@@ -3051,7 +3051,7 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeName) const
</span><span class="cx"> {
</span><del>-    return parseHTMLNonNegativeInteger(getAttribute(attributeName)).valueOr(0);
</del><ins>+    return parseHTMLNonNegativeInteger(getAttribute(attributeName)).value_or(0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, unsigned value)
</span></span></pre></div>
<a id="trunkSourceWebCoredomExceptionOrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExceptionOr.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExceptionOr.h   2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/dom/ExceptionOr.h      2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> 
</span><del>-Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx"> 
</span><span class="cx"> Redistribution and use in source and binary forms, with or without
</span><span class="cx"> modification, are permitted provided that the following conditions
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> 
</span><span class="cx"> template<typename ReturnType> inline bool ExceptionOr<ReturnType>::hasException() const
</span><span class="cx"> {
</span><del>-    return !m_value.hasValue();
</del><ins>+    return !m_value.has_value();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename ReturnType> inline const Exception& ExceptionOr<ReturnType>::exception() const
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline bool ExceptionOr<void>::hasException() const
</span><span class="cx"> {
</span><del>-    return !m_value.hasValue();
</del><ins>+    return !m_value.has_value();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline const Exception& ExceptionOr<void>::exception() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ProcessingInstruction.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp       2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp  2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">             if (m_isXSL) {
</span><span class="cx">                 auto options = CachedResourceLoader::defaultCachedResourceOptions();
</span><span class="cx">                 options.mode = FetchOptions::Mode::SameOrigin;
</span><del>-                m_cachedSheet = document().cachedResourceLoader().requestXSLStyleSheet({ResourceRequest(document().completeURL(href)), options}).valueOr(nullptr);
</del><ins>+                m_cachedSheet = document().cachedResourceLoader().requestXSLStyleSheet({ResourceRequest(document().completeURL(href)), options}).value_or(nullptr);
</ins><span class="cx">             } else
</span><span class="cx"> #endif
</span><span class="cx">             {
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">                 String charset = attributes->get("charset");
</span><span class="cx">                 CachedResourceRequest request(document().completeURL(href), CachedResourceLoader::defaultCachedResourceOptions(), std::nullopt, charset.isEmpty() ? document().charset() : WTFMove(charset));
</span><span class="cx"> 
</span><del>-                m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)).valueOr(nullptr);
</del><ins>+                m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)).value_or(nullptr);
</ins><span class="cx">             }
</span><span class="cx">             if (m_cachedSheet)
</span><span class="cx">                 m_cachedSheet->addClient(*this);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp   2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp      2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1802,7 +1802,7 @@
</span><span class="cx"> void HTMLInputElement::maxLengthAttributeChanged(const AtomicString& newValue)
</span><span class="cx"> {
</span><span class="cx">     unsigned oldEffectiveMaxLength = effectiveMaxLength();
</span><del>-    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
</del><ins>+    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
</ins><span class="cx">     if (oldEffectiveMaxLength != effectiveMaxLength())
</span><span class="cx">         updateValueIfNeeded();
</span><span class="cx"> 
</span><span class="lines">@@ -1814,7 +1814,7 @@
</span><span class="cx"> void HTMLInputElement::minLengthAttributeChanged(const AtomicString& newValue)
</span><span class="cx"> {
</span><span class="cx">     int oldMinLength = minLength();
</span><del>-    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
</del><ins>+    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
</ins><span class="cx">     if (oldMinLength != minLength())
</span><span class="cx">         updateValueIfNeeded();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx">         request.setAsPotentiallyCrossOrigin(crossOrigin(), document());
</span><span class="cx"> 
</span><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(!m_cachedSheet);
</span><del>-        m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)).valueOr(nullptr);
</del><ins>+        m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request)).value_or(nullptr);
</ins><span class="cx"> 
</span><span class="cx">         if (m_cachedSheet)
</span><span class="cx">             m_cachedSheet->addClient(*this);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp   2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -202,13 +202,13 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLTextAreaElement::maxLengthAttributeChanged(const AtomicString& newValue)
</span><span class="cx"> {
</span><del>-    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
</del><ins>+    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
</ins><span class="cx">     updateValidity();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLTextAreaElement::minLengthAttributeChanged(const AtomicString& newValue)
</span><span class="cx"> {
</span><del>-    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
</del><ins>+    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
</ins><span class="cx">     updateValidity();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -209,7 +209,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto optionalSignedResult = parseHTMLInteger(input);
</span><span class="cx">     if (!optionalSignedResult)
</span><del>-        return optionalSignedResult.getUnexpected();
</del><ins>+        return makeUnexpected(WTFMove(optionalSignedResult.error()));
</ins><span class="cx"> 
</span><span class="cx">     if (optionalSignedResult.value() < 0)
</span><span class="cx">         return makeUnexpected(HTMLIntegerParsingError::NegativeOverflow);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.h      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.h 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx"> inline unsigned limitToOnlyHTMLNonNegative(StringView stringValue, unsigned defaultValue = 0)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(defaultValue <= maxHTMLNonNegativeInteger);
</span><del>-    unsigned value = parseHTMLNonNegativeInteger(stringValue).valueOr(defaultValue);
</del><ins>+    unsigned value = parseHTMLNonNegativeInteger(stringValue).value_or(defaultValue);
</ins><span class="cx">     ASSERT(value <= maxHTMLNonNegativeInteger);
</span><span class="cx">     return value;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCrossOriginPreflightCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">         preflightRequest.setInitiator(m_loader.options().initiator);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!m_resource);
</span><del>-    m_resource = m_loader.document().cachedResourceLoader().requestRawResource(WTFMove(preflightRequest)).valueOr(nullptr);
</del><ins>+    m_resource = m_loader.document().cachedResourceLoader().requestRawResource(WTFMove(preflightRequest)).value_or(nullptr);
</ins><span class="cx">     if (m_resource)
</span><span class="cx">         m_resource->addClient(*this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp   2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp      2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1531,7 +1531,7 @@
</span><span class="cx">     mainResourceRequest.setNavigationServiceWorkerRegistrationData(m_serviceWorkerRegistrationData);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    m_mainResource = m_cachedResourceLoader->requestMainResource(WTFMove(mainResourceRequest)).valueOr(nullptr);
</del><ins>+    m_mainResource = m_cachedResourceLoader->requestMainResource(WTFMove(mainResourceRequest)).value_or(nullptr);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     if (m_mainResource && m_mainResource->errorOccurred() && m_frame->page() && m_mainResource->resourceError().domain() == ContentExtensions::WebKitContentBlockerDomain) {
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentThreadableLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp 2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp    2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -469,7 +469,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         auto cachedResource = m_document.cachedResourceLoader().requestRawResource(WTFMove(newRequest));
</span><del>-        m_resource = cachedResource.valueOr(nullptr);
</del><ins>+        m_resource = cachedResource.value_or(nullptr);
</ins><span class="cx">         if (m_resource)
</span><span class="cx">             m_resource->addClient(*this);
</span><span class="cx">         else
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderImageLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ImageLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ImageLoader.cpp      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/ImageLoader.cpp 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">             document.cachedResourceLoader().m_documentResources.set(newImage->url(), newImage.get());
</span><span class="cx">             document.cachedResourceLoader().setAutoLoadImages(autoLoadOtherImages);
</span><span class="cx">         } else
</span><del>-            newImage = document.cachedResourceLoader().requestImage(WTFMove(request)).valueOr(nullptr);
</del><ins>+            newImage = document.cachedResourceLoader().requestImage(WTFMove(request)).value_or(nullptr);
</ins><span class="cx"> 
</span><span class="cx">         // If we do not have an image here, it means that a cross-site
</span><span class="cx">         // violation occurred, or that the image was blocked via Content
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderLinkLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/LinkLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/LinkLoader.cpp       2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/LinkLoader.cpp  2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -231,7 +231,7 @@
</span><span class="cx">     linkRequest.setIsLinkPreload();
</span><span class="cx"> 
</span><span class="cx">     linkRequest.setAsPotentiallyCrossOrigin(crossOriginMode, document);
</span><del>-    auto cachedLinkResource = document.cachedResourceLoader().preload(type.value(), WTFMove(linkRequest)).valueOr(nullptr);
</del><ins>+    auto cachedLinkResource = document.cachedResourceLoader().preload(type.value(), WTFMove(linkRequest)).value_or(nullptr);
</ins><span class="cx"> 
</span><span class="cx">     if (cachedLinkResource && loader)
</span><span class="cx">         return createLinkPreloadResourceClient(*cachedLinkResource, *loader, type.value());
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx">         }
</span><span class="cx">         ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
</span><span class="cx">         options.contentSecurityPolicyImposition = ContentSecurityPolicyImposition::SkipPolicyCheck;
</span><del>-        m_cachedLinkResource = document.cachedResourceLoader().requestLinkResource(type, CachedResourceRequest(ResourceRequest(document.completeURL(href)), options, priority)).valueOr(nullptr);
</del><ins>+        m_cachedLinkResource = document.cachedResourceLoader().requestLinkResource(type, CachedResourceRequest(ResourceRequest(document.completeURL(href)), options, priority)).value_or(nullptr);
</ins><span class="cx">         if (m_cachedLinkResource)
</span><span class="cx">             m_cachedLinkResource->addClient(*this);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderMediaResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/MediaResourceLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/MediaResourceLoader.cpp      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/MediaResourceLoader.cpp 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2014 Igalia S.L
</span><del>- * Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     if (m_mediaElement)
</span><span class="cx">         cacheRequest.setInitiator(*m_mediaElement.get());
</span><span class="cx"> 
</span><del>-    auto resource = m_document->cachedResourceLoader().requestMedia(WTFMove(cacheRequest)).valueOr(nullptr);
</del><ins>+    auto resource = m_document->cachedResourceLoader().requestMedia(WTFMove(cacheRequest)).value_or(nullptr);
</ins><span class="cx">     if (!resource)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderTextTrackLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/TextTrackLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/TextTrackLoader.cpp  2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/TextTrackLoader.cpp     2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx">     CachedResourceRequest cueRequest(ResourceRequest(document->completeURL(url)), options);
</span><span class="cx">     cueRequest.setAsPotentiallyCrossOrigin(crossOriginMode, *document);
</span><span class="cx"> 
</span><del>-    m_resource = document->cachedResourceLoader().requestTextTrack(WTFMove(cueRequest)).valueOr(nullptr);
</del><ins>+    m_resource = document->cachedResourceLoader().requestTextTrack(WTFMove(cueRequest)).value_or(nullptr);
</ins><span class="cx">     if (!m_resource)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGDocumentReferencecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp 2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp    2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     fetchOptions.mode = FetchOptions::Mode::SameOrigin;
</span><span class="cx">     CachedResourceRequest request(ResourceRequest(loader.document()->completeURL(m_url)), fetchOptions);
</span><span class="cx">     request.setInitiator(cachedResourceRequestInitiators().css);
</span><del>-    m_document = loader.requestSVGDocument(WTFMove(request)).valueOr(nullptr);
</del><ins>+    m_document = loader.requestSVGDocument(WTFMove(request)).value_or(nullptr);
</ins><span class="cx">     if (m_document)
</span><span class="cx">         m_document->addClient(*this);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconLoader.cpp  2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/loader/icon/IconLoader.cpp     2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     request.setInitiator(cachedResourceRequestInitiators().icon);
</span><span class="cx"> 
</span><span class="cx">     auto cachedResource = frame->document()->cachedResourceLoader().requestIcon(WTFMove(request));
</span><del>-    m_resource = cachedResource.valueOr(nullptr);
</del><ins>+    m_resource = cachedResource.value_or(nullptr);
</ins><span class="cx">     if (m_resource)
</span><span class="cx">         m_resource->addClient(*this);
</span><span class="cx">     else
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.cpp      2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/platform/URLParser.cpp 2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -2314,11 +2314,11 @@
</span><span class="cx">     if (!iterator.atEnd() || !items.size() || items.size() > 4)
</span><span class="cx">         return makeUnexpected(IPv4ParsingError::NotIPv4);
</span><span class="cx">     for (const auto& item : items) {
</span><del>-        if (!item.hasValue() && item.error() == IPv4PieceParsingError::Failure)
</del><ins>+        if (!item.has_value() && item.error() == IPv4PieceParsingError::Failure)
</ins><span class="cx">             return makeUnexpected(IPv4ParsingError::NotIPv4);
</span><span class="cx">     }
</span><span class="cx">     for (const auto& item : items) {
</span><del>-        if (!item.hasValue() && item.error() == IPv4PieceParsingError::Overflow)
</del><ins>+        if (!item.has_value() && item.error() == IPv4PieceParsingError::Overflow)
</ins><span class="cx">             return makeUnexpected(IPv4ParsingError::Failure);
</span><span class="cx">     }
</span><span class="cx">     if (items.size() > 1) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfWebCoreAVCFResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp     2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp        2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">     CachedResourceRequest request(WTFMove(resourceRequest), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, StoredCredentialsPolicy::DoNotUse, ClientCredentialPolicy::CannotAskClientForCredentials, FetchOptions::Credentials::Omit, DoSecurityCheck, FetchOptions::Mode::NoCors, DoNotIncludeCertificateInfo, ContentSecurityPolicyImposition::DoPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::DisallowCaching));
</span><span class="cx"> 
</span><span class="cx">     CachedResourceLoader* loader = m_parent->player()->cachedResourceLoader();
</span><del>-    m_resource = loader ? loader->requestRawResource(WTFMove(request)).valueOr(nullptr) : nullptr;
</del><ins>+    m_resource = loader ? loader->requestRawResource(WTFMove(request)).value_or(nullptr) : nullptr;
</ins><span class="cx">     if (m_resource)
</span><span class="cx">         m_resource->addClient(*this);
</span><span class="cx">     else {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcWebCoreAVFResourceLoadermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm     2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm        2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     // is in a user-agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=173498>.
</span><span class="cx">     CachedResourceRequest request(WTFMove(resourceRequest), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, StoredCredentialsPolicy::DoNotUse, ClientCredentialPolicy::CannotAskClientForCredentials, FetchOptions::Credentials::Omit, DoSecurityCheck, FetchOptions::Mode::NoCors, DoNotIncludeCertificateInfo, ContentSecurityPolicyImposition::DoPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::DisallowCaching));
</span><span class="cx">     if (auto* loader = m_parent->player()->cachedResourceLoader())
</span><del>-        m_resource = loader->requestMedia(WTFMove(request)).valueOr(nullptr);
</del><ins>+        m_resource = loader->requestMedia(WTFMove(request)).value_or(nullptr);
</ins><span class="cx"> 
</span><span class="cx">     if (m_resource)
</span><span class="cx">         m_resource->addClient(*this);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFEImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFEImageElement.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFEImageElement.cpp   2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.cpp      2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> 
</span><span class="cx">     CachedResourceRequest request(ResourceRequest(document().completeURL(href())), options);
</span><span class="cx">     request.setInitiator(*this);
</span><del>-    m_cachedImage = document().cachedResourceLoader().requestImage(WTFMove(request)).valueOr(nullptr);
</del><ins>+    m_cachedImage = document().cachedResourceLoader().requestImage(WTFMove(request)).value_or(nullptr);
</ins><span class="cx"> 
</span><span class="cx">     if (m_cachedImage)
</span><span class="cx">         m_cachedImage->addClient(*this);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontFaceUriElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp       2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp  2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">         CachedResourceLoader& cachedResourceLoader = document().cachedResourceLoader();
</span><span class="cx">         CachedResourceRequest request(ResourceRequest(document().completeURL(href)), options);
</span><span class="cx">         request.setInitiator(*this);
</span><del>-        m_cachedFont = cachedResourceLoader.requestFont(WTFMove(request), isSVGFontTarget(*this)).valueOr(nullptr);
</del><ins>+        m_cachedFont = cachedResourceLoader.requestFont(WTFMove(request), isSVGFontTarget(*this)).value_or(nullptr);
</ins><span class="cx">         if (m_cachedFont) {
</span><span class="cx">             m_cachedFont->addClient(*this);
</span><span class="cx">             m_cachedFont->beginLoadIfNeeded(cachedResourceLoader);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGUseElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGUseElement.cpp       2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp  2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">  * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
</span><span class="cx">  * Copyright (C) 2012 University of Szeged
</span><span class="cx">  * Copyright (C) 2012 Renata Hodovan <reni@webkit.org>
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -590,7 +590,7 @@
</span><span class="cx">         options.mode = FetchOptions::Mode::SameOrigin;
</span><span class="cx">         CachedResourceRequest request { ResourceRequest { externalDocumentURL }, options };
</span><span class="cx">         request.setInitiator(*this);
</span><del>-        m_externalDocument = document().cachedResourceLoader().requestSVGDocument(WTFMove(request)).valueOr(nullptr);
</del><ins>+        m_externalDocument = document().cachedResourceLoader().requestSVGDocument(WTFMove(request)).value_or(nullptr);
</ins><span class="cx">         if (m_externalDocument)
</span><span class="cx">             m_externalDocument->addClient(*this);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXSLImportRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XSLImportRule.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XSLImportRule.cpp       2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebCore/xml/XSLImportRule.cpp  2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * This file is part of the XSL implementation.
</span><span class="cx">  *
</span><del>- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto options = CachedResourceLoader::defaultCachedResourceOptions();
</span><span class="cx">     options.mode = FetchOptions::Mode::SameOrigin;
</span><del>-    m_cachedSheet = cachedResourceLoader->requestXSLStyleSheet({ResourceRequest(cachedResourceLoader->document()->completeURL(absHref)), options}).valueOr(nullptr);
</del><ins>+    m_cachedSheet = cachedResourceLoader->requestXSLStyleSheet({ResourceRequest(cachedResourceLoader->document()->completeURL(absHref)), options}).value_or(nullptr);
</ins><span class="cx"> 
</span><span class="cx">     if (m_cachedSheet) {
</span><span class="cx">         m_cachedSheet->addClient(*this);
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebKit/ChangeLog       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2017-12-04  JF Bastien  <jfbastien@apple.com>
+
+        Update std::expected to match libc++ coding style
+        https://bugs.webkit.org/show_bug.cgi?id=180264
+
+        Reviewed by Alex Christensen.
+
+        Update various uses of Expected, mostly renaming valueOr and
+        hasValue to the STL naming convention.
+
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::open):
+        (WebKit::CacheStorage::Engine::retrieveCaches):
+        (WebKit::CacheStorage::Engine::retrieveRecords):
+        (WebKit::CacheStorage::Engine::putRecords):
+        (WebKit::CacheStorage::Engine::deleteMatchingRecords):
+        (WebKit::CacheStorage::Engine::fetchEntries):
+        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
+        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
+        (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
+        (WebKit::CacheStorage::Cache::updateRecordToDisk):
+        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+        (WebKit::CacheStorage::Caches::initialize):
+        (WebKit::CacheStorage::Caches::readCachesFromDisk):
+        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+        (WebKit::NetworkRTCProvider::createResolver):
+        * Platform/IPC/ArgumentCoders.h:
+
</ins><span class="cx"> 2017-12-04  Brady Eidson  <beidson@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Get a directory path to SWServers for storing ServiceWorker registrations.
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEnginecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp  2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp     2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx"> void Engine::open(const String& origin, const String& cacheName, CacheIdentifierCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     readCachesFromDisk(origin, [cacheName, callback = WTFMove(callback)](CachesOrError&& cachesOrError) mutable {
</span><del>-        if (!cachesOrError.hasValue()) {
</del><ins>+        if (!cachesOrError.has_value()) {
</ins><span class="cx">             callback(makeUnexpected(cachesOrError.error()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx"> void Engine::retrieveCaches(const String& origin, uint64_t updateCounter, CacheInfosCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     readCachesFromDisk(origin, [updateCounter, callback = WTFMove(callback)](CachesOrError&& cachesOrError) mutable {
</span><del>-        if (!cachesOrError.hasValue()) {
</del><ins>+        if (!cachesOrError.has_value()) {
</ins><span class="cx">             callback(makeUnexpected(cachesOrError.error()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx"> void Engine::retrieveRecords(uint64_t cacheIdentifier, WebCore::URL&& url, RecordsCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     readCache(cacheIdentifier, [url = WTFMove(url), callback = WTFMove(callback)](CacheOrError&& result) mutable {
</span><del>-        if (!result.hasValue()) {
</del><ins>+        if (!result.has_value()) {
</ins><span class="cx">             callback(makeUnexpected(result.error()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx"> void Engine::putRecords(uint64_t cacheIdentifier, Vector<Record>&& records, RecordIdentifiersCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     readCache(cacheIdentifier, [records = WTFMove(records), callback = WTFMove(callback)](CacheOrError&& result) mutable {
</span><del>-        if (!result.hasValue()) {
</del><ins>+        if (!result.has_value()) {
</ins><span class="cx">             callback(makeUnexpected(result.error()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> void Engine::deleteMatchingRecords(uint64_t cacheIdentifier, WebCore::ResourceRequest&& request, WebCore::CacheQueryOptions&& options, RecordIdentifiersCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     readCache(cacheIdentifier, [request = WTFMove(request), options = WTFMove(options), callback = WTFMove(callback)](CacheOrError&& result) mutable {
</span><del>-        if (!result.hasValue()) {
</del><ins>+        if (!result.has_value()) {
</ins><span class="cx">             callback(makeUnexpected(result.error()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -397,7 +397,7 @@
</span><span class="cx"> 
</span><span class="cx">             auto cacheOrigin = origin->securityOrigin()->toString();
</span><span class="cx">             protectedThis->readCachesFromDisk(cacheOrigin, [origin = WTFMove(origin.value()), taskCounter = WTFMove(taskCounter)] (CachesOrError&& result) mutable {
</span><del>-                if (!result.hasValue())
</del><ins>+                if (!result.has_value())
</ins><span class="cx">                     return;
</span><span class="cx">                 taskCounter->addOrigin(WTFMove(origin), result.value().get().storageSize());
</span><span class="cx"> 
</span><span class="lines">@@ -440,7 +440,7 @@
</span><span class="cx"> void Engine::clearMemoryRepresentation(const String& origin, WebCore::DOMCacheEngine::CompletionCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     readCachesFromDisk(origin, [callback = WTFMove(callback)](CachesOrError&& result) {
</span><del>-        if (!result.hasValue()) {
</del><ins>+        if (!result.has_value()) {
</ins><span class="cx">             callback(result.error());
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp     2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp        2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx">     void appendRecord(Expected<Record, Error>&& result, uint64_t recordIdentifier, uint64_t updateCounter)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(RunLoop::isMain());
</span><del>-        if (!result.hasValue()) {
</del><ins>+        if (!result.has_value()) {
</ins><span class="cx">             m_failedRecords.append(recordIdentifier);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -492,7 +492,7 @@
</span><span class="cx"> {
</span><span class="cx">     ++existingRecord.updateResponseCounter;
</span><span class="cx">     readRecordFromDisk(existingRecord, [caches = makeRef(m_caches), identifier = m_identifier, recordIdentifier = existingRecord.identifier, record = WTFMove(record), taskCounter = WTFMove(taskCounter)](Expected<Record, Error>&& result) mutable {
</span><del>-        if (!result.hasValue())
</del><ins>+        if (!result.has_value())
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         auto* cache = caches->find(identifier);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineCachescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">         readCachesFromDisk([this, callback = WTFMove(callback)](Expected<Vector<Cache>, Error>&& result) mutable {
</span><span class="cx">             makeDirty();
</span><span class="cx"> 
</span><del>-            if (!result.hasValue()) {
</del><ins>+            if (!result.has_value()) {
</ins><span class="cx">                 callback(result.error());
</span><span class="cx"> 
</span><span class="cx">                 auto pendingCallbacks = WTFMove(m_pendingInitializationCallbacks);
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         auto result = decodeCachesNames(data, error);
</span><del>-        if (!result.hasValue()) {
</del><ins>+        if (!result.has_value()) {
</ins><span class="cx">             callback(makeUnexpected(result.error()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesswebrtcNetworkRTCProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp 2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp    2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx"> void NetworkRTCProvider::createResolver(uint64_t identifier, const String& address)
</span><span class="cx"> {
</span><span class="cx">     auto resolver = std::make_unique<NetworkRTCResolver>([this, identifier](NetworkRTCResolver::AddressesOrError&& result) mutable {
</span><del>-        if (!result.hasValue()) {
</del><ins>+        if (!result.has_value()) {
</ins><span class="cx">             if (result.error() != NetworkRTCResolver::Error::Cancelled)
</span><span class="cx">                 m_connection->connection().send(Messages::WebRTCResolver::ResolvedAddressError(1), identifier);
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformIPCArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h        2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h   2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -482,10 +482,10 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<typename ValueType, typename ErrorType> struct ArgumentCoder<WTF::Expected<ValueType, ErrorType>> {
-    static void encode(Encoder& encoder, const WTF::Expected<ValueType, ErrorType>& expected)
</del><ins>+template<typename ValueType, typename ErrorType> struct ArgumentCoder<Expected<ValueType, ErrorType>> {
+    static void encode(Encoder& encoder, const Expected<ValueType, ErrorType>& expected)
</ins><span class="cx">     {
</span><del>-        if (!expected.hasValue()) {
</del><ins>+        if (!expected.has_value()) {
</ins><span class="cx">             encoder << false;
</span><span class="cx">             encoder << expected.error();
</span><span class="cx">             return;
</span><span class="lines">@@ -494,7 +494,7 @@
</span><span class="cx">         encoder << expected.value();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static std::optional<WTF::Expected<ValueType, ErrorType>> decode(Decoder& decoder)
</del><ins>+    static std::optional<Expected<ValueType, ErrorType>> decode(Decoder& decoder)
</ins><span class="cx">     {
</span><span class="cx">         std::optional<bool> hasValue;
</span><span class="cx">         decoder >> hasValue;
</span><span class="lines">@@ -507,7 +507,7 @@
</span><span class="cx">             if (!value)
</span><span class="cx">                 return std::nullopt;
</span><span class="cx">             
</span><del>-            WTF::Expected<ValueType, ErrorType> expected(WTFMove(*value));
</del><ins>+            Expected<ValueType, ErrorType> expected(WTFMove(*value));
</ins><span class="cx">             return WTFMove(expected);
</span><span class="cx">         }
</span><span class="cx">         std::optional<ErrorType> error;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Tools/ChangeLog       2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-12-04  JF Bastien  <jfbastien@apple.com>
+
+        Update std::expected to match libc++ coding style
+        https://bugs.webkit.org/show_bug.cgi?id=180264
+
+        Reviewed by Alex Christensen.
+
+        Update tests according to name changes as well as removal of
+        now-gone APIs.
+
+        * TestWebKitAPI/Tests/WTF/Expected.cpp:
+        (std::experimental::fundamentals_v3::operator<<):
+        (TestWebKitAPI::TEST):
+        (WTF::operator<<): Deleted.
+        * TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:
+        (TestWebKitAPI::testParseHTMLInteger):
+        (TestWebKitAPI::testParseHTMLNonNegativeInteger):
+
</ins><span class="cx"> 2017-12-04  Ross Kirsling  <ross.kirsling@sony.com>
</span><span class="cx"> 
</span><span class="cx">         download-latest-github-release.py should use existing release ANY time latest is not found
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFExpectedcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Expected.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/Expected.cpp 2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Expected.cpp    2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -31,10 +31,11 @@
</span><span class="cx"> #include <string>
</span><span class="cx"> 
</span><span class="cx"> #include <wtf/Expected.h>
</span><ins>+#include <wtf/Unexpected.h>
</ins><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> 
</span><del>-namespace WTF {
</del><ins>+namespace std {
</ins><span class="cx"> 
</span><span class="cx"> template<typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const std::pair<T0, T1>& p)
</span><span class="cx"> {
</span><span class="lines">@@ -41,6 +42,9 @@
</span><span class="cx">     return os << '(' << p.first << ", " << p.second << ')';
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+namespace experimental {
+inline namespace fundamentals_v3 {
+
</ins><span class="cx"> template<class E> std::ostream& operator<<(std::ostream& os, const Unexpected<E>& u)
</span><span class="cx"> {
</span><span class="cx">     return os << u.value();
</span><span class="lines">@@ -48,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx"> template<class T, class E> std::ostream& operator<<(std::ostream& os, const Expected<T, E>& e)
</span><span class="cx"> {
</span><del>-    if (e.hasValue())
</del><ins>+    if (e.has_value())
</ins><span class="cx">         return os << e.value();
</span><span class="cx">     return os << e.error();
</span><span class="cx"> }
</span><span class="lines">@@ -55,13 +59,14 @@
</span><span class="cx"> 
</span><span class="cx"> template<class E> std::ostream& operator<<(std::ostream& os, const Expected<void, E>& e)
</span><span class="cx"> {
</span><del>-    if (e.hasValue())
</del><ins>+    if (e.has_value())
</ins><span class="cx">         return os << "";
</span><span class="cx">     return os << e.error();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-}
</del><ins>+}}} // namespace std::experimental::fundamentals_v3
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> namespace TestWebKitAPI {
</span><span class="cx"> 
</span><span class="cx"> constexpr const char* oops = "oops";
</span><span class="lines">@@ -111,81 +116,64 @@
</span><span class="cx">     typedef Expected<foo, std::string> FooString;
</span><span class="cx">     {
</span><span class="cx">         auto e = E();
</span><del>-        EXPECT_TRUE(e.hasValue());
</del><ins>+        EXPECT_TRUE(e.has_value());
</ins><span class="cx">         EXPECT_EQ(e.value(), 0);
</span><del>-        EXPECT_EQ(e.valueOr(3.14), 0);
</del><ins>+        EXPECT_EQ(e.value_or(3.14), 0);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         constexpr E e;
</span><del>-        EXPECT_TRUE(e.hasValue());
</del><ins>+        EXPECT_TRUE(e.has_value());
</ins><span class="cx">         EXPECT_EQ(e.value(), 0);
</span><del>-        EXPECT_EQ(e.valueOr(3.14), 0);
</del><ins>+        EXPECT_EQ(e.value_or(3.14), 0);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         auto e = E(42);
</span><del>-        EXPECT_TRUE(e.hasValue());
</del><ins>+        EXPECT_TRUE(e.has_value());
</ins><span class="cx">         EXPECT_EQ(e.value(), 42);
</span><del>-        EXPECT_EQ(e.valueOr(3.14), 42);
</del><ins>+        EXPECT_EQ(e.value_or(3.14), 42);
</ins><span class="cx">         const auto e2(e);
</span><del>-        EXPECT_TRUE(e2.hasValue());
</del><ins>+        EXPECT_TRUE(e2.has_value());
</ins><span class="cx">         EXPECT_EQ(e2.value(), 42);
</span><del>-        EXPECT_EQ(e2.valueOr(3.14), 42);
</del><ins>+        EXPECT_EQ(e2.value_or(3.14), 42);
</ins><span class="cx">         E e3;
</span><span class="cx">         e3 = e2;
</span><del>-        EXPECT_TRUE(e3.hasValue());
</del><ins>+        EXPECT_TRUE(e3.has_value());
</ins><span class="cx">         EXPECT_EQ(e3.value(), 42);
</span><del>-        EXPECT_EQ(e3.valueOr(3.14), 42);
</del><ins>+        EXPECT_EQ(e3.value_or(3.14), 42);
</ins><span class="cx">         const E e4 = e2;
</span><del>-        EXPECT_TRUE(e4.hasValue());
</del><ins>+        EXPECT_TRUE(e4.has_value());
</ins><span class="cx">         EXPECT_EQ(e4.value(), 42);
</span><del>-        EXPECT_EQ(e4.valueOr(3.14), 42);
</del><ins>+        EXPECT_EQ(e4.value_or(3.14), 42);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         constexpr E c(42);
</span><del>-        EXPECT_TRUE(c.hasValue());
</del><ins>+        EXPECT_TRUE(c.has_value());
</ins><span class="cx">         EXPECT_EQ(c.value(), 42);
</span><del>-        EXPECT_EQ(c.valueOr(3.14), 42);
</del><ins>+        EXPECT_EQ(c.value_or(3.14), 42);
</ins><span class="cx">         constexpr const auto c2(c);
</span><del>-        EXPECT_TRUE(c2.hasValue());
</del><ins>+        EXPECT_TRUE(c2.has_value());
</ins><span class="cx">         EXPECT_EQ(c2.value(), 42);
</span><del>-        EXPECT_EQ(c2.valueOr(3.14), 42);
</del><ins>+        EXPECT_EQ(c2.value_or(3.14), 42);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         auto u = E(makeUnexpected(oops));
</span><del>-        EXPECT_FALSE(u.hasValue());
</del><ins>+        EXPECT_FALSE(u.has_value());
</ins><span class="cx">         EXPECT_EQ(u.error(), oops);
</span><del>-        EXPECT_EQ(u.getUnexpected().value(), oops);
-        EXPECT_EQ(u.valueOr(3.14), 3);
</del><ins>+        EXPECT_EQ(u.value_or(3.14), 3);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         auto uv = EV(makeUnexpected(oops));
</span><del>-        EXPECT_FALSE(uv.hasValue());
</del><ins>+        EXPECT_FALSE(uv.has_value());
</ins><span class="cx">         EXPECT_EQ(uv.error(), oops);
</span><del>-        EXPECT_EQ(uv.getUnexpected().value(), oops);
-        EXPECT_EQ(uv.valueOr(3.14), 3);
</del><ins>+        EXPECT_EQ(uv.value_or(3.14), 3);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         E e = makeUnexpected(oops);
</span><del>-        EXPECT_FALSE(e.hasValue());
</del><ins>+        EXPECT_FALSE(e.has_value());
</ins><span class="cx">         EXPECT_EQ(e.error(), oops);
</span><del>-        EXPECT_EQ(e.getUnexpected().value(), oops);
-        EXPECT_EQ(e.valueOr(3.14), 3);
</del><ins>+        EXPECT_EQ(e.value_or(3.14), 3);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><del>-        auto e = makeExpectedFromError<int, const char*>(oops);
-        EXPECT_FALSE(e.hasValue());
-        EXPECT_EQ(e.error(), oops);
-        EXPECT_EQ(e.getUnexpected().value(), oops);
-        EXPECT_EQ(e.valueOr(3.14), 3);
-    }
-    {
-        auto e = makeExpectedFromError<int, const void*>(oops);
-        EXPECT_FALSE(e.hasValue());
-        EXPECT_EQ(e.error(), oops);
-        EXPECT_EQ(e.getUnexpected().value(), oops);
-        EXPECT_EQ(e.valueOr(3.14), 3);
-    }
-    {
</del><span class="cx">         auto e = FooChar(42);
</span><span class="cx">         EXPECT_EQ(e->v, 42);
</span><span class="cx">         EXPECT_EQ((*e).v, 42);
</span><span class="lines">@@ -236,53 +224,38 @@
</span><span class="cx">     typedef Expected<void, std::string> String;
</span><span class="cx">     {
</span><span class="cx">         auto e = E();
</span><del>-        EXPECT_TRUE(e.hasValue());
</del><ins>+        EXPECT_TRUE(e.has_value());
</ins><span class="cx">         const auto e2(e);
</span><del>-        EXPECT_TRUE(e2.hasValue());
</del><ins>+        EXPECT_TRUE(e2.has_value());
</ins><span class="cx">         EXPECT_EQ(e, e2);
</span><span class="cx">         E e3;
</span><span class="cx">         e3 = e2;
</span><del>-        EXPECT_TRUE(e3.hasValue());
</del><ins>+        EXPECT_TRUE(e3.has_value());
</ins><span class="cx">         EXPECT_EQ(e, e3);
</span><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         constexpr E c;
</span><del>-        EXPECT_TRUE(c.hasValue());
</del><ins>+        EXPECT_TRUE(c.has_value());
</ins><span class="cx">         constexpr const auto c2(c);
</span><del>-        EXPECT_TRUE(c2.hasValue());
</del><ins>+        EXPECT_TRUE(c2.has_value());
</ins><span class="cx">         EXPECT_EQ(c, c2);
</span><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         auto u = E(makeUnexpected(oops));
</span><del>-        EXPECT_FALSE(u.hasValue());
</del><ins>+        EXPECT_FALSE(u.has_value());
</ins><span class="cx">         EXPECT_EQ(u.error(), oops);
</span><del>-        EXPECT_EQ(u.getUnexpected().value(), oops);
</del><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         auto uv = EV(makeUnexpected(oops));
</span><del>-        EXPECT_FALSE(uv.hasValue());
</del><ins>+        EXPECT_FALSE(uv.has_value());
</ins><span class="cx">         EXPECT_EQ(uv.error(), oops);
</span><del>-        EXPECT_EQ(uv.getUnexpected().value(), oops);
</del><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         E e = makeUnexpected(oops);
</span><del>-        EXPECT_FALSE(e.hasValue());
</del><ins>+        EXPECT_FALSE(e.has_value());
</ins><span class="cx">         EXPECT_EQ(e.error(), oops);
</span><del>-        EXPECT_EQ(e.getUnexpected().value(), oops);
</del><span class="cx">     }
</span><span class="cx">     {
</span><del>-        auto e = makeExpectedFromError<void, const char*>(oops);
-        EXPECT_FALSE(e.hasValue());
-        EXPECT_EQ(e.error(), oops);
-        EXPECT_EQ(e.getUnexpected().value(), oops);
-    }
-    {
-        auto e = makeExpectedFromError<void, const void*>(oops);
-        EXPECT_FALSE(e.hasValue());
-        EXPECT_EQ(e.error(), oops);
-        EXPECT_EQ(e.getUnexpected().value(), oops);
-    }
-    {
</del><span class="cx">         auto e0 = E();
</span><span class="cx">         auto e1 = E();
</span><span class="cx">         swap(e0, e1);
</span><span class="lines">@@ -312,7 +285,7 @@
</span><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         typedef Expected<std::pair<int, int>, std::string> Et;
</span><del>-        EXPECT_EQ(Et(WTF::InPlace, 1, 2), Et(WTF::InPlace, 1, 2));
</del><ins>+        EXPECT_EQ(Et(std::in_place, 1, 2), Et(std::in_place, 1, 2));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -465,7 +438,7 @@
</span><span class="cx">     {
</span><span class="cx">         RefLogger a("a");
</span><span class="cx">         Expected<Ref<RefLogger>, int> expected = Ref<RefLogger>(a);
</span><del>-        EXPECT_TRUE(expected.hasValue());
</del><ins>+        EXPECT_TRUE(expected.has_value());
</ins><span class="cx">         EXPECT_EQ(&a, expected.value().ptr());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -473,8 +446,8 @@
</span><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx">         RefLogger a("a");
</span><del>-        Expected<Ref<RefLogger>, int> expected = makeExpected<Ref<RefLogger>, int>(Ref<RefLogger>(a));
-        EXPECT_TRUE(expected.hasValue());
</del><ins>+        Expected<Ref<RefLogger>, int> expected = Expected<Ref<RefLogger>, int>(Ref<RefLogger>(a));
+        EXPECT_TRUE(expected.has_value());
</ins><span class="cx">         EXPECT_EQ(&a, expected.value().ptr());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -483,7 +456,7 @@
</span><span class="cx">     {
</span><span class="cx">         RefLogger a("a");
</span><span class="cx">         Expected<int, Ref<RefLogger>> expected = makeUnexpected(Ref<RefLogger>(a));
</span><del>-        EXPECT_FALSE(expected.hasValue());
</del><ins>+        EXPECT_FALSE(expected.has_value());
</ins><span class="cx">         EXPECT_EQ(&a, expected.error().ptr());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -492,7 +465,7 @@
</span><span class="cx">     {
</span><span class="cx">         RefLogger a("a");
</span><span class="cx">         Expected<void, Ref<RefLogger>> expected = makeUnexpected(Ref<RefLogger>(a));
</span><del>-        EXPECT_FALSE(expected.hasValue());
</del><ins>+        EXPECT_FALSE(expected.has_value());
</ins><span class="cx">         EXPECT_EQ(&a, expected.error().ptr());
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreHTMLParserIdiomscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp (225498 => 225499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp     2017-12-04 23:05:00 UTC (rev 225498)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp        2017-12-04 23:34:57 UTC (rev 225499)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto optionalResult = parseHTMLInteger(input);
</span><span class="cx">     EXPECT_TRUE(!!optionalResult);
</span><del>-    return optionalResult.valueOr(0);
</del><ins>+    return optionalResult.value_or(0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool parseHTMLIntegerFails(const String& input)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto optionalResult = parseHTMLNonNegativeInteger(input);
</span><span class="cx">     EXPECT_TRUE(!!optionalResult);
</span><del>-    return optionalResult.valueOr(0);
</del><ins>+    return optionalResult.value_or(0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool parseHTMLNonNegativeIntegerFails(const String& input)
</span></span></pre>
</div>
</div>

</body>
</html>