Make checkdeps --resolve-dotdot succeed.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1419373005 .
diff --git a/DEPS b/DEPS
index 56d303c..bf1e65b 100644
--- a/DEPS
+++ b/DEPS
@@ -34,6 +34,8 @@
 }
 
 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 b7684e5..d1f5003 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 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 @@
   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 3c1d95a..7a5251e8 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_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 0000000..548eb61
--- /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 3da522d..bcade63 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 db0e8b1..7db97d2 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 @@
                  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 @@
   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 @@
   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 @@
 }
 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 @@
 }
 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 @@
     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 @@
       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 @@
         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 @@
   if (m_bNeedDownLoadResource) {
     FX_BOOL bRet = CheckResources(pHints);
     if (!bRet) {
-      return PDF_DATA_NOTAVAIL;
+      return DataNotAvailable;
     }
     m_bNeedDownLoadResource = FALSE;
   }
@@ -4491,7 +4490,7 @@
   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 @@
   }
   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 @@
   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 @@
 }
 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 @@
       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 @@
     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 60f0aca..4ccc6b8 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 960e497..e3d55ac 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 b13eb55..463ccf4 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 0000000..d0005ca
--- /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 3ed7d28..0f8ff7d 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 bbe39d0..7bd794e 100644
--- a/samples/DEPS
+++ b/samples/DEPS
@@ -3,4 +3,4 @@
   '+public',
   '+third_party/zlib_v128',
   '+v8',
-]
\ No newline at end of file
+]
diff --git a/testing/DEPS b/testing/DEPS
index 76f3117..949e928 100644
--- a/testing/DEPS
+++ b/testing/DEPS
@@ -3,4 +3,4 @@
   '+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 0000000..0b1a28f
--- /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 8216e60..46379f6 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 da1900d..af31e0f 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"