Remove some friendships from CFXJSE_Value

Use the equivalent pre-existing public accessor methods instead.

Change-Id: I2bda2312369ab0b912460a34af0636c84df3a9e8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/52019
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cfxjse_context.cpp b/fxjs/xfa/cfxjse_context.cpp
index 19b9072..5dec89c 100644
--- a/fxjs/xfa/cfxjse_context.cpp
+++ b/fxjs/xfa/cfxjse_context.cpp
@@ -265,19 +265,17 @@
       if (hScript->Run(hContext).ToLocal(&hValue)) {
         ASSERT(!trycatch.HasCaught());
         if (lpRetValue)
-          lpRetValue->m_hValue.Reset(GetIsolate(), hValue);
+          lpRetValue->ForceSetValue(hValue);
         return true;
       }
     }
-    if (lpRetValue) {
-      lpRetValue->m_hValue.Reset(GetIsolate(),
-                                 CreateReturnValue(GetIsolate(), &trycatch));
-    }
+    if (lpRetValue)
+      lpRetValue->ForceSetValue(CreateReturnValue(GetIsolate(), &trycatch));
     return false;
   }
 
-  v8::Local<v8::Value> hNewThis =
-      v8::Local<v8::Value>::New(GetIsolate(), lpNewThisObject->m_hValue);
+  v8::Local<v8::Value> hNewThis = v8::Local<v8::Value>::New(
+      GetIsolate(), lpNewThisObject->DirectGetValue());
   ASSERT(!hNewThis.IsEmpty());
   v8::Local<v8::String> hEval =
       v8::String::NewFromUtf8(GetIsolate(),
@@ -296,8 +294,7 @@
             .ToLocal(&hValue)) {
       ASSERT(!trycatch.HasCaught());
       if (lpRetValue)
-        lpRetValue->m_hValue.Reset(GetIsolate(), hValue);
-
+        lpRetValue->ForceSetValue(hValue);
       return true;
     }
   }
@@ -316,9 +313,7 @@
   }
 #endif  // NDEBUG
 
-  if (lpRetValue) {
-    lpRetValue->m_hValue.Reset(GetIsolate(),
-                               CreateReturnValue(GetIsolate(), &trycatch));
-  }
+  if (lpRetValue)
+    lpRetValue->ForceSetValue(CreateReturnValue(GetIsolate(), &trycatch));
   return false;
 }
diff --git a/fxjs/xfa/cfxjse_value.h b/fxjs/xfa/cfxjse_value.h
index 26b8593..5a81a80 100644
--- a/fxjs/xfa/cfxjse_value.h
+++ b/fxjs/xfa/cfxjse_value.h
@@ -80,9 +80,6 @@
   }
 
  private:
-  friend class CFXJSE_Class;
-  friend class CFXJSE_Context;
-
   CFXJSE_Value() = delete;
   CFXJSE_Value(const CFXJSE_Value&) = delete;
   CFXJSE_Value& operator=(const CFXJSE_Value&) = delete;