#ifndef CONTENT_CHILD_THREAD_SAFE_SENDER_H_
#define CONTENT_CHILD_THREAD_SAFE_SENDER_H_
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
#include "ipc/ipc_sender.h"
namespace base {
class MessageLoopProxy;
}
namespace IPC {
class SyncMessageFilter;
}
namespace content {
class ChildThread;
class CONTENT_EXPORT ThreadSafeSender
: public IPC::Sender,
public base::RefCountedThreadSafe<ThreadSafeSender> {
public:
virtual bool Send(IPC::Message* msg) OVERRIDE;
private:
friend class ChildThread;
friend class IndexedDBDispatcherTest;
friend class WebIDBCursorImplTest;
friend class base::RefCountedThreadSafe<ThreadSafeSender>;
ThreadSafeSender(base::MessageLoopProxy* main_loop,
IPC::SyncMessageFilter* sync_filter);
virtual ~ThreadSafeSender();
scoped_refptr<base::MessageLoopProxy> main_loop_;
scoped_refptr<IPC::SyncMessageFilter> sync_filter_;
DISALLOW_COPY_AND_ASSIGN(ThreadSafeSender);
};
}
#endif