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> |
| 9 #include <stdint.h> |
| 10 |
8 #include <set> | 11 #include <set> |
9 #include <string> | 12 #include <string> |
10 | 13 |
| 14 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
12 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
13 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" | 17 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
14 #include "content/public/browser/tracing_controller.h" | 18 #include "content/public/browser/tracing_controller.h" |
15 | 19 |
16 namespace base { | 20 namespace base { |
17 class RefCountedString; | 21 class RefCountedString; |
18 class Timer; | 22 class Timer; |
19 } | 23 } |
20 | 24 |
(...skipping 30 matching lines...) Expand all Loading... |
51 Response RequestMemoryDump(DevToolsCommandId command_id); | 55 Response RequestMemoryDump(DevToolsCommandId command_id); |
52 | 56 |
53 bool did_initiate_recording() { return did_initiate_recording_; } | 57 bool did_initiate_recording() { return did_initiate_recording_; } |
54 | 58 |
55 private: | 59 private: |
56 void OnRecordingEnabled(DevToolsCommandId command_id); | 60 void OnRecordingEnabled(DevToolsCommandId command_id); |
57 void OnBufferUsage(float percent_full, size_t approximate_event_count); | 61 void OnBufferUsage(float percent_full, size_t approximate_event_count); |
58 void OnCategoriesReceived(DevToolsCommandId command_id, | 62 void OnCategoriesReceived(DevToolsCommandId command_id, |
59 const std::set<std::string>& category_set); | 63 const std::set<std::string>& category_set); |
60 void OnMemoryDumpFinished(DevToolsCommandId command_id, | 64 void OnMemoryDumpFinished(DevToolsCommandId command_id, |
61 uint64 dump_guid, | 65 uint64_t dump_guid, |
62 bool success); | 66 bool success); |
63 | 67 |
64 void SetupTimer(double usage_reporting_interval); | 68 void SetupTimer(double usage_reporting_interval); |
65 void StopTracing( | 69 void StopTracing( |
66 const scoped_refptr<TracingController::TraceDataSink>& trace_data_sink); | 70 const scoped_refptr<TracingController::TraceDataSink>& trace_data_sink); |
67 bool IsTracing() const; | 71 bool IsTracing() const; |
68 static bool IsStartupTracingActive(); | 72 static bool IsStartupTracingActive(); |
69 | 73 |
70 scoped_ptr<base::Timer> buffer_usage_poll_timer_; | 74 scoped_ptr<base::Timer> buffer_usage_poll_timer_; |
71 Target target_; | 75 Target target_; |
72 | 76 |
73 scoped_ptr<Client> client_; | 77 scoped_ptr<Client> client_; |
74 DevToolsIOContext* io_context_; | 78 DevToolsIOContext* io_context_; |
75 bool did_initiate_recording_; | 79 bool did_initiate_recording_; |
76 bool return_as_stream_; | 80 bool return_as_stream_; |
77 base::WeakPtrFactory<TracingHandler> weak_factory_; | 81 base::WeakPtrFactory<TracingHandler> weak_factory_; |
78 | 82 |
79 DISALLOW_COPY_AND_ASSIGN(TracingHandler); | 83 DISALLOW_COPY_AND_ASSIGN(TracingHandler); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace tracing | 86 } // namespace tracing |
83 } // namespace devtools | 87 } // namespace devtools |
84 } // namespace content | 88 } // namespace content |
85 | 89 |
86 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ | 90 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ |
OLD | NEW |