| 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/tracing.h" | 19 #include "content/browser/devtools/protocol/tracing.h" |
| 19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/tracing_controller.h" | 21 #include "content/public/browser/tracing_controller.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class Timer; | 24 class Timer; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 | 28 |
| 28 class DevToolsIOContext; | 29 class DevToolsIOContext; |
| 30 class DevToolsSession; |
| 29 | 31 |
| 30 namespace protocol { | 32 namespace protocol { |
| 31 | 33 |
| 32 class TracingHandler : public Tracing::Backend { | 34 class TracingHandler : public DevToolsDomainHandler, |
| 35 public Tracing::Backend { |
| 33 public: | 36 public: |
| 34 enum Target { Browser, Renderer }; | 37 enum Target { Browser, Renderer }; |
| 35 TracingHandler(Target target, | 38 TracingHandler(Target target, |
| 36 int frame_tree_node_id, | 39 int frame_tree_node_id, |
| 37 DevToolsIOContext* io_context); | 40 DevToolsIOContext* io_context); |
| 38 ~TracingHandler() override; | 41 ~TracingHandler() override; |
| 39 | 42 |
| 40 void Wire(UberDispatcher*); | 43 static TracingHandler* FromSession(DevToolsSession* session); |
| 44 |
| 45 void Wire(UberDispatcher* dispatcher) override; |
| 41 Response Disable() override; | 46 Response Disable() override; |
| 42 | 47 |
| 43 void OnTraceDataCollected(const std::string& trace_fragment); | 48 void OnTraceDataCollected(const std::string& trace_fragment); |
| 44 void OnTraceComplete(); | 49 void OnTraceComplete(); |
| 45 void OnTraceToStreamComplete(const std::string& stream_handle); | 50 void OnTraceToStreamComplete(const std::string& stream_handle); |
| 46 | 51 |
| 47 // Protocol methods. | 52 // Protocol methods. |
| 48 void Start(Maybe<std::string> categories, | 53 void Start(Maybe<std::string> categories, |
| 49 Maybe<std::string> options, | 54 Maybe<std::string> options, |
| 50 Maybe<double> buffer_usage_reporting_interval, | 55 Maybe<double> buffer_usage_reporting_interval, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 94 |
| 90 FRIEND_TEST_ALL_PREFIXES(TracingHandlerTest, | 95 FRIEND_TEST_ALL_PREFIXES(TracingHandlerTest, |
| 91 GetTraceConfigFromDevToolsConfig); | 96 GetTraceConfigFromDevToolsConfig); |
| 92 DISALLOW_COPY_AND_ASSIGN(TracingHandler); | 97 DISALLOW_COPY_AND_ASSIGN(TracingHandler); |
| 93 }; | 98 }; |
| 94 | 99 |
| 95 } // namespace protocol | 100 } // namespace protocol |
| 96 } // namespace content | 101 } // namespace content |
| 97 | 102 |
| 98 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ | 103 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ |
| OLD | NEW |