mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1318335 - Use auto type specifier where aplicable for variable declarations to improve code readability and maintainability in ipc/. r=billm
MozReview-Commit-ID: K4NAI8HjUd2 --HG-- extra : rebase_source : 9abcb40b9b3ffea07519cc03e892e15b907e6e25
This commit is contained in:
parent
84bb36a693
commit
bfc72d696d
@ -968,12 +968,12 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
|
||||
if (child_message.GetTranslatedPort(2) == MACH_PORT_NULL) {
|
||||
CHROMIUM_LOG(ERROR) << "parent GetTranslatedPort(2) failed.";
|
||||
}
|
||||
MachPortSender* parent_recv_port_memory_ack = new MachPortSender(child_message.GetTranslatedPort(2));
|
||||
auto* parent_recv_port_memory_ack = new MachPortSender(child_message.GetTranslatedPort(2));
|
||||
|
||||
if (child_message.GetTranslatedPort(3) == MACH_PORT_NULL) {
|
||||
CHROMIUM_LOG(ERROR) << "parent GetTranslatedPort(3) failed.";
|
||||
}
|
||||
MachPortSender* parent_send_port_memory = new MachPortSender(child_message.GetTranslatedPort(3));
|
||||
auto* parent_send_port_memory = new MachPortSender(child_message.GetTranslatedPort(3));
|
||||
|
||||
MachSendMessage parent_message(/* id= */0);
|
||||
if (!parent_message.AddDescriptor(MachMsgPortDescriptor(bootstrap_port))) {
|
||||
@ -981,13 +981,13 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
|
||||
return false;
|
||||
}
|
||||
|
||||
ReceivePort* parent_recv_port_memory = new ReceivePort();
|
||||
auto* parent_recv_port_memory = new ReceivePort();
|
||||
if (!parent_message.AddDescriptor(MachMsgPortDescriptor(parent_recv_port_memory->GetPort()))) {
|
||||
CHROMIUM_LOG(ERROR) << "parent AddDescriptor(" << parent_recv_port_memory->GetPort() << ") failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
ReceivePort* parent_send_port_memory_ack = new ReceivePort();
|
||||
auto* parent_send_port_memory_ack = new ReceivePort();
|
||||
if (!parent_message.AddDescriptor(MachMsgPortDescriptor(parent_send_port_memory_ack->GetPort()))) {
|
||||
CHROMIUM_LOG(ERROR) << "parent AddDescriptor(" << parent_send_port_memory_ack->GetPort() << ") failed.";
|
||||
return false;
|
||||
|
@ -150,7 +150,7 @@ SetupMachMemory(pid_t pid,
|
||||
if (pidIsParent) {
|
||||
gParentPid = pid;
|
||||
}
|
||||
MemoryPorts* listen_ports = new MemoryPorts(listen_port_ack, listen_port);
|
||||
auto* listen_ports = new MemoryPorts(listen_port_ack, listen_port);
|
||||
pthread_t thread;
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_init(&attr);
|
||||
@ -249,8 +249,8 @@ GetMemoryPortsForPid(pid_t pid)
|
||||
// Create two receiving ports in this process to send to the parent. One will be used for
|
||||
// for listening for incoming memory to be shared, the other for getting the Handle of
|
||||
// memory we share to the other process.
|
||||
ReceivePort* ports_in_receiver = new ReceivePort();
|
||||
ReceivePort* ports_out_receiver = new ReceivePort();
|
||||
auto* ports_in_receiver = new ReceivePort();
|
||||
auto* ports_out_receiver = new ReceivePort();
|
||||
mach_port_t raw_ports_in_sender, raw_ports_out_sender;
|
||||
if (!RequestPorts(parent,
|
||||
ports_in_receiver->GetPort(),
|
||||
@ -263,8 +263,8 @@ GetMemoryPortsForPid(pid_t pid)
|
||||
}
|
||||
// Our parent process sent us two ports, one is for sending new memory to, the other
|
||||
// is for replying with the Handle when we receive new memory.
|
||||
MachPortSender* ports_in_sender = new MachPortSender(raw_ports_in_sender);
|
||||
MachPortSender* ports_out_sender = new MachPortSender(raw_ports_out_sender);
|
||||
auto* ports_in_sender = new MachPortSender(raw_ports_in_sender);
|
||||
auto* ports_out_sender = new MachPortSender(raw_ports_out_sender);
|
||||
SetupMachMemory(pid,
|
||||
ports_in_receiver,
|
||||
ports_in_sender,
|
||||
@ -372,11 +372,11 @@ HandleGetPortsMessage(MachReceiveMessage* rmsg, MemoryPorts* ports)
|
||||
return;
|
||||
}
|
||||
|
||||
MachPortSender* ports_in_sender = new MachPortSender(rmsg->GetTranslatedPort(0));
|
||||
MachPortSender* ports_out_sender = new MachPortSender(rmsg->GetTranslatedPort(1));
|
||||
auto* ports_in_sender = new MachPortSender(rmsg->GetTranslatedPort(0));
|
||||
auto* ports_out_sender = new MachPortSender(rmsg->GetTranslatedPort(1));
|
||||
|
||||
ReceivePort* ports_in_receiver = new ReceivePort();
|
||||
ReceivePort* ports_out_receiver = new ReceivePort();
|
||||
auto* ports_in_receiver = new ReceivePort();
|
||||
auto* ports_out_receiver = new ReceivePort();
|
||||
if (SendReturnPortsMsg(ports->mSender, ports_in_receiver->GetPort(), ports_out_receiver->GetPort())) {
|
||||
SetupMachMemory(pid_pair->mRequester,
|
||||
ports_out_receiver,
|
||||
|
@ -378,7 +378,7 @@ XPCShellEnvironment::ProcessFile(JSContext *cx,
|
||||
XPCShellEnvironment*
|
||||
XPCShellEnvironment::CreateEnvironment()
|
||||
{
|
||||
XPCShellEnvironment* env = new XPCShellEnvironment();
|
||||
auto* env = new XPCShellEnvironment();
|
||||
if (env && !env->Init()) {
|
||||
delete env;
|
||||
env = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user