Remove staging SkStream::unref().

SkStream::unref() was added to ease transitioning off of SkStream
deriving from SkRefCnt. It is no longer needed, remove it.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/861413002
This commit is contained in:
bungeman 2015-01-22 06:08:31 -08:00 committed by Commit bot
parent faff2c4598
commit 2dca817edb
4 changed files with 10 additions and 18 deletions

View File

@ -40,14 +40,6 @@ class SK_API SkStream : public SkNoncopyable {
public: public:
virtual ~SkStream() {} virtual ~SkStream() {}
/**
* @deprecated
* SkStream is no longer ref counted, but we leave this here for staging.
*/
void unref() {
SkDebugf("SkStream is no longer ref counted!");
}
/** /**
* Attempts to open the specified file, and return a stream to it (using * Attempts to open the specified file, and return a stream to it (using
* mmap if available). On success, the caller is responsible for deleting. * mmap if available). On success, the caller is responsible for deleting.

View File

@ -80,15 +80,15 @@ public:
class SkIStream : public SkBaseIStream { class SkIStream : public SkBaseIStream {
private: private:
SkStream *fSkStream; SkStream *fSkStream;
bool fUnrefOnRelease; bool fDeleteOnRelease;
ULARGE_INTEGER fLocation; ULARGE_INTEGER fLocation;
SkIStream(SkStream* stream, bool unrefOnRelease); SkIStream(SkStream* stream, bool fDeleteOnRelease);
virtual ~SkIStream(); virtual ~SkIStream();
public: public:
HRESULT static CreateFromSkStream(SkStream* stream HRESULT static CreateFromSkStream(SkStream* stream
, bool unrefOnRelease , bool fDeleteOnRelease
, IStream ** ppStream); , IStream ** ppStream);
virtual HRESULT STDMETHODCALLTYPE Read(void* pv, ULONG cb, ULONG* pcbRead); virtual HRESULT STDMETHODCALLTYPE Read(void* pv, ULONG cb, ULONG* pcbRead);

View File

@ -103,7 +103,7 @@ bool SkDWriteFontFileStream::move(long offset) {
} }
SkDWriteFontFileStream* SkDWriteFontFileStream::fork() const { SkDWriteFontFileStream* SkDWriteFontFileStream::fork() const {
SkAutoTUnref<SkDWriteFontFileStream> that(this->duplicate()); SkAutoTDelete<SkDWriteFontFileStream> that(this->duplicate());
that->seek(fPos); that->seek(fPos);
return that.detach(); return that.detach();
} }

View File

@ -103,29 +103,29 @@ HRESULT STDMETHODCALLTYPE SkBaseIStream::Stat(STATSTG* pStatstg
/** /**
* SkIStream * SkIStream
*/ */
SkIStream::SkIStream(SkStream* stream, bool unrefOnRelease) SkIStream::SkIStream(SkStream* stream, bool deleteOnRelease)
: SkBaseIStream() : SkBaseIStream()
, fSkStream(stream) , fSkStream(stream)
, fUnrefOnRelease(unrefOnRelease) , fDeleteOnRelease(deleteOnRelease)
, fLocation() , fLocation()
{ {
this->fSkStream->rewind(); this->fSkStream->rewind();
} }
SkIStream::~SkIStream() { SkIStream::~SkIStream() {
if (this->fSkStream && fUnrefOnRelease) { if (this->fSkStream && fDeleteOnRelease) {
this->fSkStream->unref(); delete this->fSkStream;
} }
} }
HRESULT SkIStream::CreateFromSkStream(SkStream* stream HRESULT SkIStream::CreateFromSkStream(SkStream* stream
, bool unrefOnRelease , bool deleteOnRelease
, IStream ** ppStream) , IStream ** ppStream)
{ {
if (NULL == stream) { if (NULL == stream) {
return E_INVALIDARG; return E_INVALIDARG;
} }
*ppStream = new SkIStream(stream, unrefOnRelease); *ppStream = new SkIStream(stream, deleteOnRelease);
return S_OK; return S_OK;
} }