| 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 COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_ | 5 #ifndef COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_ |
| 6 #define COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_ | 6 #define COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 11 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 12 #include "base/trace_event/memory_dump_request_args.h" | 15 #include "base/trace_event/memory_dump_request_args.h" |
| 13 #include "components/tracing/tracing_export.h" | 16 #include "components/tracing/tracing_export.h" |
| 14 #include "ipc/message_filter.h" | 17 #include "ipc/message_filter.h" |
| 15 | 18 |
| 16 namespace base { | 19 namespace base { |
| 17 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
| 18 } | 21 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 40 | 43 |
| 41 protected: | 44 protected: |
| 42 ~ChildTraceMessageFilter() override; | 45 ~ChildTraceMessageFilter() override; |
| 43 | 46 |
| 44 private: | 47 private: |
| 45 friend class ChildTraceMessageFilterTest; | 48 friend class ChildTraceMessageFilterTest; |
| 46 | 49 |
| 47 // Message handlers. | 50 // Message handlers. |
| 48 void OnBeginTracing(const std::string& trace_config_str, | 51 void OnBeginTracing(const std::string& trace_config_str, |
| 49 base::TimeTicks browser_time, | 52 base::TimeTicks browser_time, |
| 50 uint64 tracing_process_id); | 53 uint64_t tracing_process_id); |
| 51 void OnEndTracing(); | 54 void OnEndTracing(); |
| 52 void OnCancelTracing(); | 55 void OnCancelTracing(); |
| 53 void OnStartMonitoring(const std::string& trace_config_str, | 56 void OnStartMonitoring(const std::string& trace_config_str, |
| 54 base::TimeTicks browser_time); | 57 base::TimeTicks browser_time); |
| 55 void OnStopMonitoring(); | 58 void OnStopMonitoring(); |
| 56 void OnCaptureMonitoringSnapshot(); | 59 void OnCaptureMonitoringSnapshot(); |
| 57 void OnGetTraceLogStatus(); | 60 void OnGetTraceLogStatus(); |
| 58 void OnSetWatchEvent(const std::string& category_name, | 61 void OnSetWatchEvent(const std::string& category_name, |
| 59 const std::string& event_name); | 62 const std::string& event_name); |
| 60 void OnCancelWatchEvent(); | 63 void OnCancelWatchEvent(); |
| 61 void OnWatchEventMatched(); | 64 void OnWatchEventMatched(); |
| 62 void OnProcessMemoryDumpRequest( | 65 void OnProcessMemoryDumpRequest( |
| 63 const base::trace_event::MemoryDumpRequestArgs& args); | 66 const base::trace_event::MemoryDumpRequestArgs& args); |
| 64 void OnGlobalMemoryDumpResponse(uint64 dump_guid, bool success); | 67 void OnGlobalMemoryDumpResponse(uint64_t dump_guid, bool success); |
| 65 void OnSetUMACallback(const std::string& histogram_name, | 68 void OnSetUMACallback(const std::string& histogram_name, |
| 66 int histogram_lower_value, | 69 int histogram_lower_value, |
| 67 int histogram_upper_value, | 70 int histogram_upper_value, |
| 68 bool repeat); | 71 bool repeat); |
| 69 void OnClearUMACallback(const std::string& histogram_name); | 72 void OnClearUMACallback(const std::string& histogram_name); |
| 70 void OnHistogramChanged(const std::string& histogram_name, | 73 void OnHistogramChanged(const std::string& histogram_name, |
| 71 base::Histogram::Sample reference_lower_value, | 74 base::Histogram::Sample reference_lower_value, |
| 72 base::Histogram::Sample reference_upper_value, | 75 base::Histogram::Sample reference_upper_value, |
| 73 bool repeat, | 76 bool repeat, |
| 74 base::Histogram::Sample actual_value); | 77 base::Histogram::Sample actual_value); |
| 75 void SendTriggerMessage(const std::string& histogram_name); | 78 void SendTriggerMessage(const std::string& histogram_name); |
| 76 void SendAbortBackgroundTracingMessage(); | 79 void SendAbortBackgroundTracingMessage(); |
| 77 | 80 |
| 78 // Callback from trace subsystem. | 81 // Callback from trace subsystem. |
| 79 void OnTraceDataCollected( | 82 void OnTraceDataCollected( |
| 80 const scoped_refptr<base::RefCountedString>& events_str_ptr, | 83 const scoped_refptr<base::RefCountedString>& events_str_ptr, |
| 81 bool has_more_events); | 84 bool has_more_events); |
| 82 | 85 |
| 83 void OnMonitoringTraceDataCollected( | 86 void OnMonitoringTraceDataCollected( |
| 84 const scoped_refptr<base::RefCountedString>& events_str_ptr, | 87 const scoped_refptr<base::RefCountedString>& events_str_ptr, |
| 85 bool has_more_events); | 88 bool has_more_events); |
| 86 | 89 |
| 87 void OnProcessMemoryDumpDone(uint64 dump_guid, bool success); | 90 void OnProcessMemoryDumpDone(uint64_t dump_guid, bool success); |
| 88 | 91 |
| 89 void SetSenderForTesting(IPC::Sender* sender); | 92 void SetSenderForTesting(IPC::Sender* sender); |
| 90 | 93 |
| 91 IPC::Sender* sender_; | 94 IPC::Sender* sender_; |
| 92 base::SingleThreadTaskRunner* ipc_task_runner_; | 95 base::SingleThreadTaskRunner* ipc_task_runner_; |
| 93 | 96 |
| 94 // guid of the outstanding request (to the Browser's MemoryDumpManager), if | 97 // guid of the outstanding request (to the Browser's MemoryDumpManager), if |
| 95 // any. 0 if there is no request pending. | 98 // any. 0 if there is no request pending. |
| 96 uint64 pending_memory_dump_guid_; | 99 uint64_t pending_memory_dump_guid_; |
| 97 | 100 |
| 98 // callback of the outstanding memory dump request, if any. | 101 // callback of the outstanding memory dump request, if any. |
| 99 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_; | 102 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_; |
| 100 | 103 |
| 101 base::Time histogram_last_changed_; | 104 base::Time histogram_last_changed_; |
| 102 | 105 |
| 103 DISALLOW_COPY_AND_ASSIGN(ChildTraceMessageFilter); | 106 DISALLOW_COPY_AND_ASSIGN(ChildTraceMessageFilter); |
| 104 }; | 107 }; |
| 105 | 108 |
| 106 } // namespace tracing | 109 } // namespace tracing |
| 107 | 110 |
| 108 #endif // COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_ | 111 #endif // COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_ |
| OLD | NEW |