Skip to content

Commit

Permalink
Remove Message::Sender and Channel::Listener typedefs.
Browse files Browse the repository at this point in the history
This patch fixes the remaining users to use the new names for these classes.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10698057

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145005 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@chromium.org committed Jun 29, 2012
1 parent 5c23e95 commit b7f59e8
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ChromeResourceDispatcherHostDelegate
net::URLRequest* request,
content::ResourceContext* resource_context,
content::ResourceResponse* response,
IPC::Message::Sender* sender) OVERRIDE;
IPC::Sender* sender) OVERRIDE;
virtual void OnRequestRedirected(
net::URLRequest* request,
content::ResourceContext* resource_context,
Expand Down
9 changes: 2 additions & 7 deletions ipc/ipc_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#include "ipc/ipc_message.h"
#include "ipc/ipc_sender.h"

// TODO(brettw) remove this when the "typedef Sender" is removed below.
// TODO(brettw) remove this and update files that depend on this being included
// from here.
#include "ipc/ipc_listener.h"

namespace IPC {
Expand Down Expand Up @@ -47,12 +48,6 @@ class IPC_EXPORT Channel : public Sender {
friend class ChannelTest;

public:
// IPC::Listener used to be IPC::Channel::Listener which prevented forward
// declarations. To keep existing code compiling, we provide this
// backwards-compatible definition. New code should use IPC::Listener.
// TODO(brettw) convert users of this and delete.
typedef IPC::Listener Listener;

// Flags to test modes
enum ModeFlags {
MODE_NO_FLAG = 0x0,
Expand Down
9 changes: 2 additions & 7 deletions ipc/ipc_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#include "base/pickle.h"
#include "ipc/ipc_export.h"

// TODO(brettw) remove this when the "typedef Sender" is removed below.
// TODO(brettw) remove this and update files that depend on this being included
// from here.
#include "ipc/ipc_sender.h"

// Ipc logging adds a dependency from the 'chrome' target on all ipc message
Expand Down Expand Up @@ -42,12 +43,6 @@ struct LogData;

class IPC_EXPORT Message : public Pickle {
public:
// IPC::Sender used to be IPC::Message::Sender which prevented forward
// declarations. To keep existing code compiling, we provide this backwards-
// compatible definition. New code should use IPC::Sender.
// TODO(brettw) convert users of this and delete.
typedef IPC::Sender Sender;

enum PriorityValue {
PRIORITY_LOW = 1,
PRIORITY_NORMAL,
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipc_send_fds_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void VerifyAndCloseDescriptor(int fd, ino_t inode_num) {
ASSERT_EQ(inode_num, st.st_ino);
}

class MyChannelDescriptorListener : public IPC::Channel::Listener {
class MyChannelDescriptorListener : public IPC::Listener {
public:
MyChannelDescriptorListener(ino_t expected_inode_num)
: expected_inode_num_(expected_inode_num),
Expand Down
6 changes: 3 additions & 3 deletions ipc/ipc_sync_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ base::LazyInstance<base::ThreadLocalPointer<SyncChannel::ReceivedSyncMsgQueue> >
LAZY_INSTANCE_INITIALIZER;

SyncChannel::SyncContext::SyncContext(
Channel::Listener* listener,
Listener* listener,
base::MessageLoopProxy* ipc_thread,
WaitableEvent* shutdown_event)
: ChannelProxy::Context(listener, ipc_thread),
Expand Down Expand Up @@ -387,7 +387,7 @@ void SyncChannel::SyncContext::OnWaitableEventSignaled(WaitableEvent* event) {
SyncChannel::SyncChannel(
const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
Channel::Listener* listener,
Listener* listener,
base::MessageLoopProxy* ipc_message_loop,
bool create_pipe_now,
WaitableEvent* shutdown_event)
Expand All @@ -398,7 +398,7 @@ SyncChannel::SyncChannel(
}

SyncChannel::SyncChannel(
Channel::Listener* listener,
Listener* listener,
base::MessageLoopProxy* ipc_message_loop,
WaitableEvent* shutdown_event)
: ChannelProxy(new SyncContext(listener, ipc_message_loop, shutdown_event)),
Expand Down
6 changes: 3 additions & 3 deletions ipc/ipc_sync_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ class IPC_EXPORT SyncChannel : public ChannelProxy,
// the channel will be initialized synchronously.
SyncChannel(const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
Channel::Listener* listener,
Listener* listener,
base::MessageLoopProxy* ipc_message_loop,
bool create_pipe_now,
base::WaitableEvent* shutdown_event);

// Creates an uninitialized sync channel. Call ChannelProxy::Init to
// initialize the channel. This two-step setup allows message filters to be
// added before any messages are sent or received.
SyncChannel(Channel::Listener* listener,
SyncChannel(Listener* listener,
base::MessageLoopProxy* ipc_message_loop,
base::WaitableEvent* shutdown_event);

Expand Down Expand Up @@ -119,7 +119,7 @@ class IPC_EXPORT SyncChannel : public ChannelProxy,
class SyncContext : public Context,
public base::WaitableEventWatcher::Delegate {
public:
SyncContext(Channel::Listener* listener,
SyncContext(Listener* listener,
base::MessageLoopProxy* ipc_thread,
base::WaitableEvent* shutdown_event);

Expand Down
8 changes: 4 additions & 4 deletions ipc/ipc_test_sink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ bool TestSink::Send(Message* message) {
}

bool TestSink::OnMessageReceived(const Message& msg) {
ObserverListBase<Channel::Listener>::Iterator it(filter_list_);
Channel::Listener* observer;
ObserverListBase<Listener>::Iterator it(filter_list_);
Listener* observer;
while ((observer = it.GetNext()) != NULL) {
if (observer->OnMessageReceived(msg))
return true;
Expand Down Expand Up @@ -65,11 +65,11 @@ const Message* TestSink::GetUniqueMessageMatching(uint32 id) const {
return &messages_[found_index];
}

void TestSink::AddFilter(Channel::Listener* filter) {
void TestSink::AddFilter(Listener* filter) {
filter_list_.AddObserver(filter);
}

void TestSink::RemoveFilter(Channel::Listener* filter) {
void TestSink::RemoveFilter(Listener* filter) {
filter_list_.RemoveObserver(filter);
}

Expand Down
8 changes: 4 additions & 4 deletions ipc/ipc_test_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Message;
// This can be useful if you need to wait for a particular message that will
// be posted asynchronously. Example usage:
//
// class MyListener : public IPC::Channel::Listener {
// class MyListener : public IPC::Listener {
// public:
// virtual bool OnMessageReceived(const IPC::Message& msg) {
// <do something with the message>
Expand Down Expand Up @@ -112,15 +112,15 @@ class TestSink : public Channel {
// the filters, in the order they were added. If a filter returns true
// from OnMessageReceived, subsequent filters will not receive the message
// and the TestSink will not store it.
void AddFilter(Channel::Listener* filter);
void AddFilter(Listener* filter);

// Removes the given filter from the TestSink.
void RemoveFilter(Channel::Listener* filter);
void RemoveFilter(Listener* filter);

private:
// The actual list of received messages.
std::vector<Message> messages_;
ObserverList<Channel::Listener> filter_list_;
ObserverList<Listener> filter_list_;

DISALLOW_COPY_AND_ASSIGN(TestSink);
};
Expand Down
8 changes: 4 additions & 4 deletions ipc/ipc_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static void Send(IPC::Sender* sender, const char* text) {
sender->Send(message);
}

class MyChannelListener : public IPC::Channel::Listener {
class MyChannelListener : public IPC::Listener {
public:
virtual bool OnMessageReceived(const IPC::Message& message) {
IPC::MessageIterator iter(message);
Expand Down Expand Up @@ -329,7 +329,7 @@ TEST_F(IPCChannelTest, ChannelProxyTest) {
thread.Stop();
}

class ChannelListenerWithOnConnectedSend : public IPC::Channel::Listener {
class ChannelListenerWithOnConnectedSend : public IPC::Listener {
public:
virtual void OnChannelConnected(int32 peer_pid) OVERRIDE {
SendNextMessage();
Expand Down Expand Up @@ -439,7 +439,7 @@ MULTIPROCESS_IPC_TEST_MAIN(RunTestClient) {
// This channel listener just replies to all messages with the exact same
// message. It assumes each message has one string parameter. When the string
// "quit" is sent, it will exit.
class ChannelReflectorListener : public IPC::Channel::Listener {
class ChannelReflectorListener : public IPC::Listener {
public:
explicit ChannelReflectorListener(IPC::Channel *channel) :
channel_(channel),
Expand Down Expand Up @@ -481,7 +481,7 @@ class ChannelReflectorListener : public IPC::Channel::Listener {
int latency_messages_;
};

class ChannelPerfListener : public IPC::Channel::Listener {
class ChannelPerfListener : public IPC::Listener {
public:
ChannelPerfListener(IPC::Channel* channel, int msg_count, int msg_size) :
count_down_(msg_count),
Expand Down
4 changes: 2 additions & 2 deletions ipc/sync_socket_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const size_t kHelloStringLength = arraysize(kHelloString);

// The SyncSocket server listener class processes two sorts of
// messages from the client.
class SyncSocketServerListener : public IPC::Channel::Listener {
class SyncSocketServerListener : public IPC::Listener {
public:
SyncSocketServerListener() : chan_(NULL) {
}
Expand Down Expand Up @@ -121,7 +121,7 @@ MULTIPROCESS_IPC_TEST_MAIN(RunSyncSocketServer) {

// The SyncSocket client listener only processes one sort of message,
// a response from the server.
class SyncSocketClientListener : public IPC::Channel::Listener {
class SyncSocketClientListener : public IPC::Listener {
public:
SyncSocketClientListener() {
}
Expand Down
4 changes: 2 additions & 2 deletions remoting/host/session_event_executor_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ChannelProxy;
namespace remoting {

class SessionEventExecutorWin : public EventExecutor,
public IPC::Channel::Listener {
public IPC::Listener {
public:
SessionEventExecutorWin(MessageLoop* message_loop,
base::MessageLoopProxy* io_message_loop,
Expand All @@ -47,7 +47,7 @@ class SessionEventExecutorWin : public EventExecutor,
virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;

// IPC::Channel::Listener implementation.
// IPC::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;

private:
Expand Down
4 changes: 2 additions & 2 deletions remoting/host/wts_session_process_launcher_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class WtsConsoleMonitor;

class WtsSessionProcessLauncher
: public base::win::ObjectWatcher::Delegate,
public IPC::Channel::Listener,
public IPC::Listener,
public WtsConsoleObserver {
public:
// Constructs a WtsSessionProcessLauncher object. |host_binary| is the name of
Expand All @@ -58,7 +58,7 @@ class WtsSessionProcessLauncher
// base::win::ObjectWatcher::Delegate implementation.
virtual void OnObjectSignaled(HANDLE object) OVERRIDE;

// IPC::Channel::Listener implementation.
// IPC::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;

// WtsConsoleObserver implementation.
Expand Down

0 comments on commit b7f59e8

Please sign in to comment.