Implement a stub imgIDecoderObserver to save code size in content and layout. b=339612 r+sr=sicking
git-svn-id: svn://10.0.0.236/trunk@200151 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -84,6 +84,7 @@ EXPORTS = \
|
||||
nsNodeInfoManager.h \
|
||||
nsPropertyTable.h \
|
||||
nsStubDocumentObserver.h \
|
||||
nsStubImageDecoderObserver.h \
|
||||
nsTextFragment.h \
|
||||
$(NULL)
|
||||
|
||||
@@ -132,6 +133,7 @@ CPPSRCS = \
|
||||
nsScriptEventManager.cpp \
|
||||
nsScriptLoader.cpp \
|
||||
nsStubDocumentObserver.cpp \
|
||||
nsStubImageDecoderObserver.cpp \
|
||||
nsStyleLinkElement.cpp \
|
||||
nsSyncLoadService.cpp \
|
||||
nsTextFragment.cpp \
|
||||
|
||||
109
mozilla/content/base/src/nsStubImageDecoderObserver.cpp
Normal file
109
mozilla/content/base/src/nsStubImageDecoderObserver.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is nsStubImageDecoderObserver.
|
||||
*
|
||||
* The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* L. David Baron <dbaron@dbaron.org>, Mozilla Corporation (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStartRequest(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStartDecode(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStartContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aContainer)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStartFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnDataAvailable(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame,
|
||||
const nsIntRect * aRect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStopFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStopContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aContainer)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStopDecode(imgIRequest *aRequest,
|
||||
nsresult status,
|
||||
const PRUnichar *statusArg)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::OnStopRequest(imgIRequest *aRequest,
|
||||
PRBool aIsLastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStubImageDecoderObserver::FrameChanged(imgIContainer *aContainer,
|
||||
gfxIImageFrame *aFrame,
|
||||
nsIntRect * aDirtyRect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
67
mozilla/content/base/src/nsStubImageDecoderObserver.h
Normal file
67
mozilla/content/base/src/nsStubImageDecoderObserver.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is nsStubDocumentObserver.
|
||||
*
|
||||
* The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2004
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* L. David Baron <dbaron@dbaron.org>, Mozilla Corporation (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
* nsStubImageDecoderObserver is an implementation of the imgIDecoderObserver
|
||||
* interface (except for the methods on nsISupports) that is intended to be
|
||||
* used as a base class within the content/layout library. All methods do
|
||||
* nothing.
|
||||
*/
|
||||
|
||||
#ifndef nsStubImageDecoderObserver_h_
|
||||
#define nsStubImageDecoderObserver_h_
|
||||
|
||||
#include "imgIDecoderObserver.h"
|
||||
|
||||
/**
|
||||
* There are two advantages to inheriting from nsStubImageDecoderObserver
|
||||
* rather than directly from imgIDecoderObserver:
|
||||
* 1. smaller compiled code size (since there's no need for the code
|
||||
* for the empty virtual function implementations for every
|
||||
* imgIDecoderObserver implementation)
|
||||
* 2. the performance of document's loop over observers benefits from
|
||||
* the fact that more of the functions called are the same (which
|
||||
* can reduce instruction cache misses and perhaps improve branch
|
||||
* prediction)
|
||||
*/
|
||||
class nsStubImageDecoderObserver : public imgIDecoderObserver {
|
||||
public:
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
};
|
||||
|
||||
#endif /* !defined(nsStubImageDecoderObserver_h_) */
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "imgIRequest.h"
|
||||
#include "imgILoader.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIScrollableView.h"
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
|
||||
class nsImageDocument : public nsMediaDocument,
|
||||
public nsIImageDocument,
|
||||
public imgIDecoderObserver,
|
||||
public nsStubImageDecoderObserver,
|
||||
public nsIDOMEventListener
|
||||
{
|
||||
public:
|
||||
@@ -109,9 +109,8 @@ public:
|
||||
|
||||
NS_DECL_NSIIMAGEDOCUMENT
|
||||
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
// imgIDecoderObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage);
|
||||
|
||||
// nsIDOMEventListener
|
||||
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
|
||||
@@ -484,18 +483,6 @@ nsImageDocument::ToggleImageSize()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStartRequest(imgIRequest* aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStartDecode(imgIRequest* aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage)
|
||||
{
|
||||
@@ -507,58 +494,6 @@ nsImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStartFrame(imgIRequest* aRequest, gfxIImageFrame* aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnDataAvailable(imgIRequest* aRequest,
|
||||
gfxIImageFrame* aFrame,
|
||||
const nsRect* aRect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStopFrame(imgIRequest* aRequest,
|
||||
gfxIImageFrame* aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStopContainer(imgIRequest* aRequest,
|
||||
imgIContainer* aImage)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStopDecode(imgIRequest* aRequest,
|
||||
nsresult status,
|
||||
const PRUnichar* statusArg)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::OnStopRequest(imgIRequest* aRequest,
|
||||
PRBool aLastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::FrameChanged(imgIContainer* aContainer,
|
||||
gfxIImageFrame* aFrame,
|
||||
nsRect* aDirtyRect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImageDocument::HandleEvent(nsIDOMEvent* aEvent)
|
||||
{
|
||||
|
||||
@@ -137,16 +137,6 @@ nsImageLoader::Load(imgIRequest *aImage)
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStartRequest(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStartDecode(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStartContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
@@ -164,22 +154,6 @@ NS_IMETHODIMP nsImageLoader::OnStartContainer(imgIRequest *aRequest,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStartFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnDataAvailable(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect)
|
||||
{
|
||||
// Background images are not displayed incrementally, they are displayed after the entire
|
||||
// image has been loaded.
|
||||
// Note: Images referenced by the <img> element are displayed incrementally in nsImageFrame.cpp
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStopFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
@@ -208,25 +182,6 @@ NS_IMETHODIMP nsImageLoader::OnStopFrame(imgIRequest *aRequest,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStopContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStopDecode(imgIRequest *aRequest,
|
||||
nsresult status,
|
||||
const PRUnichar *statusArg)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::OnStopRequest(imgIRequest *aRequest,
|
||||
PRBool aLastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer,
|
||||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/* class to notify frames of background image loads */
|
||||
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
|
||||
class nsPresContext;
|
||||
class nsIFrame;
|
||||
@@ -48,15 +48,26 @@ class nsIURI;
|
||||
#include "imgIRequest.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsImageLoader : public imgIDecoderObserver
|
||||
class nsImageLoader : public nsStubImageDecoderObserver
|
||||
{
|
||||
public:
|
||||
nsImageLoader();
|
||||
virtual ~nsImageLoader();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
|
||||
// imgIDecoderObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);
|
||||
NS_IMETHOD OnStopFrame(imgIRequest *aRequest, gfxIImageFrame *aFrame);
|
||||
// Do not override OnDataAvailable since background images are not
|
||||
// displayed incrementally; they are displayed after the entire image
|
||||
// has been loaded.
|
||||
// Note: Images referenced by the <img> element are displayed
|
||||
// incrementally in nsImageFrame.cpp.
|
||||
|
||||
// imgIContainerObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD FrameChanged(imgIContainer *aContainer, gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect);
|
||||
|
||||
void Init(nsIFrame *aFrame, nsPresContext *aPresContext);
|
||||
nsresult Load(imgIRequest *aImage);
|
||||
|
||||
@@ -61,21 +61,28 @@
|
||||
|
||||
#include "imgILoader.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
class nsBulletListener : public imgIDecoderObserver
|
||||
class nsBulletListener : public nsStubImageDecoderObserver
|
||||
{
|
||||
public:
|
||||
nsBulletListener();
|
||||
virtual ~nsBulletListener();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
// imgIDecoderObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);
|
||||
NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect);
|
||||
NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status,
|
||||
const PRUnichar *statusArg);
|
||||
// imgIContainerObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD FrameChanged(imgIContainer *aContainer, gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect);
|
||||
|
||||
void SetFrame(nsBulletFrame *frame) { mFrame = frame; }
|
||||
|
||||
@@ -84,10 +91,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
nsBulletFrame::~nsBulletFrame()
|
||||
{
|
||||
}
|
||||
@@ -1775,16 +1778,6 @@ nsBulletListener::~nsBulletListener()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStartRequest(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStartDecode(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStartContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
@@ -1794,12 +1787,6 @@ NS_IMETHODIMP nsBulletListener::OnStartContainer(imgIRequest *aRequest,
|
||||
return mFrame->OnStartContainer(aRequest, aImage);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStartFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnDataAvailable(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect)
|
||||
@@ -1810,18 +1797,6 @@ NS_IMETHODIMP nsBulletListener::OnDataAvailable(imgIRequest *aRequest,
|
||||
return mFrame->OnDataAvailable(aRequest, aFrame, aRect);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStopFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStopContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStopDecode(imgIRequest *aRequest,
|
||||
nsresult status,
|
||||
const PRUnichar *statusArg)
|
||||
@@ -1832,12 +1807,6 @@ NS_IMETHODIMP nsBulletListener::OnStopDecode(imgIRequest *aRequest,
|
||||
return mFrame->OnStopDecode(aRequest, status, statusArg);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::OnStopRequest(imgIRequest *aRequest,
|
||||
PRBool aLastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBulletListener::FrameChanged(imgIContainer *aContainer,
|
||||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
|
||||
@@ -2033,17 +2033,6 @@ nsImageListener::~nsImageListener()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStartRequest(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStartDecode(imgIRequest *aRequest)
|
||||
{
|
||||
// Not useful to us yet.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStartContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
@@ -2053,13 +2042,6 @@ NS_IMETHODIMP nsImageListener::OnStartContainer(imgIRequest *aRequest,
|
||||
return mFrame->OnStartContainer(aRequest, aImage);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStartFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
// Not useful to us yet.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnDataAvailable(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect)
|
||||
@@ -2070,20 +2052,6 @@ NS_IMETHODIMP nsImageListener::OnDataAvailable(imgIRequest *aRequest,
|
||||
return mFrame->OnDataAvailable(aRequest, aFrame, aRect);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStopFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
// Not useful to us yet.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStopContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
// Not useful to us yet.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStopDecode(imgIRequest *aRequest,
|
||||
nsresult status,
|
||||
const PRUnichar *statusArg)
|
||||
@@ -2094,12 +2062,6 @@ NS_IMETHODIMP nsImageListener::OnStopDecode(imgIRequest *aRequest,
|
||||
return mFrame->OnStopDecode(aRequest, status, statusArg);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::OnStopRequest(imgIRequest *aRequest,
|
||||
PRBool aLastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageListener::FrameChanged(imgIContainer *aContainer,
|
||||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
|
||||
@@ -50,8 +50,7 @@
|
||||
|
||||
#include "nsTransform2D.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "imgIContainerObserver.h"
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
|
||||
class nsIFrame;
|
||||
class nsImageMap;
|
||||
@@ -64,15 +63,22 @@ class nsDisplayImage;
|
||||
|
||||
class nsImageFrame;
|
||||
|
||||
class nsImageListener : public imgIDecoderObserver
|
||||
class nsImageListener : public nsStubImageDecoderObserver
|
||||
{
|
||||
public:
|
||||
nsImageListener(nsImageFrame *aFrame);
|
||||
virtual ~nsImageListener();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
// imgIDecoderObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);
|
||||
NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect);
|
||||
NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status,
|
||||
const PRUnichar *statusArg);
|
||||
// imgIContainerObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD FrameChanged(imgIContainer *aContainer, gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect);
|
||||
|
||||
void SetFrame(nsImageFrame *frame) { mFrame = frame; }
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "nsIDOMSVGPresAspectRatio.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "gfxIImageFrame.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
#include "nsImageLoadingContent.h"
|
||||
#include "nsIDOMSVGImageElement.h"
|
||||
#include "nsSVGElement.h"
|
||||
@@ -54,15 +54,19 @@
|
||||
|
||||
class nsSVGImageFrame;
|
||||
|
||||
class nsSVGImageListener : public imgIDecoderObserver
|
||||
class nsSVGImageListener : public nsStubImageDecoderObserver
|
||||
{
|
||||
public:
|
||||
nsSVGImageListener(nsSVGImageFrame *aFrame);
|
||||
virtual ~nsSVGImageListener();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
// imgIDecoderObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status,
|
||||
const PRUnichar *statusArg);
|
||||
// imgIContainerObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD FrameChanged(imgIContainer *aContainer, gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect);
|
||||
|
||||
void SetFrame(nsSVGImageFrame *frame) { mFrame = frame; }
|
||||
|
||||
@@ -536,47 +540,6 @@ nsSVGImageListener::~nsSVGImageListener()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStartRequest(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStartDecode(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStartContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStartFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnDataAvailable(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStopFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStopContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStopDecode(imgIRequest *aRequest,
|
||||
nsresult status,
|
||||
const PRUnichar *statusArg)
|
||||
@@ -589,12 +552,6 @@ NS_IMETHODIMP nsSVGImageListener::OnStopDecode(imgIRequest *aRequest,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::OnStopRequest(imgIRequest *aRequest,
|
||||
PRBool aLastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsSVGImageListener::FrameChanged(imgIContainer *aContainer,
|
||||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
|
||||
@@ -593,16 +593,6 @@ nsImageBoxListener::~nsImageBoxListener()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnStartRequest(imgIRequest *request)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnStartDecode(imgIRequest *request)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnStartContainer(imgIRequest *request,
|
||||
imgIContainer *image)
|
||||
{
|
||||
@@ -612,25 +602,6 @@ NS_IMETHODIMP nsImageBoxListener::OnStartContainer(imgIRequest *request,
|
||||
return mFrame->OnStartContainer(request, image);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnStartFrame(imgIRequest *request,
|
||||
gfxIImageFrame *frame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnDataAvailable(imgIRequest *request,
|
||||
gfxIImageFrame *frame,
|
||||
const nsRect * rect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnStopFrame(imgIRequest *request,
|
||||
gfxIImageFrame *frame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnStopContainer(imgIRequest *request,
|
||||
imgIContainer *image)
|
||||
{
|
||||
@@ -650,12 +621,6 @@ NS_IMETHODIMP nsImageBoxListener::OnStopDecode(imgIRequest *request,
|
||||
return mFrame->OnStopDecode(request, status, statusArg);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::OnStopRequest(imgIRequest *request,
|
||||
PRBool lastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImageBoxListener::FrameChanged(imgIContainer *container,
|
||||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
|
||||
@@ -42,19 +42,25 @@
|
||||
#include "imgILoader.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
|
||||
class nsImageBoxFrame;
|
||||
|
||||
class nsImageBoxListener : public imgIDecoderObserver
|
||||
class nsImageBoxListener : public nsStubImageDecoderObserver
|
||||
{
|
||||
public:
|
||||
nsImageBoxListener();
|
||||
virtual ~nsImageBoxListener();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
// imgIDecoderObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD OnStartContainer(imgIRequest *request, imgIContainer *image);
|
||||
NS_IMETHOD OnStopContainer(imgIRequest *request, imgIContainer *image);
|
||||
NS_IMETHOD OnStopDecode(imgIRequest *request, nsresult status,
|
||||
const PRUnichar *statusArg);
|
||||
// imgIContainerObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD FrameChanged(imgIContainer *container, gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect);
|
||||
|
||||
void SetFrame(nsImageBoxFrame *frame) { mFrame = frame; }
|
||||
|
||||
|
||||
@@ -55,16 +55,6 @@ nsTreeImageListener::~nsTreeImageListener()
|
||||
delete mInvalidationArea;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStartRequest(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStartDecode(imgIRequest *aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStartContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
@@ -73,12 +63,6 @@ NS_IMETHODIMP nsTreeImageListener::OnStartContainer(imgIRequest *aRequest,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStartFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnDataAvailable(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect)
|
||||
@@ -87,31 +71,6 @@ NS_IMETHODIMP nsTreeImageListener::OnDataAvailable(imgIRequest *aRequest,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStopFrame(imgIRequest *aRequest,
|
||||
gfxIImageFrame *aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStopContainer(imgIRequest *aRequest,
|
||||
imgIContainer *aImage)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStopDecode(imgIRequest *aRequest,
|
||||
nsresult status,
|
||||
const PRUnichar *statusArg)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::OnStopRequest(imgIRequest *aRequest,
|
||||
PRBool aLastPart)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsTreeImageListener::FrameChanged(imgIContainer *aContainer,
|
||||
gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsITreeColumns.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
#include "nsStubImageDecoderObserver.h"
|
||||
|
||||
class nsITreeBoxObject;
|
||||
|
||||
@@ -63,15 +63,20 @@ public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsITreeImageListener, NS_ITREEIMAGELISTENER_IID)
|
||||
|
||||
// This class handles image load observation.
|
||||
class nsTreeImageListener : public imgIDecoderObserver, public nsITreeImageListener
|
||||
class nsTreeImageListener : public nsStubImageDecoderObserver, public nsITreeImageListener
|
||||
{
|
||||
public:
|
||||
nsTreeImageListener(nsITreeBoxObject* aTree);
|
||||
~nsTreeImageListener();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
NS_DECL_IMGICONTAINEROBSERVER
|
||||
// imgIDecoderObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);
|
||||
NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, gfxIImageFrame *aFrame,
|
||||
const nsRect *aRect);
|
||||
// imgIContainerObserver (override nsStubImageDecoderObserver)
|
||||
NS_IMETHOD FrameChanged(imgIContainer *aContainer, gfxIImageFrame *newframe,
|
||||
nsRect * dirtyRect);
|
||||
|
||||
NS_IMETHOD AddCell(PRInt32 aIndex, nsITreeColumn* aCol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user