Changeset 85746 in webkit
- Timestamp:
- May 4, 2011 7:11:50 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r85729 r85746 1 2011-05-03 Adam Roben <aroben@apple.com> 2 3 Disallow equality comparisons between [Pass]OwnPtrs 4 5 If you have two OwnPtrs that are equal, you've already lost. (Unless you're doing something 6 really sneaky, in which case you should stop!) 7 8 Fixes <http://webkit.org/b/60053> Testing OwnPtrs for equality should cause a compiler error 9 10 Reviewed by Anders Carlsson and Antti Koivisto. 11 12 * wtf/OwnPtr.h: 13 (WTF::OwnPtr::operator==): 14 (WTF::OwnPtr::operator!=): 15 * wtf/PassOwnPtr.h: 16 (WTF::PassOwnPtr::operator==): 17 (WTF::PassOwnPtr::operator!=): 18 Added private equality operators that fail to compile when used. (When not used, the 19 compiler will skip over them because they are function templates.) 20 1 21 2011-05-04 Alexis Menard <alexis.menard@openbossa.org> 2 22 -
trunk/Source/JavaScriptCore/wtf/OwnPtr.h
r85445 r85746 82 82 private: 83 83 OwnPtr& operator=(const OwnPtr<T>&); 84 85 // We should never have two OwnPtrs for the same underlying object (otherwise we'll get 86 // double-destruction), so these equality operators should never be needed. 87 template<typename U> bool operator==(const OwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 88 template<typename U> bool operator!=(const OwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 89 template<typename U> bool operator==(const PassOwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 90 template<typename U> bool operator!=(const PassOwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 84 91 85 92 PtrType m_ptr; -
trunk/Source/JavaScriptCore/wtf/PassOwnPtr.h
r85603 r85746 91 91 #endif 92 92 93 // We should never have two OwnPtrs for the same underlying object (otherwise we'll get 94 // double-destruction), so these equality operators should never be needed. 95 template<typename U> bool operator==(const PassOwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 96 template<typename U> bool operator!=(const PassOwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 97 template<typename U> bool operator==(const OwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 98 template<typename U> bool operator!=(const OwnPtr<U>&) { COMPILE_ASSERT(false, OwnPtrs_should_never_be_equal); } 99 93 100 mutable PtrType m_ptr; 94 101 }; -
trunk/Source/WebCore/ChangeLog
r85745 r85746 1 2011-05-03 Adam Roben <aroben@apple.com> 2 3 Remove an unnecessary OwnPtr equality check in XSLT code 4 5 Fixes <http://webkit.org/b/60053> Testing OwnPtrs for equality should cause a compiler error 6 7 Reviewed by Anders Carlsson and Antti Koivisto. 8 9 * dom/Document.cpp: 10 (WebCore::Document::setTransformSource): No need to check for equality. If the pointers are 11 equal, we're screwed anyway. (And the caller always passes in a newly-allocated object, so 12 we're safe.) 13 1 14 2011-05-04 Leandro Gracia Gil <leandrogracia@chromium.org> 2 15 -
trunk/Source/WebCore/dom/Document.cpp
r85680 r85746 4059 4059 void Document::setTransformSource(PassOwnPtr<TransformSource> source) 4060 4060 { 4061 if (m_transformSource == source)4062 return;4063 4061 m_transformSource = source; 4064 4062 } -
trunk/Source/WebKit2/ChangeLog
r85721 r85746 1 2011-05-03 Adam Roben <aroben@apple.com> 2 3 Remove WebPageProxy::setDrawingArea 4 5 It is unused. It also does a useless equality comparison between OwnPtrs; if they are equal, 6 we've already lost. 7 8 Reviewed by Anders Carlsson and Antti Koivisto. 9 10 * UIProcess/WebPageProxy.cpp: 11 * UIProcess/WebPageProxy.h: 12 Removed setDrawingArea. 13 14 (WebKit::WebPageProxy::drawingArea): 15 (WebKit::WebPageProxy::backForwardList): 16 Made these functions const while I was at it. 17 1 18 2011-05-03 Pratik Solanki <psolanki@apple.com> 2 19 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r85689 r85746 195 195 } 196 196 197 void WebPageProxy::setDrawingArea(PassOwnPtr<DrawingAreaProxy> drawingArea)198 {199 if (drawingArea == m_drawingArea)200 return;201 202 m_drawingArea = drawingArea;203 }204 205 197 void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient) 206 198 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r85502 r85746 177 177 WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); } 178 178 179 DrawingAreaProxy* drawingArea() { return m_drawingArea.get(); } 180 void setDrawingArea(PassOwnPtr<DrawingAreaProxy>); 181 182 WebBackForwardList* backForwardList() { return m_backForwardList.get(); } 179 DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); } 180 181 WebBackForwardList* backForwardList() const { return m_backForwardList.get(); } 183 182 184 183 #if ENABLE(INSPECTOR)
Note: See TracChangeset
for help on using the changeset viewer.