| 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 21 matching lines...) Expand all Loading... |
| 32 #define PageConsoleAgent_h | 32 #define PageConsoleAgent_h |
| 33 | 33 |
| 34 #include "core/inspector/InspectorConsoleAgent.h" | 34 #include "core/inspector/InspectorConsoleAgent.h" |
| 35 #include "wtf/PassOwnPtr.h" | 35 #include "wtf/PassOwnPtr.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class ConsoleMessage; | 39 class ConsoleMessage; |
| 40 class ConsoleMessageStorage; | 40 class ConsoleMessageStorage; |
| 41 class InspectorDOMAgent; | 41 class InspectorDOMAgent; |
| 42 class InspectorPageAgent; | 42 class Page; |
| 43 class WorkerInspectorProxy; | 43 class WorkerInspectorProxy; |
| 44 class WorkerGlobalScopeProxy; | 44 class WorkerGlobalScopeProxy; |
| 45 | 45 |
| 46 class PageConsoleAgent final : public InspectorConsoleAgent { | 46 class PageConsoleAgent final : public InspectorConsoleAgent { |
| 47 WTF_MAKE_NONCOPYABLE(PageConsoleAgent); | 47 WTF_MAKE_NONCOPYABLE(PageConsoleAgent); |
| 48 public: | 48 public: |
| 49 static PassOwnPtrWillBeRawPtr<PageConsoleAgent> create(InjectedScriptManager
* injectedScriptManager, InspectorDOMAgent* domAgent, InspectorPageAgent* pageAg
ent) | 49 static PassOwnPtrWillBeRawPtr<PageConsoleAgent> create(InjectedScriptManager
* injectedScriptManager, InspectorDOMAgent* domAgent, Page* page) |
| 50 { | 50 { |
| 51 return adoptPtrWillBeNoop(new PageConsoleAgent(injectedScriptManager, do
mAgent, pageAgent)); | 51 return adoptPtrWillBeNoop(new PageConsoleAgent(injectedScriptManager, do
mAgent, page)); |
| 52 } | 52 } |
| 53 virtual ~PageConsoleAgent(); | 53 virtual ~PageConsoleAgent(); |
| 54 virtual void trace(Visitor*) override; | 54 virtual void trace(Visitor*) override; |
| 55 | 55 |
| 56 virtual void enable(ErrorString*) override; | 56 virtual void enable(ErrorString*) override; |
| 57 virtual void disable(ErrorString*) override; | 57 virtual void disable(ErrorString*) override; |
| 58 | 58 |
| 59 virtual bool isWorkerAgent() override { return false; } | 59 virtual bool isWorkerAgent() override { return false; } |
| 60 | 60 |
| 61 void workerTerminated(WorkerInspectorProxy*); | 61 void workerTerminated(WorkerInspectorProxy*); |
| 62 | 62 |
| 63 void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*); | 63 void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*); |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 virtual ConsoleMessageStorage* messageStorage() override; | 66 virtual ConsoleMessageStorage* messageStorage() override; |
| 67 | 67 |
| 68 virtual void enableStackCapturingIfNeeded() override; | 68 virtual void enableStackCapturingIfNeeded() override; |
| 69 virtual void disableStackCapturingIfNeeded() override; | 69 virtual void disableStackCapturingIfNeeded() override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 PageConsoleAgent(InjectedScriptManager*, InspectorDOMAgent*, InspectorPageAg
ent*); | 72 PageConsoleAgent(InjectedScriptManager*, InspectorDOMAgent*, Page*); |
| 73 virtual void clearMessages(ErrorString*) override; | 73 virtual void clearMessages(ErrorString*) override; |
| 74 virtual void addInspectedNode(ErrorString*, int nodeId) override; | 74 virtual void addInspectedNode(ErrorString*, int nodeId) override; |
| 75 | 75 |
| 76 RawPtrWillBeMember<InspectorDOMAgent> m_inspectorDOMAgent; | 76 RawPtrWillBeMember<InspectorDOMAgent> m_inspectorDOMAgent; |
| 77 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | 77 RawPtrWillBeMember<Page> m_page; |
| 78 HashSet<WorkerGlobalScopeProxy*> m_workersWithEnabledConsole; | 78 HashSet<WorkerGlobalScopeProxy*> m_workersWithEnabledConsole; |
| 79 | 79 |
| 80 static int s_enabledAgentCount; | 80 static int s_enabledAgentCount; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| 84 | 84 |
| 85 | 85 |
| 86 #endif // !defined(PageConsoleAgent_h) | 86 #endif // !defined(PageConsoleAgent_h) |
| OLD | NEW |