Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
https://bugs.webkit.org/show_bug.cgi?id=164214
Reviewed by Alex Christensen.
Source/WebCore:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeOptions): Use FetchHeaders& instead of
Ref<FetchHeaders> for return value.
(WebCore::FetchRequest::initializeWith): Ditto.
* Modules/fetch/FetchRequest.h: Updated for above.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer): Use SourceBuffer& instead of
SourceBuffer* for return value.
* Modules/mediasource/MediaSource.h: Updated for above.
* bindings/js/JSDOMBinding.h: Added overloads of checkSecurityForNode so
it works with a function returning a reference.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getCounterValue): Use Counter& instead of
Counter* for return value.
(WebCore::CSSPrimitiveValue::getRectValue): Use Rect& instead of
Rect* for return value.
* css/CSSPrimitiveValue.h: Updated for above.
* dom/ChildNode.idl: Use non-legacy exceptions.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::querySelector): Use ExceptionOr.
(WebCore::ContainerNode::querySelectorAll): Ditto.
(WebCore::ContainerNode::append): Ditto.
(WebCore::ContainerNode::prepend): Ditto.
* dom/ContainerNode.h: Updated for above.
* dom/Document.cpp:
(WebCore::Document::selectorQueryForString): Use ExceptionOr.
* dom/Document.h: Updated for above.
* dom/Element.cpp:
(WebCore::Element::attachShadow): Return ShadowRoot& instead of
Ref<ShadowRoot> since the shadow root is owned by the element, not
the caller.
(WebCore::Element::matches): Updated for change to make the
selectorQueryForString function use ExceptionOr.
(WebCore::Element::closest): Ditto.
(WebCore::contextNodeForInsertion): Return ContainerNode& instead of
ContainerNode*.
(WebCore::contextElementForInsertion): Updated for above.
* dom/Element.h: Updated for above.
* dom/Element.idl: Changed return type for closest and for
insertAdjacentElement to be nullable since both can return null.
* dom/ExceptionOr.h: Added a specialization for ExceptionOr<T&>.
* dom/Node.cpp:
(WebCore::Node::convertNodesOrStringsIntoNode): Use ExceptionOr.
(WebCore::Node::before): Ditto.
(WebCore::Node::after): Ditto.
(WebCore::Node::replaceWith): Ditto.
* dom/Node.h: Updated for above changes.
* dom/ParentNode.idl: Use non-legacy exceptions.
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::queryAll): Changed return type to Ref.
(WebCore::SelectorQueryCache::add): Use ExceptionOr.
* dom/SelectorQuery.h: Updated for above changes.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument): Return
Document& instead of Document*.
* html/HTMLFrameOwnerElement.h: Updated for above change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack): Return TextTrack&
instead of Ref<TextTrack>.
* html/HTMLMediaElement.h: Updated for above.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
Updated for new exceptions.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::querySelector): Ditto.
(WebCore::InspectorDOMAgent::querySelectorAll): Ditto.
(WebCore::InspectorDOMAgent::performSearch): Ditto.
(WebCore::InspectorDOMAgent::highlightSelector): Ditto.
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::performSearch): Put a null check
here so callers don't have to do it. Pass references to the
individual functions since the pointer can't be null.
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
Updated to use reference and streamlined code a bit, using
containsIgnoringASCIICase instead of findIgnoringCase.
(WebCore::InspectorNodeFinder::matchesAttribute): Ditto.
(WebCore::InspectorNodeFinder::matchesElement): Ditto.
(WebCore::InspectorNodeFinder::searchUsingXPath): Ditto.
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors): Ditto.
Also updated for new exceptions in querySelectorAll.
* inspector/InspectorNodeFinder.h: Updated for above.
* page/Crypto.cpp:
(WebCore::Crypto::webkitSubtle): Return WebKitSubtleCrypto&
insetad of WebKitSubtleCrypto*.
* page/Crypto.h: Updated for above.
* testing/Internals.h: Removed declarations for functions already
removed: ensureShadowRoot and createShadowRoot.
Source/WebKit/mac:
* DOM/DOMCSSPrimitiveValue.mm:
(-[DOMCSSPrimitiveValue getCounterValue]): Updated since return value
is a reference now.
(-[DOMCSSPrimitiveValue getRectValue]): Ditto.
* DOM/DOMDocument.mm:
(-[DOMDocument querySelector:]): Updated exception handling.
(-[DOMDocument querySelectorAll:]): Ditto.
* DOM/DOMDocumentFragment.mm:
(-[DOMDocumentFragment querySelector:]): Ditto.
(-[DOMDocumentFragment querySelectorAll:]): Ditto.
* DOM/DOMElement.mm:
(-[DOMElement querySelector:]): Ditto.
(-[DOMElement querySelectorAll:]): Ditto.
Source/WebKit2:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_query_selector): Updated exception handling.
(webkit_dom_document_query_selector_all): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
(webkit_dom_document_fragment_query_selector): Ditto.
(webkit_dom_document_fragment_query_selector_all): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_query_selector): Ditto.
(webkit_dom_element_query_selector_all): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@208145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/page/Crypto.cpp b/Source/WebCore/page/Crypto.cpp
index be3872f..08cc431 100644
--- a/Source/WebCore/page/Crypto.cpp
+++ b/Source/WebCore/page/Crypto.cpp
@@ -69,7 +69,7 @@
return m_subtle;
}
-ExceptionOr<WebKitSubtleCrypto*> Crypto::webkitSubtle()
+ExceptionOr<WebKitSubtleCrypto&> Crypto::webkitSubtle()
{
if (!isMainThread())
return Exception { NOT_SUPPORTED_ERR };
@@ -77,7 +77,7 @@
if (!m_webkitSubtle)
m_webkitSubtle = WebKitSubtleCrypto::create(*downcast<Document>(scriptExecutionContext()));
- return m_webkitSubtle.get();
+ return *m_webkitSubtle;
}
#endif