| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef OrderIterator_h | 31 #ifndef PageDebuggerAgent_h |
| 32 #define OrderIterator_h | 32 #define PageDebuggerAgent_h |
| 33 | 33 |
| 34 #include "wtf/Noncopyable.h" | 34 #include "bindings/core/v8/PageScriptDebugServer.h" |
| 35 | 35 #include "core/inspector/InspectorDebuggerAgent.h" |
| 36 #include <set> | |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 class RenderBox; | 39 class DocumentLoader; |
| 40 class InspectorPageAgent; |
| 41 class Page; |
| 42 class PageScriptDebugServer; |
| 43 class ScriptSourceCode; |
| 41 | 44 |
| 42 class OrderIterator { | 45 class PageDebuggerAgent FINAL |
| 43 WTF_MAKE_NONCOPYABLE(OrderIterator); | 46 : public InspectorDebuggerAgent { |
| 47 WTF_MAKE_NONCOPYABLE(PageDebuggerAgent); |
| 48 WTF_MAKE_FAST_ALLOCATED; |
| 44 public: | 49 public: |
| 45 friend class OrderIteratorPopulator; | 50 static PassOwnPtr<PageDebuggerAgent> create(PageScriptDebugServer*, Page*, I
njectedScriptManager*); |
| 51 virtual ~PageDebuggerAgent(); |
| 46 | 52 |
| 47 OrderIterator(const RenderBox*); | 53 void didClearDocumentOfWindowObject(LocalFrame*); |
| 48 | |
| 49 RenderBox* currentChild() const { return m_currentChild; } | |
| 50 RenderBox* first(); | |
| 51 RenderBox* next(); | |
| 52 void reset(); | |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 const RenderBox* m_containerBox; | 56 virtual void startListeningScriptDebugServer() override; |
| 57 virtual void stopListeningScriptDebugServer() override; |
| 58 virtual PageScriptDebugServer& scriptDebugServer() override; |
| 59 virtual void muteConsole() override; |
| 60 virtual void unmuteConsole() override; |
| 56 | 61 |
| 57 RenderBox* m_currentChild; | 62 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) override; |
| 63 virtual void setOverlayMessage(ErrorString*, const String*) override; |
| 58 | 64 |
| 59 typedef std::set<int> OrderValues; | 65 PageDebuggerAgent(PageScriptDebugServer*, Page*, InjectedScriptManager*); |
| 60 OrderValues m_orderValues; | 66 PageScriptDebugServer* m_pageScriptDebugServer; |
| 61 OrderValues::const_iterator m_orderValuesIterator; | 67 Page* m_page; |
| 62 bool m_isReset; | |
| 63 }; | |
| 64 | |
| 65 class OrderIteratorPopulator { | |
| 66 public: | |
| 67 explicit OrderIteratorPopulator(OrderIterator& iterator) | |
| 68 : m_iterator(iterator) | |
| 69 { | |
| 70 m_iterator.m_orderValues.clear(); | |
| 71 } | |
| 72 | |
| 73 ~OrderIteratorPopulator(); | |
| 74 | |
| 75 void collectChild(const RenderBox*); | |
| 76 | |
| 77 private: | |
| 78 OrderIterator& m_iterator; | |
| 79 }; | 68 }; |
| 80 | 69 |
| 81 } // namespace blink | 70 } // namespace blink |
| 82 | 71 |
| 83 #endif // OrderIterator_h | 72 |
| 73 #endif // !defined(PageDebuggerAgent_h) |
| OLD | NEW |