summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-11 21:28:38 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-11 21:28:38 +0000
commit731526e3b9f32ceac1cdac600fe3ecd55a0bc9b5 (patch)
tree7606b1ec1ad1e4c15136515958a22e0e3fbdfb0a /core/fpdfapi
parent92c8b1a07b01f428ec3f2b6d04acc109bfdeb3da (diff)
downloadpdfium-731526e3b9f32ceac1cdac600fe3ecd55a0bc9b5.tar.xz
Move some GetDict() calls out of header files.
Change-Id: I13b297ddb080b478a30a959889941b46feb363b3 Reviewed-on: https://pdfium-review.googlesource.com/20770 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_image.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_image.h4
-rw-r--r--core/fpdfapi/parser/cpdf_stream_acc.cpp12
-rw-r--r--core/fpdfapi/parser/cpdf_stream_acc.h4
4 files changed, 14 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index d722c22fb5..5221fd73be 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -71,6 +71,10 @@ void CPDF_Image::ConvertStreamToIndirectObject() {
m_pDocument->AddIndirectObject(m_pStream.Release());
}
+CPDF_Dictionary* CPDF_Image::GetDict() const {
+ return m_pStream ? m_pStream->GetDict() : nullptr;
+}
+
std::unique_ptr<CPDF_Dictionary> CPDF_Image::InitJPEG(uint8_t* pData,
uint32_t size) {
int32_t width;
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index a499932c4b..23864bbf6c 100644
--- a/core/fpdfapi/page/cpdf_image.h
+++ b/core/fpdfapi/page/cpdf_image.h
@@ -31,9 +31,7 @@ class CPDF_Image : public Retainable {
CPDF_Dictionary* GetInlineDict() const { return m_pDict.Get(); }
CPDF_Stream* GetStream() const { return m_pStream.Get(); }
- CPDF_Dictionary* GetDict() const {
- return m_pStream ? m_pStream->GetDict() : nullptr;
- }
+ CPDF_Dictionary* GetDict() const;
CPDF_Dictionary* GetOC() const { return m_pOC.Get(); }
CPDF_Document* GetDocument() const { return m_pDocument.Get(); }
diff --git a/core/fpdfapi/parser/cpdf_stream_acc.cpp b/core/fpdfapi/parser/cpdf_stream_acc.cpp
index 91d458f9a7..b539117bd3 100644
--- a/core/fpdfapi/parser/cpdf_stream_acc.cpp
+++ b/core/fpdfapi/parser/cpdf_stream_acc.cpp
@@ -16,6 +16,12 @@ CPDF_StreamAcc::CPDF_StreamAcc(const CPDF_Stream* pStream)
m_pStream(pStream),
m_pSrcData(nullptr) {}
+CPDF_StreamAcc::~CPDF_StreamAcc() {
+ if (m_bNewBuf)
+ FX_Free(m_pData);
+ FX_Free(m_pSrcData);
+}
+
void CPDF_StreamAcc::LoadAllData(bool bRawAccess,
uint32_t estimated_size,
bool bImageAcc) {
@@ -54,10 +60,8 @@ void CPDF_StreamAcc::LoadAllData(bool bRawAccess,
m_bNewBuf = m_pData != m_pStream->GetRawData();
}
-CPDF_StreamAcc::~CPDF_StreamAcc() {
- if (m_bNewBuf)
- FX_Free(m_pData);
- FX_Free(m_pSrcData);
+CPDF_Dictionary* CPDF_StreamAcc::GetDict() const {
+ return m_pStream ? m_pStream->GetDict() : nullptr;
}
const uint8_t* CPDF_StreamAcc::GetData() const {
diff --git a/core/fpdfapi/parser/cpdf_stream_acc.h b/core/fpdfapi/parser/cpdf_stream_acc.h
index c270285345..6a18c43975 100644
--- a/core/fpdfapi/parser/cpdf_stream_acc.h
+++ b/core/fpdfapi/parser/cpdf_stream_acc.h
@@ -28,9 +28,7 @@ class CPDF_StreamAcc : public Retainable {
bool bImageAcc = false);
const CPDF_Stream* GetStream() const { return m_pStream.Get(); }
- CPDF_Dictionary* GetDict() const {
- return m_pStream ? m_pStream->GetDict() : nullptr;
- }
+ CPDF_Dictionary* GetDict() const;
const uint8_t* GetData() const;
uint8_t* GetData();