Merge mozilla-central to mozilla-inbound

This commit is contained in:
Ed Morley 2012-01-06 22:35:43 +00:00
commit 2ac5b3a131
27 changed files with 101 additions and 51 deletions

View File

@ -159,10 +159,11 @@ nsImageLoadingContent::~nsImageLoadingContent()
* imgIContainerObserver impl
*/
NS_IMETHODIMP
nsImageLoadingContent::FrameChanged(imgIContainer* aContainer,
nsImageLoadingContent::FrameChanged(imgIRequest* aRequest,
imgIContainer* aContainer,
const nsIntRect* aDirtyRect)
{
LOOP_OVER_OBSERVERS(FrameChanged(aContainer, aDirtyRect));
LOOP_OVER_OBSERVERS(FrameChanged(aRequest, aContainer, aDirtyRect));
return NS_OK;
}

View File

@ -113,7 +113,8 @@ nsStubImageDecoderObserver::OnImageIsAnimated(imgIRequest *aRequest)
}
NS_IMETHODIMP
nsStubImageDecoderObserver::FrameChanged(imgIContainer *aContainer,
nsStubImageDecoderObserver::FrameChanged(imgIRequest* aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
return NS_OK;

View File

@ -5742,11 +5742,12 @@ nsSVGFEImageElement::OnStopDecode(imgIRequest *aRequest,
}
NS_IMETHODIMP
nsSVGFEImageElement::FrameChanged(imgIContainer *aContainer,
nsSVGFEImageElement::FrameChanged(imgIRequest* aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
nsresult rv =
nsImageLoadingContent::FrameChanged(aContainer, aDirtyRect);
nsImageLoadingContent::FrameChanged(aRequest, aContainer, aDirtyRect);
Invalidate();
return rv;
}

View File

@ -298,7 +298,8 @@ public:
NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status,
const PRUnichar *statusArg);
// imgIContainerObserver
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest* aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
// imgIContainerObserver
NS_IMETHOD OnStartContainer(imgIRequest *aRequest,

View File

@ -57,9 +57,24 @@ struct nsIntRect;
*/
class THEBES_API gfxASurface {
public:
#ifdef MOZILLA_INTERNAL_API
nsrefcnt AddRef(void);
nsrefcnt Release(void);
// These functions exist so that browsercomps can refcount a gfxASurface
virtual nsresult AddRefExternal(void)
{
return AddRef();
}
virtual nsresult ReleaseExternal(void)
{
return Release();
}
#else
virtual nsresult AddRef(void);
virtual nsresult Release(void);
#endif
public:
/**
* The format for an image surface. For all formats with alpha data, 0

View File

@ -47,11 +47,7 @@
*/
typedef double gfxFloat;
#if defined(IMPL_THEBES)
# define THEBES_API NS_EXPORT
#else
# define THEBES_API NS_IMPORT
#endif
# define THEBES_API
/**
* gfx errors

View File

@ -44,6 +44,7 @@
%}
interface imgIContainer;
interface imgIRequest;
[ptr] native nsIntRect(nsIntRect);
/**
@ -52,9 +53,10 @@ interface imgIContainer;
* @author Stuart Parmenter <pavlov@netscape.com>
* @version 0.1
*/
[scriptable, uuid(aa2068c1-6b91-4f52-8603-487b14ac5f04)]
[scriptable, uuid(f01efdb3-4b20-4313-a636-a2aa01a4ef5d)]
interface imgIContainerObserver : nsISupports
{
[noscript] void frameChanged(in imgIContainer aContainer,
[noscript] void frameChanged(in imgIRequest aRequest,
in imgIContainer aContainer,
[const] in nsIntRect aDirtyRect);
};

View File

@ -77,7 +77,7 @@ interface imgIContainer;
* @version 0.1
* @see imagelib2
*/
[scriptable, uuid(2e5fa0c4-57f8-4d16-bda3-1daeba9caa34)]
[scriptable, uuid(5ca71b89-1a2f-475f-881d-d76c1531c4c8)]
interface imgIDecoderObserver : imgIContainerObserver
{
/**

View File

@ -480,7 +480,7 @@ RasterImage::RequestRefresh(const mozilla::TimeStamp& aTime)
mFramesNotified++;
#endif
observer->FrameChanged(this, &dirtyRect);
observer->FrameChanged(nsnull, this, &dirtyRect);
}
}
@ -1423,7 +1423,7 @@ RasterImage::ResetAnimation()
// Update display if we were animating before
nsCOMPtr<imgIContainerObserver> observer(do_QueryReferent(mObserver));
if (mAnimating && observer)
observer->FrameChanged(this, &(mAnim->firstFrameRefreshArea));
observer->FrameChanged(nsnull, this, &(mAnim->firstFrameRefreshArea));
if (ShouldAnimate()) {
StartAnimation();

View File

@ -699,7 +699,7 @@ VectorImage::OnStopRequest(nsIRequest* aRequest, nsISupports* aCtxt,
// NOTE: This signals that width/height are available.
observer->OnStartContainer(nsnull, this);
observer->FrameChanged(this, &nsIntRect::GetMaxSizedIntRect());
observer->FrameChanged(nsnull, this, &nsIntRect::GetMaxSizedIntRect());
observer->OnStopFrame(nsnull, 0);
observer->OnStopDecode(nsnull, NS_OK, nsnull);
}
@ -738,7 +738,7 @@ VectorImage::InvalidateObserver()
nsCOMPtr<imgIContainerObserver> containerObs(do_QueryReferent(mObserver));
if (containerObs) {
containerObs->FrameChanged(this, &nsIntRect::GetMaxSizedIntRect());
containerObs->FrameChanged(nsnull, this, &nsIntRect::GetMaxSizedIntRect());
}
nsCOMPtr<imgIDecoderObserver> decoderObs(do_QueryReferent(mObserver));

View File

@ -514,8 +514,11 @@ imgRequest::RequestDecode()
/** imgIContainerObserver methods **/
/* [noscript] void frameChanged (in imgIContainer container, in nsIntRect dirtyRect); */
NS_IMETHODIMP imgRequest::FrameChanged(imgIContainer *container,
/* [noscript] void frameChanged (in imgIRequest request,
in imgIContainer container,
in nsIntRect dirtyRect); */
NS_IMETHODIMP imgRequest::FrameChanged(imgIRequest *request,
imgIContainer *container,
const nsIntRect *dirtyRect)
{
LOG_SCOPE(gImgLog, "imgRequest::FrameChanged");

View File

@ -614,7 +614,7 @@ void imgRequestProxy::FrameChanged(imgIContainer *container,
if (mListener && !mCanceled) {
// Hold a ref to the listener while we call it, just in case.
nsCOMPtr<imgIDecoderObserver> kungFuDeathGrip(mListener);
mListener->FrameChanged(container, dirtyRect);
mListener->FrameChanged(this, container, dirtyRect);
}
}

View File

@ -212,7 +212,8 @@ NS_IMETHODIMP nsImageLoader::OnStopRequest(imgIRequest *aRequest,
return NS_OK;
}
NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsImageLoader::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
if (!mFrame)
@ -223,6 +224,8 @@ NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer,
return NS_OK;
}
NS_ASSERTION(aRequest == mRequest, "This is a neat trick.");
nsRect r = aDirtyRect->IsEqualInterior(nsIntRect::GetMaxSizedIntRect()) ?
nsRect(nsPoint(0, 0), mFrame->GetSize()) :
aDirtyRect->ToAppUnits(nsPresContext::AppUnitsPerCSSPixel());

View File

@ -90,7 +90,8 @@ public:
// incrementally in nsImageFrame.cpp.
// imgIContainerObserver (override nsStubImageDecoderObserver)
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
void Destroy();

View File

@ -1547,7 +1547,8 @@ NS_IMETHODIMP nsBulletFrame::OnImageIsAnimated(imgIRequest* aRequest)
return NS_OK;
}
NS_IMETHODIMP nsBulletFrame::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsBulletFrame::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
// Invalidate the entire content area. Maybe it's not optimal but it's simple and
@ -1700,11 +1701,12 @@ NS_IMETHODIMP nsBulletListener::OnImageIsAnimated(imgIRequest *aRequest)
return mFrame->OnImageIsAnimated(aRequest);
}
NS_IMETHODIMP nsBulletListener::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsBulletListener::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
if (!mFrame)
return NS_OK;
return mFrame->FrameChanged(aContainer, aDirtyRect);
return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect);
}

View File

@ -68,7 +68,8 @@ public:
NS_IMETHOD OnImageIsAnimated(imgIRequest *aRequest);
// imgIContainerObserver (override nsStubImageDecoderObserver)
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *dirtyRect);
void SetFrame(nsBulletFrame *frame) { mFrame = frame; }
@ -122,7 +123,8 @@ public:
nsresult aStatus,
const PRUnichar *aStatusArg);
NS_IMETHOD OnImageIsAnimated(imgIRequest *aRequest);
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
/* get list item text, without '.' */

View File

@ -682,7 +682,8 @@ nsImageFrame::OnStopDecode(imgIRequest *aRequest,
}
nsresult
nsImageFrame::FrameChanged(imgIContainer *aContainer,
nsImageFrame::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
if (!GetStyleVisibility()->IsVisible()) {
@ -1988,7 +1989,8 @@ nsImageFrame::IconLoad::OnDiscard(imgIRequest *aRequest)
}
NS_IMETHODIMP
nsImageFrame::IconLoad::FrameChanged(imgIContainer *aContainer,
nsImageFrame::IconLoad::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
nsTObserverArray<nsImageFrame*>::ForwardIterator iter(mIconObservers);
@ -2043,13 +2045,14 @@ NS_IMETHODIMP nsImageListener::OnStopDecode(imgIRequest *aRequest,
return mFrame->OnStopDecode(aRequest, status, statusArg);
}
NS_IMETHODIMP nsImageListener::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsImageListener::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
if (!mFrame)
return NS_ERROR_FAILURE;
return mFrame->FrameChanged(aContainer, aDirtyRect);
return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect);
}
static bool

View File

@ -85,7 +85,8 @@ public:
NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status,
const PRUnichar *statusArg);
// imgIContainerObserver (override nsStubImageDecoderObserver)
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *dirtyRect);
void SetFrame(nsImageFrame *frame) { mFrame = frame; }
@ -237,7 +238,8 @@ protected:
nsresult OnStopDecode(imgIRequest *aRequest,
nsresult aStatus,
const PRUnichar *aStatusArg);
nsresult FrameChanged(imgIContainer *aContainer,
nsresult FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
private:

View File

@ -66,7 +66,7 @@
#include "nsIDOMNodeList.h"
#include "nsTArray.h"
#include "nsIScrollableFrame.h"
#include "nsCCUncollectableMarker.h"
#include "nsISelectionListener.h"
#include "nsIContentIterator.h"
#include "nsIDocumentEncoder.h"
@ -760,7 +760,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsFrameSelection)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mMaintainRange)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsFrameSelection)
if (tmp->mShell) {
if (tmp->mShell && tmp->mShell->GetDocument() &&
nsCCUncollectableMarker::InGeneration(cb,
tmp->mShell->GetDocument()->
GetMarkedCCGeneration())) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
PRInt32 i;

View File

@ -62,7 +62,8 @@ public:
NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status,
const PRUnichar *statusArg);
// imgIContainerObserver (override nsStubImageDecoderObserver)
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
// imgIContainerObserver (override nsStubImageDecoderObserver)
NS_IMETHOD OnStartContainer(imgIRequest *aRequest,
@ -555,7 +556,8 @@ NS_IMETHODIMP nsSVGImageListener::OnStopDecode(imgIRequest *aRequest,
return NS_OK;
}
NS_IMETHODIMP nsSVGImageListener::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsSVGImageListener::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
if (!mFrame)

View File

@ -626,7 +626,8 @@ NS_IMETHODIMP nsImageBoxFrame::OnImageIsAnimated(imgIRequest *aRequest)
return NS_OK;
}
NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
nsBoxLayoutState state(PresContext());
@ -681,12 +682,13 @@ NS_IMETHODIMP nsImageBoxListener::OnImageIsAnimated(imgIRequest* aRequest)
return mFrame->OnImageIsAnimated(aRequest);
}
NS_IMETHODIMP nsImageBoxListener::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsImageBoxListener::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
if (!mFrame)
return NS_ERROR_FAILURE;
return mFrame->FrameChanged(aContainer, aDirtyRect);
return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect);
}

View File

@ -61,7 +61,8 @@ public:
NS_IMETHOD OnImageIsAnimated(imgIRequest* aRequest);
// imgIContainerObserver (override nsStubImageDecoderObserver)
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
void SetFrame(nsImageBoxFrame *frame) { mFrame = frame; }
@ -126,7 +127,8 @@ public:
const PRUnichar *statusArg);
NS_IMETHOD OnImageIsAnimated(imgIRequest* aRequest);
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
virtual ~nsImageBoxFrame();

View File

@ -84,7 +84,8 @@ NS_IMETHODIMP nsTreeImageListener::OnDataAvailable(imgIRequest *aRequest,
return NS_OK;
}
NS_IMETHODIMP nsTreeImageListener::FrameChanged(imgIContainer *aContainer,
NS_IMETHODIMP nsTreeImageListener::FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect)
{
Invalidate();

View File

@ -60,7 +60,8 @@ public:
NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, bool aCurrentFrame,
const nsIntRect *aRect);
// imgIContainerObserver (override nsStubImageDecoderObserver)
NS_IMETHOD FrameChanged(imgIContainer *aContainer,
NS_IMETHOD FrameChanged(imgIRequest *aRequest,
imgIContainer *aContainer,
const nsIntRect *aDirtyRect);
NS_IMETHOD ClearFrame();

View File

@ -289,20 +289,24 @@ HISTOGRAM(UPDATE_STATUS, 1, 16006, 20, LINEAR, "Updater: the status of the lates
/**
* Thunderbird-specific telemetry.
*/
#ifdef MOZ_THUNDERBIRD
// Disable this application-specific #ifdef ftb. (See bug 710562)
// #ifdef MOZ_THUNDERBIRD
HISTOGRAM(THUNDERBIRD_GLODA_SIZE_MB, 1, 1000, 40, LINEAR, "Gloda: size of global-messages-db.sqlite (MB)")
// THUNDERBIRD_CONVERSATIONS_TIME_TO_2ND_GLODA_QUERY_MS is used by Thunderbird Conversations add-on.
// https://addons.mozilla.org/en-US/thunderbird/addon/54035/
HISTOGRAM(THUNDERBIRD_CONVERSATIONS_TIME_TO_2ND_GLODA_QUERY_MS, 1, 10000, 30, EXPONENTIAL, "Conversations: time between the moment we click and the second gloda query returns (ms)")
HISTOGRAM(THUNDERBIRD_INDEXING_RATE_MSG_PER_S, 1, 100, 20, LINEAR, "Gloda: indexing rate (message/s)")
#endif
// #endif
/**
* Firefox-specific telemetry.
*/
#ifdef MOZ_PHOENIX
// Disable this application-specific #ifdef ftb. (See bug 710562)
// #ifdef MOZ_PHOENIX
HISTOGRAM(FX_TAB_ANIM_OPEN_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab opening animation")
HISTOGRAM(FX_TAB_ANIM_CLOSE_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab closing animation")
HISTOGRAM_BOOLEAN(FX_CONTEXT_SEARCH_AND_TAB_SELECT, "Firefox: Background tab was selected within 5 seconds of searching from the context menu")
#endif
// #endif
HISTOGRAM_BOOLEAN(INNERWINDOWS_WITH_MUTATION_LISTENERS, "Deleted or to-be-reused innerwindow which has had mutation event listeners.")
HISTOGRAM(XUL_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "xul reflows")

View File

@ -144,7 +144,8 @@ nsAlertsIconListener::OnStopDecode(imgIRequest* aRequest,
}
NS_IMETHODIMP
nsAlertsIconListener::FrameChanged(imgIContainer* aContainer,
nsAlertsIconListener::FrameChanged(imgIRequest* aRequest,
imgIContainer* aContainer,
const nsIntRect* aDirtyRect)
{
return NS_OK;

View File

@ -358,7 +358,8 @@ nsMenuItemIconX::LoadIcon(nsIURI* aIconURI)
//
NS_IMETHODIMP
nsMenuItemIconX::FrameChanged(imgIContainer* aContainer,
nsMenuItemIconX::FrameChanged(imgIRequest* aRequest,
imgIContainer* aContainer,
const nsIntRect* aDirtyRect)
{
return NS_OK;