OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #ifndef FrameTree_h | 20 #ifndef FrameTree_h |
21 #define FrameTree_h | 21 #define FrameTree_h |
22 | 22 |
| 23 #include "platform/heap/Handle.h" |
23 #include "wtf/text/AtomicString.h" | 24 #include "wtf/text/AtomicString.h" |
24 | 25 |
25 namespace blink { | 26 namespace blink { |
26 | 27 |
27 class Frame; | 28 class Frame; |
28 class TreeScope; | 29 class TreeScope; |
29 | 30 |
30 class FrameTree { | 31 class FrameTree FINAL { |
31 WTF_MAKE_NONCOPYABLE(FrameTree); | 32 WTF_MAKE_NONCOPYABLE(FrameTree); |
| 33 ALLOW_ONLY_INLINE_ALLOCATION(); |
32 public: | 34 public: |
33 explicit FrameTree(Frame* thisFrame); | 35 explicit FrameTree(Frame* thisFrame); |
34 ~FrameTree(); | 36 ~FrameTree(); |
35 | 37 |
36 const AtomicString& name() const { return m_name; } | 38 const AtomicString& name() const { return m_name; } |
37 const AtomicString& uniqueName() const { return m_uniqueName; } | 39 const AtomicString& uniqueName() const { return m_uniqueName; } |
38 // If |name| is not empty, |fallbackName| is ignored. Otherwise, | 40 // If |name| is not empty, |fallbackName| is ignored. Otherwise, |
39 // |fallbackName| is used as a source of uniqueName. | 41 // |fallbackName| is used as a source of uniqueName. |
40 void setName(const AtomicString& name, const AtomicString& fallbackName = nu
llAtom); | 42 void setName(const AtomicString& name, const AtomicString& fallbackName = nu
llAtom); |
41 | 43 |
(...skipping 11 matching lines...) Expand all Loading... |
53 | 55 |
54 Frame* child(const AtomicString& name) const; | 56 Frame* child(const AtomicString& name) const; |
55 Frame* find(const AtomicString& name) const; | 57 Frame* find(const AtomicString& name) const; |
56 unsigned childCount() const; | 58 unsigned childCount() const; |
57 | 59 |
58 Frame* scopedChild(unsigned index) const; | 60 Frame* scopedChild(unsigned index) const; |
59 Frame* scopedChild(const AtomicString& name) const; | 61 Frame* scopedChild(const AtomicString& name) const; |
60 unsigned scopedChildCount() const; | 62 unsigned scopedChildCount() const; |
61 void invalidateScopedChildCount(); | 63 void invalidateScopedChildCount(); |
62 | 64 |
| 65 void trace(Visitor*); |
| 66 |
63 private: | 67 private: |
64 Frame* deepLastChild() const; | 68 Frame* deepLastChild() const; |
65 AtomicString uniqueChildName(const AtomicString& requestedName) const; | 69 AtomicString uniqueChildName(const AtomicString& requestedName) const; |
66 bool uniqueNameExists(const AtomicString& name) const; | 70 bool uniqueNameExists(const AtomicString& name) const; |
67 unsigned scopedChildCount(TreeScope*) const; | 71 unsigned scopedChildCount(TreeScope*) const; |
68 | 72 |
69 Frame* m_thisFrame; | 73 RawPtrWillBeMember<Frame> m_thisFrame; |
70 | 74 |
71 AtomicString m_name; // The actual frame name (may be empty). | 75 AtomicString m_name; // The actual frame name (may be empty). |
72 AtomicString m_uniqueName; | 76 AtomicString m_uniqueName; |
73 | 77 |
74 mutable unsigned m_scopedChildCount; | 78 mutable unsigned m_scopedChildCount; |
75 }; | 79 }; |
76 | 80 |
77 } // namespace blink | 81 } // namespace blink |
78 | 82 |
79 #ifndef NDEBUG | 83 #ifndef NDEBUG |
80 // Outside the WebCore namespace for ease of invocation from gdb. | 84 // Outside the WebCore namespace for ease of invocation from gdb. |
81 void showFrameTree(const blink::Frame*); | 85 void showFrameTree(const blink::Frame*); |
82 #endif | 86 #endif |
83 | 87 |
84 #endif // FrameTree_h | 88 #endif // FrameTree_h |
OLD | NEW |