2008-12-13 Darin Adler <darin@apple.com>
+ - file deletion part of https://bugs.webkit.org/show_bug.cgi?id=17497
+ eliminate DeprecatedValueList
+
+ * GNUmakefile.am: Removed references to deleted files.
+ * WebCore.pro: Ditto.
+ * WebCore.scons: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * WebCoreSources.bkl: Ditto.
+
+ * platform/DeprecatedPtrQueue.h: Removed.
+ * platform/DeprecatedValueList.h: Removed.
+ * platform/DeprecatedValueListImpl.cpp: Removed.
+ * platform/DeprecatedValueListImpl.h: Removed.
+
+2008-12-13 Darin Adler <darin@apple.com>
+
Reviewed by Anders Carlsson.
- https://bugs.webkit.org/show_bug.cgi?id=17497
WebCore/platform/DeprecatedPtrList.h \
WebCore/platform/DeprecatedPtrListImpl.cpp \
WebCore/platform/DeprecatedPtrListImpl.h \
- WebCore/platform/DeprecatedPtrQueue.h \
- WebCore/platform/DeprecatedValueList.h \
- WebCore/platform/DeprecatedValueListImpl.cpp \
- WebCore/platform/DeprecatedValueListImpl.h \
WebCore/platform/DragData.cpp \
WebCore/platform/DragData.h \
WebCore/platform/DragImage.cpp \
platform/ContextMenu.cpp \
platform/text/CString.cpp \
platform/DeprecatedPtrListImpl.cpp \
- platform/DeprecatedValueListImpl.cpp \
platform/DragData.cpp \
platform/DragImage.cpp \
platform/FileChooser.cpp \
'platform/Arena.cpp',
'platform/ContextMenu.cpp',
'platform/DeprecatedPtrListImpl.cpp',
- 'platform/DeprecatedValueListImpl.cpp',
'platform/DragData.cpp',
'platform/DragImage.cpp',
'platform/FileChooser.cpp',
>\r
</File>\r
<File\r
- RelativePath="..\platform\DeprecatedPtrQueue.h"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\platform\DeprecatedValueList.h"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\platform\DeprecatedValueListImpl.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath="..\platform\DeprecatedValueListImpl.h"\r
- >\r
- </File>\r
- <File\r
RelativePath="..\platform\DragData.cpp"\r
>\r
</File>\r
93F1996308245E59001E9ABC /* SSLKeyGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = F587866202DE3B1101EA4122 /* SSLKeyGenerator.h */; };
93F1996D08245E59001E9ABC /* DeprecatedPtrListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851502DE375901EA4122 /* DeprecatedPtrListImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F1998208245E59001E9ABC /* DeprecatedPtrList.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869902DE3B8601EA4122 /* DeprecatedPtrList.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 93F1998308245E59001E9ABC /* DeprecatedPtrQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786AD02DE3B8601EA4122 /* DeprecatedPtrQueue.h */; };
93F1998C08245E59001E9ABC /* RenderTreeAsText.h in Headers */ = {isa = PBXBuildFile; fileRef = 93955A4103D72932008635CE /* RenderTreeAsText.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 93F1999D08245E59001E9ABC /* DeprecatedValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C202DE3B8601EA4122 /* DeprecatedValueList.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 93F1999E08245E59001E9ABC /* DeprecatedValueListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F587853B02DE375901EA4122 /* DeprecatedValueListImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F199A808245E59001E9ABC /* WebCoreFrameView.h in Headers */ = {isa = PBXBuildFile; fileRef = F587854C02DE375901EA4122 /* WebCoreFrameView.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F199B308245E59001E9ABC /* WebCoreViewFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = F587855402DE375901EA4122 /* WebCoreViewFactory.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F199B808245E59001E9ABC /* Scrollbar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7B2AF80450824100A8000F /* Scrollbar.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F199F108245E59001E9ABC /* WebDashboardRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 5150C2A10702629000AF642C /* WebDashboardRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784F002DE375901EA4122 /* CursorMac.mm */; };
93F19A3C08245E59001E9ABC /* DeprecatedPtrListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587851602DE375901EA4122 /* DeprecatedPtrListImpl.cpp */; };
- 93F19A5608245E59001E9ABC /* DeprecatedValueListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853C02DE375901EA4122 /* DeprecatedValueListImpl.cpp */; };
93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587855502DE375901EA4122 /* WebCoreViewFactory.m */; };
93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23B02DE4396018635CA /* HTMLDocument.cpp */; };
93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23E02DE4396018635CA /* HTMLElement.cpp */; };
F58784F002DE375901EA4122 /* CursorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CursorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851502DE375901EA4122 /* DeprecatedPtrListImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedPtrListImpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851602DE375901EA4122 /* DeprecatedPtrListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedPtrListImpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F587853B02DE375901EA4122 /* DeprecatedValueListImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedValueListImpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F587853C02DE375901EA4122 /* DeprecatedValueListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedValueListImpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587854C02DE375901EA4122 /* WebCoreFrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFrameView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587855402DE375901EA4122 /* WebCoreViewFactory.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreViewFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587855502DE375901EA4122 /* WebCoreViewFactory.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreViewFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587866202DE3B1101EA4122 /* SSLKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SSLKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587868402DE3B8601EA4122 /* Cursor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Cursor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587869902DE3B8601EA4122 /* DeprecatedPtrList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedPtrList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F58786AD02DE3B8601EA4122 /* DeprecatedPtrQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedPtrQueue.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F58786C202DE3B8601EA4122 /* DeprecatedValueList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedValueList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58EF58E02DFDFB7018635CA /* WebCore.base.exp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.exports; path = WebCore.base.exp; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
F5C2869302846DCD018635CA /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
F5C2869402846DCD018635CA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
F587869902DE3B8601EA4122 /* DeprecatedPtrList.h */,
F587851602DE375901EA4122 /* DeprecatedPtrListImpl.cpp */,
F587851502DE375901EA4122 /* DeprecatedPtrListImpl.h */,
- F58786AD02DE3B8601EA4122 /* DeprecatedPtrQueue.h */,
- F58786C202DE3B8601EA4122 /* DeprecatedValueList.h */,
- F587853C02DE375901EA4122 /* DeprecatedValueListImpl.cpp */,
- F587853B02DE375901EA4122 /* DeprecatedValueListImpl.h */,
A79546420B5C4CB4007B438F /* DragData.cpp */,
A7B6E69D0B291A9600D0529F /* DragData.h */,
A7CFB3CF0B7ED10A0070C32D /* DragImage.cpp */,
93309DE1099E64920056E581 /* DeleteSelectionCommand.h in Headers */,
93F1998208245E59001E9ABC /* DeprecatedPtrList.h in Headers */,
93F1996D08245E59001E9ABC /* DeprecatedPtrListImpl.h in Headers */,
- 93F1998308245E59001E9ABC /* DeprecatedPtrQueue.h in Headers */,
- 93F1999D08245E59001E9ABC /* DeprecatedValueList.h in Headers */,
- 93F1999E08245E59001E9ABC /* DeprecatedValueListImpl.h in Headers */,
BCB16C2A0979C3BD00467741 /* DocLoader.h in Headers */,
93EEC1FA09C2877700C515D1 /* DocPtr.h in Headers */,
A8185F4009765766005826D9 /* Document.h in Headers */,
93309DDE099E64920056E581 /* DeleteFromTextNodeCommand.cpp in Sources */,
93309DE0099E64920056E581 /* DeleteSelectionCommand.cpp in Sources */,
93F19A3C08245E59001E9ABC /* DeprecatedPtrListImpl.cpp in Sources */,
- 93F19A5608245E59001E9ABC /* DeprecatedValueListImpl.cpp in Sources */,
BCB16C290979C3BD00467741 /* DocLoader.cpp in Sources */,
A8185F3C09765766005826D9 /* Document.cpp in Sources */,
A8185F3F09765766005826D9 /* DocumentFragment.cpp in Sources */,
platform/text/CString.cpp
platform/ContextMenu.cpp
platform/DeprecatedPtrListImpl.cpp
- platform/DeprecatedValueListImpl.cpp
platform/DragImage.cpp
platform/FileChooser.cpp
platform/GeolocationService.cpp
+++ /dev/null
-/*
- * Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DeprecatedPtrQueue_h
-#define DeprecatedPtrQueue_h
-
-#include "DeprecatedPtrList.h"
-
-namespace WebCore {
-
-template<class T> class DeprecatedPtrQueue
-{
-public:
- bool isEmpty() const { return list.isEmpty(); }
- T *dequeue() { T *tmp = list.getFirst(); list.removeFirst(); return tmp; }
- void enqueue(const T *item) { list.append (item); }
- unsigned count() const { return list.count(); }
- T *head() const { return list.getFirst(); }
- DeprecatedPtrQueue<T> &operator=(const DeprecatedPtrQueue<T> &q) { list = q.list; return *this; }
-
- private:
- DeprecatedPtrList<T> list;
-};
-
-}
-
-#endif /* DeprecatedPtrQueue_h */
+++ /dev/null
-/*
- * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DeprecatedValueList_h
-#define DeprecatedValueList_h
-
-#include "DeprecatedValueListImpl.h"
-
-namespace WebCore {
-
-template <class T> class DeprecatedValueList;
-template <class T> class DeprecatedValueListConstIterator;
-
-template<class T> class DeprecatedValueListNode : private DeprecatedValueListImplNode {
-public:
- DeprecatedValueListNode(const T &val) : value(val) { }
- T value;
- friend class DeprecatedValueList<T>;
-};
-
-template<class T> class DeprecatedValueListIterator {
-public:
- DeprecatedValueListIterator() { }
-
- T& operator*() const { return ((DeprecatedValueListNode<T> *)impl.node())->value; }
-
- DeprecatedValueListIterator &operator++() { ++impl; return *this; }
- DeprecatedValueListIterator &operator--() { --impl; return *this; }
- DeprecatedValueListIterator operator++(int) { return impl++; }
-
- bool operator==(const DeprecatedValueListIterator &other) { return impl == other.impl; }
- bool operator!=(const DeprecatedValueListIterator &other) { return impl != other.impl; }
-
-private:
- DeprecatedValueListIterator(const DeprecatedValueListImplIterator &pImp) : impl(pImp) { }
-
- DeprecatedValueListImplIterator impl;
-
- friend class DeprecatedValueList<T>;
- friend class DeprecatedValueListConstIterator<T>;
-};
-
-template<class T> class DeprecatedValueListConstIterator {
-public:
- DeprecatedValueListConstIterator() { }
- DeprecatedValueListConstIterator(const DeprecatedValueListIterator<T> &it) : impl(it.impl) { }
-
- const T& operator*() const { return ((const DeprecatedValueListNode<T> *)impl.node())->value; }
-
- DeprecatedValueListConstIterator &operator++() { ++impl; return *this; }
- DeprecatedValueListConstIterator &operator--() { --impl; return *this; }
- DeprecatedValueListConstIterator operator++(int) { return impl++; }
-
- bool operator==(const DeprecatedValueListConstIterator &other) { return impl == other.impl; }
- bool operator!=(const DeprecatedValueListConstIterator &other) { return impl != other.impl; }
-
-private:
- DeprecatedValueListConstIterator(const DeprecatedValueListImplIterator &pImp) : impl(pImp) { }
-
- DeprecatedValueListImplIterator impl;
-
- friend class DeprecatedValueList<T>;
-};
-
-template<class T> bool operator==(const DeprecatedValueList<T> &a, const DeprecatedValueList<T> &b);
-
-template <class T> class DeprecatedValueList {
-public:
- typedef DeprecatedValueListIterator<T> Iterator;
- typedef DeprecatedValueListIterator<T> iterator;
- typedef DeprecatedValueListConstIterator<T> ConstIterator;
- typedef DeprecatedValueListConstIterator<T> const_iterator;
-
- DeprecatedValueList() : impl(deleteNode, copyNode) { }
-
- void clear() { impl.clear(); }
- unsigned count() const { return impl.count(); }
- bool isEmpty() const { return impl.isEmpty(); }
-
- Iterator append(const T &val) { return impl.appendNode(new DeprecatedValueListNode<T>(val)); }
- Iterator prepend(const T &val) { return impl.prependNode(new DeprecatedValueListNode<T>(val)); }
- void remove(const T &val) { DeprecatedValueListNode<T> node(val); impl.removeEqualNodes(&node, nodesEqual); }
- unsigned contains(const T &val) const { DeprecatedValueListNode<T> node(val); return impl.containsEqualNodes(&node, nodesEqual); }
- Iterator find(const T &val) const { DeprecatedValueListNode<T> node(val); return impl.findEqualNode(&node, nodesEqual); }
-
- Iterator insert(Iterator iter, const T& val) { return impl.insert(iter.impl, new DeprecatedValueListNode<T>(val)); }
- Iterator remove(Iterator iter) { return impl.removeIterator(iter.impl); }
- Iterator fromLast() { return impl.fromLast(); }
-
- T& first() { return static_cast<DeprecatedValueListNode<T> *>(impl.firstNode())->value; }
- const T& first() const { return static_cast<DeprecatedValueListNode<T> *>(impl.firstNode())->value; }
- T& last() { return static_cast<DeprecatedValueListNode<T> *>(impl.lastNode())->value; }
- const T& last() const { return static_cast<DeprecatedValueListNode<T> *>(impl.lastNode())->value; }
-
- Iterator begin() { return impl.begin(); }
- Iterator end() { return impl.end(); }
-
- ConstIterator begin() const { return impl.begin(); }
- ConstIterator end() const { return impl.end(); }
- ConstIterator constBegin() const { return impl.begin(); }
- ConstIterator constEnd() const { return impl.end(); }
- ConstIterator fromLast() const { return impl.fromLast(); }
-
- T& operator[] (unsigned index) { return ((DeprecatedValueListNode<T> *)impl.nodeAt(index))->value; }
- const T& operator[] (unsigned index) const { return ((const DeprecatedValueListNode<T> *)impl.nodeAt(index))->value; }
- DeprecatedValueList &operator+=(const T &value) { impl.appendNode(new DeprecatedValueListNode<T>(value)); return *this; }
- DeprecatedValueList &operator<<(const T &value) { impl.appendNode(new DeprecatedValueListNode<T>(value)); return *this; }
-
- friend bool operator==<>(const DeprecatedValueList<T> &, const DeprecatedValueList<T> &);
-
-private:
- DeprecatedValueListImpl impl;
-
- static void deleteNode(DeprecatedValueListImplNode *node) { delete (DeprecatedValueListNode<T> *)node; }
- static bool nodesEqual(const DeprecatedValueListImplNode *a, const DeprecatedValueListImplNode *b)
- { return ((DeprecatedValueListNode<T> *)a)->value == ((DeprecatedValueListNode<T> *)b)->value; }
- static DeprecatedValueListImplNode *copyNode(DeprecatedValueListImplNode *node)
- { return new DeprecatedValueListNode<T>(((DeprecatedValueListNode<T> *)node)->value); }
-};
-
-template<class T>
-inline bool operator==(const DeprecatedValueList<T> &a, const DeprecatedValueList<T> &b)
-{
- return a.impl.isEqual(b.impl, DeprecatedValueList<T>::nodesEqual);
-}
-
-}
-
-#endif
+++ /dev/null
-/*
- * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DeprecatedValueListImpl.h"
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <stdlib.h>
-
-namespace WebCore {
-
-class DeprecatedValueListImpl::Private : public RefCounted<DeprecatedValueListImpl::Private> {
-public:
- Private(void (*deleteFunc)(DeprecatedValueListImplNode *), DeprecatedValueListImplNode *(*copyFunc)(DeprecatedValueListImplNode *));
- Private(const Private &other);
-
- ~Private();
-
- void copyList(DeprecatedValueListImplNode *l, DeprecatedValueListImplNode *&head, DeprecatedValueListImplNode *&tail) const;
- void deleteList(DeprecatedValueListImplNode *l);
-
- DeprecatedValueListImplNode *head;
- DeprecatedValueListImplNode *tail;
-
- void (*deleteNode)(DeprecatedValueListImplNode *);
- DeprecatedValueListImplNode *(*copyNode)(DeprecatedValueListImplNode *);
- unsigned count;
-};
-
-inline DeprecatedValueListImpl::Private::Private(void (*deleteFunc)(DeprecatedValueListImplNode*),
- DeprecatedValueListImplNode* (*copyFunc)(DeprecatedValueListImplNode*))
- : head(NULL)
- , tail(NULL)
- , deleteNode(deleteFunc)
- , copyNode(copyFunc)
- , count(0)
-{
-}
-
-inline DeprecatedValueListImpl::Private::Private(const Private &other)
- : RefCounted<Private>()
- , deleteNode(other.deleteNode)
- , copyNode(other.copyNode)
- , count(other.count)
-{
- other.copyList(other.head, head, tail);
-}
-
-inline DeprecatedValueListImpl::Private::~Private()
-{
- deleteList(head);
-}
-
-void DeprecatedValueListImpl::Private::copyList(DeprecatedValueListImplNode *l, DeprecatedValueListImplNode *&head, DeprecatedValueListImplNode *&tail) const
-{
- DeprecatedValueListImplNode *prev = NULL;
- DeprecatedValueListImplNode *node = l;
-
- head = NULL;
-
- while (node != NULL) {
- DeprecatedValueListImplNode *copy = copyNode(node);
- if (prev == NULL) {
- head = copy;
- } else {
- prev->next = copy;
- }
-
- copy->prev = prev;
- copy->next = NULL;
-
- prev = copy;
- node = node->next;
- }
-
- tail = prev;
-}
-
-void DeprecatedValueListImpl::Private::deleteList(DeprecatedValueListImplNode *l)
-{
- DeprecatedValueListImplNode *p = l;
-
- while (p != NULL) {
- DeprecatedValueListImplNode *next = p->next;
- deleteNode(p);
- p = next;
- }
-}
-
-DeprecatedValueListImpl::DeprecatedValueListImpl(void (*deleteFunc)(DeprecatedValueListImplNode *), DeprecatedValueListImplNode *(*copyFunc)(DeprecatedValueListImplNode *)) :
- d(adoptRef(new Private(deleteFunc, copyFunc)))
-{
-}
-
-DeprecatedValueListImpl::DeprecatedValueListImpl(const DeprecatedValueListImpl &other) :
- d(other.d)
-{
-}
-
-DeprecatedValueListImpl::~DeprecatedValueListImpl()
-{
-}
-
-void DeprecatedValueListImpl::clear()
-{
- if (d->head) {
- copyOnWrite();
- d->deleteList(d->head);
- d->head = NULL;
- d->tail = NULL;
- d->count = 0;
- }
-}
-
-unsigned DeprecatedValueListImpl::count() const
-{
- return d->count;
-}
-
-bool DeprecatedValueListImpl::isEmpty() const
-{
- return d->count == 0;
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::appendNode(DeprecatedValueListImplNode *node)
-{
- copyOnWrite();
-
- node->next = NULL;
- node->prev = d->tail;
- d->tail = node;
-
- if (d->head == NULL) {
- d->head = node;
- } else {
- node->prev->next = node;
- }
-
- d->count++;
-
- return node;
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::prependNode(DeprecatedValueListImplNode *node)
-{
- copyOnWrite();
-
- node->next = d->head;
- node->prev = NULL;
- d->head = node;
-
- if (d->tail == NULL) {
- d->tail = node;
- } else {
- node->next->prev = node;
- }
-
- d->count++;
-
- return node;
-}
-
-void DeprecatedValueListImpl::removeEqualNodes(DeprecatedValueListImplNode *node, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *))
-{
- copyOnWrite();
-
- DeprecatedValueListImplNode *next;
- for (DeprecatedValueListImplNode *p = d->head; p != NULL; p = next) {
- next = p->next;
- if (equalFunc(node, p)) {
- if (p->next != NULL) {
- p->next->prev = p->prev;
- } else {
- d->tail = p->prev;
- }
-
- if (p->prev != NULL) {
- p->prev->next = p->next;
- } else {
- d->head = p->next;
- }
-
- d->deleteNode(p);
-
- d->count--;
- }
- }
-}
-
-unsigned DeprecatedValueListImpl::containsEqualNodes(DeprecatedValueListImplNode *node, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *)) const
-{
- unsigned contains = 0;
-
- for (DeprecatedValueListImplNode *p = d->head; p != NULL; p = p->next) {
- if (equalFunc(node, p)) {
- ++contains;
- }
- }
-
- return contains;
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::findEqualNode(DeprecatedValueListImplNode *node, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *)) const
-{
- DeprecatedValueListImplIterator it = begin();
- DeprecatedValueListImplIterator endIt = end();
- while (it != endIt) {
- if (equalFunc(node, it.node())) {
- break;
- }
- it++;
- }
- return it;
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::insert(const DeprecatedValueListImplIterator &iterator, DeprecatedValueListImplNode *node)
-{
- copyOnWrite();
-
- DeprecatedValueListImplNode *next = iterator.nodeImpl;
-
- if (next == NULL)
- return appendNode(node);
-
- if (next == d->head)
- return prependNode(node);
-
- DeprecatedValueListImplNode *prev = next->prev;
-
- node->next = next;
- node->prev = prev;
- next->prev = node;
- prev->next = node;
-
- d->count++;
-
- return node;
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::removeIterator(DeprecatedValueListImplIterator &iterator)
-{
- copyOnWrite();
-
- if (iterator.nodeImpl == NULL) {
- return iterator;
- }
-
- DeprecatedValueListImplNode *next = iterator.nodeImpl->next;
-
- // detach node
- if (iterator.nodeImpl->next != NULL) {
- iterator.nodeImpl->next->prev = iterator.nodeImpl->prev;
- } else {
- d->tail = iterator.nodeImpl->prev;
- }
- if (iterator.nodeImpl->prev != NULL) {
- iterator.nodeImpl->prev->next = iterator.nodeImpl->next;
- } else {
- d->head = iterator.nodeImpl->next;
- }
-
- d->deleteNode(iterator.nodeImpl);
- d->count--;
-
- return DeprecatedValueListImplIterator(next);
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::fromLast()
-{
- copyOnWrite();
- return DeprecatedValueListImplIterator(lastNode());
-}
-
-DeprecatedValueListImplNode *DeprecatedValueListImpl::firstNode()
-{
- copyOnWrite();
- return ((const DeprecatedValueListImpl *)this)->firstNode();
-}
-
-DeprecatedValueListImplNode *DeprecatedValueListImpl::lastNode()
-{
- copyOnWrite();
- return ((const DeprecatedValueListImpl *)this)->lastNode();
-}
-
-DeprecatedValueListImplNode *DeprecatedValueListImpl::firstNode() const
-{
- return d->head;
-}
-
-DeprecatedValueListImplNode *DeprecatedValueListImpl::lastNode() const
-{
- return d->tail;
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::begin()
-{
- copyOnWrite();
- return ((const DeprecatedValueListImpl *)this)->begin();
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::end()
-{
- copyOnWrite();
- return ((const DeprecatedValueListImpl *)this)->end();
-}
-
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::begin() const
-{
- return DeprecatedValueListImplIterator(firstNode());
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::end() const
-{
- return DeprecatedValueListImplIterator(NULL);
-}
-
-DeprecatedValueListImplIterator DeprecatedValueListImpl::fromLast() const
-{
- return DeprecatedValueListImplIterator(lastNode());
-}
-
-DeprecatedValueListImplNode *DeprecatedValueListImpl::nodeAt(unsigned index)
-{
- copyOnWrite();
-
- if (d->count <= index) {
- return NULL;
- }
-
- DeprecatedValueListImplNode *p = d->head;
-
- for (unsigned i = 0; i < index; i++) {
- p = p->next;
- }
-
- return p;
-}
-
-DeprecatedValueListImplNode *DeprecatedValueListImpl::nodeAt(unsigned index) const
-{
- if (d->count <= index) {
- return NULL;
- }
-
- DeprecatedValueListImplNode *p = d->head;
-
- for (unsigned i = 0; i < index; i++) {
- p = p->next;
- }
-
- return p;
-}
-
-DeprecatedValueListImpl& DeprecatedValueListImpl::operator=(const DeprecatedValueListImpl &other)
-{
- DeprecatedValueListImpl tmp(other);
- RefPtr<Private> tmpD = tmp.d;
-
- tmp.d = d;
- d = tmpD;
-
- return *this;
-}
-
-void DeprecatedValueListImpl::copyOnWrite()
-{
- if (!d->hasOneRef())
- d = adoptRef(new Private(*d));
-}
-
-bool DeprecatedValueListImpl::isEqual(const DeprecatedValueListImpl &other, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *)) const
-{
- DeprecatedValueListImplNode *p, *q;
- for (p = d->head, q = other.d->head; p && q; p = p->next, q = q->next) {
- if (!equalFunc(p, q)) {
- return false;
- }
- }
- return !p && !q;
-}
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DeprecatedValueListImpl_h
-#define DeprecatedValueListImpl_h
-
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class DeprecatedValueListImplNode;
-
-class DeprecatedValueListImplIterator
-{
-public:
- DeprecatedValueListImplIterator();
-
- bool operator==(const DeprecatedValueListImplIterator &other);
- bool operator!=(const DeprecatedValueListImplIterator &other);
-
- DeprecatedValueListImplNode *node();
- const DeprecatedValueListImplNode *node() const;
-
- DeprecatedValueListImplIterator& operator++();
- DeprecatedValueListImplIterator operator++(int);
- DeprecatedValueListImplIterator& operator--();
-
-private:
- DeprecatedValueListImplIterator(const DeprecatedValueListImplNode *n);
-
- DeprecatedValueListImplNode *nodeImpl;
-
- friend class DeprecatedValueListImpl;
-};
-
-class DeprecatedValueListImpl
-{
-public:
- DeprecatedValueListImpl(void (*deleteFunc)(DeprecatedValueListImplNode *), DeprecatedValueListImplNode *(*copyNode)(DeprecatedValueListImplNode *));
- ~DeprecatedValueListImpl();
-
- DeprecatedValueListImpl(const DeprecatedValueListImpl&);
- DeprecatedValueListImpl& operator=(const DeprecatedValueListImpl&);
-
- void clear();
- unsigned count() const;
- bool isEmpty() const;
-
- DeprecatedValueListImplIterator appendNode(DeprecatedValueListImplNode *node);
- DeprecatedValueListImplIterator prependNode(DeprecatedValueListImplNode *node);
- void removeEqualNodes(DeprecatedValueListImplNode *node, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *));
- unsigned containsEqualNodes(DeprecatedValueListImplNode *node, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *)) const;
-
- DeprecatedValueListImplIterator findEqualNode(DeprecatedValueListImplNode *node, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *)) const;
-
- DeprecatedValueListImplIterator insert(const DeprecatedValueListImplIterator &iterator, DeprecatedValueListImplNode* node);
- DeprecatedValueListImplIterator removeIterator(DeprecatedValueListImplIterator &iterator);
- DeprecatedValueListImplIterator fromLast();
-
- DeprecatedValueListImplNode *firstNode();
- DeprecatedValueListImplNode *lastNode();
-
- DeprecatedValueListImplNode *firstNode() const;
- DeprecatedValueListImplNode *lastNode() const;
-
- DeprecatedValueListImplIterator begin();
- DeprecatedValueListImplIterator end();
-
- DeprecatedValueListImplIterator begin() const;
- DeprecatedValueListImplIterator end() const;
- DeprecatedValueListImplIterator fromLast() const;
-
- DeprecatedValueListImplNode *nodeAt(unsigned index);
- DeprecatedValueListImplNode *nodeAt(unsigned index) const;
-
- bool isEqual(const DeprecatedValueListImpl &other, bool (*equalFunc)(const DeprecatedValueListImplNode *, const DeprecatedValueListImplNode *)) const;
-
-private:
- void copyOnWrite();
-
- class Private;
-
- RefPtr<Private> d;
-
- friend class DeprecatedValueListImplNode;
-};
-
-class DeprecatedValueListImplNode
-{
-protected:
- DeprecatedValueListImplNode();
-
-private:
- DeprecatedValueListImplNode *prev;
- DeprecatedValueListImplNode *next;
-
- friend class DeprecatedValueListImpl;
- friend class DeprecatedValueListImplIterator;
- friend class DeprecatedValueListImpl::Private;
-};
-
-inline DeprecatedValueListImplIterator::DeprecatedValueListImplIterator() :
- nodeImpl(NULL)
-{
-}
-
-inline bool DeprecatedValueListImplIterator::operator==(const DeprecatedValueListImplIterator &other)
-{
- return nodeImpl == other.nodeImpl;
-}
-
-inline bool DeprecatedValueListImplIterator::operator!=(const DeprecatedValueListImplIterator &other)
-{
- return nodeImpl != other.nodeImpl;
-}
-
-inline DeprecatedValueListImplNode *DeprecatedValueListImplIterator::node()
-{
- return nodeImpl;
-}
-
-inline const DeprecatedValueListImplNode *DeprecatedValueListImplIterator::node() const
-{
- return nodeImpl;
-}
-
-inline DeprecatedValueListImplIterator& DeprecatedValueListImplIterator::operator++()
-{
- if (nodeImpl != NULL) {
- nodeImpl = nodeImpl->next;
- }
- return *this;
-}
-
-inline DeprecatedValueListImplIterator DeprecatedValueListImplIterator::operator++(int)
-{
- DeprecatedValueListImplIterator tmp(*this);
-
- if (nodeImpl != NULL) {
- nodeImpl = nodeImpl->next;
- }
-
- return tmp;
-}
-
-inline DeprecatedValueListImplIterator& DeprecatedValueListImplIterator::operator--()
-{
- if (nodeImpl != NULL) {
- nodeImpl = nodeImpl->prev;
- }
- return *this;
-}
-
-inline DeprecatedValueListImplIterator::DeprecatedValueListImplIterator(const DeprecatedValueListImplNode *n) :
- nodeImpl((DeprecatedValueListImplNode *)n)
-{
-}
-
-inline DeprecatedValueListImplNode::DeprecatedValueListImplNode() :
- prev(NULL),
- next(NULL)
-{
-}
-
-}
-
-#endif