Bug 1045824 - Use nsIntRect for passing around a value that is not in app units. r=smaug

This commit is contained in:
Kartikaya Gupta 2014-08-08 13:23:50 -04:00
parent bda4feff6e
commit ec0e08b0be
7 changed files with 11 additions and 14 deletions

View File

@ -1021,7 +1021,7 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size,
mRemoteBrowserInitialized = true;
}
} else {
nsRect dimensions;
nsIntRect dimensions;
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), false);
// Don't show remote iframe if we are waiting for the completion of reflow.
@ -1877,7 +1877,7 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
}
nsresult
nsFrameLoader::GetWindowDimensions(nsRect& aRect)
nsFrameLoader::GetWindowDimensions(nsIntRect& aRect)
{
// Need to get outer window position here
nsIDocument* doc = mOwnerContent->GetDocument();
@ -1917,7 +1917,7 @@ nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame *aIFrame)
if (mRemoteFrame) {
if (mRemoteBrowser) {
nsIntSize size = aIFrame->GetSubdocumentSize();
nsRect dimensions;
nsIntRect dimensions;
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE);
mRemoteBrowser->UpdateDimensions(dimensions, size);
}

View File

@ -370,7 +370,7 @@ private:
nsresult EnsureMessageManager();
// Properly retrieves documentSize of any subdocument type.
nsresult GetWindowDimensions(nsRect& aRect);
nsresult GetWindowDimensions(nsIntRect& aRect);
// Updates the subdocument position and size. This gets called only
// when we have our own in-process DocShell.

View File

@ -406,7 +406,7 @@ child:
CacheFileDescriptor(nsString path, FileDescriptor fd);
UpdateDimensions(nsRect rect, nsIntSize size, ScreenOrientation orientation) compress;
UpdateDimensions(nsIntRect rect, nsIntSize size, ScreenOrientation orientation) compress;
UpdateFrame(FrameMetrics frame);

View File

@ -1743,16 +1743,13 @@ TabChild::RecvShow(const nsIntSize& size)
}
bool
TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const ScreenOrientation& orientation)
TabChild::RecvUpdateDimensions(const nsIntRect& rect, const nsIntSize& size, const ScreenOrientation& orientation)
{
if (!mRemoteFrame) {
return true;
}
mOuterRect.x = rect.x;
mOuterRect.y = rect.y;
mOuterRect.width = rect.width;
mOuterRect.height = rect.height;
mOuterRect = rect;
bool initialSizing = !HasValidInnerSize()
&& (size.width != 0 && size.height != 0);

View File

@ -318,7 +318,7 @@ public:
const FileDescriptor& aFileDescriptor)
MOZ_OVERRIDE;
virtual bool RecvShow(const nsIntSize& size) MOZ_OVERRIDE;
virtual bool RecvUpdateDimensions(const nsRect& rect,
virtual bool RecvUpdateDimensions(const nsIntRect& rect,
const nsIntSize& size,
const ScreenOrientation& orientation) MOZ_OVERRIDE;
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;

View File

@ -560,7 +560,7 @@ TabParent::Show(const nsIntSize& size)
}
void
TabParent::UpdateDimensions(const nsRect& rect, const nsIntSize& size)
TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size)
{
if (mIsDestroyed) {
return;

View File

@ -208,7 +208,7 @@ public:
// message-sending functions under a layer of indirection and
// eating the return values
void Show(const nsIntSize& size);
void UpdateDimensions(const nsRect& rect, const nsIntSize& size);
void UpdateDimensions(const nsIntRect& rect, const nsIntSize& size);
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
void UIResolutionChanged();
void AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration);
@ -374,7 +374,7 @@ protected:
// The number of event series we're currently capturing.
int32_t mEventCaptureDepth;
nsRect mRect;
nsIntRect mRect;
nsIntSize mDimensions;
ScreenOrientation mOrientation;
float mDPI;