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