#ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_
#define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_
#include <set>
#include <string>
#include "ipc/ipc_channel_proxy.h"
struct DevToolsMessageData;
namespace base {
class MessageLoop;
}
namespace content {
class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter {
public:
DevToolsAgentFilter();
static void SendRpcMessage(const DevToolsMessageData& data);
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
void AddSharedWorkerRouteOnMainThread(int32 routing_id);
void RemoveSharedWorkerRouteOnMainThread(int32 routing_id);
protected:
virtual ~DevToolsAgentFilter();
private:
void OnDispatchOnInspectorBackend(const std::string& message);
void AddSharedWorkerRoute(int32 routing_id);
void RemoveSharedWorkerRoute(int32 routing_id);
bool message_handled_;
base::MessageLoop* render_thread_loop_;
scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
int current_routing_id_;
std::set<int32> shared_worker_routes_;
DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter);
};
}
#endif