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

Side by Side Diff: ipc/ipc_channel_mojo.cc

Issue 2455823002: Support generic synchronization against an IPC::Channel (Closed)
Patch Set: . Created 4 years, 1 month 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 | « ipc/ipc_channel_mojo.h ('k') | ipc/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/ipc_channel_mojo.h" 5 #include "ipc/ipc_channel_mojo.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 #if defined(OS_NACL) 384 #if defined(OS_NACL)
385 return -1; 385 return -1;
386 #else 386 #else
387 return base::GetCurrentProcId(); 387 return base::GetCurrentProcId();
388 #endif // defined(OS_NACL) 388 #endif // defined(OS_NACL)
389 } 389 }
390 390
391 Channel::AssociatedInterfaceSupport* 391 Channel::AssociatedInterfaceSupport*
392 ChannelMojo::GetAssociatedInterfaceSupport() { return this; } 392 ChannelMojo::GetAssociatedInterfaceSupport() { return this; }
393 393
394 void ChannelMojo::SendEventToSignal(mojo::common::mojom::EventPtr event) {
395 if (message_reader_)
396 message_reader_->SendEventToSignal(std::move(event));
397 }
398
394 void ChannelMojo::OnPeerPidReceived() { 399 void ChannelMojo::OnPeerPidReceived() {
395 listener_->OnChannelConnected(static_cast<int32_t>(GetPeerPID())); 400 listener_->OnChannelConnected(static_cast<int32_t>(GetPeerPID()));
396 } 401 }
397 402
398 void ChannelMojo::OnMessageReceived(const Message& message) { 403 void ChannelMojo::OnMessageReceived(const Message& message) {
399 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived", 404 TRACE_EVENT2("ipc,toplevel", "ChannelMojo::OnMessageReceived",
400 "class", IPC_MESSAGE_ID_CLASS(message.type()), 405 "class", IPC_MESSAGE_ID_CLASS(message.type()),
401 "line", IPC_MESSAGE_ID_LINE(message.type())); 406 "line", IPC_MESSAGE_ID_LINE(message.type()));
402 if (AttachmentBroker* broker = AttachmentBroker::GetGlobal()) { 407 if (AttachmentBroker* broker = AttachmentBroker::GetGlobal()) {
403 if (broker->OnMessageReceived(message)) 408 if (broker->OnMessageReceived(message))
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 } 498 }
494 499
495 void ChannelMojo::GetGenericRemoteAssociatedInterface( 500 void ChannelMojo::GetGenericRemoteAssociatedInterface(
496 const std::string& name, 501 const std::string& name,
497 mojo::ScopedInterfaceEndpointHandle handle) { 502 mojo::ScopedInterfaceEndpointHandle handle) {
498 if (message_reader_) 503 if (message_reader_)
499 message_reader_->GetRemoteInterface(name, std::move(handle)); 504 message_reader_->GetRemoteInterface(name, std::move(handle));
500 } 505 }
501 506
502 } // namespace IPC 507 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_mojo.h ('k') | ipc/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698