// Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
// An implementation of ChannelImpl for macOS and iOS that works via // mach ports. See the .cc file for an overview of the implementation. class ChannelMach final : public Channel, public MessageLoopForIO::MachPortWatcher { public:
ChannelMach(mozilla::UniqueMachReceiveRight receive,
mozilla::UniqueMachSendRight send, Mode mode,
base::ProcessId other_pid);
// Watch controller for |receive_port_|, calls OnMachMessageReceived() when // new messages are available.
MessageLoopForIO::MachPortWatchController watch_controller_;
// We always initialize |receive_port_| in the constructor, but |send_port_| // may not be initialized until we've received a message from our peer.
mozilla::UniqueMachReceiveRight receive_port_ MOZ_GUARDED_BY(chan_cap_);
mozilla::UniqueMachSendRight send_port_ MOZ_GUARDED_BY(chan_cap_);
// Buffers used for constructing mach IPC message payloads.
mozilla::UniquePtr<char[]> send_buffer_ MOZ_GUARDED_BY(SendMutex());
mozilla::UniquePtr<char[]> receive_buffer_ MOZ_GUARDED_BY(IOThread());
// Messages to be sent are queued here.
mozilla::Queue<mozilla::UniquePtr<Message>, 64> output_queue_
MOZ_GUARDED_BY(SendMutex());
// Indicates whether we've already serialized into the send buffer. bool send_buffer_has_message_ MOZ_GUARDED_BY(SendMutex()) = false;
// Will be set to `true` until `Connect()` has been called and communication // is ready. bool waiting_connect_ MOZ_GUARDED_BY(chan_cap_) = true;
// We keep track of the PID of the other side of this channel so that we can // record this when generating logs of IPC messages.
base::ProcessId other_pid_ MOZ_GUARDED_BY(chan_cap_) =
base::kInvalidProcessId;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.