Use the routing id on api::WebContents::GetID

The sandbox option allows multiple webContents in one renderer process, so using
the only the renderer id to identify WebContents instances is no longer an
option.

WebContents::GetID now returns a 64-bit integer, which is composed of both the
process id(high 32), and the RenderViewHost routing id(low 32). Also add a
`GetProcessID` that retrieves the renderer process id, a requirement in some of
our javascript code.
This commit is contained in:
Thiago de Arruda 2016-09-05 22:28:40 -03:00
parent 524bab530a
commit a64978b812
4 changed files with 14 additions and 5 deletions

View file

@ -123,7 +123,7 @@ const hookWebContentsEvents = function (webContents) {
sendToBackgroundPages('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', {
frameId: 0,
parentFrameId: -1,
processId: webContents.getId(),
processId: webContents.getProcessId(),
tabId: tabId,
timeStamp: Date.now(),
url: url
@ -134,7 +134,7 @@ const hookWebContentsEvents = function (webContents) {
sendToBackgroundPages('CHROME_WEBNAVIGATION_ONCOMPLETED', {
frameId: 0,
parentFrameId: -1,
processId: webContents.getId(),
processId: webContents.getProcessId(),
tabId: tabId,
timeStamp: Date.now(),
url: url