feat: add event.senderId property to IPCs sent via ipcRenderer.sendTo (#14395)

This commit is contained in:
Milan Burda 2018-09-01 03:13:51 +02:00 committed by Charles Kerr
parent b89848d683
commit c17a1b37ea
11 changed files with 90 additions and 31 deletions

View file

@ -39,10 +39,11 @@ IPC_MESSAGE_ROUTED4(AtomFrameHostMsg_Message_To,
std::string /* channel */,
base::ListValue /* arguments */)
IPC_MESSAGE_ROUTED3(AtomFrameMsg_Message,
IPC_MESSAGE_ROUTED4(AtomFrameMsg_Message,
bool /* send_to_all */,
std::string /* channel */,
base::ListValue /* arguments */)
base::ListValue /* arguments */,
int32_t /* sender_id */)
IPC_MESSAGE_ROUTED0(AtomViewMsg_Offscreen)

View file

@ -36,12 +36,13 @@ RemoteCallbackFreer::~RemoteCallbackFreer() {}
void RemoteCallbackFreer::RunDestructor() {
auto* channel = "ELECTRON_RENDERER_RELEASE_CALLBACK";
base::ListValue args;
int32_t sender_id = 0;
args.AppendString(context_id_);
args.AppendInteger(object_id_);
auto* frame_host = web_contents()->GetMainFrame();
if (frame_host) {
frame_host->Send(new AtomFrameMsg_Message(frame_host->GetRoutingID(), false,
channel, args));
channel, args, sender_id));
}
Observe(nullptr);