Bug 1199765 - Add support to TabParent for querying the active state of remote browsers. r=Mossop

This commit is contained in:
Jim Mathies 2015-09-04 08:42:01 -05:00
Родитель 9887f9ea18
Коммит f0f7a995e4
7 изменённых файлов: 27 добавлений и 10 удалений

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

@ -5,7 +5,7 @@
#include "domstubs.idl"
[scriptable, uuid(531b902b-b551-4faa-9814-1a73e8299ac4)]
[scriptable, uuid(3dd203e4-66ec-40fd-acde-43f0b35c98e9)]
interface nsITabParent : nsISupports
{
void injectTouchEvent(in AString aType,
@ -23,7 +23,10 @@ interface nsITabParent : nsISupports
readonly attribute boolean useAsyncPanZoom;
void setIsDocShellActive(in bool aIsActive);
/**
* Manages the docshell active state of the remote browser.
*/
attribute boolean docShellIsActive;
/**
* During interactions where painting performance

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

@ -722,9 +722,9 @@ child:
SetUpdateHitRegion(bool aEnabled);
/**
* Tell the child to update its docShell's active state.
* Update the child side docShell active (resource use) state.
*/
SetIsDocShellActive(bool aIsActive);
SetDocShellIsActive(bool aIsActive);
/**
* Notify the child that it shouldn't paint the offscreen displayport.

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

@ -2572,7 +2572,7 @@ TabChild::RecvSetUpdateHitRegion(const bool& aEnabled)
}
bool
TabChild::RecvSetIsDocShellActive(const bool& aIsActive)
TabChild::RecvSetDocShellIsActive(const bool& aIsActive)
{
nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
if (docShell) {

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

@ -512,7 +512,7 @@ protected:
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
virtual bool RecvDestroy() override;
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
virtual bool RecvSetIsDocShellActive(const bool& aIsActive) override;
virtual bool RecvSetDocShellIsActive(const bool& aIsActive) override;
virtual bool RecvNavigateByKey(const bool& aForward, const bool& aForDocumentNavigation) override;
virtual bool RecvRequestNotifyAfterRemotePaint() override;

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

@ -276,6 +276,7 @@ TabParent::TabParent(nsIContentParent* aManager,
, mDefaultScale(0)
, mUpdatedDimensions(false)
, mManager(aManager)
, mDocShellIsActive(false)
, mMarkedDestroying(false)
, mIsDestroyed(false)
, mIsDetached(true)
@ -3044,10 +3045,19 @@ TabParent::GetUseAsyncPanZoom(bool* useAsyncPanZoom)
return NS_OK;
}
// defined in nsITabParent
NS_IMETHODIMP
TabParent::SetIsDocShellActive(bool isActive)
TabParent::SetDocShellIsActive(bool isActive)
{
unused << SendSetIsDocShellActive(isActive);
mDocShellIsActive = isActive;
unused << SendSetDocShellIsActive(isActive);
return NS_OK;
}
NS_IMETHODIMP
TabParent::GetDocShellIsActive(bool* aIsActive)
{
*aIsActive = mDocShellIsActive;
return NS_OK;
}

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

@ -504,6 +504,9 @@ private:
bool AsyncPanZoomEnabled() const;
// Cached value indicating the docshell active state of the remote browser.
bool mDocShellIsActive;
// Update state prior to routing an APZ-aware event to the child process.
// |aOutTargetGuid| will contain the identifier
// of the APZC instance that handled the event. aOutTargetGuid may be null.

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

@ -219,13 +219,14 @@
<property name="docShellIsActive">
<getter>
<![CDATA[
throw new Error("not supported");
let {frameLoader} = this.QueryInterface(Ci.nsIFrameLoaderOwner);
return frameLoader.tabParent.docShellIsActive;
]]>
</getter>
<setter>
<![CDATA[
let {frameLoader} = this.QueryInterface(Ci.nsIFrameLoaderOwner);
frameLoader.tabParent.setIsDocShellActive(val);
frameLoader.tabParent.docShellIsActive = val;
return val;
]]>
</setter>