Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Side by Side Diff: ipc/mojo/ipc_channel_mojo.cc

Issue 942933005: ChannelMojo should use PID from the bootstrap Channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 320 }
321 321
322 return message_reader_->Send(make_scoped_ptr(message)); 322 return message_reader_->Send(make_scoped_ptr(message));
323 } 323 }
324 324
325 base::ProcessId ChannelMojo::GetPeerPID() const { 325 base::ProcessId ChannelMojo::GetPeerPID() const {
326 return peer_pid_; 326 return peer_pid_;
327 } 327 }
328 328
329 base::ProcessId ChannelMojo::GetSelfPID() const { 329 base::ProcessId ChannelMojo::GetSelfPID() const {
330 return base::GetCurrentProcId(); 330 return bootstrap_->GetSelfPID();
331 } 331 }
332 332
333 void ChannelMojo::OnClientLaunched(base::ProcessHandle handle) { 333 void ChannelMojo::OnClientLaunched(base::ProcessHandle handle) {
334 bootstrap_->OnClientLaunched(handle); 334 bootstrap_->OnClientLaunched(handle);
335 } 335 }
336 336
337 void ChannelMojo::OnMessageReceived(Message& message) { 337 void ChannelMojo::OnMessageReceived(Message& message) {
338 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", 338 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived",
339 "class", IPC_MESSAGE_ID_CLASS(message.type()), 339 "class", IPC_MESSAGE_ID_CLASS(message.type()),
340 "line", IPC_MESSAGE_ID_LINE(message.type())); 340 "line", IPC_MESSAGE_ID_LINE(message.type()));
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 if (!ok) { 422 if (!ok) {
423 DLOG(ERROR) << "Failed to add new Mojo handle."; 423 DLOG(ERROR) << "Failed to add new Mojo handle.";
424 return MOJO_RESULT_UNKNOWN; 424 return MOJO_RESULT_UNKNOWN;
425 } 425 }
426 } 426 }
427 427
428 return MOJO_RESULT_OK; 428 return MOJO_RESULT_OK;
429 } 429 }
430 430
431 } // namespace IPC 431 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698