Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Unified Diff: core/src/fxcrt/extension.h

Issue 1458373002: Merge to XFA: Add more overrides. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxcrt/extension.h
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index 038fa30e70e85beafca25f6bb9fc021a11bf114a..718c8f0423d451e3e125ad45e7542722ed2c790a 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -136,23 +136,23 @@ class CFX_MemoryStream final : public IFX_MemoryStream {
}
m_Blocks.RemoveAll();
}
- virtual IFX_FileStream* Retain() override {
+
+ // IFX_MemoryStream:
+ IFX_FileStream* Retain() override {
m_dwCount++;
return this;
}
- virtual void Release() override {
+ void Release() override {
FX_DWORD nCount = --m_dwCount;
if (nCount) {
return;
}
delete this;
}
- virtual FX_FILESIZE GetSize() override { return (FX_FILESIZE)m_nCurSize; }
- virtual FX_BOOL IsEOF() override { return m_nCurPos >= (size_t)GetSize(); }
- virtual FX_FILESIZE GetPosition() override { return (FX_FILESIZE)m_nCurPos; }
- virtual FX_BOOL ReadBlock(void* buffer,
- FX_FILESIZE offset,
- size_t size) override {
+ FX_FILESIZE GetSize() override { return (FX_FILESIZE)m_nCurSize; }
+ FX_BOOL IsEOF() override { return m_nCurPos >= (size_t)GetSize(); }
+ FX_FILESIZE GetPosition() override { return (FX_FILESIZE)m_nCurPos; }
+ FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override {
if (!buffer || !size) {
return FALSE;
}
@@ -185,7 +185,7 @@ class CFX_MemoryStream final : public IFX_MemoryStream {
}
return TRUE;
}
- virtual size_t ReadBlock(void* buffer, size_t size) override {
+ size_t ReadBlock(void* buffer, size_t size) override {
if (m_nCurPos >= m_nCurSize) {
return 0;
}
@@ -195,9 +195,9 @@ class CFX_MemoryStream final : public IFX_MemoryStream {
}
return nRead;
}
- virtual FX_BOOL WriteBlock(const void* buffer,
- FX_FILESIZE offset,
- size_t size) override {
+ FX_BOOL WriteBlock(const void* buffer,
+ FX_FILESIZE offset,
+ size_t size) override {
if (!buffer || !size) {
return FALSE;
}
@@ -255,11 +255,11 @@ class CFX_MemoryStream final : public IFX_MemoryStream {
}
return TRUE;
}
- virtual FX_BOOL Flush() override { return TRUE; }
- virtual FX_BOOL IsConsecutive() const override {
+ FX_BOOL Flush() override { return TRUE; }
+ FX_BOOL IsConsecutive() const override {
return m_dwFlags & FX_MEMSTREAM_Consecutive;
}
- virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) override {
+ void EstimateSize(size_t nInitSize, size_t nGrowSize) override {
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
if (m_Blocks.GetSize() < 1) {
uint8_t* pBlock = FX_Alloc(uint8_t, FX_MAX(nInitSize, 4096));
@@ -270,12 +270,12 @@ class CFX_MemoryStream final : public IFX_MemoryStream {
m_nGrowSize = FX_MAX(nGrowSize, 4096);
}
}
- virtual uint8_t* GetBuffer() const override {
+ uint8_t* GetBuffer() const override {
return m_Blocks.GetSize() ? (uint8_t*)m_Blocks[0] : NULL;
}
- virtual void AttachBuffer(uint8_t* pBuffer,
- size_t nSize,
- FX_BOOL bTakeOver = FALSE) override {
+ void AttachBuffer(uint8_t* pBuffer,
+ size_t nSize,
+ FX_BOOL bTakeOver = FALSE) override {
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;
}
@@ -286,7 +286,7 @@ class CFX_MemoryStream final : public IFX_MemoryStream {
m_dwFlags =
FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
}
- virtual void DetachBuffer() override {
+ void DetachBuffer() override {
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698