#ifndef COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_
#define COMPONENTS_TRACING_CHILD_TRACE_MESSAGE_FILTER_H_
#include "base/bind.h"
#include "base/memory/ref_counted_memory.h"
#include "ipc/ipc_channel_proxy.h"
namespace base {
class MessageLoopProxy;
}
namespace tracing {
class ChildTraceMessageFilter : public IPC::ChannelProxy::MessageFilter {
public:
explicit ChildTraceMessageFilter(base::MessageLoopProxy* ipc_message_loop);
virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
virtual void OnFilterRemoved() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
protected:
virtual ~ChildTraceMessageFilter();
private:
void OnBeginTracing(const std::string& category_filter_str,
base::TimeTicks browser_time,
int options);
void OnEndTracing();
void OnEnableMonitoring(const std::string& category_filter_str,
base::TimeTicks browser_time,
int options);
void OnDisableMonitoring();
void OnCaptureMonitoringSnapshot();
void OnGetTraceBufferPercentFull();
void OnSetWatchEvent(const std::string& category_name,
const std::string& event_name);
void OnCancelWatchEvent();
void OnWatchEventMatched();
void OnTraceDataCollected(
const scoped_refptr<base::RefCountedString>& events_str_ptr,
bool has_more_events);
void OnMonitoringTraceDataCollected(
const scoped_refptr<base::RefCountedString>& events_str_ptr,
bool has_more_events);
IPC::Channel* channel_;
base::MessageLoopProxy* ipc_message_loop_;
DISALLOW_COPY_AND_ASSIGN(ChildTraceMessageFilter);
};
}
#endif