| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef InspectorTracingAgent_h | 7 #ifndef InspectorTracingAgent_h |
| 8 #define InspectorTracingAgent_h | 8 #define InspectorTracingAgent_h |
| 9 | 9 |
| 10 #include "core/InspectorFrontend.h" | 10 #include "core/InspectorFrontend.h" |
| 11 #include "core/inspector/InspectorBaseAgent.h" | 11 #include "core/inspector/InspectorBaseAgent.h" |
| 12 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
| 13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class InspectorClient; | 17 class InspectorClient; |
| 18 class InspectorPageAgent; | |
| 19 class InspectorWorkerAgent; | 18 class InspectorWorkerAgent; |
| 19 class Page; |
| 20 | 20 |
| 21 class InspectorTracingAgent final | 21 class InspectorTracingAgent final |
| 22 : public InspectorBaseAgent<InspectorTracingAgent> | 22 : public InspectorBaseAgent<InspectorTracingAgent> |
| 23 , public InspectorBackendDispatcher::TracingCommandHandler { | 23 , public InspectorBackendDispatcher::TracingCommandHandler { |
| 24 WTF_MAKE_NONCOPYABLE(InspectorTracingAgent); | 24 WTF_MAKE_NONCOPYABLE(InspectorTracingAgent); |
| 25 public: | 25 public: |
| 26 static PassOwnPtrWillBeRawPtr<InspectorTracingAgent> create(InspectorClient*
client, InspectorWorkerAgent* workerAgent, InspectorPageAgent* pageAgent) | 26 static PassOwnPtrWillBeRawPtr<InspectorTracingAgent> create(InspectorClient*
client, InspectorWorkerAgent* workerAgent, Page* page) |
| 27 { | 27 { |
| 28 return adoptPtrWillBeNoop(new InspectorTracingAgent(client, workerAgent,
pageAgent)); | 28 return adoptPtrWillBeNoop(new InspectorTracingAgent(client, workerAgent,
page)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void trace(Visitor*) override; | 31 void trace(Visitor*) override; |
| 32 | 32 |
| 33 // Base agent methods. | 33 // Base agent methods. |
| 34 virtual void restore() override; | 34 virtual void restore() override; |
| 35 virtual void setFrontend(InspectorFrontend*) override; | 35 virtual void setFrontend(InspectorFrontend*) override; |
| 36 virtual void clearFrontend() override; | 36 virtual void clearFrontend() override; |
| 37 | 37 |
| 38 // Protocol method implementations. | 38 // Protocol method implementations. |
| 39 virtual void start(ErrorString*, const String* categoryFilter, const String*
, const double*, PassRefPtrWillBeRawPtr<StartCallback>) override; | 39 virtual void start(ErrorString*, const String* categoryFilter, const String*
, const double*, PassRefPtrWillBeRawPtr<StartCallback>) override; |
| 40 virtual void end(ErrorString*, PassRefPtrWillBeRawPtr<EndCallback>); | 40 virtual void end(ErrorString*, PassRefPtrWillBeRawPtr<EndCallback>); |
| 41 | 41 |
| 42 // Methods for other agents to use. | 42 // Methods for other agents to use. |
| 43 void setLayerTreeId(int); | 43 void setLayerTreeId(int); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 InspectorTracingAgent(InspectorClient*, InspectorWorkerAgent*, InspectorPage
Agent*); | 46 InspectorTracingAgent(InspectorClient*, InspectorWorkerAgent*, Page*); |
| 47 | 47 |
| 48 void emitMetadataEvents(); | 48 void emitMetadataEvents(); |
| 49 void resetSessionId(); | 49 void resetSessionId(); |
| 50 String sessionId(); | 50 String sessionId(); |
| 51 | 51 |
| 52 int m_layerTreeId; | 52 int m_layerTreeId; |
| 53 InspectorClient* m_client; | 53 InspectorClient* m_client; |
| 54 InspectorFrontend::Tracing* m_frontend; | 54 InspectorFrontend::Tracing* m_frontend; |
| 55 RawPtrWillBeMember<InspectorWorkerAgent> m_workerAgent; | 55 RawPtrWillBeMember<InspectorWorkerAgent> m_workerAgent; |
| 56 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | 56 RawPtrWillBeMember<Page> m_page; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace blink | 59 } // namespace blink |
| 60 | 60 |
| 61 #endif // InspectorTracingAgent_h | 61 #endif // InspectorTracingAgent_h |
| OLD | NEW |