Bug 1277705 - Remove Message::Sender interface (r=dvander)

This commit is contained in:
Bill McCloskey 2016-06-01 16:37:42 -07:00
parent ae244aacff
commit 4045bfae0a
6 changed files with 2 additions and 39 deletions

View File

@ -67,14 +67,6 @@ void ChildProcessHost::SetHandle(base::ProcessHandle process) {
#endif
}
bool ChildProcessHost::Send(IPC::Message* msg) {
if (!channel_.get()) {
delete msg;
return false;
}
return channel_->Send(msg);
}
ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host)
: host_(host) {
}

View File

@ -25,15 +25,11 @@ class FileDescriptor;
// Plugins/workers and other child processes that live on the IO thread should
// derive from this class.
class ChildProcessHost :
public IPC::Message::Sender,
public ChildProcessInfo,
public IPC::Channel::Listener {
public:
virtual ~ChildProcessHost();
// ResourceDispatcherHost::Receiver implementation:
virtual bool Send(IPC::Message* msg);
protected:
explicit ChildProcessHost(ProcessType type);

View File

@ -55,15 +55,6 @@ void ChildThread::MarkThread() {
}
#endif
bool ChildThread::Send(IPC::Message* msg) {
if (!channel_.get()) {
delete msg;
return false;
}
return channel_->Send(msg);
}
void ChildThread::OnMessageReceived(IPC::Message&& msg) {
if (msg.routing_id() == MSG_ROUTING_CONTROL) {
OnControlMessageReceived(msg);

View File

@ -15,16 +15,12 @@ class ResourceDispatcher;
// Child processes's background thread should derive from this class.
class ChildThread : public IPC::Channel::Listener,
public IPC::Message::Sender,
public base::Thread {
public:
// Creates the thread.
explicit ChildThread(Thread::Options options);
virtual ~ChildThread();
// IPC::Message::Sender implementation:
virtual bool Send(IPC::Message* msg);
// See documentation on MessageRouter for AddRoute and RemoveRoute
void AddRoute(int32_t routing_id, IPC::Channel::Listener* listener);
void RemoveRoute(int32_t routing_id);

View File

@ -16,7 +16,7 @@ namespace IPC {
//------------------------------------------------------------------------------
class Channel : public Message::Sender {
class Channel {
// Security tests need access to the pipe handle.
friend class ChannelTest;
@ -105,7 +105,7 @@ class Channel : public Message::Sender {
//
// If you Send() a message on a Close()'d channel, we delete the message
// immediately.
virtual bool Send(Message* message) override;
bool Send(Message* message);
// Unsound_IsClosed() and Unsound_NumQueuedMessages() are safe to call from
// any thread, but the value returned may be out of date, because we don't

View File

@ -38,18 +38,6 @@ class Message : public Pickle {
public:
typedef uint32_t msgid_t;
// Implemented by objects that can send IPC messages across a channel.
class Sender {
public:
virtual ~Sender() {}
// Sends the given IPC message. The implementor takes ownership of the
// given Message regardless of whether or not this method succeeds. This
// is done to make this method easier to use. Returns true on success and
// false otherwise.
virtual bool Send(Message* msg) = 0;
};
enum PriorityValue {
PRIORITY_NORMAL = 1,
PRIORITY_HIGH = 2,