| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
| 35 #include "wtf/RefPtr.h" | 35 #include "wtf/RefPtr.h" |
| 36 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 class Node; | 40 class Node; |
| 41 | 41 |
| 42 class StaticNodeList FINAL : public NodeList { | 42 class StaticNodeList FINAL : public NodeList { |
| 43 public: | 43 public: |
| 44 static PassRefPtr<StaticNodeList> adopt(Vector<RefPtr<Node> >& nodes); | 44 static PassRefPtrWillBeRawPtr<StaticNodeList> adopt(Vector<RefPtr<Node> >& n
odes); |
| 45 | 45 |
| 46 static PassRefPtr<StaticNodeList> createEmpty() | 46 static PassRefPtrWillBeRawPtr<StaticNodeList> createEmpty() |
| 47 { | 47 { |
| 48 return adoptRef(new StaticNodeList); | 48 return adoptRefWillBeNoop(new StaticNodeList); |
| 49 } | 49 } |
| 50 | 50 |
| 51 virtual ~StaticNodeList(); | 51 virtual ~StaticNodeList(); |
| 52 | 52 |
| 53 virtual unsigned length() const OVERRIDE; | 53 virtual unsigned length() const OVERRIDE; |
| 54 virtual Node* item(unsigned index) const OVERRIDE; | 54 virtual Node* item(unsigned index) const OVERRIDE; |
| 55 | 55 |
| 56 virtual void trace(Visitor*) OVERRIDE; |
| 57 |
| 56 private: | 58 private: |
| 57 // If AllocationSize() is larger than this, we report it as external | 59 // If AllocationSize() is larger than this, we report it as external |
| 58 // allocated memory to V8. | 60 // allocated memory to V8. |
| 59 const static ptrdiff_t externalMemoryReportSizeLimit = 1024; | 61 const static ptrdiff_t externalMemoryReportSizeLimit = 1024; |
| 60 | 62 |
| 61 ptrdiff_t AllocationSize() | 63 ptrdiff_t AllocationSize() |
| 62 { | 64 { |
| 63 return m_nodes.capacity() * sizeof(RefPtr<Node>); | 65 return m_nodes.capacity() * sizeof(RefPtrWillBeMember<Node>); |
| 64 } | 66 } |
| 65 | 67 |
| 66 Vector<RefPtr<Node> > m_nodes; | 68 WillBeHeapVector<RefPtrWillBeMember<Node> > m_nodes; |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace WebCore | 71 } // namespace WebCore |
| 70 | 72 |
| 71 #endif // StaticNodeList_h | 73 #endif // StaticNodeList_h |
| OLD | NEW |