summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-13 14:57:29 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-13 14:57:29 -0700
commit868150bd69f0f1f9472affc20deea0a9341bf22b (patch)
tree07ebd9327583ecc20ebb43b800c2f36501a80068 /core/fpdfapi/fpdf_parser
parent82e24b1c5047076b982c073671315071760b9880 (diff)
downloadpdfium-868150bd69f0f1f9472affc20deea0a9341bf22b.tar.xz
Make code compile with clang_use_chrome_plugin (part I)
This change contains files in core/fpdfapi directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2060973002
Diffstat (limited to 'core/fpdfapi/fpdf_parser')
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp6
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.h4
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp7
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_hint_tables.h6
4 files changed, 15 insertions, 8 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
index 9018f06399..6f8f9ee1a6 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
@@ -835,6 +835,10 @@ IPDF_DataAvail::DocLinearizationStatus CPDF_DataAvail::IsLinearizedPDF() {
return NotLinearized;
}
+FX_BOOL CPDF_DataAvail::IsLinearized() {
+ return m_bLinearized;
+}
+
FX_BOOL CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, uint32_t dwLen) {
if (m_pLinearized)
return m_bLinearized;
@@ -969,7 +973,7 @@ int32_t CPDF_DataAvail::CheckCrossRefStream(
return 0;
}
-inline void CPDF_DataAvail::SetStartOffset(FX_FILESIZE dwOffset) {
+void CPDF_DataAvail::SetStartOffset(FX_FILESIZE dwOffset) {
m_Pos = dwOffset;
}
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.h b/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
index f7da8f0d22..553489a267 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
@@ -56,13 +56,13 @@ class CPDF_DataAvail final : public IPDF_DataAvail {
FX_BOOL bSupportHintTable);
~CPDF_DataAvail() override;
- // IPDF_DataAvail:
+ // IPDF_DataAvail
DocAvailStatus IsDocAvail(DownloadHints* pHints) override;
void SetDocument(CPDF_Document* pDoc) override;
DocAvailStatus IsPageAvail(int iPage, DownloadHints* pHints) override;
DocFormStatus IsFormAvail(DownloadHints* pHints) override;
DocLinearizationStatus IsLinearizedPDF() override;
- FX_BOOL IsLinearized() override { return m_bLinearized; }
+ FX_BOOL IsLinearized() override;
void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, uint32_t* pSize) override;
int GetPageCount() const;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
index 3e08ead9ff..8f810aa888 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
@@ -23,6 +23,13 @@ bool CanReadFromBitStream(const CFX_BitStream* hStream,
} // namespace
+CPDF_HintTables::CPDF_HintTables(CPDF_DataAvail* pDataAvail,
+ CPDF_Dictionary* pLinearized)
+ : m_pDataAvail(pDataAvail),
+ m_pLinearizedDict(pLinearized),
+ m_nFirstPageSharedObjs(0),
+ m_szFirstPageObjOffset(0) {}
+
CPDF_HintTables::~CPDF_HintTables() {
m_dwDeltaNObjsArray.RemoveAll();
m_dwNSharedObjsArray.RemoveAll();
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
index 33b6b39323..4436339e82 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
@@ -20,11 +20,7 @@ class CPDF_Stream;
class CPDF_HintTables {
public:
- CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Dictionary* pLinearized)
- : m_pDataAvail(pDataAvail),
- m_pLinearizedDict(pLinearized),
- m_nFirstPageSharedObjs(0),
- m_szFirstPageObjOffset(0) {}
+ CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Dictionary* pLinearized);
~CPDF_HintTables();
FX_BOOL GetPagePos(int index,