<!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>[207522] 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/207522">207522</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-10-19 00:00:10 -0700 (Wed, 19 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move many miscellaneous classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163645

Reviewed by Ryosuke Niwa.

Source/WebCore:

* bindings/js/JSCryptoCustom.cpp:
(WebCore::JSCrypto::getRandomValues): Use propagateException.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage): Ditto.
(WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
(WebCore::JSDOMWindow::setInterval): Ditto.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter): Use propagateException.
(WebCore::JSStorage::deleteProperty): Ditto.
(WebCore::JSStorage::getOwnPropertyNames): Ditto.
(WebCore::JSStorage::putDelegate): Ditto.

* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::update): Use ExceptionOr.
(WebCore::DOMApplicationCache::swapCache): Ditto.
* loader/appcache/DOMApplicationCache.h: Update for above changes.
* loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.

* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues): Use ExceptionOr.
(WebCore::Crypto::webkitSubtle): Ditto.
* page/Crypto.h: Updated for above changes.
* page/Crypto.idl: Use non-legacy exceptions.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow): Initialize many data members in
the class definition instead of here.
(WebCore::DOMWindow::page): Use nullptr.
(WebCore::DOMWindow::screen): Ditto.
(WebCore::DOMWindow::crypto): Ditto.
(WebCore::DOMWindow::locationbar): Ditto.
(WebCore::DOMWindow::menubar): Ditto.
(WebCore::DOMWindow::personalbar): Ditto.
(WebCore::DOMWindow::scrollbars): Ditto.
(WebCore::DOMWindow::statusbar): Ditto.
(WebCore::DOMWindow::toolbar): Ditto.
(WebCore::DOMWindow::applicationCache): Ditto.
(WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
(WebCore::DOMWindow::localStorage): Ditto.
(WebCore::DOMWindow::postMessage): Ditto.
(WebCore::DOMWindow::frameElement): Use nullptr.
(WebCore::DOMWindow::self): Ditto.
(WebCore::DOMWindow::opener): Ditto.
(WebCore::DOMWindow::parent): Ditto.
(WebCore::DOMWindow::top): Ditto.
(WebCore::DOMWindow::getComputedStyle): Use Ref.
(WebCore::DOMWindow::setTimeout): Use ExceptionOr.
(WebCore::DOMWindow::setInterval): Ditto.
(WebCore::didAddStorageEventListener): Use a reference instead of a
pointer, and ignore return value instead of using IGNORE_EXCEPTION.
(WebCore::DOMWindow::addEventListener): Pass reference to function above.
(WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
* page/DOMWindow.h: Updated for changes above. Also changed indentatation.
* page/DOMWindow.idl: Use non-legacy exceptions.

* page/EventSource.cpp:
(WebCore::EventSource::create): Use ExceptionOr.
* page/EventSource.h: Updated for change above.
* page/EventSource.idl: Use non-legacy exception.

* page/Location.cpp:
(WebCore::Location::setProtocol): Use ExceptionOr.
* page/Location.h: Updated for change above.
* page/Location.idl: Use non-legacy exception.

* page/Performance.cpp:
(WebCore::Performance::Performance): Remove unnecessary initialization of
smart pointer to null, and moved initialization of m_resourceTimingBufferSize
to the header.
(WebCore::Performance::navigation): Made non-const and return a reference.
(WebCore::Performance::timing): Ditto.
(WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
a const&amp; instead of passing in a copy.
(WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
(WebCore::Performance::webkitClearMarks): Ditto.
(WebCore::Performance::webkitMeasure): Ditto.
(WebCore::Performance::webkitClearMeasures): Ditto.
(WebCore::Performance::reduceTimeResolution): Use std::floor.
* page/Performance.h: Updated for above changes. Removed unneeded includes.
Made more things private. Removed unneeded reference counting of UserTiming.
* page/Performance.idl: Use non-legacy exceptions.

* page/PerformanceUserTiming.cpp:
(WebCore::restrictedMarkFunction): Removed unneeded class name.
(WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
(WebCore::UserTiming::mark): Use ExceptionOr.
(WebCore::UserTiming::findExistingMarkStartTime): Ditto.
(WebCore::UserTiming::measure): Ditto.
(WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
* page/PerformanceUserTiming.h: Updated for above changes. Removed reference
counting since this is a single-owner object.

* page/UserMessageHandler.cpp:
(WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
* page/UserMessageHandler.h: Updated for above change.
* page/UserMessageHandler.idl: Use non-legacy exception.

* storage/Storage.cpp:
(WebCore::Storage::length): Use ExceptionOr.
(WebCore::Storage::key): Ditto.
(WebCore::Storage::getItem): Ditto.
(WebCore::Storage::setItem): Ditto.
(WebCore::Storage::removeItem): Ditto.
(WebCore::Storage::clear): Ditto.
(WebCore::Storage::contains): Ditto.
* storage/Storage.h: Updated for above change.
* storage/Storage.idl: Use non-legacy exceptions.

* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
Updated for ExceptionOr.
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMDocument::getComputedStyle): Use ptr instead of get since the return
value is now Ref instead of RefPtr.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoCustomcpp">trunk/Source/WebCore/bindings/js/JSCryptoCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSStorageCustomcpp">trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheDOMApplicationCachecpp">trunk/Source/WebCore/loader/appcache/DOMApplicationCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheDOMApplicationCacheh">trunk/Source/WebCore/loader/appcache/DOMApplicationCache.h</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheDOMApplicationCacheidl">trunk/Source/WebCore/loader/appcache/DOMApplicationCache.idl</a></li>
<li><a href="#trunkSourceWebCorepageCryptocpp">trunk/Source/WebCore/page/Crypto.cpp</a></li>
<li><a href="#trunkSourceWebCorepageCryptoh">trunk/Source/WebCore/page/Crypto.h</a></li>
<li><a href="#trunkSourceWebCorepageCryptoidl">trunk/Source/WebCore/page/Crypto.idl</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowidl">trunk/Source/WebCore/page/DOMWindow.idl</a></li>
<li><a href="#trunkSourceWebCorepageEventSourcecpp">trunk/Source/WebCore/page/EventSource.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventSourceh">trunk/Source/WebCore/page/EventSource.h</a></li>
<li><a href="#trunkSourceWebCorepageEventSourceidl">trunk/Source/WebCore/page/EventSource.idl</a></li>
<li><a href="#trunkSourceWebCorepageLocationcpp">trunk/Source/WebCore/page/Location.cpp</a></li>
<li><a href="#trunkSourceWebCorepageLocationh">trunk/Source/WebCore/page/Location.h</a></li>
<li><a href="#trunkSourceWebCorepageLocationidl">trunk/Source/WebCore/page/Location.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformancecpp">trunk/Source/WebCore/page/Performance.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceh">trunk/Source/WebCore/page/Performance.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceidl">trunk/Source/WebCore/page/Performance.idl</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceUserTimingcpp">trunk/Source/WebCore/page/PerformanceUserTiming.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceUserTimingh">trunk/Source/WebCore/page/PerformanceUserTiming.h</a></li>
<li><a href="#trunkSourceWebCorepageUserMessageHandlercpp">trunk/Source/WebCore/page/UserMessageHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserMessageHandlerh">trunk/Source/WebCore/page/UserMessageHandler.h</a></li>
<li><a href="#trunkSourceWebCorepageUserMessageHandleridl">trunk/Source/WebCore/page/UserMessageHandler.idl</a></li>
<li><a href="#trunkSourceWebCorestorageStoragecpp">trunk/Source/WebCore/storage/Storage.cpp</a></li>
<li><a href="#trunkSourceWebCorestorageStorageh">trunk/Source/WebCore/storage/Storage.h</a></li>
<li><a href="#trunkSourceWebCorestorageStorageidl">trunk/Source/WebCore/storage/Storage.idl</a></li>
<li><a href="#trunkSourceWebCorestorageStorageEventDispatchercpp">trunk/Source/WebCore/storage/StorageEventDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinDOMCoreClassescpp">trunk/Source/WebKit/win/DOMCoreClasses.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/ChangeLog        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -1,5 +1,125 @@
</span><span class="cx"> 2016-10-18  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move many miscellaneous classes from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=163645
+
+        Reviewed by Ryosuke Niwa.
+
+        * bindings/js/JSCryptoCustom.cpp:
+        (WebCore::JSCrypto::getRandomValues): Use propagateException.
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::handlePostMessage): Ditto.
+        (WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
+        (WebCore::JSDOMWindow::setInterval): Ditto.
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::nameGetter): Use propagateException.
+        (WebCore::JSStorage::deleteProperty): Ditto.
+        (WebCore::JSStorage::getOwnPropertyNames): Ditto.
+        (WebCore::JSStorage::putDelegate): Ditto.
+
+        * loader/appcache/DOMApplicationCache.cpp:
+        (WebCore::DOMApplicationCache::update): Use ExceptionOr.
+        (WebCore::DOMApplicationCache::swapCache): Ditto.
+        * loader/appcache/DOMApplicationCache.h: Update for above changes.
+        * loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
+
+        * page/Crypto.cpp:
+        (WebCore::Crypto::getRandomValues): Use ExceptionOr.
+        (WebCore::Crypto::webkitSubtle): Ditto.
+        * page/Crypto.h: Updated for above changes.
+        * page/Crypto.idl: Use non-legacy exceptions.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::DOMWindow): Initialize many data members in
+        the class definition instead of here.
+        (WebCore::DOMWindow::page): Use nullptr.
+        (WebCore::DOMWindow::screen): Ditto.
+        (WebCore::DOMWindow::crypto): Ditto.
+        (WebCore::DOMWindow::locationbar): Ditto.
+        (WebCore::DOMWindow::menubar): Ditto.
+        (WebCore::DOMWindow::personalbar): Ditto.
+        (WebCore::DOMWindow::scrollbars): Ditto.
+        (WebCore::DOMWindow::statusbar): Ditto.
+        (WebCore::DOMWindow::toolbar): Ditto.
+        (WebCore::DOMWindow::applicationCache): Ditto.
+        (WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
+        (WebCore::DOMWindow::localStorage): Ditto.
+        (WebCore::DOMWindow::postMessage): Ditto.
+        (WebCore::DOMWindow::frameElement): Use nullptr.
+        (WebCore::DOMWindow::self): Ditto.
+        (WebCore::DOMWindow::opener): Ditto.
+        (WebCore::DOMWindow::parent): Ditto.
+        (WebCore::DOMWindow::top): Ditto.
+        (WebCore::DOMWindow::getComputedStyle): Use Ref.
+        (WebCore::DOMWindow::setTimeout): Use ExceptionOr.
+        (WebCore::DOMWindow::setInterval): Ditto.
+        (WebCore::didAddStorageEventListener): Use a reference instead of a
+        pointer, and ignore return value instead of using IGNORE_EXCEPTION.
+        (WebCore::DOMWindow::addEventListener): Pass reference to function above.
+        (WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
+        * page/DOMWindow.h: Updated for changes above. Also changed indentatation.
+        * page/DOMWindow.idl: Use non-legacy exceptions.
+
+        * page/EventSource.cpp:
+        (WebCore::EventSource::create): Use ExceptionOr.
+        * page/EventSource.h: Updated for change above.
+        * page/EventSource.idl: Use non-legacy exception.
+
+        * page/Location.cpp:
+        (WebCore::Location::setProtocol): Use ExceptionOr.
+        * page/Location.h: Updated for change above.
+        * page/Location.idl: Use non-legacy exception.
+
+        * page/Performance.cpp:
+        (WebCore::Performance::Performance): Remove unnecessary initialization of
+        smart pointer to null, and moved initialization of m_resourceTimingBufferSize
+        to the header.
+        (WebCore::Performance::navigation): Made non-const and return a reference.
+        (WebCore::Performance::timing): Ditto.
+        (WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
+        a const&amp; instead of passing in a copy.
+        (WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
+        (WebCore::Performance::webkitClearMarks): Ditto.
+        (WebCore::Performance::webkitMeasure): Ditto.
+        (WebCore::Performance::webkitClearMeasures): Ditto.
+        (WebCore::Performance::reduceTimeResolution): Use std::floor.
+        * page/Performance.h: Updated for above changes. Removed unneeded includes.
+        Made more things private. Removed unneeded reference counting of UserTiming.
+        * page/Performance.idl: Use non-legacy exceptions.
+
+        * page/PerformanceUserTiming.cpp:
+        (WebCore::restrictedMarkFunction): Removed unneeded class name.
+        (WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
+        (WebCore::UserTiming::mark): Use ExceptionOr.
+        (WebCore::UserTiming::findExistingMarkStartTime): Ditto.
+        (WebCore::UserTiming::measure): Ditto.
+        (WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
+        * page/PerformanceUserTiming.h: Updated for above changes. Removed reference
+        counting since this is a single-owner object.
+
+        * page/UserMessageHandler.cpp:
+        (WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
+        * page/UserMessageHandler.h: Updated for above change.
+        * page/UserMessageHandler.idl: Use non-legacy exception.
+
+        * storage/Storage.cpp:
+        (WebCore::Storage::length): Use ExceptionOr.
+        (WebCore::Storage::key): Ditto.
+        (WebCore::Storage::getItem): Ditto.
+        (WebCore::Storage::setItem): Ditto.
+        (WebCore::Storage::removeItem): Ditto.
+        (WebCore::Storage::clear): Ditto.
+        (WebCore::Storage::contains): Ditto.
+        * storage/Storage.h: Updated for above change.
+        * storage/Storage.idl: Use non-legacy exceptions.
+
+        * storage/StorageEventDispatcher.cpp:
+        (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
+        Updated for ExceptionOr.
+        (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
+
+2016-10-18  Darin Adler  &lt;darin@apple.com&gt;
+
</ins><span class="cx">         Move internal testing classes from ExceptionCode to Exception
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=163553
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoCustom.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoCustom.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/bindings/js/JSCryptoCustom.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -45,18 +45,12 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     JSValue buffer = state.argument(0);
</span><del>-    RefPtr&lt;ArrayBufferView&gt; arrayBufferView = toArrayBufferView(buffer);
</del><ins>+    auto arrayBufferView = toArrayBufferView(buffer);
</ins><span class="cx">     if (!arrayBufferView)
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    wrapped().getRandomValues(arrayBufferView.get(), ec);
</del><ins>+    propagateException(state, scope, wrapped().getRandomValues(*arrayBufferView));
</ins><span class="cx"> 
</span><del>-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
</del><span class="cx">     return buffer;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -526,15 +526,12 @@
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx"> 
</span><span class="cx">     auto message = SerializedScriptValue::create(state, state.uncheckedArgument(0), messagePorts, WTFMove(arrayBuffers));
</span><del>-
</del><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx"> 
</span><span class="cx">     String targetOrigin = valueToUSVStringWithUndefinedOrNullCheck(&amp;state, state.uncheckedArgument(targetOriginArgIndex));
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    impl.postMessage(WTFMove(message), WTFMove(messagePorts), targetOrigin, callerDOMWindow(&amp;state), ec);
-    setDOMException(&amp;state, ec);
</del><ins>+    propagateException(state, scope, impl.postMessage(message.releaseNonNull(), WTFMove(messagePorts), targetOrigin, callerDOMWindow(&amp;state)));
</ins><span class="cx"> 
</span><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="lines">@@ -552,20 +549,14 @@
</span><span class="cx">     if (UNLIKELY(state.argumentCount() &lt; 1))
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><del>-    ContentSecurityPolicy* contentSecurityPolicy = wrapped().document() ? wrapped().document()-&gt;contentSecurityPolicy() : nullptr;
-    std::unique_ptr&lt;ScheduledAction&gt; action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), contentSecurityPolicy);
</del><ins>+    auto* contentSecurityPolicy = wrapped().document() ? wrapped().document()-&gt;contentSecurityPolicy() : nullptr;
+    auto action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), contentSecurityPolicy);
</ins><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-
</del><span class="cx">     if (!action)
</span><span class="cx">         return jsNumber(0);
</span><span class="cx"> 
</span><span class="cx">     int delay = state.argument(1).toInt32(&amp;state);
</span><del>-
-    ExceptionCode ec = 0;
-    int result = wrapped().setTimeout(WTFMove(action), delay, ec);
-    setDOMException(&amp;state, ec);
-
-    return jsNumber(result);
</del><ins>+    return toJSNumber(state, scope, wrapped().setTimeout(WTFMove(action), delay));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSDOMWindow::setInterval(ExecState&amp; state)
</span><span class="lines">@@ -576,19 +567,14 @@
</span><span class="cx">     if (UNLIKELY(state.argumentCount() &lt; 1))
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><del>-    ContentSecurityPolicy* contentSecurityPolicy = wrapped().document() ? wrapped().document()-&gt;contentSecurityPolicy() : nullptr;
-    std::unique_ptr&lt;ScheduledAction&gt; action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), contentSecurityPolicy);
</del><ins>+    auto* contentSecurityPolicy = wrapped().document() ? wrapped().document()-&gt;contentSecurityPolicy() : nullptr;
+    auto action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), contentSecurityPolicy);
</ins><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    int delay = state.argument(1).toInt32(&amp;state);
-
</del><span class="cx">     if (!action)
</span><span class="cx">         return jsNumber(0);
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    int result = wrapped().setInterval(WTFMove(action), delay, ec);
-    setDOMException(&amp;state, ec);
-
-    return jsNumber(result);
</del><ins>+    int delay = state.argument(1).toInt32(&amp;state);
+    return toJSNumber(state, scope, wrapped().setInterval(WTFMove(action), delay));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DOMWindow* JSDOMWindow::toWrapped(JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSStorageCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -35,40 +35,42 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-bool JSStorage::nameGetter(ExecState* exec, PropertyName propertyName, JSValue&amp; value)
</del><ins>+bool JSStorage::nameGetter(ExecState* state, PropertyName propertyName, JSValue&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     if (propertyName.isSymbol())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    String item = wrapped().getItem(propertyNameToString(propertyName), ec);
-    setDOMException(exec, ec);
</del><ins>+    auto item = wrapped().getItem(propertyNameToString(propertyName));
+    if (item.hasException())
+        propagateException(*state, item.releaseException());
</ins><span class="cx"> 
</span><del>-    if (item.isNull())
</del><ins>+    auto string = item.releaseReturnValue();
+    if (string.isNull())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    value = jsStringWithCache(exec, item);
</del><ins>+    value = jsStringWithCache(state, string);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
</del><ins>+bool JSStorage::deleteProperty(JSCell* cell, ExecState* state, PropertyName propertyName)
</ins><span class="cx"> {
</span><del>-    JSStorage* thisObject = jsCast&lt;JSStorage*&gt;(cell);
</del><ins>+    auto&amp; thisObject = *jsCast&lt;JSStorage*&gt;(cell);
+
</ins><span class="cx">     // Only perform the custom delete if the object doesn't have a native property by this name.
</span><span class="cx">     // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
</span><span class="cx">     // the native property slots manually.
</span><del>-    PropertySlot slot(thisObject, PropertySlot::InternalMethodType::GetOwnProperty);
</del><ins>+    PropertySlot slot(&amp;thisObject, PropertySlot::InternalMethodType::GetOwnProperty);
</ins><span class="cx"> 
</span><del>-    JSValue prototype = thisObject-&gt;getPrototypeDirect();
-    if (prototype.isObject() &amp;&amp; asObject(prototype)-&gt;getPropertySlot(exec, propertyName, slot))
-        return Base::deleteProperty(thisObject, exec, propertyName);
</del><ins>+    JSValue prototype = thisObject.getPrototypeDirect();
+    if (prototype.isObject() &amp;&amp; asObject(prototype)-&gt;getPropertySlot(state, propertyName, slot))
+        return Base::deleteProperty(&amp;thisObject, state, propertyName);
</ins><span class="cx"> 
</span><span class="cx">     if (propertyName.isSymbol())
</span><del>-        return Base::deleteProperty(thisObject, exec, propertyName);
</del><ins>+        return Base::deleteProperty(&amp;thisObject, state, propertyName);
</ins><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    thisObject-&gt;wrapped().removeItem(propertyNameToString(propertyName), ec);
-    setDOMException(exec, ec);
</del><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    propagateException(*state, scope, thisObject.wrapped().removeItem(propertyNameToString(propertyName)));
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -77,28 +79,33 @@
</span><span class="cx">     return deleteProperty(cell, exec, Identifier::from(exec, propertyName));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray&amp; propertyNames, EnumerationMode mode)
</del><ins>+void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray&amp; propertyNames, EnumerationMode mode)
</ins><span class="cx"> {
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><ins>+    VM&amp; vm = state-&gt;vm();
</ins><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><del>-    JSStorage* thisObject = jsCast&lt;JSStorage*&gt;(object);
-    ExceptionCode ec = 0;
-    unsigned length = thisObject-&gt;wrapped().length(ec);
-    setDOMException(exec, ec);
-    RETURN_IF_EXCEPTION(scope, void());
</del><ins>+    auto&amp; thisObject = *jsCast&lt;JSStorage*&gt;(object);
+    auto lengthResult = thisObject.wrapped().length();
+    if (lengthResult.hasException()) {
+        propagateException(*state, scope, lengthResult.releaseException());
+        return;
+    }
+    unsigned length = lengthResult.releaseReturnValue();
</ins><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><del>-        propertyNames.add(Identifier::fromString(exec, thisObject-&gt;wrapped().key(i, ec)));
-        setDOMException(exec, ec);
-        RETURN_IF_EXCEPTION(scope, void());
</del><ins>+        auto keyResult = thisObject.wrapped().key(i);
+        if (keyResult.hasException()) {
+            propagateException(*state, scope, lengthResult.releaseException());
+            return;
+        }
+        propertyNames.add(Identifier::fromString(state, keyResult.releaseReturnValue()));
</ins><span class="cx">     }
</span><span class="cx">         
</span><del>-    Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
</del><ins>+    Base::getOwnPropertyNames(&amp;thisObject, state, propertyNames, mode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool JSStorage::putDelegate(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&amp;, bool&amp; putResult)
</del><ins>+bool JSStorage::putDelegate(ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot&amp;, bool&amp; putResult)
</ins><span class="cx"> {
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><ins>+    VM&amp; vm = state-&gt;vm();
</ins><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     // Only perform the custom put if the object doesn't have a native property by this name.
</span><span class="lines">@@ -107,13 +114,13 @@
</span><span class="cx">     PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty);
</span><span class="cx"> 
</span><span class="cx">     JSValue prototype = this-&gt;getPrototypeDirect();
</span><del>-    if (prototype.isObject() &amp;&amp; asObject(prototype)-&gt;getPropertySlot(exec, propertyName, slot))
</del><ins>+    if (prototype.isObject() &amp;&amp; asObject(prototype)-&gt;getPropertySlot(state, propertyName, slot))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (propertyName.isSymbol())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    String stringValue = value.toString(exec)-&gt;value(exec);
</del><ins>+    String stringValue = value.toString(state)-&gt;value(state);
</ins><span class="cx">     if (UNLIKELY(scope.exception())) {
</span><span class="cx">         // The return value indicates whether putDelegate() should handle the put operation (which
</span><span class="cx">         // if true, tells the caller not to execute the generic put). It does not indicate whether
</span><span class="lines">@@ -123,10 +130,9 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExceptionCode ec = 0;
-    wrapped().setItem(propertyNameToString(propertyName), stringValue, ec);
-    setDOMException(exec, ec);
-    putResult = !ec;
</del><ins>+    auto setItemResult = wrapped().setItem(propertyNameToString(propertyName), stringValue);
+    putResult = !setItemResult.hasException();
+    propagateException(*state, scope, WTFMove(setItemResult));
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheDOMApplicationCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/DOMApplicationCache.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/DOMApplicationCache.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/loader/appcache/DOMApplicationCache.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -82,18 +82,20 @@
</span><span class="cx">     return cacheHost-&gt;status();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMApplicationCache::update(ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; DOMApplicationCache::update()
</ins><span class="cx"> {
</span><del>-    ApplicationCacheHost* cacheHost = applicationCacheHost();
</del><ins>+    auto* cacheHost = applicationCacheHost();
</ins><span class="cx">     if (!cacheHost || !cacheHost-&gt;update())
</span><del>-        ec = INVALID_STATE_ERR;
</del><ins>+        return Exception { INVALID_STATE_ERR };
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMApplicationCache::swapCache(ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; DOMApplicationCache::swapCache()
</ins><span class="cx"> {
</span><del>-    ApplicationCacheHost* cacheHost = applicationCacheHost();
</del><ins>+    auto* cacheHost = applicationCacheHost();
</ins><span class="cx">     if (!cacheHost || !cacheHost-&gt;swapCache())
</span><del>-        ec = INVALID_STATE_ERR;
</del><ins>+        return Exception { INVALID_STATE_ERR };
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DOMApplicationCache::abort()
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheDOMApplicationCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/DOMApplicationCache.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/DOMApplicationCache.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/loader/appcache/DOMApplicationCache.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -23,16 +23,14 @@
</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 DOMApplicationCache_h
-#define DOMApplicationCache_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;ApplicationCacheHost.h&quot;
</span><span class="cx"> #include &quot;DOMWindowProperty.h&quot;
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><del>-#include &lt;wtf/Forward.h&gt;
</del><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/text/AtomicStringHash.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -50,8 +48,8 @@
</span><span class="cx">     void willDestroyGlobalObjectInFrame() override;
</span><span class="cx"> 
</span><span class="cx">     unsigned short status() const;
</span><del>-    void update(ExceptionCode&amp;);
-    void swapCache(ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; update();
+    ExceptionOr&lt;void&gt; swapCache();
</ins><span class="cx">     void abort();
</span><span class="cx"> 
</span><span class="cx">     using RefCounted&lt;DOMApplicationCache&gt;::ref;
</span><span class="lines">@@ -72,5 +70,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // DOMApplicationCache_h
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheDOMApplicationCacheidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/DOMApplicationCache.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/DOMApplicationCache.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/loader/appcache/DOMApplicationCache.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -37,8 +37,8 @@
</span><span class="cx">     const unsigned short OBSOLETE = 5;
</span><span class="cx">     readonly attribute unsigned short status;
</span><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void update();
-    [MayThrowLegacyException] void swapCache();
</del><ins>+    [MayThrowException] void update();
+    [MayThrowException] void swapCache();
</ins><span class="cx">     void abort();
</span><span class="cx"> 
</span><span class="cx">     attribute EventHandler onchecking;
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Crypto.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -52,31 +52,27 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Crypto::getRandomValues(ArrayBufferView* array, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; Crypto::getRandomValues(ArrayBufferView&amp; array)
</ins><span class="cx"> {
</span><del>-    if (!array || !JSC::isInt(array-&gt;getType())) {
-        ec = TYPE_MISMATCH_ERR;
-        return;
-    }
-    if (array-&gt;byteLength() &gt; 65536) {
-        ec = QUOTA_EXCEEDED_ERR;
-        return;
-    }
-    cryptographicallyRandomValues(array-&gt;baseAddress(), array-&gt;byteLength());
</del><ins>+    if (!isInt(array.getType()))
+        return Exception { TYPE_MISMATCH_ERR };
+    if (array.byteLength() &gt; 65536)
+        return Exception { QUOTA_EXCEEDED_ERR };
+    cryptographicallyRandomValues(array.baseAddress(), array.byteLength());
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+
</ins><span class="cx"> SubtleCrypto&amp; Crypto::subtle()
</span><span class="cx"> {
</span><span class="cx">     return m_subtle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebKitSubtleCrypto* Crypto::webkitSubtle(ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;WebKitSubtleCrypto*&gt; Crypto::webkitSubtle()
</ins><span class="cx"> {
</span><del>-    if (!isMainThread()) {
-        ec = NOT_SUPPORTED_ERR;
-        return 0;
-    }
</del><ins>+    if (!isMainThread())
+        return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (!m_webkitSubtle)
</span><span class="cx">         m_webkitSubtle = WebKitSubtleCrypto::create(*downcast&lt;Document&gt;(scriptExecutionContext()));
</span><span class="lines">@@ -83,6 +79,7 @@
</span><span class="cx"> 
</span><span class="cx">     return m_webkitSubtle.get();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Crypto.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -27,13 +27,10 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef Crypto_h
-#define Crypto_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;ContextDestructionObserver.h&quot;
</span><del>-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
</del><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class ArrayBufferView;
</span><span class="lines">@@ -41,11 +38,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
-class Document;
</del><ins>+class SubtleCrypto;
</ins><span class="cx"> class WebKitSubtleCrypto;
</span><del>-class SubtleCrypto;
</del><span class="cx"> 
</span><span class="cx"> class Crypto : public ContextDestructionObserver, public RefCounted&lt;Crypto&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -52,13 +46,13 @@
</span><span class="cx">     static Ref&lt;Crypto&gt; create(ScriptExecutionContext&amp; context) { return adoptRef(*new Crypto(context)); }
</span><span class="cx">     virtual ~Crypto();
</span><span class="cx"> 
</span><del>-    void getRandomValues(JSC::ArrayBufferView*, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; getRandomValues(JSC::ArrayBufferView&amp;);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="cx">     SubtleCrypto&amp; subtle();
</span><span class="cx"> 
</span><span class="cx">     // Will be deprecated.
</span><del>-    WebKitSubtleCrypto* webkitSubtle(ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;WebKitSubtleCrypto*&gt; webkitSubtle();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -73,5 +67,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorepageCryptoidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Crypto.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -32,8 +32,8 @@
</span><span class="cx">     GenerateIsReachable=ImplScriptExecutionContext,
</span><span class="cx"> ] interface Crypto {
</span><span class="cx">     [Conditional=SUBTLE_CRYPTO] readonly attribute SubtleCrypto subtle;
</span><del>-    [Custom, MayThrowLegacyException] ArrayBufferView getRandomValues(ArrayBufferView array);
</del><ins>+    [Custom, MayThrowException] ArrayBufferView getRandomValues(ArrayBufferView array);
</ins><span class="cx"> 
</span><span class="cx">     // Will be deprecated.
</span><del>-    [Conditional=SUBTLE_CRYPTO, GetterMayThrowLegacyException] readonly attribute WebKitSubtleCrypto webkitSubtle;
</del><ins>+    [Conditional=SUBTLE_CRYPTO, GetterMayThrowException] readonly attribute WebKitSubtleCrypto webkitSubtle;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -406,19 +406,7 @@
</span><span class="cx"> DOMWindow::DOMWindow(Document* document)
</span><span class="cx">     : ContextDestructionObserver(document)
</span><span class="cx">     , FrameDestructionObserver(document-&gt;frame())
</span><del>-    , m_shouldPrintWhenFinishedLoading(false)
-    , m_suspendedForDocumentSuspension(false)
-    , m_lastPageStatus(PageStatusNone)
</del><span class="cx">     , m_weakPtrFactory(this)
</span><del>-#if PLATFORM(IOS)
-    , m_scrollEventListenerCount(0)
-#endif
-#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
-    , m_touchEventListenerCount(0)
-#endif
-#if ENABLE(GAMEPAD)
-    , m_gamepadEventListenerCount(0)
-#endif
</del><span class="cx"> {
</span><span class="cx">     ASSERT(frame());
</span><span class="cx">     ASSERT(DOMWindow::document());
</span><span class="lines">@@ -488,7 +476,7 @@
</span><span class="cx"> 
</span><span class="cx"> Page* DOMWindow::page()
</span><span class="cx"> {
</span><del>-    return frame() ? frame()-&gt;page() : 0;
</del><ins>+    return frame() ? frame()-&gt;page() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DOMWindow::frameDestroyed()
</span><span class="lines">@@ -537,6 +525,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GAMEPAD)
</span><ins>+
</ins><span class="cx"> void DOMWindow::incrementGamepadEventListenerCount()
</span><span class="cx"> {
</span><span class="cx">     if (++m_gamepadEventListenerCount == 1)
</span><span class="lines">@@ -550,6 +539,7 @@
</span><span class="cx">     if (!--m_gamepadEventListenerCount)
</span><span class="cx">         GamepadManager::singleton().unregisterDOMWindow(this);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void DOMWindow::registerProperty(DOMWindowProperty* property)
</span><span class="lines">@@ -635,6 +625,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><ins>+
</ins><span class="cx"> CustomElementRegistry&amp; DOMWindow::ensureCustomElementRegistry()
</span><span class="cx"> {
</span><span class="cx">     if (!m_customElementRegistry)
</span><span class="lines">@@ -641,9 +632,11 @@
</span><span class="cx">         m_customElementRegistry = CustomElementRegistry::create(*this);
</span><span class="cx">     return *m_customElementRegistry;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ORIENTATION_EVENTS)
</span><ins>+
</ins><span class="cx"> int DOMWindow::orientation() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><span class="lines">@@ -651,12 +644,13 @@
</span><span class="cx"> 
</span><span class="cx">     return m_frame-&gt;orientation();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> Screen* DOMWindow::screen() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_screen)
</span><span class="cx">         m_screen = Screen::create(m_frame);
</span><span class="cx">     return m_screen.get();
</span><span class="lines">@@ -675,7 +669,7 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Why is crypto not available when the window is not currently displayed in a frame?
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_crypto)
</span><span class="cx">         m_crypto = Crypto::create(*document());
</span><span class="cx">     return m_crypto.get();
</span><span class="lines">@@ -684,7 +678,7 @@
</span><span class="cx"> BarProp* DOMWindow::locationbar() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_locationbar)
</span><span class="cx">         m_locationbar = BarProp::create(m_frame, BarProp::Locationbar);
</span><span class="cx">     return m_locationbar.get();
</span><span class="lines">@@ -693,7 +687,7 @@
</span><span class="cx"> BarProp* DOMWindow::menubar() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_menubar)
</span><span class="cx">         m_menubar = BarProp::create(m_frame, BarProp::Menubar);
</span><span class="cx">     return m_menubar.get();
</span><span class="lines">@@ -702,7 +696,7 @@
</span><span class="cx"> BarProp* DOMWindow::personalbar() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_personalbar)
</span><span class="cx">         m_personalbar = BarProp::create(m_frame, BarProp::Personalbar);
</span><span class="cx">     return m_personalbar.get();
</span><span class="lines">@@ -711,7 +705,7 @@
</span><span class="cx"> BarProp* DOMWindow::scrollbars() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_scrollbars)
</span><span class="cx">         m_scrollbars = BarProp::create(m_frame, BarProp::Scrollbars);
</span><span class="cx">     return m_scrollbars.get();
</span><span class="lines">@@ -720,7 +714,7 @@
</span><span class="cx"> BarProp* DOMWindow::statusbar() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_statusbar)
</span><span class="cx">         m_statusbar = BarProp::create(m_frame, BarProp::Statusbar);
</span><span class="cx">     return m_statusbar.get();
</span><span class="lines">@@ -729,7 +723,7 @@
</span><span class="cx"> BarProp* DOMWindow::toolbar() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_toolbar)
</span><span class="cx">         m_toolbar = BarProp::create(m_frame, BarProp::Toolbar);
</span><span class="cx">     return m_toolbar.get();
</span><span class="lines">@@ -745,7 +739,7 @@
</span><span class="cx"> DOMApplicationCache* DOMWindow::applicationCache() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!m_applicationCache)
</span><span class="cx">         m_applicationCache = DOMApplicationCache::create(m_frame);
</span><span class="cx">     return m_applicationCache.get();
</span><span class="lines">@@ -761,6 +755,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><ins>+
</ins><span class="cx"> Performance* DOMWindow::performance() const
</span><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><span class="lines">@@ -769,6 +764,7 @@
</span><span class="cx">         m_performance = Performance::create(*m_frame);
</span><span class="cx">     return m_performance.get();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> double DOMWindow::nowTimestamp() const
</span><span class="lines">@@ -790,6 +786,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span><ins>+
</ins><span class="cx"> bool DOMWindow::shouldHaveWebKitNamespaceForWorld(DOMWrapperWorld&amp; world)
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><span class="lines">@@ -821,67 +818,58 @@
</span><span class="cx">         m_webkitNamespace = WebKitNamespace::create(*m_frame, page-&gt;userContentProvider());
</span><span class="cx">     return m_webkitNamespace.get();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-Storage* DOMWindow::sessionStorage(ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;Storage*&gt; DOMWindow::sessionStorage() const
</ins><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    Document* document = this-&gt;document();
</del><ins>+    auto* document = this-&gt;document();
</ins><span class="cx">     if (!document)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    if (!document-&gt;securityOrigin()-&gt;canAccessSessionStorage(document-&gt;topOrigin())) {
-        ec = SECURITY_ERR;
-        return 0;
-    }
</del><ins>+    if (!document-&gt;securityOrigin()-&gt;canAccessSessionStorage(document-&gt;topOrigin()))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (m_sessionStorage) {
</span><del>-        if (!m_sessionStorage-&gt;area().canAccessStorage(m_frame)) {
-            ec = SECURITY_ERR;
-            return 0;
-        }
</del><ins>+        if (!m_sessionStorage-&gt;area().canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx">         return m_sessionStorage.get();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Page* page = document-&gt;page();
</del><ins>+    auto* page = document-&gt;page();
</ins><span class="cx">     if (!page)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     auto storageArea = page-&gt;sessionStorage()-&gt;storageArea(document-&gt;securityOrigin());
</span><del>-    if (!storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return 0;
-    }
</del><ins>+    if (!storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     m_sessionStorage = Storage::create(m_frame, WTFMove(storageArea));
</span><span class="cx">     return m_sessionStorage.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Storage* DOMWindow::localStorage(ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;Storage*&gt; DOMWindow::localStorage() const
</ins><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    Document* document = this-&gt;document();
</del><ins>+    auto* document = this-&gt;document();
</ins><span class="cx">     if (!document)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (!document-&gt;securityOrigin()-&gt;canAccessLocalStorage(nullptr)) {
-        ec = SECURITY_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!document-&gt;securityOrigin()-&gt;canAccessLocalStorage(nullptr))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><del>-    Page* page = document-&gt;page();
</del><ins>+    auto* page = document-&gt;page();
</ins><span class="cx">     // FIXME: We should consider supporting access/modification to local storage
</span><span class="cx">     // after calling window.close(). See &lt;https://bugs.webkit.org/show_bug.cgi?id=135330&gt;.
</span><span class="cx">     if (!page || !page-&gt;isClosing()) {
</span><span class="cx">         if (m_localStorage) {
</span><del>-            if (!m_localStorage-&gt;area().canAccessStorage(m_frame)) {
-                ec = SECURITY_ERR;
-                return nullptr;
-            }
</del><ins>+            if (!m_localStorage-&gt;area().canAccessStorage(m_frame))
+                return Exception { SECURITY_ERR };
</ins><span class="cx">             return m_localStorage.get();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -897,19 +885,17 @@
</span><span class="cx"> 
</span><span class="cx">     auto storageArea = page-&gt;storageNamespaceProvider().localStorageArea(*document);
</span><span class="cx"> 
</span><del>-    if (!storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     m_localStorage = Storage::create(m_frame, WTFMove(storageArea));
</span><span class="cx">     return m_localStorage.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMWindow::postMessage(PassRefPtr&lt;SerializedScriptValue&gt; message, Vector&lt;RefPtr&lt;MessagePort&gt;&gt;&amp;&amp; ports, const String&amp; targetOrigin, DOMWindow&amp; source, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; DOMWindow::postMessage(Ref&lt;SerializedScriptValue&gt;&amp;&amp; message, Vector&lt;RefPtr&lt;MessagePort&gt;&gt;&amp;&amp; ports, const String&amp; targetOrigin, DOMWindow&amp; source)
</ins><span class="cx"> {
</span><span class="cx">     if (!isCurrentlyDisplayedInFrame())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     Document* sourceDocument = source.document();
</span><span class="cx"> 
</span><span class="lines">@@ -918,27 +904,26 @@
</span><span class="cx">     RefPtr&lt;SecurityOrigin&gt; target;
</span><span class="cx">     if (targetOrigin == &quot;/&quot;) {
</span><span class="cx">         if (!sourceDocument)
</span><del>-            return;
</del><ins>+            return { };
</ins><span class="cx">         target = sourceDocument-&gt;securityOrigin();
</span><span class="cx">     } else if (targetOrigin != &quot;*&quot;) {
</span><span class="cx">         target = SecurityOrigin::createFromString(targetOrigin);
</span><span class="cx">         // It doesn't make sense target a postMessage at a unique origin
</span><span class="cx">         // because there's no way to represent a unique origin in a string.
</span><del>-        if (target-&gt;isUnique()) {
-            ec = SYNTAX_ERR;
-            return;
-        }
</del><ins>+        if (target-&gt;isUnique())
+            return Exception { SYNTAX_ERR };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    ExceptionCode ec = 0;
</ins><span class="cx">     auto channels = MessagePort::disentanglePorts(WTFMove(ports), ec);
</span><span class="cx">     if (ec)
</span><del>-        return;
</del><ins>+        return Exception { ec };
</ins><span class="cx"> 
</span><span class="cx">     // Capture the source of the message.  We need to do this synchronously
</span><span class="cx">     // in order to capture the source of the message correctly.
</span><span class="cx">     if (!sourceDocument)
</span><del>-        return;
-    String sourceOrigin = sourceDocument-&gt;securityOrigin()-&gt;toString();
</del><ins>+        return { };
+    auto sourceOrigin = sourceDocument-&gt;securityOrigin()-&gt;toString();
</ins><span class="cx"> 
</span><span class="cx">     // Capture stack trace only when inspector front-end is loaded as it may be time consuming.
</span><span class="cx">     RefPtr&lt;ScriptCallStack&gt; stackTrace;
</span><span class="lines">@@ -946,8 +931,10 @@
</span><span class="cx">         stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture);
</span><span class="cx"> 
</span><span class="cx">     // Schedule the message.
</span><del>-    PostMessageTimer* timer = new PostMessageTimer(*this, message, sourceOrigin, source, WTFMove(channels), WTFMove(target), WTFMove(stackTrace));
</del><ins>+    auto* timer = new PostMessageTimer(*this, PassRefPtr&lt;SerializedScriptValue&gt; { WTFMove(message) }, sourceOrigin, source, WTFMove(channels), WTFMove(target), WTFMove(stackTrace));
</ins><span class="cx">     timer-&gt;startOneShot(0);
</span><ins>+
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DOMWindow::postMessageTimerFired(PostMessageTimer&amp; timer)
</span><span class="lines">@@ -986,7 +973,7 @@
</span><span class="cx"> Element* DOMWindow::frameElement() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     return m_frame-&gt;ownerElement();
</span><span class="cx"> }
</span><span class="lines">@@ -1361,7 +1348,7 @@
</span><span class="cx"> DOMWindow* DOMWindow::self() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     return m_frame-&gt;document()-&gt;domWindow();
</span><span class="cx"> }
</span><span class="lines">@@ -1369,11 +1356,11 @@
</span><span class="cx"> DOMWindow* DOMWindow::opener() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     Frame* opener = m_frame-&gt;loader().opener();
</span><span class="cx">     if (!opener)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     return opener-&gt;document()-&gt;domWindow();
</span><span class="cx"> }
</span><span class="lines">@@ -1381,7 +1368,7 @@
</span><span class="cx"> DOMWindow* DOMWindow::parent() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     Frame* parent = m_frame-&gt;tree().parent();
</span><span class="cx">     if (parent)
</span><span class="lines">@@ -1393,11 +1380,11 @@
</span><span class="cx"> DOMWindow* DOMWindow::top() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     Page* page = m_frame-&gt;page();
</span><span class="cx">     if (!page)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     return m_frame-&gt;tree().top().document()-&gt;domWindow();
</span><span class="cx"> }
</span><span class="lines">@@ -1417,13 +1404,13 @@
</span><span class="cx">     return m_media;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSStyleDeclaration&gt; DOMWindow::getComputedStyle(Element&amp; element, const String&amp; pseudoElt) const
</del><ins>+Ref&lt;CSSStyleDeclaration&gt; DOMWindow::getComputedStyle(Element&amp; element, const String&amp; pseudoElt) const
</ins><span class="cx"> {
</span><span class="cx">     return CSSComputedStyleDeclaration::create(element, false, pseudoElt);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: Drop this overload once &lt;rdar://problem/28016778&gt; has been fixed.
</span><del>-RefPtr&lt;CSSStyleDeclaration&gt; DOMWindow::getComputedStyle(Document&amp;, const String&amp;, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;RefPtr&lt;CSSStyleDeclaration&gt;&gt; DOMWindow::getComputedStyle(Document&amp;, const String&amp;)
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     if (MacApplication::isAppStore()) {
</span><span class="lines">@@ -1431,8 +1418,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-    ec = TypeError;
-    return nullptr;
</del><ins>+    return Exception { TypeError };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSRuleList&gt; DOMWindow::getMatchedCSSRules(Element* element, const String&amp; pseudoElement, bool authorOnly) const
</span><span class="lines">@@ -1631,13 +1617,11 @@
</span><span class="cx">     page-&gt;chrome().setWindowRect(adjustWindowRect(page, update));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int DOMWindow::setTimeout(std::unique_ptr&lt;ScheduledAction&gt; action, int timeout, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;int&gt; DOMWindow::setTimeout(std::unique_ptr&lt;ScheduledAction&gt; action, int timeout)
</ins><span class="cx"> {
</span><del>-    ScriptExecutionContext* context = scriptExecutionContext();
-    if (!context) {
-        ec = INVALID_ACCESS_ERR;
-        return -1;
-    }
</del><ins>+    auto* context = scriptExecutionContext();
+    if (!context)
+        return ExceptionCode { INVALID_ACCESS_ERR };
</ins><span class="cx">     return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1665,13 +1649,11 @@
</span><span class="cx">     DOMTimer::removeById(*context, timeoutId);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int DOMWindow::setInterval(std::unique_ptr&lt;ScheduledAction&gt; action, int timeout, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;int&gt; DOMWindow::setInterval(std::unique_ptr&lt;ScheduledAction&gt; action, int timeout)
</ins><span class="cx"> {
</span><del>-    ScriptExecutionContext* context = scriptExecutionContext();
-    if (!context) {
-        ec = INVALID_ACCESS_ERR;
-        return -1;
-    }
</del><ins>+    auto* context = scriptExecutionContext();
+    if (!context)
+        return ExceptionCode { INVALID_ACCESS_ERR };
</ins><span class="cx">     return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1684,6 +1666,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><ins>+
</ins><span class="cx"> int DOMWindow::requestAnimationFrame(PassRefPtr&lt;RequestAnimationFrameCallback&gt; callback)
</span><span class="cx"> {
</span><span class="cx">     callback-&gt;m_useLegacyTimeBase = false;
</span><span class="lines">@@ -1705,16 +1688,17 @@
</span><span class="cx">     if (Document* d = document())
</span><span class="cx">         d-&gt;cancelAnimationFrame(id);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static void didAddStorageEventListener(DOMWindow* window)
</del><ins>+static void didAddStorageEventListener(DOMWindow&amp; window)
</ins><span class="cx"> {
</span><span class="cx">     // Creating these WebCore::Storage objects informs the system that we'd like to receive
</span><span class="cx">     // notifications about storage events that might be triggered in other processes. Rather
</span><span class="cx">     // than subscribe to these notifications explicitly, we subscribe to them implicitly to
</span><span class="cx">     // simplify the work done by the system. 
</span><del>-    window-&gt;localStorage(IGNORE_EXCEPTION);
-    window-&gt;sessionStorage(IGNORE_EXCEPTION);
</del><ins>+    window.localStorage();
+    window.sessionStorage();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool DOMWindow::isSameSecurityOriginAsMainFrame() const
</span><span class="lines">@@ -1745,7 +1729,7 @@
</span><span class="cx">         else if (eventNames().isTouchEventType(eventType))
</span><span class="cx">             document-&gt;didAddTouchEventHandler(*document);
</span><span class="cx">         else if (eventType == eventNames().storageEvent)
</span><del>-            didAddStorageEventListener(this);
</del><ins>+            didAddStorageEventListener(*this);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (eventType == eventNames().unloadEvent)
</span><span class="lines">@@ -1806,6 +1790,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> void DOMWindow::incrementScrollEventListenersCount()
</span><span class="cx"> {
</span><span class="cx">     Document* document = this-&gt;document();
</span><span class="lines">@@ -1825,6 +1810,7 @@
</span><span class="cx">             frame-&gt;page()-&gt;chrome().client().setNeedsScrollNotifications(frame, false);
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void DOMWindow::resetAllGeolocationPermission()
</span><span class="lines">@@ -1938,13 +1924,13 @@
</span><span class="cx">     // &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow&gt;.
</span><span class="cx">     if (event.eventInterface() == PageTransitionEventInterfaceType) {
</span><span class="cx">         if (event.type() == eventNames().pageshowEvent) {
</span><del>-            if (m_lastPageStatus == PageStatusShown)
</del><ins>+            if (m_lastPageStatus == PageStatus::Shown)
</ins><span class="cx">                 return true; // Event was previously dispatched; do not fire a duplicate event.
</span><del>-            m_lastPageStatus = PageStatusShown;
</del><ins>+            m_lastPageStatus = PageStatus::Shown;
</ins><span class="cx">         } else if (event.type() == eventNames().pagehideEvent) {
</span><del>-            if (m_lastPageStatus == PageStatusHidden)
</del><ins>+            if (m_lastPageStatus == PageStatus::Hidden)
</ins><span class="cx">                 return true; // Event was previously dispatched; do not fire a duplicate event.
</span><del>-            m_lastPageStatus = PageStatusHidden;
</del><ins>+            m_lastPageStatus = PageStatus::Hidden;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/DOMWindow.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;Base64Utilities.h&quot;
</span><span class="cx"> #include &quot;ContextDestructionObserver.h&quot;
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;FrameDestructionObserver.h&quot;
</span><span class="cx"> #include &quot;ScrollToOptions.h&quot;
</span><span class="cx"> #include &quot;Supplementable.h&quot;
</span><span class="lines">@@ -45,397 +46,391 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-    class BarProp;
-    class CSSRuleList;
-    class CSSStyleDeclaration;
-    class Crypto;
-    class CustomElementRegistry;
-    class DOMApplicationCache;
-    class DOMSelection;
-    class DOMURL;
-    class DOMWindowProperty;
-    class DOMWrapperWorld;
-    class Database;
-    class DatabaseCallback;
-    class Document;
-    class Element;
-    class EventListener;
-    class FloatRect;
-    class Frame;
-    class History;
-    class IDBFactory;
-    class Location;
-    class MediaQueryList;
-    class MessageEvent;
-    class Navigator;
-    class Node;
-    class Page;
-    class PageConsoleClient;
-    class Performance;
-    class PostMessageTimer;
-    class ScheduledAction;
-    class Screen;
-    class SecurityOrigin;
-    class SerializedScriptValue;
-    class Storage;
-    class StyleMedia;
-    class WebKitNamespace;
-    class WebKitPoint;
</del><ins>+class BarProp;
+class CSSRuleList;
+class CSSStyleDeclaration;
+class Crypto;
+class CustomElementRegistry;
+class DOMApplicationCache;
+class DOMSelection;
+class DOMURL;
+class DOMWindowProperty;
+class DOMWrapperWorld;
+class Database;
+class DatabaseCallback;
+class Document;
+class Element;
+class EventListener;
+class FloatRect;
+class Frame;
+class History;
+class IDBFactory;
+class Location;
+class MediaQueryList;
+class MessageEvent;
+class Navigator;
+class Node;
+class Page;
+class PageConsoleClient;
+class Performance;
+class PostMessageTimer;
+class RequestAnimationFrameCallback;
+class ScheduledAction;
+class Screen;
+class SecurityOrigin;
+class SerializedScriptValue;
+class Storage;
+class StyleMedia;
+class WebKitNamespace;
+class WebKitPoint;
</ins><span class="cx"> 
</span><del>-#if ENABLE(REQUEST_ANIMATION_FRAME)
-    class RequestAnimationFrameCallback;
-#endif
</del><ins>+struct WindowFeatures;
</ins><span class="cx"> 
</span><del>-    struct WindowFeatures;
</del><ins>+enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForwardList };
</ins><span class="cx"> 
</span><del>-    typedef int ExceptionCode;
</del><ins>+// FIXME: DOMWindow shouldn't subclass FrameDestructionObserver and instead should get to Frame via its Document.
+class DOMWindow final
+    : public RefCounted&lt;DOMWindow&gt;
+    , public EventTargetWithInlineData
+    , public ContextDestructionObserver
+    , public FrameDestructionObserver
+    , public Base64Utilities
+    , public Supplementable&lt;DOMWindow&gt; {
+public:
+    static Ref&lt;DOMWindow&gt; create(Document* document) { return adoptRef(*new DOMWindow(document)); }
+    WEBCORE_EXPORT virtual ~DOMWindow();
</ins><span class="cx"> 
</span><del>-    enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForwardList };
</del><ins>+    // In some rare cases, we'll reuse a DOMWindow for a new Document. For example,
+    // when a script calls window.open(&quot;...&quot;), the browser gives JavaScript a window
+    // synchronously but kicks off the load in the window asynchronously. Web sites
+    // expect that modifications that they make to the window object synchronously
+    // won't be blown away when the network load commits. To make that happen, we
+    // &quot;securely transition&quot; the existing DOMWindow to the Document that results from
+    // the network load. See also SecurityContext::isSecureTransitionTo.
+    void didSecureTransitionTo(Document*);
</ins><span class="cx"> 
</span><del>-    // FIXME: DOMWindow shouldn't subclass FrameDestructionObserver and instead should get to Frame via its Document.
-    class DOMWindow final
-        : public RefCounted&lt;DOMWindow&gt;
-        , public EventTargetWithInlineData
-        , public ContextDestructionObserver
-        , public FrameDestructionObserver
-        , public Base64Utilities
-        , public Supplementable&lt;DOMWindow&gt; {
-    public:
-        static Ref&lt;DOMWindow&gt; create(Document* document) { return adoptRef(*new DOMWindow(document)); }
-        WEBCORE_EXPORT virtual ~DOMWindow();
</del><ins>+    EventTargetInterface eventTargetInterface() const override { return DOMWindowEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const override { return ContextDestructionObserver::scriptExecutionContext(); }
</ins><span class="cx"> 
</span><del>-        // In some rare cases, we'll re-used a DOMWindow for a new Document. For example,
-        // when a script calls window.open(&quot;...&quot;), the browser gives JavaScript a window
-        // synchronously but kicks off the load in the window asynchronously. Web sites
-        // expect that modifications that they make to the window object synchronously
-        // won't be blown away when the network load commits. To make that happen, we
-        // &quot;securely transition&quot; the existing DOMWindow to the Document that results from
-        // the network load. See also SecurityContext::isSecureTransitionTo.
-        void didSecureTransitionTo(Document*);
</del><ins>+    DOMWindow* toDOMWindow() override;
</ins><span class="cx"> 
</span><del>-        EventTargetInterface eventTargetInterface() const override { return DOMWindowEventTargetInterfaceType; }
-        ScriptExecutionContext* scriptExecutionContext() const override { return ContextDestructionObserver::scriptExecutionContext(); }
</del><ins>+    void registerProperty(DOMWindowProperty*);
+    void unregisterProperty(DOMWindowProperty*);
</ins><span class="cx"> 
</span><del>-        DOMWindow* toDOMWindow() override;
</del><ins>+    void resetUnlessSuspendedForDocumentSuspension();
+    void suspendForDocumentSuspension();
+    void resumeFromDocumentSuspension();
</ins><span class="cx"> 
</span><del>-        void registerProperty(DOMWindowProperty*);
-        void unregisterProperty(DOMWindowProperty*);
</del><ins>+    RefPtr&lt;MediaQueryList&gt; matchMedia(const String&amp;);
</ins><span class="cx"> 
</span><del>-        void resetUnlessSuspendedForDocumentSuspension();
-        void suspendForDocumentSuspension();
-        void resumeFromDocumentSuspension();
</del><ins>+    WEBCORE_EXPORT unsigned pendingUnloadEventListeners() const;
</ins><span class="cx"> 
</span><del>-        RefPtr&lt;MediaQueryList&gt; matchMedia(const String&amp;);
</del><ins>+    WEBCORE_EXPORT static bool dispatchAllPendingBeforeUnloadEvents();
+    WEBCORE_EXPORT static void dispatchAllPendingUnloadEvents();
</ins><span class="cx"> 
</span><del>-        WEBCORE_EXPORT unsigned pendingUnloadEventListeners() const;
</del><ins>+    static FloatRect adjustWindowRect(Page*, const FloatRect&amp; pendingChanges);
</ins><span class="cx"> 
</span><del>-        WEBCORE_EXPORT static bool dispatchAllPendingBeforeUnloadEvents();
-        WEBCORE_EXPORT static void dispatchAllPendingUnloadEvents();
</del><ins>+    bool allowPopUp(); // Call on first window, not target window.
+    static bool allowPopUp(Frame* firstFrame);
+    static bool canShowModalDialog(const Frame*);
+    WEBCORE_EXPORT void setCanShowModalDialogOverride(bool);
</ins><span class="cx"> 
</span><del>-        static FloatRect adjustWindowRect(Page*, const FloatRect&amp; pendingChanges);
</del><ins>+    Screen* screen() const;
+    History* history() const;
+    Crypto* crypto() const;
+    BarProp* locationbar() const;
+    BarProp* menubar() const;
+    BarProp* personalbar() const;
+    BarProp* scrollbars() const;
+    BarProp* statusbar() const;
+    BarProp* toolbar() const;
+    Navigator* navigator() const;
+    Navigator* clientInformation() const { return navigator(); }
</ins><span class="cx"> 
</span><del>-        bool allowPopUp(); // Call on first window, not target window.
-        static bool allowPopUp(Frame* firstFrame);
-        static bool canShowModalDialog(const Frame*);
-        WEBCORE_EXPORT void setCanShowModalDialogOverride(bool);
</del><ins>+    Location* location() const;
+    void setLocation(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp; location, SetLocationLocking = LockHistoryBasedOnGestureState);
</ins><span class="cx"> 
</span><del>-        Screen* screen() const;
-        History* history() const;
-        Crypto* crypto() const;
-        BarProp* locationbar() const;
-        BarProp* menubar() const;
-        BarProp* personalbar() const;
-        BarProp* scrollbars() const;
-        BarProp* statusbar() const;
-        BarProp* toolbar() const;
-        Navigator* navigator() const;
-        Navigator* clientInformation() const { return navigator(); }
</del><ins>+    DOMSelection* getSelection();
</ins><span class="cx"> 
</span><del>-        Location* location() const;
-        void setLocation(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp; location,
-            SetLocationLocking = LockHistoryBasedOnGestureState);
</del><ins>+    Element* frameElement() const;
</ins><span class="cx"> 
</span><del>-        DOMSelection* getSelection();
</del><ins>+    WEBCORE_EXPORT void focus(bool allowFocus = false);
+    void focus(DOMWindow&amp; callerWindow);
+    void blur();
+    WEBCORE_EXPORT void close();
+    void close(Document&amp;);
+    void print();
+    void stop();
</ins><span class="cx"> 
</span><del>-        Element* frameElement() const;
</del><ins>+    WEBCORE_EXPORT RefPtr&lt;DOMWindow&gt; open(const String&amp; urlString, const AtomicString&amp; frameName, const String&amp; windowFeaturesString, DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow);
</ins><span class="cx"> 
</span><del>-        WEBCORE_EXPORT void focus(bool allowFocus = false);
-        void focus(DOMWindow&amp; callerWindow);
-        void blur();
-        WEBCORE_EXPORT void close();
-        void close(Document&amp;);
-        void print();
-        void stop();
</del><ins>+    void showModalDialog(const String&amp; urlString, const String&amp; dialogFeaturesString, DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, std::function&lt;void(DOMWindow&amp;)&gt; prepareDialogFunction);
</ins><span class="cx"> 
</span><del>-        WEBCORE_EXPORT RefPtr&lt;DOMWindow&gt; open(const String&amp; urlString, const AtomicString&amp; frameName, const String&amp; windowFeaturesString,
-            DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow);
</del><ins>+    void alert(const String&amp; message = emptyString());
+    bool confirm(const String&amp; message);
+    String prompt(const String&amp; message, const String&amp; defaultValue);
</ins><span class="cx"> 
</span><del>-        void showModalDialog(const String&amp; urlString, const String&amp; dialogFeaturesString, DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, std::function&lt;void (DOMWindow&amp;)&gt; prepareDialogFunction);
</del><ins>+    bool find(const String&amp;, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const;
</ins><span class="cx"> 
</span><del>-        void alert(const String&amp; message = emptyString());
-        bool confirm(const String&amp; message);
-        String prompt(const String&amp; message, const String&amp; defaultValue);
</del><ins>+    bool offscreenBuffering() const;
</ins><span class="cx"> 
</span><del>-        bool find(const String&amp;, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const;
</del><ins>+    int outerHeight() const;
+    int outerWidth() const;
+    int innerHeight() const;
+    int innerWidth() const;
+    int screenX() const;
+    int screenY() const;
+    int screenLeft() const { return screenX(); }
+    int screenTop() const { return screenY(); }
+    int scrollX() const;
+    int scrollY() const;
</ins><span class="cx"> 
</span><del>-        bool offscreenBuffering() const;
</del><ins>+    bool closed() const;
</ins><span class="cx"> 
</span><del>-        int outerHeight() const;
-        int outerWidth() const;
-        int innerHeight() const;
-        int innerWidth() const;
-        int screenX() const;
-        int screenY() const;
-        int screenLeft() const { return screenX(); }
-        int screenTop() const { return screenY(); }
-        int scrollX() const;
-        int scrollY() const;
</del><ins>+    unsigned length() const;
</ins><span class="cx"> 
</span><del>-        bool closed() const;
</del><ins>+    String name() const;
+    void setName(const String&amp;);
</ins><span class="cx"> 
</span><del>-        unsigned length() const;
</del><ins>+    String status() const;
+    void setStatus(const String&amp;);
+    String defaultStatus() const;
+    void setDefaultStatus(const String&amp;);
</ins><span class="cx"> 
</span><del>-        String name() const;
-        void setName(const String&amp;);
</del><ins>+    // Self-referential attributes
</ins><span class="cx"> 
</span><del>-        String status() const;
-        void setStatus(const String&amp;);
-        String defaultStatus() const;
-        void setDefaultStatus(const String&amp;);
</del><ins>+    DOMWindow* self() const;
+    DOMWindow* window() const { return self(); }
+    DOMWindow* frames() const { return self(); }
</ins><span class="cx"> 
</span><del>-        // Self-referential attributes
</del><ins>+    DOMWindow* opener() const;
+    DOMWindow* parent() const;
+    DOMWindow* top() const;
</ins><span class="cx"> 
</span><del>-        DOMWindow* self() const;
-        DOMWindow* window() const { return self(); }
-        DOMWindow* frames() const { return self(); }
</del><ins>+    // DOM Level 2 AbstractView Interface
</ins><span class="cx"> 
</span><del>-        DOMWindow* opener() const;
-        DOMWindow* parent() const;
-        DOMWindow* top() const;
</del><ins>+    WEBCORE_EXPORT Document* document() const;
</ins><span class="cx"> 
</span><del>-        // DOM Level 2 AbstractView Interface
</del><ins>+    // CSSOM View Module
</ins><span class="cx"> 
</span><del>-        WEBCORE_EXPORT Document* document() const;
</del><ins>+    RefPtr&lt;StyleMedia&gt; styleMedia() const;
</ins><span class="cx"> 
</span><del>-        // CSSOM View Module
</del><ins>+    // DOM Level 2 Style Interface
</ins><span class="cx"> 
</span><del>-        RefPtr&lt;StyleMedia&gt; styleMedia() const;
</del><ins>+    WEBCORE_EXPORT Ref&lt;CSSStyleDeclaration&gt; getComputedStyle(Element&amp;, const String&amp; pseudoElt) const;
+    ExceptionOr&lt;RefPtr&lt;CSSStyleDeclaration&gt;&gt; getComputedStyle(Document&amp;, const String&amp; pseudoElt);
</ins><span class="cx"> 
</span><del>-        // DOM Level 2 Style Interface
</del><ins>+    // WebKit extensions
</ins><span class="cx"> 
</span><del>-        WEBCORE_EXPORT RefPtr&lt;CSSStyleDeclaration&gt; getComputedStyle(Element&amp;, const String&amp; pseudoElt) const;
-        RefPtr&lt;CSSStyleDeclaration&gt; getComputedStyle(Document&amp;, const String&amp; pseudoElt, ExceptionCode&amp;);
</del><ins>+    WEBCORE_EXPORT RefPtr&lt;CSSRuleList&gt; getMatchedCSSRules(Element*, const String&amp; pseudoElt, bool authorOnly = true) const;
+    double devicePixelRatio() const;
</ins><span class="cx"> 
</span><del>-        // WebKit extensions
</del><ins>+    RefPtr&lt;WebKitPoint&gt; webkitConvertPointFromPageToNode(Node*, const WebKitPoint*) const;
+    RefPtr&lt;WebKitPoint&gt; webkitConvertPointFromNodeToPage(Node*, const WebKitPoint*) const;
</ins><span class="cx"> 
</span><del>-        WEBCORE_EXPORT RefPtr&lt;CSSRuleList&gt; getMatchedCSSRules(Element*, const String&amp; pseudoElt, bool authorOnly = true) const;
-        double devicePixelRatio() const;
</del><ins>+    PageConsoleClient* console() const;
</ins><span class="cx"> 
</span><del>-        RefPtr&lt;WebKitPoint&gt; webkitConvertPointFromPageToNode(Node*, const WebKitPoint*) const;
-        RefPtr&lt;WebKitPoint&gt; webkitConvertPointFromNodeToPage(Node*, const WebKitPoint*) const;
</del><ins>+    void printErrorMessage(const String&amp;);
+    String crossDomainAccessErrorMessage(const DOMWindow&amp; activeWindow);
</ins><span class="cx"> 
</span><del>-        PageConsoleClient* console() const;
</del><ins>+    ExceptionOr&lt;void&gt; postMessage(Ref&lt;SerializedScriptValue&gt;&amp;&amp; message, Vector&lt;RefPtr&lt;MessagePort&gt;&gt;&amp;&amp;, const String&amp; targetOrigin, DOMWindow&amp; source);
+    void postMessageTimerFired(PostMessageTimer&amp;);
+    void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, Event&amp;, PassRefPtr&lt;Inspector::ScriptCallStack&gt;);
</ins><span class="cx"> 
</span><del>-        void printErrorMessage(const String&amp;);
-        String crossDomainAccessErrorMessage(const DOMWindow&amp; activeWindow);
</del><ins>+    void languagesChanged();
</ins><span class="cx"> 
</span><del>-        void postMessage(PassRefPtr&lt;SerializedScriptValue&gt; message, Vector&lt;RefPtr&lt;MessagePort&gt;&gt;&amp;&amp;, const String&amp; targetOrigin, DOMWindow&amp; source, ExceptionCode&amp;);
-        void postMessageTimerFired(PostMessageTimer&amp;);
-        void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, Event&amp;, PassRefPtr&lt;Inspector::ScriptCallStack&gt;);
</del><ins>+    void scrollBy(const ScrollToOptions&amp;) const;
+    void scrollBy(double x, double y) const;
+    void scrollTo(const ScrollToOptions&amp;) const;
+    void scrollTo(double x, double y) const;
</ins><span class="cx"> 
</span><del>-        void languagesChanged();
</del><ins>+    void moveBy(float x, float y) const;
+    void moveTo(float x, float y) const;
</ins><span class="cx"> 
</span><del>-        void scrollBy(const ScrollToOptions&amp;) const;
-        void scrollBy(double x, double y) const;
-        void scrollTo(const ScrollToOptions&amp;) const;
-        void scrollTo(double x, double y) const;
</del><ins>+    void resizeBy(float x, float y) const;
+    void resizeTo(float width, float height) const;
</ins><span class="cx"> 
</span><del>-        void moveBy(float x, float y) const;
-        void moveTo(float x, float y) const;
</del><ins>+    // Timers
+    ExceptionOr&lt;int&gt; setTimeout(std::unique_ptr&lt;ScheduledAction&gt;, int timeout);
+    void clearTimeout(int timeoutId);
+    ExceptionOr&lt;int&gt; setInterval(std::unique_ptr&lt;ScheduledAction&gt;, int timeout);
+    void clearInterval(int timeoutId);
</ins><span class="cx"> 
</span><del>-        void resizeBy(float x, float y) const;
-        void resizeTo(float width, float height) const;
-
-        // Timers
-        int setTimeout(std::unique_ptr&lt;ScheduledAction&gt;, int timeout, ExceptionCode&amp;);
-        void clearTimeout(int timeoutId);
-        int setInterval(std::unique_ptr&lt;ScheduledAction&gt;, int timeout, ExceptionCode&amp;);
-        void clearInterval(int timeoutId);
-
-        // WebKit animation extensions
</del><ins>+    // WebKit animation extensions
</ins><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><del>-        int requestAnimationFrame(PassRefPtr&lt;RequestAnimationFrameCallback&gt;);
-        int webkitRequestAnimationFrame(PassRefPtr&lt;RequestAnimationFrameCallback&gt;);
-        void cancelAnimationFrame(int id);
</del><ins>+    int requestAnimationFrame(PassRefPtr&lt;RequestAnimationFrameCallback&gt;);
+    int webkitRequestAnimationFrame(PassRefPtr&lt;RequestAnimationFrameCallback&gt;);
+    void cancelAnimationFrame(int id);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        // Events
-        // EventTarget API
-        bool addEventListener(const AtomicString&amp; eventType, Ref&lt;EventListener&gt;&amp;&amp;, const AddEventListenerOptions&amp;) override;
-        bool removeEventListener(const AtomicString&amp; eventType, EventListener&amp;, const ListenerOptions&amp;) override;
-        void removeAllEventListeners() override;
</del><ins>+    // Events
+    // EventTarget API
+    bool addEventListener(const AtomicString&amp; eventType, Ref&lt;EventListener&gt;&amp;&amp;, const AddEventListenerOptions&amp;) override;
+    bool removeEventListener(const AtomicString&amp; eventType, EventListener&amp;, const ListenerOptions&amp;) override;
+    void removeAllEventListeners() override;
</ins><span class="cx"> 
</span><del>-        using EventTarget::dispatchEvent;
-        bool dispatchEvent(Event&amp;, EventTarget*);
</del><ins>+    using EventTarget::dispatchEvent;
+    bool dispatchEvent(Event&amp;, EventTarget*);
</ins><span class="cx"> 
</span><del>-        void dispatchLoadEvent();
</del><ins>+    void dispatchLoadEvent();
</ins><span class="cx"> 
</span><del>-        void captureEvents();
-        void releaseEvents();
</del><ins>+    void captureEvents();
+    void releaseEvents();
</ins><span class="cx"> 
</span><del>-        void finishedLoading();
</del><ins>+    void finishedLoading();
</ins><span class="cx"> 
</span><del>-        using RefCounted&lt;DOMWindow&gt;::ref;
-        using RefCounted&lt;DOMWindow&gt;::deref;
</del><ins>+    using RefCounted&lt;DOMWindow&gt;::ref;
+    using RefCounted&lt;DOMWindow&gt;::deref;
</ins><span class="cx"> 
</span><del>-        // HTML 5 key/value storage
-        Storage* sessionStorage(ExceptionCode&amp;) const;
-        Storage* localStorage(ExceptionCode&amp;) const;
-        Storage* optionalSessionStorage() const { return m_sessionStorage.get(); }
-        Storage* optionalLocalStorage() const { return m_localStorage.get(); }
</del><ins>+    // HTML 5 key/value storage
+    ExceptionOr&lt;Storage*&gt; sessionStorage() const;
+    ExceptionOr&lt;Storage*&gt; localStorage() const;
+    Storage* optionalSessionStorage() const { return m_sessionStorage.get(); }
+    Storage* optionalLocalStorage() const { return m_localStorage.get(); }
</ins><span class="cx"> 
</span><del>-        DOMApplicationCache* applicationCache() const;
-        DOMApplicationCache* optionalApplicationCache() const { return m_applicationCache.get(); }
</del><ins>+    DOMApplicationCache* applicationCache() const;
+    DOMApplicationCache* optionalApplicationCache() const { return m_applicationCache.get(); }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>-        CustomElementRegistry* customElementRegistry() { return m_customElementRegistry.get(); }
-        CustomElementRegistry&amp; ensureCustomElementRegistry();
</del><ins>+    CustomElementRegistry* customElementRegistry() { return m_customElementRegistry.get(); }
+    CustomElementRegistry&amp; ensureCustomElementRegistry();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ORIENTATION_EVENTS)
</span><del>-        // This is the interface orientation in degrees. Some examples are:
-        //  0 is straight up; -90 is when the device is rotated 90 clockwise;
-        //  90 is when rotated counter clockwise.
-        int orientation() const;
</del><ins>+    // This is the interface orientation in degrees. Some examples are:
+    //  0 is straight up; -90 is when the device is rotated 90 clockwise;
+    //  90 is when rotated counter clockwise.
+    int orientation() const;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><del>-        Performance* performance() const;
</del><ins>+    Performance* performance() const;
</ins><span class="cx"> #endif
</span><del>-        double nowTimestamp() const;
</del><ins>+    double nowTimestamp() const;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-        void incrementScrollEventListenersCount();
-        void decrementScrollEventListenersCount();
-        unsigned scrollEventListenerCount() const { return m_scrollEventListenerCount; }
</del><ins>+    void incrementScrollEventListenersCount();
+    void decrementScrollEventListenersCount();
+    unsigned scrollEventListenerCount() const { return m_scrollEventListenerCount; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        void resetAllGeolocationPermission();
</del><ins>+    void resetAllGeolocationPermission();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
</span><del>-        bool hasTouchEventListeners() const { return m_touchEventListenerCount &gt; 0; }
</del><ins>+    bool hasTouchEventListeners() const { return m_touchEventListenerCount &gt; 0; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span><del>-        bool shouldHaveWebKitNamespaceForWorld(DOMWrapperWorld&amp;);
-        WebKitNamespace* webkitNamespace() const;
</del><ins>+    bool shouldHaveWebKitNamespaceForWorld(DOMWrapperWorld&amp;);
+    WebKitNamespace* webkitNamespace() const;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e.,
-        // when its document is no longer the document that is displayed in its
-        // frame), we would like to zero out m_frame to avoid being confused
-        // by the document that is currently active in m_frame.
-        bool isCurrentlyDisplayedInFrame() const;
</del><ins>+    // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e.,
+    // when its document is no longer the document that is displayed in its
+    // frame), we would like to zero out m_frame to avoid being confused
+    // by the document that is currently active in m_frame.
+    bool isCurrentlyDisplayedInFrame() const;
</ins><span class="cx"> 
</span><del>-        void willDetachDocumentFromFrame();
-        void willDestroyCachedFrame();
</del><ins>+    void willDetachDocumentFromFrame();
+    void willDestroyCachedFrame();
</ins><span class="cx"> 
</span><del>-        void enableSuddenTermination();
-        void disableSuddenTermination();
</del><ins>+    void enableSuddenTermination();
+    void disableSuddenTermination();
</ins><span class="cx"> 
</span><del>-        WeakPtr&lt;DOMWindow&gt; createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
</del><ins>+    WeakPtr&lt;DOMWindow&gt; createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
</ins><span class="cx"> 
</span><del>-    private:
-        explicit DOMWindow(Document*);
</del><ins>+private:
+    explicit DOMWindow(Document*);
</ins><span class="cx"> 
</span><del>-        Page* page();
-        bool allowedToChangeWindowGeometry() const;
</del><ins>+    Page* page();
+    bool allowedToChangeWindowGeometry() const;
</ins><span class="cx"> 
</span><del>-        void frameDestroyed() override;
-        void willDetachPage() override;
</del><ins>+    void frameDestroyed() override;
+    void willDetachPage() override;
</ins><span class="cx"> 
</span><del>-        void refEventTarget() override { ref(); }
-        void derefEventTarget() override { deref(); }
</del><ins>+    void refEventTarget() override { ref(); }
+    void derefEventTarget() override { deref(); }
</ins><span class="cx"> 
</span><del>-        static RefPtr&lt;Frame&gt; createWindow(const String&amp; urlString, const AtomicString&amp; frameName, const WindowFeatures&amp;, DOMWindow&amp; activeWindow, Frame&amp; firstFrame, Frame&amp; openerFrame, std::function&lt;void (DOMWindow&amp;)&gt; prepareDialogFunction = nullptr);
-        bool isInsecureScriptAccess(DOMWindow&amp; activeWindow, const String&amp; urlString);
</del><ins>+    static RefPtr&lt;Frame&gt; createWindow(const String&amp; urlString, const AtomicString&amp; frameName, const WindowFeatures&amp;, DOMWindow&amp; activeWindow, Frame&amp; firstFrame, Frame&amp; openerFrame, std::function&lt;void(DOMWindow&amp;)&gt; prepareDialogFunction = nullptr);
+    bool isInsecureScriptAccess(DOMWindow&amp; activeWindow, const String&amp; urlString);
</ins><span class="cx"> 
</span><del>-        void resetDOMWindowProperties();
-        void disconnectDOMWindowProperties();
-        void reconnectDOMWindowProperties();
-        void willDestroyDocumentInFrame();
</del><ins>+    void resetDOMWindowProperties();
+    void disconnectDOMWindowProperties();
+    void reconnectDOMWindowProperties();
+    void willDestroyDocumentInFrame();
</ins><span class="cx"> 
</span><del>-        bool isSameSecurityOriginAsMainFrame() const;
</del><ins>+    bool isSameSecurityOriginAsMainFrame() const;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(GAMEPAD)
</span><del>-        void incrementGamepadEventListenerCount();
-        void decrementGamepadEventListenerCount();
</del><ins>+    void incrementGamepadEventListenerCount();
+    void decrementGamepadEventListenerCount();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        bool m_shouldPrintWhenFinishedLoading;
-        bool m_suspendedForDocumentSuspension;
-        Optional&lt;bool&gt; m_canShowModalDialogOverride;
</del><ins>+    bool m_shouldPrintWhenFinishedLoading { false };
+    bool m_suspendedForDocumentSuspension { false };
+    Optional&lt;bool&gt; m_canShowModalDialogOverride;
</ins><span class="cx"> 
</span><del>-        HashSet&lt;DOMWindowProperty*&gt; m_properties;
</del><ins>+    HashSet&lt;DOMWindowProperty*&gt; m_properties;
</ins><span class="cx"> 
</span><del>-        mutable RefPtr&lt;Crypto&gt; m_crypto;
-        mutable RefPtr&lt;History&gt; m_history;
-        mutable RefPtr&lt;BarProp&gt; m_locationbar;
-        mutable RefPtr&lt;StyleMedia&gt; m_media;
-        mutable RefPtr&lt;BarProp&gt; m_menubar;
-        mutable RefPtr&lt;Navigator&gt; m_navigator;
-        mutable RefPtr&lt;BarProp&gt; m_personalbar;
-        mutable RefPtr&lt;Screen&gt; m_screen;
-        mutable RefPtr&lt;BarProp&gt; m_scrollbars;
-        mutable RefPtr&lt;DOMSelection&gt; m_selection;
-        mutable RefPtr&lt;BarProp&gt; m_statusbar;
-        mutable RefPtr&lt;BarProp&gt; m_toolbar;
-        mutable RefPtr&lt;Location&gt; m_location;
</del><ins>+    mutable RefPtr&lt;Crypto&gt; m_crypto;
+    mutable RefPtr&lt;History&gt; m_history;
+    mutable RefPtr&lt;BarProp&gt; m_locationbar;
+    mutable RefPtr&lt;StyleMedia&gt; m_media;
+    mutable RefPtr&lt;BarProp&gt; m_menubar;
+    mutable RefPtr&lt;Navigator&gt; m_navigator;
+    mutable RefPtr&lt;BarProp&gt; m_personalbar;
+    mutable RefPtr&lt;Screen&gt; m_screen;
+    mutable RefPtr&lt;BarProp&gt; m_scrollbars;
+    mutable RefPtr&lt;DOMSelection&gt; m_selection;
+    mutable RefPtr&lt;BarProp&gt; m_statusbar;
+    mutable RefPtr&lt;BarProp&gt; m_toolbar;
+    mutable RefPtr&lt;Location&gt; m_location;
</ins><span class="cx"> 
</span><del>-        String m_status;
-        String m_defaultStatus;
</del><ins>+    String m_status;
+    String m_defaultStatus;
</ins><span class="cx"> 
</span><del>-        enum PageStatus { PageStatusNone, PageStatusShown, PageStatusHidden };
-        PageStatus m_lastPageStatus;
</del><ins>+    enum class PageStatus { None, Shown, Hidden };
+    PageStatus m_lastPageStatus { PageStatus::None };
</ins><span class="cx"> 
</span><del>-        WeakPtrFactory&lt;DOMWindow&gt; m_weakPtrFactory;
</del><ins>+    WeakPtrFactory&lt;DOMWindow&gt; m_weakPtrFactory;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-        unsigned m_scrollEventListenerCount;
</del><ins>+    unsigned m_scrollEventListenerCount { 0 };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
</span><del>-        unsigned m_touchEventListenerCount;
</del><ins>+    unsigned m_touchEventListenerCount { 0 };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GAMEPAD)
</span><del>-        unsigned m_gamepadEventListenerCount;
</del><ins>+    unsigned m_gamepadEventListenerCount { 0 };
</ins><span class="cx"> #endif
</span><del>-        mutable RefPtr&lt;Storage&gt; m_sessionStorage;
-        mutable RefPtr&lt;Storage&gt; m_localStorage;
-        mutable RefPtr&lt;DOMApplicationCache&gt; m_applicationCache;
</del><span class="cx"> 
</span><ins>+    mutable RefPtr&lt;Storage&gt; m_sessionStorage;
+    mutable RefPtr&lt;Storage&gt; m_localStorage;
+    mutable RefPtr&lt;DOMApplicationCache&gt; m_applicationCache;
+
</ins><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>-        RefPtr&lt;CustomElementRegistry&gt; m_customElementRegistry;
</del><ins>+    RefPtr&lt;CustomElementRegistry&gt; m_customElementRegistry;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><del>-        mutable RefPtr&lt;Performance&gt; m_performance;
</del><ins>+    mutable RefPtr&lt;Performance&gt; m_performance;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span><del>-        mutable RefPtr&lt;WebKitNamespace&gt; m_webkitNamespace;
</del><ins>+    mutable RefPtr&lt;WebKitNamespace&gt; m_webkitNamespace;
</ins><span class="cx"> #endif
</span><del>-    };
</del><ins>+};
</ins><span class="cx"> 
</span><del>-    inline String DOMWindow::status() const
-    {
-        return m_status;
-    }
</del><ins>+inline String DOMWindow::status() const
+{
+    return m_status;
+}
</ins><span class="cx"> 
</span><del>-    inline String DOMWindow::defaultStatus() const
-    {
-        return m_defaultStatus;
-    }
</del><ins>+inline String DOMWindow::defaultStatus() const
+{
+    return m_defaultStatus;
+}
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/DOMWindow.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">     [NewObject] CSSStyleDeclaration getComputedStyle(Element element, optional DOMString? pseudoElement = null);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Drop the following overload of getComputedStyle once &lt;rdar://problem/28020681&gt; has been fixed.
</span><del>-    [NewObject, MayThrowLegacyException] CSSStyleDeclaration getComputedStyle(Document document, optional DOMString? pseudoElement = null);
</del><ins>+    [NewObject, MayThrowException] CSSStyleDeclaration? getComputedStyle(Document document, optional DOMString? pseudoElement = null);
</ins><span class="cx"> 
</span><span class="cx">     CSSRuleList getMatchedCSSRules(optional Element? element = null, optional DOMString? pseudoElement = null);
</span><span class="cx"> 
</span><span class="lines">@@ -144,14 +144,14 @@
</span><span class="cx"> 
</span><span class="cx">     readonly attribute DOMApplicationCache applicationCache;
</span><span class="cx"> 
</span><del>-    [GetterMayThrowLegacyException] readonly attribute Storage sessionStorage;
-    [GetterMayThrowLegacyException] readonly attribute Storage localStorage;
</del><ins>+    [GetterMayThrowException] readonly attribute Storage sessionStorage;
+    [GetterMayThrowException] readonly attribute Storage localStorage;
</ins><span class="cx"> 
</span><span class="cx">     // This is the interface orientation in degrees. Some examples:
</span><span class="cx">     // 0 when straight up; -90 when rotated 90 degrees clockwise; 90 counter clockwise.
</span><span class="cx">     [Conditional=ORIENTATION_EVENTS] readonly attribute long orientation;
</span><span class="cx"> 
</span><del>-    [DoNotCheckSecurity, Custom, MayThrowLegacyException, ForwardDeclareInHeader] void postMessage(SerializedScriptValue message, USVString targetOrigin, optional Array messagePorts);
</del><ins>+    [DoNotCheckSecurity, Custom, MayThrowException, ForwardDeclareInHeader] void postMessage(SerializedScriptValue message, USVString targetOrigin, optional Array messagePorts);
</ins><span class="cx"> 
</span><span class="cx">     [Conditional=WEB_TIMING, Replaceable] readonly attribute Performance performance;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventSource.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventSource.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/EventSource.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -58,24 +58,19 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;EventSource&gt; EventSource::create(ScriptExecutionContext&amp; context, const String&amp; url, const Init&amp; eventSourceInit, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;Ref&lt;EventSource&gt;&gt; EventSource::create(ScriptExecutionContext&amp; context, const String&amp; url, const Init&amp; eventSourceInit)
</ins><span class="cx"> {
</span><del>-    if (url.isEmpty()) {
-        ec = SYNTAX_ERR;
-        return nullptr;
-    }
</del><ins>+    if (url.isEmpty())
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><span class="cx">     URL fullURL = context.completeURL(url);
</span><del>-    if (!fullURL.isValid()) {
-        ec = SYNTAX_ERR;
-        return nullptr;
-    }
</del><ins>+    if (!fullURL.isValid())
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved.
</del><ins>+    // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is resolved.
</ins><span class="cx">     if (!context.shouldBypassMainWorldContentSecurityPolicy() &amp;&amp; !context.contentSecurityPolicy()-&gt;allowConnectToSource(fullURL)) {
</span><span class="cx">         // FIXME: Should this be throwing an exception?
</span><del>-        ec = SECURITY_ERR;
-        return nullptr;
</del><ins>+        return Exception { SECURITY_ERR };
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto source = adoptRef(*new EventSource(context, fullURL, eventSourceInit));
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventSource.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventSource.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/EventSource.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -33,6 +33,7 @@
</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;URL.h&quot;
</span><span class="cx"> #include &quot;ThreadableLoaderClient.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="lines">@@ -50,13 +51,13 @@
</span><span class="cx">     struct Init {
</span><span class="cx">         bool withCredentials;
</span><span class="cx">     };
</span><del>-    static RefPtr&lt;EventSource&gt; create(ScriptExecutionContext&amp;, const String&amp; url, const Init&amp;, ExceptionCode&amp;);
</del><ins>+    static ExceptionOr&lt;Ref&lt;EventSource&gt;&gt; create(ScriptExecutionContext&amp;, const String&amp; url, const Init&amp;);
</ins><span class="cx">     virtual ~EventSource();
</span><span class="cx"> 
</span><span class="cx">     const String&amp; url() const;
</span><span class="cx">     bool withCredentials() const;
</span><span class="cx"> 
</span><del>-    typedef short State;
</del><ins>+    using State = short;
</ins><span class="cx">     static const State CONNECTING = 0;
</span><span class="cx">     static const State OPEN = 1;
</span><span class="cx">     static const State CLOSED = 2;
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventSourceidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventSource.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventSource.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/EventSource.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">     ActiveDOMObject,
</span><span class="cx">     Constructor(USVString url, optional EventSourceInit eventSourceInitDict),
</span><span class="cx">     ConstructorCallWith=ScriptExecutionContext,
</span><del>-    ConstructorMayThrowLegacyException,
</del><ins>+    ConstructorMayThrowException,
</ins><span class="cx"> ] interface EventSource : EventTarget {
</span><span class="cx">     readonly attribute USVString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
</span><span class="cx">     readonly attribute USVString url;
</span></span></pre></div>
<a id="trunkSourceWebCorepageLocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Location.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Location.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Location.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -158,16 +158,15 @@
</span><span class="cx">     setLocation(activeWindow, firstWindow, url);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Location::setProtocol(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp; protocol, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; Location::setProtocol(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp; protocol)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx">     URL url = m_frame-&gt;document()-&gt;url();
</span><del>-    if (!url.setProtocol(protocol)) {
-        ec = SYNTAX_ERR;
-        return;
-    }
</del><ins>+    if (!url.setProtocol(protocol))
+        return Exception { SYNTAX_ERR };
</ins><span class="cx">     setLocation(activeWindow, firstWindow, url.string());
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Location::setHost(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp; host)
</span></span></pre></div>
<a id="trunkSourceWebCorepageLocationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Location.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Location.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Location.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -26,14 +26,12 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef Location_h
-#define Location_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;DOMStringList.h&quot;
</span><span class="cx"> #include &quot;DOMWindowProperty.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><del>-#include &lt;wtf/RefCounted.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">@@ -54,7 +52,7 @@
</span><span class="cx">     void replace(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp;);
</span><span class="cx">     void reload(DOMWindow&amp; activeWindow);
</span><span class="cx"> 
</span><del>-    void setProtocol(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; setProtocol(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp;);
</ins><span class="cx">     String protocol() const;
</span><span class="cx">     void setHost(DOMWindow&amp; activeWindow, DOMWindow&amp; firstWindow, const String&amp;);
</span><span class="cx">     String host() const;
</span><span class="lines">@@ -83,5 +81,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // Location_h
</del></span></pre></div>
<a id="trunkSourceWebCorepageLocationidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Location.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Location.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Location.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     [CallWith=ActiveWindow, ForwardDeclareInHeader] void reload();
</span><span class="cx"> 
</span><span class="cx">     // URI decomposition attributes
</span><del>-    [SetterCallWith=ActiveWindow&amp;FirstWindow, SetterMayThrowLegacyException] attribute USVString protocol;
</del><ins>+    [SetterCallWith=ActiveWindow&amp;FirstWindow, SetterMayThrowException] attribute USVString protocol;
</ins><span class="cx">     [SetterCallWith=ActiveWindow&amp;FirstWindow] attribute USVString host;
</span><span class="cx">     [SetterCallWith=ActiveWindow&amp;FirstWindow] attribute USVString hostname;
</span><span class="cx">     [SetterCallWith=ActiveWindow&amp;FirstWindow] attribute USVString port;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Performance.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -31,9 +31,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;Performance.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><del>-#include &quot;Performance.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><span class="lines">@@ -49,15 +49,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static const size_t defaultResourceTimingBufferSize = 150;
-
</del><span class="cx"> Performance::Performance(Frame&amp; frame)
</span><span class="cx">     : DOMWindowProperty(&amp;frame)
</span><del>-    , m_resourceTimingBufferSize(defaultResourceTimingBufferSize)
</del><span class="cx">     , m_referenceTime(frame.document()-&gt;loader() ? frame.document()-&gt;loader()-&gt;timing().referenceMonotonicTime() : monotonicallyIncreasingTime())
</span><del>-#if ENABLE(USER_TIMING)
-    , m_userTiming(nullptr)
-#endif // ENABLE(USER_TIMING)
</del><span class="cx"> {
</span><span class="cx">     ASSERT(m_referenceTime);
</span><span class="cx"> }
</span><span class="lines">@@ -73,20 +67,18 @@
</span><span class="cx">     return frame()-&gt;document();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PerformanceNavigation* Performance::navigation() const
</del><ins>+PerformanceNavigation&amp; Performance::navigation()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_navigation)
</span><span class="cx">         m_navigation = PerformanceNavigation::create(m_frame);
</span><del>-
-    return m_navigation.get();
</del><ins>+    return *m_navigation;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PerformanceTiming* Performance::timing() const
</del><ins>+PerformanceTiming&amp; Performance::timing()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_timing)
</span><span class="cx">         m_timing = PerformanceTiming::create(m_frame);
</span><del>-
-    return m_timing.get();
</del><ins>+    return *m_timing;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; Performance::getEntries() const
</span><span class="lines">@@ -164,7 +156,7 @@
</span><span class="cx">         dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, false, false));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Performance::addResourceTiming(const String&amp; initiatorName, Document* initiatorDocument, const URL&amp; originalURL, const ResourceResponse&amp; response, LoadTiming loadTiming)
</del><ins>+void Performance::addResourceTiming(const String&amp; initiatorName, Document* initiatorDocument, const URL&amp; originalURL, const ResourceResponse&amp; response, const LoadTiming&amp; loadTiming)
</ins><span class="cx"> {
</span><span class="cx">     if (isResourceTimingBufferFull())
</span><span class="cx">         return;
</span><span class="lines">@@ -183,33 +175,32 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_TIMING)
</span><del>-void Performance::webkitMark(const String&amp; markName, ExceptionCode&amp; ec)
</del><ins>+
+ExceptionOr&lt;void&gt; Performance::webkitMark(const String&amp; markName)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     if (!m_userTiming)
</span><del>-        m_userTiming = UserTiming::create(this);
-    m_userTiming-&gt;mark(markName, ec);
</del><ins>+        m_userTiming = std::make_unique&lt;UserTiming&gt;(*this);
+    return m_userTiming-&gt;mark(markName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Performance::webkitClearMarks(const String&amp; markName)
</span><span class="cx"> {
</span><span class="cx">     if (!m_userTiming)
</span><del>-        m_userTiming = UserTiming::create(this);
</del><ins>+        m_userTiming = std::make_unique&lt;UserTiming&gt;(*this);
</ins><span class="cx">     m_userTiming-&gt;clearMarks(markName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Performance::webkitMeasure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; Performance::webkitMeasure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark)
</ins><span class="cx"> {
</span><del>-    ec = 0;
</del><span class="cx">     if (!m_userTiming)
</span><del>-        m_userTiming = UserTiming::create(this);
-    m_userTiming-&gt;measure(measureName, startMark, endMark, ec);
</del><ins>+        m_userTiming = std::make_unique&lt;UserTiming&gt;(*this);
+    return m_userTiming-&gt;measure(measureName, startMark, endMark);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Performance::webkitClearMeasures(const String&amp; measureName)
</span><span class="cx"> {
</span><span class="cx">     if (!m_userTiming)
</span><del>-        m_userTiming = UserTiming::create(this);
</del><ins>+        m_userTiming = std::make_unique&lt;UserTiming&gt;(*this);
</ins><span class="cx">     m_userTiming-&gt;clearMeasures(measureName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -224,7 +215,7 @@
</span><span class="cx"> double Performance::reduceTimeResolution(double seconds)
</span><span class="cx"> {
</span><span class="cx">     const double resolutionSeconds = 0.000005;
</span><del>-    return floor(seconds / resolutionSeconds) * resolutionSeconds;
</del><ins>+    return std::floor(seconds / resolutionSeconds) * resolutionSeconds;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Performance.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -36,12 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMWindowProperty.h&quot;
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><del>-#include &quot;PerformanceNavigation.h&quot;
-#include &quot;PerformanceTiming.h&quot;
-#include &quot;ScriptWrappable.h&quot;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
</del><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -48,10 +43,11 @@
</span><span class="cx"> class Document;
</span><span class="cx"> class LoadTiming;
</span><span class="cx"> class PerformanceEntry;
</span><del>-class ResourceRequest;
</del><ins>+class PerformanceNavigation;
+class PerformanceTiming;
</ins><span class="cx"> class ResourceResponse;
</span><ins>+class URL;
</ins><span class="cx"> class UserTiming;
</span><del>-class URL;
</del><span class="cx"> 
</span><span class="cx"> class Performance final : public RefCounted&lt;Performance&gt;, public DOMWindowProperty, public EventTargetWithInlineData {
</span><span class="cx"> public:
</span><span class="lines">@@ -58,11 +54,8 @@
</span><span class="cx">     static Ref&lt;Performance&gt; create(Frame&amp; frame) { return adoptRef(*new Performance(frame)); }
</span><span class="cx">     ~Performance();
</span><span class="cx"> 
</span><del>-    EventTargetInterface eventTargetInterface() const override { return PerformanceEventTargetInterfaceType; }
-    ScriptExecutionContext* scriptExecutionContext() const override;
-
-    PerformanceNavigation* navigation() const;
-    PerformanceTiming* timing() const;
</del><ins>+    PerformanceNavigation&amp; navigation();
+    PerformanceTiming&amp; timing();
</ins><span class="cx">     double now() const;
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; getEntries() const;
</span><span class="lines">@@ -72,18 +65,18 @@
</span><span class="cx">     void clearResourceTimings();
</span><span class="cx">     void setResourceTimingBufferSize(unsigned);
</span><span class="cx"> 
</span><del>-    void addResourceTiming(const String&amp; initiatorName, Document*, const URL&amp; originalURL, const ResourceResponse&amp;, LoadTiming);
</del><ins>+    void addResourceTiming(const String&amp; initiatorName, Document*, const URL&amp; originalURL, const ResourceResponse&amp;, const LoadTiming&amp;);
</ins><span class="cx"> 
</span><del>-    using RefCounted&lt;Performance&gt;::ref;
-    using RefCounted&lt;Performance&gt;::deref;
</del><ins>+    using RefCounted::ref;
+    using RefCounted::deref;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_TIMING)
</span><del>-    void webkitMark(const String&amp; markName, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; webkitMark(const String&amp; markName);
</ins><span class="cx">     void webkitClearMarks(const String&amp; markName);
</span><span class="cx"> 
</span><del>-    void webkitMeasure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; webkitMeasure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark);
</ins><span class="cx">     void webkitClearMeasures(const String&amp; measureName);
</span><del>-#endif // ENABLE(USER_TIMING)
</del><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     static double reduceTimeResolution(double seconds);
</span><span class="cx"> 
</span><span class="lines">@@ -90,21 +83,26 @@
</span><span class="cx"> private:
</span><span class="cx">     explicit Performance(Frame&amp;);
</span><span class="cx"> 
</span><del>-    void refEventTarget() override { ref(); }
-    void derefEventTarget() override { deref(); }
</del><ins>+    EventTargetInterface eventTargetInterface() const final { return PerformanceEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const final;
+
+    void refEventTarget() final { ref(); }
+    void derefEventTarget() final { deref(); }
+
</ins><span class="cx">     bool isResourceTimingBufferFull();
</span><span class="cx"> 
</span><span class="cx">     mutable RefPtr&lt;PerformanceNavigation&gt; m_navigation;
</span><span class="cx">     mutable RefPtr&lt;PerformanceTiming&gt; m_timing;
</span><span class="cx"> 
</span><ins>+    // https://w3c.github.io/resource-timing/#extensions-performance-interface recommends size of 150.
</ins><span class="cx">     Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; m_resourceTimingBuffer;
</span><del>-    unsigned m_resourceTimingBufferSize;
</del><ins>+    unsigned m_resourceTimingBufferSize { 150 };
</ins><span class="cx"> 
</span><span class="cx">     double m_referenceTime;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_TIMING)
</span><del>-    RefPtr&lt;UserTiming&gt; m_userTiming;
-#endif // ENABLE(USER_TIMING)
</del><ins>+    std::unique_ptr&lt;UserTiming&gt; m_userTiming;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Performance.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Performance.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/Performance.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx">     [EnabledAtRuntime=ResourceTiming] PerformanceEntryList getEntriesByType(DOMString entryType);
</span><span class="cx">     [EnabledAtRuntime=ResourceTiming] PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType);
</span><span class="cx"> 
</span><del>-
</del><span class="cx">     [EnabledAtRuntime=ResourceTiming] void clearResourceTimings();
</span><span class="cx">     [EnabledAtRuntime=ResourceTiming] void setResourceTimingBufferSize(unsigned long maxSize);
</span><span class="cx"> 
</span><span class="lines">@@ -49,10 +48,10 @@
</span><span class="cx"> 
</span><span class="cx">     // See http://www.w3.org/TR/2012/CR-user-timing-20120726/
</span><span class="cx"> #if defined(ENABLE_USER_TIMING) &amp;&amp; ENABLE_USER_TIMING
</span><del>-    [MayThrowLegacyException] void webkitMark(DOMString markName);
-    void webkitClearMarks(optional  DOMString markName);
</del><ins>+    [MayThrowException] void webkitMark(DOMString markName);
+    void webkitClearMarks(optional DOMString markName);
</ins><span class="cx"> 
</span><del>-    [MayThrowLegacyException] void webkitMeasure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
</del><ins>+    [MayThrowException] void webkitMeasure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
</ins><span class="cx">     void webkitClearMeasures(optional DOMString measureName);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceUserTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceUserTiming.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceUserTiming.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/PerformanceUserTiming.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -28,42 +28,46 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_TIMING)
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionCode.h&quot;
</ins><span class="cx"> #include &quot;Performance.h&quot;
</span><ins>+#include &quot;PerformanceEntry.h&quot;
</ins><span class="cx"> #include &quot;PerformanceMark.h&quot;
</span><span class="cx"> #include &quot;PerformanceMeasure.h&quot;
</span><ins>+#include &lt;array&gt;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/dtoa/utils.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"> namespace {
</span><span class="cx"> 
</span><ins>+typedef unsigned long long (PerformanceTiming::*NavigationTimingFunction)() const;
+
</ins><span class="cx"> static NavigationTimingFunction restrictedMarkFunction(const String&amp; markName)
</span><span class="cx"> {
</span><span class="cx">     using MapPair = std::pair&lt;ASCIILiteral, NavigationTimingFunction&gt;;
</span><span class="cx">     static const std::array&lt;MapPair, 21&gt; pairs = { {
</span><del>-        MapPair{ ASCIILiteral(&quot;navigationStart&quot;), &amp;PerformanceTiming::navigationStart },
-        MapPair{ ASCIILiteral(&quot;unloadEventStart&quot;), &amp;PerformanceTiming::unloadEventStart },
-        MapPair{ ASCIILiteral(&quot;unloadEventEnd&quot;), &amp;PerformanceTiming::unloadEventEnd },
-        MapPair{ ASCIILiteral(&quot;redirectStart&quot;), &amp;PerformanceTiming::redirectStart },
-        MapPair{ ASCIILiteral(&quot;redirectEnd&quot;), &amp;PerformanceTiming::redirectEnd },
-        MapPair{ ASCIILiteral(&quot;fetchStart&quot;), &amp;PerformanceTiming::fetchStart },
-        MapPair{ ASCIILiteral(&quot;domainLookupStart&quot;), &amp;PerformanceTiming::domainLookupStart },
-        MapPair{ ASCIILiteral(&quot;domainLookupEnd&quot;), &amp;PerformanceTiming::domainLookupEnd },
-        MapPair{ ASCIILiteral(&quot;connectStart&quot;), &amp;PerformanceTiming::connectStart },
-        MapPair{ ASCIILiteral(&quot;connectEnd&quot;), &amp;PerformanceTiming::connectEnd },
-        MapPair{ ASCIILiteral(&quot;secureConnectionStart&quot;), &amp;PerformanceTiming::secureConnectionStart },
-        MapPair{ ASCIILiteral(&quot;requestStart&quot;), &amp;PerformanceTiming::requestStart },
-        MapPair{ ASCIILiteral(&quot;responseStart&quot;), &amp;PerformanceTiming::responseStart },
-        MapPair{ ASCIILiteral(&quot;responseEnd&quot;), &amp;PerformanceTiming::responseEnd },
-        MapPair{ ASCIILiteral(&quot;domLoading&quot;), &amp;PerformanceTiming::domLoading },
-        MapPair{ ASCIILiteral(&quot;domInteractive&quot;), &amp;PerformanceTiming::domInteractive },
-        MapPair{ ASCIILiteral(&quot;domContentLoadedEventStart&quot;), &amp;PerformanceTiming::domContentLoadedEventStart },
-        MapPair{ ASCIILiteral(&quot;domContentLoadedEventEnd&quot;), &amp;PerformanceTiming::domContentLoadedEventEnd },
-        MapPair{ ASCIILiteral(&quot;domComplete&quot;), &amp;PerformanceTiming::domComplete },
-        MapPair{ ASCIILiteral(&quot;loadEventStart&quot;), &amp;PerformanceTiming::loadEventStart },
-        MapPair{ ASCIILiteral(&quot;loadEventEnd&quot;), &amp;PerformanceTiming::loadEventEnd },
</del><ins>+        { ASCIILiteral(&quot;navigationStart&quot;), &amp;PerformanceTiming::navigationStart },
+        { ASCIILiteral(&quot;unloadEventStart&quot;), &amp;PerformanceTiming::unloadEventStart },
+        { ASCIILiteral(&quot;unloadEventEnd&quot;), &amp;PerformanceTiming::unloadEventEnd },
+        { ASCIILiteral(&quot;redirectStart&quot;), &amp;PerformanceTiming::redirectStart },
+        { ASCIILiteral(&quot;redirectEnd&quot;), &amp;PerformanceTiming::redirectEnd },
+        { ASCIILiteral(&quot;fetchStart&quot;), &amp;PerformanceTiming::fetchStart },
+        { ASCIILiteral(&quot;domainLookupStart&quot;), &amp;PerformanceTiming::domainLookupStart },
+        { ASCIILiteral(&quot;domainLookupEnd&quot;), &amp;PerformanceTiming::domainLookupEnd },
+        { ASCIILiteral(&quot;connectStart&quot;), &amp;PerformanceTiming::connectStart },
+        { ASCIILiteral(&quot;connectEnd&quot;), &amp;PerformanceTiming::connectEnd },
+        { ASCIILiteral(&quot;secureConnectionStart&quot;), &amp;PerformanceTiming::secureConnectionStart },
+        { ASCIILiteral(&quot;requestStart&quot;), &amp;PerformanceTiming::requestStart },
+        { ASCIILiteral(&quot;responseStart&quot;), &amp;PerformanceTiming::responseStart },
+        { ASCIILiteral(&quot;responseEnd&quot;), &amp;PerformanceTiming::responseEnd },
+        { ASCIILiteral(&quot;domLoading&quot;), &amp;PerformanceTiming::domLoading },
+        { ASCIILiteral(&quot;domInteractive&quot;), &amp;PerformanceTiming::domInteractive },
+        { ASCIILiteral(&quot;domContentLoadedEventStart&quot;), &amp;PerformanceTiming::domContentLoadedEventStart },
+        { ASCIILiteral(&quot;domContentLoadedEventEnd&quot;), &amp;PerformanceTiming::domContentLoadedEventEnd },
+        { ASCIILiteral(&quot;domComplete&quot;), &amp;PerformanceTiming::domComplete },
+        { ASCIILiteral(&quot;loadEventStart&quot;), &amp;PerformanceTiming::loadEventStart },
+        { ASCIILiteral(&quot;loadEventEnd&quot;), &amp;PerformanceTiming::loadEventEnd },
</ins><span class="cx">     } };
</span><span class="cx"> 
</span><span class="cx">     static NeverDestroyed&lt;HashMap&lt;String, NavigationTimingFunction&gt;&gt; map;
</span><span class="lines">@@ -77,7 +81,7 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace anonymous
</span><span class="cx"> 
</span><del>-UserTiming::UserTiming(Performance* performance)
</del><ins>+UserTiming::UserTiming(Performance&amp; performance)
</ins><span class="cx">     : m_performance(performance)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -102,16 +106,13 @@
</span><span class="cx">     performanceEntryMap.remove(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UserTiming::mark(const String&amp; markName, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; UserTiming::mark(const String&amp; markName)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (restrictedMarkFunction(markName)) {
-        ec = SYNTAX_ERR;
-        return;
-    }
</del><ins>+    if (restrictedMarkFunction(markName))
+        return Exception { SYNTAX_ERR };
</ins><span class="cx"> 
</span><del>-    double startTime = m_performance-&gt;now();
-    insertPerformanceEntry(m_marksMap, PerformanceMark::create(markName, startTime));
</del><ins>+    insertPerformanceEntry(m_marksMap, PerformanceMark::create(markName, m_performance.now()));
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void UserTiming::clearMarks(const String&amp; markName)
</span><span class="lines">@@ -119,48 +120,47 @@
</span><span class="cx">     clearPeformanceEntries(m_marksMap, markName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double UserTiming::findExistingMarkStartTime(const String&amp; markName, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;double&gt; UserTiming::findExistingMarkStartTime(const String&amp; markName)
</ins><span class="cx"> {
</span><del>-    ec = 0;
-
</del><span class="cx">     if (m_marksMap.contains(markName))
</span><span class="cx">         return m_marksMap.get(markName).last()-&gt;startTime();
</span><span class="cx"> 
</span><span class="cx">     if (auto function = restrictedMarkFunction(markName)) {
</span><del>-        double value = static_cast&lt;double&gt;((m_performance-&gt;timing()-&gt;*(function))());
-        if (!value) {
-            ec = INVALID_ACCESS_ERR;
-            return 0.0;
-        }
-        return value - m_performance-&gt;timing()-&gt;navigationStart();
</del><ins>+        double value = static_cast&lt;double&gt;((m_performance.timing().*(function))());
+        if (!value)
+            return Exception { INVALID_ACCESS_ERR };
+        return value - m_performance.timing().navigationStart();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ec = SYNTAX_ERR;
-    return 0.0;
</del><ins>+    return Exception { SYNTAX_ERR };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UserTiming::measure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; UserTiming::measure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark)
</ins><span class="cx"> {
</span><span class="cx">     double startTime = 0.0;
</span><span class="cx">     double endTime = 0.0;
</span><span class="cx"> 
</span><span class="cx">     if (startMark.isNull())
</span><del>-        endTime = m_performance-&gt;now();
</del><ins>+        endTime = m_performance.now();
</ins><span class="cx">     else if (endMark.isNull()) {
</span><del>-        endTime = m_performance-&gt;now();
-        startTime = findExistingMarkStartTime(startMark, ec);
-        if (ec)
-            return;
</del><ins>+        endTime = m_performance.now();
+        auto startMarkResult = findExistingMarkStartTime(startMark);
+        if (startMarkResult.hasException())
+            return startMarkResult.releaseException();
+        endTime = startMarkResult.releaseReturnValue();
</ins><span class="cx">     } else {
</span><del>-        endTime = findExistingMarkStartTime(endMark, ec);
-        if (ec)
-            return;
-        startTime = findExistingMarkStartTime(startMark, ec);
-        if (ec)
-            return;
</del><ins>+        auto endMarkResult = findExistingMarkStartTime(endMark);
+        if (endMarkResult.hasException())
+            return endMarkResult.releaseException();
+        auto startMarkResult = findExistingMarkStartTime(startMark);
+        if (startMarkResult.hasException())
+            return startMarkResult.releaseException();
+        startTime = startMarkResult.releaseReturnValue();
+        endTime = endMarkResult.releaseReturnValue();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     insertPerformanceEntry(m_measuresMap, PerformanceMeasure::create(measureName, startTime, endTime));
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void UserTiming::clearMeasures(const String&amp; measureName)
</span><span class="lines">@@ -168,43 +168,35 @@
</span><span class="cx">     clearPeformanceEntries(m_measuresMap, measureName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; convertToEntrySequence(const PerformanceEntryMap&amp; performanceEntryMap)
</del><ins>+static Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; convertToEntrySequence(const PerformanceEntryMap&amp; performanceEntryMap)
</ins><span class="cx"> {
</span><del>-    Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; entries;
-
</del><ins>+    Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; entries;
</ins><span class="cx">     for (auto&amp; entry : performanceEntryMap.values())
</span><span class="cx">         entries.appendVector(entry);
</span><del>-
</del><span class="cx">     return entries;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; getEntrySequenceByName(const PerformanceEntryMap&amp; performanceEntryMap, const String&amp; name)
</del><ins>+static Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; getEntrySequenceByName(const PerformanceEntryMap&amp; performanceEntryMap, const String&amp; name)
</ins><span class="cx"> {
</span><del>-    Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; entries;
-
-    PerformanceEntryMap::const_iterator it = performanceEntryMap.find(name);
-    if (it != performanceEntryMap.end())
-        entries.appendVector(it-&gt;value);
-
-    return entries;
</del><ins>+    return performanceEntryMap.get(name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; UserTiming::getMarks() const
</del><ins>+Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; UserTiming::getMarks() const
</ins><span class="cx"> {
</span><span class="cx">     return convertToEntrySequence(m_marksMap);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; UserTiming::getMarks(const String&amp; name) const
</del><ins>+Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; UserTiming::getMarks(const String&amp; name) const
</ins><span class="cx"> {
</span><span class="cx">     return getEntrySequenceByName(m_marksMap, name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; UserTiming::getMeasures() const
</del><ins>+Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; UserTiming::getMeasures() const
</ins><span class="cx"> {
</span><span class="cx">     return convertToEntrySequence(m_measuresMap);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; UserTiming::getMeasures(const String&amp; name) const
</del><ins>+Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; UserTiming::getMeasures(const String&amp; name) const
</ins><span class="cx"> {
</span><span class="cx">     return getEntrySequenceByName(m_measuresMap, name);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceUserTimingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceUserTiming.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceUserTiming.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/PerformanceUserTiming.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -23,18 +23,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 PerformanceUserTiming_h
-#define PerformanceUserTiming_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_TIMING)
</span><span class="cx"> 
</span><del>-#include &quot;ExceptionCode.h&quot;
-#include &quot;Performance.h&quot;
-#include &quot;PerformanceTiming.h&quot;
</del><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/text/StringHash.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="lines">@@ -41,30 +36,28 @@
</span><span class="cx"> class Performance;
</span><span class="cx"> class PerformanceEntry;
</span><span class="cx"> 
</span><del>-typedef unsigned long long (PerformanceTiming::*NavigationTimingFunction)() const;
-typedef HashMap&lt;String, Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; &gt; PerformanceEntryMap;
</del><ins>+using PerformanceEntryMap = HashMap&lt;String, Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt;&gt;;
</ins><span class="cx"> 
</span><del>-class UserTiming : public RefCounted&lt;UserTiming&gt; {
</del><ins>+class UserTiming {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;UserTiming&gt; create(Performance* performance) { return adoptRef(*new UserTiming(performance)); }
</del><ins>+    explicit UserTiming(Performance&amp;);
</ins><span class="cx"> 
</span><del>-    void mark(const String&amp; markName, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; mark(const String&amp; markName);
</ins><span class="cx">     void clearMarks(const String&amp; markName);
</span><span class="cx"> 
</span><del>-    void measure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; measure(const String&amp; measureName, const String&amp; startMark, const String&amp; endMark);
</ins><span class="cx">     void clearMeasures(const String&amp; measureName);
</span><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; getMarks() const;
-    Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; getMeasures() const;
</del><ins>+    Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; getMarks() const;
+    Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; getMeasures() const;
</ins><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; getMarks(const String&amp; name) const;
-    Vector&lt;RefPtr&lt;PerformanceEntry&gt; &gt; getMeasures(const String&amp; name) const;
</del><ins>+    Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; getMarks(const String&amp; name) const;
+    Vector&lt;RefPtr&lt;PerformanceEntry&gt;&gt; getMeasures(const String&amp; name) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit UserTiming(Performance*);
</del><ins>+    ExceptionOr&lt;double&gt; findExistingMarkStartTime(const String&amp; markName);
</ins><span class="cx"> 
</span><del>-    double findExistingMarkStartTime(const String&amp; markName, ExceptionCode&amp;);
-    Performance* m_performance;
</del><ins>+    Performance&amp; m_performance;
</ins><span class="cx">     PerformanceEntryMap m_marksMap;
</span><span class="cx">     PerformanceEntryMap m_measuresMap;
</span><span class="cx"> };
</span><span class="lines">@@ -72,5 +65,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(USER_TIMING)
</span><del>-
-#endif // !defined(PerformanceUserTiming_h)
</del></span></pre></div>
<a id="trunkSourceWebCorepageUserMessageHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserMessageHandler.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserMessageHandler.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/UserMessageHandler.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -44,16 +44,15 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UserMessageHandler::postMessage(PassRefPtr&lt;SerializedScriptValue&gt; value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; UserMessageHandler::postMessage(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     // Check to see if the descriptor has been removed. This can happen if the host application has
</span><span class="cx">     // removed the named message handler at the WebKit2 API level.
</span><del>-    if (!m_descriptor) {
-        ec = INVALID_ACCESS_ERR;
-        return;
-    }
</del><ins>+    if (!m_descriptor)
+        return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx"> 
</span><span class="cx">     m_descriptor-&gt;didPostMessage(*this, value.get());
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserMessageHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserMessageHandler.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserMessageHandler.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/UserMessageHandler.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -23,18 +23,16 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef UserMessageHandler_h
-#define UserMessageHandler_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span><span class="cx"> 
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;FrameDestructionObserver.h&quot;
</span><span class="cx"> #include &quot;UserMessageHandlerDescriptor.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class UserMessageHandler : public RefCounted&lt;UserMessageHandler&gt;, public FrameDestructionObserver {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;UserMessageHandler&gt; create(Frame&amp; frame, UserMessageHandlerDescriptor&amp; descriptor)
</span><span class="lines">@@ -43,7 +41,7 @@
</span><span class="cx">     }
</span><span class="cx">     virtual ~UserMessageHandler();
</span><span class="cx"> 
</span><del>-    void postMessage(PassRefPtr&lt;SerializedScriptValue&gt;, ExceptionCode&amp;);
</del><ins>+    ExceptionOr&lt;void&gt; postMessage(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     UserMessageHandlerDescriptor* descriptor() { return m_descriptor.get(); }
</span><span class="cx">     void invalidateDescriptor() { m_descriptor = nullptr; }
</span><span class="lines">@@ -57,4 +55,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(USER_MESSAGE_HANDLERS)
</span><del>-#endif // UserMessageHandler_h
</del></span></pre></div>
<a id="trunkSourceWebCorepageUserMessageHandleridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserMessageHandler.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserMessageHandler.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/page/UserMessageHandler.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -26,5 +26,5 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=USER_MESSAGE_HANDLERS
</span><span class="cx"> ] interface UserMessageHandler {
</span><del>-    [MayThrowLegacyException] void postMessage(SerializedScriptValue message);
</del><ins>+    [MayThrowException] void postMessage(SerializedScriptValue message);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorestorageStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/storage/Storage.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/Storage.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/storage/Storage.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -57,13 +57,10 @@
</span><span class="cx">     m_storageArea-&gt;decrementAccessCount();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned Storage::length(ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;unsigned&gt; Storage::length() const
</ins><span class="cx"> {
</span><del>-    ec = 0;
-    if (!m_storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return 0;
-    }
</del><ins>+    if (!m_storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (isDisabledByPrivateBrowsing())
</span><span class="cx">         return 0;
</span><span class="lines">@@ -71,12 +68,10 @@
</span><span class="cx">     return m_storageArea-&gt;length();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String Storage::key(unsigned index, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;String&gt; Storage::key(unsigned index) const
</ins><span class="cx"> {
</span><del>-    if (!m_storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return String();
-    }
</del><ins>+    if (!m_storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (isDisabledByPrivateBrowsing())
</span><span class="cx">         return String();
</span><span class="lines">@@ -84,12 +79,10 @@
</span><span class="cx">     return m_storageArea-&gt;key(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String Storage::getItem(const String&amp; key, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;String&gt; Storage::getItem(const String&amp; key) const
</ins><span class="cx"> {
</span><del>-    if (!m_storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return String();
-    }
</del><ins>+    if (!m_storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (isDisabledByPrivateBrowsing())
</span><span class="cx">         return String();
</span><span class="lines">@@ -97,57 +90,49 @@
</span><span class="cx">     return m_storageArea-&gt;item(key);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Storage::setItem(const String&amp; key, const String&amp; value, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; Storage::setItem(const String&amp; key, const String&amp; value)
</ins><span class="cx"> {
</span><del>-    if (!m_storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return;
-    }
</del><ins>+    if (!m_storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><del>-    if (isDisabledByPrivateBrowsing()) {
-        ec = QUOTA_EXCEEDED_ERR;
-        return;
-    }
</del><ins>+    if (isDisabledByPrivateBrowsing())
+        return Exception { QUOTA_EXCEEDED_ERR };
</ins><span class="cx"> 
</span><span class="cx">     bool quotaException = false;
</span><span class="cx">     m_storageArea-&gt;setItem(m_frame, key, value, quotaException);
</span><del>-
</del><span class="cx">     if (quotaException)
</span><del>-        ec = QUOTA_EXCEEDED_ERR;
</del><ins>+        return Exception { QUOTA_EXCEEDED_ERR };
+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Storage::removeItem(const String&amp; key, ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; Storage::removeItem(const String&amp; key)
</ins><span class="cx"> {
</span><del>-    if (!m_storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return;
-    }
</del><ins>+    if (!m_storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (isDisabledByPrivateBrowsing())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     m_storageArea-&gt;removeItem(m_frame, key);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Storage::clear(ExceptionCode&amp; ec)
</del><ins>+ExceptionOr&lt;void&gt; Storage::clear()
</ins><span class="cx"> {
</span><del>-    if (!m_storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return;
-    }
</del><ins>+    if (!m_storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (isDisabledByPrivateBrowsing())
</span><del>-        return;
</del><ins>+        return { };
</ins><span class="cx"> 
</span><span class="cx">     m_storageArea-&gt;clear(m_frame);
</span><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Storage::contains(const String&amp; key, ExceptionCode&amp; ec) const
</del><ins>+ExceptionOr&lt;bool&gt; Storage::contains(const String&amp; key) const
</ins><span class="cx"> {
</span><del>-    if (!m_storageArea-&gt;canAccessStorage(m_frame)) {
-        ec = SECURITY_ERR;
-        return false;
-    }
</del><ins>+    if (!m_storageArea-&gt;canAccessStorage(m_frame))
+        return Exception { SECURITY_ERR };
</ins><span class="cx"> 
</span><span class="cx">     if (isDisabledByPrivateBrowsing())
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebCorestorageStorageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/storage/Storage.h (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/Storage.h        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/storage/Storage.h        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -23,14 +23,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 Storage_h
-#define Storage_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;DOMWindowProperty.h&quot;
</span><ins>+#include &quot;ExceptionOr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><del>-#include &lt;wtf/Forward.h&gt;
-#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">@@ -37,20 +34,18 @@
</span><span class="cx"> class Frame;
</span><span class="cx"> class StorageArea;
</span><span class="cx"> 
</span><del>-typedef int ExceptionCode;
-
</del><span class="cx"> class Storage : public ScriptWrappable, public RefCounted&lt;Storage&gt;, public DOMWindowProperty {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;Storage&gt; create(Frame*, RefPtr&lt;StorageArea&gt;&amp;&amp;);
</span><span class="cx">     ~Storage();
</span><span class="cx"> 
</span><del>-    unsigned length(ExceptionCode&amp;) const;
-    String key(unsigned index, ExceptionCode&amp;) const;
-    String getItem(const String&amp; key, ExceptionCode&amp;) const;
-    void setItem(const String&amp; key, const String&amp; value, ExceptionCode&amp;);
-    void removeItem(const String&amp; key, ExceptionCode&amp;);
-    void clear(ExceptionCode&amp;);
-    bool contains(const String&amp; key, ExceptionCode&amp;) const;
</del><ins>+    ExceptionOr&lt;unsigned&gt; length() const;
+    ExceptionOr&lt;String&gt; key(unsigned index) const;
+    ExceptionOr&lt;String&gt; getItem(const String&amp; key) const;
+    ExceptionOr&lt;void&gt; setItem(const String&amp; key, const String&amp; value);
+    ExceptionOr&lt;void&gt; removeItem(const String&amp; key);
+    ExceptionOr&lt;void&gt; clear();
+    ExceptionOr&lt;bool&gt; contains(const String&amp; key) const;
</ins><span class="cx"> 
</span><span class="cx">     StorageArea&amp; area() const { return *m_storageArea; }
</span><span class="cx"> 
</span><span class="lines">@@ -63,5 +58,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // Storage_h
</del></span></pre></div>
<a id="trunkSourceWebCorestorageStorageidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/storage/Storage.idl (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/Storage.idl        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/storage/Storage.idl        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -30,11 +30,11 @@
</span><span class="cx">     CustomNamedSetter,
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx"> ] interface Storage {
</span><del>-    [GetterMayThrowLegacyException] readonly attribute unsigned long length;
-    [MayThrowLegacyException] DOMString? key(unsigned long index);
-    [MayThrowLegacyException] getter DOMString? getItem(DOMString key);
-    [MayThrowLegacyException] void setItem(DOMString key, DOMString data);
-    [MayThrowLegacyException] void removeItem(DOMString key);
-    [MayThrowLegacyException] void clear();
</del><ins>+    [GetterMayThrowException] readonly attribute unsigned long length;
+    [MayThrowException] DOMString? key(unsigned long index);
+    [MayThrowException] getter DOMString? getItem(DOMString key);
+    [MayThrowException] void setItem(DOMString key, DOMString data);
+    [MayThrowException] void removeItem(DOMString key);
+    [MayThrowException] void clear();
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorestorageStorageEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/storage/StorageEventDispatcher.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/StorageEventDispatcher.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebCore/storage/StorageEventDispatcher.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -79,10 +79,9 @@
</span><span class="cx">     InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, SessionStorage, securityOrigin, &amp;page);
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; frame : frames) {
</span><del>-        ExceptionCode ec = 0;
-        Storage* storage = frame-&gt;document()-&gt;domWindow()-&gt;sessionStorage(ec);
-        if (!ec)
-            frame-&gt;document()-&gt;enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, storage));
</del><ins>+        auto result = frame-&gt;document()-&gt;domWindow()-&gt;sessionStorage();
+        if (!result.hasException())
+            frame-&gt;document()-&gt;enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, result.releaseReturnValue()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -92,10 +91,9 @@
</span><span class="cx">         InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, LocalStorage, securityOrigin, page);
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; frame : frames) {
</span><del>-        ExceptionCode ec = 0;
-        Storage* storage = frame-&gt;document()-&gt;domWindow()-&gt;localStorage(ec);
-        if (!ec)
-            frame-&gt;document()-&gt;enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, storage));
</del><ins>+        auto result = frame-&gt;document()-&gt;domWindow()-&gt;localStorage();
+        if (!result.hasException())
+            frame-&gt;document()-&gt;enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, result.releaseReturnValue()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebKit/win/ChangeLog        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-18  Darin Adler  &lt;darin@apple.com&gt;
+
+        Move many miscellaneous classes from ExceptionCode to Exception
+        https://bugs.webkit.org/show_bug.cgi?id=163645
+
+        Reviewed by Ryosuke Niwa.
+
+        * DOMCoreClasses.cpp:
+        (DOMDocument::getComputedStyle): Use ptr instead of get since the return
+        value is now Ref instead of RefPtr.
+
</ins><span class="cx"> 2016-10-18  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Try to fix the Windows build.
</span></span></pre></div>
<a id="trunkSourceWebKitwinDOMCoreClassescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/DOMCoreClasses.cpp (207521 => 207522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/DOMCoreClasses.cpp        2016-10-19 05:25:06 UTC (rev 207521)
+++ trunk/Source/WebKit/win/DOMCoreClasses.cpp        2016-10-19 07:00:10 UTC (rev 207522)
</span><span class="lines">@@ -803,7 +803,7 @@
</span><span class="cx">     if (!dv)
</span><span class="cx">         return E_FAIL;
</span><span class="cx">     
</span><del>-    *result = DOMCSSStyleDeclaration::createInstance(dv-&gt;getComputedStyle(*element, pseudoEltString.impl()).get());
</del><ins>+    *result = DOMCSSStyleDeclaration::createInstance(dv-&gt;getComputedStyle(*element, pseudoEltString.impl()).ptr());
</ins><span class="cx">     return *result ? S_OK : E_FAIL;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>