Forward declare cppgc::Heap in fxjs/gc/heap.h

Include v8/include/cppgc/heap.h only where needed. This should cut
down on the include bloat.

Change-Id: Ied5b31d823fd0f9b4f9f7ec34a303973c1ec4325
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/81612
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/gc/heap.cpp b/fxjs/gc/heap.cpp
index 958a782..841e812 100644
--- a/fxjs/gc/heap.cpp
+++ b/fxjs/gc/heap.cpp
@@ -9,6 +9,7 @@
 #include "core/fxcrt/fx_system.h"
 #include "third_party/base/check.h"
 #include "third_party/base/ptr_util.h"
+#include "v8/include/cppgc/heap.h"
 
 namespace {
 
diff --git a/fxjs/gc/heap.h b/fxjs/gc/heap.h
index b304d70..076a5f6 100644
--- a/fxjs/gc/heap.h
+++ b/fxjs/gc/heap.h
@@ -8,7 +8,10 @@
 #include <memory>
 
 #include "v8/include/cppgc/allocation.h"
-#include "v8/include/cppgc/heap.h"
+
+namespace cppgc {
+class Heap;
+}  // namespace cppgc
 
 namespace v8 {
 class Isolate;
diff --git a/xfa/fxfa/cxfa_textparser_unittest.cpp b/xfa/fxfa/cxfa_textparser_unittest.cpp
index a61f441..c57cbfe 100644
--- a/xfa/fxfa/cxfa_textparser_unittest.cpp
+++ b/xfa/fxfa/cxfa_textparser_unittest.cpp
@@ -7,6 +7,7 @@
 #include "fxjs/gc/heap.h"
 #include "testing/fxgc_unittest.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "v8/include/cppgc/heap.h"
 
 class CXFA_TestTextParser final : public CXFA_TextParser {
  public:
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmexpression_unittest.cpp
index c0b70e3..b7b20c4 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression_unittest.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression_unittest.cpp
@@ -11,6 +11,7 @@
 #include "core/fxcrt/fx_string.h"
 #include "testing/fxgc_unittest.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "v8/include/cppgc/heap.h"
 #include "xfa/fxfa/fm2js/cxfa_fmlexer.h"
 #include "xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h"
 
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index 4d9f272..a163684 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -11,6 +11,7 @@
 #include <vector>
 
 #include "core/fxcrt/autorestorer.h"
+#include "v8/include/cppgc/heap.h"
 
 namespace {