Chromium Code Reviews| 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 InspectorPageAgent; | |
| 18 class InspectorWorkerAgent; | 17 class InspectorWorkerAgent; |
|
yurys
2015/04/24 08:54:41
class LocalFrame;
| |
| 19 | 18 |
| 20 class InspectorTracingAgent final | 19 class InspectorTracingAgent final |
| 21 : public InspectorBaseAgent<InspectorTracingAgent, InspectorFrontend::Tracin g> | 20 : public InspectorBaseAgent<InspectorTracingAgent, InspectorFrontend::Tracin g> |
| 22 , public InspectorBackendDispatcher::TracingCommandHandler { | 21 , public InspectorBackendDispatcher::TracingCommandHandler { |
| 23 WTF_MAKE_NONCOPYABLE(InspectorTracingAgent); | 22 WTF_MAKE_NONCOPYABLE(InspectorTracingAgent); |
| 24 public: | 23 public: |
| 25 class Client { | 24 class Client { |
| 26 public: | 25 public: |
| 27 virtual ~Client() { } | 26 virtual ~Client() { } |
| 28 | 27 |
| 29 virtual void enableTracing(const String& categoryFilter) { } | 28 virtual void enableTracing(const String& categoryFilter) { } |
| 30 virtual void disableTracing() { } | 29 virtual void disableTracing() { } |
| 31 }; | 30 }; |
| 32 | 31 |
| 33 static PassOwnPtrWillBeRawPtr<InspectorTracingAgent> create(Client* client, InspectorWorkerAgent* workerAgent, InspectorPageAgent* pageAgent) | 32 static PassOwnPtrWillBeRawPtr<InspectorTracingAgent> create(LocalFrame* insp ectedFrame, Client* client, InspectorWorkerAgent* workerAgent) |
| 34 { | 33 { |
| 35 return adoptPtrWillBeNoop(new InspectorTracingAgent(client, workerAgent, pageAgent)); | 34 return adoptPtrWillBeNoop(new InspectorTracingAgent(inspectedFrame, clie nt, workerAgent)); |
| 36 } | 35 } |
| 37 | 36 |
| 38 DECLARE_VIRTUAL_TRACE(); | 37 DECLARE_VIRTUAL_TRACE(); |
| 39 | 38 |
| 40 // Base agent methods. | 39 // Base agent methods. |
| 41 void restore() override; | 40 void restore() override; |
| 42 void disable(ErrorString*) override; | 41 void disable(ErrorString*) override; |
| 43 | 42 |
| 44 // Protocol method implementations. | 43 // Protocol method implementations. |
| 45 virtual void start(ErrorString*, const String* categoryFilter, const String* , const double*, PassRefPtrWillBeRawPtr<StartCallback>) override; | 44 virtual void start(ErrorString*, const String* categoryFilter, const String* , const double*, PassRefPtrWillBeRawPtr<StartCallback>) override; |
| 46 virtual void end(ErrorString*, PassRefPtrWillBeRawPtr<EndCallback>); | 45 virtual void end(ErrorString*, PassRefPtrWillBeRawPtr<EndCallback>); |
| 47 | 46 |
| 48 // Methods for other agents to use. | 47 // Methods for other agents to use. |
| 49 void setLayerTreeId(int); | 48 void setLayerTreeId(int); |
| 50 | 49 |
| 51 private: | 50 private: |
| 52 InspectorTracingAgent(Client*, InspectorWorkerAgent*, InspectorPageAgent*); | 51 InspectorTracingAgent(LocalFrame*, Client*, InspectorWorkerAgent*); |
| 53 | 52 |
| 54 void emitMetadataEvents(); | 53 void emitMetadataEvents(); |
| 55 void resetSessionId(); | 54 void resetSessionId(); |
| 56 String sessionId(); | 55 String sessionId(); |
| 57 | 56 |
| 57 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; | |
| 58 int m_layerTreeId; | 58 int m_layerTreeId; |
| 59 Client* m_client; | 59 Client* m_client; |
| 60 RawPtrWillBeMember<InspectorWorkerAgent> m_workerAgent; | 60 RawPtrWillBeMember<InspectorWorkerAgent> m_workerAgent; |
| 61 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 } // namespace blink | 63 } // namespace blink |
| 65 | 64 |
| 66 #endif // InspectorTracingAgent_h | 65 #endif // InspectorTracingAgent_h |
| OLD | NEW |