| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/debug/trace_event.h" |
| 8 #include "content/browser/devtools/devtools_protocol.h" | 9 #include "content/browser/devtools/devtools_protocol.h" |
| 9 #include "content/public/browser/trace_subscriber.h" | 10 #include "content/public/browser/trace_subscriber.h" |
| 10 | 11 |
| 11 namespace content { | 12 namespace content { |
| 12 | 13 |
| 13 class DevToolsWebSocketSender; | 14 class DevToolsWebSocketSender; |
| 14 | 15 |
| 15 // This class bridges DevTools remote debugging server with the trace | 16 // This class bridges DevTools remote debugging server with the trace |
| 16 // infrastructure. | 17 // infrastructure. |
| 17 class DevToolsTracingHandler | 18 class DevToolsTracingHandler |
| 18 : public TraceSubscriber, | 19 : public TraceSubscriber, |
| 19 public DevToolsProtocol::Handler { | 20 public DevToolsProtocol::Handler { |
| 20 public: | 21 public: |
| 21 static const char kDomain[]; | 22 static const char kDomain[]; |
| 22 | 23 |
| 23 DevToolsTracingHandler(); | 24 DevToolsTracingHandler(); |
| 24 virtual ~DevToolsTracingHandler(); | 25 virtual ~DevToolsTracingHandler(); |
| 25 | 26 |
| 26 // TraceSubscriber: | 27 // TraceSubscriber: |
| 27 virtual void OnEndTracingComplete() OVERRIDE;; | 28 virtual void OnEndTracingComplete() OVERRIDE;; |
| 28 virtual void OnTraceDataCollected( | 29 virtual void OnTraceDataCollected( |
| 29 const scoped_refptr<base::RefCountedString>& trace_fragment) OVERRIDE; | 30 const scoped_refptr<base::RefCountedString>& trace_fragment) OVERRIDE; |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 scoped_ptr<DevToolsProtocol::Response> OnStart( | 33 scoped_ptr<DevToolsProtocol::Response> OnStart( |
| 33 DevToolsProtocol::Command* command); | 34 DevToolsProtocol::Command* command); |
| 34 scoped_ptr<DevToolsProtocol::Response> OnEnd( | 35 scoped_ptr<DevToolsProtocol::Response> OnEnd( |
| 35 DevToolsProtocol::Command* command); | 36 DevToolsProtocol::Command* command); |
| 36 | 37 |
| 38 base::debug::TraceLog::Options TraceOptionsFromString( |
| 39 const std::string& options); |
| 40 |
| 37 bool is_running_; | 41 bool is_running_; |
| 38 | 42 |
| 39 DISALLOW_COPY_AND_ASSIGN(DevToolsTracingHandler); | 43 DISALLOW_COPY_AND_ASSIGN(DevToolsTracingHandler); |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 } // namespace content | 46 } // namespace content |
| 43 | 47 |
| 44 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ | 48 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_TRACING_HANDLER_H_ |
| OLD | NEW |