Bug 513681 - part 17 - remove imgIDecoder.r=joe,sr=shaver,a=blocker

This commit is contained in:
Bobby Holley 2010-08-22 22:30:46 -04:00
Родитель f749f8df22
Коммит 8d670545c2
8 изменённых файлов: 5 добавлений и 152 удалений

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

@ -51,7 +51,6 @@ XPIDLSRCS = \
imgICache.idl \
imgIContainer.idl \
imgIContainerObserver.idl \
imgIDecoder.idl \
imgIDecoderObserver.idl \
imgIEncoder.idl \
imgILoader.idl \

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

@ -1,105 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** 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 mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
* Bobby Holley <bobbyholley@gmail.com>
*
* 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 "nsISupports.idl"
interface nsIInputStream;
interface imgIContainer;
interface imgIDecoderObserver;
/**
* imgIDecoder interface
*
* @author Stuart Parmenter <pavlov@netscape.com>
* @version 0.2
* @see imagelib2
*/
[scriptable, uuid(6fc61088-5443-4539-9e24-629a266a800a)]
interface imgIDecoder : nsISupports
{
/**
* Initialize an image decoder.
* @param aContainer The image container to decode to.
* @param aObserver The observer for decode notification events.
* @param aFlags Flags for the decoder
*
* @note The decoder should always pass NULL as the
* first two parameters to all of the imgIDecoderObserver APIs.
*/
void init(in imgIContainer aImage, in imgIDecoderObserver aObserver,
in unsigned long aFlags);
/**
* Closes the stream.
* @param aFlags Close flags of the CLOSE_FLAG_* Variety
*
* Resources are always freed with this call. If notifications are sent,
* OnStopDecode is guaranteed to be called if it hasn't been called already.
*
* CLOSE_FLAG_DONTNOTIFY - Don't send any observer notifications, and don't
* call imgIContainer::decodingComplete().
*/
const long CLOSE_FLAG_DONTNOTIFY = 0x01;
void close(in PRUint32 aFlags);
/**
* Flushes the stream.
*/
void flush();
/**
* Writes data to the decoder.
*
* For Header-Only decodes, OnStartContainer is the only notification
* fired. It is an error to write any more data to the decoder for header-only
* decodes after SetSize() has been called.
*
* If a decoding error occurs, an internal flag is set and an error is
* returned. Each subsequent call to write will fail immediately
* for the lifetime of the decoder. Shutdown notifications of the OnStopX
* variety, as well as DecodingComplete(), are guaranteed not to be called
* if a decoding error occurs.
*
* @param aBuffer buffer containing the data to be written
* @param aCount the number of bytes to write
*/
void write(in string aBuffer, in unsigned long count);
};

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

@ -41,34 +41,6 @@
namespace mozilla {
namespace imagelib {
// XXX - This goes away when we stop implementing imgIDecoder
NS_IMPL_ISUPPORTS1(Decoder, imgIDecoder)
/*
* Translation layer from imgIDecoder to the interface we're actually going to use.
*/
NS_IMETHODIMP
Decoder::Init(imgIContainer *aImage,
imgIDecoderObserver *aObserver,
PRUint32 aFlags)
{
NS_ABORT_IF_FALSE(aImage->GetType() == imgIContainer::TYPE_RASTER,
"wrong type of imgIContainer for decoding into");
return Init(static_cast<RasterImage*>(aImage), aObserver, aFlags);
}
NS_IMETHODIMP
Decoder::Close(PRUint32 aFlags)
{
NS_ABORT_IF_FALSE(0, "Not reached!");
return NS_OK;
}
NS_IMETHODIMP Decoder::Flush()
{
return NS_OK;
}
Decoder::Decoder()
: mFrameCount(0)
, mInitialized(false)
@ -106,8 +78,7 @@ Decoder::Init(RasterImage* aImage, imgIDecoderObserver* aObserver)
return rv;
}
// XXX - This should stop being an IMETHODIMP when we stop inheriting imgIDecoder
NS_IMETHODIMP
nsresult
Decoder::Write(const char* aBuffer, PRUint32 aCount)
{
// Pass the data along to the implementation

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

@ -42,20 +42,14 @@
#include "RasterImage.h"
#include "imgIDecoderObserver.h"
#include "imgIDecoder.h"
namespace mozilla {
namespace imagelib {
// XXX - We temporarily inherit imgIDecoder
class Decoder : public imgIDecoder
class Decoder
{
public:
// XXX - We should get rid of these when westop inheriting imgIDecoder
NS_DECL_ISUPPORTS
NS_DECL_IMGIDECODER
Decoder();
virtual ~Decoder();
@ -83,9 +77,7 @@ public:
*
* Notifications Sent: TODO
*/
// This is commented out while we inherit imgIDecoder because the signature
// is the same as the one in the idl.
// nsresult Write(const char* aBuffer, PRUint32 aCount);
nsresult Write(const char* aBuffer, PRUint32 aCount);
/**
* Informs the decoder that all the data has been written.
@ -95,8 +87,7 @@ public:
nsresult Finish();
// We're not COM-y, so we don't get refcounts by default
// XXX - This is uncommented in a later patch when we stop inheriting imgIDecoder
// NS_INLINE_DECL_REFCOUNTING(Decoder)
NS_INLINE_DECL_REFCOUNTING(Decoder)
/*
* State.

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

@ -45,7 +45,7 @@
#include "nsComponentManagerUtils.h"
#include "imgIContainerObserver.h"
#include "ImageErrors.h"
#include "imgIDecoder.h"
#include "Decoder.h"
#include "imgIDecoderObserver.h"
#include "RasterImage.h"
#include "nsIInterfaceRequestor.h"

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

@ -41,7 +41,6 @@
#ifndef imgRequest_h__
#define imgRequest_h__
#include "imgIDecoder.h"
#include "imgIDecoderObserver.h"
#include "nsIChannelEventSink.h"

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

@ -44,7 +44,6 @@
#include "imgIDecoderObserver.h"
#include "nsISecurityInfoProvider.h"
#include "imgIDecoder.h"
#include "nsIRequestObserver.h"
#include "nsIChannel.h"
#include "nsILoadGroup.h"

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

@ -41,7 +41,6 @@
#include "nsString.h"
#include "ImageErrors.h"
#include "imgIContainer.h"
#include "imgIDecoder.h"
#include "imgIEncoder.h"
#include "imgIDecoderObserver.h"
#include "imgIContainerObserver.h"