| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_TRACING_TRACING_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_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 #include <vector> | 13 #include <vector> |
| 11 | 14 |
| 12 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 16 #include "base/macros.h" |
| 13 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 14 #include "base/trace_event/memory_dump_manager.h" | 18 #include "base/trace_event/memory_dump_manager.h" |
| 15 #include "base/trace_event/tracing_agent.h" | 19 #include "base/trace_event/tracing_agent.h" |
| 16 #include "content/public/browser/tracing_controller.h" | 20 #include "content/public/browser/tracing_controller.h" |
| 17 | 21 |
| 18 namespace base { | 22 namespace base { |
| 19 class RefCountedString; | 23 class RefCountedString; |
| 20 class RefCountedMemory; | 24 class RefCountedMemory; |
| 21 } | 25 } |
| 22 | 26 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void StopAgentTracing(const StopAgentTracingCallback& callback) override; | 70 void StopAgentTracing(const StopAgentTracingCallback& callback) override; |
| 67 bool SupportsExplicitClockSync() override; | 71 bool SupportsExplicitClockSync() override; |
| 68 void RecordClockSyncMarker( | 72 void RecordClockSyncMarker( |
| 69 int sync_id, | 73 int sync_id, |
| 70 const RecordClockSyncMarkerCallback& callback) override; | 74 const RecordClockSyncMarkerCallback& callback) override; |
| 71 | 75 |
| 72 // base::trace_event::MemoryDumpManagerDelegate implementation. | 76 // base::trace_event::MemoryDumpManagerDelegate implementation. |
| 73 void RequestGlobalMemoryDump( | 77 void RequestGlobalMemoryDump( |
| 74 const base::trace_event::MemoryDumpRequestArgs& args, | 78 const base::trace_event::MemoryDumpRequestArgs& args, |
| 75 const base::trace_event::MemoryDumpCallback& callback) override; | 79 const base::trace_event::MemoryDumpCallback& callback) override; |
| 76 uint64 GetTracingProcessId() const override; | 80 uint64_t GetTracingProcessId() const override; |
| 77 | 81 |
| 78 class TraceMessageFilterObserver { | 82 class TraceMessageFilterObserver { |
| 79 public: | 83 public: |
| 80 virtual void OnTraceMessageFilterAdded(TraceMessageFilter* filter) = 0; | 84 virtual void OnTraceMessageFilterAdded(TraceMessageFilter* filter) = 0; |
| 81 virtual void OnTraceMessageFilterRemoved(TraceMessageFilter* filter) = 0; | 85 virtual void OnTraceMessageFilterRemoved(TraceMessageFilter* filter) = 0; |
| 82 }; | 86 }; |
| 83 void AddTraceMessageFilterObserver(TraceMessageFilterObserver* observer); | 87 void AddTraceMessageFilterObserver(TraceMessageFilterObserver* observer); |
| 84 void RemoveTraceMessageFilterObserver(TraceMessageFilterObserver* observer); | 88 void RemoveTraceMessageFilterObserver(TraceMessageFilterObserver* observer); |
| 85 | 89 |
| 86 private: | 90 private: |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const std::string& agent_name, | 144 const std::string& agent_name, |
| 141 const std::string& events_label, | 145 const std::string& events_label, |
| 142 const scoped_refptr<base::RefCountedString>& events_str_ptr); | 146 const scoped_refptr<base::RefCountedString>& events_str_ptr); |
| 143 | 147 |
| 144 void OnCaptureMonitoringSnapshotAcked( | 148 void OnCaptureMonitoringSnapshotAcked( |
| 145 TraceMessageFilter* trace_message_filter); | 149 TraceMessageFilter* trace_message_filter); |
| 146 | 150 |
| 147 void OnTraceLogStatusReply(TraceMessageFilter* trace_message_filter, | 151 void OnTraceLogStatusReply(TraceMessageFilter* trace_message_filter, |
| 148 const base::trace_event::TraceLogStatus& status); | 152 const base::trace_event::TraceLogStatus& status); |
| 149 void OnProcessMemoryDumpResponse(TraceMessageFilter* trace_message_filter, | 153 void OnProcessMemoryDumpResponse(TraceMessageFilter* trace_message_filter, |
| 150 uint64 dump_guid, | 154 uint64_t dump_guid, |
| 151 bool success); | 155 bool success); |
| 152 | 156 |
| 153 // Callback of MemoryDumpManager::CreateProcessDump(). | 157 // Callback of MemoryDumpManager::CreateProcessDump(). |
| 154 void OnBrowserProcessMemoryDumpDone(uint64 dump_guid, bool success); | 158 void OnBrowserProcessMemoryDumpDone(uint64_t dump_guid, bool success); |
| 155 | 159 |
| 156 void FinalizeGlobalMemoryDumpIfAllProcessesReplied(); | 160 void FinalizeGlobalMemoryDumpIfAllProcessesReplied(); |
| 157 | 161 |
| 158 void OnWatchEventMatched(); | 162 void OnWatchEventMatched(); |
| 159 | 163 |
| 160 void SetEnabledOnFileThread( | 164 void SetEnabledOnFileThread( |
| 161 const base::trace_event::TraceConfig& trace_config, | 165 const base::trace_event::TraceConfig& trace_config, |
| 162 int mode, | 166 int mode, |
| 163 const base::Closure& callback); | 167 const base::Closure& callback); |
| 164 void SetDisabledOnFileThread(const base::Closure& callback); | 168 void SetDisabledOnFileThread(const base::Closure& callback); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // Pending acks for GetTraceLogStatus. | 200 // Pending acks for GetTraceLogStatus. |
| 197 int pending_trace_log_status_ack_count_; | 201 int pending_trace_log_status_ack_count_; |
| 198 TraceMessageFilterSet pending_trace_log_status_filters_; | 202 TraceMessageFilterSet pending_trace_log_status_filters_; |
| 199 float maximum_trace_buffer_usage_; | 203 float maximum_trace_buffer_usage_; |
| 200 size_t approximate_event_count_; | 204 size_t approximate_event_count_; |
| 201 | 205 |
| 202 // Pending acks for memory RequestGlobalDumpPoint. | 206 // Pending acks for memory RequestGlobalDumpPoint. |
| 203 int pending_memory_dump_ack_count_; | 207 int pending_memory_dump_ack_count_; |
| 204 int failed_memory_dump_count_; | 208 int failed_memory_dump_count_; |
| 205 TraceMessageFilterSet pending_memory_dump_filters_; | 209 TraceMessageFilterSet pending_memory_dump_filters_; |
| 206 uint64 pending_memory_dump_guid_; | 210 uint64_t pending_memory_dump_guid_; |
| 207 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_; | 211 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_; |
| 208 | 212 |
| 209 StartTracingDoneCallback start_tracing_done_callback_; | 213 StartTracingDoneCallback start_tracing_done_callback_; |
| 210 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; | 214 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; |
| 211 int clock_sync_id_; | 215 int clock_sync_id_; |
| 212 int pending_clock_sync_ack_count_; | 216 int pending_clock_sync_ack_count_; |
| 213 base::OneShotTimer clock_sync_timer_; | 217 base::OneShotTimer clock_sync_timer_; |
| 214 | 218 |
| 215 bool is_tracing_; | 219 bool is_tracing_; |
| 216 bool is_monitoring_; | 220 bool is_monitoring_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 229 std::set<TracingUI*> tracing_uis_; | 233 std::set<TracingUI*> tracing_uis_; |
| 230 scoped_refptr<TraceDataSink> trace_data_sink_; | 234 scoped_refptr<TraceDataSink> trace_data_sink_; |
| 231 scoped_refptr<TraceDataSink> monitoring_data_sink_; | 235 scoped_refptr<TraceDataSink> monitoring_data_sink_; |
| 232 | 236 |
| 233 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); | 237 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); |
| 234 }; | 238 }; |
| 235 | 239 |
| 236 } // namespace content | 240 } // namespace content |
| 237 | 241 |
| 238 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 242 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
| OLD | NEW |