summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-04 14:16:22 -0800
committerLei Zhang <thestig@chromium.org>2015-11-04 14:16:22 -0800
commit79f5a32175293620abe456554e10efb7c3f4e7c6 (patch)
treea6d9de63ae975548dacf1620a91f92ee9a6fb0a0
parent14e83759abec5eca9c4da0b4e8cd5969375a00f4 (diff)
downloadpdfium-79f5a32175293620abe456554e10efb7c3f4e7c6.tar.xz
Make checkdeps --resolve-dotdot succeed.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1419373005 .
-rw-r--r--DEPS2
-rw-r--r--core/include/fpdfapi/fpdf_parser.h35
-rw-r--r--core/include/fpdfapi/fpdf_render.h14
-rw-r--r--core/include/fxcodec/DEPS3
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp1
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp110
-rw-r--r--fpdfsdk/DEPS2
-rw-r--r--fpdfsdk/src/fpdf_dataavail.cpp24
-rw-r--r--fpdfsdk/src/fpdf_progressive.cpp11
-rw-r--r--public/DEPS8
-rw-r--r--public/fpdf_dataavail.h2
-rw-r--r--samples/DEPS2
-rw-r--r--testing/DEPS2
-rw-r--r--third_party/DEPS7
-rw-r--r--third_party/agg23/agg_rasterizer_scanline_aa.cpp1
-rw-r--r--third_party/agg23/agg_rasterizer_scanline_aa.h3
16 files changed, 156 insertions, 71 deletions
diff --git a/DEPS b/DEPS
index 56d303c626..bf1e65b4fb 100644
--- a/DEPS
+++ b/DEPS
@@ -34,6 +34,8 @@ deps_os = {
}
include_rules = [
+ # Basic stuff that everyone can use.
+ # Note: public is not here because core cannot depend on public.
'+testing',
'+third_party/base',
]
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index b7684e530a..d1f50038a7 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -7,7 +7,6 @@
#ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
#define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
-#include "../../../public/fpdf_dataavail.h"
#include "../../../third_party/base/nonstd_unique_ptr.h"
#include "../fxcrt/fx_system.h"
#include "fpdf_objects.h"
@@ -871,6 +870,34 @@ class IFX_DownloadHints {
class IPDF_DataAvail {
public:
+ // Must match PDF_DATA_* definitions in public/fpdf_dataavail.h, but cannot
+ // #include that header. fpdfsdk/src/fpdf_dataavail.cpp has static_asserts
+ // to make sure the two sets of values match.
+ enum DocAvailStatus {
+ DataError = -1, // PDF_DATA_ERROR
+ DataNotAvailable = 0, // PDF_DATA_NOTAVAIL
+ DataAvailable = 1, // PDF_DATA_AVAIL
+ };
+
+ // Must match PDF_*LINEAR* definitions in public/fpdf_dataavail.h, but cannot
+ // #include that header. fpdfsdk/src/fpdf_dataavail.cpp has static_asserts
+ // to make sure the two sets of values match.
+ enum DocLinearizationStatus {
+ LinearizationUnknown = -1, // PDF_LINEARIZATION_UNKNOWN
+ NotLinearized = 0, // PDF_NOT_LINEARIZED
+ Linearized = 1, // PDF_LINEARIZED
+ };
+
+ // Must match PDF_FORM_* definitions in public/fpdf_dataavail.h, but cannot
+ // #include that header. fpdfsdk/src/fpdf_dataavail.cpp has static_asserts
+ // to make sure the two sets of values match.
+ enum DocFormStatus {
+ FormError = -1, // PDF_FORM_ERROR
+ FormNotAvailable = 0, // PDF_FORM_NOTAVAIL
+ FormAvailable = 1, // PDF_FORM_AVAIL
+ FormNotExist = 2, // PDF_FORM_NOTEXIST
+ };
+
static IPDF_DataAvail* Create(IFX_FileAvail* pFileAvail,
IFX_FileRead* pFileRead);
virtual ~IPDF_DataAvail() {}
@@ -878,12 +905,12 @@ class IPDF_DataAvail {
IFX_FileAvail* GetFileAvail() const { return m_pFileAvail; }
IFX_FileRead* GetFileRead() const { return m_pFileRead; }
- virtual int IsDocAvail(IFX_DownloadHints* pHints) = 0;
+ virtual DocAvailStatus IsDocAvail(IFX_DownloadHints* pHints) = 0;
virtual void SetDocument(CPDF_Document* pDoc) = 0;
virtual int IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
virtual FX_BOOL IsLinearized() = 0;
- virtual int IsFormAvail(IFX_DownloadHints* pHints) = 0;
- virtual int IsLinearizedPDF() = 0;
+ virtual DocFormStatus IsFormAvail(IFX_DownloadHints* pHints) = 0;
+ virtual DocLinearizationStatus IsLinearizedPDF() = 0;
virtual void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos,
FX_DWORD* pSize) = 0;
diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h
index 3c1d95aa8a..7a5251e86e 100644
--- a/core/include/fpdfapi/fpdf_render.h
+++ b/core/include/fpdfapi/fpdf_render.h
@@ -8,7 +8,6 @@
#define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_
#include "../../../third_party/base/nonstd_unique_ptr.h"
-#include "../../../public/fpdf_progressive.h"
#include "../fxge/fx_ge.h"
#include "fpdf_page.h"
@@ -134,13 +133,16 @@ class CPDF_RenderContext {
class CPDF_ProgressiveRenderer {
public:
- // Must match FDF_RENDER_* definitions in fpdf_progressive.h.
+ // Must match FDF_RENDER_* definitions in public/fpdf_progressive.h, but
+ // cannot #include that header. fpdfsdk/src/fpdf_progressive.cpp has
+ // static_asserts to make sure the two sets of values match.
enum Status {
- Ready = FPDF_RENDER_READER,
- ToBeContinued = FPDF_RENDER_TOBECOUNTINUED,
- Done = FPDF_RENDER_DONE,
- Failed = FPDF_RENDER_FAILED
+ Ready, // FPDF_RENDER_READER
+ ToBeContinued, // FPDF_RENDER_TOBECOUNTINUED
+ Done, // FPDF_RENDER_DONE
+ Failed // FPDF_RENDER_FAILED
};
+
static int ToFPDFStatus(Status status) { return static_cast<int>(status); }
CPDF_ProgressiveRenderer(CPDF_RenderContext* pContext,
diff --git a/core/include/fxcodec/DEPS b/core/include/fxcodec/DEPS
new file mode 100644
index 0000000000..548eb61a3b
--- /dev/null
+++ b/core/include/fxcodec/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ '+third_party/zlib_v128/zlib.h',
+]
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
index 3da522da4e..bcade63831 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
@@ -5,7 +5,6 @@
#include <cstring>
#include <string>
-#include "../../../../public/fpdfview.h"
#include "../../../../testing/fx_string_testhelpers.h"
#include "../../../include/fpdfapi/fpdf_parser.h"
#include "../../../include/fxcrt/fx_basic.h"
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index db0e8b19e1..7db97d25b3 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -2678,19 +2678,15 @@ class CPDF_DataAvail final : public IPDF_DataAvail {
FX_BOOL bSupportHintTable);
~CPDF_DataAvail() override;
- int IsDocAvail(IFX_DownloadHints* pHints) override;
-
+ // IPDF_DataAvail:
+ DocAvailStatus IsDocAvail(IFX_DownloadHints* pHints) override;
void SetDocument(CPDF_Document* pDoc) override;
-
int IsPageAvail(int iPage, IFX_DownloadHints* pHints) override;
-
- int IsFormAvail(IFX_DownloadHints* pHints) override;
-
- int IsLinearizedPDF() override;
-
+ DocFormStatus IsFormAvail(IFX_DownloadHints* pHints) override;
+ DocLinearizationStatus IsLinearizedPDF() override;
FX_BOOL IsLinearized() override { return m_bLinearized; }
-
void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, FX_DWORD* pSize) override;
+
int GetPageCount() const;
CPDF_Dictionary* GetPage(int index);
@@ -3080,20 +3076,23 @@ FX_BOOL CPDF_DataAvail::IsObjectsAvail(CFX_PtrArray& obj_array,
obj_array.Append(new_obj_array);
return IsObjectsAvail(obj_array, FALSE, pHints, ret_array);
}
-int CPDF_DataAvail::IsDocAvail(IFX_DownloadHints* pHints) {
+
+IPDF_DataAvail::DocAvailStatus CPDF_DataAvail::IsDocAvail(
+ IFX_DownloadHints* pHints) {
if (!m_dwFileLen && m_pFileRead) {
m_dwFileLen = (FX_DWORD)m_pFileRead->GetSize();
if (!m_dwFileLen) {
- return PDF_DATA_ERROR;
+ return DataError;
}
}
while (!m_bDocAvail) {
if (!CheckDocStatus(pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
}
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
+
FX_BOOL CPDF_DataAvail::CheckAcroFormSubObject(IFX_DownloadHints* pHints) {
if (!m_objs_array.GetSize()) {
m_objs_array.RemoveAll();
@@ -3644,24 +3643,24 @@ CPDF_Object* CPDF_DataAvail::ParseIndirectObjectAt(
m_syntaxParser.RestorePos(SavedPos);
return pObj;
}
-int CPDF_DataAvail::IsLinearizedPDF() {
+IPDF_DataAvail::DocLinearizationStatus CPDF_DataAvail::IsLinearizedPDF() {
FX_DWORD req_size = 1024;
if (!m_pFileAvail->IsDataAvail(0, req_size)) {
- return PDF_LINEARIZATION_UNKNOWN;
+ return LinearizationUnknown;
}
if (!m_pFileRead) {
- return PDF_NOT_LINEARIZED;
+ return NotLinearized;
}
FX_FILESIZE dwSize = m_pFileRead->GetSize();
if (dwSize < (FX_FILESIZE)req_size) {
- return PDF_LINEARIZATION_UNKNOWN;
+ return LinearizationUnknown;
}
uint8_t buffer[1024];
m_pFileRead->ReadBlock(buffer, 0, req_size);
if (IsLinearizedFile(buffer, req_size)) {
- return PDF_LINEARIZED;
+ return Linearized;
}
- return PDF_NOT_LINEARIZED;
+ return NotLinearized;
}
FX_BOOL CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen) {
ScopedFileStream file(FX_CreateMemoryStream(pData, (size_t)dwLen, FALSE));
@@ -4278,33 +4277,33 @@ FX_BOOL CPDF_DataAvail::LoadPages(IFX_DownloadHints* pHints) {
}
int CPDF_DataAvail::CheckLinearizedData(IFX_DownloadHints* pHints) {
if (m_bLinearedDataOK) {
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
if (!m_bMainXRefLoadTried) {
FX_SAFE_DWORD data_size = m_dwFileLen;
data_size -= m_dwLastXRefOffset;
if (!data_size.IsValid()) {
- return PDF_DATA_ERROR;
+ return DataError;
}
if (!m_pFileAvail->IsDataAvail(m_dwLastXRefOffset,
data_size.ValueOrDie())) {
pHints->AddSegment(m_dwLastXRefOffset, data_size.ValueOrDie());
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
FX_DWORD dwRet = (m_pDocument->GetParser())->LoadLinearizedMainXRefTable();
m_bMainXRefLoadTried = TRUE;
if (dwRet != PDFPARSE_ERROR_SUCCESS) {
- return PDF_DATA_ERROR;
+ return DataError;
}
if (!PreparePageItem()) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
m_bMainXRefLoadedOK = TRUE;
m_bLinearedDataOK = TRUE;
}
- return m_bLinearedDataOK ? PDF_DATA_AVAIL : PDF_DATA_NOTAVAIL;
+ return m_bLinearedDataOK ? DataAvailable : DataNotAvailable;
}
FX_BOOL CPDF_DataAvail::CheckPageAnnots(int32_t iPage,
IFX_DownloadHints* pHints) {
@@ -4372,7 +4371,7 @@ FX_BOOL CPDF_DataAvail::HaveResourceAncestor(CPDF_Dictionary* pDict) {
}
int CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints) {
if (!m_pDocument) {
- return PDF_DATA_ERROR;
+ return DataError;
}
if (IsFirstCheck(iPage)) {
m_bCurPageDictLoadOK = FALSE;
@@ -4383,52 +4382,52 @@ int CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints) {
m_objnum_array.RemoveAll();
}
if (m_pagesLoadState.find(iPage) != m_pagesLoadState.end()) {
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
if (m_bLinearized) {
if ((FX_DWORD)iPage == m_dwFirstPageNo) {
m_pagesLoadState.insert(iPage);
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
int32_t nResult = CheckLinearizedData(pHints);
- if (nResult != PDF_DATA_AVAIL) {
+ if (nResult != DataAvailable) {
return nResult;
}
if (m_pHintTables) {
nResult = m_pHintTables->CheckPage(iPage, pHints);
- if (nResult != PDF_DATA_AVAIL)
+ if (nResult != DataAvailable)
return nResult;
m_pagesLoadState.insert(iPage);
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
if (m_bMainXRefLoadedOK) {
if (m_bTotalLoadPageTree) {
if (!LoadPages(pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
} else {
if (!m_bCurPageDictLoadOK && !CheckPage(iPage, pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
}
} else {
if (!LoadAllFile(pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
((CPDF_Parser*)m_pDocument->GetParser())->RebuildCrossRef();
ResetFirstCheck(iPage);
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
} else {
if (!m_bTotalLoadPageTree) {
if (!m_bCurPageDictLoadOK && !CheckPage(iPage, pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
}
}
if (m_bHaveAcroForm && !m_bAcroFormLoad) {
if (!CheckAcroFormSubObject(pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
m_bAcroFormLoad = TRUE;
}
@@ -4439,7 +4438,7 @@ int CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints) {
m_pPageDict = m_pDocument->GetPage(iPage);
if (!m_pPageDict) {
ResetFirstCheck(iPage);
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
CFX_PtrArray obj_array;
obj_array.Add(m_pPageDict);
@@ -4459,14 +4458,14 @@ int CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints) {
m_bPageLoadedOK = TRUE;
} else {
m_objs_array.Append(new_objs_array);
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
}
}
if (m_bPageLoadedOK) {
if (!m_bAnnotsLoad) {
if (!CheckPageAnnots(iPage, pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
m_bAnnotsLoad = TRUE;
}
@@ -4482,7 +4481,7 @@ int CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints) {
if (m_bNeedDownLoadResource) {
FX_BOOL bRet = CheckResources(pHints);
if (!bRet) {
- return PDF_DATA_NOTAVAIL;
+ return DataNotAvailable;
}
m_bNeedDownLoadResource = FALSE;
}
@@ -4491,7 +4490,7 @@ int CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints) {
m_bCurPageDictLoadOK = FALSE;
ResetFirstCheck(iPage);
m_pagesLoadState.insert(iPage);
- return PDF_DATA_AVAIL;
+ return DataAvailable;
}
FX_BOOL CPDF_DataAvail::CheckResources(IFX_DownloadHints* pHints) {
if (!m_objs_array.GetSize()) {
@@ -4557,21 +4556,22 @@ CPDF_Dictionary* CPDF_DataAvail::GetPage(int index) {
}
return m_pDocument->GetPage(index);
}
-int CPDF_DataAvail::IsFormAvail(IFX_DownloadHints* pHints) {
+IPDF_DataAvail::DocFormStatus CPDF_DataAvail::IsFormAvail(
+ IFX_DownloadHints* pHints) {
if (!m_pDocument) {
- return PDF_FORM_AVAIL;
+ return FormAvailable;
}
if (!m_bLinearizedFormParamLoad) {
CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
if (!pRoot) {
- return PDF_FORM_AVAIL;
+ return FormAvailable;
}
CPDF_Object* pAcroForm = pRoot->GetElement(FX_BSTRC("AcroForm"));
if (!pAcroForm) {
- return PDF_FORM_NOTEXIST;
+ return FormNotExist;
}
if (!CheckLinearizedData(pHints)) {
- return PDF_FORM_NOTAVAIL;
+ return FormNotAvailable;
}
if (!m_objs_array.GetSize()) {
m_objs_array.Add(pAcroForm->GetDict());
@@ -4583,9 +4583,9 @@ int CPDF_DataAvail::IsFormAvail(IFX_DownloadHints* pHints) {
m_objs_array.RemoveAll();
if (!bRet) {
m_objs_array.Append(new_objs_array);
- return PDF_FORM_NOTAVAIL;
+ return FormNotAvailable;
}
- return PDF_FORM_AVAIL;
+ return FormAvailable;
}
void CPDF_SortObjNumArray::AddObjNum(FX_DWORD dwObjNum) {
int32_t iNext = 0;
@@ -4869,17 +4869,17 @@ FX_BOOL CPDF_HintTables::GetPagePos(int index,
}
int32_t CPDF_HintTables::CheckPage(int index, IFX_DownloadHints* pHints) {
if (!m_pLinearizedDict || !pHints)
- return PDF_DATA_ERROR;
+ return IPDF_DataAvail::DataError;
CPDF_Object* pFirstAvailPage =
m_pLinearizedDict->GetElementValue(FX_BSTRC("P"));
int nFirstAvailPage = pFirstAvailPage ? pFirstAvailPage->GetInteger() : 0;
if (index == nFirstAvailPage)
- return PDF_DATA_AVAIL;
+ return IPDF_DataAvail::DataAvailable;
FX_DWORD dwLength = GetItemLength(index, m_szPageOffsetArray);
if (!dwLength ||
!m_pDataAvail->IsDataAvail(m_szPageOffsetArray[index], dwLength,
pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return IPDF_DataAvail::DataNotAvailable;
}
// Download data of shared objects in the page.
FX_DWORD offset = 0;
@@ -4890,7 +4890,7 @@ int32_t CPDF_HintTables::CheckPage(int index, IFX_DownloadHints* pHints) {
m_pLinearizedDict->GetElementValue(FX_BSTRC("O"));
int nFirstPageObjNum = pFirstPageObj ? pFirstPageObj->GetInteger() : -1;
if (nFirstPageObjNum < 0)
- return FALSE;
+ return FALSE; // TODO(thestig): Fix this and the return type.
FX_DWORD dwIndex = 0;
FX_DWORD dwObjNum = 0;
for (int j = 0; j < m_dwNSharedObjsArray[index]; ++j) {
@@ -4904,10 +4904,10 @@ int32_t CPDF_HintTables::CheckPage(int index, IFX_DownloadHints* pHints) {
if (!dwLength ||
!m_pDataAvail->IsDataAvail(m_szSharedObjOffsetArray[dwIndex], dwLength,
pHints)) {
- return PDF_DATA_NOTAVAIL;
+ return IPDF_DataAvail::DataNotAvailable;
}
}
- return PDF_DATA_AVAIL;
+ return IPDF_DataAvail::DataAvailable;
}
FX_BOOL CPDF_HintTables::LoadHintStream(CPDF_Stream* pHintStream) {
if (!pHintStream || !m_pLinearizedDict)
diff --git a/fpdfsdk/DEPS b/fpdfsdk/DEPS
index 60f0aca754..4ccc6b82d7 100644
--- a/fpdfsdk/DEPS
+++ b/fpdfsdk/DEPS
@@ -1,6 +1,6 @@
include_rules = [
'+core/include',
- '+javascript',
+ '+javascript/IJavaScript.h',
'+public',
'+v8',
]
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index 960e497e23..e3d55acdc7 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -8,6 +8,30 @@
#include "../../public/fpdf_formfill.h"
#include "../include/fsdk_define.h"
+// These checks are here because core/ and public/ cannot depend on each other.
+static_assert(IPDF_DataAvail::DataError == PDF_DATA_ERROR,
+ "IPDF_DataAvail::DataError value mismatch");
+static_assert(IPDF_DataAvail::DataNotAvailable == PDF_DATA_NOTAVAIL,
+ "IPDF_DataAvail::DataNotAvailable value mismatch");
+static_assert(IPDF_DataAvail::DataAvailable == PDF_DATA_AVAIL,
+ "IPDF_DataAvail::DataAvailable value mismatch");
+
+static_assert(IPDF_DataAvail::LinearizationUnknown == PDF_LINEARIZATION_UNKNOWN,
+ "IPDF_DataAvail::LinearizationUnknown value mismatch");
+static_assert(IPDF_DataAvail::NotLinearized == PDF_NOT_LINEARIZED,
+ "IPDF_DataAvail::NotLinearized value mismatch");
+static_assert(IPDF_DataAvail::Linearized == PDF_LINEARIZED,
+ "IPDF_DataAvail::Linearized value mismatch");
+
+static_assert(IPDF_DataAvail::FormError == PDF_FORM_ERROR,
+ "IPDF_DataAvail::FormError value mismatch");
+static_assert(IPDF_DataAvail::FormNotAvailable == PDF_FORM_NOTAVAIL,
+ "IPDF_DataAvail::FormNotAvailable value mismatch");
+static_assert(IPDF_DataAvail::FormAvailable == PDF_FORM_AVAIL,
+ "IPDF_DataAvail::FormAvailable value mismatch");
+static_assert(IPDF_DataAvail::FormNotExist == PDF_FORM_NOTEXIST,
+ "IPDF_DataAvail::FormNotExist value mismatch");
+
class CFPDF_FileAvailWrap : public IFX_FileAvail {
public:
CFPDF_FileAvailWrap() { m_pfileAvail = NULL; }
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index b13eb553cc..463ccf4c53 100644
--- a/fpdfsdk/src/fpdf_progressive.cpp
+++ b/fpdfsdk/src/fpdf_progressive.cpp
@@ -9,6 +9,17 @@
#include "../include/fsdk_define.h"
#include "../include/fsdk_rendercontext.h"
+// These checks are here because core/ and public/ cannot depend on each other.
+static_assert(CPDF_ProgressiveRenderer::Ready == FPDF_RENDER_READER,
+ "CPDF_ProgressiveRenderer::Ready value mismatch");
+static_assert(CPDF_ProgressiveRenderer::ToBeContinued ==
+ FPDF_RENDER_TOBECOUNTINUED,
+ "CPDF_ProgressiveRenderer::ToBeContinued value mismatch");
+static_assert(CPDF_ProgressiveRenderer::Done == FPDF_RENDER_DONE,
+ "CPDF_ProgressiveRenderer::Done value mismatch");
+static_assert(CPDF_ProgressiveRenderer::Failed == FPDF_RENDER_FAILED,
+ "CPDF_ProgressiveRenderer::Failed value mismatch");
+
DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
FPDF_PAGE page,
int start_x,
diff --git a/public/DEPS b/public/DEPS
new file mode 100644
index 0000000000..d0005cacd6
--- /dev/null
+++ b/public/DEPS
@@ -0,0 +1,8 @@
+include_rules = [
+ # public/ needs to be standalone. Explicitly disallow everything.
+ '-core',
+ '-fpdfsdk',
+ '-testing',
+ '-third_party',
+ '-v8',
+]
diff --git a/public/fpdf_dataavail.h b/public/fpdf_dataavail.h
index 3ed7d285ed..0f8ff7d6d7 100644
--- a/public/fpdf_dataavail.h
+++ b/public/fpdf_dataavail.h
@@ -14,9 +14,11 @@
#define PDF_LINEARIZATION_UNKNOWN -1
#define PDF_NOT_LINEARIZED 0
#define PDF_LINEARIZED 1
+
#define PDF_DATA_ERROR -1
#define PDF_DATA_NOTAVAIL 0
#define PDF_DATA_AVAIL 1
+
#define PDF_FORM_ERROR -1
#define PDF_FORM_NOTAVAIL 0
#define PDF_FORM_AVAIL 1
diff --git a/samples/DEPS b/samples/DEPS
index bbe39d0293..7bd794e6ef 100644
--- a/samples/DEPS
+++ b/samples/DEPS
@@ -3,4 +3,4 @@ include_rules = [
'+public',
'+third_party/zlib_v128',
'+v8',
-] \ No newline at end of file
+]
diff --git a/testing/DEPS b/testing/DEPS
index 76f3117de1..949e92821f 100644
--- a/testing/DEPS
+++ b/testing/DEPS
@@ -3,4 +3,4 @@ include_rules = [
'+fpdfsdk/include',
'+public',
'+v8',
-] \ No newline at end of file
+]
diff --git a/third_party/DEPS b/third_party/DEPS
new file mode 100644
index 0000000000..0b1a28f808
--- /dev/null
+++ b/third_party/DEPS
@@ -0,0 +1,7 @@
+include_rules = [
+ # A lot of third_party code has been modified to use fxcrt.
+ '+core/include/fxcrt/fx_basic.h',
+ '+core/include/fxcrt/fx_coordinates.h',
+ '+core/include/fxcrt/fx_memory.h',
+ '+core/include/fxcrt/fx_system.h',
+]
diff --git a/third_party/agg23/agg_rasterizer_scanline_aa.cpp b/third_party/agg23/agg_rasterizer_scanline_aa.cpp
index 8216e60221..46379f6dfd 100644
--- a/third_party/agg23/agg_rasterizer_scanline_aa.cpp
+++ b/third_party/agg23/agg_rasterizer_scanline_aa.cpp
@@ -46,7 +46,6 @@
// All other code is very different from the original.
//
//----------------------------------------------------------------------------
-#include "../../core/include/fxcrt/fx_ext.h"
#include <limits.h>
#include "agg_rasterizer_scanline_aa.h"
namespace agg
diff --git a/third_party/agg23/agg_rasterizer_scanline_aa.h b/third_party/agg23/agg_rasterizer_scanline_aa.h
index da1900d0dd..af31e0f2af 100644
--- a/third_party/agg23/agg_rasterizer_scanline_aa.h
+++ b/third_party/agg23/agg_rasterizer_scanline_aa.h
@@ -29,7 +29,8 @@
//----------------------------------------------------------------------------
#ifndef AGG_RASTERIZER_SCANLINE_AA_INCLUDED
#define AGG_RASTERIZER_SCANLINE_AA_INCLUDED
-#include "../../core/include/fxge/fx_ge.h"
+#include "../../core/include/fxcrt/fx_coordinates.h"
+#include "../../core/include/fxcrt/fx_memory.h"
#include "agg_basics.h"
#include "agg_math.h"
#include "agg_array.h"