| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROTOCOL_TRACING_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
| 18 #include "content/browser/devtools/protocol/devtools_domain_handler.h" | 18 #include "content/browser/devtools/protocol/devtools_domain_handler.h" |
| 19 #include "content/browser/devtools/protocol/tracing.h" | 19 #include "content/browser/devtools/protocol/tracing.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "content/public/browser/tracing_controller.h" | 21 #include "content/public/browser/tracing_controller.h" |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class Timer; | 24 class Timer; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 class DevToolsAgentHostImpl; |
| 29 class DevToolsIOContext; | 30 class DevToolsIOContext; |
| 30 class DevToolsSession; | |
| 31 | 31 |
| 32 namespace protocol { | 32 namespace protocol { |
| 33 | 33 |
| 34 class TracingHandler : public DevToolsDomainHandler, | 34 class TracingHandler : public DevToolsDomainHandler, |
| 35 public Tracing::Backend { | 35 public Tracing::Backend { |
| 36 public: | 36 public: |
| 37 enum Target { Browser, Renderer }; | 37 enum Target { Browser, Renderer }; |
| 38 TracingHandler(Target target, | 38 TracingHandler(Target target, |
| 39 int frame_tree_node_id, | 39 int frame_tree_node_id, |
| 40 DevToolsIOContext* io_context); | 40 DevToolsIOContext* io_context); |
| 41 ~TracingHandler() override; | 41 ~TracingHandler() override; |
| 42 | 42 |
| 43 static TracingHandler* FromSession(DevToolsSession* session); | 43 static std::vector<TracingHandler*> ForAgentHost(DevToolsAgentHostImpl* host); |
| 44 | 44 |
| 45 void Wire(UberDispatcher* dispatcher) override; | 45 void Wire(UberDispatcher* dispatcher) override; |
| 46 Response Disable() override; | 46 Response Disable() override; |
| 47 | 47 |
| 48 void OnTraceDataCollected(const std::string& trace_fragment); | 48 void OnTraceDataCollected(const std::string& trace_fragment); |
| 49 void OnTraceComplete(); | 49 void OnTraceComplete(); |
| 50 void OnTraceToStreamComplete(const std::string& stream_handle); | 50 void OnTraceToStreamComplete(const std::string& stream_handle); |
| 51 | 51 |
| 52 // Protocol methods. | 52 // Protocol methods. |
| 53 void Start(Maybe<std::string> categories, | 53 void Start(Maybe<std::string> categories, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 FRIEND_TEST_ALL_PREFIXES(TracingHandlerTest, | 95 FRIEND_TEST_ALL_PREFIXES(TracingHandlerTest, |
| 96 GetTraceConfigFromDevToolsConfig); | 96 GetTraceConfigFromDevToolsConfig); |
| 97 DISALLOW_COPY_AND_ASSIGN(TracingHandler); | 97 DISALLOW_COPY_AND_ASSIGN(TracingHandler); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace protocol | 100 } // namespace protocol |
| 101 } // namespace content | 101 } // namespace content |
| 102 | 102 |
| 103 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ | 103 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ |
| OLD | NEW |