| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef InspectedFrames_h | 5 #ifndef InspectedFrames_h |
| 6 #define InspectedFrames_h | 6 #define InspectedFrames_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
| 11 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class LocalFrame; | 15 class LocalFrame; |
| 16 | 16 |
| 17 class CORE_EXPORT InspectedFrames final : public NoBaseWillBeGarbageCollectedFin
alized<InspectedFrames> { | 17 class CORE_EXPORT InspectedFrames final : public GarbageCollectedFinalized<Inspe
ctedFrames> { |
| 18 WTF_MAKE_NONCOPYABLE(InspectedFrames); | 18 WTF_MAKE_NONCOPYABLE(InspectedFrames); |
| 19 USING_FAST_MALLOC_WILL_BE_REMOVED(InspectedFrames); | |
| 20 public: | 19 public: |
| 21 class CORE_EXPORT Iterator { | 20 class CORE_EXPORT Iterator { |
| 22 STACK_ALLOCATED(); | 21 STACK_ALLOCATED(); |
| 23 public: | 22 public: |
| 24 Iterator operator++(int); | 23 Iterator operator++(int); |
| 25 Iterator& operator++(); | 24 Iterator& operator++(); |
| 26 bool operator==(const Iterator& other); | 25 bool operator==(const Iterator& other); |
| 27 bool operator!=(const Iterator& other); | 26 bool operator!=(const Iterator& other); |
| 28 LocalFrame* operator*() { return m_current; } | 27 LocalFrame* operator*() { return m_current; } |
| 29 LocalFrame* operator->() { return m_current; } | 28 LocalFrame* operator->() { return m_current; } |
| 30 private: | 29 private: |
| 31 friend class InspectedFrames; | 30 friend class InspectedFrames; |
| 32 Iterator(LocalFrame* root, LocalFrame* current); | 31 Iterator(LocalFrame* root, LocalFrame* current); |
| 33 RawPtrWillBeMember<LocalFrame> m_root; | 32 Member<LocalFrame> m_root; |
| 34 RawPtrWillBeMember<LocalFrame> m_current; | 33 Member<LocalFrame> m_current; |
| 35 }; | 34 }; |
| 36 | 35 |
| 37 static PassOwnPtrWillBeRawPtr<InspectedFrames> create(LocalFrame* root) | 36 static RawPtr<InspectedFrames> create(LocalFrame* root) |
| 38 { | 37 { |
| 39 return adoptPtrWillBeNoop(new InspectedFrames(root)); | 38 return new InspectedFrames(root); |
| 40 } | 39 } |
| 41 | 40 |
| 42 LocalFrame* root() { return m_root; } | 41 LocalFrame* root() { return m_root; } |
| 43 bool contains(LocalFrame*) const; | 42 bool contains(LocalFrame*) const; |
| 44 LocalFrame* frameWithSecurityOrigin(const String& originRawString); | 43 LocalFrame* frameWithSecurityOrigin(const String& originRawString); |
| 45 Iterator begin(); | 44 Iterator begin(); |
| 46 Iterator end(); | 45 Iterator end(); |
| 47 | 46 |
| 48 DECLARE_VIRTUAL_TRACE(); | 47 DECLARE_VIRTUAL_TRACE(); |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 explicit InspectedFrames(LocalFrame*); | 50 explicit InspectedFrames(LocalFrame*); |
| 52 | 51 |
| 53 RawPtrWillBeMember<LocalFrame> m_root; | 52 Member<LocalFrame> m_root; |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 } // namespace blink | 55 } // namespace blink |
| 57 | 56 |
| 58 #endif // InspectedFrames_h | 57 #endif // InspectedFrames_h |
| OLD | NEW |