Chromium Code Reviews| Index: ipc/mojo/ipc_mojo_bootstrap.cc |
| diff --git a/ipc/mojo/ipc_mojo_bootstrap.cc b/ipc/mojo/ipc_mojo_bootstrap.cc |
| index 4af4e503a9d27b04efc732b5c6faf935046693a5..7f19bb43051e741ed686ba7bae80c1ed7e5e6782 100644 |
| --- a/ipc/mojo/ipc_mojo_bootstrap.cc |
| +++ b/ipc/mojo/ipc_mojo_bootstrap.cc |
| @@ -100,9 +100,13 @@ void MojoServerBootstrap::OnChannelConnected(int32 peer_pid) { |
| } |
| bool MojoServerBootstrap::OnMessageReceived(const Message&) { |
| - DCHECK_EQ(state(), STATE_WAITING_ACK); |
| - set_state(STATE_READY); |
| + if (state() != STATE_WAITING_ACK) { |
|
viettrungluu
2014/11/13 20:27:57
You should probably document in the header what th
Hajime Morrita
2014/11/13 21:01:18
Done.
|
| + DLOG(WARNING) << "Got inconsistent message from client."; |
|
viettrungluu
2014/11/13 20:27:57
LOG(ERROR)?
This seems pretty serious.
Hajime Morrita
2014/11/13 21:01:18
Done.
|
| + return false; |
| + } |
| + set_state(STATE_READY); |
| + DCHECK(server_pipe_.is_valid()); |
|
viettrungluu
2014/11/13 20:27:57
CHECK?
Hajime Morrita
2014/11/13 21:01:18
Done.
|
| delegate()->OnPipeAvailable( |
| mojo::embedder::ScopedPlatformHandle(server_pipe_.release())); |
| @@ -129,6 +133,11 @@ MojoClientBootstrap::MojoClientBootstrap() { |
| } |
| bool MojoClientBootstrap::OnMessageReceived(const Message& message) { |
| + if (STATE_INITIALIZED != state()) { |
|
viettrungluu
2014/11/13 20:27:57
state() != STATE_INITIALIZED
Hajime Morrita
2014/11/13 21:01:18
Done.
|
| + DLOG(WARNING) << "Got inconsistent message from server."; |
|
viettrungluu
2014/11/13 20:27:57
LOG(ERROR)?
Hajime Morrita
2014/11/13 21:01:18
Done.
|
| + return false; |
| + } |
| + |
| PlatformFileForTransit pipe; |
| PickleIterator iter(message); |
| if (!ParamTraits<PlatformFileForTransit>::Read(&message, &iter, &pipe)) { |