Bug 1234583 -Expose OS Pid in nsITabParent. r=billm

This commit is contained in:
Gabor Krizsanits 2016-08-01 12:26:48 +02:00
Родитель f6bc83a18a
Коммит 8de309e78f
5 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -54,6 +54,11 @@ interface nsITabParent : nsISupports
readonly attribute uint64_t tabId;
/**
* The OS level process Id of the related child process.
*/
readonly attribute int32_t osPid;
/**
* Navigate by key. If aForDocumentNavigation is true, navigate by document.
* If aForDocumentNavigation is false, navigate by element.

Просмотреть файл

@ -62,6 +62,11 @@ public:
{
return mIsForBrowser;
}
virtual int32_t Pid() const override
{
// XXX: do we need this for ContentBridgeParent?
return -1;
}
protected:
virtual ~ContentBridgeParent();

Просмотреть файл

@ -386,8 +386,6 @@ public:
return mSubprocess;
}
int32_t Pid() const;
ContentParent* Opener() const
{
return mOpener;
@ -591,6 +589,8 @@ public:
virtual bool
RecvUnstoreAndBroadcastBlobURLUnregistration(const nsCString& aURI) override;
virtual int32_t Pid() const override;
protected:
void OnChannelConnected(int32_t pid) override;

Просмотреть файл

@ -2943,6 +2943,13 @@ TabParent::GetTabId(uint64_t* aId)
return NS_OK;
}
NS_IMETHODIMP
TabParent::GetOsPid(int32_t* aId)
{
*aId = Manager()->Pid();
return NS_OK;
}
NS_IMETHODIMP
TabParent::GetHasContentOpener(bool* aResult)
{

Просмотреть файл

@ -82,6 +82,8 @@ public:
ContentBridgeParent* AsContentBridgeParent();
virtual int32_t Pid() const = 0;
protected: // methods
bool CanOpenBrowser(const IPCTabContext& aContext);