Ref: A smart pointer for the reference age.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Sep 2013 18:50:01 +0000 (18:50 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Sep 2013 18:50:01 +0000 (18:50 +0000)
commit3c0e7aa4cc4fea4623ea30f61c1e4318b91f38b2
tree286e844e24208e29d959e04d145a5437dd5ca290
parent81f6558b86e2717ccb9029e2a1f111b474ba3740
Ref: A smart pointer for the reference age.
<https://webkit.org/b/120570>

Reviewed by Antti Koivisto.

Source/WebCore:

Use Ref<T> for various stack guards where null checking isn't needed.

Source/WTF:

Add a very simple simple Ref<T> smart pointer class that is never null.
It's initialized by passing a T& to the constructor and cannot be assigned to.

operator-> is not overloaded, to prevent unsafe-looking code.
The value is extracted by "T& get()", since C++ does not let you override operator.()

* wtf/Ref.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
68 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.pro
Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/Forward.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/geolocation/Geolocation.cpp
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp
Source/WebCore/bindings/js/JSErrorHandler.cpp
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSEventListener.h
Source/WebCore/bridge/runtime_root.cpp
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/StyleSheetContents.cpp
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNodeAlgorithms.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/DocumentEventQueue.cpp
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLScriptElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTitleElement.cpp
Source/WebCore/html/parser/HTMLDocumentParser.cpp
Source/WebCore/html/shadow/SpinButtonElement.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/DocumentWriter.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/NavigationScheduler.cpp
Source/WebCore/loader/NetscapePlugInStreamLoader.cpp
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/cf/SubresourceLoaderCF.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindowExtension.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
Source/WebCore/platform/mac/WidgetMac.mm
Source/WebCore/platform/network/BlobResourceHandle.cpp
Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/workers/WorkerScriptLoader.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/parser/XMLDocumentParser.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp