<!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>[208118] trunk/Source</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/208118">208118</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-10-29 19:56:39 -0700 (Sat, 29 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Convert more of DOM from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164173

Reviewed by Ryosuke Niwa.

Source/WebCore:

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia): Use ExceptionOr.
(WebCore::MediaDevices::enumerateDevices): Ditto.
* Modules/mediastream/MediaDevices.h: Updated for above.
* Modules/mediastream/MediaDevices.idl: Use non-legacy exceptions.

* Modules/mediastream/MediaEndpointSessionDescription.cpp:
Added now-needed include of ExceptionCode.h.

* Modules/mediastream/RTCConfiguration.cpp:
(WebCore::parseIceServer): Use ExceptionOr.
(WebCore::RTCConfiguration::create): Ditto.
(WebCore::RTCConfiguration::initialize): Ditto.
* Modules/mediastream/RTCConfiguration.h: Updated for above.
* Modules/mediastream/RTCConfiguration.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::create): Use ExceptionOr.
(WebCore::RTCDTMFSender::insertDTMF): Ditto.
* Modules/mediastream/RTCDTMFSender.h: Updated for above.
* Modules/mediastream/RTCDTMFSender.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create): Use ExceptionOr.
(WebCore::RTCDataChannel::setBinaryType): Ditto.
(WebCore::RTCDataChannel::send): Ditto.
(WebCore::RTCDataChannel::didReceiveRawData): Ditto.
* Modules/mediastream/RTCDataChannel.h: Updated for above.
Also fhcanged resturn values to use const AtomicString&amp; and
unsigned instead of unsigned long. Also made more private.
Also changed BinaryType into an enum class.
* Modules/mediastream/RTCDataChannel.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create): Use ExceptionOr.
* Modules/mediastream/RTCIceCandidate.h: Updated for above.
* Modules/mediastream/RTCIceCandidate.idl: Use non-legacy exception.

* Modules/mediastream/RTCOfferAnswerOptions.cpp:
(WebCore::RTCOfferOptions::create): Use ExceptionOr.
(WebCore::RTCAnswerOptions::create): Ditto.
* Modules/mediastream/RTCOfferAnswerOptions.h: Updated for above.
Also removed all virtual functions since nothing here is polymorphic
and initalized data members in the header.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith): Use ExceptionOr.
(WebCore::RTCPeerConnection::addTrack): Ditto.
(WebCore::RTCPeerConnection::removeTrack): Ditto.
(WebCore::RTCPeerConnection::addTransceiver): Ditto.
(WebCore::RTCPeerConnection::completeAddTransceiver): Ditto.
(WebCore::RTCPeerConnection::queuedCreateOffer): Ditto.
(WebCore::RTCPeerConnection::queuedCreateAnswer): Ditto.
(WebCore::RTCPeerConnection::setConfiguration): Ditto.
(WebCore::RTCPeerConnection::createDataChannel): Ditto.
* Modules/mediastream/RTCPeerConnection.h: Updated for above.
* Modules/mediastream/RTCPeerConnection.idl: Use non-legacy exceptions.

* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack): Use ExceptionOr.
* Modules/mediastream/RTCRtpSender.h: Updated for above.
* Modules/mediastream/RTCRtpSender.idl: Use non-legacy exception.

* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::create): Use ExceptoinOr.
* Modules/mediastream/RTCSessionDescription.h: Updated for above.
(WebCore::RTCSessionDescription::~RTCSessionDescription):
* Modules/mediastream/RTCSessionDescription.idl: Use non-legacy exceptions.

* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::verifyCustomHandlerURL): Just return a boolean, no exception.
(WebCore::verifyProtocolHandlerScheme): Ditto.
(WebCore::NavigatorContentUtils::registerProtocolHandler): Use ExceptionOr.
(WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): Ditto.
(WebCore::NavigatorContentUtils::unregisterProtocolHandler): Ditto.
* Modules/navigatorcontentutils/NavigatorContentUtils.h: Updated for above.
* Modules/navigatorcontentutils/NavigatorContentUtils.idl: Use non-legacy exceptions.

* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevicesGetUserMediaPromiseFunction): Use propagateException.

* bindings/scripts/CodeGeneratorJS.pm:
(NeedsExplicitPropagateExceptionCall): Added. Helper function to decide whether
we need to call propagateException explicitly, if return value processing is not
going to propagate the exception for us.
(GenerateParametersCheck): Moved the code from GenerateReturnParameters inline
because it's almost as short as the function call. Use the newly created
NeedsExplicitPropagateExceptionCall function, which properly handles the case
where the return value is a promise.
(GenerateReturnParameters): Deleted.

* dom/CharacterData.cpp:
(WebCore::CharacterData::substringData): Use ExceptionOr.
(WebCore::CharacterData::insertData): Ditto.
(WebCore::CharacterData::deleteData): Ditto.
(WebCore::CharacterData::replaceData): Ditto.
* dom/CharacterData.h: Updated for above.
* dom/CharacterData.idl: Use non-legacy exceptions.

* dom/DataTransferItemList.h: Tried to use ExceptionOr, but this seems
like dead code that doesn't compile.
* dom/DataTransferItemList.idl: Use non-legacy exceptions.

* dom/MessagePort.idl: Use non-legacy exceptions, except this has
already been converted and was a custom binding.

* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe): Use ExceptionOr.
* dom/MutationObserver.h: Updated for above.
* dom/MutationObserver.idl: Use non-legacy exception.

* dom/Range.cpp:
(WebCore::deleteCharacterData): Updated use of calls that now use
ExceptionOr.
(WebCore::Range::processContentsBetweenOffsets): Ditto.
(WebCore::Range::insertNode): Ditto.

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr.
* dom/ShadowRoot.h: Updated for above.
* dom/ShadowRoot.idl: Use non-legacy exception.

* dom/Text.cpp:
(WebCore::Text::splitText): Use ExceptionOr.
(WebCore::Text::replaceWholeText): Removed unused ExceptionCode&amp;.
* dom/Text.h: Updated for above.
* dom/Text.idl: Use non-legacy exception.

* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition): Rewrote to use data rather than
substringData; more efficient.

* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply): Updated to work with
functions that return ExceptionOr.
(WebCore::DeleteFromTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.

* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
Use WTFMove to avoid a little bit of reference count churn.
(WebCore::InsertIntoTextNodeCommand::doApply): Removed IGNORE_EXCEPTION.
(WebCore::InsertIntoTextNodeCommand::doReapply): Removed ExceptionCode.
(WebCore::InsertIntoTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.

* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doApply): Updated to work with functions
that return ExceptionCode.
(WebCore::SplitTextNodeCommand::doUnapply): Removed ASSERT_NO_EXCEPTION.
(WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Updated to work
with functions that return ExceptionCode.

* html/HTMLTextFormControlElement.cpp:
Added now-needed include of ExceptionCode.h.

* inspector/DOMEditor.cpp: Removed ExceptionCode out argument from calls
to replaceWholeText, which never throws an exception.

Source/WebKit/mac:

* DOM/DOMCharacterData.mm:
(-[DOMCharacterData substringData:length:]): Updated since this
now uses ExceptionOr.
(-[DOMCharacterData insertData:data:]): Ditto.
(-[DOMCharacterData deleteData:length:]): Ditto.
(-[DOMCharacterData replaceData:length:data:]): Ditto.
* DOM/DOMText.mm:
(-[DOMText splitText:]): Ditto.
(-[DOMText replaceWholeText:]): Removed unneeded exception code
handling from function that does not throw an exception.

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
(webkit_dom_character_data_substring_data): Updated since this
now uses ExceptionOr.
(webkit_dom_character_data_insert_data): Ditto.
(webkit_dom_character_data_delete_data): Ditto.
(webkit_dom_character_data_replace_data): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
(webkit_dom_text_replace_whole_text): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
(webkit_dom_text_split_text): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicescpp">trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesh">trunk/Source/WebCore/Modules/mediastream/MediaDevices.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesidl">trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointSessionDescriptioncpp">trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCConfigurationcpp">trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCConfigurationh">trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCConfigurationidl">trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDTMFSendercpp">trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDTMFSenderh">trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDTMFSenderidl">trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDataChannelcpp">trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDataChannelh">trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDataChannelidl">trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCIceCandidatecpp">trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCIceCandidateh">trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCIceCandidateidl">trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionscpp">trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionsh">trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCRtpSendercpp">trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCRtpSenderh">trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCRtpSenderidl">trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCSessionDescriptioncpp">trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCSessionDescriptionh">trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCSessionDescriptionidl">trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilscpp">trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilsh">trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h</a></li>
<li><a href="#trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilsidl">trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMediaDevicesCustomcpp">trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatacpp">trunk/Source/WebCore/dom/CharacterData.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatah">trunk/Source/WebCore/dom/CharacterData.h</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDataidl">trunk/Source/WebCore/dom/CharacterData.idl</a></li>
<li><a href="#trunkSourceWebCoredomDataTransferItemListh">trunk/Source/WebCore/dom/DataTransferItemList.h</a></li>
<li><a href="#trunkSourceWebCoredomDataTransferItemListidl">trunk/Source/WebCore/dom/DataTransferItemList.idl</a></li>
<li><a href="#trunkSourceWebCoredomMessagePortidl">trunk/Source/WebCore/dom/MessagePort.idl</a></li>
<li><a href="#trunkSourceWebCoredomMutationObservercpp">trunk/Source/WebCore/dom/MutationObserver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserverh">trunk/Source/WebCore/dom/MutationObserver.h</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserveridl">trunk/Source/WebCore/dom/MutationObserver.idl</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRootcpp">trunk/Source/WebCore/dom/ShadowRoot.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRooth">trunk/Source/WebCore/dom/ShadowRoot.h</a></li>
<li><a href="#trunkSourceWebCoredomShadowRootidl">trunk/Source/WebCore/dom/ShadowRoot.idl</a></li>
<li><a href="#trunkSourceWebCoredomTextcpp">trunk/Source/WebCore/dom/Text.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTexth">trunk/Source/WebCore/dom/Text.h</a></li>
<li><a href="#trunkSourceWebCoredomTextidl">trunk/Source/WebCore/dom/Text.idl</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyBlockElementCommandcpp">trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteFromTextNodeCommandcpp">trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp">trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingSplitTextNodeCommandcpp">trunk/Source/WebCore/editing/SplitTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementcpp">trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorDOMEditorcpp">trunk/Source/WebCore/inspector/DOMEditor.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMCharacterDatamm">trunk/Source/WebKit/mac/DOM/DOMCharacterData.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMTextmm">trunk/Source/WebKit/mac/DOM/DOMText.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMCharacterDatacpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMDeprecatedcpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMTextcpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/ChangeLog        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -1,3 +1,167 @@
</span><ins>+2016-10-29  Darin Adler  &lt;darin@apple.com&gt;
+
+        Convert more of DOM from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=164173
+
+        Reviewed by Ryosuke Niwa.
+
+        * Modules/mediastream/MediaDevices.cpp:
+        (WebCore::MediaDevices::getUserMedia): Use ExceptionOr.
+        (WebCore::MediaDevices::enumerateDevices): Ditto.
+        * Modules/mediastream/MediaDevices.h: Updated for above.
+        * Modules/mediastream/MediaDevices.idl: Use non-legacy exceptions.
+
+        * Modules/mediastream/MediaEndpointSessionDescription.cpp:
+        Added now-needed include of ExceptionCode.h.
+
+        * Modules/mediastream/RTCConfiguration.cpp:
+        (WebCore::parseIceServer): Use ExceptionOr.
+        (WebCore::RTCConfiguration::create): Ditto.
+        (WebCore::RTCConfiguration::initialize): Ditto.
+        * Modules/mediastream/RTCConfiguration.h: Updated for above.
+        * Modules/mediastream/RTCConfiguration.idl: Use non-legacy exceptions.
+
+        * Modules/mediastream/RTCDTMFSender.cpp:
+        (WebCore::RTCDTMFSender::create): Use ExceptionOr.
+        (WebCore::RTCDTMFSender::insertDTMF): Ditto.
+        * Modules/mediastream/RTCDTMFSender.h: Updated for above.
+        * Modules/mediastream/RTCDTMFSender.idl: Use non-legacy exceptions.
+
+        * Modules/mediastream/RTCDataChannel.cpp:
+        (WebCore::RTCDataChannel::create): Use ExceptionOr.
+        (WebCore::RTCDataChannel::setBinaryType): Ditto.
+        (WebCore::RTCDataChannel::send): Ditto.
+        (WebCore::RTCDataChannel::didReceiveRawData): Ditto.
+        * Modules/mediastream/RTCDataChannel.h: Updated for above.
+        Also fhcanged resturn values to use const AtomicString&amp; and
+        unsigned instead of unsigned long. Also made more private.
+        Also changed BinaryType into an enum class.
+        * Modules/mediastream/RTCDataChannel.idl: Use non-legacy exceptions.
+
+        * Modules/mediastream/RTCIceCandidate.cpp:
+        (WebCore::RTCIceCandidate::create): Use ExceptionOr.
+        * Modules/mediastream/RTCIceCandidate.h: Updated for above.
+        * Modules/mediastream/RTCIceCandidate.idl: Use non-legacy exception.
+
+        * Modules/mediastream/RTCOfferAnswerOptions.cpp:
+        (WebCore::RTCOfferOptions::create): Use ExceptionOr.
+        (WebCore::RTCAnswerOptions::create): Ditto.
+        * Modules/mediastream/RTCOfferAnswerOptions.h: Updated for above.
+        Also removed all virtual functions since nothing here is polymorphic
+        and initalized data members in the header.
+
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::initializeWith): Use ExceptionOr.
+        (WebCore::RTCPeerConnection::addTrack): Ditto.
+        (WebCore::RTCPeerConnection::removeTrack): Ditto.
+        (WebCore::RTCPeerConnection::addTransceiver): Ditto.
+        (WebCore::RTCPeerConnection::completeAddTransceiver): Ditto.
+        (WebCore::RTCPeerConnection::queuedCreateOffer): Ditto.
+        (WebCore::RTCPeerConnection::queuedCreateAnswer): Ditto.
+        (WebCore::RTCPeerConnection::setConfiguration): Ditto.
+        (WebCore::RTCPeerConnection::createDataChannel): Ditto.
+        * Modules/mediastream/RTCPeerConnection.h: Updated for above.
+        * Modules/mediastream/RTCPeerConnection.idl: Use non-legacy exceptions.
+
+        * Modules/mediastream/RTCRtpSender.cpp:
+        (WebCore::RTCRtpSender::replaceTrack): Use ExceptionOr.
+        * Modules/mediastream/RTCRtpSender.h: Updated for above.
+        * Modules/mediastream/RTCRtpSender.idl: Use non-legacy exception.
+
+        * Modules/mediastream/RTCSessionDescription.cpp:
+        (WebCore::RTCSessionDescription::create): Use ExceptoinOr.
+        * Modules/mediastream/RTCSessionDescription.h: Updated for above.
+        (WebCore::RTCSessionDescription::~RTCSessionDescription):
+        * Modules/mediastream/RTCSessionDescription.idl: Use non-legacy exceptions.
+
+        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
+        (WebCore::verifyCustomHandlerURL): Just return a boolean, no exception.
+        (WebCore::verifyProtocolHandlerScheme): Ditto.
+        (WebCore::NavigatorContentUtils::registerProtocolHandler): Use ExceptionOr.
+        (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): Ditto.
+        (WebCore::NavigatorContentUtils::unregisterProtocolHandler): Ditto.
+        * Modules/navigatorcontentutils/NavigatorContentUtils.h: Updated for above.
+        * Modules/navigatorcontentutils/NavigatorContentUtils.idl: Use non-legacy exceptions.
+
+        * bindings/js/JSMediaDevicesCustom.cpp:
+        (WebCore::JSMediaDevicesGetUserMediaPromiseFunction): Use propagateException.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NeedsExplicitPropagateExceptionCall): Added. Helper function to decide whether
+        we need to call propagateException explicitly, if return value processing is not
+        going to propagate the exception for us.
+        (GenerateParametersCheck): Moved the code from GenerateReturnParameters inline
+        because it's almost as short as the function call. Use the newly created
+        NeedsExplicitPropagateExceptionCall function, which properly handles the case
+        where the return value is a promise.
+        (GenerateReturnParameters): Deleted.
+
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::substringData): Use ExceptionOr.
+        (WebCore::CharacterData::insertData): Ditto.
+        (WebCore::CharacterData::deleteData): Ditto.
+        (WebCore::CharacterData::replaceData): Ditto.
+        * dom/CharacterData.h: Updated for above.
+        * dom/CharacterData.idl: Use non-legacy exceptions.
+
+        * dom/DataTransferItemList.h: Tried to use ExceptionOr, but this seems
+        like dead code that doesn't compile.
+        * dom/DataTransferItemList.idl: Use non-legacy exceptions.
+
+        * dom/MessagePort.idl: Use non-legacy exceptions, except this has
+        already been converted and was a custom binding.
+
+        * dom/MutationObserver.cpp:
+        (WebCore::MutationObserver::observe): Use ExceptionOr.
+        * dom/MutationObserver.h: Updated for above.
+        * dom/MutationObserver.idl: Use non-legacy exception.
+
+        * dom/Range.cpp:
+        (WebCore::deleteCharacterData): Updated use of calls that now use
+        ExceptionOr.
+        (WebCore::Range::processContentsBetweenOffsets): Ditto.
+        (WebCore::Range::insertNode): Ditto.
+
+        * dom/ShadowRoot.cpp:
+        (WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr.
+        * dom/ShadowRoot.h: Updated for above.
+        * dom/ShadowRoot.idl: Use non-legacy exception.
+
+        * dom/Text.cpp:
+        (WebCore::Text::splitText): Use ExceptionOr.
+        (WebCore::Text::replaceWholeText): Removed unused ExceptionCode&amp;.
+        * dom/Text.h: Updated for above.
+        * dom/Text.idl: Use non-legacy exception.
+
+        * editing/ApplyBlockElementCommand.cpp:
+        (WebCore::isNewLineAtPosition): Rewrote to use data rather than
+        substringData; more efficient.
+
+        * editing/DeleteFromTextNodeCommand.cpp:
+        (WebCore::DeleteFromTextNodeCommand::doApply): Updated to work with
+        functions that return ExceptionOr.
+        (WebCore::DeleteFromTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
+
+        * editing/InsertIntoTextNodeCommand.cpp:
+        (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
+        Use WTFMove to avoid a little bit of reference count churn.
+        (WebCore::InsertIntoTextNodeCommand::doApply): Removed IGNORE_EXCEPTION.
+        (WebCore::InsertIntoTextNodeCommand::doReapply): Removed ExceptionCode.
+        (WebCore::InsertIntoTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
+
+        * editing/SplitTextNodeCommand.cpp:
+        (WebCore::SplitTextNodeCommand::doApply): Updated to work with functions
+        that return ExceptionCode.
+        (WebCore::SplitTextNodeCommand::doUnapply): Removed ASSERT_NO_EXCEPTION.
+        (WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Updated to work
+        with functions that return ExceptionCode.
+
+        * html/HTMLTextFormControlElement.cpp:
+        Added now-needed include of ExceptionCode.h.
+
+        * inspector/DOMEditor.cpp: Removed ExceptionCode out argument from calls
+        to replaceWholeText, which never throws an exception.
+
</ins><span class="cx"> 2016-10-29  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Parse color() function
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -63,16 +63,24 @@
</span><span class="cx">     return downcast&lt;Document&gt;(scriptExecutionContext());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaDevices::getUserMedia(Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; audioConstraints, Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; videoConstraints, Promise&amp;&amp; promise, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;void&gt; MediaDevices::getUserMedia(Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; audioConstraints, Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; videoConstraints, Promise&amp;&amp; promise) const
</ins><span class="cx"> {
</span><ins>+    ExceptionCode ec = 0;
</ins><span class="cx">     UserMediaRequest::start(document(), WTFMove(audioConstraints), WTFMove(videoConstraints), WTFMove(promise), ec);
</span><ins>+    if (ec)
+        return Exception { ec };
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaDevices::enumerateDevices(EnumerateDevicesPromise&amp;&amp; promise, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;void&gt; MediaDevices::enumerateDevices(EnumerateDevicesPromise&amp;&amp; promise) const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;MediaDevicesRequest&gt; request = MediaDevicesRequest::create(document(), WTFMove(promise), ec);
</del><ins>+    ExceptionCode ec = 0;
+    auto request = MediaDevicesRequest::create(document(), WTFMove(promise), ec);
+    if (ec)
+        return Exception { ec };
</ins><span class="cx">     if (request)
</span><span class="cx">         request-&gt;start();
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;MediaTrackSupportedConstraints&gt; MediaDevices::getSupportedConstraints()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,8 +28,7 @@
</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 MediaDevices_h
-#define MediaDevices_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> 
</span><span class="lines">@@ -38,8 +37,6 @@
</span><span class="cx"> #include &quot;MediaDeviceInfo.h&quot;
</span><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &lt;functional&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -49,8 +46,6 @@
</span><span class="cx"> class MediaStream;
</span><span class="cx"> class MediaTrackSupportedConstraints;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class MediaDevices : public ScriptWrappable, public RefCounted&lt;MediaDevices&gt;, public ContextDestructionObserver {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;MediaDevices&gt; create(ScriptExecutionContext*);
</span><span class="lines">@@ -61,8 +56,8 @@
</span><span class="cx">     typedef DOMPromise&lt;MediaStream&gt; Promise;
</span><span class="cx">     typedef DOMPromise&lt;MediaDeviceInfoVector&gt; EnumerateDevicesPromise;
</span><span class="cx"> 
</span><del>-    void getUserMedia(Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; audioConstraints, Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; videoConstraints, Promise&amp;&amp;, ExceptionCode&amp;) const;
-    void enumerateDevices(EnumerateDevicesPromise&amp;&amp;, ExceptionCode&amp;) const;
</del><ins>+    ExceptionOr&lt;void&gt; getUserMedia(Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; audioConstraints, Ref&lt;MediaConstraintsImpl&gt;&amp;&amp; videoConstraints, Promise&amp;&amp;) const;
+    ExceptionOr&lt;void&gt; enumerateDevices(EnumerateDevicesPromise&amp;&amp;) const;
</ins><span class="cx">     RefPtr&lt;MediaTrackSupportedConstraints&gt; getSupportedConstraints();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -72,5 +67,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MEDIA_STREAM)
</span><del>-
-#endif // MediaDevices_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -34,6 +34,6 @@
</span><span class="cx"> ] interface MediaDevices {
</span><span class="cx">     MediaTrackSupportedConstraints getSupportedConstraints();
</span><span class="cx"> 
</span><del>-    [Custom, PrivateIdentifier, PublicIdentifier] Promise getUserMedia(Dictionary options);
-    [MayThrowLegacyException] Promise enumerateDevices();
</del><ins>+    [Custom, MayThrowException, PrivateIdentifier, PublicIdentifier] Promise getUserMedia(Dictionary options);
+    [MayThrowException] Promise enumerateDevices();
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointSessionDescriptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionCode.h&quot;
</ins><span class="cx"> #include &quot;SDPProcessor.h&quot;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;RTCIceServer&gt; parseIceServer(const Dictionary&amp; iceServer, ExceptionCode&amp; ec)
</del><ins>+static ExceptionOr&lt;Ref&lt;RTCIceServer&gt;&gt; parseIceServer(const Dictionary&amp; iceServer)
</ins><span class="cx"> {
</span><span class="cx">     String credential, username;
</span><span class="cx">     iceServer.get(&quot;credential&quot;, credential);
</span><span class="lines">@@ -67,24 +67,17 @@
</span><span class="cx">     // So we convert to a string always, which converts a sequence to a string in the format: &quot;foo, bar, ..&quot;,
</span><span class="cx">     // then checking for a comma in the string assures that a string was a sequence and then we convert
</span><span class="cx">     // it to a sequence safely.
</span><del>-    if (urlString.isEmpty()) {
-        ec = INVALID_ACCESS_ERR;
-        return nullptr;
-    }
</del><ins>+    if (urlString.isEmpty())
+        return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (urlString.find(',') != notFound &amp;&amp; iceServer.get(&quot;urls&quot;, urlsList) &amp;&amp; urlsList.size()) {
</span><span class="cx">         for (auto iter = urlsList.begin(); iter != urlsList.end(); ++iter) {
</span><del>-            if (!validateIceServerURL(*iter)) {
-                ec = INVALID_ACCESS_ERR;
-                return nullptr;
-            }
</del><ins>+            if (!validateIceServerURL(*iter))
+                return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">         }
</span><span class="cx">     } else {
</span><del>-        if (!validateIceServerURL(urlString)) {
-            ec = INVALID_ACCESS_ERR;
-            return nullptr;
-        }
-
</del><ins>+        if (!validateIceServerURL(urlString))
+            return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">         urlsList.append(urlString);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -91,17 +84,17 @@
</span><span class="cx">     return RTCIceServer::create(urlsList, credential, username);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCConfiguration&gt; RTCConfiguration::create(const Dictionary&amp; configuration, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;RefPtr&lt;RTCConfiguration&gt;&gt; RTCConfiguration::create(const Dictionary&amp; configuration)
</ins><span class="cx"> {
</span><span class="cx">     if (configuration.isUndefinedOrNull())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RTCConfiguration&gt; rtcConfiguration = adoptRef(new RTCConfiguration());
-    rtcConfiguration-&gt;initialize(configuration, ec);
-    if (ec)
-        return nullptr;
</del><ins>+    auto result = adoptRef(*new RTCConfiguration);
+    auto initializeResult = result-&gt;initialize(configuration);
+    if (initializeResult.hasException())
+        return initializeResult.releaseException();
</ins><span class="cx"> 
</span><del>-    return rtcConfiguration;
</del><ins>+    return RefPtr&lt;RTCConfiguration&gt; { WTFMove(result) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RTCConfiguration::RTCConfiguration()
</span><span class="lines">@@ -108,35 +101,31 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCConfiguration::initialize(const Dictionary&amp; configuration, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCConfiguration::initialize(const Dictionary&amp; configuration)
</ins><span class="cx"> {
</span><span class="cx">     ArrayValue iceServers;
</span><span class="cx">     bool ok = configuration.get(&quot;iceServers&quot;, iceServers);
</span><del>-    if (!ok || iceServers.isUndefinedOrNull()) {
-        ec = TYPE_MISMATCH_ERR;
-        return;
-    }
</del><ins>+    if (!ok || iceServers.isUndefinedOrNull())
+        return Exception { TYPE_MISMATCH_ERR };
</ins><span class="cx"> 
</span><span class="cx">     size_t numberOfServers;
</span><span class="cx">     ok = iceServers.length(numberOfServers);
</span><del>-    if (!ok || !numberOfServers) {
-        ec = !ok ? TYPE_MISMATCH_ERR : INVALID_ACCESS_ERR;
-        return;
-    }
</del><ins>+    if (!ok)
+        return Exception { TYPE_MISMATCH_ERR };
+    if (!numberOfServers)
+        return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; numberOfServers; ++i) {
</span><span class="cx">         Dictionary iceServerDict;
</span><span class="cx">         ok = iceServers.get(i, iceServerDict);
</span><del>-        if (!ok) {
-            ec = TYPE_MISMATCH_ERR;
-            return;
-        }
</del><ins>+        if (!ok)
+            return Exception { TYPE_MISMATCH_ERR };
</ins><span class="cx"> 
</span><del>-        RefPtr&lt;RTCIceServer&gt; iceServer = parseIceServer(iceServerDict, ec);
-        if (!iceServer)
-            return;
</del><ins>+        auto server = parseIceServer(iceServerDict);
+        if (server.hasException())
+            return server.releaseException();
</ins><span class="cx"> 
</span><del>-        m_iceServers.append(WTFMove(iceServer));
</del><ins>+        m_iceServers.append(server.releaseReturnValue());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String iceTransportPolicy;
</span><span class="lines">@@ -145,10 +134,8 @@
</span><span class="cx">             m_iceTransportPolicy = IceTransportPolicy::Relay;
</span><span class="cx">         else if (iceTransportPolicy == &quot;all&quot;)
</span><span class="cx">             m_iceTransportPolicy = IceTransportPolicy::All;
</span><del>-        else {
-            ec = TypeError;
-            return;
-        }
</del><ins>+        else
+            return Exception { TypeError };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String bundlePolicy;
</span><span class="lines">@@ -160,8 +147,10 @@
</span><span class="cx">         else if (bundlePolicy == &quot;max-bundle&quot;)
</span><span class="cx">             m_bundlePolicy = BundlePolicy::MaxBundle;
</span><span class="cx">         else
</span><del>-            ec = TypeError;
</del><ins>+            return Exception { TypeError };
</ins><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="trunkSourceWebCoreModulesmediastreamRTCConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,28 +28,23 @@
</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 RTCConfiguration_h
-#define RTCConfiguration_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;PeerConnectionStates.h&quot;
</span><span class="cx"> #include &quot;RTCIceServer.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Dictionary;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><ins>+// FIXME: Why reference count this?
</ins><span class="cx"> class RTCConfiguration : public RefCounted&lt;RTCConfiguration&gt; {
</span><span class="cx"> public:
</span><del>-    static RefPtr&lt;RTCConfiguration&gt; create(const Dictionary&amp; configuration, ExceptionCode&amp;);
-    virtual ~RTCConfiguration() { }
</del><ins>+    static ExceptionOr&lt;RefPtr&lt;RTCConfiguration&gt;&gt; create(const Dictionary&amp; configuration);
</ins><span class="cx"> 
</span><span class="cx">     using IceTransportPolicy = PeerConnectionStates::IceTransportPolicy;
</span><span class="cx">     IceTransportPolicy iceTransportPolicy() const { return m_iceTransportPolicy; }
</span><span class="lines">@@ -62,7 +57,7 @@
</span><span class="cx"> private:
</span><span class="cx">     RTCConfiguration();
</span><span class="cx"> 
</span><del>-    void initialize(const Dictionary&amp; configuration, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; initialize(const Dictionary&amp; configuration);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;RefPtr&lt;RTCIceServer&gt;&gt; m_iceServers;
</span><span class="cx">     IceTransportPolicy m_iceTransportPolicy { IceTransportPolicy::All };
</span><span class="lines">@@ -72,5 +67,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // RTCConfiguration_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCConfigurationidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_RTC,
</span><ins>+    ImplementationLacksVTable,
</ins><span class="cx">     NoInterfaceObject,
</span><span class="cx"> ] interface RTCConfiguration {
</span><span class="cx">     readonly attribute sequence&lt;RTCIceServer&gt; iceServers;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDTMFSendercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -44,21 +44,19 @@
</span><span class="cx"> static const long minInterToneGapMs = 30;
</span><span class="cx"> static const long defaultInterToneGapMs = 70;
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCDTMFSender&gt; RTCDTMFSender::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp; track, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCDTMFSender&gt;&gt; RTCDTMFSender::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp; track)
</ins><span class="cx"> {
</span><del>-    std::unique_ptr&lt;RTCDTMFSenderHandler&gt; handler = peerConnectionHandler-&gt;createDTMFSender(&amp;track-&gt;source());
-    if (!handler) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
</del><ins>+    auto handler = peerConnectionHandler-&gt;createDTMFSender(&amp;track-&gt;source());
+    if (!handler)
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;RTCDTMFSender&gt; dtmfSender = adoptRef(new RTCDTMFSender(context, WTFMove(track), WTFMove(handler)));
-    dtmfSender-&gt;suspendIfNeeded();
-    return dtmfSender;
</del><ins>+    auto sender = adoptRef(*new RTCDTMFSender(*context, WTFMove(track), WTFMove(handler)));
+    sender-&gt;suspendIfNeeded();
+    return WTFMove(sender);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext* context, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp; track, std::unique_ptr&lt;RTCDTMFSenderHandler&gt; handler)
-    : ActiveDOMObject(context)
</del><ins>+RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext&amp; context, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp; track, std::unique_ptr&lt;RTCDTMFSenderHandler&gt; handler)
+    : ActiveDOMObject(&amp;context)
</ins><span class="cx">     , m_track(WTFMove(track))
</span><span class="cx">     , m_duration(defaultToneDurationMs)
</span><span class="cx">     , m_interToneGap(defaultInterToneGapMs)
</span><span class="lines">@@ -88,28 +86,24 @@
</span><span class="cx">     return m_handler-&gt;currentToneBuffer();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCDTMFSender::insertDTMF(const String&amp; tones, Optional&lt;int&gt; duration, Optional&lt;int&gt; interToneGap, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCDTMFSender::insertDTMF(const String&amp; tones, Optional&lt;int&gt; duration, Optional&lt;int&gt; interToneGap)
</ins><span class="cx"> {
</span><del>-    if (!canInsertDTMF()) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><ins>+    if (!canInsertDTMF())
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><del>-    if (duration &amp;&amp; (duration.value() &gt; maxToneDurationMs || duration.value() &lt; minToneDurationMs)) {
-        ec = SYNTAX_ERR;
-        return;
-    }
</del><ins>+    if (duration &amp;&amp; (duration.value() &gt; maxToneDurationMs || duration.value() &lt; minToneDurationMs))
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    if (interToneGap &amp;&amp; interToneGap.value() &lt; minInterToneGapMs) {
-        ec = SYNTAX_ERR;
-        return;
-    }
</del><ins>+    if (interToneGap &amp;&amp; interToneGap.value() &lt; minInterToneGapMs)
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><span class="cx">     m_duration = duration.valueOr(defaultToneDurationMs);
</span><span class="cx">     m_interToneGap = interToneGap.valueOr(defaultInterToneGapMs);
</span><span class="cx"> 
</span><span class="cx">     if (!m_handler-&gt;insertDTMF(tones, m_duration, m_interToneGap))
</span><del>-        ec = SYNTAX_ERR;
</del><ins>+        return Exception { SYNTAX_ERR };
+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RTCDTMFSender::didPlayTone(const String&amp; tone)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDTMFSenderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -23,17 +23,16 @@
</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 RTCDTMFSender_h
-#define RTCDTMFSender_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;RTCDTMFSenderHandlerClient.h&quot;
</span><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,10 +40,10 @@
</span><span class="cx"> class RTCPeerConnectionHandler;
</span><span class="cx"> class RTCDTMFSenderHandler;
</span><span class="cx"> 
</span><del>-class RTCDTMFSender final : public RefCounted&lt;RTCDTMFSender&gt;, public EventTargetWithInlineData, public RTCDTMFSenderHandlerClient, public ActiveDOMObject {
</del><ins>+class RTCDTMFSender final : public RefCounted&lt;RTCDTMFSender&gt;, public EventTargetWithInlineData, private RTCDTMFSenderHandlerClient, public ActiveDOMObject {
</ins><span class="cx"> public:
</span><del>-    static RefPtr&lt;RTCDTMFSender&gt; create(ScriptExecutionContext*, RTCPeerConnectionHandler*, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp;, ExceptionCode&amp;);
-    ~RTCDTMFSender();
</del><ins>+    static ExceptionOr&lt;Ref&lt;RTCDTMFSender&gt;&gt; create(ScriptExecutionContext*, RTCPeerConnectionHandler*, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp;);
+    virtual ~RTCDTMFSender();
</ins><span class="cx"> 
</span><span class="cx">     bool canInsertDTMF() const;
</span><span class="cx">     MediaStreamTrack* track() const;
</span><span class="lines">@@ -52,33 +51,29 @@
</span><span class="cx">     long duration() const { return m_duration; }
</span><span class="cx">     long interToneGap() const { return m_interToneGap; }
</span><span class="cx"> 
</span><del>-    void insertDTMF(const String&amp; tones, Optional&lt;int&gt; duration, Optional&lt;int&gt; interToneGap, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; insertDTMF(const String&amp; tones, Optional&lt;int&gt; duration, Optional&lt;int&gt; interToneGap);
</ins><span class="cx"> 
</span><del>-    // EventTarget
-    EventTargetInterface eventTargetInterface() const override { return RTCDTMFSenderEventTargetInterfaceType; }
-    ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
</del><ins>+    using RefCounted::ref;
+    using RefCounted::deref;
</ins><span class="cx"> 
</span><del>-    using RefCounted&lt;RTCDTMFSender&gt;::ref;
-    using RefCounted&lt;RTCDTMFSender&gt;::deref;
-
</del><span class="cx"> private:
</span><del>-    RTCDTMFSender(ScriptExecutionContext*, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp;, std::unique_ptr&lt;RTCDTMFSenderHandler&gt;);
</del><ins>+    RTCDTMFSender(ScriptExecutionContext&amp;, RefPtr&lt;MediaStreamTrack&gt;&amp;&amp;, std::unique_ptr&lt;RTCDTMFSenderHandler&gt;);
</ins><span class="cx"> 
</span><del>-    // ActiveDOMObject
-    void stop() override;
-    const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
</del><ins>+    void stop() final;
+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
</ins><span class="cx"> 
</span><ins>+    EventTargetInterface eventTargetInterface() const final { return RTCDTMFSenderEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
+
+    void refEventTarget() final { ref(); }
+    void derefEventTarget() final { deref(); }
+
+    void didPlayTone(const String&amp;) final;
+
</ins><span class="cx">     void scheduleDispatchEvent(Ref&lt;Event&gt;&amp;&amp;);
</span><span class="cx">     void scheduledEventTimerFired();
</span><span class="cx"> 
</span><del>-    // EventTarget
-    void refEventTarget() override { ref(); }
-    void derefEventTarget() override { deref(); }
-
-    // RTCDTMFSenderHandlerClient
-    void didPlayTone(const String&amp;) override;
-
</del><span class="cx">     RefPtr&lt;MediaStreamTrack&gt; m_track;
</span><span class="cx">     long m_duration;
</span><span class="cx">     long m_interToneGap;
</span><span class="lines">@@ -94,5 +89,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // RTCDTMFSender_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDTMFSenderidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -24,9 +24,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><ins>+    ActiveDOMObject,
+    Conditional=WEB_RTC,
</ins><span class="cx">     NoInterfaceObject,
</span><del>-    Conditional=WEB_RTC,
-    ActiveDOMObject,
</del><span class="cx"> ] interface RTCDTMFSender : EventTarget {
</span><span class="cx">     readonly attribute boolean canInsertDTMF;
</span><span class="cx">     readonly attribute MediaStreamTrack track;
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">     readonly attribute long duration;
</span><span class="cx">     readonly attribute long interToneGap;
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void insertDTMF(DOMString tones, optional long duration, optional long interToneGap);
</del><ins>+    [MayThrowException] void insertDTMF(DOMString tones, optional long duration, optional long interToneGap);
</ins><span class="cx"> 
</span><span class="cx">     attribute EventHandler ontonechange;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDataChannelcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     return arraybuffer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCDataChannel&gt; RTCDataChannel::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, const String&amp; label, const Dictionary&amp; options, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCDataChannel&gt;&gt; RTCDataChannel::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, const String&amp; label, const Dictionary&amp; options)
</ins><span class="cx"> {
</span><span class="cx">     RTCDataChannelInit initData;
</span><span class="cx">     String maxRetransmitsStr;
</span><span class="lines">@@ -71,31 +71,25 @@
</span><span class="cx">     bool maxRetransmitTimeConversion;
</span><span class="cx">     initData.maxRetransmits = maxRetransmitsStr.toUIntStrict(&amp;maxRetransmitsConversion);
</span><span class="cx">     initData.maxRetransmitTime = maxRetransmitTimeStr.toUIntStrict(&amp;maxRetransmitTimeConversion);
</span><del>-    if (maxRetransmitsConversion &amp;&amp; maxRetransmitTimeConversion) {
-        ec = SYNTAX_ERR;
-        return nullptr;
-    }
</del><ins>+    if (maxRetransmitsConversion &amp;&amp; maxRetransmitTimeConversion)
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    std::unique_ptr&lt;RTCDataChannelHandler&gt; handler = peerConnectionHandler-&gt;createDataChannel(label, initData);
-    if (!handler) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
-    return adoptRef(*new RTCDataChannel(context, WTFMove(handler)));
</del><ins>+    auto handler = peerConnectionHandler-&gt;createDataChannel(label, initData);
+    if (!handler)
+        return Exception { NOT_SUPPORTED_ERR };
+
+    return adoptRef(*new RTCDataChannel(*context, WTFMove(handler)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;RTCDataChannel&gt; RTCDataChannel::create(ScriptExecutionContext* context, std::unique_ptr&lt;RTCDataChannelHandler&gt; handler)
</del><ins>+Ref&lt;RTCDataChannel&gt; RTCDataChannel::create(ScriptExecutionContext* context, std::unique_ptr&lt;RTCDataChannelHandler&gt;&amp;&amp; handler)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(handler);
</span><del>-    return adoptRef(*new RTCDataChannel(context, WTFMove(handler)));
</del><ins>+    return adoptRef(*new RTCDataChannel(*context, WTFMove(handler)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RTCDataChannel::RTCDataChannel(ScriptExecutionContext* context, std::unique_ptr&lt;RTCDataChannelHandler&gt; handler)
-    : m_scriptExecutionContext(context)
</del><ins>+RTCDataChannel::RTCDataChannel(ScriptExecutionContext&amp; context, std::unique_ptr&lt;RTCDataChannelHandler&gt;&amp;&amp; handler)
+    : m_scriptExecutionContext(&amp;context)
</ins><span class="cx">     , m_handler(WTFMove(handler))
</span><del>-    , m_stopped(false)
-    , m_readyState(ReadyStateConnecting)
-    , m_binaryType(BinaryTypeArrayBuffer)
</del><span class="cx">     , m_scheduledEventTimer(*this, &amp;RTCDataChannel::scheduledEventTimerFired)
</span><span class="cx"> {
</span><span class="cx">     m_handler-&gt;setClient(this);
</span><span class="lines">@@ -122,7 +116,7 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned short RTCDataChannel::maxRetransmits() const
</span><span class="cx"> {
</span><del>-return m_handler-&gt;maxRetransmits();
</del><ins>+    return m_handler-&gt;maxRetransmits();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String RTCDataChannel::protocol() const
</span><span class="lines">@@ -140,13 +134,13 @@
</span><span class="cx">     return m_handler-&gt;id();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AtomicString RTCDataChannel::readyState() const
</del><ins>+const AtomicString&amp; RTCDataChannel::readyState() const
</ins><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;AtomicString&gt; connectingState(&quot;connecting&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">     static NeverDestroyed&lt;AtomicString&gt; openState(&quot;open&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">     static NeverDestroyed&lt;AtomicString&gt; closingState(&quot;closing&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">     static NeverDestroyed&lt;AtomicString&gt; closedState(&quot;closed&quot;, AtomicString::ConstructFromLiteral);
</span><del>-    
</del><ins>+
</ins><span class="cx">     switch (m_readyState) {
</span><span class="cx">     case ReadyStateConnecting:
</span><span class="cx">         return connectingState;
</span><span class="lines">@@ -162,17 +156,17 @@
</span><span class="cx">     return emptyAtom;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned long RTCDataChannel::bufferedAmount() const
</del><ins>+unsigned RTCDataChannel::bufferedAmount() const
</ins><span class="cx"> {
</span><span class="cx">     return m_handler-&gt;bufferedAmount();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AtomicString RTCDataChannel::binaryType() const
</del><ins>+const AtomicString&amp; RTCDataChannel::binaryType() const
</ins><span class="cx"> {
</span><span class="cx">     switch (m_binaryType) {
</span><del>-    case BinaryTypeBlob:
</del><ins>+    case BinaryType::Blob:
</ins><span class="cx">         return blobKeyword();
</span><del>-    case BinaryTypeArrayBuffer:
</del><ins>+    case BinaryType::ArrayBuffer:
</ins><span class="cx">         return arraybufferKeyword();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -180,57 +174,58 @@
</span><span class="cx">     return emptyAtom;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCDataChannel::setBinaryType(const AtomicString&amp; binaryType, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCDataChannel::setBinaryType(const AtomicString&amp; binaryType)
</ins><span class="cx"> {
</span><span class="cx">     if (binaryType == blobKeyword())
</span><del>-        ec = NOT_SUPPORTED_ERR;
-    else if (binaryType == arraybufferKeyword())
-        m_binaryType = BinaryTypeArrayBuffer;
-    else
-        ec = TYPE_MISMATCH_ERR;
</del><ins>+        return Exception { NOT_SUPPORTED_ERR };
+    if (binaryType == arraybufferKeyword()) {
+        m_binaryType = BinaryType::ArrayBuffer;
+        return { };
+    }
+    return Exception { TYPE_MISMATCH_ERR };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCDataChannel::send(const String&amp; data, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCDataChannel::send(const String&amp; data)
</ins><span class="cx"> {
</span><del>-    if (m_readyState != ReadyStateOpen) {
-        ec = INVALID_STATE_ERR;
-        return;
-    }
</del><ins>+    if (m_readyState != ReadyStateOpen)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (!m_handler-&gt;sendStringData(data)) {
</span><span class="cx">         // FIXME: Decide what the right exception here is.
</span><del>-        ec = SYNTAX_ERR;
</del><ins>+        return Exception { SYNTAX_ERR };
</ins><span class="cx">     }
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCDataChannel::send(ArrayBuffer&amp; data, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCDataChannel::send(ArrayBuffer&amp; data)
</ins><span class="cx"> {
</span><del>-    if (m_readyState != ReadyStateOpen) {
-        ec = INVALID_STATE_ERR;
-        return;
-    }
</del><ins>+    if (m_readyState != ReadyStateOpen)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     size_t dataLength = data.byteLength();
</span><span class="cx">     if (!dataLength)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     const char* dataPointer = static_cast&lt;const char*&gt;(data.data());
</span><span class="cx"> 
</span><span class="cx">     if (!m_handler-&gt;sendRawData(dataPointer, dataLength)) {
</span><span class="cx">         // FIXME: Decide what the right exception here is.
</span><del>-        ec = SYNTAX_ERR;
</del><ins>+        return Exception { SYNTAX_ERR };
</ins><span class="cx">     }
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCDataChannel::send(ArrayBufferView&amp; data, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCDataChannel::send(ArrayBufferView&amp; data)
</ins><span class="cx"> {
</span><del>-    send(*data.buffer(), ec);
</del><ins>+    return send(*data.buffer());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCDataChannel::send(Blob&amp;, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCDataChannel::send(Blob&amp;)
</ins><span class="cx"> {
</span><del>-    // FIXME: implement
-    ec = NOT_SUPPORTED_ERR;
</del><ins>+    // FIXME: Implement.
+    return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RTCDataChannel::close()
</span><span class="lines">@@ -273,12 +268,12 @@
</span><span class="cx">     if (m_stopped)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_binaryType == BinaryTypeBlob) {
</del><ins>+    if (m_binaryType == BinaryType::Blob) {
</ins><span class="cx">         // FIXME: Implement.
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_binaryType == BinaryTypeArrayBuffer) {
</del><ins>+    if (m_binaryType == BinaryType::ArrayBuffer) {
</ins><span class="cx">         scheduleDispatchEvent(MessageEvent::create(ArrayBuffer::create(data, dataLength)));
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDataChannelh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -22,16 +22,15 @@
</span><span class="cx">  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef RTCDataChannel_h
-#define RTCDataChannel_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</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;RTCDataChannelHandlerClient.h&quot;
</span><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx">     class ArrayBuffer;
</span><span class="lines">@@ -47,8 +46,8 @@
</span><span class="cx"> 
</span><span class="cx"> class RTCDataChannel final : public RefCounted&lt;RTCDataChannel&gt;, public EventTargetWithInlineData, public RTCDataChannelHandlerClient {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;RTCDataChannel&gt; create(ScriptExecutionContext*, std::unique_ptr&lt;RTCDataChannelHandler&gt;);
-    static RefPtr&lt;RTCDataChannel&gt; create(ScriptExecutionContext*, RTCPeerConnectionHandler*, const String&amp; label, const Dictionary&amp; options, ExceptionCode&amp;);
</del><ins>+    static Ref&lt;RTCDataChannel&gt; create(ScriptExecutionContext*, std::unique_ptr&lt;RTCDataChannelHandler&gt;&amp;&amp;);
+    static ExceptionOr&lt;Ref&lt;RTCDataChannel&gt;&gt; create(ScriptExecutionContext*, RTCPeerConnectionHandler*, const String&amp; label, const Dictionary&amp; options);
</ins><span class="cx">     ~RTCDataChannel();
</span><span class="cx"> 
</span><span class="cx">     String label() const;
</span><span class="lines">@@ -58,57 +57,52 @@
</span><span class="cx">     String protocol() const;
</span><span class="cx">     bool negotiated() const;
</span><span class="cx">     unsigned short id() const;
</span><del>-    AtomicString readyState() const;
-    unsigned long bufferedAmount() const;
</del><ins>+    const AtomicString&amp; readyState() const;
+    unsigned bufferedAmount() const;
</ins><span class="cx"> 
</span><del>-    AtomicString binaryType() const;
-    void setBinaryType(const AtomicString&amp;, ExceptionCode&amp;);
</del><ins>+    const AtomicString&amp; binaryType() const;
+    ExceptionOr&lt;void&gt; setBinaryType(const AtomicString&amp;);
</ins><span class="cx"> 
</span><del>-    void send(const String&amp;, ExceptionCode&amp;);
-    void send(JSC::ArrayBuffer&amp;, ExceptionCode&amp;);
-    void send(JSC::ArrayBufferView&amp;, ExceptionCode&amp;);
-    void send(Blob&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; send(const String&amp;);
+    ExceptionOr&lt;void&gt; send(JSC::ArrayBuffer&amp;);
+    ExceptionOr&lt;void&gt; send(JSC::ArrayBufferView&amp;);
+    ExceptionOr&lt;void&gt; send(Blob&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void close();
</span><span class="cx"> 
</span><span class="cx">     void stop();
</span><span class="cx"> 
</span><del>-    // EventTarget
-    EventTargetInterface eventTargetInterface() const override { return RTCDataChannelEventTargetInterfaceType; }
-    ScriptExecutionContext* scriptExecutionContext() const override { return m_scriptExecutionContext; }
</del><ins>+    using RefCounted::ref;
+    using RefCounted::deref;
</ins><span class="cx"> 
</span><del>-    using RefCounted&lt;RTCDataChannel&gt;::ref;
-    using RefCounted&lt;RTCDataChannel&gt;::deref;
-
</del><span class="cx"> private:
</span><del>-    RTCDataChannel(ScriptExecutionContext*, std::unique_ptr&lt;RTCDataChannelHandler&gt;);
</del><ins>+    RTCDataChannel(ScriptExecutionContext&amp;, std::unique_ptr&lt;RTCDataChannelHandler&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void scheduleDispatchEvent(Ref&lt;Event&gt;&amp;&amp;);
</span><span class="cx">     void scheduledEventTimerFired();
</span><span class="cx"> 
</span><del>-    // EventTarget
-    void refEventTarget() override { ref(); }
-    void derefEventTarget() override { deref(); }
</del><ins>+    EventTargetInterface eventTargetInterface() const final { return RTCDataChannelEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const final { return m_scriptExecutionContext; }
</ins><span class="cx"> 
</span><ins>+    void refEventTarget() final { ref(); }
+    void derefEventTarget() final { deref(); }
+
</ins><span class="cx">     ScriptExecutionContext* m_scriptExecutionContext;
</span><span class="cx"> 
</span><del>-    // RTCDataChannelHandlerClient
-    void didChangeReadyState(ReadyState) override;
-    void didReceiveStringData(const String&amp;) override;
-    void didReceiveRawData(const char*, size_t) override;
-    void didDetectError() override;
</del><ins>+    void didChangeReadyState(ReadyState) final;
+    void didReceiveStringData(const String&amp;) final;
+    void didReceiveRawData(const char*, size_t) final;
+    void didDetectError() final;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;RTCDataChannelHandler&gt; m_handler;
</span><span class="cx"> 
</span><del>-    bool m_stopped;
</del><ins>+    bool m_stopped { false };
</ins><span class="cx"> 
</span><del>-    ReadyState m_readyState;
-    enum BinaryType {
-        BinaryTypeBlob,
-        BinaryTypeArrayBuffer
-    };
-    BinaryType m_binaryType;
</del><ins>+    ReadyState m_readyState { ReadyStateConnecting };
</ins><span class="cx"> 
</span><ins>+    enum class BinaryType { Blob, ArrayBuffer };
+    BinaryType m_binaryType { BinaryType::ArrayBuffer };
+
</ins><span class="cx">     Timer m_scheduledEventTimer;
</span><span class="cx">     Vector&lt;Ref&lt;Event&gt;&gt; m_scheduledEvents;
</span><span class="cx"> };
</span><span class="lines">@@ -116,5 +110,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // RTCDataChannel_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDataChannelidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -36,12 +36,12 @@
</span><span class="cx">     readonly attribute DOMString readyState;
</span><span class="cx">     readonly attribute unsigned long bufferedAmount;
</span><span class="cx"> 
</span><del>-    [SetterMayThrowLegacyException] attribute DOMString binaryType;
</del><ins>+    [SetterMayThrowException] attribute DOMString binaryType;
</ins><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void send(ArrayBuffer data);
-    [MayThrowLegacyException] void send(ArrayBufferView data);
-    [MayThrowLegacyException] void send(Blob data);
-    [MayThrowLegacyException] void send(DOMString data);
</del><ins>+    [MayThrowException] void send(ArrayBuffer data);
+    [MayThrowException] void send(ArrayBufferView data);
+    [MayThrowException] void send(Blob data);
+    [MayThrowException] void send(DOMString data);
</ins><span class="cx"> 
</span><span class="cx">     void close();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCIceCandidatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -41,13 +41,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCIceCandidate&gt; RTCIceCandidate::create(const Dictionary&amp; dictionary, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCIceCandidate&gt;&gt; RTCIceCandidate::create(const Dictionary&amp; dictionary)
</ins><span class="cx"> {
</span><span class="cx">     String candidate;
</span><del>-    if (!dictionary.get(&quot;candidate&quot;, candidate)) {
-        ec = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (!dictionary.get(&quot;candidate&quot;, candidate))
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><span class="cx">     String sdpMid;
</span><span class="cx">     dictionary.getWithUndefinedOrNullCheck(&quot;sdpMid&quot;, sdpMid);
</span><span class="lines">@@ -58,19 +56,15 @@
</span><span class="cx">     if (dictionary.getWithUndefinedOrNullCheck(&quot;sdpMLineIndex&quot;, sdpMLineIndexString)) {
</span><span class="cx">         bool intConversionOk;
</span><span class="cx">         unsigned result = sdpMLineIndexString.toUIntStrict(&amp;intConversionOk);
</span><del>-        if (!intConversionOk || result &gt; USHRT_MAX) {
-            ec = TypeError;
-            return nullptr;
-        }
</del><ins>+        if (!intConversionOk || result &gt; USHRT_MAX)
+            return Exception { TypeError };
</ins><span class="cx">         sdpMLineIndex = result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (sdpMid.isNull() &amp;&amp; !sdpMLineIndex) {
-        ec = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (sdpMid.isNull() &amp;&amp; !sdpMLineIndex)
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><del>-    return adoptRef(new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex));
</del><ins>+    return adoptRef(*new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;RTCIceCandidate&gt; RTCIceCandidate::create(const String&amp; candidate, const String&amp; sdpMid, Optional&lt;unsigned short&gt; sdpMLineIndex)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCIceCandidateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,17 +28,13 @@
</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 RTCIceCandidate_h
-#define RTCIceCandidate_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><del>-#include &quot;ExceptionBase.h&quot;
</del><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -47,9 +43,8 @@
</span><span class="cx"> 
</span><span class="cx"> class RTCIceCandidate : public RefCounted&lt;RTCIceCandidate&gt;, public ScriptWrappable {
</span><span class="cx"> public:
</span><del>-    static RefPtr&lt;RTCIceCandidate&gt; create(const Dictionary&amp;, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;RTCIceCandidate&gt;&gt; create(const Dictionary&amp;);
</ins><span class="cx">     static Ref&lt;RTCIceCandidate&gt; create(const String&amp; candidate, const String&amp; sdpMid, Optional&lt;unsigned short&gt; sdpMLineIndex);
</span><del>-    virtual ~RTCIceCandidate() { }
</del><span class="cx"> 
</span><span class="cx">     const String&amp; candidate() const { return m_candidate; }
</span><span class="cx">     const String&amp; sdpMid() const { return m_sdpMid; }
</span><span class="lines">@@ -66,5 +61,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // RTCIceCandidate_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCIceCandidateidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -32,7 +32,8 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_RTC,
</span><span class="cx">     Constructor(Dictionary dictionary),
</span><del>-    ConstructorMayThrowLegacyException,
</del><ins>+    ConstructorMayThrowException,
+    ImplementationLacksVTable,
</ins><span class="cx">     PrivateIdentifier,
</span><span class="cx">     PublicIdentifier
</span><span class="cx"> ] interface RTCIceCandidate {
</span><span class="lines">@@ -42,4 +43,3 @@
</span><span class="cx"> 
</span><span class="cx">     serializer = {candidate, sdpMid, sdpMLineIndex};
</span><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -33,11 +33,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RTCOfferAnswerOptions::RTCOfferAnswerOptions()
-    : m_voiceActivityDetection(true)
-{
-}
-
</del><span class="cx"> bool RTCOfferAnswerOptions::initialize(const Dictionary&amp; options)
</span><span class="cx"> {
</span><span class="cx">     bool voiceActivityDetection;
</span><span class="lines">@@ -47,26 +42,17 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCOfferOptions&gt; RTCOfferOptions::create(const Dictionary&amp; options, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCOfferOptions&gt;&gt; RTCOfferOptions::create(const Dictionary&amp; options)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;RTCOfferOptions&gt; offerOptions = adoptRef(new RTCOfferOptions());
-    if (!offerOptions-&gt;initialize(options)) {
</del><ins>+    auto result = adoptRef(*new RTCOfferOptions);
+    if (!result-&gt;initialize(options)) {
</ins><span class="cx">         // FIXME: https://webkit.org/b/129800
</span><span class="cx">         // According to the spec, the error is going to be defined yet, so let's use TYPE_MISMATCH_ERR for now.
</span><del>-        ec = TYPE_MISMATCH_ERR;
-        return nullptr;
</del><ins>+        return Exception { TYPE_MISMATCH_ERR };
</ins><span class="cx">     }
</span><del>-
-    return offerOptions;
</del><ins>+    return WTFMove(result);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RTCOfferOptions::RTCOfferOptions()
-    : m_offerToReceiveVideo(0)
-    , m_offerToReceiveAudio(0)
-    , m_iceRestart(false)
-{
-}
-
</del><span class="cx"> bool RTCOfferOptions::initialize(const Dictionary&amp; options)
</span><span class="cx"> {
</span><span class="cx">     if (options.isUndefinedOrNull())
</span><span class="lines">@@ -99,17 +85,15 @@
</span><span class="cx">     return RTCOfferAnswerOptions::initialize(options);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCAnswerOptions&gt; RTCAnswerOptions::create(const Dictionary&amp; options, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCAnswerOptions&gt;&gt; RTCAnswerOptions::create(const Dictionary&amp; options)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;RTCAnswerOptions&gt; offerOptions = adoptRef(new RTCAnswerOptions());
-    if (!offerOptions-&gt;initialize(options)) {
</del><ins>+    auto result = adoptRef(*new RTCAnswerOptions);
+    if (!result-&gt;initialize(options)) {
</ins><span class="cx">         // FIXME: https://webkit.org/b/129800
</span><span class="cx">         // According to the spec, the error is going to be defined yet, so let's use TYPE_MISMATCH_ERR for now.
</span><del>-        ec = TYPE_MISMATCH_ERR;
-        return nullptr;
</del><ins>+        return Exception { TYPE_MISMATCH_ERR };
</ins><span class="cx">     }
</span><del>-
-    return offerOptions;
</del><ins>+    return WTFMove(result);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RTCAnswerOptions::initialize(const Dictionary&amp; options)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -24,8 +24,7 @@
</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 RTCOfferAnswerOptions_h
-#define RTCOfferAnswerOptions_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><span class="lines">@@ -38,22 +37,22 @@
</span><span class="cx"> 
</span><span class="cx"> class Dictionary;
</span><span class="cx"> 
</span><del>-class RTCOfferAnswerOptions : public RefCounted&lt;RTCOfferAnswerOptions&gt; {
</del><ins>+class RTCOfferAnswerOptions {
</ins><span class="cx"> public:
</span><del>-    virtual ~RTCOfferAnswerOptions() { }
-
</del><span class="cx">     bool voiceActivityDetection() const { return m_voiceActivityDetection; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    virtual bool initialize(const Dictionary&amp;);
-    RTCOfferAnswerOptions();
</del><ins>+    RTCOfferAnswerOptions() = default;
+    bool initialize(const Dictionary&amp;);
</ins><span class="cx"> 
</span><del>-    bool m_voiceActivityDetection;
</del><ins>+private:
+    bool m_voiceActivityDetection { true };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-class RTCOfferOptions : public RTCOfferAnswerOptions {
</del><ins>+// FIXME: Why is this reference counted?
+class RTCOfferOptions : public RefCounted&lt;RTCOfferOptions&gt;, public RTCOfferAnswerOptions {
</ins><span class="cx"> public:
</span><del>-    static RefPtr&lt;RTCOfferOptions&gt; create(const Dictionary&amp;, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;RTCOfferOptions&gt;&gt; create(const Dictionary&amp;);
</ins><span class="cx"> 
</span><span class="cx">     int64_t offerToReceiveVideo() const { return m_offerToReceiveVideo; }
</span><span class="cx">     int64_t offerToReceiveAudio() const { return m_offerToReceiveAudio; }
</span><span class="lines">@@ -60,25 +59,24 @@
</span><span class="cx">     bool iceRestart() const { return m_iceRestart; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    bool initialize(const Dictionary&amp;) override;
-    RTCOfferOptions();
</del><ins>+    RTCOfferOptions() = default;
+    bool initialize(const Dictionary&amp;);
</ins><span class="cx"> 
</span><del>-    int64_t m_offerToReceiveVideo;
-    int64_t m_offerToReceiveAudio;
-    bool m_iceRestart;
</del><ins>+    int64_t m_offerToReceiveVideo { 0 };
+    int64_t m_offerToReceiveAudio { 0 };
+    bool m_iceRestart { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-class RTCAnswerOptions : public RTCOfferAnswerOptions {
</del><ins>+// FIXME: Why is this reference counted?
+class RTCAnswerOptions : public RefCounted&lt;RTCAnswerOptions&gt;, public RTCOfferAnswerOptions {
</ins><span class="cx"> public:
</span><del>-    static RefPtr&lt;RTCAnswerOptions&gt; create(const Dictionary&amp;, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;RTCAnswerOptions&gt;&gt; create(const Dictionary&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    bool initialize(const Dictionary&amp;) override;
-    RTCAnswerOptions() { }
</del><ins>+    RTCAnswerOptions() = default;
+    bool initialize(const Dictionary&amp;);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // RTCOfferAnswerOptions_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -78,39 +78,29 @@
</span><span class="cx">     stop();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCPeerConnection::initializeWith(Document&amp; document, const Dictionary&amp; rtcConfiguration, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCPeerConnection::initializeWith(Document&amp; document, const Dictionary&amp; rtcConfiguration)
</ins><span class="cx"> {
</span><del>-    if (!document.frame()) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><ins>+    if (!document.frame())
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><del>-    if (!m_backend) {
-        ec = NOT_SUPPORTED_ERR;
-        return;
-    }
</del><ins>+    if (!m_backend)
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><del>-    setConfiguration(rtcConfiguration, ec);
</del><ins>+    return setConfiguration(rtcConfiguration);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCRtpSender&gt; RTCPeerConnection::addTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp; track, const Vector&lt;std::reference_wrapper&lt;MediaStream&gt;&gt;&amp; streams, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCRtpSender&gt;&gt; RTCPeerConnection::addTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp; track, const Vector&lt;std::reference_wrapper&lt;MediaStream&gt;&gt;&amp; streams)
</ins><span class="cx"> {
</span><del>-    if (m_signalingState == SignalingState::Closed) {
-        ec = INVALID_STATE_ERR;
-        return nullptr;
-    }
</del><ins>+    if (m_signalingState == SignalingState::Closed)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     // Require at least one stream until https://github.com/w3c/webrtc-pc/issues/288 is resolved
</span><del>-    if (!streams.size()) {
-        ec = NOT_SUPPORTED_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!streams.size())
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><span class="cx">     for (auto&amp; sender : m_transceiverSet-&gt;getSenders()) {
</span><del>-        if (sender-&gt;trackId() == track-&gt;id()) {
-            ec = INVALID_ACCESS_ERR;
-            return nullptr;
-        }
</del><ins>+        if (sender-&gt;trackId() == track-&gt;id())
+            return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; mediaStreamIds;
</span><span class="lines">@@ -150,30 +140,27 @@
</span><span class="cx"> 
</span><span class="cx">     m_backend-&gt;markAsNeedingNegotiation();
</span><span class="cx"> 
</span><del>-    return sender;
</del><ins>+    return Ref&lt;RTCRtpSender&gt; { *sender };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCPeerConnection::removeTrack(RTCRtpSender&amp; sender, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCPeerConnection::removeTrack(RTCRtpSender&amp; sender)
</ins><span class="cx"> {
</span><del>-    if (m_signalingState == SignalingState::Closed) {
-        ec = INVALID_STATE_ERR;
-        return;
-    }
</del><ins>+    if (m_signalingState == SignalingState::Closed)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (!m_transceiverSet-&gt;getSenders().contains(&amp;sender))
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     sender.stop();
</span><span class="cx"> 
</span><span class="cx">     m_backend-&gt;markAsNeedingNegotiation();
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCRtpTransceiver&gt; RTCPeerConnection::addTransceiver(Ref&lt;MediaStreamTrack&gt;&amp;&amp; track, const RtpTransceiverInit&amp; init, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCRtpTransceiver&gt;&gt; RTCPeerConnection::addTransceiver(Ref&lt;MediaStreamTrack&gt;&amp;&amp; track, const RtpTransceiverInit&amp; init)
</ins><span class="cx"> {
</span><del>-    if (m_signalingState == SignalingState::Closed) {
-        ec = INVALID_STATE_ERR;
-        return nullptr;
-    }
</del><ins>+    if (m_signalingState == SignalingState::Closed)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     String transceiverMid = RTCRtpTransceiver::getNextMid();
</span><span class="cx">     const String&amp; trackKind = track-&gt;kind();
</span><span class="lines">@@ -184,20 +171,17 @@
</span><span class="cx">     auto transceiver = RTCRtpTransceiver::create(WTFMove(sender), WTFMove(receiver));
</span><span class="cx">     transceiver-&gt;setProvisionalMid(transceiverMid);
</span><span class="cx"> 
</span><del>-    return completeAddTransceiver(WTFMove(transceiver), init);
</del><ins>+    completeAddTransceiver(transceiver, init);
+    return WTFMove(transceiver);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCRtpTransceiver&gt; RTCPeerConnection::addTransceiver(const String&amp; kind, const RtpTransceiverInit&amp; init, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCRtpTransceiver&gt;&gt; RTCPeerConnection::addTransceiver(const String&amp; kind, const RtpTransceiverInit&amp; init)
</ins><span class="cx"> {
</span><del>-    if (m_signalingState == SignalingState::Closed) {
-        ec = INVALID_STATE_ERR;
-        return nullptr;
-    }
</del><ins>+    if (m_signalingState == SignalingState::Closed)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><del>-    if (kind != &quot;audio&quot; &amp;&amp; kind != &quot;video&quot;) {
-        ec = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (kind != &quot;audio&quot; &amp;&amp; kind != &quot;video&quot;)
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><span class="cx">     String transceiverMid = RTCRtpTransceiver::getNextMid();
</span><span class="cx">     String trackId = createCanonicalUUIDString();
</span><span class="lines">@@ -207,17 +191,16 @@
</span><span class="cx">     auto transceiver = RTCRtpTransceiver::create(WTFMove(sender), WTFMove(receiver));
</span><span class="cx">     transceiver-&gt;setProvisionalMid(transceiverMid);
</span><span class="cx"> 
</span><del>-    return completeAddTransceiver(WTFMove(transceiver), init);
</del><ins>+    completeAddTransceiver(transceiver, init);
+    return WTFMove(transceiver);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCRtpTransceiver&gt; RTCPeerConnection::completeAddTransceiver(Ref&lt;RTCRtpTransceiver&gt;&amp;&amp; transceiver, const RtpTransceiverInit&amp; init)
</del><ins>+void RTCPeerConnection::completeAddTransceiver(RTCRtpTransceiver&amp; transceiver, const RtpTransceiverInit&amp; init)
</ins><span class="cx"> {
</span><del>-    transceiver-&gt;setDirection(static_cast&lt;RTCRtpTransceiver::Direction&gt;(init.direction));
</del><ins>+    transceiver.setDirection(static_cast&lt;RTCRtpTransceiver::Direction&gt;(init.direction));
</ins><span class="cx"> 
</span><del>-    m_transceiverSet-&gt;append(transceiver.copyRef());
</del><ins>+    m_transceiverSet-&gt;append(&amp;transceiver);
</ins><span class="cx">     m_backend-&gt;markAsNeedingNegotiation();
</span><del>-
-    return WTFMove(transceiver);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RTCPeerConnection::queuedCreateOffer(const Dictionary&amp; offerOptions, SessionDescriptionPromise&amp;&amp; promise)
</span><span class="lines">@@ -227,15 +210,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    RefPtr&lt;RTCOfferOptions&gt; options = RTCOfferOptions::create(offerOptions, ec);
-    if (ec) {
</del><ins>+    auto options = RTCOfferOptions::create(offerOptions);
+    if (options.hasException()) {
</ins><span class="cx">         promise.reject(OperationError, &quot;Invalid createOffer argument&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    ASSERT(options);
</del><span class="cx"> 
</span><del>-    m_backend-&gt;createOffer(*options, WTFMove(promise));
</del><ins>+    m_backend-&gt;createOffer(options.releaseReturnValue(), WTFMove(promise));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RTCPeerConnection::queuedCreateAnswer(const Dictionary&amp; answerOptions, SessionDescriptionPromise&amp;&amp; promise)
</span><span class="lines">@@ -245,14 +226,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    RefPtr&lt;RTCAnswerOptions&gt; options = RTCAnswerOptions::create(answerOptions, ec);
-    if (ec) {
</del><ins>+    auto options = RTCAnswerOptions::create(answerOptions);
+    if (options.hasException()) {
</ins><span class="cx">         promise.reject(OperationError, &quot;Invalid createAnswer argument&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_backend-&gt;createAnswer(*options, WTFMove(promise));
</del><ins>+    m_backend-&gt;createAnswer(options.releaseReturnValue(), WTFMove(promise));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RTCPeerConnection::queuedSetLocalDescription(RTCSessionDescription&amp; description, PeerConnection::VoidPromise&amp;&amp; promise)
</span><span class="lines">@@ -379,24 +359,21 @@
</span><span class="cx">     return m_configuration.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCPeerConnection::setConfiguration(const Dictionary&amp; configuration, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCPeerConnection::setConfiguration(const Dictionary&amp; configuration)
</ins><span class="cx"> {
</span><del>-    if (configuration.isUndefinedOrNull()) {
-        ec = TypeError;
-        return;
-    }
</del><ins>+    if (configuration.isUndefinedOrNull())
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><del>-    if (m_signalingState == SignalingState::Closed) {
-        ec = INVALID_STATE_ERR;
-        return;
-    }
</del><ins>+    if (m_signalingState == SignalingState::Closed)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;RTCConfiguration&gt; newConfiguration = RTCConfiguration::create(configuration, ec);
-    if (ec)
-        return;
</del><ins>+    auto newConfiguration = RTCConfiguration::create(configuration);
+    if (newConfiguration.hasException())
+        return newConfiguration.releaseException();
</ins><span class="cx"> 
</span><del>-    m_configuration = WTFMove(newConfiguration);
</del><ins>+    m_configuration = newConfiguration.releaseReturnValue();
</ins><span class="cx">     m_backend-&gt;setConfiguration(*m_configuration);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RTCPeerConnection::privateGetStats(MediaStreamTrack* selector, PeerConnection::StatsPromise&amp;&amp; promise)
</span><span class="lines">@@ -404,12 +381,10 @@
</span><span class="cx">     m_backend-&gt;getStats(selector, WTFMove(promise));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCDataChannel&gt; RTCPeerConnection::createDataChannel(String, const Dictionary&amp;, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;RefPtr&lt;RTCDataChannel&gt;&gt; RTCPeerConnection::createDataChannel(const String&amp;, const Dictionary&amp;)
</ins><span class="cx"> {
</span><del>-    if (m_signalingState == SignalingState::Closed) {
-        ec = INVALID_STATE_ERR;
-        return nullptr;
-    }
</del><ins>+    if (m_signalingState == SignalingState::Closed)
+        return Exception { INVALID_STATE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     static Ref&lt;RTCPeerConnection&gt; create(ScriptExecutionContext&amp;);
</span><span class="cx">     ~RTCPeerConnection();
</span><span class="cx"> 
</span><del>-    void initializeWith(Document&amp;, const Dictionary&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; initializeWith(Document&amp;, const Dictionary&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const Vector&lt;RefPtr&lt;RTCRtpSender&gt;&gt;&amp; getSenders() const { return m_transceiverSet-&gt;getSenders(); }
</span><span class="cx">     const Vector&lt;RefPtr&lt;RTCRtpReceiver&gt;&gt;&amp; getReceivers() const { return m_transceiverSet-&gt;getReceivers(); }
</span><span class="lines">@@ -69,8 +69,8 @@
</span><span class="cx">     // Part of legacy MediaStream-based API (mostly implemented as JS built-ins)
</span><span class="cx">     Vector&lt;RefPtr&lt;MediaStream&gt;&gt; getRemoteStreams() const { return m_backend-&gt;getRemoteStreams(); }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RTCRtpSender&gt; addTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp;, const Vector&lt;std::reference_wrapper&lt;MediaStream&gt;&gt;&amp;, ExceptionCode&amp;);
-    void removeTrack(RTCRtpSender&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;RTCRtpSender&gt;&gt; addTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp;, const Vector&lt;std::reference_wrapper&lt;MediaStream&gt;&gt;&amp;);
+    ExceptionOr&lt;void&gt; removeTrack(RTCRtpSender&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // This enum is mirrored in RTCRtpTransceiver.h
</span><span class="cx">     enum class RtpTransceiverDirection { Sendrecv, Sendonly, Recvonly, Inactive };
</span><span class="lines">@@ -79,8 +79,8 @@
</span><span class="cx">         RtpTransceiverDirection direction;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RTCRtpTransceiver&gt; addTransceiver(Ref&lt;MediaStreamTrack&gt;&amp;&amp;, const RtpTransceiverInit&amp;, ExceptionCode&amp;);
-    RefPtr&lt;RTCRtpTransceiver&gt; addTransceiver(const String&amp; kind, const RtpTransceiverInit&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;Ref&lt;RTCRtpTransceiver&gt;&gt; addTransceiver(Ref&lt;MediaStreamTrack&gt;&amp;&amp;, const RtpTransceiverInit&amp;);
+    ExceptionOr&lt;Ref&lt;RTCRtpTransceiver&gt;&gt; addTransceiver(const String&amp; kind, const RtpTransceiverInit&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void queuedCreateOffer(const Dictionary&amp; offerOptions, PeerConnection::SessionDescriptionPromise&amp;&amp;);
</span><span class="cx">     void queuedCreateAnswer(const Dictionary&amp; answerOptions, PeerConnection::SessionDescriptionPromise&amp;&amp;);
</span><span class="lines">@@ -103,11 +103,11 @@
</span><span class="cx">     String iceConnectionState() const;
</span><span class="cx"> 
</span><span class="cx">     RTCConfiguration* getConfiguration() const;
</span><del>-    void setConfiguration(const Dictionary&amp; configuration, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setConfiguration(const Dictionary&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void privateGetStats(MediaStreamTrack*, PeerConnection::StatsPromise&amp;&amp;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RTCDataChannel&gt; createDataChannel(String label, const Dictionary&amp; dataChannelDict, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;RefPtr&lt;RTCDataChannel&gt;&gt; createDataChannel(const String&amp; label, const Dictionary&amp; dataChannelDict);
</ins><span class="cx"> 
</span><span class="cx">     void close();
</span><span class="cx"> 
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> private:
</span><span class="cx">     RTCPeerConnection(ScriptExecutionContext&amp;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RTCRtpTransceiver&gt; completeAddTransceiver(Ref&lt;RTCRtpTransceiver&gt;&amp;&amp;, const RtpTransceiverInit&amp;);
</del><ins>+    void completeAddTransceiver(RTCRtpTransceiver&amp;, const RtpTransceiverInit&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // EventTarget implementation.
</span><span class="cx">     void refEventTarget() final { ref(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">     JSBuiltinConstructor,
</span><span class="cx"> ] interface RTCPeerConnection : EventTarget {
</span><span class="cx">     // Private initializer
</span><del>-    [PrivateIdentifier, CallWith=Document, MayThrowLegacyException] void initializeWith(Dictionary parameters);
</del><ins>+    [PrivateIdentifier, CallWith=Document, MayThrowException] void initializeWith(Dictionary parameters);
</ins><span class="cx"> 
</span><span class="cx">     // RTP Media API extensions
</span><span class="cx">     [PrivateIdentifier, PublicIdentifier] sequence&lt;RTCRtpSender&gt; getSenders();
</span><span class="lines">@@ -45,11 +45,11 @@
</span><span class="cx">     sequence&lt;RTCRtpReceiver&gt; getReceivers();
</span><span class="cx">     sequence&lt;RTCRtpTransceiver&gt; getTransceivers();
</span><span class="cx"> 
</span><del>-    [PrivateIdentifier, PublicIdentifier, MayThrowLegacyException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
-    [PrivateIdentifier, PublicIdentifier, MayThrowLegacyException] void removeTrack(RTCRtpSender sender);
</del><ins>+    [PrivateIdentifier, PublicIdentifier, MayThrowException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
+    [PrivateIdentifier, PublicIdentifier, MayThrowException] void removeTrack(RTCRtpSender sender);
</ins><span class="cx"> 
</span><del>-    [MayThrowLegacyException] RTCRtpTransceiver addTransceiver(MediaStreamTrack track, optional RTCRtpTransceiverInit init);
-    [MayThrowLegacyException] RTCRtpTransceiver addTransceiver(DOMString kind, optional RTCRtpTransceiverInit init);
</del><ins>+    [MayThrowException] RTCRtpTransceiver addTransceiver(MediaStreamTrack track, optional RTCRtpTransceiverInit init);
+    [MayThrowException] RTCRtpTransceiver addTransceiver(DOMString kind, optional RTCRtpTransceiverInit init);
</ins><span class="cx"> 
</span><span class="cx">     // Legacy MediaSream-based API (implemented on top of the RTP Media API)
</span><span class="cx">     [JSBuiltin] sequence&lt;MediaStream&gt; getLocalStreams();
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     readonly attribute DOMString iceConnectionState;
</span><span class="cx"> 
</span><span class="cx">     RTCConfiguration getConfiguration();
</span><del>-    [MayThrowLegacyException] void setConfiguration(Dictionary configuration);
</del><ins>+    [MayThrowException] void setConfiguration(Dictionary configuration);
</ins><span class="cx"> 
</span><span class="cx">     [JSBuiltin] Promise getStats(optional MediaStreamTrack? selector = null);
</span><span class="cx">     // Legacy signature: Promise getStats(MediaStreamTrack? selector
</span><span class="lines">@@ -114,7 +114,7 @@
</span><span class="cx">     [PrivateIdentifier] Promise queuedAddIceCandidate(RTCIceCandidate candidate);
</span><span class="cx">     [PrivateIdentifier] Promise privateGetStats(MediaStreamTrack? selector);
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional Dictionary options);
</del><ins>+    [MayThrowException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional Dictionary options);
</ins><span class="cx"> 
</span><span class="cx">     void close();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCRtpSendercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -67,19 +67,19 @@
</span><span class="cx">     m_track = WTFMove(track);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCRtpSender::replaceTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp; withTrack, PeerConnection::VoidPromise&amp;&amp; promise, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; RTCRtpSender::replaceTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp; withTrack, PeerConnection::VoidPromise&amp;&amp; promise)
</ins><span class="cx"> {
</span><span class="cx">     if (isStopped()) {
</span><span class="cx">         promise.reject(INVALID_STATE_ERR);
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_trackKind != withTrack-&gt;kind()) {
-        ec = TypeError;
-        return;
-    }
</del><ins>+    if (m_trackKind != withTrack-&gt;kind())
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><span class="cx">     m_client-&gt;replaceTrack(*this, WTFMove(withTrack), WTFMove(promise));
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCRtpSenderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,14 +28,12 @@
</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 RTCRtpSender_h
-#define RTCRtpSender_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;PeerConnectionBackend.h&quot;
</span><span class="cx"> #include &quot;RTCRtpSenderReceiverBase.h&quot;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -61,7 +59,7 @@
</span><span class="cx">     void stop() { m_client = nullptr; }
</span><span class="cx">     void setTrack(RefPtr&lt;MediaStreamTrack&gt;&amp;&amp;);
</span><span class="cx"> 
</span><del>-    void replaceTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp;, PeerConnection::VoidPromise&amp;&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; replaceTrack(Ref&lt;MediaStreamTrack&gt;&amp;&amp;, PeerConnection::VoidPromise&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     RTCRtpSender(RefPtr&lt;MediaStreamTrack&gt;&amp;&amp;, const String&amp; trackKind, Vector&lt;String&gt;&amp;&amp; mediaStreamIds, RTCRtpSenderClient&amp;);
</span><span class="lines">@@ -75,4 +73,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-#endif // RTCRtpSender_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCRtpSenderidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -33,5 +33,5 @@
</span><span class="cx"> ] interface RTCRtpSender {
</span><span class="cx">     readonly attribute MediaStreamTrack? track;
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] Promise replaceTrack(MediaStreamTrack withTrack);
</del><ins>+    [MayThrowException] Promise replaceTrack(MediaStreamTrack withTrack);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCSessionDescriptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -30,12 +30,12 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;RTCSessionDescription.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><del>-#include &quot;RTCSessionDescription.h&quot;
-
</del><span class="cx"> #include &quot;Dictionary.h&quot;
</span><ins>+#include &quot;ExceptionCode.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -55,25 +55,21 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;RTCSessionDescription&gt; RTCSessionDescription::create(const Dictionary&amp; dictionary, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;RTCSessionDescription&gt;&gt; RTCSessionDescription::create(const Dictionary&amp; dictionary)
</ins><span class="cx"> {
</span><span class="cx">     String typeString;
</span><span class="cx">     // Dictionary member type is required.
</span><del>-    if (!dictionary.get(&quot;type&quot;, typeString)) {
-        ec = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (!dictionary.get(&quot;type&quot;, typeString))
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><span class="cx">     SdpType type;
</span><del>-    if (!parseTypeString(typeString, type)) {
-        ec = TypeError;
-        return nullptr;
-    }
</del><ins>+    if (!parseTypeString(typeString, type))
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><span class="cx">     String sdp;
</span><span class="cx">     dictionary.get(&quot;sdp&quot;, sdp);
</span><span class="cx"> 
</span><del>-    return adoptRef(new RTCSessionDescription(type, sdp));
</del><ins>+    return adoptRef(*new RTCSessionDescription(type, sdp));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;RTCSessionDescription&gt; RTCSessionDescription::create(SdpType type, const String&amp; sdp)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCSessionDescriptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,16 +28,12 @@
</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 RTCSessionDescription_h
-#define RTCSessionDescription_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx"> 
</span><del>-#include &quot;ExceptionCode.h&quot;
</del><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -52,9 +48,8 @@
</span><span class="cx">         Rollback
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static RefPtr&lt;RTCSessionDescription&gt; create(const Dictionary&amp;, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;RTCSessionDescription&gt;&gt; create(const Dictionary&amp;);
</ins><span class="cx">     static Ref&lt;RTCSessionDescription&gt; create(SdpType, const String&amp; sdp);
</span><del>-    virtual ~RTCSessionDescription() { }
</del><span class="cx"> 
</span><span class="cx">     SdpType type() const { return m_type; }
</span><span class="cx"> 
</span><span class="lines">@@ -71,5 +66,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // RTCSessionDescription_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCSessionDescriptionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -32,11 +32,12 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_RTC,
</span><span class="cx">     Constructor(Dictionary dictionary),
</span><del>-    ConstructorMayThrowLegacyException,
</del><ins>+    ConstructorMayThrowException,
+    ImplementationLacksVTable,
</ins><span class="cx">     PrivateIdentifier,
</span><del>-    PublicIdentifier
</del><ins>+    PublicIdentifier,
</ins><span class="cx"> ] interface RTCSessionDescription {
</span><del>-    [SetterMayThrowLegacyException] readonly attribute RTCSdpType type;
</del><ins>+    [SetterMayThrowException] readonly attribute RTCSdpType type;
</ins><span class="cx">     readonly attribute DOMString sdp;
</span><span class="cx"> 
</span><span class="cx">     serializer = {type, sdp};
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -39,16 +39,14 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static bool verifyCustomHandlerURL(const URL&amp; baseURL, const String&amp; url, ExceptionCode&amp; ec)
</del><ins>+static bool verifyCustomHandlerURL(const URL&amp; baseURL, const String&amp; url)
</ins><span class="cx"> {
</span><span class="cx">     // The specification requires that it is a SYNTAX_ERR if the &quot;%s&quot; token is
</span><span class="cx">     // not present.
</span><span class="cx">     static const char token[] = &quot;%s&quot;;
</span><span class="cx">     int index = url.find(token);
</span><del>-    if (-1 == index) {
-        ec = SYNTAX_ERR;
</del><ins>+    if (-1 == index)
</ins><span class="cx">         return false;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     // It is also a SYNTAX_ERR if the custom handler URL, as created by removing
</span><span class="cx">     // the &quot;%s&quot; token and prepending the base url, does not resolve.
</span><span class="lines">@@ -57,10 +55,8 @@
</span><span class="cx"> 
</span><span class="cx">     URL kurl(baseURL, newURL);
</span><span class="cx"> 
</span><del>-    if (kurl.isEmpty() || !kurl.isValid()) {
-        ec = SYNTAX_ERR;
</del><ins>+    if (kurl.isEmpty() || !kurl.isValid())
</ins><span class="cx">         return false;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -76,7 +72,7 @@
</span><span class="cx">     return protocolWhitelist.get().contains(scheme);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool verifyProtocolHandlerScheme(const String&amp; scheme, ExceptionCode&amp; ec)
</del><ins>+static bool verifyProtocolHandlerScheme(const String&amp; scheme)
</ins><span class="cx"> {
</span><span class="cx">     if (isProtocolWhitelisted(scheme))
</span><span class="cx">         return true;
</span><span class="lines">@@ -88,7 +84,6 @@
</span><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ec = SECURITY_ERR;
</del><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -101,23 +96,25 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NavigatorContentUtils::registerProtocolHandler(Navigator&amp; navigator, const String&amp; scheme, const String&amp; url, const String&amp; title, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; NavigatorContentUtils::registerProtocolHandler(Navigator&amp; navigator, const String&amp; scheme, const String&amp; url, const String&amp; title)
</ins><span class="cx"> {
</span><span class="cx">     if (!navigator.frame())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     URL baseURL = navigator.frame()-&gt;document()-&gt;baseURL();
</span><span class="cx"> 
</span><del>-    if (!verifyCustomHandlerURL(baseURL, url, ec))
-        return;
</del><ins>+    if (!verifyCustomHandlerURL(baseURL, url))
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    if (!verifyProtocolHandlerScheme(scheme, ec))
-        return;
</del><ins>+    if (!verifyProtocolHandlerScheme(scheme))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     NavigatorContentUtils::from(navigator.frame()-&gt;page())-&gt;client()-&gt;registerProtocolHandler(scheme, baseURL, URL(ParsedURLString, url), navigator.frame()-&gt;displayStringModifiedByEncoding(title));
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CUSTOM_SCHEME_HANDLER)
</span><ins>+
</ins><span class="cx"> static String customHandlersStateString(const NavigatorContentUtilsClient::CustomHandlersState state)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;String&gt; newHandler(ASCIILiteral(&quot;new&quot;));
</span><span class="lines">@@ -137,39 +134,41 @@
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator&amp; navigator, const String&amp; scheme, const String&amp; url, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;String&gt; NavigatorContentUtils::isProtocolHandlerRegistered(Navigator&amp; navigator, const String&amp; scheme, const String&amp; url)
</ins><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;String&gt; declined(ASCIILiteral(&quot;declined&quot;));
</span><span class="cx"> 
</span><span class="cx">     if (!navigator.frame())
</span><del>-        return declined;
</del><ins>+        return String { declined };
</ins><span class="cx"> 
</span><span class="cx">     URL baseURL = navigator.frame()-&gt;document()-&gt;baseURL();
</span><span class="cx"> 
</span><del>-    if (!verifyCustomHandlerURL(baseURL, url, ec))
-        return declined;
</del><ins>+    if (!verifyCustomHandlerURL(baseURL, url))
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    if (!verifyProtocolHandlerScheme(scheme, ec))
-        return declined;
</del><ins>+    if (!verifyProtocolHandlerScheme(scheme))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     return customHandlersStateString(NavigatorContentUtils::from(navigator.frame()-&gt;page())-&gt;client()-&gt;isProtocolHandlerRegistered(scheme, baseURL, URL(ParsedURLString, url)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NavigatorContentUtils::unregisterProtocolHandler(Navigator&amp; navigator, const String&amp; scheme, const String&amp; url, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; NavigatorContentUtils::unregisterProtocolHandler(Navigator&amp; navigator, const String&amp; scheme, const String&amp; url)
</ins><span class="cx"> {
</span><span class="cx">     if (!navigator.frame())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     URL baseURL = navigator.frame()-&gt;document()-&gt;baseURL();
</span><span class="cx"> 
</span><del>-    if (!verifyCustomHandlerURL(baseURL, url, ec))
-        return;
</del><ins>+    if (!verifyCustomHandlerURL(baseURL, url))
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    if (!verifyProtocolHandlerScheme(scheme, ec))
-        return;
</del><ins>+    if (!verifyProtocolHandlerScheme(scheme))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     NavigatorContentUtils::from(navigator.frame()-&gt;page())-&gt;client()-&gt;unregisterProtocolHandler(scheme, baseURL, URL(ParsedURLString, url));
</span><ins>+    return { };
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> const char* NavigatorContentUtils::supplementName()
</span><span class="lines">@@ -185,4 +184,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(NAVIGATOR_CONTENT_UTILS)
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -24,14 +24,13 @@
</span><span class="cx">  * DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef NavigatorContentUtils_h
-#define NavigatorContentUtils_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(NAVIGATOR_CONTENT_UTILS)
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;NavigatorContentUtilsClient.h&quot;
</span><span class="cx"> #include &quot;Supplementable.h&quot;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -51,11 +50,11 @@
</span><span class="cx">     static const char* supplementName();
</span><span class="cx">     static NavigatorContentUtils* from(Page*);
</span><span class="cx"> 
</span><del>-    static void registerProtocolHandler(Navigator&amp;, const String&amp; scheme, const String&amp; url, const String&amp; title, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;void&gt; registerProtocolHandler(Navigator&amp;, const String&amp; scheme, const String&amp; url, const String&amp; title);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CUSTOM_SCHEME_HANDLER)
</span><del>-    static String isProtocolHandlerRegistered(Navigator&amp;, const String&amp; scheme, const String&amp; url, ExceptionCode&amp;);
-    static void unregisterProtocolHandler(Navigator&amp;, const String&amp; scheme, const String&amp; url, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;String&gt; isProtocolHandlerRegistered(Navigator&amp;, const String&amp; scheme, const String&amp; url);
+    static ExceptionOr&lt;void&gt; unregisterProtocolHandler(Navigator&amp;, const String&amp; scheme, const String&amp; url);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -67,5 +66,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(NAVIGATOR_CONTENT_UTILS)
</span><del>-
-#endif // NavigatorContentUtils_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -20,8 +20,7 @@
</span><span class="cx"> 
</span><span class="cx"> // http://www.w3.org/TR/html5/system-state-and-capabilities.html#custom-handlers
</span><span class="cx"> partial interface Navigator {
</span><del>-    [Conditional=NAVIGATOR_CONTENT_UTILS, MayThrowLegacyException] void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
-    [Conditional=NAVIGATOR_CONTENT_UTILS&amp;CUSTOM_SCHEME_HANDLER, MayThrowLegacyException] DOMString isProtocolHandlerRegistered(DOMString scheme, DOMString url);
-    [Conditional=NAVIGATOR_CONTENT_UTILS&amp;CUSTOM_SCHEME_HANDLER, MayThrowLegacyException] void unregisterProtocolHandler(DOMString scheme, DOMString url);
</del><ins>+    [Conditional=NAVIGATOR_CONTENT_UTILS, MayThrowException] void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
+    [Conditional=NAVIGATOR_CONTENT_UTILS&amp;CUSTOM_SCHEME_HANDLER, MayThrowException] DOMString isProtocolHandlerRegistered(DOMString scheme, DOMString url);
+    [Conditional=NAVIGATOR_CONTENT_UTILS&amp;CUSTOM_SCHEME_HANDLER, MayThrowException] void unregisterProtocolHandler(DOMString scheme, DOMString url);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMediaDevicesCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -359,7 +359,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
</del><span class="cx">     auto constraintsDictionary = Dictionary(&amp;state, state.uncheckedArgument(0));
</span><span class="cx"> 
</span><span class="cx">     MediaTrackConstraintSetMap mandatoryAudioConstraints;
</span><span class="lines">@@ -386,8 +385,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto audioConstraints = MediaConstraintsImpl::create(WTFMove(mandatoryAudioConstraints), WTFMove(advancedAudioConstraints), areAudioConstraintsValid);
</span><span class="cx">     auto videoConstraints = MediaConstraintsImpl::create(WTFMove(mandatoryVideoConstraints), WTFMove(advancedVideoConstraints), areVideoConstraintsValid);
</span><del>-    castThisValue&lt;JSMediaDevices&gt;(state).wrapped().getUserMedia(WTFMove(audioConstraints), WTFMove(videoConstraints), WTFMove(promise), ec);
-    setDOMException(&amp;state, ec);
</del><ins>+    propagateException(state, scope, castThisValue&lt;JSMediaDevices&gt;(state).wrapped().getUserMedia(WTFMove(audioConstraints), WTFMove(videoConstraints), WTFMove(promise)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSMediaDevices::getUserMedia(ExecState&amp; state)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -4261,6 +4261,18 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub NeedsExplicitPropagateExceptionCall
+{
+    my ($function) = @_;
+
+    return 0 unless $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowException};
+
+    return 1 if $function-&gt;signature-&gt;type &amp;&amp; $function-&gt;signature-&gt;type-&gt;name eq &quot;void&quot;;
+    return 1 if IsReturningPromise($function);
+
+    return 0;
+}
+
</ins><span class="cx"> sub GenerateParametersCheck
</span><span class="cx"> {
</span><span class="cx">     my ($outputArray, $function, $interface, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType) = @_;
</span><span class="lines">@@ -4486,23 +4498,15 @@
</span><span class="cx">         $argumentIndex++;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    push @arguments, GenerateReturnParameters($function);
</del><ins>+    push(@arguments, &quot;WTFMove(promise)&quot;) if IsReturningPromise($function);
+    push(@arguments, &quot;ec&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
+
</ins><span class="cx">     my $functionString = &quot;$functionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;;
</span><del>-    $functionString = &quot;propagateException(*state, throwScope, $functionString)&quot; if $function-&gt;signature-&gt;type &amp;&amp; $function-&gt;signature-&gt;type-&gt;name eq &quot;void&quot; &amp;&amp; $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowException};
</del><ins>+    $functionString = &quot;propagateException(*state, throwScope, $functionString)&quot; if NeedsExplicitPropagateExceptionCall($function);
</ins><span class="cx"> 
</span><span class="cx">     return ($functionString, scalar @arguments);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GenerateReturnParameters
-{
-    my $function = shift;
-
-    my @arguments;
-    push(@arguments, &quot;WTFMove(promise)&quot;) if IsReturningPromise($function);
-    push(@arguments, &quot;ec&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
-    return @arguments;
-}
-
</del><span class="cx"> sub GenerateDictionaryHeader
</span><span class="cx"> {
</span><span class="cx">     my ($object, $dictionary, $className, $enumerations) = @_;
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/CharacterData.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -63,11 +63,10 @@
</span><span class="cx">     document().textRemoved(this, 0, oldLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String CharacterData::substringData(unsigned offset, unsigned count, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;String&gt; CharacterData::substringData(unsigned offset, unsigned count)
</ins><span class="cx"> {
</span><del>-    checkCharDataOperation(offset, ec);
-    if (ec)
-        return String();
</del><ins>+    if (offset &gt; length())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     return m_data.substring(offset, count);
</span><span class="cx"> }
</span><span class="lines">@@ -118,11 +117,10 @@
</span><span class="cx">     // FIXME: Should we call textInserted here?
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CharacterData::insertData(unsigned offset, const String&amp; data, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CharacterData::insertData(unsigned offset, const String&amp; data)
</ins><span class="cx"> {
</span><del>-    checkCharDataOperation(offset, ec);
-    if (ec)
-        return;
</del><ins>+    if (offset &gt; length())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     String newStr = m_data;
</span><span class="cx">     newStr.insert(data, offset);
</span><span class="lines">@@ -130,13 +128,14 @@
</span><span class="cx">     setDataAndUpdate(newStr, offset, 0, data.length());
</span><span class="cx"> 
</span><span class="cx">     document().textInserted(this, offset, data.length());
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CharacterData::deleteData(unsigned offset, unsigned count)
</ins><span class="cx"> {
</span><del>-    checkCharDataOperation(offset, ec);
-    if (ec)
-        return;
</del><ins>+    if (offset &gt; length())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     count = std::min(count, length() - offset);
</span><span class="cx"> 
</span><span class="lines">@@ -146,13 +145,14 @@
</span><span class="cx">     setDataAndUpdate(newStr, offset, count, 0);
</span><span class="cx"> 
</span><span class="cx">     document().textRemoved(this, offset, count);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CharacterData::replaceData(unsigned offset, unsigned count, const String&amp; data, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; CharacterData::replaceData(unsigned offset, unsigned count, const String&amp; data)
</ins><span class="cx"> {
</span><del>-    checkCharDataOperation(offset, ec);
-    if (ec)
-        return;
</del><ins>+    if (offset &gt; length())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><span class="cx">     count = std::min(count, length() - offset);
</span><span class="cx"> 
</span><span class="lines">@@ -165,6 +165,8 @@
</span><span class="cx">     // update the markers for spell checking and grammar checking
</span><span class="cx">     document().textRemoved(this, offset, count);
</span><span class="cx">     document().textInserted(this, offset, data.length());
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String CharacterData::nodeValue() const
</span><span class="lines">@@ -232,18 +234,6 @@
</span><span class="cx">     InspectorInstrumentation::characterDataModified(document(), *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CharacterData::checkCharDataOperation(unsigned offset, ExceptionCode&amp; ec)
-{
-    ec = 0;
-
-    // INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit
-    // units in data.
-    if (offset &gt; length()) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-}
-
</del><span class="cx"> int CharacterData::maxCharacterOffset() const
</span><span class="cx"> {
</span><span class="cx">     return static_cast&lt;int&gt;(length());
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/CharacterData.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -23,7 +23,6 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ContainerNode.h&quot;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -34,11 +33,11 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void setData(const String&amp;);
</span><span class="cx">     unsigned length() const { return m_data.length(); }
</span><del>-    WEBCORE_EXPORT String substringData(unsigned offset, unsigned count, ExceptionCode&amp;);
</del><ins>+    WEBCORE_EXPORT ExceptionOr&lt;String&gt; substringData(unsigned offset, unsigned count);
</ins><span class="cx">     WEBCORE_EXPORT void appendData(const String&amp;);
</span><del>-    WEBCORE_EXPORT void insertData(unsigned offset, const String&amp;, ExceptionCode&amp;);
-    WEBCORE_EXPORT void deleteData(unsigned offset, unsigned count, ExceptionCode&amp;);
-    WEBCORE_EXPORT void replaceData(unsigned offset, unsigned count, const String&amp;, ExceptionCode&amp;);
</del><ins>+    WEBCORE_EXPORT ExceptionOr&lt;void&gt; insertData(unsigned offset, const String&amp;);
+    WEBCORE_EXPORT ExceptionOr&lt;void&gt; deleteData(unsigned offset, unsigned count);
+    WEBCORE_EXPORT ExceptionOr&lt;void&gt; replaceData(unsigned offset, unsigned count, const String&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool containsOnlyWhitespace() const;
</span><span class="cx"> 
</span><span class="lines">@@ -68,7 +67,6 @@
</span><span class="cx">     int maxCharacterOffset() const final;
</span><span class="cx">     bool offsetInCharacters() const final;
</span><span class="cx">     void setDataAndUpdate(const String&amp;, unsigned offsetOfReplacedData, unsigned oldLength, unsigned newLength);
</span><del>-    void checkCharDataOperation(unsigned offset, ExceptionCode&amp;);
</del><span class="cx">     void notifyParentAfterChange(ContainerNode::ChildChangeSource);
</span><span class="cx"> 
</span><span class="cx">     String m_data;
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDataidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/CharacterData.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -21,12 +21,12 @@
</span><span class="cx">     [CEReactions, TreatNullAs=EmptyString] attribute DOMString data;
</span><span class="cx">     readonly attribute unsigned long length;
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] DOMString? substringData(unsigned long offset, unsigned long length);
</del><ins>+    [MayThrowException] DOMString? substringData(unsigned long offset, unsigned long length);
</ins><span class="cx"> 
</span><span class="cx">     [CEReactions] void appendData(DOMString data);
</span><del>-    [CEReactions, MayThrowLegacyException] void insertData(unsigned long offset, DOMString data);
-    [CEReactions, MayThrowLegacyException] void deleteData(unsigned long offset, unsigned long length);
-    [CEReactions, MayThrowLegacyException] void replaceData(unsigned long offset, unsigned long length, DOMString data);
</del><ins>+    [CEReactions, MayThrowException] void insertData(unsigned long offset, DOMString data);
+    [CEReactions, MayThrowException] void deleteData(unsigned long offset, unsigned long length);
+    [CEReactions, MayThrowException] void replaceData(unsigned long offset, unsigned long length, DOMString data);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> CharacterData implements ChildNode;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDataTransferItemListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DataTransferItemList.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DataTransferItemList.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/DataTransferItemList.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,8 +28,7 @@
</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 DataTransferItemList_h
-#define DataTransferItemList_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATA_TRANSFER_ITEMS)
</span><span class="cx"> 
</span><span class="lines">@@ -41,22 +40,19 @@
</span><span class="cx"> 
</span><span class="cx"> class File;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><ins>+// FIXME: Unclear why this need to be an abstract base class.
</ins><span class="cx"> class DataTransferItemList : public RefCounted&lt;DataTransferItemList&gt; {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~DataTransferItemList() { }
</span><span class="cx"> 
</span><del>-    virtual size_t length() const = 0;
-    virtual PassRefPtr&lt;DataTransferItem&gt; item(unsigned long index) = 0;
-    virtual void deleteItem(unsigned long index, ExceptionCode&amp;) = 0;
</del><ins>+    virtual unsigned length() const = 0;
+    virtual DataTransferItem* item(unsigned index) = 0;
+    virtual ExceptionOr&lt;void&gt; deleteItem(unsigned index) = 0;
</ins><span class="cx">     virtual void clear() = 0;
</span><del>-    virtual void add(const String&amp; data, const String&amp; type, ExceptionCode&amp;) = 0;
-    virtual void add(PassRefPtr&lt;File&gt;) = 0;
</del><ins>+    virtual ExceptionOr&lt;void&gt; add(const String&amp; data, const String&amp; type) = 0;
+    virtual void add(RefPtr&lt;File&gt;&amp;&amp;) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(DATA_TRANSFER_ITEMS)
</span><del>-
-#endif // DataTransferItemList_h
</del></span></pre></div>
<a id="trunkSourceWebCoredomDataTransferItemListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DataTransferItemList.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DataTransferItemList.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/DataTransferItemList.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -40,7 +40,5 @@
</span><span class="cx">     void clear();
</span><span class="cx">     void add(File? file);
</span><span class="cx"> 
</span><del>-    // FIXME: Using &quot;undefined&quot; as default parameter value is wrong.
-    [MayThrowLegacyException] void add(optional DOMString data = &quot;undefined&quot;, optional DOMString type = &quot;undefined&quot;);
</del><ins>+    [MayThrowException] void add(optional DOMString data = &quot;undefined&quot;, optional DOMString type = &quot;undefined&quot;);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoredomMessagePortidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessagePort.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessagePort.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/MessagePort.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">     GenerateIsReachable=Impl,
</span><span class="cx">     JSCustomMarkFunction,
</span><span class="cx"> ] interface MessagePort : EventTarget {
</span><del>-    [Custom, MayThrowLegacyException] void postMessage(any message, optional Array messagePorts);
</del><ins>+    [Custom, MayThrowException] void postMessage(any message, optional Array messagePorts);
</ins><span class="cx"> 
</span><span class="cx">     void start();
</span><span class="cx">     void close();
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObservercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserver.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserver.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/MutationObserver.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">         &amp;&amp; ((options &amp; CharacterData) || !(options &amp; CharacterDataOldValue));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MutationObserver::observe(Node&amp; node, const Init&amp; init, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; MutationObserver::observe(Node&amp; node, const Init&amp; init)
</ins><span class="cx"> {
</span><span class="cx">     MutationObserverOptions options = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -98,12 +98,12 @@
</span><span class="cx">     if (init.characterData ? init.characterData.value() : (options &amp; CharacterDataOldValue))
</span><span class="cx">         options |= CharacterData;
</span><span class="cx"> 
</span><del>-    if (!validateOptions(options)) {
-        ec = TypeError;
-        return;
-    }
</del><ins>+    if (!validateOptions(options))
+        return Exception { TypeError };
</ins><span class="cx"> 
</span><span class="cx">     node.registerMutationObserver(this, options, attributeFilter);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;Ref&lt;MutationRecord&gt;&gt; MutationObserver::takeRecords()
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserver.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserver.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/MutationObserver.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -28,13 +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 MutationObserver_h
-#define MutationObserver_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><del>-#include &lt;wtf/Optional.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -45,11 +43,9 @@
</span><span class="cx"> class MutationRecord;
</span><span class="cx"> class Node;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
</del><ins>+using MutationObserverOptions = unsigned char;
+using MutationRecordDeliveryOptions = unsigned char;
</ins><span class="cx"> 
</span><del>-typedef unsigned char MutationObserverOptions;
-typedef unsigned char MutationRecordDeliveryOptions;
-
</del><span class="cx"> class MutationObserver : public RefCounted&lt;MutationObserver&gt; {
</span><span class="cx">     friend class MutationObserverMicrotask;
</span><span class="cx"> public:
</span><span class="lines">@@ -85,7 +81,7 @@
</span><span class="cx">         Optional&lt;Vector&lt;String&gt;&gt; attributeFilter;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    void observe(Node&amp;, const Init&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; observe(Node&amp;, const Init&amp;);
</ins><span class="cx">     Vector&lt;Ref&lt;MutationRecord&gt;&gt; takeRecords();
</span><span class="cx">     void disconnect();
</span><span class="cx"> 
</span><span class="lines">@@ -113,5 +109,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif // MutationObserver_h
</del></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserveridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserver.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserver.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/MutationObserver.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">     CustomIsReachable,
</span><span class="cx">     ImplementationLacksVTable,
</span><span class="cx"> ] interface MutationObserver {
</span><del>-    [MayThrowLegacyException] void observe(Node target, optional MutationObserverInit options);
</del><ins>+    [MayThrowException] void observe(Node target, optional MutationObserverInit options);
</ins><span class="cx">     sequence&lt;MutationRecord&gt; takeRecords();
</span><span class="cx">     void disconnect();
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/Range.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -652,10 +652,16 @@
</span><span class="cx"> 
</span><span class="cx"> static inline void deleteCharacterData(CharacterData&amp; data, unsigned startOffset, unsigned endOffset, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (data.length() - endOffset)
-        data.deleteData(endOffset, data.length() - endOffset, ec);
-    if (startOffset)
-        data.deleteData(0, startOffset, ec);
</del><ins>+    if (data.length() - endOffset) {
+        auto result = data.deleteData(endOffset, data.length() - endOffset);
+        if (result.hasException())
+            ec = result.releaseException().code();
+    }
+    if (startOffset) {
+        auto result = data.deleteData(0, startOffset);
+        if (result.hasException())
+            ec = result.releaseException().code();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;Node&gt; Range::processContentsBetweenOffsets(ActionType action, PassRefPtr&lt;DocumentFragment&gt; fragment, Node* container, unsigned startOffset, unsigned endOffset, ExceptionCode&amp; ec)
</span><span class="lines">@@ -680,8 +686,11 @@
</span><span class="cx">             } else
</span><span class="cx">                 result = WTFMove(characters);
</span><span class="cx">         }
</span><del>-        if (action == Extract || action == Delete)
-            downcast&lt;CharacterData&gt;(*container).deleteData(startOffset, endOffset - startOffset, ec);
</del><ins>+        if (action == Extract || action == Delete) {
+            auto result = downcast&lt;CharacterData&gt;(*container).deleteData(startOffset, endOffset - startOffset);
+            if (result.hasException())
+                ec = result.releaseException().code();
+        }
</ins><span class="cx">         break;
</span><span class="cx">     case Node::PROCESSING_INSTRUCTION_NODE:
</span><span class="cx">         endOffset = std::min(endOffset, static_cast&lt;ProcessingInstruction*&gt;(container)-&gt;data().length());
</span><span class="lines">@@ -845,9 +854,12 @@
</span><span class="cx"> 
</span><span class="cx">     EventQueueScope scope;
</span><span class="cx">     if (startIsText) {
</span><del>-        referenceNode = downcast&lt;Text&gt;(startContainer()).splitText(startOffset(), ec);
-        if (ec)
</del><ins>+        auto result = downcast&lt;Text&gt;(startContainer()).splitText(startOffset());
+        if (result.hasException()) {
+            ec = result.releaseException().code();
</ins><span class="cx">             return;
</span><ins>+        }
+        referenceNode = result.releaseReturnValue();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (referenceNode == node.ptr())
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;ElementTraversal.h&quot;
</span><ins>+#include &quot;ExceptionCode.h&quot;
</ins><span class="cx"> #include &quot;RenderElement.h&quot;
</span><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> #include &quot;SlotAssignment.h&quot;
</span><span class="lines">@@ -106,21 +107,14 @@
</span><span class="cx">     return createMarkup(*this, ChildrenOnly);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ShadowRoot::setInnerHTML(const String&amp; markup, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; ShadowRoot::setInnerHTML(const String&amp; markup)
</ins><span class="cx"> {
</span><del>-    if (isOrphan()) {
-        ec = INVALID_ACCESS_ERR;
-        return;
-    }
-
</del><ins>+    if (isOrphan())
+        return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">     auto fragment = createFragmentForInnerOuterHTML(*host(), markup, AllowScriptingContent);
</span><del>-    if (fragment.hasException()) {
-        ec = fragment.releaseException().code();
-        return;
-    }
-    auto result = replaceChildrenWithFragment(*this, fragment.releaseReturnValue());
-    if (result.hasException())
-        ec = result.releaseException().code();
</del><ins>+    if (fragment.hasException())
+        return fragment.releaseException();
+    return replaceChildrenWithFragment(*this, fragment.releaseReturnValue());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ShadowRoot::childTypeAllowed(NodeType type) const
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/ShadowRoot.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -24,16 +24,12 @@
</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 ShadowRoot_h
-#define ShadowRoot_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#include &quot;ContainerNode.h&quot;
</del><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentFragment.h&quot;
</span><span class="cx"> #include &quot;Element.h&quot;
</span><del>-#include &quot;ExceptionCode.h&quot;
</del><span class="cx"> #include &quot;ShadowRootMode.h&quot;
</span><del>-#include &quot;TreeScope.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -65,7 +61,7 @@
</span><span class="cx">     void setHost(Element* host) { m_host = host; }
</span><span class="cx"> 
</span><span class="cx">     String innerHTML() const;
</span><del>-    void setInnerHTML(const String&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setInnerHTML(const String&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Element* activeElement() const;
</span><span class="cx"> 
</span><span class="lines">@@ -142,5 +138,3 @@
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ShadowRoot)
</span><span class="cx">     static bool isType(const WebCore::Node&amp; node) { return node.isShadowRoot(); }
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoredomShadowRootidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/ShadowRoot.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -27,10 +27,10 @@
</span><span class="cx">     EnabledAtRuntime=ShadowDOM,
</span><span class="cx">     JSGenerateToJSObject
</span><span class="cx"> ] interface ShadowRoot : DocumentFragment {
</span><del>-    readonly attribute ShadowRootMode   mode;
-    readonly attribute Element          host;
</del><ins>+    readonly attribute ShadowRootMode mode;
+    readonly attribute Element host;
</ins><span class="cx"> 
</span><del>-    [CEReactions, SetterMayThrowLegacyException, TreatNullAs=EmptyString] attribute DOMString innerHTML;
</del><ins>+    [CEReactions, SetterMayThrowException, TreatNullAs=EmptyString] attribute DOMString innerHTML;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> ShadowRoot implements DocumentOrShadowRoot;
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/Text.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -56,33 +56,29 @@
</span><span class="cx">     ASSERT(!renderer());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Text&gt; Text::splitText(unsigned offset, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;Text&gt;&gt; Text::splitText(unsigned offset)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><ins>+    if (offset &gt; length())
+        return Exception { INDEX_SIZE_ERR };
</ins><span class="cx"> 
</span><del>-    // INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than
-    // the number of 16-bit units in data.
-    if (offset &gt; length()) {
-        ec = INDEX_SIZE_ERR;
-        return 0;
-    }
-
</del><span class="cx">     EventQueueScope scope;
</span><del>-    String oldStr = data();
-    Ref&lt;Text&gt; newText = virtualCreate(oldStr.substring(offset));
-    setDataWithoutUpdate(oldStr.substring(0, offset));
</del><ins>+    auto oldData = data();
+    auto newText = virtualCreate(oldData.substring(offset));
+    setDataWithoutUpdate(oldData.substring(0, offset));
</ins><span class="cx"> 
</span><del>-    dispatchModifiedEvent(oldStr);
</del><ins>+    dispatchModifiedEvent(oldData);
</ins><span class="cx"> 
</span><del>-    if (parentNode())
</del><ins>+    if (parentNode()) {
+        ExceptionCode ec = 0;
</ins><span class="cx">         parentNode()-&gt;insertBefore(newText, nextSibling(), ec);
</span><del>-    if (ec)
-        return 0;
</del><ins>+        if (ec)
+            return Exception { ec };
+    }
</ins><span class="cx"> 
</span><span class="cx">     document().textNodeSplit(this);
</span><span class="cx"> 
</span><span class="cx">     if (renderer())
</span><del>-        renderer()-&gt;setTextWithOffset(data(), 0, oldStr.length());
</del><ins>+        renderer()-&gt;setTextWithOffset(data(), 0, oldData.length());
</ins><span class="cx"> 
</span><span class="cx">     return WTFMove(newText);
</span><span class="cx"> }
</span><span class="lines">@@ -122,7 +118,7 @@
</span><span class="cx">     return result.toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Text&gt; Text::replaceWholeText(const String&amp; newText, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;Text&gt; Text::replaceWholeText(const String&amp; newText)
</ins><span class="cx"> {
</span><span class="cx">     // Remove all adjacent text nodes, and replace the contents of this one.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.h (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.h        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/Text.h        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -39,12 +39,12 @@
</span><span class="cx"> 
</span><span class="cx">     virtual ~Text();
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT RefPtr&lt;Text&gt; splitText(unsigned offset, ExceptionCode&amp;);
</del><ins>+    WEBCORE_EXPORT ExceptionOr&lt;Ref&lt;Text&gt;&gt; splitText(unsigned offset);
</ins><span class="cx"> 
</span><span class="cx">     // DOM Level 3: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1312295772
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT String wholeText() const;
</span><del>-    WEBCORE_EXPORT RefPtr&lt;Text&gt; replaceWholeText(const String&amp;, ExceptionCode&amp;);
</del><ins>+    WEBCORE_EXPORT RefPtr&lt;Text&gt; replaceWholeText(const String&amp;);
</ins><span class="cx">     
</span><span class="cx">     RenderPtr&lt;RenderText&gt; createTextRenderer(const RenderStyle&amp;);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.idl (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.idl        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/dom/Text.idl        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006 Apple Inc.
</del><ins>+ * Copyright (C) 2006 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -16,17 +16,14 @@
</span><span class="cx">  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
</span><span class="cx">  * Boston, MA 02110-1301, USA.
</span><span class="cx">  */
</span><ins>+
</ins><span class="cx"> [
</span><span class="cx">     Constructor(optional DOMString data),
</span><span class="cx">     ConstructorCallWith=Document,
</span><span class="cx">     CustomToJSObject,
</span><span class="cx"> ] interface Text : CharacterData {
</span><ins>+    [MayThrowException] Text splitText(unsigned long offset);
</ins><span class="cx"> 
</span><del>-    // DOM Level 1
-
-    [MayThrowLegacyException] Text splitText(unsigned long offset);
-
-    // Introduced in DOM Level 3:
</del><span class="cx">     readonly attribute DOMString wholeText;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyBlockElementCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -175,13 +175,7 @@
</span><span class="cx">     int offset = position.offsetInContainerNode();
</span><span class="cx">     if (!is&lt;Text&gt;(textNode) || offset &lt; 0 || offset &gt;= textNode-&gt;maxCharacterOffset())
</span><span class="cx">         return false;
</span><del>-
-    ExceptionCode ec = 0;
-    String textAtPosition = downcast&lt;Text&gt;(*textNode).substringData(offset, 1, ec);
-    if (ec)
-        return false;
-
-    return textAtPosition[0] == '\n';
</del><ins>+    return downcast&lt;Text&gt;(*textNode).data()[offset] == '\n';
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const RenderStyle* ApplyBlockElementCommand::renderStyleOfEnclosingTextNode(const Position&amp; position)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteFromTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -51,12 +51,11 @@
</span><span class="cx">     if (!isEditableNode(*m_node))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    m_text = m_node-&gt;substringData(m_offset, m_count, ec);
-    if (ec)
</del><ins>+    auto result = m_node-&gt;substringData(m_offset, m_count);
+    if (result.hasException())
</ins><span class="cx">         return;
</span><del>-
-    m_node-&gt;deleteData(m_offset, m_count, ec);
</del><ins>+    m_text = result.releaseReturnValue();
+    m_node-&gt;deleteData(m_offset, m_count);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DeleteFromTextNodeCommand::doUnapply()
</span><span class="lines">@@ -66,7 +65,7 @@
</span><span class="cx">     if (!m_node-&gt;hasEditableStyle())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_node-&gt;insertData(m_offset, m_text, IGNORE_EXCEPTION);
</del><ins>+    m_node-&gt;insertData(m_offset, m_text);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -27,11 +27,11 @@
</span><span class="cx"> #include &quot;InsertIntoTextNodeCommand.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;ExceptionCodePlaceholder.h&quot;
</del><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;Text.h&quot;
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> InsertIntoTextNodeCommand::InsertIntoTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, const String&amp; text, EditAction editingAction)
</span><span class="cx">     : SimpleEditCommand(node-&gt;document(), editingAction)
</span><del>-    , m_node(node)
</del><ins>+    , m_node(WTFMove(node))
</ins><span class="cx">     , m_offset(offset)
</span><span class="cx">     , m_text(text)
</span><span class="cx"> {
</span><span class="lines">@@ -63,15 +63,19 @@
</span><span class="cx">             renderText-&gt;momentarilyRevealLastTypedCharacter(m_offset + m_text.length());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_node-&gt;insertData(m_offset, m_text, IGNORE_EXCEPTION);
</del><ins>+    m_node-&gt;insertData(m_offset, m_text);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
+// FIXME: Why would reapply be iOS-specific?
</ins><span class="cx"> void InsertIntoTextNodeCommand::doReapply()
</span><span class="cx"> {
</span><del>-    ExceptionCode ec;
-    m_node-&gt;insertData(m_offset, m_text, ec);
</del><ins>+    // FIXME: Shouldn't this have a hasEditableStyle check?
+
+    m_node-&gt;insertData(m_offset, m_text);
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx"> void InsertIntoTextNodeCommand::doUnapply()
</span><span class="lines">@@ -79,14 +83,16 @@
</span><span class="cx">     if (!m_node-&gt;hasEditableStyle())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_node-&gt;deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION);
</del><ins>+    m_node-&gt;deleteData(m_offset, m_text.length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><ins>+
</ins><span class="cx"> void InsertIntoTextNodeCommand::getNodesInCommand(HashSet&lt;Node*&gt;&amp; nodes)
</span><span class="cx"> {
</span><span class="cx">     addNodeAndDescendants(m_node.get(), nodes);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingSplitTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/SplitTextNodeCommand.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/SplitTextNodeCommand.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/editing/SplitTextNodeCommand.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -54,11 +54,14 @@
</span><span class="cx">     if (!parent || !parent-&gt;hasEditableStyle())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    String prefixText = m_text2-&gt;substringData(0, m_offset, IGNORE_EXCEPTION);
</del><ins>+    auto result = m_text2-&gt;substringData(0, m_offset);
+    if (result.hasException())
+        return;
+    auto prefixText = result.releaseReturnValue();
</ins><span class="cx">     if (prefixText.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_text1 = Text::create(document(), prefixText);
</del><ins>+    m_text1 = Text::create(document(), WTFMove(prefixText));
</ins><span class="cx">     ASSERT(m_text1);
</span><span class="cx">     document().markers().copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);
</span><span class="cx"> 
</span><span class="lines">@@ -74,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx">     String prefixText = m_text1-&gt;data();
</span><span class="cx"> 
</span><del>-    m_text2-&gt;insertData(0, prefixText, ASSERT_NO_EXCEPTION);
</del><ins>+    m_text2-&gt;insertData(0, prefixText);
</ins><span class="cx"> 
</span><span class="cx">     document().markers().copyMarkers(m_text1.get(), 0, prefixText.length(), m_text2.get(), 0);
</span><span class="cx">     m_text1-&gt;remove();
</span><span class="lines">@@ -98,15 +101,17 @@
</span><span class="cx">     m_text2-&gt;parentNode()-&gt;insertBefore(*m_text1, m_text2.get(), ec);
</span><span class="cx">     if (ec)
</span><span class="cx">         return;
</span><del>-    m_text2-&gt;deleteData(0, m_offset, ec);
</del><ins>+    m_text2-&gt;deleteData(0, m_offset);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><ins>+
</ins><span class="cx"> void SplitTextNodeCommand::getNodesInCommand(HashSet&lt;Node*&gt;&amp; nodes)
</span><span class="cx"> {
</span><span class="cx">     addNodeAndDescendants(m_text1.get(), nodes);
</span><span class="cx">     addNodeAndDescendants(m_text2.get(), nodes);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><ins>+#include &quot;ExceptionCode.h&quot;
</ins><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameSelection.h&quot;
</span><span class="cx"> #include &quot;HTMLBRElement.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorDOMEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/DOMEditor.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/DOMEditor.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebCore/inspector/DOMEditor.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -260,15 +260,15 @@
</span><span class="cx">         return redo(ec);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool undo(ExceptionCode&amp; ec) override
</del><ins>+    bool undo(ExceptionCode&amp;) override
</ins><span class="cx">     {
</span><del>-        m_textNode-&gt;replaceWholeText(m_oldText, ec);
</del><ins>+        m_textNode-&gt;replaceWholeText(m_oldText);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool redo(ExceptionCode&amp; ec) override
</del><ins>+    bool redo(ExceptionCode&amp;) override
</ins><span class="cx">     {
</span><del>-        m_textNode-&gt;replaceWholeText(m_text, ec);
</del><ins>+        m_textNode-&gt;replaceWholeText(m_text);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-10-29  Darin Adler  &lt;darin@apple.com&gt;
+
+        Convert more of DOM from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=164173
+
+        Reviewed by Ryosuke Niwa.
+
+        * DOM/DOMCharacterData.mm:
+        (-[DOMCharacterData substringData:length:]): Updated since this
+        now uses ExceptionOr.
+        (-[DOMCharacterData insertData:data:]): Ditto.
+        (-[DOMCharacterData deleteData:length:]): Ditto.
+        (-[DOMCharacterData replaceData:length:data:]): Ditto.
+        * DOM/DOMText.mm:
+        (-[DOMText splitText:]): Ditto.
+        (-[DOMText replaceWholeText:]): Removed unneeded exception code
+        handling from function that does not throw an exception.
+
</ins><span class="cx"> 2016-10-28  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move all classes in the HTML directory from ExceptionCode to Exception
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMCharacterDatamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMCharacterData.mm (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMCharacterData.mm        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebKit/mac/DOM/DOMCharacterData.mm        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -73,10 +73,7 @@
</span><span class="cx"> - (NSString *)substringData:(unsigned)offset length:(unsigned)inLength
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    WebCore::ExceptionCode ec = 0;
-    NSString *result = IMPL-&gt;substringData(offset, inLength, ec);
-    raiseOnDOMError(ec);
-    return result;
</del><ins>+    return raiseOnDOMError(IMPL-&gt;substringData(offset, inLength));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)appendData:(NSString *)inData
</span><span class="lines">@@ -88,25 +85,19 @@
</span><span class="cx"> - (void)insertData:(unsigned)offset data:(NSString *)inData
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    WebCore::ExceptionCode ec = 0;
-    IMPL-&gt;insertData(offset, inData, ec);
-    raiseOnDOMError(ec);
</del><ins>+    raiseOnDOMError(IMPL-&gt;insertData(offset, inData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)deleteData:(unsigned)offset length:(unsigned)inLength
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    WebCore::ExceptionCode ec = 0;
-    IMPL-&gt;deleteData(offset, inLength, ec);
-    raiseOnDOMError(ec);
</del><ins>+    raiseOnDOMError(IMPL-&gt;deleteData(offset, inLength));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)replaceData:(unsigned)offset length:(unsigned)inLength data:(NSString *)inData
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    WebCore::ExceptionCode ec = 0;
-    IMPL-&gt;replaceData(offset, inLength, inData, ec);
-    raiseOnDOMError(ec);
</del><ins>+    raiseOnDOMError(IMPL-&gt;replaceData(offset, inLength, inData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)remove
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMTextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMText.mm (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMText.mm        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebKit/mac/DOM/DOMText.mm        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -47,19 +47,13 @@
</span><span class="cx"> - (DOMText *)splitText:(unsigned)offset
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    WebCore::ExceptionCode ec = 0;
-    DOMText *result = kit(WTF::getPtr(IMPL-&gt;splitText(offset, ec)));
-    raiseOnDOMError(ec);
-    return result;
</del><ins>+    return kit(raiseOnDOMError(IMPL-&gt;splitText(offset)).ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (DOMText *)replaceWholeText:(NSString *)content
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    WebCore::ExceptionCode ec = 0;
-    DOMText *result = kit(WTF::getPtr(IMPL-&gt;replaceWholeText(content, ec)));
-    raiseOnDOMError(ec);
-    return result;
</del><ins>+    return kit(IMPL-&gt;replaceWholeText(content).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-10-29  Darin Adler  &lt;darin@apple.com&gt;
+
+        Convert more of DOM from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=164173
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
+        (webkit_dom_character_data_substring_data): Updated since this
+        now uses ExceptionOr.
+        (webkit_dom_character_data_insert_data): Ditto.
+        (webkit_dom_character_data_delete_data): Ditto.
+        (webkit_dom_character_data_replace_data): Ditto.
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
+        (webkit_dom_text_replace_whole_text): Ditto.
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
+        (webkit_dom_text_split_text): Ditto.
+
</ins><span class="cx"> 2016-10-28  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move all classes in the HTML directory from ExceptionCode to Exception
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMCharacterDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -169,9 +169,10 @@
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_CHARACTER_DATA(self), 0);
</span><span class="cx">     g_return_val_if_fail(!error || !*error, 0);
</span><span class="cx">     WebCore::CharacterData* item = WebKit::core(self);
</span><del>-    WebCore::ExceptionCode ec = 0;
-    gchar* result = convertToUTF8String(item-&gt;substringData(offset, length, ec));
-    return result;
</del><ins>+    auto result = item-&gt;substringData(offset, length);
+    if (result.hasException())
+        return nullptr;
+    return convertToUTF8String(result.releaseReturnValue());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void webkit_dom_character_data_append_data(WebKitDOMCharacterData* self, const gchar* data, GError** error)
</span><span class="lines">@@ -193,10 +194,9 @@
</span><span class="cx">     g_return_if_fail(!error || !*error);
</span><span class="cx">     WebCore::CharacterData* item = WebKit::core(self);
</span><span class="cx">     WTF::String convertedData = WTF::String::fromUTF8(data);
</span><del>-    WebCore::ExceptionCode ec = 0;
-    item-&gt;insertData(offset, convertedData, ec);
-    if (ec) {
-        WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+    auto result = item-&gt;insertData(offset, convertedData);
+    if (result.hasException()) {
+        WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx">         g_set_error_literal(error, g_quark_from_string(&quot;WEBKIT_DOM&quot;), ecdesc.code, ecdesc.name);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -207,10 +207,9 @@
</span><span class="cx">     g_return_if_fail(WEBKIT_DOM_IS_CHARACTER_DATA(self));
</span><span class="cx">     g_return_if_fail(!error || !*error);
</span><span class="cx">     WebCore::CharacterData* item = WebKit::core(self);
</span><del>-    WebCore::ExceptionCode ec = 0;
-    item-&gt;deleteData(offset, length, ec);
-    if (ec) {
-        WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+    auto result = item-&gt;deleteData(offset, length);
+    if (result.hasException()) {
+        WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx">         g_set_error_literal(error, g_quark_from_string(&quot;WEBKIT_DOM&quot;), ecdesc.code, ecdesc.name);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -223,10 +222,9 @@
</span><span class="cx">     g_return_if_fail(!error || !*error);
</span><span class="cx">     WebCore::CharacterData* item = WebKit::core(self);
</span><span class="cx">     WTF::String convertedData = WTF::String::fromUTF8(data);
</span><del>-    WebCore::ExceptionCode ec = 0;
-    item-&gt;replaceData(offset, length, convertedData, ec);
-    if (ec) {
-        WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+    auto result = item-&gt;replaceData(offset, length, convertedData);
+    if (result.hasException()) {
+        WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx">         g_set_error_literal(error, g_quark_from_string(&quot;WEBKIT_DOM&quot;), ecdesc.code, ecdesc.name);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMDeprecatedcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -155,13 +155,7 @@
</span><span class="cx">     g_return_val_if_fail(!error || !*error, nullptr);
</span><span class="cx"> 
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><del>-    WebCore::ExceptionCode ec = 0;
-    RefPtr&lt;WebCore::Text&gt; gobjectResult = WTF::getPtr(WebKit::core(self)-&gt;replaceWholeText(WTF::String::fromUTF8(content), ec));
-    if (ec) {
-        WebCore::ExceptionCodeDescription ecdesc(ec);
-        g_set_error_literal(error, g_quark_from_string(&quot;WEBKIT_DOM&quot;), ecdesc.code, ecdesc.name);
-    }
-    return WebKit::kit(gobjectResult.get());
</del><ins>+    return WebKit::kit(WebKit::core(self)-&gt;replaceWholeText(WTF::String::fromUTF8(content)).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> gboolean webkit_dom_html_input_element_get_capture(WebKitDOMHTMLInputElement* self)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkDOMWebKitDOMTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp (208117 => 208118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp        2016-10-30 01:38:22 UTC (rev 208117)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp        2016-10-30 02:56:39 UTC (rev 208118)
</span><span class="lines">@@ -140,13 +140,13 @@
</span><span class="cx">     g_return_val_if_fail(WEBKIT_DOM_IS_TEXT(self), 0);
</span><span class="cx">     g_return_val_if_fail(!error || !*error, 0);
</span><span class="cx">     WebCore::Text* item = WebKit::core(self);
</span><del>-    WebCore::ExceptionCode ec = 0;
-    RefPtr&lt;WebCore::Text&gt; gobjectResult = WTF::getPtr(item-&gt;splitText(offset, ec));
-    if (ec) {
-        WebCore::ExceptionCodeDescription ecdesc(ec);
</del><ins>+    auto result = item-&gt;splitText(offset);
+    if (result.hasException()) {
+        WebCore::ExceptionCodeDescription ecdesc(result.releaseException().code());
</ins><span class="cx">         g_set_error_literal(error, g_quark_from_string(&quot;WEBKIT_DOM&quot;), ecdesc.code, ecdesc.name);
</span><ins>+        return nullptr;
</ins><span class="cx">     }
</span><del>-    return WebKit::kit(gobjectResult.get());
</del><ins>+    return WebKit::kit(result.releaseReturnValue().ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> gchar* webkit_dom_text_get_whole_text(WebKitDOMText* self)
</span></span></pre>
</div>
</div>

</body>
</html>