зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1102060 - Part2: Change the way to send/rcv for ScreenForBrowser. r=smaug
This commit is contained in:
Родитель
2703c710fa
Коммит
dd818f0292
|
@ -9,6 +9,7 @@ include protocol PContent;
|
|||
include "mozilla/GfxMessageUtils.h";
|
||||
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -49,7 +50,7 @@ parent:
|
|||
returns (ScreenDetails screen,
|
||||
bool success);
|
||||
|
||||
prio(high) sync ScreenForBrowser(PBrowser aBrowser)
|
||||
prio(high) sync ScreenForBrowser(TabId aTabId)
|
||||
returns (ScreenDetails screen,
|
||||
bool success);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "nsIWidget.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "ScreenManagerParent.h"
|
||||
#include "ContentProcessManager.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -116,7 +117,7 @@ ScreenManagerParent::RecvScreenForRect(const int32_t& aLeft,
|
|||
}
|
||||
|
||||
bool
|
||||
ScreenManagerParent::RecvScreenForBrowser(PBrowserParent* aBrowser,
|
||||
ScreenManagerParent::RecvScreenForBrowser(const TabId& aTabId,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
{
|
||||
|
@ -129,7 +130,14 @@ ScreenManagerParent::RecvScreenForBrowser(PBrowserParent* aBrowser,
|
|||
|
||||
// Find the mWidget associated with the tabparent, and then return
|
||||
// the nsIScreen it's on.
|
||||
TabParent* tabParent = static_cast<TabParent*>(aBrowser);
|
||||
ContentParent* cp = static_cast<ContentParent*>(this->Manager());
|
||||
ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
|
||||
nsRefPtr<TabParent> tabParent =
|
||||
cpm->GetTopLevelTabParentByProcessAndTabId(cp->ChildID(), aTabId);
|
||||
if(!tabParent){
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWidget> widget = tabParent->GetWidget();
|
||||
|
||||
nsCOMPtr<nsIScreen> screen;
|
||||
|
|
|
@ -41,7 +41,7 @@ class ScreenManagerParent : public PScreenManagerParent
|
|||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvScreenForBrowser(PBrowserParent* aBrowser,
|
||||
virtual bool RecvScreenForBrowser(const TabId& aTabId,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ nsScreenManagerProxy::ScreenForNativeWidget(void* aWidget,
|
|||
// for it.
|
||||
bool success = false;
|
||||
ScreenDetails details;
|
||||
unused << SendScreenForBrowser(tabChild, &details, &success);
|
||||
unused << SendScreenForBrowser(tabChild->GetTabId(), &details, &success);
|
||||
if (!success) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче