| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ipc/mojo/ipc_channel_mojo.h" | 5 #include "ipc/mojo/ipc_channel_mojo.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "ipc/ipc_listener.h" | 10 #include "ipc/ipc_listener.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 return message_reader_->Send(make_scoped_ptr(message)); | 313 return message_reader_->Send(make_scoped_ptr(message)); |
| 314 } | 314 } |
| 315 | 315 |
| 316 base::ProcessId ChannelMojo::GetPeerPID() const { | 316 base::ProcessId ChannelMojo::GetPeerPID() const { |
| 317 return peer_pid_; | 317 return peer_pid_; |
| 318 } | 318 } |
| 319 | 319 |
| 320 base::ProcessId ChannelMojo::GetSelfPID() const { | 320 base::ProcessId ChannelMojo::GetSelfPID() const { |
| 321 return base::GetCurrentProcId(); | 321 return bootstrap_->GetSelfPID(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void ChannelMojo::OnClientLaunched(base::ProcessHandle handle) { | 324 void ChannelMojo::OnClientLaunched(base::ProcessHandle handle) { |
| 325 bootstrap_->OnClientLaunched(handle); | 325 bootstrap_->OnClientLaunched(handle); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void ChannelMojo::OnMessageReceived(Message& message) { | 328 void ChannelMojo::OnMessageReceived(Message& message) { |
| 329 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", | 329 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", |
| 330 "class", IPC_MESSAGE_ID_CLASS(message.type()), | 330 "class", IPC_MESSAGE_ID_CLASS(message.type()), |
| 331 "line", IPC_MESSAGE_ID_LINE(message.type())); | 331 "line", IPC_MESSAGE_ID_LINE(message.type())); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 if (!ok) { | 413 if (!ok) { |
| 414 DLOG(ERROR) << "Failed to add new Mojo handle."; | 414 DLOG(ERROR) << "Failed to add new Mojo handle."; |
| 415 return MOJO_RESULT_UNKNOWN; | 415 return MOJO_RESULT_UNKNOWN; |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 | 418 |
| 419 return MOJO_RESULT_OK; | 419 return MOJO_RESULT_OK; |
| 420 } | 420 } |
| 421 | 421 |
| 422 } // namespace IPC | 422 } // namespace IPC |
| OLD | NEW |