Move many miscellaneous classes from ExceptionCode to Exception
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2016 07:00:10 +0000 (07:00 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2016 07:00:10 +0000 (07:00 +0000)
commit4fc421e7ebd8f9d141784f70ecbaa3923bd0f95e
tree35f2418a8a4d0aa43e519206efeb51797d4ff5fb
parent7f694009bee408f16d11ecab1d9dea68d2f4e58b
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& 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSCryptoCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/loader/appcache/DOMApplicationCache.cpp
Source/WebCore/loader/appcache/DOMApplicationCache.h
Source/WebCore/loader/appcache/DOMApplicationCache.idl
Source/WebCore/page/Crypto.cpp
Source/WebCore/page/Crypto.h
Source/WebCore/page/Crypto.idl
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/EventSource.h
Source/WebCore/page/EventSource.idl
Source/WebCore/page/Location.cpp
Source/WebCore/page/Location.h
Source/WebCore/page/Location.idl
Source/WebCore/page/Performance.cpp
Source/WebCore/page/Performance.h
Source/WebCore/page/Performance.idl
Source/WebCore/page/PerformanceUserTiming.cpp
Source/WebCore/page/PerformanceUserTiming.h
Source/WebCore/page/UserMessageHandler.cpp
Source/WebCore/page/UserMessageHandler.h
Source/WebCore/page/UserMessageHandler.idl
Source/WebCore/storage/Storage.cpp
Source/WebCore/storage/Storage.h
Source/WebCore/storage/Storage.idl
Source/WebCore/storage/StorageEventDispatcher.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/DOMCoreClasses.cpp