<!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>[206976] trunk/Source/WebCore</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/206976">206976</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-10-09 19:13:28 -0700 (Sun, 09 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Replace all uses of ExceptionCodeWithMessage with WebCore::Exception
https://bugs.webkit.org/show_bug.cgi?id=163178

Reviewed by Sam Weinig.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::stringToDirection): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBCursor::update): Return ExceptionOr instead of using an
ExceptionCodeWithMessage out argument.
(WebCore::IDBCursor::advance): Ditto.
(WebCore::IDBCursor::continueFunction): Ditto.
(WebCore::IDBCursor::deleteFunction): Ditto.
* Modules/indexeddb/IDBCursor.h: Updated for above changes.

* Modules/indexeddb/IDBCursor.idl: Sorted extended attributes alphabetically.
Use MayThrowException instead of MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBDatabase::transaction): Ditto.
(WebCore::IDBDatabase::deleteObjectStore): Ditto.
* Modules/indexeddb/IDBDatabase.h: Updated for above changes.

* Modules/indexeddb/IDBDatabase.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBFactory::openInternal): Ditto.
(WebCore::IDBFactory::deleteDatabase): Ditto.
(WebCore::IDBFactory::cmp): Ditto.
* Modules/indexeddb/IDBFactory.h: Updated for above changes.

* Modules/indexeddb/IDBFactory.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBIndex::count): Ditto.
(WebCore::IDBIndex::doCount): Ditto.
(WebCore::IDBIndex::openKeyCursor): Ditto.
(WebCore::IDBIndex::get): Ditto.
(WebCore::IDBIndex::doGet): Ditto.
(WebCore::IDBIndex::getKey): Ditto.
(WebCore::IDBIndex::doGetKey): Ditto.
* Modules/indexeddb/IDBIndex.h: Updated for above changes.

* Modules/indexeddb/IDBIndex.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only): Return ExceptionOr instead of
using an ExceptionCode out argument.
(WebCore::IDBKeyRange::lowerBound): Ditto.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.
* Modules/indexeddb/IDBKeyRange.h: Updated for above changes.
* Modules/indexeddb/IDBKeyRange.idl: Use MayThrowException instead of
MayThrowLegacyException.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::add): Ditto.
(WebCore::IDBObjectStore::put): Ditto.
(WebCore::IDBObjectStore::putForCursorUpdate): Ditto.
(WebCore::IDBObjectStore::putOrAdd): Ditto.
(WebCore::IDBObjectStore::deleteFunction): Ditto.
(WebCore::IDBObjectStore::doDelete): Ditto.
(WebCore::IDBObjectStore::clear): Ditto.
(WebCore::IDBObjectStore::createIndex): Ditto.
(WebCore::IDBObjectStore::index): Ditto.
(WebCore::IDBObjectStore::deleteIndex): Ditto.
(WebCore::IDBObjectStore::count): Ditto.
(WebCore::IDBObjectStore::doCount): Ditto.
* Modules/indexeddb/IDBObjectStore.h: Updated for above changes.

* Modules/indexeddb/IDBObjectStore.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::errorCode): Deleted. Was dead code.
(WebCore::IDBRequest::error): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
* Modules/indexeddb/IDBRequest.h: Updated for above changes.

* Modules/indexeddb/IDBRequest.idl: Use GetterMayThrowException instead of
GetterMayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::stringToMode): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBTransaction::db): Tweaked code a bit.
(WebCore::IDBTransaction::error): Return a pointer instead of a RefPtr.
(WebCore::IDBTransaction::objectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::abortDueToFailedRequest): Call internalAbort.
(WebCore::IDBTransaction::abort): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::internalAbort): Added a version that asserts
instead of throwing an exception for internal use.
(WebCore::IDBTransaction::stop): Call internalAbort.
* Modules/indexeddb/IDBTransaction.h: Updated for above changes.

* Modules/indexeddb/IDBTransaction.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::openDatabase): Updated to return
a Ref instead of a RefPtr, since the function can never return null.
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): Ditto.
* Modules/indexeddb/client/IDBConnectionProxy.h: Updated for above changes.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): Updated
exception handling to use ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
(WebCore::MediaEndpointSessionDescription::create): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.h: Updated for above change.

* bindings/js/JSDOMBinding.cpp:
(WebCore::createDOMException): Added overload for Exception.
(WebCore::throwDOMException): Deleted overload for ExceptionCodeWithMessage.
Updated code to call the new createDOMException function.
(WebCore::setDOMExceptionSlow): Ditto.
(WebCore::setDOMException): Ditto.

* bindings/js/JSDOMBinding.h: Added overload of createDOMException that takes
an Exception. Deleted functions dealing with ExceptionCodeWithMessage. Fixed
interface of toJSNumber and toJSNullableNumber and implemented toJSNumber.

* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Added overload that takes an Exception.
* bindings/js/JSDOMPromise.h: Updated for above change.

* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState): Use propagateException to deal with
ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::JSHistory::replaceState): Ditto.

* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore): Use toJS and
to deal with ExceptionOr rather than setDOMException to deal
with ExceptionCodeWithMessage.

* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result): Use propagateException and
Exception rather than setDOMException and ExceptionCodeWithMessage.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed support for GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
(GenerateReturnParameters): Ditto.
(GenerateImplementationFunctionCall): Ditto.
(GenerateConstructorDefinition): Ditto.

* bindings/scripts/IDLAttributes.txt: Removed GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.

* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
* bindings/scripts/test/TestObj.idl: Removed tests cases for now-removed attributes.

* dom/CustomElementRegistry.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.

* dom/ExceptionCode.h: Removed ExceptionCodeWithMessage. Also updated to use pragma
once, removed include of WTFString.h and switched to using instead of typedef.

* history/HistoryItem.h: Return a pointer instead of a RefPtr from stateObject
to cut down a little on unnecessary reference count churn.

* inspector/InspectorIndexedDBAgent.cpp: Updated all the code that uses IDB
classes to use the new versions rather than the old ExceptionCodeWithMessage versions.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::history): Pass a reference instead of a pointer.

* page/History.cpp:
(WebCore::History::History): Take a reference instead of a pointer.
(WebCore::History::length): Tweaked to use a local variable.
(WebCore::History::state): Return a pointer instead of a PassRefPtr.
(WebCore::History::stateInternal): Ditto. Also use early return consistently.
(WebCore::History::isSameAsCurrentState): Updated for above change.
(WebCore::History::stateObjectAdded): Return ExceptionOr rather than taking an
ExceptionCodeWithMessage out argument.

* page/History.h: Use pragma once. Removed some unneeded includes. Marked class final.
Updated for changes above.

* page/History.idl: Use MayThrowException instead of MayThrowLegacyException.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursoridl">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseidl">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactorycpp">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactoryh">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactoryidl">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexcpp">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexh">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexidl">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeh">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeidl">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestidl">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionidl">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectioncpp">trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointSessionDescriptioncpp">trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointSessionDescriptionh">trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMPromisecpp">trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMPromiseh">trunk/Source/WebCore/bindings/js/JSDOMPromise.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHistoryCustomcpp">trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBDatabaseCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBRequestCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCoredomCustomElementRegistryidl">trunk/Source/WebCore/dom/CustomElementRegistry.idl</a></li>
<li><a href="#trunkSourceWebCoredomExceptionCodeh">trunk/Source/WebCore/dom/ExceptionCode.h</a></li>
<li><a href="#trunkSourceWebCorehistoryHistoryItemh">trunk/Source/WebCore/history/HistoryItem.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp">trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageHistorycpp">trunk/Source/WebCore/page/History.cpp</a></li>
<li><a href="#trunkSourceWebCorepageHistoryh">trunk/Source/WebCore/page/History.h</a></li>
<li><a href="#trunkSourceWebCorepageHistoryidl">trunk/Source/WebCore/page/History.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/ChangeLog        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -1,3 +1,204 @@
</span><ins>+2016-10-09  Darin Adler  &lt;darin@apple.com&gt;
+
+        Replace all uses of ExceptionCodeWithMessage with WebCore::Exception
+        https://bugs.webkit.org/show_bug.cgi?id=163178
+
+        Reviewed by Sam Weinig.
+
+        * Modules/indexeddb/IDBCursor.cpp:
+        (WebCore::IDBCursor::stringToDirection): Return an Optional instead of
+        using an ExceptionCode out argument, since this function just needs to
+        indicate failure, not actually throw an exception.
+        (WebCore::IDBCursor::update): Return ExceptionOr instead of using an
+        ExceptionCodeWithMessage out argument.
+        (WebCore::IDBCursor::advance): Ditto.
+        (WebCore::IDBCursor::continueFunction): Ditto.
+        (WebCore::IDBCursor::deleteFunction): Ditto.
+        * Modules/indexeddb/IDBCursor.h: Updated for above changes.
+
+        * Modules/indexeddb/IDBCursor.idl: Sorted extended attributes alphabetically.
+        Use MayThrowException instead of MayThrowLegacyExceptionWithMessage.
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::createObjectStore): Return ExceptionOr instead of
+        using an ExceptionCodeWithMessage out argument.
+        (WebCore::IDBDatabase::transaction): Ditto.
+        (WebCore::IDBDatabase::deleteObjectStore): Ditto.
+        * Modules/indexeddb/IDBDatabase.h: Updated for above changes.
+
+        * Modules/indexeddb/IDBDatabase.idl: Use MayThrowException instead of
+        MayThrowLegacyExceptionWithMessage.
+
+        * Modules/indexeddb/IDBFactory.cpp:
+        (WebCore::IDBFactory::open): Return ExceptionOr instead of
+        using an ExceptionCodeWithMessage out argument.
+        (WebCore::IDBFactory::openInternal): Ditto.
+        (WebCore::IDBFactory::deleteDatabase): Ditto.
+        (WebCore::IDBFactory::cmp): Ditto.
+        * Modules/indexeddb/IDBFactory.h: Updated for above changes.
+
+        * Modules/indexeddb/IDBFactory.idl: Use MayThrowException instead of
+        MayThrowLegacyExceptionWithMessage.
+
+        * Modules/indexeddb/IDBIndex.cpp:
+        (WebCore::IDBIndex::openCursor): Return ExceptionOr instead of
+        using an ExceptionCodeWithMessage out argument.
+        (WebCore::IDBIndex::count): Ditto.
+        (WebCore::IDBIndex::doCount): Ditto.
+        (WebCore::IDBIndex::openKeyCursor): Ditto.
+        (WebCore::IDBIndex::get): Ditto.
+        (WebCore::IDBIndex::doGet): Ditto.
+        (WebCore::IDBIndex::getKey): Ditto.
+        (WebCore::IDBIndex::doGetKey): Ditto.
+        * Modules/indexeddb/IDBIndex.h: Updated for above changes.
+
+        * Modules/indexeddb/IDBIndex.idl: Use MayThrowException instead of
+        MayThrowLegacyExceptionWithMessage.
+
+        * Modules/indexeddb/IDBKeyRange.cpp:
+        (WebCore::IDBKeyRange::only): Return ExceptionOr instead of
+        using an ExceptionCode out argument.
+        (WebCore::IDBKeyRange::lowerBound): Ditto.
+        (WebCore::IDBKeyRange::upperBound): Ditto.
+        (WebCore::IDBKeyRange::bound): Ditto.
+        * Modules/indexeddb/IDBKeyRange.h: Updated for above changes.
+        * Modules/indexeddb/IDBKeyRange.idl: Use MayThrowException instead of
+        MayThrowLegacyException.
+
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::openCursor): Return ExceptionOr instead of
+        using an ExceptionCodeWithMessage out argument.
+        (WebCore::IDBObjectStore::get): Ditto.
+        (WebCore::IDBObjectStore::add): Ditto.
+        (WebCore::IDBObjectStore::put): Ditto.
+        (WebCore::IDBObjectStore::putForCursorUpdate): Ditto.
+        (WebCore::IDBObjectStore::putOrAdd): Ditto.
+        (WebCore::IDBObjectStore::deleteFunction): Ditto.
+        (WebCore::IDBObjectStore::doDelete): Ditto.
+        (WebCore::IDBObjectStore::clear): Ditto.
+        (WebCore::IDBObjectStore::createIndex): Ditto.
+        (WebCore::IDBObjectStore::index): Ditto.
+        (WebCore::IDBObjectStore::deleteIndex): Ditto.
+        (WebCore::IDBObjectStore::count): Ditto.
+        (WebCore::IDBObjectStore::doCount): Ditto.
+        * Modules/indexeddb/IDBObjectStore.h: Updated for above changes.
+
+        * Modules/indexeddb/IDBObjectStore.idl: Use MayThrowException instead of
+        MayThrowLegacyExceptionWithMessage.
+
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::errorCode): Deleted. Was dead code.
+        (WebCore::IDBRequest::error): Return ExceptionOr instead of
+        using an ExceptionCodeWithMessage out argument.
+        * Modules/indexeddb/IDBRequest.h: Updated for above changes.
+
+        * Modules/indexeddb/IDBRequest.idl: Use GetterMayThrowException instead of
+        GetterMayThrowLegacyExceptionWithMessage.
+
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::stringToMode): Return an Optional instead of
+        using an ExceptionCode out argument, since this function just needs to
+        indicate failure, not actually throw an exception.
+        (WebCore::IDBTransaction::db): Tweaked code a bit.
+        (WebCore::IDBTransaction::error): Return a pointer instead of a RefPtr.
+        (WebCore::IDBTransaction::objectStore): Return ExceptionOr instead of
+        using an ExceptionCodeWithMessage out argument.
+        (WebCore::IDBTransaction::abortDueToFailedRequest): Call internalAbort.
+        (WebCore::IDBTransaction::abort): Return ExceptionOr instead of
+        using an ExceptionCodeWithMessage out argument.
+        (WebCore::IDBTransaction::internalAbort): Added a version that asserts
+        instead of throwing an exception for internal use.
+        (WebCore::IDBTransaction::stop): Call internalAbort.
+        * Modules/indexeddb/IDBTransaction.h: Updated for above changes.
+
+        * Modules/indexeddb/IDBTransaction.idl: Use MayThrowException instead of
+        MayThrowLegacyExceptionWithMessage.
+
+        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+        (WebCore::IDBClient::IDBConnectionProxy::openDatabase): Updated to return
+        a Ref instead of a RefPtr, since the function can never return null.
+        (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): Ditto.
+        * Modules/indexeddb/client/IDBConnectionProxy.h: Updated for above changes.
+
+        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
+        (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): Updated
+        exception handling to use ExceptionOr instead of ExceptionCodeWithMessage.
+        (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask): Ditto.
+        * Modules/mediastream/MediaEndpointSessionDescription.cpp:
+        (WebCore::MediaEndpointSessionDescription::create): Ditto.
+        * Modules/mediastream/MediaEndpointSessionDescription.h: Updated for above change.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::createDOMException): Added overload for Exception.
+        (WebCore::throwDOMException): Deleted overload for ExceptionCodeWithMessage.
+        Updated code to call the new createDOMException function.
+        (WebCore::setDOMExceptionSlow): Ditto.
+        (WebCore::setDOMException): Ditto.
+
+        * bindings/js/JSDOMBinding.h: Added overload of createDOMException that takes
+        an Exception. Deleted functions dealing with ExceptionCodeWithMessage. Fixed
+        interface of toJSNumber and toJSNullableNumber and implemented toJSNumber.
+
+        * bindings/js/JSDOMPromise.cpp:
+        (WebCore::DeferredPromise::reject): Added overload that takes an Exception.
+        * bindings/js/JSDOMPromise.h: Updated for above change.
+
+        * bindings/js/JSHistoryCustom.cpp:
+        (WebCore::JSHistory::pushState): Use propagateException to deal with
+        ExceptionOr instead of ExceptionCodeWithMessage.
+        (WebCore::JSHistory::replaceState): Ditto.
+
+        * bindings/js/JSIDBDatabaseCustom.cpp:
+        (WebCore::JSIDBDatabase::createObjectStore): Use toJS and
+        to deal with ExceptionOr rather than setDOMException to deal
+        with ExceptionCodeWithMessage.
+
+        * bindings/js/JSIDBRequestCustom.cpp:
+        (WebCore::JSIDBRequest::result): Use propagateException and
+        Exception rather than setDOMException and ExceptionCodeWithMessage.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation): Removed support for GetterMayThrowLegacyExceptionWithMessage,
+        SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
+        (GenerateReturnParameters): Ditto.
+        (GenerateImplementationFunctionCall): Ditto.
+        (GenerateConstructorDefinition): Ditto.
+
+        * bindings/scripts/IDLAttributes.txt: Removed GetterMayThrowLegacyExceptionWithMessage,
+        SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
+
+        * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
+        * bindings/scripts/test/TestObj.idl: Removed tests cases for now-removed attributes.
+
+        * dom/CustomElementRegistry.idl: Use MayThrowException instead of
+        MayThrowLegacyExceptionWithMessage.
+
+        * dom/ExceptionCode.h: Removed ExceptionCodeWithMessage. Also updated to use pragma
+        once, removed include of WTFString.h and switched to using instead of typedef.
+
+        * history/HistoryItem.h: Return a pointer instead of a RefPtr from stateObject
+        to cut down a little on unnecessary reference count churn.
+
+        * inspector/InspectorIndexedDBAgent.cpp: Updated all the code that uses IDB
+        classes to use the new versions rather than the old ExceptionCodeWithMessage versions.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::history): Pass a reference instead of a pointer.
+
+        * page/History.cpp:
+        (WebCore::History::History): Take a reference instead of a pointer.
+        (WebCore::History::length): Tweaked to use a local variable.
+        (WebCore::History::state): Return a pointer instead of a PassRefPtr.
+        (WebCore::History::stateInternal): Ditto. Also use early return consistently.
+        (WebCore::History::isSameAsCurrentState): Updated for above change.
+        (WebCore::History::stateObjectAdded): Return ExceptionOr rather than taking an
+        ExceptionCodeWithMessage out argument.
+
+        * page/History.h: Use pragma once. Removed some unneeded includes. Marked class final.
+        Updated for changes above.
+
+        * page/History.idl: Use MayThrowException instead of MayThrowLegacyException.
+
</ins><span class="cx"> 2016-10-07  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r165103): labels list doesn't get invalidated when other lists are invalidated at document level
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">     return prevunique;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IndexedDB::CursorDirection IDBCursor::stringToDirection(const String&amp; directionString, ExceptionCode&amp; ec)
</del><ins>+Optional&lt;IndexedDB::CursorDirection&gt; IDBCursor::stringToDirection(const String&amp; directionString)
</ins><span class="cx"> {
</span><span class="cx">     if (directionString == directionNext())
</span><span class="cx">         return IndexedDB::CursorDirection::Next;
</span><span class="lines">@@ -82,8 +82,7 @@
</span><span class="cx">     if (directionString == directionPrevUnique())
</span><span class="cx">         return IndexedDB::CursorDirection::PrevNoDuplicate;
</span><span class="cx"> 
</span><del>-    ec = TypeError;
-    return IndexedDB::CursorDirection::Next;
</del><ins>+    return Nullopt;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AtomicString&amp; IDBCursor::directionToString(IndexedDB::CursorDirection direction)
</span><span class="lines">@@ -169,162 +168,116 @@
</span><span class="cx">     return directionToString(m_info.cursorDirection());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBCursor::update(ExecState&amp; exec, JSValue value, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBCursor::update(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBCursor::update&quot;);
</span><span class="cx">     ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (sourcesDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (sourcesDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!transaction().isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (transaction().isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The record may not be updated inside a read-only transaction.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (transaction().isReadOnly())
+        return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The record may not be updated inside a read-only transaction.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_gotValue) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_gotValue)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!isKeyCursorWithValue()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The cursor is a key cursor.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!isKeyCursorWithValue())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The cursor is a key cursor.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     auto&amp; objectStore = effectiveObjectStore();
</span><span class="cx">     auto&amp; keyPath = objectStore.info().keyPath();
</span><span class="cx">     const bool usesInLineKeys = !keyPath.isNull();
</span><span class="cx">     if (usesInLineKeys) {
</span><del>-        RefPtr&lt;IDBKey&gt; keyPathKey = maybeCreateIDBKeyFromScriptValueAndKeyPath(exec, value, keyPath);
</del><ins>+        RefPtr&lt;IDBKey&gt; keyPathKey = maybeCreateIDBKeyFromScriptValueAndKeyPath(state, value, keyPath);
</ins><span class="cx">         IDBKeyData keyPathKeyData(keyPathKey.get());
</span><del>-        if (!keyPathKey || keyPathKeyData != m_currentPrimaryKeyData) {
-            ec.code = IDBDatabaseException::DataError;
-            ec.message = ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key.&quot;);
-            return nullptr;
-        }
</del><ins>+        if (!keyPathKey || keyPathKeyData != m_currentPrimaryKeyData)
+            return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key.&quot;) };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto request = effectiveObjectStore().putForCursorUpdate(exec, value, m_currentPrimaryKey.get(), ec);
-    if (ec.code)
-        return nullptr;
</del><ins>+    auto putResult = effectiveObjectStore().putForCursorUpdate(state, value, m_currentPrimaryKey.get());
+    if (putResult.hasException())
+        return putResult.releaseException();
</ins><span class="cx"> 
</span><del>-    ASSERT(request);
</del><ins>+    auto request = putResult.releaseReturnValue();
</ins><span class="cx">     request-&gt;setSource(*this);
</span><span class="cx">     ++m_outstandingRequestCount;
</span><span class="cx"> 
</span><del>-    return request;
</del><ins>+    return WTFMove(request);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::advance(unsigned count, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; IDBCursor::advance(unsigned count)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBCursor::advance&quot;);
</span><span class="cx">     ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (!m_request) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return;
-    }
-    
-    if (!count) {
-        ec.code = TypeError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': A count argument with value 0 (zero) was supplied, must be greater than 0.&quot;);
-        return;
-    }
</del><ins>+    if (!m_request)
+        return Exception { IDBDatabaseException::InvalidStateError };
</ins><span class="cx"> 
</span><del>-    if (sourcesDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;);
-        return;
-    }
</del><ins>+    if (!count)
+        return Exception { TypeError, ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': A count argument with value 0 (zero) was supplied, must be greater than 0.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!transaction().isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': The transaction is inactive or finished.&quot;);
-        return;
-    }
</del><ins>+    if (sourcesDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_gotValue) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;);
-        return;
-    }
</del><ins>+    if (!transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><ins>+    if (!m_gotValue)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'advance' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;) };
+
</ins><span class="cx">     m_gotValue = false;
</span><span class="cx"> 
</span><span class="cx">     uncheckedIterateCursor(IDBKeyData(), count);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::continueFunction(ExecState&amp; execState, JSValue keyValue, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; IDBCursor::continueFunction(ExecState&amp; execState, JSValue keyValue)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; key;
</span><span class="cx">     if (!keyValue.isUndefined())
</span><span class="cx">         key = scriptValueToIDBKey(execState, keyValue);
</span><span class="cx"> 
</span><del>-    continueFunction(key.get(), ec);
</del><ins>+    return continueFunction(key.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::continueFunction(const IDBKeyData&amp; key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; IDBCursor::continueFunction(const IDBKeyData&amp; key)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBCursor::continueFunction (to key %s)&quot;, key.loggingString().utf8().data());
</span><span class="cx">     ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (!m_request) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return;
-    }
</del><ins>+    if (!m_request)
+        return Exception { IDBDatabaseException::InvalidStateError };
</ins><span class="cx"> 
</span><del>-    if (sourcesDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;);
-        return;
-    }
</del><ins>+    if (sourcesDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!transaction().isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The transaction is inactive or finished.&quot;);
-        return;
-    }
</del><ins>+    if (!transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_gotValue) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;);
-        return;
-    }
</del><ins>+    if (!m_gotValue)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!key.isNull() &amp;&amp; !key.isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The parameter is not a valid key.&quot;);
-        return;
-    }
</del><ins>+    if (!key.isNull() &amp;&amp; !key.isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     if (m_info.isDirectionForward()) {
</span><del>-        if (!key.isNull() &amp;&amp; key.compare(m_currentKeyData) &lt;= 0) {
-            ec.code = IDBDatabaseException::DataError;
-            ec.message = ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.&quot;);
-            return;
-        }
-    } else if (!key.isNull() &amp;&amp; key.compare(m_currentKeyData) &gt;= 0) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The parameter is greater than or equal to this cursor's position.&quot;);
-        return;
</del><ins>+        if (!key.isNull() &amp;&amp; key.compare(m_currentKeyData) &lt;= 0)
+            return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.&quot;) };
+    } else {
+        if (!key.isNull() &amp;&amp; key.compare(m_currentKeyData) &gt;= 0)
+            return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': The parameter is greater than or equal to this cursor's position.&quot;) };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_gotValue = false;
</span><span class="cx"> 
</span><span class="cx">     uncheckedIterateCursor(key, 0);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBCursor::uncheckedIterateCursor(const IDBKeyData&amp; key, unsigned count)
</span><span class="lines">@@ -337,50 +290,35 @@
</span><span class="cx">     transaction().iterateCursor(*this, key, count);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBCursor::deleteFunction(ExecState&amp; execState, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;WebCore::IDBRequest&gt;&gt; IDBCursor::deleteFunction(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBCursor::deleteFunction&quot;);
</span><span class="cx">     ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (sourcesDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (sourcesDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The cursor's source or effective object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!transaction().isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (transaction().isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The record may not be deleted inside a read-only transaction.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (transaction().isReadOnly())
+        return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The record may not be deleted inside a read-only transaction.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_gotValue) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_gotValue)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The cursor is being iterated or has iterated past its end.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!isKeyCursorWithValue()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The cursor is a key cursor.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!isKeyCursorWithValue())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The cursor is a key cursor.&quot;) };
</ins><span class="cx"> 
</span><del>-    auto request = effectiveObjectStore().deleteFunction(execState, m_currentPrimaryKey.get(), ec);
-    if (ec.code)
-        return nullptr;
</del><ins>+    auto result = effectiveObjectStore().deleteFunction(state, m_currentPrimaryKey.get());
+    if (result.hasException())
+        return result.releaseException();
</ins><span class="cx"> 
</span><del>-    ASSERT(request);
</del><ins>+    auto request = result.releaseReturnValue();
</ins><span class="cx">     request-&gt;setSource(*this);
</span><span class="cx">     ++m_outstandingRequestCount;
</span><span class="cx"> 
</span><del>-    return request;
</del><ins>+    return WTFMove(request);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBCursor::setGetResult(IDBRequest&amp; request, const IDBGetResult&amp; getResult)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;DOMWrapperWorld.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;IDBCursorInfo.h&quot;
</span><span class="cx"> #include &lt;heap/Strong.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -39,8 +40,6 @@
</span><span class="cx"> class IDBObjectStore;
</span><span class="cx"> class IDBTransaction;
</span><span class="cx"> 
</span><del>-struct ExceptionCodeWithMessage;
-
</del><span class="cx"> class IDBCursor : public ScriptWrappable, public RefCounted&lt;IDBCursor&gt;, public ActiveDOMObject {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBCursor&gt; create(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
</span><span class="lines">@@ -50,7 +49,7 @@
</span><span class="cx">     static const AtomicString&amp; directionPrev();
</span><span class="cx">     static const AtomicString&amp; directionPrevUnique();
</span><span class="cx"> 
</span><del>-    static IndexedDB::CursorDirection stringToDirection(const String&amp; modeString, ExceptionCode&amp;);
</del><ins>+    static Optional&lt;IndexedDB::CursorDirection&gt; stringToDirection(const String&amp; modeString);
</ins><span class="cx">     static const AtomicString&amp; directionToString(IndexedDB::CursorDirection mode);
</span><span class="cx">     
</span><span class="cx">     virtual ~IDBCursor();
</span><span class="lines">@@ -62,12 +61,12 @@
</span><span class="cx">     IDBObjectStore* objectStore() const { return m_objectStore.get(); }
</span><span class="cx">     IDBIndex* index() const { return m_index.get(); }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; update(JSC::ExecState&amp;, JSC::JSValue, ExceptionCodeWithMessage&amp;);
-    void advance(unsigned, ExceptionCodeWithMessage&amp;);
-    void continueFunction(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; deleteFunction(JSC::ExecState&amp;, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; update(JSC::ExecState&amp;, JSC::JSValue);
+    ExceptionOr&lt;void&gt; advance(unsigned);
+    ExceptionOr&lt;void&gt; continueFunction(JSC::ExecState&amp;, JSC::JSValue key);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; deleteFunction(JSC::ExecState&amp;);
</ins><span class="cx"> 
</span><del>-    void continueFunction(const IDBKeyData&amp;, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; continueFunction(const IDBKeyData&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const IDBCursorInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -24,12 +24,12 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><ins>+    ActiveDOMObject,
</ins><span class="cx">     Conditional=INDEXED_DATABASE,
</span><span class="cx">     CustomToJSObject,
</span><span class="cx">     EnabledAtRuntime=IndexedDB,
</span><del>-    ActiveDOMObject,
</del><ins>+    JSCustomMarkFunction,
</ins><span class="cx">     SkipVTableValidation,
</span><del>-    JSCustomMarkFunction,
</del><span class="cx"> ] interface IDBCursor {
</span><span class="cx">     [CustomGetter] readonly attribute any source;
</span><span class="cx">     readonly attribute DOMString direction;
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx">     readonly attribute any key;
</span><span class="cx">     readonly attribute any primaryKey;
</span><span class="cx"> 
</span><del>-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest update(any value);
-    [MayThrowLegacyExceptionWithMessage] void advance([EnforceRange] unsigned long count);
-    [CallWith=ScriptState, ImplementedAs=continueFunction, MayThrowLegacyExceptionWithMessage] void continue(optional any key);
-    [CallWith=ScriptState, ImplementedAs=deleteFunction, MayThrowLegacyExceptionWithMessage] IDBRequest delete();
</del><ins>+    [CallWith=ScriptState, MayThrowException] IDBRequest update(any value);
+    [MayThrowException] void advance([EnforceRange] unsigned long count);
+    [CallWith=ScriptState, ImplementedAs=continueFunction, MayThrowException] void continue(optional any key);
+    [CallWith=ScriptState, ImplementedAs=deleteFunction, MayThrowException] IDBRequest delete();
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -106,13 +106,13 @@
</span><span class="cx">     return objectStoreNames;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBObjectStore&gt; IDBDatabase::createObjectStore(const String&amp;, const Dictionary&amp;, ExceptionCodeWithMessage&amp;)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBObjectStore&gt;&gt; IDBDatabase::createObjectStore(const String&amp;, const Dictionary&amp;)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return nullptr;
</del><ins>+    return Exception { IDBDatabaseException::InvalidStateError };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBObjectStore&gt; IDBDatabase::createObjectStore(const String&amp; name, const IDBKeyPath&amp; keyPath, bool autoIncrement, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBObjectStore&gt;&gt; IDBDatabase::createObjectStore(const String&amp; name, const IDBKeyPath&amp; keyPath, bool autoIncrement)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBDatabase::createObjectStore - (%s %s)&quot;, m_info.name().utf8().data(), name.utf8().data());
</span><span class="cx"> 
</span><span class="lines">@@ -119,132 +119,94 @@
</span><span class="cx">     ASSERT(currentThread() == originThreadID());
</span><span class="cx">     ASSERT(!m_versionChangeTransaction || m_versionChangeTransaction-&gt;isVersionChange());
</span><span class="cx"> 
</span><del>-    if (!m_versionChangeTransaction) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': The database is not running a version change transaction.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_versionChangeTransaction)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': The database is not running a version change transaction.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_versionChangeTransaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return nullptr;
-    }
</del><ins>+    if (!m_versionChangeTransaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError };
</ins><span class="cx"> 
</span><del>-    if (m_info.hasObjectStore(name)) {
-        ec.code = IDBDatabaseException::ConstraintError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': An object store with the specified name already exists.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_info.hasObjectStore(name))
+        return Exception { IDBDatabaseException::ConstraintError, ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': An object store with the specified name already exists.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!keyPath.isNull() &amp;&amp; !keyPath.isValid()) {
-        ec.code = IDBDatabaseException::SyntaxError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': The keyPath option is not a valid key path.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!keyPath.isNull() &amp;&amp; !keyPath.isValid())
+        return Exception { IDBDatabaseException::SyntaxError, ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': The keyPath option is not a valid key path.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (autoIncrement &amp;&amp; !keyPath.isNull()) {
-        if ((keyPath.type() == IDBKeyPath::Type::String &amp;&amp; keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::Type::Array) {
-            ec.code = IDBDatabaseException::InvalidAccessError;
-            ec.message = ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': The autoIncrement option was set but the keyPath option was empty or an array.&quot;);
-            return nullptr;
-        }
-    }
</del><ins>+    if (autoIncrement &amp;&amp; ((keyPath.type() == IDBKeyPath::Type::String &amp;&amp; keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::Type::Array))
+        return Exception { IDBDatabaseException::InvalidAccessError, ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': The autoIncrement option was set but the keyPath option was empty or an array.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     // Install the new ObjectStore into the connection's metadata.
</span><del>-    IDBObjectStoreInfo info = m_info.createNewObjectStore(name, keyPath, autoIncrement);
</del><ins>+    auto info = m_info.createNewObjectStore(name, keyPath, autoIncrement);
</ins><span class="cx"> 
</span><span class="cx">     // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
</span><del>-    Ref&lt;IDBObjectStore&gt; objectStore = m_versionChangeTransaction-&gt;createObjectStore(info);
-    return adoptRef(&amp;objectStore.leakRef());
</del><ins>+    return m_versionChangeTransaction-&gt;createObjectStore(info);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBTransaction&gt; IDBDatabase::transaction(const Vector&lt;String&gt;&amp; objectStores, const String&amp; modeString, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBTransaction&gt;&gt; IDBDatabase::transaction(const Vector&lt;String&gt;&amp; objectStores, const String&amp; modeString)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBDatabase::transaction&quot;);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(currentThread() == originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_closePending) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_closePending)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (objectStores.isEmpty()) {
-        ec.code = IDBDatabaseException::InvalidAccessError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': The storeNames parameter was empty.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (objectStores.isEmpty())
+        return Exception { IDBDatabaseException::InvalidAccessError, ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': The storeNames parameter was empty.&quot;) };
</ins><span class="cx"> 
</span><del>-    IndexedDB::TransactionMode mode = IDBTransaction::stringToMode(modeString, ec.code);
-    if (ec.code) {
-        ec.message = makeString(ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': The mode provided ('&quot;), modeString, ASCIILiteral(&quot;') is not one of 'readonly' or 'readwrite'.&quot;));
-        return nullptr;
-    }
</del><ins>+    auto mode = IDBTransaction::stringToMode(modeString);
+    if (!mode)
+        return Exception { TypeError, &quot;Failed to execute 'transaction' on 'IDBDatabase': The mode provided ('&quot; + modeString + &quot;') is not one of 'readonly' or 'readwrite'.&quot; };
</ins><span class="cx"> 
</span><del>-    if (mode != IndexedDB::TransactionMode::ReadOnly &amp;&amp; mode != IndexedDB::TransactionMode::ReadWrite) {
-        ec.code = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (mode.value() != IndexedDB::TransactionMode::ReadOnly &amp;&amp; mode.value() != IndexedDB::TransactionMode::ReadWrite)
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><del>-    if (m_versionChangeTransaction &amp;&amp; !m_versionChangeTransaction-&gt;isFinishedOrFinishing()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_versionChangeTransaction &amp;&amp; !m_versionChangeTransaction-&gt;isFinishedOrFinishing())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     for (auto&amp; objectStoreName : objectStores) {
</span><span class="cx">         if (m_info.hasObjectStore(objectStoreName))
</span><span class="cx">             continue;
</span><del>-        ec.code = IDBDatabaseException::NotFoundError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.&quot;);
-        return nullptr;
</del><ins>+        return Exception { IDBDatabaseException::NotFoundError, ASCIILiteral(&quot;Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.&quot;) };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto info = IDBTransactionInfo::clientTransaction(m_connectionProxy.get(), objectStores, mode);
</del><ins>+    auto info = IDBTransactionInfo::clientTransaction(m_connectionProxy.get(), objectStores, mode.value());
</ins><span class="cx">     auto transaction = IDBTransaction::create(*this, info);
</span><span class="cx"> 
</span><span class="cx">     LOG(IndexedDB, &quot;IDBDatabase::transaction - Added active transaction %s&quot;, info.identifier().loggingString().utf8().data());
</span><span class="cx"> 
</span><del>-    m_activeTransactions.set(info.identifier(), &amp;transaction.get());
</del><ins>+    m_activeTransactions.set(info.identifier(), transaction.ptr());
</ins><span class="cx"> 
</span><del>-    return adoptRef(&amp;transaction.leakRef());
</del><ins>+    return WTFMove(transaction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBTransaction&gt; IDBDatabase::transaction(const String&amp; objectStore, const String&amp; mode, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBTransaction&gt;&gt; IDBDatabase::transaction(const String&amp; objectStore, const String&amp; mode)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == originThreadID());
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; objectStores(1);
</span><span class="cx">     objectStores[0] = objectStore;
</span><del>-    return transaction(objectStores, mode, ec);
</del><ins>+    return transaction(objectStores, mode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBDatabase::deleteObjectStore(const String&amp; objectStoreName, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; IDBDatabase::deleteObjectStore(const String&amp; objectStoreName)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBDatabase::deleteObjectStore&quot;);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(currentThread() == originThreadID());
</span><span class="cx"> 
</span><del>-    if (!m_versionChangeTransaction) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'deleteObjectStore' on 'IDBDatabase': The database is not running a version change transaction.&quot;);
-        return;
-    }
</del><ins>+    if (!m_versionChangeTransaction)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'deleteObjectStore' on 'IDBDatabase': The database is not running a version change transaction.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_versionChangeTransaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return;
-    }
</del><ins>+    if (!m_versionChangeTransaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError };
</ins><span class="cx"> 
</span><del>-    if (!m_info.hasObjectStore(objectStoreName)) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'deleteObjectStore' on 'IDBDatabase': The specified object store was not found.&quot;);
-        return;
-    }
</del><ins>+    if (!m_info.hasObjectStore(objectStoreName))
+        return Exception { IDBDatabaseException::NotFoundError, ASCIILiteral(&quot;Failed to execute 'deleteObjectStore' on 'IDBDatabase': The specified object store was not found.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     m_info.deleteObjectStore(objectStoreName);
</span><span class="cx">     m_versionChangeTransaction-&gt;deleteObjectStore(objectStoreName);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBDatabase::close()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -55,11 +55,11 @@
</span><span class="cx">     uint64_t version() const;
</span><span class="cx">     RefPtr&lt;DOMStringList&gt; objectStoreNames() const;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBObjectStore&gt; createObjectStore(const String&amp; name, const Dictionary&amp;, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBObjectStore&gt; createObjectStore(const String&amp; name, const IDBKeyPath&amp;, bool autoIncrement, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBTransaction&gt; transaction(const Vector&lt;String&gt;&amp;, const String&amp; mode, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBTransaction&gt; transaction(const String&amp;, const String&amp; mode, ExceptionCodeWithMessage&amp;);
-    void deleteObjectStore(const String&amp; name, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBObjectStore&gt;&gt; createObjectStore(const String&amp; name, const Dictionary&amp;);
+    ExceptionOr&lt;Ref&lt;IDBObjectStore&gt;&gt; createObjectStore(const String&amp; name, const IDBKeyPath&amp;, bool autoIncrement);
+    ExceptionOr&lt;Ref&lt;IDBTransaction&gt;&gt; transaction(const Vector&lt;String&gt;&amp;, const String&amp; mode);
+    ExceptionOr&lt;Ref&lt;IDBTransaction&gt;&gt; transaction(const String&amp;, const String&amp; mode);
+    ExceptionOr&lt;void&gt; deleteObjectStore(const String&amp; name);
</ins><span class="cx">     void close();
</span><span class="cx"> 
</span><span class="cx">     // EventTarget
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -34,13 +34,13 @@
</span><span class="cx">     readonly attribute unsigned long long version;
</span><span class="cx">     readonly attribute DOMStringList objectStoreNames;
</span><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyExceptionWithMessage] IDBObjectStore createObjectStore(DOMString name, optional Dictionary options);
-    [MayThrowLegacyExceptionWithMessage] void deleteObjectStore(DOMString name);
-    [MayThrowLegacyExceptionWithMessage] IDBTransaction transaction(DOMString storeName, optional DOMString mode = &quot;readonly&quot;);
-    [MayThrowLegacyExceptionWithMessage] IDBTransaction transaction(sequence&lt;DOMString&gt; storeNames, optional DOMString mode = &quot;readonly&quot;);
</del><ins>+    [Custom, MayThrowException] IDBObjectStore createObjectStore(DOMString name, optional Dictionary options);
+    [MayThrowException] void deleteObjectStore(DOMString name);
+    [MayThrowException] IDBTransaction transaction(DOMString storeName, optional DOMString mode = &quot;readonly&quot;);
+    [MayThrowException] IDBTransaction transaction(sequence&lt;DOMString&gt; storeNames, optional DOMString mode = &quot;readonly&quot;);
</ins><span class="cx">     // FIXME: This is not part of the spec, but is needed for compatibility.
</span><span class="cx">     // See https://github.com/w3c/IndexedDB/issues/85
</span><del>-    [MayThrowLegacyExceptionWithMessage] IDBTransaction transaction(DOMStringList storeNames, optional DOMString mode = &quot;readonly&quot;);
</del><ins>+    [MayThrowException] IDBTransaction transaction(DOMStringList storeNames, optional DOMString mode = &quot;readonly&quot;);
</ins><span class="cx">     void close();
</span><span class="cx"> 
</span><span class="cx">     attribute EventHandler onabort;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -76,82 +76,59 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, Optional&lt;uint64_t&gt; version, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBOpenDBRequest&gt;&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, Optional&lt;uint64_t&gt; version)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBFactory::open&quot;);
</span><span class="cx">     
</span><del>-    if (version &amp;&amp; !version.value()) {
-        ec.code = TypeError;
-        ec.message = ASCIILiteral(&quot;IDBFactory.open() called with a version of 0&quot;);
-        return nullptr;
-    }
</del><ins>+    if (version &amp;&amp; !version.value())
+        return Exception { TypeError, ASCIILiteral(&quot;IDBFactory.open() called with a version of 0&quot;) };
</ins><span class="cx"> 
</span><del>-    return openInternal(context, name, version.valueOr(0), ec);
</del><ins>+    return openInternal(context, name, version.valueOr(0));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::openInternal(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBOpenDBRequest&gt;&gt; IDBFactory::openInternal(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version)
</ins><span class="cx"> {
</span><del>-    if (name.isNull()) {
-        ec.code = TypeError;
-        ec.message = ASCIILiteral(&quot;IDBFactory.open() called without a database name&quot;);
-        return nullptr;
-    }
</del><ins>+    if (name.isNull())
+        return Exception { TypeError, ASCIILiteral(&quot;IDBFactory.open() called without a database name&quot;) };
</ins><span class="cx"> 
</span><del>-    if (shouldThrowSecurityException(context)) {
-        ec.code = SECURITY_ERR;
-        ec.message = ASCIILiteral(&quot;IDBFactory.open() called in an invalid security context&quot;);
-        return nullptr;
-    }
</del><ins>+    if (shouldThrowSecurityException(context))
+        return Exception { SECURITY_ERR, ASCIILiteral(&quot;IDBFactory.open() called in an invalid security context&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(context.securityOrigin());
</span><span class="cx">     ASSERT(context.topOrigin());
</span><span class="cx">     IDBDatabaseIdentifier databaseIdentifier(name, *context.securityOrigin(), *context.topOrigin());
</span><del>-    if (!databaseIdentifier.isValid()) {
-        ec.code = TypeError;
-        ec.message = ASCIILiteral(&quot;IDBFactory.open() called with an invalid security origin&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!databaseIdentifier.isValid())
+        return Exception { TypeError, ASCIILiteral(&quot;IDBFactory.open() called with an invalid security origin&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return m_connectionProxy-&gt;openDatabase(context, databaseIdentifier, version);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::deleteDatabase(ScriptExecutionContext&amp; context, const String&amp; name, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBOpenDBRequest&gt;&gt; IDBFactory::deleteDatabase(ScriptExecutionContext&amp; context, const String&amp; name)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBFactory::deleteDatabase - %s&quot;, name.utf8().data());
</span><span class="cx"> 
</span><del>-    if (name.isNull()) {
-        ec.code = TypeError;
-        ec.message = ASCIILiteral(&quot;IDBFactory.deleteDatabase() called without a database name&quot;);
-    }
-    
-    if (shouldThrowSecurityException(context)) {
-        ec.code = SECURITY_ERR;
-        ec.message = ASCIILiteral(&quot;IDBFactory.deleteDatabase() called in an invalid security context&quot;);
-        return nullptr;
-    }
</del><ins>+    if (name.isNull())
+        return Exception { TypeError, ASCIILiteral(&quot;IDBFactory.deleteDatabase() called without a database name&quot;) };
</ins><span class="cx"> 
</span><ins>+    if (shouldThrowSecurityException(context))
+        return Exception { SECURITY_ERR, ASCIILiteral(&quot;IDBFactory.deleteDatabase() called in an invalid security context&quot;) };
+
</ins><span class="cx">     ASSERT(context.securityOrigin());
</span><span class="cx">     ASSERT(context.topOrigin());
</span><span class="cx">     IDBDatabaseIdentifier databaseIdentifier(name, *context.securityOrigin(), *context.topOrigin());
</span><del>-    if (!databaseIdentifier.isValid()) {
-        ec.code = TypeError;
-        ec.message = ASCIILiteral(&quot;IDBFactory.deleteDatabase() called with an invalid security origin&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!databaseIdentifier.isValid())
+        return Exception { TypeError, ASCIILiteral(&quot;IDBFactory.deleteDatabase() called with an invalid security origin&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return m_connectionProxy-&gt;deleteDatabase(context, databaseIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-short IDBFactory::cmp(ExecState&amp; execState, JSValue firstValue, JSValue secondValue, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;short&gt; IDBFactory::cmp(ExecState&amp; execState, JSValue firstValue, JSValue secondValue)
</ins><span class="cx"> {
</span><del>-    Ref&lt;IDBKey&gt; first = scriptValueToIDBKey(execState, firstValue);
-    Ref&lt;IDBKey&gt; second = scriptValueToIDBKey(execState, secondValue);
</del><ins>+    auto first = scriptValueToIDBKey(execState, firstValue);
+    auto second = scriptValueToIDBKey(execState, secondValue);
</ins><span class="cx"> 
</span><del>-    if (!first-&gt;isValid() || !second-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.&quot;);
-        return 0;
-    }
</del><ins>+    if (!first-&gt;isValid() || !second-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return first-&gt;compare(second.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &lt;functional&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="lines">@@ -44,8 +45,6 @@
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> 
</span><del>-struct ExceptionCodeWithMessage;
-
</del><span class="cx"> namespace IDBClient {
</span><span class="cx"> class IDBConnectionProxy;
</span><span class="cx"> }
</span><span class="lines">@@ -57,10 +56,10 @@
</span><span class="cx">     static Ref&lt;IDBFactory&gt; create(IDBClient::IDBConnectionProxy&amp;);
</span><span class="cx">     ~IDBFactory();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, Optional&lt;uint64_t&gt; version, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBOpenDBRequest&gt;&gt; open(ScriptExecutionContext&amp;, const String&amp; name, Optional&lt;uint64_t&gt; version);
+    ExceptionOr&lt;Ref&lt;IDBOpenDBRequest&gt;&gt; deleteDatabase(ScriptExecutionContext&amp;, const String&amp; name);
</ins><span class="cx"> 
</span><del>-    short cmp(JSC::ExecState&amp;, JSC::JSValue first, JSC::JSValue second, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;short&gt; cmp(JSC::ExecState&amp;, JSC::JSValue first, JSC::JSValue second);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void getAllDatabaseNames(const SecurityOrigin&amp; mainFrameOrigin, const SecurityOrigin&amp; openingOrigin, std::function&lt;void (const Vector&lt;String&gt;&amp;)&gt;);
</span><span class="cx"> 
</span><span class="lines">@@ -67,7 +66,7 @@
</span><span class="cx"> private:
</span><span class="cx">     explicit IDBFactory(IDBClient::IDBConnectionProxy&amp;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBOpenDBRequest&gt; openInternal(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBOpenDBRequest&gt;&gt; openInternal(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;IDBClient::IDBConnectionProxy&gt; m_connectionProxy;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -28,8 +28,7 @@
</span><span class="cx">     EnabledAtRuntime=IndexedDB,
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx"> ] interface IDBFactory {
</span><del>-    [CallWith=ScriptExecutionContext, MayThrowLegacyExceptionWithMessage] IDBOpenDBRequest open(DOMString name, [EnforceRange] optional unsigned long long version);
-    [CallWith=ScriptExecutionContext, MayThrowLegacyExceptionWithMessage] IDBOpenDBRequest deleteDatabase(DOMString name);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] short cmp(any first, any second);
</del><ins>+    [CallWith=ScriptExecutionContext, MayThrowException] IDBOpenDBRequest open(DOMString name, [EnforceRange] optional unsigned long long version);
+    [CallWith=ScriptExecutionContext, MayThrowException] IDBOpenDBRequest deleteDatabase(DOMString name);
+    [CallWith=ScriptState, MayThrowException] short cmp(any first, any second);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -102,28 +102,20 @@
</span><span class="cx">     return m_info.multiEntry();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openCursor(ExecState&amp; execState, IDBKeyRange* range, const String&amp; directionString, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::openCursor(ExecState&amp; execState, IDBKeyRange* range, const String&amp; directionString)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::openCursor&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted || m_objectStore.isDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The index or its object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted || m_objectStore.isDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The index or its object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_objectStore.transaction().isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_objectStore.transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec.code);
-    if (ec.code) {
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.&quot;);
-        return nullptr;
-    }
</del><ins>+    auto direction = IDBCursor::stringToDirection(directionString);
+    if (!direction)
+        return Exception { TypeError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     IDBKeyRangeData rangeData = range;
</span><span class="cx">     if (rangeData.lowerKey.isNull())
</span><span class="lines">@@ -131,196 +123,152 @@
</span><span class="cx">     if (rangeData.upperKey.isNull())
</span><span class="cx">         rangeData.upperKey = IDBKeyData::maximum();
</span><span class="cx"> 
</span><del>-    auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), rangeData, direction, IndexedDB::CursorType::KeyAndValue);
</del><ins>+    auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), rangeData, direction.value(), IndexedDB::CursorType::KeyAndValue);
</ins><span class="cx">     return m_objectStore.transaction().requestOpenCursor(execState, *this, info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openCursor(ExecState&amp; execState, JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::openCursor(ExecState&amp; execState, JSValue key, const String&amp; direction)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::openCursor&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(execState, key, ec.code);
-    if (ec.code) {
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
</del><ins>+    auto keyRange = IDBKeyRange::only(execState, key);
+    if (keyRange.hasException())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBIndex': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><del>-    return openCursor(execState, keyRange.get(), direction, ec);
</del><ins>+    return openCursor(execState, keyRange.releaseReturnValue().ptr(), direction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::count(ExecState&amp; execState, IDBKeyRange* range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::count(ExecState&amp; execState, IDBKeyRange* range)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::count&quot;);
</span><span class="cx"> 
</span><del>-    return doCount(execState, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys(), ec);
</del><ins>+    return doCount(execState, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::count(ExecState&amp; execState, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::count(ExecState&amp; execState, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::count&quot;);
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(execState, key);
-    if (!idbKey-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
</del><ins>+    auto idbKey = scriptValueToIDBKey(execState, key);
+    if (!idbKey-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><del>-    return doCount(execState, IDBKeyRangeData(idbKey.ptr()), ec);
</del><ins>+    return doCount(execState, IDBKeyRangeData(idbKey.ptr()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::doCount(ExecState&amp; execState, const IDBKeyRangeData&amp; range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::doCount(ExecState&amp; execState, const IDBKeyRangeData&amp; range)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted || m_objectStore.isDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': The index or its object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted || m_objectStore.isDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': The index or its object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!range.isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (!range.isValid())
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     auto&amp; transaction = m_objectStore.transaction();
</span><del>-    if (!transaction.isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!transaction.isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return transaction.requestCount(execState, *this, range);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openKeyCursor(ExecState&amp; execState, IDBKeyRange* range, const String&amp; directionString, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::openKeyCursor(ExecState&amp; execState, IDBKeyRange* range, const String&amp; directionString)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::openKeyCursor&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted || m_objectStore.isDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The index or its object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted || m_objectStore.isDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The index or its object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_objectStore.transaction().isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_objectStore.transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec.code);
-    if (ec.code) {
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.&quot;);
-        return nullptr;
-    }
</del><ins>+    auto direction = IDBCursor::stringToDirection(directionString);
+    if (!direction)
+        return Exception { TypeError, ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.&quot;) };
</ins><span class="cx"> 
</span><del>-    auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), range, direction, IndexedDB::CursorType::KeyOnly);
</del><ins>+    auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), range, direction.value(), IndexedDB::CursorType::KeyOnly);
</ins><span class="cx">     return m_objectStore.transaction().requestOpenCursor(execState, *this, info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openKeyCursor(ExecState&amp; execState, JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::openKeyCursor(ExecState&amp; execState, JSValue key, const String&amp; direction)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::openKeyCursor&quot;);
</span><del>-    RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(execState, key, ec.code);
-    if (ec.code) {
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
-    return openKeyCursor(execState, keyRange.get(), direction, ec);
</del><ins>+
+    auto keyRange = IDBKeyRange::only(execState, key);
+    if (keyRange.hasException())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBIndex': The parameter is not a valid key.&quot;) };
+    return openKeyCursor(execState, keyRange.releaseReturnValue().ptr(), direction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::get(ExecState&amp; execState, IDBKeyRange* range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::get(ExecState&amp; execState, IDBKeyRange* range)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::get&quot;);
</span><span class="cx"> 
</span><del>-    return doGet(execState, IDBKeyRangeData(range), ec);
</del><ins>+    return doGet(execState, IDBKeyRangeData(range));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::get(ExecState&amp; execState, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::get(ExecState&amp; execState, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::get&quot;);
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(execState, key);
-    if (!idbKey-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
</del><ins>+    auto idbKey = scriptValueToIDBKey(execState, key);
+    if (!idbKey-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><del>-    return doGet(execState, IDBKeyRangeData(idbKey.ptr()), ec);
</del><ins>+    return doGet(execState, IDBKeyRangeData(idbKey.ptr()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::doGet(ExecState&amp; execState, const IDBKeyRangeData&amp; range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::doGet(ExecState&amp; execState, const IDBKeyRangeData&amp; range)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted || m_objectStore.isDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': The index or its object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted || m_objectStore.isDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': The index or its object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (range.isNull) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (range.isNull)
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     auto&amp; transaction = m_objectStore.transaction();
</span><del>-    if (!transaction.isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!transaction.isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return transaction.requestGetValue(execState, *this, range);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::getKey(ExecState&amp; execState, IDBKeyRange* range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::getKey(ExecState&amp; execState, IDBKeyRange* range)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::getKey&quot;);
</span><span class="cx"> 
</span><del>-    return doGetKey(execState, IDBKeyRangeData(range), ec);
</del><ins>+    return doGetKey(execState, IDBKeyRangeData(range));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::getKey(ExecState&amp; execState, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::getKey(ExecState&amp; execState, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::getKey&quot;);
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(execState, key);
-    if (!idbKey-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'getKey' on 'IDBIndex': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
</del><ins>+    auto idbKey = scriptValueToIDBKey(execState, key);
+    if (!idbKey-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'getKey' on 'IDBIndex': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><del>-    return doGetKey(execState, IDBKeyRangeData(idbKey.ptr()), ec);
</del><ins>+    return doGetKey(execState, IDBKeyRangeData(idbKey.ptr()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::doGetKey(ExecState&amp; execState, const IDBKeyRangeData&amp; range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::doGetKey(ExecState&amp; execState, const IDBKeyRangeData&amp; range)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted || m_objectStore.isDeleted()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'getKey' on 'IDBIndex': The index or its object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted || m_objectStore.isDeleted())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'getKey' on 'IDBIndex': The index or its object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (range.isNull) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (range.isNull)
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     auto&amp; transaction = m_objectStore.transaction();
</span><del>-    if (!transaction.isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'getKey' on 'IDBIndex': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!transaction.isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'getKey' on 'IDBIndex': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return transaction.requestGetKey(execState, *this, range);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -53,19 +53,19 @@
</span><span class="cx">     bool unique() const;
</span><span class="cx">     bool multiEntry() const;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; openCursor(JSC::ExecState&amp;, IDBKeyRange*, const String&amp; direction, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; openCursor(JSC::ExecState&amp;, JSC::JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openCursor(JSC::ExecState&amp;, IDBKeyRange*, const String&amp; direction);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openCursor(JSC::ExecState&amp;, JSC::JSValue key, const String&amp; direction);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; count(JSC::ExecState&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; count(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; count(JSC::ExecState&amp;, IDBKeyRange*);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; count(JSC::ExecState&amp;, JSC::JSValue key);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; openKeyCursor(JSC::ExecState&amp;, IDBKeyRange*, const String&amp; direction, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; openKeyCursor(JSC::ExecState&amp;, JSC::JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openKeyCursor(JSC::ExecState&amp;, IDBKeyRange*, const String&amp; direction);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openKeyCursor(JSC::ExecState&amp;, JSC::JSValue key, const String&amp; direction);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; get(JSC::ExecState&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; get(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; getKey(JSC::ExecState&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; getKey(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; get(JSC::ExecState&amp;, IDBKeyRange*);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; get(JSC::ExecState&amp;, JSC::JSValue key);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; getKey(JSC::ExecState&amp;, IDBKeyRange*);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; getKey(JSC::ExecState&amp;, JSC::JSValue key);
</ins><span class="cx"> 
</span><span class="cx">     const IDBIndexInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><span class="lines">@@ -78,9 +78,9 @@
</span><span class="cx">     void* objectStoreAsOpaqueRoot() { return &amp;m_objectStore; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    RefPtr&lt;IDBRequest&gt; doCount(JSC::ExecState&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; doGet(JSC::ExecState&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; doGetKey(JSC::ExecState&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; doCount(JSC::ExecState&amp;, const IDBKeyRangeData&amp;);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; doGet(JSC::ExecState&amp;, const IDBKeyRangeData&amp;);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; doGetKey(JSC::ExecState&amp;, const IDBKeyRangeData&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const char* activeDOMObjectName() const final;
</span><span class="cx">     bool canSuspendForDocumentSuspension() const final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -26,9 +26,9 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=INDEXED_DATABASE,
</span><span class="cx">     EnabledAtRuntime=IndexedDB,
</span><ins>+    GenerateIsReachable=Impl,
+    JSCustomMarkFunction,
</ins><span class="cx">     SkipVTableValidation,
</span><del>-    JSCustomMarkFunction,
-    GenerateIsReachable=Impl,
</del><span class="cx"> ] interface IDBIndex {
</span><span class="cx">     readonly attribute DOMString name;
</span><span class="cx">     readonly attribute IDBObjectStore objectStore;
</span><span class="lines">@@ -36,17 +36,17 @@
</span><span class="cx">     readonly attribute boolean multiEntry;
</span><span class="cx">     readonly attribute boolean unique;
</span><span class="cx"> 
</span><del>-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest openCursor(any key, optional DOMString direction = &quot;next&quot;);
</del><ins>+    [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
+    [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional DOMString direction = &quot;next&quot;);
</ins><span class="cx"> 
</span><del>-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest openKeyCursor(any key, optional DOMString direction = &quot;next&quot;);
</del><ins>+    [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
+    [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(any key, optional DOMString direction = &quot;next&quot;);
</ins><span class="cx"> 
</span><del>-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest get(IDBKeyRange? key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest get(any key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest getKey(IDBKeyRange? key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest getKey(any key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest count(optional IDBKeyRange? range = null);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest count(any key);
</del><ins>+    [CallWith=ScriptState, MayThrowException] IDBRequest get(IDBKeyRange? key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest get(any key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest getKey(IDBKeyRange? key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest getKey(any key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest count(optional IDBKeyRange? range = null);
+    [CallWith=ScriptState, MayThrowException] IDBRequest count(any key);
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -62,60 +62,48 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::only(RefPtr&lt;IDBKey&gt;&amp;&amp; key, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; IDBKeyRange::only(RefPtr&lt;IDBKey&gt;&amp;&amp; key)
</ins><span class="cx"> {
</span><del>-    if (!key || !key-&gt;isValid()) {
-        ec = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (!key || !key-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     return create(WTFMove(key));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::only(ExecState&amp; state, JSValue keyValue, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; IDBKeyRange::only(ExecState&amp; state, JSValue keyValue)
</ins><span class="cx"> {
</span><del>-    return only(scriptValueToIDBKey(state, keyValue), ec);
</del><ins>+    return only(scriptValueToIDBKey(state, keyValue));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::lowerBound(ExecState&amp; state, JSValue boundValue, bool open, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; IDBKeyRange::lowerBound(ExecState&amp; state, JSValue boundValue, bool open)
</ins><span class="cx"> {
</span><span class="cx">     auto bound = scriptValueToIDBKey(state, boundValue);
</span><del>-    if (!bound-&gt;isValid()) {
-        ec = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (!bound-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     return create(WTFMove(bound), nullptr, open, true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::upperBound(ExecState&amp; state, JSValue boundValue, bool open, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; IDBKeyRange::upperBound(ExecState&amp; state, JSValue boundValue, bool open)
</ins><span class="cx"> {
</span><span class="cx">     auto bound = scriptValueToIDBKey(state, boundValue);
</span><del>-    if (!bound-&gt;isValid()) {
-        ec = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (!bound-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     return create(nullptr, WTFMove(bound), true, open);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::bound(ExecState&amp; state, JSValue lowerValue, JSValue upperValue, bool lowerOpen, bool upperOpen, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; IDBKeyRange::bound(ExecState&amp; state, JSValue lowerValue, JSValue upperValue, bool lowerOpen, bool upperOpen)
</ins><span class="cx"> {
</span><span class="cx">     auto lower = scriptValueToIDBKey(state, lowerValue);
</span><span class="cx">     auto upper = scriptValueToIDBKey(state, upperValue);
</span><span class="cx"> 
</span><del>-    if (!lower-&gt;isValid() || !upper-&gt;isValid()) {
-        ec = IDBDatabaseException::DataError;
-        return nullptr;
-    }
-    if (upper-&gt;isLessThan(lower.get())) {
-        ec = IDBDatabaseException::DataError;
-        return nullptr;
-    }
-    if (upper-&gt;isEqual(lower.get()) &amp;&amp; (lowerOpen || upperOpen)) {
-        ec = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (!lower-&gt;isValid() || !upper-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError };
+    if (upper-&gt;isLessThan(lower.get()))
+        return Exception { IDBDatabaseException::DataError };
+    if (upper-&gt;isEqual(lower.get()) &amp;&amp; (lowerOpen || upperOpen))
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     return create(WTFMove(lower), WTFMove(upper), lowerOpen, upperOpen);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="lines">@@ -54,13 +55,13 @@
</span><span class="cx">     bool lowerOpen() const { return m_isLowerOpen; }
</span><span class="cx">     bool upperOpen() const { return m_isUpperOpen; }
</span><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBKeyRange&gt; only(RefPtr&lt;IDBKey&gt;&amp;&amp; value, ExceptionCode&amp;);
-    static RefPtr&lt;IDBKeyRange&gt; only(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; only(RefPtr&lt;IDBKey&gt;&amp;&amp; value);
+    static ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; only(JSC::ExecState&amp;, JSC::JSValue key);
</ins><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBKeyRange&gt; lowerBound(JSC::ExecState&amp;, JSC::JSValue bound, bool open, ExceptionCode&amp;);
-    static RefPtr&lt;IDBKeyRange&gt; upperBound(JSC::ExecState&amp;, JSC::JSValue bound, bool open, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; lowerBound(JSC::ExecState&amp;, JSC::JSValue bound, bool open);
+    static ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; upperBound(JSC::ExecState&amp;, JSC::JSValue bound, bool open);
</ins><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBKeyRange&gt; bound(JSC::ExecState&amp;, JSC::JSValue lower, JSC::JSValue upper, bool lowerOpen, bool upperOpen, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;IDBKeyRange&gt;&gt; bound(JSC::ExecState&amp;, JSC::JSValue lower, JSC::JSValue upper, bool lowerOpen, bool upperOpen);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool isOnlyKey() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx">     readonly attribute boolean lowerOpen;
</span><span class="cx">     readonly attribute boolean upperOpen;
</span><span class="cx"> 
</span><del>-    [CallWith=ScriptState, MayThrowLegacyException] static IDBKeyRange only(any value);
-    [CallWith=ScriptState, MayThrowLegacyException] static IDBKeyRange lowerBound(any lower, optional boolean open = false);
-    [CallWith=ScriptState, MayThrowLegacyException] static IDBKeyRange upperBound(any upper, optional boolean open = false);
-    [CallWith=ScriptState, MayThrowLegacyException] static IDBKeyRange bound(any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
</del><ins>+    [CallWith=ScriptState, MayThrowException] static IDBKeyRange only(any value);
+    [CallWith=ScriptState, MayThrowException] static IDBKeyRange lowerBound(any lower, optional boolean open = false);
+    [CallWith=ScriptState, MayThrowException] static IDBKeyRange upperBound(any upper, optional boolean open = false);
+    [CallWith=ScriptState, MayThrowException] static IDBKeyRange bound(any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -125,116 +125,92 @@
</span><span class="cx">     return m_info.autoIncrement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::openCursor(ExecState&amp; execState, IDBKeyRange* range, const String&amp; directionString, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::openCursor(ExecState&amp; execState, IDBKeyRange* range, const String&amp; directionString)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::openCursor&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec.code);
-    if (ec.code)
-        return nullptr;
</del><ins>+    auto direction = IDBCursor::stringToDirection(directionString);
+    if (!direction)
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><del>-    auto info = IDBCursorInfo::objectStoreCursor(m_transaction.get(), m_info.identifier(), range, direction);
</del><ins>+    auto info = IDBCursorInfo::objectStoreCursor(m_transaction.get(), m_info.identifier(), range, direction.value());
</ins><span class="cx">     return m_transaction-&gt;requestOpenCursor(execState, *this, info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::openCursor(ExecState&amp; execState, JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::openCursor(ExecState&amp; execState, JSValue key, const String&amp; direction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(execState, key, ec.code);
-    if (ec.code) {
-        ec.message = ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The parameter is not a valid key.&quot;);
-        return 0;
-    }
</del><ins>+    auto onlyResult = IDBKeyRange::only(execState, key);
+    if (onlyResult.hasException())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><del>-    return openCursor(execState, keyRange.get(), direction, ec);
</del><ins>+    return openCursor(execState, onlyResult.releaseReturnValue().ptr(), direction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::get(ExecState&amp; execState, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::get(ExecState&amp; execState, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::get&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(execState, key);
-    if (!idbKey-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
</del><ins>+    auto idbKey = scriptValueToIDBKey(execState, key);
+    if (!idbKey-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return m_transaction-&gt;requestGetRecord(execState, *this, { idbKey.ptr() });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::get(ExecState&amp; execState, IDBKeyRange* keyRange, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::get(ExecState&amp; execState, IDBKeyRange* keyRange)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::get&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError };
</ins><span class="cx"> 
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     IDBKeyRangeData keyRangeData(keyRange);
</span><del>-    if (!keyRangeData.isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (!keyRangeData.isValid())
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     return m_transaction-&gt;requestGetRecord(execState, *this, { keyRangeData });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::add(ExecState&amp; execState, JSValue value, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::add(ExecState&amp; execState, JSValue value, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; idbKey;
</span><span class="cx">     if (!key.isUndefined())
</span><span class="cx">         idbKey = scriptValueToIDBKey(execState, key);
</span><del>-    return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, InlineKeyCheck::Perform, ec);
</del><ins>+    return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, InlineKeyCheck::Perform);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::put(ExecState&amp; execState, JSValue value, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::put(ExecState&amp; execState, JSValue value, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; idbKey;
</span><span class="cx">     if (!key.isUndefined())
</span><span class="cx">         idbKey = scriptValueToIDBKey(execState, key);
</span><del>-    return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform, ec);
</del><ins>+    return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::putForCursorUpdate(ExecState&amp; state, JSValue value, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::putForCursorUpdate(ExecState&amp; state, JSValue value, JSValue key)
</ins><span class="cx"> {
</span><del>-    return putOrAdd(state, value, scriptValueToIDBKey(state, key), IndexedDB::ObjectStoreOverwriteMode::OverwriteForCursor, InlineKeyCheck::DoNotPerform, ec);
</del><ins>+    return putOrAdd(state, value, scriptValueToIDBKey(state, key), IndexedDB::ObjectStoreOverwriteMode::OverwriteForCursor, InlineKeyCheck::DoNotPerform);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::putOrAdd(ExecState&amp; state, JSValue value, RefPtr&lt;IDBKey&gt; key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, InlineKeyCheck inlineKeyCheck, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::putOrAdd(ExecState&amp; state, JSValue value, RefPtr&lt;IDBKey&gt; key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, InlineKeyCheck inlineKeyCheck)
</ins><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="cx">     auto scope = DECLARE_CATCH_SCOPE(vm);
</span><span class="lines">@@ -243,11 +219,8 @@
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><span class="cx">     auto context = scriptExecutionContextFromExecState(&amp;state);
</span><del>-    if (!context) {
-        ec.code = IDBDatabaseException::UnknownError;
-        ec.message = ASCIILiteral(&quot;Unable to store record in object store because it does not have a valid script execution context&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!context)
+        return Exception { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Unable to store record in object store because it does not have a valid script execution context&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
</span><span class="cx">     // the exception for an object store being deleted.
</span><span class="lines">@@ -254,23 +227,14 @@
</span><span class="cx">     // However, a handful of W3C IDB tests expect the deleted exception even though the transaction inactive exception also applies.
</span><span class="cx">     // Additionally, Chrome and Edge agree with the test, as does Legacy IDB in WebKit.
</span><span class="cx">     // Until this is sorted out, we'll agree with the test and the majority share browsers.
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The transaction is read-only.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_transaction-&gt;isReadOnly())
+        return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The transaction is read-only.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SerializedScriptValue&gt; serializedValue = SerializedScriptValue::create(&amp;state, value, nullptr, nullptr);
</span><span class="cx">     if (UNLIKELY(scope.exception())) {
</span><span class="lines">@@ -277,9 +241,7 @@
</span><span class="cx">         // Clear the DOM exception from the serializer so we can give a more targeted exception.
</span><span class="cx">         scope.clearException();
</span><span class="cx"> 
</span><del>-        ec.code = IDBDatabaseException::DataCloneError;
-        ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: An object could not be cloned.&quot;);
-        return nullptr;
</del><ins>+        return Exception { IDBDatabaseException::DataCloneError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: An object could not be cloned.&quot;) };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool privateBrowsingEnabled = false;
</span><span class="lines">@@ -290,44 +252,27 @@
</span><span class="cx"> 
</span><span class="cx">     if (serializedValue-&gt;hasBlobURLs() &amp;&amp; privateBrowsingEnabled) {
</span><span class="cx">         // https://bugs.webkit.org/show_bug.cgi?id=156347 - Support Blobs in private browsing.
</span><del>-        ec.code = IDBDatabaseException::DataCloneError;
-        ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: BlobURLs are not yet supported.&quot;);
-        return nullptr;
</del><ins>+        return Exception { IDBDatabaseException::DataCloneError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: BlobURLs are not yet supported.&quot;) };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (key &amp;&amp; !key-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (key &amp;&amp; !key-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     bool usesInlineKeys = !m_info.keyPath().isNull();
</span><span class="cx">     bool usesKeyGenerator = autoIncrement();
</span><span class="cx">     if (usesInlineKeys &amp;&amp; inlineKeyCheck == InlineKeyCheck::Perform) {
</span><del>-        if (key) {
-            ec.code = IDBDatabaseException::DataError;
-            ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store uses in-line keys and the key parameter was provided.&quot;);
-            return nullptr;
-        }
</del><ins>+        if (key)
+            return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store uses in-line keys and the key parameter was provided.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">         RefPtr&lt;IDBKey&gt; keyPathKey = maybeCreateIDBKeyFromScriptValueAndKeyPath(state, value, m_info.keyPath());
</span><del>-        if (keyPathKey &amp;&amp; !keyPathKey-&gt;isValid()) {
-            ec.code = IDBDatabaseException::DataError;
-            ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: Evaluating the object store's key path yielded a value that is not a valid key.&quot;);
-            return nullptr;
-        }
</del><ins>+        if (keyPathKey &amp;&amp; !keyPathKey-&gt;isValid())
+            return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: Evaluating the object store's key path yielded a value that is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">         if (!keyPathKey) {
</span><del>-            if (usesKeyGenerator) {
-                if (!canInjectIDBKeyIntoScriptValue(state, value, m_info.keyPath())) {
-                    ec.code = IDBDatabaseException::DataError;
-                    return nullptr;
-                }
-            } else {
-                ec.code = IDBDatabaseException::DataError;
-                ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.&quot;);
-                return nullptr;
-            }
</del><ins>+            if (!usesKeyGenerator)
+                return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.&quot;) };
+            if (!canInjectIDBKeyIntoScriptValue(state, value, m_info.keyPath()))
+                return Exception { IDBDatabaseException::DataError };
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (keyPathKey) {
</span><span class="lines">@@ -334,21 +279,18 @@
</span><span class="cx">             ASSERT(!key);
</span><span class="cx">             key = keyPathKey;
</span><span class="cx">         }
</span><del>-    } else if (!usesKeyGenerator &amp;&amp; !key) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.&quot;);
-        return nullptr;
-    }
</del><ins>+    } else if (!usesKeyGenerator &amp;&amp; !key)
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return m_transaction-&gt;requestPutOrAdd(state, *this, key.get(), *serializedValue, overwriteMode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::deleteFunction(ExecState&amp; execState, IDBKeyRange* keyRange, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::deleteFunction(ExecState&amp; execState, IDBKeyRange* keyRange)
</ins><span class="cx"> {
</span><del>-    return doDelete(execState, keyRange, ec);
</del><ins>+    return doDelete(execState, keyRange);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::doDelete(ExecState&amp; execState, IDBKeyRange* keyRange, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::doDelete(ExecState&amp; execState, IDBKeyRange* keyRange)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::deleteFunction&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="lines">@@ -358,47 +300,31 @@
</span><span class="cx">     // However, a handful of W3C IDB tests expect the deleted exception even though the transaction inactive exception also applies.
</span><span class="cx">     // Additionally, Chrome and Edge agree with the test, as does Legacy IDB in WebKit.
</span><span class="cx">     // Until this is sorted out, we'll agree with the test and the majority share browsers.
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The transaction is read-only.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_transaction-&gt;isReadOnly())
+        return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The transaction is read-only.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     IDBKeyRangeData keyRangeData(keyRange);
</span><del>-    if (!keyRangeData.isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key range.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!keyRangeData.isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key range.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     return m_transaction-&gt;requestDeleteRecord(execState, *this, keyRangeData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::deleteFunction(ExecState&amp; execState, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::deleteFunction(ExecState&amp; execState, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(execState, key);
</span><del>-    if (!idbKey-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
-
-    return doDelete(execState, &amp;IDBKeyRange::create(WTFMove(idbKey)).get(), ec);
</del><ins>+    if (!idbKey-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key.&quot;) };
+    return doDelete(execState, IDBKeyRange::create(WTFMove(idbKey)).ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::clear(ExecState&amp; execState, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::clear(ExecState&amp; execState)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::clear&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="lines">@@ -408,72 +334,43 @@
</span><span class="cx">     // However, a handful of W3C IDB tests expect the deleted exception even though the transaction inactive exception also applies.
</span><span class="cx">     // Additionally, Chrome and Edge agree with the test, as does Legacy IDB in WebKit.
</span><span class="cx">     // Until this is sorted out, we'll agree with the test and the majority share browsers.
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The transaction is read-only.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_transaction-&gt;isReadOnly())
+        return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The transaction is read-only.&quot;) };
</ins><span class="cx"> 
</span><del>-    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestClearObjectStore(execState, *this);
-    return adoptRef(request.leakRef());
</del><ins>+    return m_transaction-&gt;requestClearObjectStore(execState, *this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBIndex&gt; IDBObjectStore::createIndex(ExecState&amp;, const String&amp; name, const IDBKeyPath&amp; keyPath, const IndexParameters&amp; parameters, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBIndex&gt;&gt; IDBObjectStore::createIndex(ExecState&amp;, const String&amp; name, const IDBKeyPath&amp; keyPath, const IndexParameters&amp; parameters)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::createIndex %s&quot;, name.utf8().data());
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isVersionChange()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The database is not running a version change transaction.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isVersionChange())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The database is not running a version change transaction.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError };
</ins><span class="cx"> 
</span><del>-    if (!keyPath.isValid()) {
-        ec.code = IDBDatabaseException::SyntaxError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!keyPath.isValid())
+        return Exception { IDBDatabaseException::SyntaxError, ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (name.isNull()) {
-        ec.code = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (name.isNull())
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><del>-    if (m_info.hasIndex(name)) {
-        ec.code = IDBDatabaseException::ConstraintError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': An index with the specified name already exists.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_info.hasIndex(name))
+        return Exception { IDBDatabaseException::ConstraintError, ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': An index with the specified name already exists.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (keyPath.type() == IDBKeyPath::Type::Array &amp;&amp; parameters.multiEntry) {
-        ec.code = IDBDatabaseException::InvalidAccessError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument was an array and the multiEntry option is true.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (keyPath.type() == IDBKeyPath::Type::Array &amp;&amp; parameters.multiEntry)
+        return Exception { IDBDatabaseException::InvalidAccessError, ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument was an array and the multiEntry option is true.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     // Install the new Index into the ObjectStore's info.
</span><span class="cx">     IDBIndexInfo info = m_info.createNewIndex(name, keyPath, parameters.unique, parameters.multiEntry);
</span><span class="lines">@@ -481,81 +378,63 @@
</span><span class="cx"> 
</span><span class="cx">     // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
</span><span class="cx">     auto index = m_transaction-&gt;createIndex(*this, info);
</span><del>-    RefPtr&lt;IDBIndex&gt; refIndex = index.get();
</del><span class="cx"> 
</span><ins>+    Ref&lt;IDBIndex&gt; referencedIndex { *index };
+
</ins><span class="cx">     Locker&lt;Lock&gt; locker(m_referencedIndexLock);
</span><span class="cx">     m_referencedIndexes.set(name, WTFMove(index));
</span><span class="cx"> 
</span><del>-    return refIndex;
</del><ins>+    return WTFMove(referencedIndex);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBIndex&gt; IDBObjectStore::index(const String&amp; indexName, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBIndex&gt;&gt; IDBObjectStore::index(const String&amp; indexName)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::index&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><span class="cx">     if (!scriptExecutionContext())
</span><del>-        return nullptr;
</del><ins>+        return Exception { IDBDatabaseException::InvalidStateError }; // FIXME: Is this code tested? Is iteven reachable?
</ins><span class="cx"> 
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isFinishedOrFinishing()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The transaction is finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_transaction-&gt;isFinishedOrFinishing())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The transaction is finished.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     Locker&lt;Lock&gt; locker(m_referencedIndexLock);
</span><span class="cx">     auto iterator = m_referencedIndexes.find(indexName);
</span><span class="cx">     if (iterator != m_referencedIndexes.end())
</span><del>-        return iterator-&gt;value.get();
</del><ins>+        return Ref&lt;IDBIndex&gt; { *iterator-&gt;value };
</ins><span class="cx"> 
</span><span class="cx">     auto* info = m_info.infoForExistingIndex(indexName);
</span><del>-    if (!info) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The specified index was not found.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!info)
+        return Exception { IDBDatabaseException::NotFoundError, ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The specified index was not found.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     auto index = std::make_unique&lt;IDBIndex&gt;(*scriptExecutionContext(), *info, *this);
</span><del>-    RefPtr&lt;IDBIndex&gt; refIndex = index.get();
</del><ins>+
+    Ref&lt;IDBIndex&gt; referencedIndex { *index };
+
</ins><span class="cx">     m_referencedIndexes.set(indexName, WTFMove(index));
</span><span class="cx"> 
</span><del>-    return refIndex;
</del><ins>+    return WTFMove(referencedIndex);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBObjectStore::deleteIndex(const String&amp; name, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; IDBObjectStore::deleteIndex(const String&amp; name)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::deleteIndex %s&quot;, name.utf8().data());
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isVersionChange()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The database is not running a version change transaction.&quot;);
-        return;
-    }
</del><ins>+    if (!m_transaction-&gt;isVersionChange())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The database is not running a version change transaction.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The transaction is inactive or finished.&quot;);
-        return;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError,  ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_info.hasIndex(name)) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found.&quot;);
-        return;
-    }
</del><ins>+    if (!m_info.hasIndex(name))
+        return Exception { IDBDatabaseException::NotFoundError, ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     auto* info = m_info.infoForExistingIndex(name);
</span><span class="cx">     ASSERT(info);
</span><span class="lines">@@ -573,30 +452,29 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_transaction-&gt;deleteIndex(m_info.identifier(), name);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::count(ExecState&amp; execState, JSValue key, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::count(ExecState&amp; execState, JSValue key)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::count&quot;);
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(execState, key);
</span><del>-    if (!idbKey-&gt;isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!idbKey-&gt;isValid())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.&quot;) };
</ins><span class="cx"> 
</span><del>-    return doCount(execState, IDBKeyRangeData(idbKey.ptr()), ec);
</del><ins>+    return doCount(execState, IDBKeyRangeData(idbKey.ptr()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::count(ExecState&amp; execState, IDBKeyRange* range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::count(ExecState&amp; execState, IDBKeyRange* range)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::count&quot;);
</span><span class="cx"> 
</span><del>-    return doCount(execState, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys(), ec);
</del><ins>+    return doCount(execState, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBObjectStore::doCount(ExecState&amp; execState, const IDBKeyRangeData&amp; range, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::doCount(ExecState&amp; execState, const IDBKeyRangeData&amp; range)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><span class="lines">@@ -605,22 +483,14 @@
</span><span class="cx">     // However, a handful of W3C IDB tests expect the deleted exception even though the transaction inactive exception also applies.
</span><span class="cx">     // Additionally, Chrome and Edge agree with the test, as does Legacy IDB in WebKit.
</span><span class="cx">     // Until this is sorted out, we'll agree with the test and the majority share browsers.
</span><del>-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The object store has been deleted.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The transaction is inactive or finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><del>-    if (!range.isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
</del><ins>+    if (!range.isValid())
+        return Exception { IDBDatabaseException::DataError };
</ins><span class="cx"> 
</span><span class="cx">     return m_transaction-&gt;requestCount(execState, *this, range);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -46,7 +47,6 @@
</span><span class="cx"> class IDBRequest;
</span><span class="cx"> class IDBTransaction;
</span><span class="cx"> 
</span><del>-struct ExceptionCodeWithMessage;
</del><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="cx"> namespace IndexedDB {
</span><span class="lines">@@ -70,22 +70,22 @@
</span><span class="cx">         bool multiEntry;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; openCursor(JSC::ExecState&amp;, IDBKeyRange*, const String&amp; direction, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; openCursor(JSC::ExecState&amp;, JSC::JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; get(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; get(JSC::ExecState&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; add(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; put(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; deleteFunction(JSC::ExecState&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; deleteFunction(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; clear(JSC::ExecState&amp;, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBIndex&gt; createIndex(JSC::ExecState&amp;, const String&amp; name, const IDBKeyPath&amp;, const IndexParameters&amp;, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBIndex&gt; index(const String&amp; name, ExceptionCodeWithMessage&amp;);
-    void deleteIndex(const String&amp; name, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; count(JSC::ExecState&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; count(JSC::ExecState&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openCursor(JSC::ExecState&amp;, IDBKeyRange*, const String&amp; direction);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openCursor(JSC::ExecState&amp;, JSC::JSValue key, const String&amp; direction);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; get(JSC::ExecState&amp;, JSC::JSValue key);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; get(JSC::ExecState&amp;, IDBKeyRange*);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; add(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; put(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; deleteFunction(JSC::ExecState&amp;, IDBKeyRange*);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; deleteFunction(JSC::ExecState&amp;, JSC::JSValue key);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; clear(JSC::ExecState&amp;);
+    ExceptionOr&lt;Ref&lt;IDBIndex&gt;&gt; createIndex(JSC::ExecState&amp;, const String&amp; name, const IDBKeyPath&amp;, const IndexParameters&amp;);
+    ExceptionOr&lt;Ref&lt;IDBIndex&gt;&gt; index(const String&amp; name);
+    ExceptionOr&lt;void&gt; deleteIndex(const String&amp; name);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; count(JSC::ExecState&amp;, IDBKeyRange*);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; count(JSC::ExecState&amp;, JSC::JSValue key);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; putForCursorUpdate(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; putForCursorUpdate(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key);
</ins><span class="cx"> 
</span><span class="cx">     void markAsDeleted();
</span><span class="cx">     bool isDeleted() const { return m_deleted; }
</span><span class="lines">@@ -100,9 +100,9 @@
</span><span class="cx">     IDBObjectStore(ScriptExecutionContext&amp;, const IDBObjectStoreInfo&amp;, IDBTransaction&amp;);
</span><span class="cx"> 
</span><span class="cx">     enum class InlineKeyCheck { Perform, DoNotPerform };
</span><del>-    RefPtr&lt;IDBRequest&gt; putOrAdd(JSC::ExecState&amp;, JSC::JSValue, RefPtr&lt;IDBKey&gt;, IndexedDB::ObjectStoreOverwriteMode, InlineKeyCheck, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; doCount(JSC::ExecState&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
-    RefPtr&lt;IDBRequest&gt; doDelete(JSC::ExecState&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; putOrAdd(JSC::ExecState&amp;, JSC::JSValue, RefPtr&lt;IDBKey&gt;, IndexedDB::ObjectStoreOverwriteMode, InlineKeyCheck);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; doCount(JSC::ExecState&amp;, const IDBKeyRangeData&amp;);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; doDelete(JSC::ExecState&amp;, IDBKeyRange*);
</ins><span class="cx"> 
</span><span class="cx">     const char* activeDOMObjectName() const final;
</span><span class="cx">     bool canSuspendForDocumentSuspension() const final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -36,21 +36,21 @@
</span><span class="cx">     readonly attribute IDBTransaction transaction;
</span><span class="cx">     readonly attribute boolean autoIncrement;
</span><span class="cx"> 
</span><del>-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest put(any value, optional any key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest add(any value, optional any key);
-    [CallWith=ScriptState, ImplementedAs=deleteFunction, MayThrowLegacyExceptionWithMessage] IDBRequest delete(IDBKeyRange? keyRange);
-    [CallWith=ScriptState, ImplementedAs=deleteFunction, MayThrowLegacyExceptionWithMessage] IDBRequest delete(any key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest get(IDBKeyRange? key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest get(any key);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest clear();
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest openCursor(any key, optional DOMString direction = &quot;next&quot;);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBIndex createIndex(DOMString name, sequence&lt;DOMString&gt; keyPath, optional IDBIndexParameters options);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBIndex createIndex(DOMString name, DOMString keyPath, optional IDBIndexParameters options);
-    [MayThrowLegacyExceptionWithMessage] IDBIndex index(DOMString name);
-    [MayThrowLegacyExceptionWithMessage] void deleteIndex(DOMString name);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest count(optional IDBKeyRange? range = null);
-    [CallWith=ScriptState, MayThrowLegacyExceptionWithMessage] IDBRequest count(any key);
</del><ins>+    [CallWith=ScriptState, MayThrowException] IDBRequest put(any value, optional any key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest add(any value, optional any key);
+    [CallWith=ScriptState, ImplementedAs=deleteFunction, MayThrowException] IDBRequest delete(IDBKeyRange? keyRange);
+    [CallWith=ScriptState, ImplementedAs=deleteFunction, MayThrowException] IDBRequest delete(any key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest get(IDBKeyRange? key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest get(any key);
+    [CallWith=ScriptState, MayThrowException] IDBRequest clear();
+    [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
+    [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional DOMString direction = &quot;next&quot;);
+    [CallWith=ScriptState, MayThrowException] IDBIndex createIndex(DOMString name, sequence&lt;DOMString&gt; keyPath, optional IDBIndexParameters options);
+    [CallWith=ScriptState, MayThrowException] IDBIndex createIndex(DOMString name, DOMString keyPath, optional IDBIndexParameters options);
+    [MayThrowException] IDBIndex index(DOMString name);
+    [MayThrowException] void deleteIndex(DOMString name);
+    [CallWith=ScriptState, MayThrowException] IDBRequest count(optional IDBKeyRange? range = null);
+    [CallWith=ScriptState, MayThrowException] IDBRequest count(any key);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> dictionary IDBIndexParameters {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -126,23 +126,14 @@
</span><span class="cx">         m_cursorResult-&gt;clearRequest();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned short IDBRequest::errorCode(ExceptionCode&amp;) const
</del><ins>+ExceptionOr&lt;DOMError*&gt; IDBRequest::error() const
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == originThreadID());
</span><span class="cx"> 
</span><del>-    return 0;
-}
</del><ins>+    if (!m_isDone)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to read the 'error' property from 'IDBRequest': The request has not finished.&quot;) };
</ins><span class="cx"> 
</span><del>-RefPtr&lt;DOMError&gt; IDBRequest::error(ExceptionCodeWithMessage&amp; ec) const
-{
-    ASSERT(currentThread() == originThreadID());
-
-    if (m_isDone)
-        return m_domError;
-
-    ec.code = IDBDatabaseException::InvalidStateError;
-    ec.message = ASCIILiteral(&quot;Failed to read the 'error' property from 'IDBRequest': The request has not finished.&quot;);
-    return nullptr;
</del><ins>+    return m_domError.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBRequest::setSource(IDBCursor&amp; cursor)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;IDBActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><span class="cx"> #include &quot;IDBResourceIdentifier.h&quot;
</span><span class="lines">@@ -66,8 +67,7 @@
</span><span class="cx">     IDBCursor* cursorResult() const { return m_cursorResult.get(); }
</span><span class="cx">     IDBDatabase* databaseResult() const { return m_databaseResult.get(); }
</span><span class="cx">     JSC::JSValue scriptResult() const { return m_scriptResult.get(); }
</span><del>-    unsigned short errorCode(ExceptionCode&amp;) const;
-    RefPtr&lt;DOMError&gt; error(ExceptionCodeWithMessage&amp;) const;
</del><ins>+    ExceptionOr&lt;DOMError*&gt; error() const;
</ins><span class="cx">     IDBObjectStore* objectStoreSource() const { return m_objectStoreSource.get(); }
</span><span class="cx">     IDBIndex* indexSource() const { return m_indexSource.get(); }
</span><span class="cx">     IDBCursor* cursorSource() const { return m_cursorSource.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx"> ] interface IDBRequest : EventTarget {
</span><span class="cx">     [CustomGetter] readonly attribute any result;
</span><del>-    [GetterMayThrowLegacyExceptionWithMessage] readonly attribute DOMError error;
</del><ins>+    [GetterMayThrowException] readonly attribute DOMError? error;
</ins><span class="cx">     [CustomGetter] readonly attribute any source;
</span><span class="cx">     readonly attribute IDBTransaction transaction;
</span><span class="cx">     readonly attribute DOMString readyState;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -88,16 +88,14 @@
</span><span class="cx">     return readwrite;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IndexedDB::TransactionMode IDBTransaction::stringToMode(const String&amp; modeString, ExceptionCode&amp; ec)
</del><ins>+Optional&lt;IndexedDB::TransactionMode&gt; IDBTransaction::stringToMode(const String&amp; modeString)
</ins><span class="cx"> {
</span><del>-    if (modeString.isNull()
-        || modeString == IDBTransaction::modeReadOnly())
</del><ins>+    if (modeString.isNull() || modeString == IDBTransaction::modeReadOnly())
</ins><span class="cx">         return IndexedDB::TransactionMode::ReadOnly;
</span><span class="cx">     if (modeString == IDBTransaction::modeReadWrite())
</span><span class="cx">         return IndexedDB::TransactionMode::ReadWrite;
</span><span class="cx"> 
</span><del>-    ec = TypeError;
-    return IndexedDB::TransactionMode::ReadOnly;
</del><ins>+    return Nullopt;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AtomicString&amp; IDBTransaction::modeToString(IndexedDB::TransactionMode mode)
</span><span class="lines">@@ -186,35 +184,32 @@
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebCore::IDBDatabase* IDBTransaction::db()
</del><ins>+IDBDatabase* IDBTransaction::db()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_database-&gt;originThreadID());
</span><del>-    return &amp;m_database.get();
</del><ins>+    return m_database.ptr();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;DOMError&gt; IDBTransaction::error() const
</del><ins>+DOMError* IDBTransaction::error() const
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_database-&gt;originThreadID());
</span><del>-    return m_domError;
</del><ins>+    return m_domError.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBObjectStore&gt; IDBTransaction::objectStore(const String&amp; objectStoreName, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;IDBObjectStore&gt;&gt; IDBTransaction::objectStore(const String&amp; objectStoreName)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::objectStore&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_database-&gt;originThreadID());
</span><span class="cx"> 
</span><span class="cx">     if (!scriptExecutionContext())
</span><del>-        return nullptr;
</del><ins>+        return Exception { IDBDatabaseException::InvalidStateError };
</ins><span class="cx"> 
</span><del>-    if (isFinishedOrFinishing()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'objectStore' on 'IDBTransaction': The transaction finished.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (isFinishedOrFinishing())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'objectStore' on 'IDBTransaction': The transaction finished.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     auto iterator = m_referencedObjectStores.find(objectStoreName);
</span><span class="cx">     if (iterator != m_referencedObjectStores.end())
</span><del>-        return iterator-&gt;value;
</del><ins>+        return Ref&lt;IDBObjectStore&gt; { *iterator-&gt;value };
</ins><span class="cx"> 
</span><span class="cx">     bool found = false;
</span><span class="cx">     for (auto&amp; objectStore : m_info.objectStores()) {
</span><span class="lines">@@ -225,23 +220,17 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto* info = m_database-&gt;info().infoForExistingObjectStore(objectStoreName);
</span><del>-    if (!info) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!info)
+        return Exception { IDBDatabaseException::NotFoundError, ASCIILiteral(&quot;Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     // Version change transactions are scoped to every object store in the database.
</span><del>-    if (!info || (!found &amp;&amp; !isVersionChange())) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.&quot;);
-        return nullptr;
-    }
</del><ins>+    if (!info || (!found &amp;&amp; !isVersionChange()))
+        return Exception { IDBDatabaseException::NotFoundError, ASCIILiteral(&quot;Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.&quot;) };
</ins><span class="cx"> 
</span><span class="cx">     auto objectStore = IDBObjectStore::create(*scriptExecutionContext(), *info, *this);
</span><del>-    m_referencedObjectStores.set(objectStoreName, &amp;objectStore.get());
</del><ins>+    m_referencedObjectStores.set(objectStoreName, objectStore.ptr());
</ins><span class="cx"> 
</span><del>-    return adoptRef(&amp;objectStore.leakRef());
</del><ins>+    return WTFMove(objectStore);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -254,8 +243,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_domError = &amp;error;
</span><del>-    ExceptionCodeWithMessage ec;
-    abort(ec);
</del><ins>+    internalAbort();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBTransaction::transitionedToFinishing(IndexedDB::TransactionState state)
</span><span class="lines">@@ -268,17 +256,25 @@
</span><span class="cx">     m_referencedObjectStores.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBTransaction::abort(ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; IDBTransaction::abort()
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::abort&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_database-&gt;originThreadID());
</span><span class="cx"> 
</span><del>-    if (isFinishedOrFinishing()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'abort' on 'IDBTransaction': The transaction is inactive or finished.&quot;);
-        return;
-    }
</del><ins>+    if (isFinishedOrFinishing())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'abort' on 'IDBTransaction': The transaction is inactive or finished.&quot;) };
</ins><span class="cx"> 
</span><ins>+    internalAbort();
+
+    return { };
+}
+
+void IDBTransaction::internalAbort()
+{
+    LOG(IndexedDB, &quot;IDBTransaction::internalAbort&quot;);
+    ASSERT(currentThread() == m_database-&gt;originThreadID());
+    ASSERT(!isFinishedOrFinishing());
+
</ins><span class="cx">     m_database-&gt;willAbortTransaction(*this);
</span><span class="cx"> 
</span><span class="cx">     if (isVersionChange()) {
</span><span class="lines">@@ -290,8 +286,7 @@
</span><span class="cx">     
</span><span class="cx">     m_abortQueue.swap(m_transactionOperationQueue);
</span><span class="cx"> 
</span><del>-    auto operation = IDBClient::createTransactionOperation(*this, nullptr, &amp;IDBTransaction::abortOnServerAndCancelRequests);
-    scheduleOperation(WTFMove(operation));
</del><ins>+    scheduleOperation(IDBClient::createTransactionOperation(*this, nullptr, &amp;IDBTransaction::abortOnServerAndCancelRequests));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBTransaction::abortOnServerAndCancelRequests(IDBClient::TransactionOperation&amp; operation)
</span><span class="lines">@@ -348,8 +343,7 @@
</span><span class="cx">     if (isFinishedOrFinishing())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ExceptionCodeWithMessage ec;
-    abort(ec);
</del><ins>+    internalAbort();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IDBTransaction::isActive() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     static const AtomicString&amp; modeReadOnlyLegacy();
</span><span class="cx">     static const AtomicString&amp; modeReadWriteLegacy();
</span><span class="cx"> 
</span><del>-    static IndexedDB::TransactionMode stringToMode(const String&amp;, ExceptionCode&amp;);
</del><ins>+    static Optional&lt;IndexedDB::TransactionMode&gt; stringToMode(const String&amp;);
</ins><span class="cx">     static const AtomicString&amp; modeToString(IndexedDB::TransactionMode);
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;IDBTransaction&gt; create(IDBDatabase&amp;, const IDBTransactionInfo&amp;);
</span><span class="lines">@@ -80,9 +80,9 @@
</span><span class="cx">     // IDBTransaction IDL
</span><span class="cx">     const String&amp; mode() const;
</span><span class="cx">     IDBDatabase* db();
</span><del>-    RefPtr&lt;DOMError&gt; error() const;
-    RefPtr&lt;IDBObjectStore&gt; objectStore(const String&amp; name, ExceptionCodeWithMessage&amp;);
-    void abort(ExceptionCodeWithMessage&amp;);
</del><ins>+    DOMError* error() const;
+    ExceptionOr&lt;Ref&lt;IDBObjectStore&gt;&gt; objectStore(const String&amp; name);
+    ExceptionOr&lt;void&gt; abort();
</ins><span class="cx"> 
</span><span class="cx">     EventTargetInterface eventTargetInterface() const final { return IDBTransactionEventTargetInterfaceType; }
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
</span><span class="lines">@@ -152,6 +152,7 @@
</span><span class="cx"> 
</span><span class="cx">     void commit();
</span><span class="cx"> 
</span><ins>+    void internalAbort();
</ins><span class="cx">     void notifyDidAbort(const IDBError&amp;);
</span><span class="cx">     void finishAbortOrCommit();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -25,8 +25,8 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><ins>+    ActiveDOMObject,
</ins><span class="cx">     Conditional=INDEXED_DATABASE,
</span><del>-    ActiveDOMObject,
</del><span class="cx">     EnabledAtRuntime=IndexedDB,
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx"> ] interface IDBTransaction : EventTarget {
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx">     readonly attribute IDBDatabase db;
</span><span class="cx">     readonly attribute DOMError error;
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyExceptionWithMessage] IDBObjectStore objectStore (DOMString name);
-    [MayThrowLegacyExceptionWithMessage] void abort ();
</del><ins>+    [MayThrowException] IDBObjectStore objectStore(DOMString name);
+    [MayThrowException] void abort();
</ins><span class="cx"> 
</span><span class="cx">     attribute EventHandler onabort;
</span><span class="cx">     attribute EventHandler oncomplete;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     m_connectionToServer.deref();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBConnectionProxy::openDatabase(ScriptExecutionContext&amp; context, const IDBDatabaseIdentifier&amp; databaseIdentifier, uint64_t version)
</del><ins>+Ref&lt;IDBOpenDBRequest&gt; IDBConnectionProxy::openDatabase(ScriptExecutionContext&amp; context, const IDBDatabaseIdentifier&amp; databaseIdentifier, uint64_t version)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; request;
</span><span class="cx">     {
</span><span class="lines">@@ -72,10 +72,10 @@
</span><span class="cx"> 
</span><span class="cx">     callConnectionOnMainThread(&amp;IDBConnectionToServer::openDatabase, IDBRequestData(*this, *request));
</span><span class="cx"> 
</span><del>-    return request;
</del><ins>+    return request.releaseNonNull();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBConnectionProxy::deleteDatabase(ScriptExecutionContext&amp; context, const IDBDatabaseIdentifier&amp; databaseIdentifier)
</del><ins>+Ref&lt;IDBOpenDBRequest&gt; IDBConnectionProxy::deleteDatabase(ScriptExecutionContext&amp; context, const IDBDatabaseIdentifier&amp; databaseIdentifier)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; request;
</span><span class="cx">     {
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> 
</span><span class="cx">     callConnectionOnMainThread(&amp;IDBConnectionToServer::deleteDatabase, IDBRequestData(*this, *request));
</span><span class="cx"> 
</span><del>-    return request;
</del><ins>+    return request.releaseNonNull();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBConnectionProxy::didOpenDatabase(const IDBResultData&amp; resultData)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -60,10 +60,10 @@
</span><span class="cx"> public:
</span><span class="cx">     IDBConnectionProxy(IDBConnectionToServer&amp;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBOpenDBRequest&gt; openDatabase(ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;, uint64_t version);
</del><ins>+    Ref&lt;IDBOpenDBRequest&gt; openDatabase(ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;, uint64_t version);
</ins><span class="cx">     void didOpenDatabase(const IDBResultData&amp;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;);
</del><ins>+    Ref&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;);
</ins><span class="cx">     void didDeleteDatabase(const IDBResultData&amp;);
</span><span class="cx"> 
</span><span class="cx">     void createObjectStore(TransactionOperation&amp;, const IDBObjectStoreInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -322,12 +322,12 @@
</span><span class="cx">     if (m_client-&gt;internalSignalingState() == SignalingState::Closed)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ExceptionCodeWithMessage exception;
-    auto newDescription = MediaEndpointSessionDescription::create(WTFMove(description), *m_sdpProcessor, exception);
-    if (exception.code) {
-        promise.reject(exception.code, exception.message);
</del><ins>+    auto result = MediaEndpointSessionDescription::create(WTFMove(description), *m_sdpProcessor);
+    if (result.hasException()) {
+        promise.reject(result.releaseException());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+    auto newDescription = result.releaseReturnValue();
</ins><span class="cx"> 
</span><span class="cx">     if (!localDescriptionTypeValidForState(newDescription-&gt;type())) {
</span><span class="cx">         promise.reject(INVALID_STATE_ERR, &quot;Description type incompatible with current signaling state&quot;);
</span><span class="lines">@@ -389,12 +389,12 @@
</span><span class="cx">     // Update state and local descriptions according to setLocal/RemoteDescription processing model
</span><span class="cx">     switch (newDescription-&gt;type()) {
</span><span class="cx">     case RTCSessionDescription::SdpType::Offer:
</span><del>-        m_pendingLocalDescription = newDescription;
</del><ins>+        m_pendingLocalDescription = WTFMove(newDescription);
</ins><span class="cx">         newSignalingState = SignalingState::HaveLocalOffer;
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case RTCSessionDescription::SdpType::Answer:
</span><del>-        m_currentLocalDescription = newDescription;
</del><ins>+        m_currentLocalDescription = WTFMove(newDescription);
</ins><span class="cx">         m_currentRemoteDescription = m_pendingRemoteDescription;
</span><span class="cx">         m_pendingLocalDescription = nullptr;
</span><span class="cx">         m_pendingRemoteDescription = nullptr;
</span><span class="lines">@@ -407,7 +407,7 @@
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case RTCSessionDescription::SdpType::Pranswer:
</span><del>-        m_pendingLocalDescription = newDescription;
</del><ins>+        m_pendingLocalDescription = WTFMove(newDescription);
</ins><span class="cx">         newSignalingState = SignalingState::HaveLocalPrAnswer;
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -453,12 +453,12 @@
</span><span class="cx">     if (m_client-&gt;internalSignalingState() == SignalingState::Closed)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ExceptionCodeWithMessage exception;
-    auto newDescription = MediaEndpointSessionDescription::create(WTFMove(description), *m_sdpProcessor, exception);
-    if (exception.code) {
-        promise.reject(exception.code, exception.message);
</del><ins>+    auto result = MediaEndpointSessionDescription::create(WTFMove(description), *m_sdpProcessor);
+    if (result.hasException()) {
+        promise.reject(result.releaseException());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+    auto newDescription = result.releaseReturnValue();
</ins><span class="cx"> 
</span><span class="cx">     if (!remoteDescriptionTypeValidForState(newDescription-&gt;type())) {
</span><span class="cx">         promise.reject(INVALID_STATE_ERR, &quot;Description type incompatible with current signaling state&quot;);
</span><span class="lines">@@ -564,12 +564,12 @@
</span><span class="cx">     // Update state and local descriptions according to setLocal/RemoteDescription processing model
</span><span class="cx">     switch (newDescription-&gt;type()) {
</span><span class="cx">     case RTCSessionDescription::SdpType::Offer:
</span><del>-        m_pendingRemoteDescription = newDescription;
</del><ins>+        m_pendingRemoteDescription = WTFMove(newDescription);
</ins><span class="cx">         newSignalingState = SignalingState::HaveRemoteOffer;
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case RTCSessionDescription::SdpType::Answer:
</span><del>-        m_currentRemoteDescription = newDescription;
</del><ins>+        m_currentRemoteDescription = WTFMove(newDescription);
</ins><span class="cx">         m_currentLocalDescription = m_pendingLocalDescription;
</span><span class="cx">         m_pendingRemoteDescription = nullptr;
</span><span class="cx">         m_pendingLocalDescription = nullptr;
</span><span class="lines">@@ -582,7 +582,7 @@
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case RTCSessionDescription::SdpType::Pranswer:
</span><del>-        m_pendingRemoteDescription = newDescription;
</del><ins>+        m_pendingRemoteDescription = WTFMove(newDescription);
</ins><span class="cx">         newSignalingState = SignalingState::HaveRemotePrAnswer;
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointSessionDescriptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -55,23 +55,17 @@
</span><span class="cx">     return adoptRef(*new MediaEndpointSessionDescription(type, WTFMove(configuration), nullptr));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;MediaEndpointSessionDescription&gt; MediaEndpointSessionDescription::create(RefPtr&lt;RTCSessionDescription&gt;&amp;&amp; rtcDescription, const SDPProcessor&amp; sdpProcessor, ExceptionCodeWithMessage&amp; exception)
</del><ins>+ExceptionOr&lt;Ref&lt;MediaEndpointSessionDescription&gt;&gt; MediaEndpointSessionDescription::create(RefPtr&lt;RTCSessionDescription&gt;&amp;&amp; rtcDescription, const SDPProcessor&amp; sdpProcessor)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;MediaEndpointSessionConfiguration&gt; configuration;
</span><del>-    SDPProcessor::Result result = sdpProcessor.parse(rtcDescription-&gt;sdp(), configuration);
</del><ins>+    auto result = sdpProcessor.parse(rtcDescription-&gt;sdp(), configuration);
</ins><span class="cx">     if (result != SDPProcessor::Result::Success) {
</span><del>-        if (result == SDPProcessor::Result::ParseError) {
-            exception.code = INVALID_ACCESS_ERR;
-            exception.message = ASCIILiteral(&quot;SDP content is invalid&quot;);
-            return nullptr;
-        }
</del><ins>+        if (result == SDPProcessor::Result::ParseError)
+            return Exception { INVALID_ACCESS_ERR, ASCIILiteral(&quot;SDP content is invalid&quot;) };
</ins><span class="cx">         LOG_ERROR(&quot;SDPProcessor internal error&quot;);
</span><del>-        exception.code = ABORT_ERR;
-        exception.message = ASCIILiteral(&quot;Internal error&quot;);
-        return nullptr;
</del><ins>+        return Exception { ABORT_ERR, ASCIILiteral(&quot;Internal error&quot;) };
</ins><span class="cx">     }
</span><del>-
-    return adoptRef(new MediaEndpointSessionDescription(rtcDescription-&gt;type(), WTFMove(configuration), WTFMove(rtcDescription)));
</del><ins>+    return adoptRef(*new MediaEndpointSessionDescription(rtcDescription-&gt;type(), WTFMove(configuration), WTFMove(rtcDescription)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;RTCSessionDescription&gt; MediaEndpointSessionDescription::toRTCSessionDescription(const SDPProcessor&amp; sdpProcessor) const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointSessionDescriptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -28,11 +28,11 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef MediaEndpointSessionDescription_h
-#define MediaEndpointSessionDescription_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;RTCSessionDescription.h&quot;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="lines">@@ -46,8 +46,8 @@
</span><span class="cx"> class MediaEndpointSessionDescription : public RefCounted&lt;MediaEndpointSessionDescription&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;MediaEndpointSessionDescription&gt; create(RTCSessionDescription::SdpType, RefPtr&lt;MediaEndpointSessionConfiguration&gt;&amp;&amp;);
</span><del>-    static RefPtr&lt;MediaEndpointSessionDescription&gt; create(RefPtr&lt;RTCSessionDescription&gt;&amp;&amp;, const SDPProcessor&amp;, ExceptionCodeWithMessage&amp;);
-    virtual ~MediaEndpointSessionDescription() { }
</del><ins>+    static ExceptionOr&lt;Ref&lt;MediaEndpointSessionDescription&gt;&gt; create(RefPtr&lt;RTCSessionDescription&gt;&amp;&amp;, const SDPProcessor&amp;);
+    virtual ~MediaEndpointSessionDescription() { } // FIXME: Why is this virtual? There are no other virtual functions in this class.
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RTCSessionDescription&gt; toRTCSessionDescription(const SDPProcessor&amp;) const;
</span><span class="cx"> 
</span><span class="lines">@@ -73,5 +73,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // MediaEndpointSessionDescription_h
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -335,6 +335,11 @@
</span><span class="cx">     return createDOMException(exec, ec, &amp;message);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue createDOMException(ExecState&amp; state, Exception&amp;&amp; exception)
+{
+    return createDOMException(&amp;state, exception.code(), exception.releaseMessage());
+}
+
</ins><span class="cx"> ALWAYS_INLINE static void throwDOMException(ExecState* exec, ThrowScope&amp; throwScope, ExceptionCode ec)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(ec &amp;&amp; !throwScope.exception());
</span><span class="lines">@@ -341,16 +346,10 @@
</span><span class="cx">     throwException(exec, throwScope, createDOMException(exec, ec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE static void throwDOMException(ExecState* exec, ThrowScope&amp; throwScope, const ExceptionCodeWithMessage&amp; ec)
-{
-    ASSERT(ec.code &amp;&amp; !throwScope.exception());
-    throwException(exec, throwScope, createDOMException(exec, ec.code, ec.message));
-}
-
</del><span class="cx"> void propagateExceptionSlowPath(JSC::ExecState&amp; state, JSC::ThrowScope&amp; throwScope, Exception&amp;&amp; exception)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!throwScope.exception());
</span><del>-    throwException(&amp;state, throwScope, createDOMException(&amp;state, exception.code(), exception.releaseMessage()));
</del><ins>+    throwException(&amp;state, throwScope, createDOMException(state, WTFMove(exception)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void propagateException(JSC::ExecState&amp; state, Exception&amp;&amp; exception)
</span><span class="lines">@@ -365,11 +364,6 @@
</span><span class="cx">     throwDOMException(exec, throwScope, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void setDOMExceptionSlow(ExecState* exec, ThrowScope&amp; throwScope, const ExceptionCodeWithMessage&amp; ec)
-{
-    throwDOMException(exec, throwScope, ec);
-}
-
</del><span class="cx"> void setDOMException(ExecState* exec, ExceptionCode ec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="lines">@@ -381,17 +375,6 @@
</span><span class="cx">     throwDOMException(exec, scope, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void setDOMException(ExecState* exec, const ExceptionCodeWithMessage&amp; ec)
-{
-    VM&amp; vm = exec-&gt;vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    if (!ec.code || scope.exception())
-        return;
-
-    throwDOMException(exec, scope, ec);
-}
-
</del><span class="cx"> bool hasIteratorMethod(JSC::ExecState&amp; state, JSC::JSValue value)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; vm = state.vm();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -181,22 +181,20 @@
</span><span class="cx"> WEBCORE_EXPORT void reportException(JSC::ExecState*, JSC::Exception*, CachedScript* = nullptr, ExceptionDetails* = nullptr);
</span><span class="cx"> void reportCurrentException(JSC::ExecState*);
</span><span class="cx"> 
</span><ins>+JSC::JSValue createDOMException(JSC::ExecState&amp;, Exception&amp;&amp;);
</ins><span class="cx"> JSC::JSValue createDOMException(JSC::ExecState*, ExceptionCode, const String&amp;);
</span><span class="cx"> 
</span><span class="cx"> // Convert a DOM implementation exception into a JavaScript exception in the execution state.
</span><span class="cx"> void propagateException(JSC::ExecState&amp;, JSC::ThrowScope&amp;, Exception&amp;&amp;);
</span><span class="cx"> void setDOMException(JSC::ExecState*, JSC::ThrowScope&amp;, ExceptionCode);
</span><del>-void setDOMException(JSC::ExecState*, JSC::ThrowScope&amp;, const ExceptionCodeWithMessage&amp;);
</del><span class="cx"> 
</span><span class="cx"> // Slower versions of the above for use when the caller doesn't have a ThrowScope.
</span><span class="cx"> void propagateException(JSC::ExecState&amp;, Exception&amp;&amp;);
</span><span class="cx"> WEBCORE_EXPORT void setDOMException(JSC::ExecState*, ExceptionCode);
</span><del>-void setDOMException(JSC::ExecState*, const ExceptionCodeWithMessage&amp;);
</del><span class="cx"> 
</span><span class="cx"> // Implementation details of the above.
</span><ins>+void propagateExceptionSlowPath(JSC::ExecState&amp;, JSC::ThrowScope&amp;, Exception&amp;&amp;);
</ins><span class="cx"> WEBCORE_EXPORT void setDOMExceptionSlow(JSC::ExecState*, JSC::ThrowScope&amp;, ExceptionCode);
</span><del>-void setDOMExceptionSlow(JSC::ExecState*, JSC::ThrowScope&amp;, const ExceptionCodeWithMessage&amp;);
-void propagateExceptionSlowPath(JSC::ExecState&amp;, JSC::ThrowScope&amp;, Exception&amp;&amp;);
</del><span class="cx"> 
</span><span class="cx"> JSC::JSValue jsString(JSC::ExecState*, const URL&amp;); // empty if the URL is null
</span><span class="cx"> 
</span><span class="lines">@@ -364,8 +362,8 @@
</span><span class="cx"> JSC::JSValue toJSNullableDate(JSC::ExecState&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;Optional&lt;double&gt;&gt;&amp;&amp;);
</span><span class="cx"> JSC::JSValue toJSNullableString(JSC::ExecState&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;String&gt;&amp;&amp;);
</span><span class="cx"> template&lt;typename T&gt; JSC::JSValue toJSNewlyCreated(JSC::ExecState&amp;, JSDOMGlobalObject&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;T&gt;&amp;&amp; value);
</span><del>-template&lt;typename T&gt; JSC::JSValue toJSNumber(JSC::ExecState&amp;, JSDOMGlobalObject&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;T&gt;&amp;&amp; value);
-template&lt;typename T&gt; JSC::JSValue toJSNullableNumber(JSC::ExecState&amp;, JSDOMGlobalObject&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;T&gt;&amp;&amp; value);
</del><ins>+template&lt;typename T&gt; JSC::JSValue toJSNumber(JSC::ExecState&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;T&gt;&amp;&amp; value);
+template&lt;typename T&gt; JSC::JSValue toJSNullableNumber(JSC::ExecState&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;T&gt;&amp;&amp; value);
</ins><span class="cx"> JSC::JSValue toJSString(JSC::ExecState&amp;, JSC::ThrowScope&amp;, ExceptionOr&lt;String&gt;&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx"> // Inline functions and template definitions.
</span><span class="lines">@@ -903,13 +901,6 @@
</span><span class="cx">     setDOMExceptionSlow(exec, throwScope, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE void setDOMException(JSC::ExecState* exec, JSC::ThrowScope&amp; throwScope, const ExceptionCodeWithMessage&amp; exception)
-{
-    if (LIKELY(!exception.code || throwScope.exception()))
-        return;
-    setDOMExceptionSlow(exec, throwScope, exception);
-}
-
</del><span class="cx"> inline void propagateException(JSC::ExecState&amp; state, JSC::ThrowScope&amp; throwScope, ExceptionOr&lt;void&gt;&amp;&amp; value)
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(value.hasException()))
</span><span class="lines">@@ -934,4 +925,13 @@
</span><span class="cx">     return toJSNewlyCreated(&amp;state, &amp;globalObject, value.releaseReturnValue());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt; inline JSC::JSValue toJSNumber(JSC::ExecState&amp; state, JSC::ThrowScope&amp; throwScope, ExceptionOr&lt;T&gt;&amp;&amp; value)
+{
+    if (UNLIKELY(value.hasException())) {
+        propagateException(state, throwScope, value.releaseException());
+        return { };
+    }
+    return JSC::jsNumber(value.releaseReturnValue());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMPromisecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -89,6 +89,18 @@
</span><span class="cx">     clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void DeferredPromise::reject(Exception&amp;&amp; exception)
+{
+    if (isSuspended())
+        return;
+
+    ASSERT(m_deferred);
+    ASSERT(m_globalObject);
+    auto&amp; state = *m_globalObject-&gt;globalExec();
+    JSC::JSLockHolder locker(&amp;state);
+    reject(state, createDOMException(state, WTFMove(exception)));
+}
+
</ins><span class="cx"> void DeferredPromise::reject(ExceptionCode ec, const String&amp; message)
</span><span class="cx"> {
</span><span class="cx">     if (isSuspended())
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMPromiseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMPromise.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMPromise.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromise.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx"> 
</span><span class="cx">     template&lt;class ResolveResultType&gt; void resolveWithNewlyCreated(Ref&lt;ResolveResultType&gt;&amp;&amp;);
</span><span class="cx"> 
</span><ins>+    void reject(Exception&amp;&amp;);
</ins><span class="cx">     void reject(ExceptionCode, const String&amp; = { });
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue promise() const;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHistoryCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -75,9 +75,7 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCodeWithMessage ec;
-    wrapped().stateObjectAdded(WTFMove(historyState), title, url, History::StateObjectType::Push, ec);
-    setDOMException(&amp;state, ec);
</del><ins>+    propagateException(state, scope, wrapped().stateObjectAdded(WTFMove(historyState), title, url, History::StateObjectType::Push));
</ins><span class="cx"> 
</span><span class="cx">     m_state.clear();
</span><span class="cx"> 
</span><span class="lines">@@ -106,9 +104,7 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCodeWithMessage ec;
-    wrapped().stateObjectAdded(WTFMove(historyState), title, url, History::StateObjectType::Replace, ec);
-    setDOMException(&amp;state, ec);
</del><ins>+    propagateException(state, scope, wrapped().stateObjectAdded(WTFMove(historyState), title, url, History::StateObjectType::Replace));
</ins><span class="cx"> 
</span><span class="cx">     m_state.clear();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBDatabaseCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -76,10 +76,7 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCodeWithMessage ec;
-    JSValue result = toJS(&amp;state, globalObject(), wrapped().createObjectStore(name, keyPath, autoIncrement, ec));
-    setDOMException(&amp;state, ec);
-    return result;
</del><ins>+    return toJS(state, *globalObject(), scope, wrapped().createObjectStore(name, keyPath, autoIncrement));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBRequestCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -42,13 +42,9 @@
</span><span class="cx">     auto&amp; request = wrapped();
</span><span class="cx"> 
</span><span class="cx">     if (!request.isDone()) {
</span><del>-        ExceptionCodeWithMessage ec;
-        ec.code = IDBDatabaseException::InvalidStateError;
-        ec.message = ASCIILiteral(&quot;Failed to read the 'result' property from 'IDBRequest': The request has not finished.&quot;);
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
</del><ins>+        propagateException(state, Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to read the 'result' property from 'IDBRequest': The request has not finished.&quot;) });
+        return { };
</ins><span class="cx">     }
</span><del>-
</del><span class="cx">     if (auto* cursor = request.cursorResult())
</span><span class="cx">         return toJS(&amp;state, globalObject(), *cursor);
</span><span class="cx">     if (auto* database = request.databaseResult())
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -2896,8 +2896,7 @@
</span><span class="cx">             my $type = $attribute-&gt;signature-&gt;type;
</span><span class="cx">             my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx">             my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $name);
</span><del>-            my $getterMayThrowLegacyExceptionWithMessage = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyExceptionWithMessage};
-            my $getterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException} || $getterMayThrowLegacyExceptionWithMessage;
</del><ins>+            my $getterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException};
</ins><span class="cx"> 
</span><span class="cx">             $implIncludes{&quot;ExceptionCode.h&quot;} = 1 if $getterMayThrowLegacyException;
</span><span class="cx"> 
</span><span class="lines">@@ -2938,11 +2937,7 @@
</span><span class="cx">             my @arguments = ();
</span><span class="cx">             if ($getterMayThrowLegacyException &amp;&amp; !HasCustomGetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</span><span class="cx">                 push(@arguments, &quot;ec&quot;);
</span><del>-                if ($getterMayThrowLegacyExceptionWithMessage) {
-                    push(@implContent, &quot;    ExceptionCodeWithMessage ec;\n&quot;);
-                } else {
-                    push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
-                }
</del><ins>+                push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             # Global constructors can be disabled at runtime.
</span><span class="lines">@@ -2983,7 +2978,7 @@
</span><span class="cx"> 
</span><span class="cx">                 my $nativeType = GetNativeType($interface, $type);
</span><span class="cx">                 my $memoizedType = GetNativeTypeForMemoization($interface, $type);
</span><del>-                my $exceptionCode = $getterMayThrowLegacyExceptionWithMessage ? &quot;ec.code&quot; : ($getterMayThrowLegacyException ? &quot;ec&quot; : &quot;0&quot;);
</del><ins>+                my $exceptionCode = $getterMayThrowLegacyException ? &quot;ec&quot; : &quot;0&quot;;
</ins><span class="cx">                 push(@implContent, &quot;    static NeverDestroyed&lt;const AtomicString&gt; bindingName(\&quot;$interfaceName.$name\&quot;, AtomicString::ConstructFromLiteral);\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    if (cursor.isCapturing()) {\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;        $memoizedType memoizedResult = thisObject-&gt;wrapped().$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;);\n&quot;);
</span><span class="lines">@@ -3032,7 +3027,7 @@
</span><span class="cx">                     AddToImplIncludes(&quot;JS&quot; . $constructorType . &quot;.h&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</span><span class="cx">                     push(@implContent, &quot;    return JS&quot; . $constructorType . &quot;::getConstructor(state-&gt;vm(), thisObject-&gt;globalObject());\n&quot;);
</span><span class="cx">                 }
</span><del>-            } elsif (!$attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException} &amp;&amp; !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyExceptionWithMessage}) {
</del><ins>+            } elsif (!$attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException}) {
</ins><span class="cx">                 my $cacheIndex = 0;
</span><span class="cx">                 if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CachedAttribute}) {
</span><span class="cx">                     $cacheIndex = $currentCachedAttribute;
</span><span class="lines">@@ -3199,8 +3194,7 @@
</span><span class="cx">             my $type = $attribute-&gt;signature-&gt;type;
</span><span class="cx">             my $putFunctionName = GetAttributeSetterName($interface, $className, $attribute);
</span><span class="cx">             my $implSetterFunctionName = $codeGenerator-&gt;WK_ucfirst($name);
</span><del>-            my $setterMayThrowLegacyExceptionWithMessage = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterMayThrowLegacyExceptionWithMessage};
-            my $setterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterMayThrowLegacyException} || $setterMayThrowLegacyExceptionWithMessage;
</del><ins>+            my $setterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterMayThrowLegacyException};
</ins><span class="cx"> 
</span><span class="cx">             $implIncludes{&quot;ExceptionCode.h&quot;} = 1 if $setterMayThrowLegacyException;
</span><span class="cx"> 
</span><span class="lines">@@ -3293,12 +3287,9 @@
</span><span class="cx">                         push(@implContent, &quot;    auto&amp; impl = castedThis-&gt;wrapped();\n&quot;);
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><del>-                if ($setterMayThrowLegacyExceptionWithMessage) {
-                    push(@implContent, &quot;    ExceptionCodeWithMessage ec;\n&quot;);
-                } elsif ($setterMayThrowLegacyException) {
-                    push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
-                }
</del><span class="cx"> 
</span><ins>+                push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;) if $setterMayThrowLegacyException;
+
</ins><span class="cx">                 my $shouldPassByReference = ShouldPassWrapperByReference($attribute-&gt;signature, $interface);
</span><span class="cx"> 
</span><span class="cx">                 my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute-&gt;signature, &quot;value&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</span><span class="lines">@@ -3348,10 +3339,7 @@
</span><span class="cx">                         push(@implContent, &quot;    setDOMException(state, throwScope, ec);\n&quot;) if $setterMayThrowLegacyException;
</span><span class="cx">                     }
</span><span class="cx">                     if ($svgPropertyType) {
</span><del>-                        if ($setterMayThrowLegacyExceptionWithMessage) {
-                            push(@implContent, &quot;    if (LIKELY(!ec.code))\n&quot;);
-                            push(@implContent, &quot;        impl.commitChange();\n&quot;);
-                        } elsif ($setterMayThrowLegacyException) {
</del><ins>+                        if ($setterMayThrowLegacyException) {
</ins><span class="cx">                             push(@implContent, &quot;    if (LIKELY(!ec))\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;        impl.commitChange();\n&quot;);
</span><span class="cx">                         } else {
</span><span class="lines">@@ -3449,11 +3437,8 @@
</span><span class="cx">             my $isCustom = HasCustomMethod($function-&gt;signature-&gt;extendedAttributes);
</span><span class="cx">             my $isOverloaded = $function-&gt;{overloads} &amp;&amp; @{$function-&gt;{overloads}} &gt; 1;
</span><span class="cx"> 
</span><del>-            die &quot;MayThrowLegacyException and MayThrowLegacyExceptionWithMessage are mutually exclusive&quot; if $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException} &amp;&amp; $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyExceptionWithMessage};
</del><ins>+            my $mayThrowLegacyException = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</ins><span class="cx"> 
</span><del>-            my $mayThrowLegacyExceptionWithMessage = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyExceptionWithMessage};
-            my $mayThrowLegacyException = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException} || $mayThrowLegacyExceptionWithMessage;
-
</del><span class="cx">             next if $isCustom &amp;&amp; $isOverloaded &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><span class="cx"> 
</span><span class="cx">             AddIncludesForTypeInImpl($function-&gt;signature-&gt;type) unless $isCustom or IsReturningPromise($function);
</span><span class="lines">@@ -3517,11 +3502,7 @@
</span><span class="cx">                 } else {
</span><span class="cx">                     GenerateArgumentsCountCheck(\@implContent, $function, $interface);
</span><span class="cx"> 
</span><del>-                    if ($mayThrowLegacyExceptionWithMessage) {
-                        push(@implContent, &quot;    ExceptionCodeWithMessage ec;\n&quot;);
-                    } elsif ($mayThrowLegacyException) {
-                        push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
-                    }
</del><ins>+                    push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;) if $mayThrowLegacyException;
</ins><span class="cx"> 
</span><span class="cx">                     my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $interface, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType);
</span><span class="cx">                     GenerateImplementationFunctionCall($function, $functionString, &quot;    &quot;, $svgPropertyType, $interface);
</span><span class="lines">@@ -3563,11 +3544,7 @@
</span><span class="cx"> 
</span><span class="cx">                     GenerateArgumentsCountCheck(\@implContent, $function, $interface);
</span><span class="cx"> 
</span><del>-                    if ($mayThrowLegacyExceptionWithMessage) {
-                        push(@implContent, &quot;    ExceptionCodeWithMessage ec;\n&quot;);
-                    } elsif ($mayThrowLegacyException) {
-                        push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
-                    }
</del><ins>+                    push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;) if $mayThrowLegacyException;
</ins><span class="cx"> 
</span><span class="cx">                     if ($function-&gt;signature-&gt;extendedAttributes-&gt;{CheckSecurityForNode}) {
</span><span class="cx">                         push(@implContent, &quot;    if (!shouldAllowAccessToNode(state, impl.&quot; . $function-&gt;signature-&gt;name . &quot;(&quot; . ($mayThrowLegacyException ? &quot;ec&quot; : &quot;&quot;) .&quot;)))\n&quot;);
</span><span class="lines">@@ -4229,7 +4206,7 @@
</span><span class="cx"> 
</span><span class="cx">     my @arguments;
</span><span class="cx">     push(@arguments, &quot;WTFMove(promise)&quot;) if IsReturningPromise($function);
</span><del>-    push(@arguments, &quot;ec&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException} || $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyExceptionWithMessage};
</del><ins>+    push(@arguments, &quot;ec&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</ins><span class="cx">     return @arguments;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -4516,8 +4493,7 @@
</span><span class="cx">     my ($function, $functionString, $indent, $svgPropertyType, $interface) = @_;
</span><span class="cx"> 
</span><span class="cx">     my $nondeterministic = $function-&gt;signature-&gt;extendedAttributes-&gt;{Nondeterministic};
</span><del>-    my $mayThrowLegacyExceptionWithMessage = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyExceptionWithMessage};
-    my $mayThrowLegacyException = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException} || $mayThrowLegacyExceptionWithMessage;
</del><ins>+    my $mayThrowLegacyException = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</ins><span class="cx"> 
</span><span class="cx">     if ($function-&gt;signature-&gt;type eq &quot;void&quot; || IsReturningPromise($function)) {
</span><span class="cx">         if ($nondeterministic) {
</span><span class="lines">@@ -4538,10 +4514,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ($svgPropertyType and !$function-&gt;isStatic) {
</span><del>-            if ($mayThrowLegacyExceptionWithMessage) {
-                push(@implContent, $indent . &quot;if (LIKELY(!ec.code))\n&quot;);
-                push(@implContent, $indent . &quot;    impl.commitChange();\n&quot;);
-            } elsif ($mayThrowLegacyException) {
</del><ins>+            if ($mayThrowLegacyException) {
</ins><span class="cx">                 push(@implContent, $indent . &quot;if (LIKELY(!ec))\n&quot;);
</span><span class="cx">                 push(@implContent, $indent . &quot;    impl.commitChange();\n&quot;);
</span><span class="cx">             } else {
</span><span class="lines">@@ -4566,7 +4539,7 @@
</span><span class="cx">             push(@implContent, $indent . &quot;static NeverDestroyed&lt;const AtomicString&gt; bindingName(\&quot;$bindingName\&quot;, AtomicString::ConstructFromLiteral);\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;if (cursor.isCapturing()) {\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;    $nativeType memoizedResult = $functionString;\n&quot;);
</span><del>-            my $exceptionCode = $mayThrowLegacyExceptionWithMessage ? &quot;ec.code&quot; : ($mayThrowLegacyException ? &quot;ec&quot; : &quot;0&quot;);
</del><ins>+            my $exceptionCode = $mayThrowLegacyException ? &quot;ec&quot; : &quot;0&quot;;
</ins><span class="cx">             push(@implContent, $indent . &quot;    cursor.appendInput&lt;MemoizedDOMResult&lt;$memoizedType&gt;&gt;(bindingName.get().string(), memoizedResult, $exceptionCode);\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;    result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interface, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;} else if (cursor.isReplaying()) {\n&quot;);
</span><span class="lines">@@ -4575,8 +4548,7 @@
</span><span class="cx">             # FIXME: the generated code should report an error if an input cannot be fetched or converted.
</span><span class="cx">             push(@implContent, $indent . &quot;    if (input &amp;&amp; input-&gt;convertTo&lt;$memoizedType&gt;(memoizedResult)) {\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interface, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
</span><del>-            push(@implContent, $indent . &quot;        ec.code = input-&gt;exceptionCode();\n&quot;) if $mayThrowLegacyExceptionWithMessage;
-            push(@implContent, $indent . &quot;        ec = input-&gt;exceptionCode();\n&quot;) if $mayThrowLegacyException &amp;&amp; !$mayThrowLegacyExceptionWithMessage;
</del><ins>+            push(@implContent, $indent . &quot;        ec = input-&gt;exceptionCode();\n&quot;) if $mayThrowLegacyException;
</ins><span class="cx">             push(@implContent, $indent . &quot;    } else\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValue($function-&gt;signature, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;} else\n&quot;);
</span><span class="lines">@@ -5506,13 +5478,9 @@
</span><span class="cx"> 
</span><span class="cx">             GenerateArgumentsCountCheck($outputArray, $function, $interface);
</span><span class="cx"> 
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException} || $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyExceptionWithMessage} || $interface-&gt;extendedAttributes-&gt;{ConstructorMayThrowLegacyException}) {
</del><ins>+            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException} || $interface-&gt;extendedAttributes-&gt;{ConstructorMayThrowLegacyException}) {
</ins><span class="cx">                 $implIncludes{&quot;ExceptionCode.h&quot;} = 1;
</span><del>-                if ($function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyExceptionWithMessage}) {
-                    push(@$outputArray, &quot;    ExceptionCodeWithMessage ec;\n&quot;);
-                } else {
-                    push(@$outputArray, &quot;    ExceptionCode ec = 0;\n&quot;);
-                }
</del><ins>+                push(@$outputArray, &quot;    ExceptionCode ec = 0;\n&quot;);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             # FIXME: For now, we do not support SVG constructors.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -70,7 +70,6 @@
</span><span class="cx"> GenerateIsReachable=|Impl|ImplWebGLRenderingContext|ImplDocument|ImplElementRoot|ImplFrame|ImplOwnerNodeRoot|ImplScriptExecutionContext
</span><span class="cx"> GetterMayThrowException
</span><span class="cx"> GetterMayThrowLegacyException
</span><del>-GetterMayThrowLegacyExceptionWithMessage
</del><span class="cx"> Immutable
</span><span class="cx"> ImplementedAs=*
</span><span class="cx"> ImplementationLacksVTable
</span><span class="lines">@@ -98,7 +97,6 @@
</span><span class="cx"> MasqueradesAsUndefined
</span><span class="cx"> MayThrowException
</span><span class="cx"> MayThrowLegacyException
</span><del>-MayThrowLegacyExceptionWithMessage
</del><span class="cx"> NamedConstructor=*
</span><span class="cx"> NewImpurePropertyFiresWatchpoints
</span><span class="cx"> NewObject
</span><span class="lines">@@ -118,7 +116,6 @@
</span><span class="cx"> SetterCallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow
</span><span class="cx"> SetterMayThrowException
</span><span class="cx"> SetterMayThrowLegacyException
</span><del>-SetterMayThrowLegacyExceptionWithMessage
</del><span class="cx"> SkipVTableValidation
</span><span class="cx"> SuppressToJSObject
</span><span class="cx"> TreatNullAs=EmptyString
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -866,7 +866,6 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionReturningLong(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionReturningObject(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithLegacyException(JSC::ExecState*);
</span><del>-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionWithMessage(JSC::ExecState*);
</del><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionPrivateMethod(JSC::ExecState*);
</span><span class="lines">@@ -1061,14 +1060,10 @@
</span><span class="cx"> bool setJSTestObjAttributeWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjAttributeWithGetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjAttributeWithGetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><del>-JSC::EncodedJSValue jsTestObjAttrWithGetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestObjAttrWithGetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</del><span class="cx"> JSC::EncodedJSValue jsTestObjAttributeWithSetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjAttributeWithSetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjAttributeWithSetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjAttributeWithSetterLegacyException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><del>-JSC::EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestObjAttrWithSetterExceptionWithMessage(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</del><span class="cx"> JSC::EncodedJSValue jsTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> bool setJSTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="lines">@@ -1378,10 +1373,8 @@
</span><span class="cx">     { &quot;typedArrayAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjTypedArrayAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjTypedArrayAttr) } },
</span><span class="cx">     { &quot;attributeWithGetterException&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjAttributeWithGetterException), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjAttributeWithGetterException) } },
</span><span class="cx">     { &quot;attributeWithGetterLegacyException&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjAttributeWithGetterLegacyException), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjAttributeWithGetterLegacyException) } },
</span><del>-    { &quot;attrWithGetterExceptionWithMessage&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjAttrWithGetterExceptionWithMessage), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjAttrWithGetterExceptionWithMessage) } },
</del><span class="cx">     { &quot;attributeWithSetterException&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjAttributeWithSetterException), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjAttributeWithSetterException) } },
</span><span class="cx">     { &quot;attributeWithSetterLegacyException&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjAttributeWithSetterLegacyException), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjAttributeWithSetterLegacyException) } },
</span><del>-    { &quot;attrWithSetterExceptionWithMessage&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjAttrWithSetterExceptionWithMessage), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjAttrWithSetterExceptionWithMessage) } },
</del><span class="cx">     { &quot;stringAttrWithGetterException&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjStringAttrWithGetterException), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjStringAttrWithGetterException) } },
</span><span class="cx">     { &quot;stringAttrWithSetterException&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjStringAttrWithSetterException), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjStringAttrWithSetterException) } },
</span><span class="cx">     { &quot;customAttr&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjCustomAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjCustomAttr) } },
</span><span class="lines">@@ -1478,7 +1471,6 @@
</span><span class="cx">     { &quot;methodWithExceptionReturningLong&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithExceptionReturningLong), (intptr_t) (0) } },
</span><span class="cx">     { &quot;methodWithExceptionReturningObject&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithExceptionReturningObject), (intptr_t) (0) } },
</span><span class="cx">     { &quot;methodWithLegacyException&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithLegacyException), (intptr_t) (0) } },
</span><del>-    { &quot;methodWithExceptionWithMessage&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithExceptionWithMessage), (intptr_t) (0) } },
</del><span class="cx">     { &quot;customMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionCustomMethod), (intptr_t) (0) } },
</span><span class="cx">     { &quot;customMethodWithArgs&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t) (3) } },
</span><span class="cx"> #if ENABLE(Condition3)
</span><span class="lines">@@ -2391,24 +2383,6 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline JSValue jsTestObjAttrWithGetterExceptionWithMessageGetter(ExecState*, JSTestObj*, ThrowScope&amp; throwScope);
-
-EncodedJSValue jsTestObjAttrWithGetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, PropertyName)
-{
-    return BindingCaller&lt;JSTestObj&gt;::attribute&lt;jsTestObjAttrWithGetterExceptionWithMessageGetter&gt;(state, thisValue, &quot;attrWithGetterExceptionWithMessage&quot;);
-}
-
-static inline JSValue jsTestObjAttrWithGetterExceptionWithMessageGetter(ExecState* state, JSTestObj* thisObject, ThrowScope&amp; throwScope)
-{
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(state);
-    ExceptionCodeWithMessage ec;
-    auto&amp; impl = thisObject-&gt;wrapped();
-    JSValue result = jsNumber(impl.attrWithGetterExceptionWithMessage(ec));
-    setDOMException(state, throwScope, ec);
-    return result;
-}
-
</del><span class="cx"> static inline JSValue jsTestObjAttributeWithSetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope&amp; throwScope);
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestObjAttributeWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -2441,22 +2415,6 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline JSValue jsTestObjAttrWithSetterExceptionWithMessageGetter(ExecState*, JSTestObj*, ThrowScope&amp; throwScope);
-
-EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, PropertyName)
-{
-    return BindingCaller&lt;JSTestObj&gt;::attribute&lt;jsTestObjAttrWithSetterExceptionWithMessageGetter&gt;(state, thisValue, &quot;attrWithSetterExceptionWithMessage&quot;);
-}
-
-static inline JSValue jsTestObjAttrWithSetterExceptionWithMessageGetter(ExecState* state, JSTestObj* thisObject, ThrowScope&amp; throwScope)
-{
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(state);
-    auto&amp; impl = thisObject-&gt;wrapped();
-    JSValue result = jsNumber(impl.attrWithSetterExceptionWithMessage());
-    return result;
-}
-
</del><span class="cx"> static inline JSValue jsTestObjStringAttrWithGetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope&amp; throwScope);
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestObjStringAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -3920,24 +3878,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-bool setJSTestObjAttrWithGetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
-{
-    VM&amp; vm = state-&gt;vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    JSValue value = JSValue::decode(encodedValue);
-    UNUSED_PARAM(thisValue);
-    JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
-    if (UNLIKELY(!castedThis))
-        return throwSetterTypeError(*state, throwScope, &quot;TestObject&quot;, &quot;attrWithGetterExceptionWithMessage&quot;);
-    auto&amp; impl = castedThis-&gt;wrapped();
-    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
-    RETURN_IF_EXCEPTION(throwScope, false);
-    impl.setAttrWithGetterExceptionWithMessage(WTFMove(nativeValue));
-    return true;
-}
-
-
</del><span class="cx"> bool setJSTestObjAttributeWithSetterException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="lines">@@ -3976,26 +3916,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-bool setJSTestObjAttrWithSetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
-{
-    VM&amp; vm = state-&gt;vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    JSValue value = JSValue::decode(encodedValue);
-    UNUSED_PARAM(thisValue);
-    JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
-    if (UNLIKELY(!castedThis))
-        return throwSetterTypeError(*state, throwScope, &quot;TestObject&quot;, &quot;attrWithSetterExceptionWithMessage&quot;);
-    auto&amp; impl = castedThis-&gt;wrapped();
-    ExceptionCodeWithMessage ec;
-    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
-    RETURN_IF_EXCEPTION(throwScope, false);
-    impl.setAttrWithSetterExceptionWithMessage(WTFMove(nativeValue), ec);
-    setDOMException(state, throwScope, ec);
-    return true;
-}
-
-
</del><span class="cx"> bool setJSTestObjStringAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="lines">@@ -5281,23 +5201,6 @@
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithExceptionWithMessage(ExecState* state)
-{
-    VM&amp; vm = state-&gt;vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    JSValue thisValue = state-&gt;thisValue();
-    auto castedThis = jsDynamicCast&lt;JSTestObj*&gt;(thisValue);
-    if (UNLIKELY(!castedThis))
-        return throwThisTypeError(*state, throwScope, &quot;TestObject&quot;, &quot;methodWithExceptionWithMessage&quot;);
-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
-    auto&amp; impl = castedThis-&gt;wrapped();
-    ExceptionCodeWithMessage ec;
-    impl.methodWithExceptionWithMessage(ec);
-    setDOMException(state, throwScope, ec);
-    return JSValue::encode(jsUndefined());
-}
-
</del><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -153,13 +153,10 @@
</span><span class="cx">     [MayThrowException] long methodWithExceptionReturningLong();
</span><span class="cx">     [MayThrowException] TestObj methodWithExceptionReturningObject();
</span><span class="cx">     [MayThrowLegacyException] void methodWithLegacyException();
</span><del>-    [MayThrowLegacyExceptionWithMessage] void methodWithExceptionWithMessage();
</del><span class="cx">     [GetterMayThrowException] attribute long attributeWithGetterException;
</span><span class="cx">     [GetterMayThrowLegacyException] attribute long attributeWithGetterLegacyException;
</span><del>-    [GetterMayThrowLegacyExceptionWithMessage] attribute long attrWithGetterExceptionWithMessage;
</del><span class="cx">     [SetterMayThrowException] attribute long attributeWithSetterException;
</span><span class="cx">     [SetterMayThrowLegacyException] attribute long attributeWithSetterLegacyException;
</span><del>-    [SetterMayThrowLegacyExceptionWithMessage] attribute long attrWithSetterExceptionWithMessage;
</del><span class="cx">     [GetterMayThrowLegacyException] attribute DOMString stringAttrWithGetterException;
</span><span class="cx">     [SetterMayThrowLegacyException] attribute DOMString stringAttrWithSetterException;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomCustomElementRegistryidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CustomElementRegistry.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CustomElementRegistry.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/dom/CustomElementRegistry.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -26,12 +26,10 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=CUSTOM_ELEMENTS,
</span><span class="cx">     EnabledAtRuntime=CustomElements,
</span><ins>+    ImplementationLacksVTable,
</ins><span class="cx">     JSGenerateToNativeObject,
</span><del>-    ImplementationLacksVTable
</del><span class="cx"> ] interface CustomElementRegistry {
</span><del>-
</del><span class="cx">     [CEReactions, Custom] void define(DOMString name, Function constructor);
</span><span class="cx">     any get(DOMString name);
</span><del>-    [MayThrowLegacyExceptionWithMessage, Custom] Promise whenDefined(DOMString name);
-
</del><ins>+    [Custom, MayThrowException] Promise whenDefined(DOMString name);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomExceptionCodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExceptionCode.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExceptionCode.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/dom/ExceptionCode.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -16,11 +16,8 @@
</span><span class="cx">  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef ExceptionCode_h
-#define ExceptionCode_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> // The DOM standards use unsigned short for exception codes.
</span><span class="lines">@@ -27,9 +24,8 @@
</span><span class="cx"> // In our DOM implementation we use int instead, and use different
</span><span class="cx"> // numerical ranges for different types of DOM exception, so that
</span><span class="cx"> // an exception of any type can be expressed with a single integer.
</span><del>-typedef int ExceptionCode;
</del><ins>+using ExceptionCode = int;
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> // Some of these are considered historical since they have been
</span><span class="cx"> // changed or removed from the specifications.
</span><span class="cx"> enum {
</span><span class="lines">@@ -82,11 +78,4 @@
</span><span class="cx">     RangeError = 106,
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-struct ExceptionCodeWithMessage {
-    ExceptionCode code { 0 };
-    String message;
-};
-
</del><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // ExceptionCode_h
</del></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/history/HistoryItem.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">     WEBCORE_EXPORT void setIsTargetItem(bool);
</span><span class="cx">     
</span><span class="cx">     WEBCORE_EXPORT void setStateObject(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;);
</span><del>-    RefPtr&lt;SerializedScriptValue&gt; stateObject() const { return m_stateObject; }
</del><ins>+    SerializedScriptValue* stateObject() const { return m_stateObject.get(); }
</ins><span class="cx"> 
</span><span class="cx">     void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number; }
</span><span class="cx">     long long itemSequenceNumber() const { return m_itemSequenceNumber; }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -106,19 +106,17 @@
</span><span class="cx"> 
</span><span class="cx"> class OpenDatabaseCallback final : public EventListener {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;OpenDatabaseCallback&gt; create(ExecutableWithDatabase* executableWithDatabase)
</del><ins>+    static Ref&lt;OpenDatabaseCallback&gt; create(ExecutableWithDatabase&amp; executableWithDatabase)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(*new OpenDatabaseCallback(executableWithDatabase));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual ~OpenDatabaseCallback() { }
-
-    bool operator==(const EventListener&amp; other) const override
</del><ins>+    bool operator==(const EventListener&amp; other) const final
</ins><span class="cx">     {
</span><span class="cx">         return this == &amp;other;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void handleEvent(ScriptExecutionContext*, Event* event) override
</del><ins>+    void handleEvent(ScriptExecutionContext*, Event* event) final
</ins><span class="cx">     {
</span><span class="cx">         if (event-&gt;type() != eventNames().successEvent) {
</span><span class="cx">             m_executableWithDatabase-&gt;requestCallback().sendFailure(&quot;Unexpected event type.&quot;);
</span><span class="lines">@@ -141,10 +139,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    OpenDatabaseCallback(ExecutableWithDatabase* executableWithDatabase)
</del><ins>+    OpenDatabaseCallback(ExecutableWithDatabase&amp; executableWithDatabase)
</ins><span class="cx">         : EventListener(EventListener::CPPEventListenerType)
</span><span class="cx">         , m_executableWithDatabase(executableWithDatabase) { }
</span><del>-    RefPtr&lt;ExecutableWithDatabase&gt; m_executableWithDatabase;
</del><ins>+    Ref&lt;ExecutableWithDatabase&gt; m_executableWithDatabase;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> void ExecutableWithDatabase::start(IDBFactory* idbFactory, SecurityOrigin*, const String&amp; databaseName)
</span><span class="lines">@@ -154,15 +152,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCodeWithMessage ec;
-    RefPtr&lt;IDBOpenDBRequest&gt; idbOpenDBRequest = idbFactory-&gt;open(*context(), databaseName, Nullopt, ec);
-    if (ec.code) {
</del><ins>+    auto result = idbFactory-&gt;open(*context(), databaseName, Nullopt);
+    if (result.hasException()) {
</ins><span class="cx">         requestCallback().sendFailure(&quot;Could not open database.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Ref&lt;OpenDatabaseCallback&gt; callback = OpenDatabaseCallback::create(this);
-    idbOpenDBRequest-&gt;addEventListener(eventNames().successEvent, WTFMove(callback), false);
</del><ins>+    result.releaseReturnValue()-&gt;addEventListener(eventNames().successEvent, OpenDatabaseCallback::create(*this), false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -203,29 +199,26 @@
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;IDBTransaction&gt; transactionForDatabase(IDBDatabase* idbDatabase, const String&amp; objectStoreName, const String&amp; mode = IDBTransaction::modeReadOnly())
</span><span class="cx"> {
</span><del>-    ExceptionCodeWithMessage ec;
-    RefPtr&lt;IDBTransaction&gt; idbTransaction = idbDatabase-&gt;transaction(objectStoreName, mode, ec);
-    if (ec.code)
</del><ins>+    auto result = idbDatabase-&gt;transaction(objectStoreName, mode);
+    if (result.hasException())
</ins><span class="cx">         return nullptr;
</span><del>-    return idbTransaction;
</del><ins>+    return result.releaseReturnValue();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;IDBObjectStore&gt; objectStoreForTransaction(IDBTransaction* idbTransaction, const String&amp; objectStoreName)
</span><span class="cx"> {
</span><del>-    ExceptionCodeWithMessage ec;
-    RefPtr&lt;IDBObjectStore&gt; idbObjectStore = idbTransaction-&gt;objectStore(objectStoreName, ec);
-    if (ec.code)
</del><ins>+    auto result = idbTransaction-&gt;objectStore(objectStoreName);
+    if (result.hasException())
</ins><span class="cx">         return nullptr;
</span><del>-    return idbObjectStore;
</del><ins>+    return result.releaseReturnValue();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;IDBIndex&gt; indexForObjectStore(IDBObjectStore* idbObjectStore, const String&amp; indexName)
</span><span class="cx"> {
</span><del>-    ExceptionCodeWithMessage ec;
-    RefPtr&lt;IDBIndex&gt; idbIndex = idbObjectStore-&gt;index(indexName, ec);
-    if (ec.code)
</del><ins>+    auto index = idbObjectStore-&gt;index(indexName);
+    if (index.hasException())
</ins><span class="cx">         return nullptr;
</span><del>-    return idbIndex;
</del><ins>+    return index.releaseReturnValue();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class DatabaseLoader final : public ExecutableWithDatabase {
</span><span class="lines">@@ -253,7 +246,7 @@
</span><span class="cx">             auto indexes = Inspector::Protocol::Array&lt;Inspector::Protocol::IndexedDB::ObjectStoreIndex&gt;::create();
</span><span class="cx">     
</span><span class="cx">             for (auto&amp; indexInfo : objectStoreInfo-&gt;indexMap().values()) {
</span><del>-                Ref&lt;ObjectStoreIndex&gt; objectStoreIndex = ObjectStoreIndex::create()
</del><ins>+                auto objectStoreIndex = ObjectStoreIndex::create()
</ins><span class="cx">                     .setName(indexInfo.name())
</span><span class="cx">                     .setKeyPath(keyPathFromIDBKeyPath(indexInfo.keyPath()))
</span><span class="cx">                     .setUnique(indexInfo.unique())
</span><span class="lines">@@ -262,7 +255,7 @@
</span><span class="cx">                 indexes-&gt;addItem(WTFMove(objectStoreIndex));
</span><span class="cx">             }
</span><span class="cx">     
</span><del>-            Ref&lt;ObjectStore&gt; objectStore = ObjectStore::create()
</del><ins>+            auto objectStore = ObjectStore::create()
</ins><span class="cx">                 .setName(objectStoreInfo-&gt;name())
</span><span class="cx">                 .setKeyPath(keyPathFromIDBKeyPath(objectStoreInfo-&gt;keyPath()))
</span><span class="cx">                 .setAutoIncrement(objectStoreInfo-&gt;autoIncrement())
</span><span class="lines">@@ -271,7 +264,7 @@
</span><span class="cx">             objectStores-&gt;addItem(WTFMove(objectStore));
</span><span class="cx">         }
</span><span class="cx">     
</span><del>-        Ref&lt;DatabaseWithObjectStores&gt; result = DatabaseWithObjectStores::create()
</del><ins>+        auto result = DatabaseWithObjectStores::create()
</ins><span class="cx">             .setName(databaseInfo.name())
</span><span class="cx">             .setVersion(databaseInfo.version())
</span><span class="cx">             .setObjectStores(WTFMove(objectStores))
</span><span class="lines">@@ -403,9 +396,7 @@
</span><span class="cx">         auto&amp; cursor = *cursorResult;
</span><span class="cx"> 
</span><span class="cx">         if (m_skipCount) {
</span><del>-            ExceptionCodeWithMessage ec;
-            cursor.advance(m_skipCount, ec);
-            if (ec.code)
</del><ins>+            if (cursor.advance(m_skipCount).hasException())
</ins><span class="cx">                 m_requestCallback-&gt;sendFailure(&quot;Could not advance cursor.&quot;);
</span><span class="cx">             m_skipCount = 0;
</span><span class="cx">             return;
</span><span class="lines">@@ -417,18 +408,16 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Continue cursor before making injected script calls, otherwise transaction might be finished.
</span><del>-        ExceptionCodeWithMessage ec;
-        cursor.continueFunction(nullptr, ec);
-        if (ec.code) {
</del><ins>+        if (cursor.continueFunction(nullptr).hasException()) {
</ins><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not continue cursor.&quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        JSC::ExecState* state = context ? context-&gt;execState() : nullptr;
</del><ins>+        auto* state = context ? context-&gt;execState() : nullptr;
</ins><span class="cx">         if (!state)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        RefPtr&lt;DataEntry&gt; dataEntry = DataEntry::create()
</del><ins>+        auto dataEntry = DataEntry::create()
</ins><span class="cx">             .setKey(m_injectedScript.wrapObject(cursor.key(), String(), true))
</span><span class="cx">             .setPrimaryKey(m_injectedScript.wrapObject(cursor.primaryKey(), String(), true))
</span><span class="cx">             .setValue(m_injectedScript.wrapObject(cursor.value(), String(), true))
</span><span class="lines">@@ -474,13 +463,13 @@
</span><span class="cx">         if (!requestCallback().isActive())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        RefPtr&lt;IDBTransaction&gt; idbTransaction = transactionForDatabase(&amp;database, m_objectStoreName);
</del><ins>+        auto idbTransaction = transactionForDatabase(&amp;database, m_objectStoreName);
</ins><span class="cx">         if (!idbTransaction) {
</span><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not get transaction&quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        RefPtr&lt;IDBObjectStore&gt; idbObjectStore = objectStoreForTransaction(idbTransaction.get(), m_objectStoreName);
</del><ins>+        auto idbObjectStore = objectStoreForTransaction(idbTransaction.get(), m_objectStoreName);
</ins><span class="cx">         if (!idbObjectStore) {
</span><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not get object store&quot;);
</span><span class="cx">             return;
</span><span class="lines">@@ -487,19 +476,27 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         TransactionActivator activator(idbTransaction.get());
</span><del>-        ExceptionCodeWithMessage ec;
</del><span class="cx">         RefPtr&lt;IDBRequest&gt; idbRequest;
</span><del>-        JSC::ExecState* exec = context() ? context()-&gt;execState() : nullptr;
</del><ins>+        auto* exec = context() ? context()-&gt;execState() : nullptr;
</ins><span class="cx">         if (!m_indexName.isEmpty()) {
</span><del>-            RefPtr&lt;IDBIndex&gt; idbIndex = indexForObjectStore(idbObjectStore.get(), m_indexName);
</del><ins>+            auto idbIndex = indexForObjectStore(idbObjectStore.get(), m_indexName);
</ins><span class="cx">             if (!idbIndex) {
</span><span class="cx">                 m_requestCallback-&gt;sendFailure(&quot;Could not get index&quot;);
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            idbRequest = exec ? idbIndex-&gt;openCursor(*exec, m_idbKeyRange.get(), IDBCursor::directionNext(), ec) : nullptr;
-        } else
-            idbRequest = exec ? idbObjectStore-&gt;openCursor(*exec, m_idbKeyRange.get(), IDBCursor::directionNext(), ec) : nullptr;
</del><ins>+            if (exec) {
+                auto result = idbIndex-&gt;openCursor(*exec, m_idbKeyRange.get(), IDBCursor::directionNext());
+                if (!result.hasException())
+                    idbRequest = result.releaseReturnValue();
+            }
+        } else {
+            if (exec) {
+                auto result = idbObjectStore-&gt;openCursor(*exec, m_idbKeyRange.get(), IDBCursor::directionNext());
+                if (!result.hasException())
+                    idbRequest = result.releaseReturnValue();
+            }
+        }
</ins><span class="cx"> 
</span><span class="cx">         if (!idbRequest) {
</span><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not open cursor to populate database data&quot;);
</span><span class="lines">@@ -506,7 +503,7 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        Ref&lt;OpenCursorCallback&gt; openCursorCallback = OpenCursorCallback::create(m_injectedScript, m_requestCallback.copyRef(), m_skipCount, m_pageSize);
</del><ins>+        auto openCursorCallback = OpenCursorCallback::create(m_injectedScript, m_requestCallback.copyRef(), m_skipCount, m_pageSize);
</ins><span class="cx">         idbRequest-&gt;addEventListener(eventNames().successEvent, WTFMove(openCursorCallback), false);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -709,13 +706,13 @@
</span><span class="cx">         if (!requestCallback().isActive())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        RefPtr&lt;IDBTransaction&gt; idbTransaction = transactionForDatabase(&amp;database, m_objectStoreName, IDBTransaction::modeReadWrite());
</del><ins>+        auto idbTransaction = transactionForDatabase(&amp;database, m_objectStoreName, IDBTransaction::modeReadWrite());
</ins><span class="cx">         if (!idbTransaction) {
</span><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not get transaction&quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        RefPtr&lt;IDBObjectStore&gt; idbObjectStore = objectStoreForTransaction(idbTransaction.get(), m_objectStoreName);
</del><ins>+        auto idbObjectStore = objectStoreForTransaction(idbTransaction.get(), m_objectStoreName);
</ins><span class="cx">         if (!idbObjectStore) {
</span><span class="cx">             m_requestCallback-&gt;sendFailure(&quot;Could not get object store&quot;);
</span><span class="cx">             return;
</span><span class="lines">@@ -722,13 +719,15 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         TransactionActivator activator(idbTransaction.get());
</span><del>-        ExceptionCodeWithMessage ec;
-        JSC::ExecState* exec = context() ? context()-&gt;execState() : nullptr;
-        RefPtr&lt;IDBRequest&gt; idbRequest = exec ? idbObjectStore-&gt;clear(*exec, ec) : nullptr;
-        ASSERT(!ec.code);
-        if (ec.code) {
-            m_requestCallback-&gt;sendFailure(String::format(&quot;Could not clear object store '%s': %d&quot;, m_objectStoreName.utf8().data(), ec.code));
-            return;
</del><ins>+        RefPtr&lt;IDBRequest&gt; idbRequest;
+        if (auto* exec = context() ? context()-&gt;execState() : nullptr) {
+            auto result = idbObjectStore-&gt;clear(*exec);
+            ASSERT(!result.hasException());
+            if (result.hasException()) {
+                m_requestCallback-&gt;sendFailure(String::format(&quot;Could not clear object store '%s': %d&quot;, m_objectStoreName.utf8().data(), result.releaseException().code()));
+                return;
+            }
+            idbRequest = result.releaseReturnValue();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         idbTransaction-&gt;addEventListener(eventNames().completeEvent, ClearObjectStoreListener::create(m_requestCallback.copyRef()), false);
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -657,7 +657,7 @@
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><span class="cx">         return nullptr;
</span><span class="cx">     if (!m_history)
</span><del>-        m_history = History::create(m_frame);
</del><ins>+        m_history = History::create(*m_frame);
</ins><span class="cx">     return m_history.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageHistorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/History.cpp (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/History.cpp        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/page/History.cpp        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -38,15 +38,13 @@
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><del>-#include &quot;SerializedScriptValue.h&quot;
</del><span class="cx"> #include &lt;wtf/CheckedArithmetic.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-History::History(Frame* frame)
-    : DOMWindowProperty(frame)
-    , m_lastStateObjectRequested(nullptr)
</del><ins>+History::History(Frame&amp; frame)
+    : DOMWindowProperty(&amp;frame)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -54,26 +52,26 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><span class="cx">         return 0;
</span><del>-    if (!m_frame-&gt;page())
</del><ins>+    auto* page = m_frame-&gt;page();
+    if (!page)
</ins><span class="cx">         return 0;
</span><del>-    return m_frame-&gt;page()-&gt;backForward().count();
</del><ins>+    return page-&gt;backForward().count();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;SerializedScriptValue&gt; History::state()
</del><ins>+SerializedScriptValue* History::state()
</ins><span class="cx"> {
</span><span class="cx">     m_lastStateObjectRequested = stateInternal();
</span><del>-    return m_lastStateObjectRequested;
</del><ins>+    return m_lastStateObjectRequested.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;SerializedScriptValue&gt; History::stateInternal() const
</del><ins>+SerializedScriptValue* History::stateInternal() const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><del>-        return 0;
-
-    if (HistoryItem* historyItem = m_frame-&gt;loader().history().currentItem())
-        return historyItem-&gt;stateObject();
-
-    return 0;
</del><ins>+        return nullptr;
+    auto* historyItem = m_frame-&gt;loader().history().currentItem();
+    if (!historyItem)
+        return nullptr;
+    return historyItem-&gt;stateObject();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool History::stateChanged() const
</span><span class="lines">@@ -83,7 +81,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool History::isSameAsCurrentState(SerializedScriptValue* state) const
</span><span class="cx"> {
</span><del>-    return state == stateInternal().get();
</del><ins>+    return state == stateInternal();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void History::back()
</span><span class="lines">@@ -136,29 +134,24 @@
</span><span class="cx">     return URL(baseURL, urlString);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void History::stateObjectAdded(PassRefPtr&lt;SerializedScriptValue&gt; data, const String&amp; title, const String&amp; urlString, StateObjectType stateObjectType, ExceptionCodeWithMessage&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; History::stateObjectAdded(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; data, const String&amp; title, const String&amp; urlString, StateObjectType stateObjectType)
</ins><span class="cx"> {
</span><del>-    // Each unique main-frame document is only allowed to send 64mb of state object payload to the UI client/process.
</del><ins>+    // Each unique main-frame document is only allowed to send 64MB of state object payload to the UI client/process.
</ins><span class="cx">     static uint32_t totalStateObjectPayloadLimit = 0x4000000;
</span><span class="cx">     static double stateObjectTimeSpan = 30.0;
</span><span class="cx">     static unsigned perStateObjectTimeSpanLimit = 100;
</span><span class="cx"> 
</span><span class="cx">     if (!m_frame || !m_frame-&gt;page())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     URL fullURL = urlForState(urlString);
</span><del>-    if (!fullURL.isValid() || !m_frame-&gt;document()-&gt;securityOrigin()-&gt;canRequest(fullURL)) {
-        ec.code = SECURITY_ERR;
-        return;
-    }
</del><ins>+    if (!fullURL.isValid() || !m_frame-&gt;document()-&gt;securityOrigin()-&gt;canRequest(fullURL))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (fullURL.hasUsername() || fullURL.hasPassword()) {
</span><del>-        ec.code = SECURITY_ERR;
</del><span class="cx">         if (stateObjectType == StateObjectType::Replace)
</span><del>-            ec.message = makeString(&quot;Attempt to use history.replaceState() to change session history URL to &quot;, fullURL.string(), &quot; is insecure; Username/passwords aren't allowed in state object URLs&quot;);
-        else
-            ec.message = makeString(&quot;Attempt to use history.pushState() to add URL &quot;, fullURL.string(), &quot; to session history is insecure; Username/passwords aren't allowed in state object URLs&quot;);
-        return;
</del><ins>+            return Exception { SECURITY_ERR, &quot;Attempt to use history.replaceState() to change session history URL to &quot; + fullURL.string() + &quot; is insecure; Username/passwords aren't allowed in state object URLs&quot; };
+        return Exception { SECURITY_ERR, &quot;Attempt to use history.pushState() to add URL &quot; + fullURL.string() + &quot; to session history is insecure; Username/passwords aren't allowed in state object URLs&quot; };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Document* mainDocument = m_frame-&gt;page()-&gt;mainFrame().document();
</span><span class="lines">@@ -169,7 +162,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!mainHistory)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     double currentTimestamp = currentTime();
</span><span class="cx">     if (currentTimestamp - mainHistory-&gt;m_currentStateObjectTimeSpanStart &gt; stateObjectTimeSpan) {
</span><span class="lines">@@ -178,12 +171,9 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (mainHistory-&gt;m_currentStateObjectTimeSpanObjectsAdded &gt;= perStateObjectTimeSpanLimit) {
</span><del>-        ec.code = SECURITY_ERR;
</del><span class="cx">         if (stateObjectType == StateObjectType::Replace)
</span><del>-            ec.message = String::format(&quot;Attempt to use history.replaceState() more than %u times per %f seconds&quot;, perStateObjectTimeSpanLimit, stateObjectTimeSpan);
-        else
-            ec.message = String::format(&quot;Attempt to use history.pushState() more than %u times per %f seconds&quot;, perStateObjectTimeSpanLimit, stateObjectTimeSpan);
-        return;
</del><ins>+            return Exception { SECURITY_ERR, String::format(&quot;Attempt to use history.replaceState() more than %u times per %f seconds&quot;, perStateObjectTimeSpanLimit, stateObjectTimeSpan) };
+        return Exception { SECURITY_ERR, String::format(&quot;Attempt to use history.pushState() more than %u times per %f seconds&quot;, perStateObjectTimeSpanLimit, stateObjectTimeSpan) };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Checked&lt;unsigned&gt; titleSize = title.length();
</span><span class="lines">@@ -203,12 +193,9 @@
</span><span class="cx">     newTotalUsage += payloadSize;
</span><span class="cx"> 
</span><span class="cx">     if (newTotalUsage &gt; totalStateObjectPayloadLimit) {
</span><del>-        ec.code = QUOTA_EXCEEDED_ERR;
</del><span class="cx">         if (stateObjectType == StateObjectType::Replace)
</span><del>-            ec.message = ASCIILiteral(&quot;Attempt to store more data than allowed using history.replaceState()&quot;);
-        else
-            ec.message = ASCIILiteral(&quot;Attempt to store more data than allowed using history.pushState()&quot;);
-        return;
</del><ins>+            return Exception { QUOTA_EXCEEDED_ERR, ASCIILiteral(&quot;Attempt to store more data than allowed using history.replaceState()&quot;) };
+        return Exception { QUOTA_EXCEEDED_ERR, ASCIILiteral(&quot;Attempt to store more data than allowed using history.pushState()&quot;) };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_mostRecentStateObjectUsage = payloadSize.unsafeGet();
</span><span class="lines">@@ -226,6 +213,8 @@
</span><span class="cx">         m_frame-&gt;loader().history().replaceState(data, title, fullURL.string());
</span><span class="cx">         m_frame-&gt;loader().client().dispatchDidReplaceStateWithinPage();
</span><span class="cx">     }
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageHistoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/History.h (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/History.h        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/page/History.h        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -23,30 +23,25 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef History_h
-#define History_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;DOMWindowProperty.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><del>-#include &quot;URL.h&quot;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><span class="cx"> class Frame;
</span><del>-struct ExceptionCodeWithMessage;
-typedef int ExceptionCode;
</del><ins>+class URL;
</ins><span class="cx"> 
</span><del>-class History : public ScriptWrappable, public RefCounted&lt;History&gt;, public DOMWindowProperty {
</del><ins>+class History final : public ScriptWrappable, public RefCounted&lt;History&gt;, public DOMWindowProperty {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;History&gt; create(Frame* frame) { return adoptRef(*new History(frame)); }
</del><ins>+    static Ref&lt;History&gt; create(Frame&amp; frame) { return adoptRef(*new History(frame)); }
</ins><span class="cx"> 
</span><span class="cx">     unsigned length() const;
</span><del>-    PassRefPtr&lt;SerializedScriptValue&gt; state();
</del><ins>+    SerializedScriptValue* state();
</ins><span class="cx">     void back();
</span><span class="cx">     void forward();
</span><span class="cx">     void go(int);
</span><span class="lines">@@ -58,18 +53,15 @@
</span><span class="cx">     bool stateChanged() const;
</span><span class="cx">     bool isSameAsCurrentState(SerializedScriptValue*) const;
</span><span class="cx"> 
</span><del>-    enum class StateObjectType {
-        Push,
-        Replace
-    };
-    void stateObjectAdded(PassRefPtr&lt;SerializedScriptValue&gt;, const String&amp; title, const String&amp; url, StateObjectType, ExceptionCodeWithMessage&amp;);
</del><ins>+    enum class StateObjectType { Push, Replace };
+    ExceptionOr&lt;void&gt; stateObjectAdded(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;, const String&amp; title, const String&amp; url, StateObjectType);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit History(Frame*);
</del><ins>+    explicit History(Frame&amp;);
</ins><span class="cx"> 
</span><span class="cx">     URL urlForState(const String&amp; url);
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;SerializedScriptValue&gt; stateInternal() const;
</del><ins>+    SerializedScriptValue* stateInternal() const;
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SerializedScriptValue&gt; m_lastStateObjectRequested;
</span><span class="cx"> 
</span><span class="lines">@@ -84,5 +76,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // History_h
</del></span></pre></div>
<a id="trunkSourceWebCorepageHistoryidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/History.idl (206975 => 206976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/History.idl        2016-10-10 02:03:35 UTC (rev 206975)
+++ trunk/Source/WebCore/page/History.idl        2016-10-10 02:13:28 UTC (rev 206976)
</span><span class="lines">@@ -33,6 +33,6 @@
</span><span class="cx">     [CallWith=Document, ForwardDeclareInHeader] void forward();
</span><span class="cx">     [CallWith=Document, ForwardDeclareInHeader] void go(optional long distance = 0);
</span><span class="cx"> 
</span><del>-    [Custom, MayThrowLegacyException] void pushState(any data, DOMString title, optional USVString? url = null);
-    [Custom, MayThrowLegacyException] void replaceState(any data, DOMString title, optional USVString? url = null);
</del><ins>+    [Custom, MayThrowException] void pushState(any data, DOMString title, optional USVString? url = null);
+    [Custom, MayThrowException] void replaceState(any data, DOMString title, optional USVString? url = null);
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>