mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 22:05:40 +00:00
Bug 1041457 - Use rpc protocol for DOM screen messages (r=mconley,jimm)
This commit is contained in:
parent
8fe7015020
commit
e48c9359a9
@ -494,7 +494,7 @@ parent:
|
||||
|
||||
PNecko();
|
||||
|
||||
sync PScreenManager()
|
||||
rpc PScreenManager()
|
||||
returns (uint32_t numberOfScreens,
|
||||
float systemDefaultScale,
|
||||
bool success);
|
||||
|
@ -20,32 +20,32 @@ struct ScreenDetails {
|
||||
double contentsScaleFactor;
|
||||
};
|
||||
|
||||
sync protocol PScreenManager
|
||||
rpc protocol PScreenManager
|
||||
{
|
||||
manager PContent;
|
||||
|
||||
parent:
|
||||
sync Refresh()
|
||||
rpc Refresh()
|
||||
returns (uint32_t numberOfScreens,
|
||||
float systemDefaultScale,
|
||||
bool success);
|
||||
|
||||
sync ScreenRefresh(uint32_t aId)
|
||||
rpc ScreenRefresh(uint32_t aId)
|
||||
returns (ScreenDetails screen,
|
||||
bool success);
|
||||
|
||||
sync GetPrimaryScreen()
|
||||
rpc GetPrimaryScreen()
|
||||
returns (ScreenDetails screen,
|
||||
bool success);
|
||||
|
||||
sync ScreenForRect(int32_t aLeft,
|
||||
rpc ScreenForRect(int32_t aLeft,
|
||||
int32_t aTop,
|
||||
int32_t aWidth,
|
||||
int32_t aHeight)
|
||||
returns (ScreenDetails screen,
|
||||
bool success);
|
||||
|
||||
sync ScreenForBrowser(PBrowser aBrowser)
|
||||
rpc ScreenForBrowser(PBrowser aBrowser)
|
||||
returns (ScreenDetails screen,
|
||||
bool success);
|
||||
|
||||
|
@ -24,13 +24,13 @@ ScreenManagerParent::ScreenManagerParent(uint32_t* aNumberOfScreens,
|
||||
MOZ_CRASH("Couldn't get nsIScreenManager from ScreenManagerParent.");
|
||||
}
|
||||
|
||||
unused << RecvRefresh(aNumberOfScreens, aSystemDefaultScale, aSuccess);
|
||||
unused << AnswerRefresh(aNumberOfScreens, aSystemDefaultScale, aSuccess);
|
||||
}
|
||||
|
||||
bool
|
||||
ScreenManagerParent::RecvRefresh(uint32_t* aNumberOfScreens,
|
||||
float* aSystemDefaultScale,
|
||||
bool* aSuccess)
|
||||
ScreenManagerParent::AnswerRefresh(uint32_t* aNumberOfScreens,
|
||||
float* aSystemDefaultScale,
|
||||
bool* aSuccess)
|
||||
{
|
||||
*aSuccess = false;
|
||||
|
||||
@ -49,9 +49,9 @@ ScreenManagerParent::RecvRefresh(uint32_t* aNumberOfScreens,
|
||||
}
|
||||
|
||||
bool
|
||||
ScreenManagerParent::RecvScreenRefresh(const uint32_t& aId,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
ScreenManagerParent::AnswerScreenRefresh(const uint32_t& aId,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
{
|
||||
*aSuccess = false;
|
||||
|
||||
@ -70,8 +70,8 @@ ScreenManagerParent::RecvScreenRefresh(const uint32_t& aId,
|
||||
}
|
||||
|
||||
bool
|
||||
ScreenManagerParent::RecvGetPrimaryScreen(ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
ScreenManagerParent::AnswerGetPrimaryScreen(ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
{
|
||||
*aSuccess = false;
|
||||
|
||||
@ -91,12 +91,12 @@ ScreenManagerParent::RecvGetPrimaryScreen(ScreenDetails* aRetVal,
|
||||
}
|
||||
|
||||
bool
|
||||
ScreenManagerParent::RecvScreenForRect(const int32_t& aLeft,
|
||||
const int32_t& aTop,
|
||||
const int32_t& aWidth,
|
||||
const int32_t& aHeight,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
ScreenManagerParent::AnswerScreenForRect(const int32_t& aLeft,
|
||||
const int32_t& aTop,
|
||||
const int32_t& aWidth,
|
||||
const int32_t& aHeight,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
{
|
||||
*aSuccess = false;
|
||||
|
||||
@ -116,9 +116,9 @@ ScreenManagerParent::RecvScreenForRect(const int32_t& aLeft,
|
||||
}
|
||||
|
||||
bool
|
||||
ScreenManagerParent::RecvScreenForBrowser(PBrowserParent* aBrowser,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
ScreenManagerParent::AnswerScreenForBrowser(PBrowserParent* aBrowser,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess)
|
||||
{
|
||||
*aSuccess = false;
|
||||
|
||||
|
@ -21,29 +21,29 @@ class ScreenManagerParent : public PScreenManagerParent
|
||||
bool* aSuccess);
|
||||
~ScreenManagerParent() {};
|
||||
|
||||
virtual bool RecvRefresh(uint32_t* aNumberOfScreens,
|
||||
float* aSystemDefaultScale,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
virtual bool AnswerRefresh(uint32_t* aNumberOfScreens,
|
||||
float* aSystemDefaultScale,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvScreenRefresh(const uint32_t& aId,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
virtual bool AnswerScreenRefresh(const uint32_t& aId,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvGetPrimaryScreen(ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
virtual bool AnswerGetPrimaryScreen(ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvScreenForRect(const int32_t& aLeft,
|
||||
const int32_t& aTop,
|
||||
const int32_t& aWidth,
|
||||
const int32_t& aHeight,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
virtual bool AnswerScreenForRect(const int32_t& aLeft,
|
||||
const int32_t& aTop,
|
||||
const int32_t& aWidth,
|
||||
const int32_t& aHeight,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvScreenForBrowser(PBrowserParent* aBrowser,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess);
|
||||
virtual bool AnswerScreenForBrowser(PBrowserParent* aBrowser,
|
||||
ScreenDetails* aRetVal,
|
||||
bool* aSuccess);
|
||||
|
||||
private:
|
||||
bool ExtractScreenDetails(nsIScreen* aScreen, ScreenDetails &aDetails);
|
||||
|
@ -111,7 +111,7 @@ ScreenProxy::EnsureCacheIsValid()
|
||||
// Kick off a synchronous IPC call to the parent to get the
|
||||
// most up-to-date information.
|
||||
ScreenDetails details;
|
||||
unused << mScreenManager->SendScreenRefresh(mId, &details, &success);
|
||||
unused << mScreenManager->CallScreenRefresh(mId, &details, &success);
|
||||
if (!success) {
|
||||
NS_WARNING("Updating a ScreenProxy in the child process failed on parent side.");
|
||||
return false;
|
||||
|
@ -28,7 +28,7 @@ nsScreenManagerProxy::nsScreenManagerProxy()
|
||||
, mCacheWillInvalidate(false)
|
||||
{
|
||||
bool success = false;
|
||||
unused << ContentChild::GetSingleton()->SendPScreenManagerConstructor(
|
||||
unused << ContentChild::GetSingleton()->CallPScreenManagerConstructor(
|
||||
this,
|
||||
&mNumberOfScreens,
|
||||
&mSystemDefaultScale,
|
||||
@ -64,7 +64,7 @@ nsScreenManagerProxy::GetPrimaryScreen(nsIScreen** outScreen)
|
||||
if (!mPrimaryScreen) {
|
||||
ScreenDetails details;
|
||||
bool success = false;
|
||||
unused << SendGetPrimaryScreen(&details, &success);
|
||||
unused << CallGetPrimaryScreen(&details, &success);
|
||||
if (!success) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
@ -92,7 +92,7 @@ nsScreenManagerProxy::ScreenForRect(int32_t inLeft,
|
||||
{
|
||||
bool success = false;
|
||||
ScreenDetails details;
|
||||
unused << SendScreenForRect(inLeft, inTop, inWidth, inHeight, &details, &success);
|
||||
unused << CallScreenForRect(inLeft, inTop, inWidth, inHeight, &details, &success);
|
||||
if (!success) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
@ -126,7 +126,7 @@ nsScreenManagerProxy::ScreenForNativeWidget(void* aWidget,
|
||||
// for it.
|
||||
bool success = false;
|
||||
ScreenDetails details;
|
||||
unused << SendScreenForBrowser(tabChild, &details, &success);
|
||||
unused << CallScreenForBrowser(tabChild, &details, &success);
|
||||
if (!success) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
@ -177,7 +177,7 @@ nsScreenManagerProxy::EnsureCacheIsValid()
|
||||
bool success = false;
|
||||
// Kick off a synchronous IPC call to the parent to get the
|
||||
// most up-to-date information.
|
||||
unused << SendRefresh(&mNumberOfScreens, &mSystemDefaultScale, &success);
|
||||
unused << CallRefresh(&mNumberOfScreens, &mSystemDefaultScale, &success);
|
||||
if (!success) {
|
||||
NS_WARNING("Refreshing nsScreenManagerProxy failed in the parent process.");
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user