| 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 WorkerInspectorProxy; | 43 class WorkerInspectorProxy; |
| 43 class WorkerGlobalScopeProxy; | 44 class WorkerGlobalScopeProxy; |
| 44 | 45 |
| 45 class PageConsoleAgent final : public InspectorConsoleAgent { | 46 class PageConsoleAgent final : public InspectorConsoleAgent { |
| 46 WTF_MAKE_NONCOPYABLE(PageConsoleAgent); | 47 WTF_MAKE_NONCOPYABLE(PageConsoleAgent); |
| 47 public: | 48 public: |
| 48 static PassOwnPtrWillBeRawPtr<PageConsoleAgent> create(LocalFrame* inspected
Frame, InjectedScriptManager* injectedScriptManager, InspectorDOMAgent* domAgent
) | 49 static PassOwnPtrWillBeRawPtr<PageConsoleAgent> create(InjectedScriptManager
* injectedScriptManager, InspectorDOMAgent* domAgent, InspectorPageAgent* pageAg
ent) |
| 49 { | 50 { |
| 50 return adoptPtrWillBeNoop(new PageConsoleAgent(inspectedFrame, injectedS
criptManager, domAgent)); | 51 return adoptPtrWillBeNoop(new PageConsoleAgent(injectedScriptManager, do
mAgent, pageAgent)); |
| 51 } | 52 } |
| 52 virtual ~PageConsoleAgent(); | 53 virtual ~PageConsoleAgent(); |
| 53 DECLARE_VIRTUAL_TRACE(); | 54 DECLARE_VIRTUAL_TRACE(); |
| 54 | 55 |
| 55 virtual void enable(ErrorString*) override; | 56 virtual void enable(ErrorString*) override; |
| 56 virtual void disable(ErrorString*) override; | 57 virtual void disable(ErrorString*) override; |
| 57 | 58 |
| 58 void workerTerminated(WorkerInspectorProxy*); | 59 void workerTerminated(WorkerInspectorProxy*); |
| 59 | 60 |
| 60 void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*); | 61 void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*); |
| 61 | 62 |
| 62 protected: | 63 protected: |
| 63 virtual ConsoleMessageStorage* messageStorage() override; | 64 virtual ConsoleMessageStorage* messageStorage() override; |
| 64 | 65 |
| 65 virtual void enableStackCapturingIfNeeded() override; | 66 virtual void enableStackCapturingIfNeeded() override; |
| 66 virtual void disableStackCapturingIfNeeded() override; | 67 virtual void disableStackCapturingIfNeeded() override; |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 PageConsoleAgent(LocalFrame*, InjectedScriptManager*, InspectorDOMAgent*); | 70 PageConsoleAgent(InjectedScriptManager*, InspectorDOMAgent*, InspectorPageAg
ent*); |
| 70 virtual void clearMessages(ErrorString*) override; | 71 virtual void clearMessages(ErrorString*) override; |
| 71 | 72 |
| 72 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; | |
| 73 RawPtrWillBeMember<InspectorDOMAgent> m_inspectorDOMAgent; | 73 RawPtrWillBeMember<InspectorDOMAgent> m_inspectorDOMAgent; |
| 74 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 74 HashSet<WorkerGlobalScopeProxy*> m_workersWithEnabledConsole; | 75 HashSet<WorkerGlobalScopeProxy*> m_workersWithEnabledConsole; |
| 75 | 76 |
| 76 static int s_enabledAgentCount; | 77 static int s_enabledAgentCount; |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace blink | 80 } // namespace blink |
| 80 | 81 |
| 81 | 82 |
| 82 #endif // !defined(PageConsoleAgent_h) | 83 #endif // !defined(PageConsoleAgent_h) |
| OLD | NEW |