Remove a few V8 includes from header files.

Change-Id: I087c4e712aa87f99ada4ef515f5b361037a5dae0
Reviewed-on: https://pdfium-review.googlesource.com/c/44257
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cfx_v8.h b/fxjs/cfx_v8.h
index 3ebabde..70d3655 100644
--- a/fxjs/cfx_v8.h
+++ b/fxjs/cfx_v8.h
@@ -11,7 +11,6 @@
 
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "v8/include/v8-util.h"
 #include "v8/include/v8.h"
 
 class CFX_V8 {
diff --git a/fxjs/cfxjs_engine.cpp b/fxjs/cfxjs_engine.cpp
index f1dd450..c993a7d 100644
--- a/fxjs/cfxjs_engine.cpp
+++ b/fxjs/cfxjs_engine.cpp
@@ -15,6 +15,7 @@
 #include "fxjs/cjs_object.h"
 #include "third_party/base/ptr_util.h"
 #include "third_party/base/stl_util.h"
+#include "v8/include/v8-util.h"
 
 class CFXJS_PerObjectData;
 
@@ -590,6 +591,10 @@
   GetIsolate()->ThrowException(NewString(message.AsStringView()));
 }
 
+v8::Local<v8::Context> CFXJS_Engine::GetV8Context() {
+  return v8::Local<v8::Context>::New(GetIsolate(), m_V8Context);
+}
+
 // static
 CJS_Object* CFXJS_Engine::GetObjectPrivate(v8::Local<v8::Object> pObj) {
   auto* pData = CFXJS_PerObjectData::GetFromObject(pObj);
diff --git a/fxjs/cfxjs_engine.h b/fxjs/cfxjs_engine.h
index 0ee4fe5..8c6c69c 100644
--- a/fxjs/cfxjs_engine.h
+++ b/fxjs/cfxjs_engine.h
@@ -22,7 +22,6 @@
 #include "core/fxcrt/fx_string.h"
 #include "fxjs/cfx_v8.h"
 #include "fxjs/ijs_runtime.h"
-#include "v8/include/v8-util.h"
 #include "v8/include/v8.h"
 
 #ifdef PDF_ENABLE_XFA
@@ -128,9 +127,7 @@
   v8::Local<v8::Object> NewFXJSBoundObject(int nObjDefnID, FXJSOBJTYPE type);
   void Error(const WideString& message);
 
-  v8::Local<v8::Context> GetV8Context() {
-    return v8::Local<v8::Context>::New(GetIsolate(), m_V8Context);
-  }
+  v8::Local<v8::Context> GetV8Context();
 
   v8::Local<v8::Array> GetConstArray(const WideString& name);
   void SetConstArray(const WideString& name, v8::Local<v8::Array> array);
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 10b944d..6dd13e2 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -94,6 +94,12 @@
   delete loader_;
 }
 
+#ifdef PDF_ENABLE_V8
+void EmbedderTest::SetExternalIsolate(void* isolate) {
+  external_isolate_ = static_cast<v8::Isolate*>(isolate);
+}
+#endif  // PDF_ENABLE_V8
+
 bool EmbedderTest::CreateEmptyDocument() {
   document_ = FPDF_CreateNewDocument();
   if (!document_)
diff --git a/testing/embedder_test.h b/testing/embedder_test.h
index fc96241..37c5ca8 100644
--- a/testing/embedder_test.h
+++ b/testing/embedder_test.h
@@ -20,10 +20,6 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/test_support.h"
 
-#ifdef PDF_ENABLE_V8
-#include "v8/include/v8.h"
-#endif  // PDF_ENABLE_v8
-
 class TestLoader;
 
 // This class is used to load a PDF document, and then run programatic
@@ -75,9 +71,7 @@
 
 #ifdef PDF_ENABLE_V8
   // Call before SetUp to pass shared isolate, otherwise PDFium creates one.
-  void SetExternalIsolate(void* isolate) {
-    external_isolate_ = static_cast<v8::Isolate*>(isolate);
-  }
+  void SetExternalIsolate(void* isolate);
 #endif  // PDF_ENABLE_V8
 
   void SetDelegate(Delegate* delegate) {