summaryrefslogtreecommitdiff
path: root/chromium/third_party/pdfium/fxjs
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/third_party/pdfium/fxjs
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/pdfium/fxjs')
-rw-r--r--chromium/third_party/pdfium/fxjs/BUILD.gn12
-rw-r--r--chromium/third_party/pdfium/fxjs/cfx_globaldata.cpp51
-rw-r--r--chromium/third_party/pdfium/fxjs/cfx_globaldata_unittest.cpp16
-rw-r--r--chromium/third_party/pdfium/fxjs/cfx_keyvalue.h12
-rw-r--r--chromium/third_party/pdfium/fxjs/cfx_v8_unittest.cpp5
-rw-r--r--chromium/third_party/pdfium/fxjs/cfxjs_engine.cpp8
-rw-r--r--chromium/third_party/pdfium/fxjs/cfxjs_engine_unittest.cpp7
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_app.cpp9
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_delaydata.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_document.cpp4
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_event_context.cpp3
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_field.cpp61
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_global.cpp114
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_globalarrays.cpp4
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_object.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp14
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_publicmethods_unittest.cpp4
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_runtime.cpp5
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_runtimestub.cpp3
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_util.cpp6
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_util_unittest.cpp4
-rw-r--r--chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp7
-rw-r--r--chromium/third_party/pdfium/fxjs/gc/gced_tree_node.h43
-rw-r--r--chromium/third_party/pdfium/fxjs/gc/gced_tree_node_embeddertest.cpp146
-rw-r--r--chromium/third_party/pdfium/fxjs/gc/heap.cpp77
-rw-r--r--chromium/third_party/pdfium/fxjs/gc/heap.h27
-rw-r--r--chromium/third_party/pdfium/fxjs/gc/heap_embeddertest.cpp106
-rw-r--r--chromium/third_party/pdfium/fxjs/global_timer.cpp4
-rw-r--r--chromium/third_party/pdfium/fxjs/ijs_runtime.cpp22
-rw-r--r--chromium/third_party/pdfium/fxjs/ijs_runtime.h2
-rw-r--r--chromium/third_party/pdfium/fxjs/js_define.h4
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_class.cpp15
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_context.cpp7
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_engine.cpp17
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp284
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp126
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_resolveprocessor.cpp9
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_value.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cfxjse_value_embeddertest.cpp5
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_container.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_datawindow.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_delta.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_desc.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_eventpseudomodel.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_exclgroup.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_field.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_form.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_hostpseudomodel.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_instancemanager.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_layoutpseudomodel.cpp14
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_list.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_logpseudomodel.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_manifest.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_model.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_node.cpp3
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_object.cpp9
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_packet.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_signaturepseudomodel.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_source.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_subform.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_template.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_textnode.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_tree.cpp10
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_treelist.cpp2
-rw-r--r--chromium/third_party/pdfium/fxjs/xfa/cjx_wsdlconnection.cpp2
65 files changed, 858 insertions, 471 deletions
diff --git a/chromium/third_party/pdfium/fxjs/BUILD.gn b/chromium/third_party/pdfium/fxjs/BUILD.gn
index 8f6225fd0f4..6c9e6558660 100644
--- a/chromium/third_party/pdfium/fxjs/BUILD.gn
+++ b/chromium/third_party/pdfium/fxjs/BUILD.gn
@@ -114,6 +114,9 @@ source_set("fxjs") {
if (pdf_enable_xfa) {
sources += [
+ "gc/gced_tree_node.h",
+ "gc/heap.cpp",
+ "gc/heap.h",
"xfa/cfxjse_class.cpp",
"xfa/cfxjse_class.h",
"xfa/cfxjse_context.cpp",
@@ -205,6 +208,7 @@ source_set("fxjs") {
deps += [
"../xfa/fgas",
"../xfa/fxfa/fm2js",
+ "//v8:cppgc",
]
}
}
@@ -237,16 +241,20 @@ if (pdf_enable_v8) {
"../fpdfsdk",
]
pdfium_root_dir = "../"
-
if (pdf_enable_xfa) {
sources += [
+ "gc/gced_tree_node_embeddertest.cpp",
+ "gc/heap_embeddertest.cpp",
"xfa/cfxjse_app_embeddertest.cpp",
"xfa/cfxjse_formcalc_context_embeddertest.cpp",
"xfa/cfxjse_value_embeddertest.cpp",
"xfa/cjx_hostpseudomodel_embeddertest.cpp",
"xfa/cjx_list_embeddertest.cpp",
]
- deps += [ "../xfa/fxfa" ]
+ deps += [
+ "../xfa/fxfa",
+ "//v8:cppgc",
+ ]
}
}
}
diff --git a/chromium/third_party/pdfium/fxjs/cfx_globaldata.cpp b/chromium/third_party/pdfium/fxjs/cfx_globaldata.cpp
index 9131f02cc1f..3ad82949dd1 100644
--- a/chromium/third_party/pdfium/fxjs/cfx_globaldata.cpp
+++ b/chromium/third_party/pdfium/fxjs/cfx_globaldata.cpp
@@ -9,7 +9,6 @@
#include <utility>
#include "core/fdrm/fx_crypt.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
namespace {
@@ -53,31 +52,31 @@ bool MakeByteString(const ByteString& name,
const CFX_KeyValue& pData,
CFX_BinaryBuf* result) {
switch (pData.nType) {
- case CFX_Value::DataType::NUMBER: {
+ case CFX_Value::DataType::kNumber: {
MakeNameTypeString(name, pData.nType, result);
double dData = pData.dData;
result->AppendBlock(&dData, sizeof(double));
return true;
}
- case CFX_Value::DataType::BOOLEAN: {
+ case CFX_Value::DataType::kBoolean: {
MakeNameTypeString(name, pData.nType, result);
uint16_t wData = static_cast<uint16_t>(pData.bData);
result->AppendBlock(&wData, sizeof(uint16_t));
return true;
}
- case CFX_Value::DataType::STRING: {
+ case CFX_Value::DataType::kString: {
MakeNameTypeString(name, pData.nType, result);
uint32_t dwDataLen = (uint32_t)pData.sData.GetLength();
result->AppendBlock(&dwDataLen, sizeof(uint32_t));
result->AppendString(pData.sData);
return true;
}
- case CFX_Value::DataType::NULLOBJ: {
+ case CFX_Value::DataType::kNull: {
MakeNameTypeString(name, pData.nType, result);
return true;
}
// Arrays don't get persisted per JS spec page 484.
- case CFX_Value::DataType::OBJECT:
+ case CFX_Value::DataType::kObject:
default:
break;
}
@@ -135,13 +134,13 @@ void CFX_GlobalData::SetGlobalVariableNumber(ByteString sPropName,
CFX_GlobalData::Element* pData = GetGlobalVariable(sPropName);
if (pData) {
- pData->data.nType = CFX_Value::DataType::NUMBER;
+ pData->data.nType = CFX_Value::DataType::kNumber;
pData->data.dData = dData;
return;
}
- auto pNewData = pdfium::MakeUnique<CFX_GlobalData::Element>();
+ auto pNewData = std::make_unique<CFX_GlobalData::Element>();
pNewData->data.sKey = std::move(sPropName);
- pNewData->data.nType = CFX_Value::DataType::NUMBER;
+ pNewData->data.nType = CFX_Value::DataType::kNumber;
pNewData->data.dData = dData;
m_arrayGlobalData.push_back(std::move(pNewData));
}
@@ -153,13 +152,13 @@ void CFX_GlobalData::SetGlobalVariableBoolean(ByteString sPropName,
CFX_GlobalData::Element* pData = GetGlobalVariable(sPropName);
if (pData) {
- pData->data.nType = CFX_Value::DataType::BOOLEAN;
+ pData->data.nType = CFX_Value::DataType::kBoolean;
pData->data.bData = bData;
return;
}
- auto pNewData = pdfium::MakeUnique<CFX_GlobalData::Element>();
+ auto pNewData = std::make_unique<CFX_GlobalData::Element>();
pNewData->data.sKey = std::move(sPropName);
- pNewData->data.nType = CFX_Value::DataType::BOOLEAN;
+ pNewData->data.nType = CFX_Value::DataType::kBoolean;
pNewData->data.bData = bData;
m_arrayGlobalData.push_back(std::move(pNewData));
}
@@ -171,13 +170,13 @@ void CFX_GlobalData::SetGlobalVariableString(ByteString sPropName,
CFX_GlobalData::Element* pData = GetGlobalVariable(sPropName);
if (pData) {
- pData->data.nType = CFX_Value::DataType::STRING;
+ pData->data.nType = CFX_Value::DataType::kString;
pData->data.sData = sData;
return;
}
- auto pNewData = pdfium::MakeUnique<CFX_GlobalData::Element>();
+ auto pNewData = std::make_unique<CFX_GlobalData::Element>();
pNewData->data.sKey = std::move(sPropName);
- pNewData->data.nType = CFX_Value::DataType::STRING;
+ pNewData->data.nType = CFX_Value::DataType::kString;
pNewData->data.sData = sData;
m_arrayGlobalData.push_back(std::move(pNewData));
}
@@ -190,13 +189,13 @@ void CFX_GlobalData::SetGlobalVariableObject(
CFX_GlobalData::Element* pData = GetGlobalVariable(sPropName);
if (pData) {
- pData->data.nType = CFX_Value::DataType::OBJECT;
+ pData->data.nType = CFX_Value::DataType::kObject;
pData->data.objData = std::move(array);
return;
}
- auto pNewData = pdfium::MakeUnique<CFX_GlobalData::Element>();
+ auto pNewData = std::make_unique<CFX_GlobalData::Element>();
pNewData->data.sKey = std::move(sPropName);
- pNewData->data.nType = CFX_Value::DataType::OBJECT;
+ pNewData->data.nType = CFX_Value::DataType::kObject;
pNewData->data.objData = std::move(array);
m_arrayGlobalData.push_back(std::move(pNewData));
}
@@ -207,12 +206,12 @@ void CFX_GlobalData::SetGlobalVariableNull(ByteString sPropName) {
CFX_GlobalData::Element* pData = GetGlobalVariable(sPropName);
if (pData) {
- pData->data.nType = CFX_Value::DataType::NULLOBJ;
+ pData->data.nType = CFX_Value::DataType::kNull;
return;
}
- auto pNewData = pdfium::MakeUnique<CFX_GlobalData::Element>();
+ auto pNewData = std::make_unique<CFX_GlobalData::Element>();
pNewData->data.sKey = std::move(sPropName);
- pNewData->data.nType = CFX_Value::DataType::NULLOBJ;
+ pNewData->data.nType = CFX_Value::DataType::kNull;
m_arrayGlobalData.push_back(std::move(pNewData));
}
@@ -312,7 +311,7 @@ bool CFX_GlobalData::LoadGlobalPersistentVariablesFromBuffer(
p += sizeof(uint16_t);
switch (wDataType) {
- case CFX_Value::DataType::NUMBER: {
+ case CFX_Value::DataType::kNumber: {
double dData = 0;
switch (wVersion) {
case 1: {
@@ -328,13 +327,13 @@ bool CFX_GlobalData::LoadGlobalPersistentVariablesFromBuffer(
SetGlobalVariableNumber(sEntry, dData);
SetGlobalVariablePersistent(sEntry, true);
} break;
- case CFX_Value::DataType::BOOLEAN: {
+ case CFX_Value::DataType::kBoolean: {
uint16_t wData = *((uint16_t*)p);
p += sizeof(uint16_t);
SetGlobalVariableBoolean(sEntry, (bool)(wData == 1));
SetGlobalVariablePersistent(sEntry, true);
} break;
- case CFX_Value::DataType::STRING: {
+ case CFX_Value::DataType::kString: {
uint32_t dwLength = *((uint32_t*)p);
p += sizeof(uint32_t);
if (p + dwLength > buffer.end())
@@ -344,11 +343,11 @@ bool CFX_GlobalData::LoadGlobalPersistentVariablesFromBuffer(
SetGlobalVariablePersistent(sEntry, true);
p += sizeof(char) * dwLength;
} break;
- case CFX_Value::DataType::NULLOBJ: {
+ case CFX_Value::DataType::kNull: {
SetGlobalVariableNull(sEntry);
SetGlobalVariablePersistent(sEntry, true);
} break;
- case CFX_Value::DataType::OBJECT:
+ case CFX_Value::DataType::kObject:
default:
// Arrays aren't allowed in these buffers, nor are unrecoginzed tags.
return false;
diff --git a/chromium/third_party/pdfium/fxjs/cfx_globaldata_unittest.cpp b/chromium/third_party/pdfium/fxjs/cfx_globaldata_unittest.cpp
index b0e4253666f..9a204e9d61b 100644
--- a/chromium/third_party/pdfium/fxjs/cfx_globaldata_unittest.cpp
+++ b/chromium/third_party/pdfium/fxjs/cfx_globaldata_unittest.cpp
@@ -73,25 +73,25 @@ TEST(CFXGlobalData, StoreReload) {
auto* element = pInstance->GetAt(0);
ASSERT_TRUE(element);
EXPECT_EQ("double", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::NUMBER, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kNumber, element->data.nType);
EXPECT_EQ(2.0, element->data.dData);
element = pInstance->GetAt(1);
ASSERT_TRUE(element);
EXPECT_EQ("string", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::STRING, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kString, element->data.nType);
EXPECT_EQ("clams", element->data.sData);
element = pInstance->GetAt(2);
ASSERT_TRUE(element);
EXPECT_EQ("boolean", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::BOOLEAN, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kBoolean, element->data.nType);
EXPECT_EQ(true, element->data.bData);
element = pInstance->GetAt(3);
ASSERT_TRUE(element);
EXPECT_EQ("null", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::NULLOBJ, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kNull, element->data.nType);
// Arrays don't get persisted.
element = pInstance->GetAt(4);
@@ -115,25 +115,25 @@ TEST(CFXGlobalData, ResetValues) {
auto* element = pInstance->GetAt(0);
ASSERT_TRUE(element);
EXPECT_EQ("double", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::NUMBER, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kNumber, element->data.nType);
EXPECT_EQ(2.0, element->data.dData);
element = pInstance->GetAt(1);
ASSERT_TRUE(element);
EXPECT_EQ("string", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::STRING, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kString, element->data.nType);
EXPECT_EQ("clams", element->data.sData);
element = pInstance->GetAt(2);
ASSERT_TRUE(element);
EXPECT_EQ("boolean", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::BOOLEAN, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kBoolean, element->data.nType);
EXPECT_EQ(true, element->data.bData);
element = pInstance->GetAt(3);
ASSERT_TRUE(element);
EXPECT_EQ("null", element->data.sKey);
- EXPECT_EQ(CFX_Value::DataType::NULLOBJ, element->data.nType);
+ EXPECT_EQ(CFX_Value::DataType::kNull, element->data.nType);
ASSERT_TRUE(pInstance->Release());
}
diff --git a/chromium/third_party/pdfium/fxjs/cfx_keyvalue.h b/chromium/third_party/pdfium/fxjs/cfx_keyvalue.h
index b66dc120d1b..3f6dd42d1da 100644
--- a/chromium/third_party/pdfium/fxjs/cfx_keyvalue.h
+++ b/chromium/third_party/pdfium/fxjs/cfx_keyvalue.h
@@ -17,17 +17,17 @@ class CFX_KeyValue;
class CFX_Value {
public:
enum class DataType : uint8_t {
- NUMBER = 0,
- BOOLEAN,
- STRING,
- OBJECT,
- NULLOBJ
+ kNumber = 0,
+ kBoolean,
+ kString,
+ kObject,
+ kNull
};
CFX_Value();
~CFX_Value();
- DataType nType = DataType::NULLOBJ;
+ DataType nType = DataType::kNull;
bool bData;
double dData;
ByteString sData;
diff --git a/chromium/third_party/pdfium/fxjs/cfx_v8_unittest.cpp b/chromium/third_party/pdfium/fxjs/cfx_v8_unittest.cpp
index 762ecd7dd64..d9358da8b15 100644
--- a/chromium/third_party/pdfium/fxjs/cfx_v8_unittest.cpp
+++ b/chromium/third_party/pdfium/fxjs/cfx_v8_unittest.cpp
@@ -9,7 +9,6 @@
#include "fxjs/cfx_v8.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/base/ptr_util.h"
namespace {
bool getter_sentinel = false;
@@ -25,13 +24,13 @@ FXV8UnitTest::FXV8UnitTest() = default;
FXV8UnitTest::~FXV8UnitTest() = default;
void FXV8UnitTest::SetUp() {
- array_buffer_allocator_ = pdfium::MakeUnique<CFX_V8ArrayBufferAllocator>();
+ array_buffer_allocator_ = std::make_unique<CFX_V8ArrayBufferAllocator>();
v8::Isolate::CreateParams params;
params.array_buffer_allocator = array_buffer_allocator_.get();
isolate_.reset(v8::Isolate::New(params));
- cfx_v8_ = pdfium::MakeUnique<CFX_V8>(isolate_.get());
+ cfx_v8_ = std::make_unique<CFX_V8>(isolate_.get());
}
TEST_F(FXV8UnitTest, EmptyLocal) {
diff --git a/chromium/third_party/pdfium/fxjs/cfxjs_engine.cpp b/chromium/third_party/pdfium/fxjs/cfxjs_engine.cpp
index 4a15ebe11ed..ae1a9bcb6e2 100644
--- a/chromium/third_party/pdfium/fxjs/cfxjs_engine.cpp
+++ b/chromium/third_party/pdfium/fxjs/cfxjs_engine.cpp
@@ -8,13 +8,11 @@
#include <memory>
#include <utility>
-#include <vector>
#include "core/fxcrt/unowned_ptr.h"
#include "fxjs/cjs_object.h"
#include "fxjs/fxv8.h"
#include "fxjs/xfa/cfxjse_runtimedata.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "v8/include/v8-util.h"
@@ -309,7 +307,7 @@ size_t FXJS_GlobalIsolateRefCount() {
return g_isolate_ref_count;
}
-FXJS_PerIsolateData::~FXJS_PerIsolateData() {}
+FXJS_PerIsolateData::~FXJS_PerIsolateData() = default;
// static
void FXJS_PerIsolateData::SetUp(v8::Isolate* pIsolate) {
@@ -380,8 +378,8 @@ int CFXJS_Engine::DefineObj(const char* sObjName,
FXJS_PerIsolateData::SetUp(GetIsolate());
FXJS_PerIsolateData* pIsolateData = FXJS_PerIsolateData::Get(GetIsolate());
return pIsolateData->AssignIDForObjDefinition(
- pdfium::MakeUnique<CFXJS_ObjDefinition>(GetIsolate(), sObjName, eObjType,
- pConstructor, pDestructor));
+ std::make_unique<CFXJS_ObjDefinition>(GetIsolate(), sObjName, eObjType,
+ pConstructor, pDestructor));
}
void CFXJS_Engine::DefineObjMethod(int nObjDefnID,
diff --git a/chromium/third_party/pdfium/fxjs/cfxjs_engine_unittest.cpp b/chromium/third_party/pdfium/fxjs/cfxjs_engine_unittest.cpp
index e0f730128f9..c8e844cf879 100644
--- a/chromium/third_party/pdfium/fxjs/cfxjs_engine_unittest.cpp
+++ b/chromium/third_party/pdfium/fxjs/cfxjs_engine_unittest.cpp
@@ -9,7 +9,6 @@
#include "fxjs/cfx_v8_unittest.h"
#include "fxjs/cjs_object.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/base/ptr_util.h"
class FXJSEngineUnitTest : public FXV8UnitTest {
public:
@@ -19,7 +18,7 @@ class FXJSEngineUnitTest : public FXV8UnitTest {
void SetUp() override {
FXV8UnitTest::SetUp();
FXJS_Initialize(1, isolate());
- engine_ = pdfium::MakeUnique<CFXJS_Engine>(isolate());
+ engine_ = std::make_unique<CFXJS_Engine>(isolate());
}
void TearDown() override { FXJS_Release(); }
@@ -44,7 +43,7 @@ TEST_F(FXJSEngineUnitTest, GC) {
"perm", FXJSOBJTYPE_DYNAMIC,
[](CFXJS_Engine* pEngine, v8::Local<v8::Object> obj) {
pEngine->SetObjectPrivate(obj,
- pdfium::MakeUnique<CJS_Object>(obj, nullptr));
+ std::make_unique<CJS_Object>(obj, nullptr));
perm_created = true;
},
[](v8::Local<v8::Object> obj) {
@@ -57,7 +56,7 @@ TEST_F(FXJSEngineUnitTest, GC) {
"temp", FXJSOBJTYPE_DYNAMIC,
[](CFXJS_Engine* pEngine, v8::Local<v8::Object> obj) {
pEngine->SetObjectPrivate(obj,
- pdfium::MakeUnique<CJS_Object>(obj, nullptr));
+ std::make_unique<CJS_Object>(obj, nullptr));
temp_created = true;
},
[](v8::Local<v8::Object> obj) {
diff --git a/chromium/third_party/pdfium/fxjs/cjs_app.cpp b/chromium/third_party/pdfium/fxjs/cjs_app.cpp
index 36dece08df1..bc710945e34 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_app.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_app.cpp
@@ -14,7 +14,6 @@
#include "fxjs/global_timer.h"
#include "fxjs/ijs_event_context.h"
#include "fxjs/js_resources.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#define JS_STR_VIEWERTYPE L"pdfium"
@@ -302,7 +301,7 @@ CJS_Result CJS_App::setInterval(
return CJS_Result::Failure(JSMessage::kInvalidInputError);
uint32_t dwInterval = params.size() > 1 ? pRuntime->ToInt32(params[1]) : 1000;
- auto timerRef = pdfium::MakeUnique<GlobalTimer>(
+ auto timerRef = std::make_unique<GlobalTimer>(
this, pRuntime, GlobalTimer::Type::kRepeating, script, dwInterval, 0);
GlobalTimer* pTimerRef = timerRef.get();
m_Timers.insert(std::move(timerRef));
@@ -330,9 +329,9 @@ CJS_Result CJS_App::setTimeOut(
return CJS_Result::Failure(JSMessage::kInvalidInputError);
uint32_t dwTimeOut = params.size() > 1 ? pRuntime->ToInt32(params[1]) : 1000;
- auto timerRef = pdfium::MakeUnique<GlobalTimer>(this, pRuntime,
- GlobalTimer::Type::kOneShot,
- script, dwTimeOut, dwTimeOut);
+ auto timerRef =
+ std::make_unique<GlobalTimer>(this, pRuntime, GlobalTimer::Type::kOneShot,
+ script, dwTimeOut, dwTimeOut);
GlobalTimer* pTimerRef = timerRef.get();
m_Timers.insert(std::move(timerRef));
diff --git a/chromium/third_party/pdfium/fxjs/cjs_delaydata.cpp b/chromium/third_party/pdfium/fxjs/cjs_delaydata.cpp
index d7e1f780045..0aab785cf4e 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_delaydata.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_delaydata.cpp
@@ -9,4 +9,4 @@
CJS_DelayData::CJS_DelayData(FIELD_PROP prop, int idx, const WideString& name)
: eProp(prop), nControlIndex(idx), sFieldName(name) {}
-CJS_DelayData::~CJS_DelayData() {}
+CJS_DelayData::~CJS_DelayData() = default;
diff --git a/chromium/third_party/pdfium/fxjs/cjs_document.cpp b/chromium/third_party/pdfium/fxjs/cjs_document.cpp
index 14c7a208f30..a7de0bef94b 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_document.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_document.cpp
@@ -1254,7 +1254,7 @@ CJS_Result CJS_Document::getPageNthWord(
return CJS_Result::Failure(JSMessage::kBadObjectError);
auto page = pdfium::MakeRetain<CPDF_Page>(pDocument, pPageDict);
- page->SetRenderCache(pdfium::MakeUnique<CPDF_PageRenderCache>(page.Get()));
+ page->SetRenderCache(std::make_unique<CPDF_PageRenderCache>(page.Get()));
page->ParseContent();
int nWords = 0;
@@ -1309,7 +1309,7 @@ CJS_Result CJS_Document::getPageNumWords(
return CJS_Result::Failure(JSMessage::kBadObjectError);
auto page = pdfium::MakeRetain<CPDF_Page>(pDocument, pPageDict);
- page->SetRenderCache(pdfium::MakeUnique<CPDF_PageRenderCache>(page.Get()));
+ page->SetRenderCache(std::make_unique<CPDF_PageRenderCache>(page.Get()));
page->ParseContent();
int nWords = 0;
diff --git a/chromium/third_party/pdfium/fxjs/cjs_event_context.cpp b/chromium/third_party/pdfium/fxjs/cjs_event_context.cpp
index 27e8120aca3..b308c472239 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_event_context.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_event_context.cpp
@@ -12,11 +12,10 @@
#include "fxjs/cjs_runtime.h"
#include "fxjs/js_define.h"
#include "fxjs/js_resources.h"
-#include "third_party/base/ptr_util.h"
CJS_EventContext::CJS_EventContext(CJS_Runtime* pRuntime)
: m_pRuntime(pRuntime),
- m_pEventRecorder(pdfium::MakeUnique<CJS_EventRecorder>()) {
+ m_pEventRecorder(std::make_unique<CJS_EventRecorder>()) {
ASSERT(pRuntime);
}
diff --git a/chromium/third_party/pdfium/fxjs/cjs_field.cpp b/chromium/third_party/pdfium/fxjs/cjs_field.cpp
index 1cd0d3f3545..7483ee03ab2 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_field.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_field.cpp
@@ -25,7 +25,6 @@
#include "fxjs/cjs_document.h"
#include "fxjs/cjs_icon.h"
#include "fxjs/js_resources.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -221,17 +220,17 @@ void SetBorderStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv,
const ByteString& string) {
ASSERT(pFormFillEnv);
- BorderStyle nBorderStyle = BorderStyle::SOLID;
+ BorderStyle nBorderStyle = BorderStyle::kSolid;
if (string == "solid")
- nBorderStyle = BorderStyle::SOLID;
+ nBorderStyle = BorderStyle::kSolid;
else if (string == "beveled")
- nBorderStyle = BorderStyle::BEVELED;
+ nBorderStyle = BorderStyle::kBeveled;
else if (string == "dashed")
- nBorderStyle = BorderStyle::DASH;
+ nBorderStyle = BorderStyle::kDash;
else if (string == "inset")
- nBorderStyle = BorderStyle::INSET;
+ nBorderStyle = BorderStyle::kInset;
else if (string == "underline")
- nBorderStyle = BorderStyle::UNDERLINE;
+ nBorderStyle = BorderStyle::kUnderline;
else
return;
@@ -704,15 +703,15 @@ CJS_Result CJS_Field::get_border_style(CJS_Runtime* pRuntime) {
return CJS_Result::Failure(JSMessage::kBadObjectError);
switch (pWidget->GetBorderStyle()) {
- case BorderStyle::SOLID:
+ case BorderStyle::kSolid:
return CJS_Result::Success(pRuntime->NewString("solid"));
- case BorderStyle::DASH:
+ case BorderStyle::kDash:
return CJS_Result::Success(pRuntime->NewString("dashed"));
- case BorderStyle::BEVELED:
+ case BorderStyle::kBeveled:
return CJS_Result::Success(pRuntime->NewString("beveled"));
- case BorderStyle::INSET:
+ case BorderStyle::kInset:
return CJS_Result::Success(pRuntime->NewString("inset"));
- case BorderStyle::UNDERLINE:
+ case BorderStyle::kUnderline:
return CJS_Result::Success(pRuntime->NewString("underline"));
}
return CJS_Result::Success(pRuntime->NewString(""));
@@ -881,21 +880,19 @@ CJS_Result CJS_Field::get_button_scale_when(CJS_Runtime* pRuntime) {
return CJS_Result::Failure(JSMessage::kBadObjectError);
CPDF_IconFit IconFit = pFormControl->GetIconFit();
- int ScaleM = IconFit.GetScaleMethod();
- switch (ScaleM) {
- case CPDF_IconFit::Always:
+ CPDF_IconFit::ScaleMethod scale_method = IconFit.GetScaleMethod();
+ switch (scale_method) {
+ case CPDF_IconFit::ScaleMethod::kAlways:
+ case CPDF_IconFit::ScaleMethod::kBigger:
+ case CPDF_IconFit::ScaleMethod::kNever:
+ case CPDF_IconFit::ScaleMethod::kSmaller:
return CJS_Result::Success(
- pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Always)));
- case CPDF_IconFit::Bigger:
- return CJS_Result::Success(
- pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Bigger)));
- case CPDF_IconFit::Never:
- return CJS_Result::Success(
- pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Never)));
- case CPDF_IconFit::Smaller:
- return CJS_Result::Success(
- pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Smaller)));
+ pRuntime->NewNumber(static_cast<int>(scale_method)));
}
+
+ // Note this is deliberately not the default case for the switch statement
+ // above, so missing cases trigger compile time errors.
+ NOTREACHED();
return CJS_Result::Success();
}
@@ -2376,7 +2373,7 @@ CJS_Result CJS_Field::getArray(
std::vector<std::unique_ptr<WideString>> swSort;
for (CPDF_FormField* pFormField : FieldArray) {
- swSort.push_back(pdfium::MakeUnique<WideString>(pFormField->GetFullName()));
+ swSort.push_back(std::make_unique<WideString>(pFormField->GetFullName()));
}
std::sort(swSort.begin(), swSort.end(),
@@ -2581,28 +2578,28 @@ CJS_Result CJS_Field::signatureValidate(
void CJS_Field::AddDelay_Int(FIELD_PROP prop, int32_t n) {
auto pNewData =
- pdfium::MakeUnique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
+ std::make_unique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
pNewData->num = n;
m_pJSDoc->AddDelayData(std::move(pNewData));
}
void CJS_Field::AddDelay_Bool(FIELD_PROP prop, bool b) {
auto pNewData =
- pdfium::MakeUnique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
+ std::make_unique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
pNewData->b = b;
m_pJSDoc->AddDelayData(std::move(pNewData));
}
void CJS_Field::AddDelay_String(FIELD_PROP prop, const ByteString& str) {
auto pNewData =
- pdfium::MakeUnique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
+ std::make_unique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
pNewData->bytestring = str;
m_pJSDoc->AddDelayData(std::move(pNewData));
}
void CJS_Field::AddDelay_Rect(FIELD_PROP prop, const CFX_FloatRect& rect) {
auto pNewData =
- pdfium::MakeUnique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
+ std::make_unique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
pNewData->rect = rect;
m_pJSDoc->AddDelayData(std::move(pNewData));
}
@@ -2610,7 +2607,7 @@ void CJS_Field::AddDelay_Rect(FIELD_PROP prop, const CFX_FloatRect& rect) {
void CJS_Field::AddDelay_WordArray(FIELD_PROP prop,
const std::vector<uint32_t>& array) {
auto pNewData =
- pdfium::MakeUnique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
+ std::make_unique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
pNewData->wordarray = array;
m_pJSDoc->AddDelayData(std::move(pNewData));
}
@@ -2618,7 +2615,7 @@ void CJS_Field::AddDelay_WordArray(FIELD_PROP prop,
void CJS_Field::AddDelay_WideStringArray(FIELD_PROP prop,
const std::vector<WideString>& array) {
auto pNewData =
- pdfium::MakeUnique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
+ std::make_unique<CJS_DelayData>(prop, m_nFormControlIndex, m_FieldName);
pNewData->widestringarray = array;
m_pJSDoc->AddDelayData(std::move(pNewData));
}
diff --git a/chromium/third_party/pdfium/fxjs/cjs_global.cpp b/chromium/third_party/pdfium/fxjs/cjs_global.cpp
index 925b665eb9b..a45cceaaf28 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_global.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_global.cpp
@@ -6,7 +6,6 @@
#include "fxjs/cjs_global.h"
-#include <map>
#include <memory>
#include <utility>
#include <vector>
@@ -19,7 +18,6 @@
#include "fxjs/cjs_object.h"
#include "fxjs/js_define.h"
#include "fxjs/js_resources.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -238,17 +236,17 @@ CJS_Result CJS_Global::GetProperty(CJS_Runtime* pRuntime,
return CJS_Result::Success();
switch (pData->nType) {
- case CFX_Value::DataType::NUMBER:
+ case CFX_Value::DataType::kNumber:
return CJS_Result::Success(pRuntime->NewNumber(pData->dData));
- case CFX_Value::DataType::BOOLEAN:
+ case CFX_Value::DataType::kBoolean:
return CJS_Result::Success(pRuntime->NewBoolean(pData->bData));
- case CFX_Value::DataType::STRING:
+ case CFX_Value::DataType::kString:
return CJS_Result::Success(pRuntime->NewString(
WideString::FromDefANSI(pData->sData.AsStringView()).AsStringView()));
- case CFX_Value::DataType::OBJECT:
+ case CFX_Value::DataType::kObject:
return CJS_Result::Success(
v8::Local<v8::Object>::New(pRuntime->GetIsolate(), pData->pData));
- case CFX_Value::DataType::NULLOBJ:
+ case CFX_Value::DataType::kNull:
return CJS_Result::Success(pRuntime->NewNull());
default:
break;
@@ -261,26 +259,26 @@ CJS_Result CJS_Global::SetProperty(CJS_Runtime* pRuntime,
v8::Local<v8::Value> vp) {
ByteString sPropName = WideString(propname).ToDefANSI();
if (vp->IsNumber()) {
- return SetGlobalVariables(sPropName, CFX_Value::DataType::NUMBER,
+ return SetGlobalVariables(sPropName, CFX_Value::DataType::kNumber,
pRuntime->ToDouble(vp), false, ByteString(),
v8::Local<v8::Object>(), false);
}
if (vp->IsBoolean()) {
- return SetGlobalVariables(sPropName, CFX_Value::DataType::BOOLEAN, 0,
+ return SetGlobalVariables(sPropName, CFX_Value::DataType::kBoolean, 0,
pRuntime->ToBoolean(vp), ByteString(),
v8::Local<v8::Object>(), false);
}
if (vp->IsString()) {
- return SetGlobalVariables(sPropName, CFX_Value::DataType::STRING, 0, false,
+ return SetGlobalVariables(sPropName, CFX_Value::DataType::kString, 0, false,
pRuntime->ToWideString(vp).ToDefANSI(),
v8::Local<v8::Object>(), false);
}
if (vp->IsObject()) {
- return SetGlobalVariables(sPropName, CFX_Value::DataType::OBJECT, 0, false,
+ return SetGlobalVariables(sPropName, CFX_Value::DataType::kObject, 0, false,
ByteString(), pRuntime->ToObject(vp), false);
}
if (vp->IsNull()) {
- return SetGlobalVariables(sPropName, CFX_Value::DataType::NULLOBJ, 0, false,
+ return SetGlobalVariables(sPropName, CFX_Value::DataType::kNull, 0, false,
ByteString(), v8::Local<v8::Object>(), false);
}
if (vp->IsUndefined()) {
@@ -312,24 +310,24 @@ void CJS_Global::UpdateGlobalPersistentVariables() {
for (int i = 0, sz = m_pGlobalData->GetSize(); i < sz; i++) {
CFX_GlobalData::Element* pData = m_pGlobalData->GetAt(i);
switch (pData->data.nType) {
- case CFX_Value::DataType::NUMBER:
- SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::NUMBER,
+ case CFX_Value::DataType::kNumber:
+ SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::kNumber,
pData->data.dData, false, ByteString(),
v8::Local<v8::Object>(), pData->bPersistent == 1);
pRuntime->PutObjectProperty(ToV8Object(),
pData->data.sKey.AsStringView(),
pRuntime->NewNumber(pData->data.dData));
break;
- case CFX_Value::DataType::BOOLEAN:
- SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::BOOLEAN, 0,
+ case CFX_Value::DataType::kBoolean:
+ SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::kBoolean, 0,
pData->data.bData == 1, ByteString(),
v8::Local<v8::Object>(), pData->bPersistent == 1);
pRuntime->PutObjectProperty(
ToV8Object(), pData->data.sKey.AsStringView(),
pRuntime->NewBoolean(pData->data.bData == 1));
break;
- case CFX_Value::DataType::STRING:
- SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::STRING, 0,
+ case CFX_Value::DataType::kString:
+ SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::kString, 0,
false, pData->data.sData, v8::Local<v8::Object>(),
pData->bPersistent == 1);
pRuntime->PutObjectProperty(
@@ -338,19 +336,19 @@ void CJS_Global::UpdateGlobalPersistentVariables() {
WideString::FromUTF8(pData->data.sData.AsStringView())
.AsStringView()));
break;
- case CFX_Value::DataType::OBJECT: {
+ case CFX_Value::DataType::kObject: {
v8::Local<v8::Object> pObj = pRuntime->NewObject();
if (!pObj.IsEmpty()) {
PutObjectProperty(pObj, &pData->data);
- SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::OBJECT, 0,
+ SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::kObject, 0,
false, ByteString(), pObj,
pData->bPersistent == 1);
pRuntime->PutObjectProperty(ToV8Object(),
pData->data.sKey.AsStringView(), pObj);
}
} break;
- case CFX_Value::DataType::NULLOBJ:
- SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::NULLOBJ, 0,
+ case CFX_Value::DataType::kNull:
+ SetGlobalVariables(pData->data.sKey, CFX_Value::DataType::kNull, 0,
false, ByteString(), v8::Local<v8::Object>(),
pData->bPersistent == 1);
pRuntime->PutObjectProperty(
@@ -369,19 +367,19 @@ void CJS_Global::CommitGlobalPersisitentVariables(CJS_Runtime* pRuntime) {
continue;
}
switch (pData->nType) {
- case CFX_Value::DataType::NUMBER:
+ case CFX_Value::DataType::kNumber:
m_pGlobalData->SetGlobalVariableNumber(name, pData->dData);
m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
break;
- case CFX_Value::DataType::BOOLEAN:
+ case CFX_Value::DataType::kBoolean:
m_pGlobalData->SetGlobalVariableBoolean(name, pData->bData);
m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
break;
- case CFX_Value::DataType::STRING:
+ case CFX_Value::DataType::kString:
m_pGlobalData->SetGlobalVariableString(name, pData->sData);
m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
break;
- case CFX_Value::DataType::OBJECT: {
+ case CFX_Value::DataType::kObject: {
std::vector<std::unique_ptr<CFX_KeyValue>> array;
v8::Local<v8::Object> obj =
v8::Local<v8::Object>::New(GetIsolate(), pData->pData);
@@ -389,7 +387,7 @@ void CJS_Global::CommitGlobalPersisitentVariables(CJS_Runtime* pRuntime) {
m_pGlobalData->SetGlobalVariableObject(name, std::move(array));
m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
} break;
- case CFX_Value::DataType::NULLOBJ:
+ case CFX_Value::DataType::kNull:
m_pGlobalData->SetGlobalVariableNull(name);
m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
break;
@@ -407,16 +405,16 @@ void CJS_Global::ObjectToArray(
v8::Local<v8::Value> v =
pRuntime->GetObjectProperty(pObj, sKey.AsStringView());
if (v->IsNumber()) {
- auto pObjElement = pdfium::MakeUnique<CFX_KeyValue>();
- pObjElement->nType = CFX_Value::DataType::NUMBER;
+ auto pObjElement = std::make_unique<CFX_KeyValue>();
+ pObjElement->nType = CFX_Value::DataType::kNumber;
pObjElement->sKey = sKey;
pObjElement->dData = pRuntime->ToDouble(v);
pArray->push_back(std::move(pObjElement));
continue;
}
if (v->IsBoolean()) {
- auto pObjElement = pdfium::MakeUnique<CFX_KeyValue>();
- pObjElement->nType = CFX_Value::DataType::BOOLEAN;
+ auto pObjElement = std::make_unique<CFX_KeyValue>();
+ pObjElement->nType = CFX_Value::DataType::kBoolean;
pObjElement->sKey = sKey;
pObjElement->dData = pRuntime->ToBoolean(v);
pArray->push_back(std::move(pObjElement));
@@ -424,24 +422,24 @@ void CJS_Global::ObjectToArray(
}
if (v->IsString()) {
ByteString sValue = pRuntime->ToWideString(v).ToDefANSI();
- auto pObjElement = pdfium::MakeUnique<CFX_KeyValue>();
- pObjElement->nType = CFX_Value::DataType::STRING;
+ auto pObjElement = std::make_unique<CFX_KeyValue>();
+ pObjElement->nType = CFX_Value::DataType::kString;
pObjElement->sKey = sKey;
pObjElement->sData = sValue;
pArray->push_back(std::move(pObjElement));
continue;
}
if (v->IsObject()) {
- auto pObjElement = pdfium::MakeUnique<CFX_KeyValue>();
- pObjElement->nType = CFX_Value::DataType::OBJECT;
+ auto pObjElement = std::make_unique<CFX_KeyValue>();
+ pObjElement->nType = CFX_Value::DataType::kObject;
pObjElement->sKey = sKey;
ObjectToArray(pRuntime, pRuntime->ToObject(v), &pObjElement->objData);
pArray->push_back(std::move(pObjElement));
continue;
}
if (v->IsNull()) {
- auto pObjElement = pdfium::MakeUnique<CFX_KeyValue>();
- pObjElement->nType = CFX_Value::DataType::NULLOBJ;
+ auto pObjElement = std::make_unique<CFX_KeyValue>();
+ pObjElement->nType = CFX_Value::DataType::kNull;
pObjElement->sKey = sKey;
pArray->push_back(std::move(pObjElement));
}
@@ -457,22 +455,22 @@ void CJS_Global::PutObjectProperty(v8::Local<v8::Object> pObj,
for (size_t i = 0; i < pData->objData.size(); ++i) {
CFX_KeyValue* pObjData = pData->objData.at(i).get();
switch (pObjData->nType) {
- case CFX_Value::DataType::NUMBER:
+ case CFX_Value::DataType::kNumber:
pRuntime->PutObjectProperty(pObj, pObjData->sKey.AsStringView(),
pRuntime->NewNumber(pObjData->dData));
break;
- case CFX_Value::DataType::BOOLEAN:
+ case CFX_Value::DataType::kBoolean:
pRuntime->PutObjectProperty(pObj, pObjData->sKey.AsStringView(),
pRuntime->NewBoolean(pObjData->bData == 1));
break;
- case CFX_Value::DataType::STRING:
+ case CFX_Value::DataType::kString:
pRuntime->PutObjectProperty(
pObj, pObjData->sKey.AsStringView(),
pRuntime->NewString(
WideString::FromUTF8(pObjData->sData.AsStringView())
.AsStringView()));
break;
- case CFX_Value::DataType::OBJECT: {
+ case CFX_Value::DataType::kObject: {
v8::Local<v8::Object> pNewObj = pRuntime->NewObject();
if (!pNewObj.IsEmpty()) {
PutObjectProperty(pNewObj, pObjData);
@@ -480,7 +478,7 @@ void CJS_Global::PutObjectProperty(v8::Local<v8::Object> pObj,
pNewObj);
}
} break;
- case CFX_Value::DataType::NULLOBJ:
+ case CFX_Value::DataType::kNull:
pRuntime->PutObjectProperty(pObj, pObjData->sKey.AsStringView(),
pRuntime->NewNull());
break;
@@ -513,19 +511,19 @@ CJS_Result CJS_Global::SetGlobalVariables(const ByteString& propname,
}
pTemp->bDeleted = false;
switch (nType) {
- case CFX_Value::DataType::NUMBER:
+ case CFX_Value::DataType::kNumber:
pTemp->dData = dData;
break;
- case CFX_Value::DataType::BOOLEAN:
+ case CFX_Value::DataType::kBoolean:
pTemp->bData = bData;
break;
- case CFX_Value::DataType::STRING:
+ case CFX_Value::DataType::kString:
pTemp->sData = sData;
break;
- case CFX_Value::DataType::OBJECT:
+ case CFX_Value::DataType::kObject:
pTemp->pData.Reset(pData->GetIsolate(), pData);
break;
- case CFX_Value::DataType::NULLOBJ:
+ case CFX_Value::DataType::kNull:
break;
default:
return CJS_Result::Failure(JSMessage::kObjectTypeError);
@@ -533,30 +531,30 @@ CJS_Result CJS_Global::SetGlobalVariables(const ByteString& propname,
return CJS_Result::Success();
}
- auto pNewData = pdfium::MakeUnique<JSGlobalData>();
+ auto pNewData = std::make_unique<JSGlobalData>();
switch (nType) {
- case CFX_Value::DataType::NUMBER:
- pNewData->nType = CFX_Value::DataType::NUMBER;
+ case CFX_Value::DataType::kNumber:
+ pNewData->nType = CFX_Value::DataType::kNumber;
pNewData->dData = dData;
pNewData->bPersistent = bDefaultPersistent;
break;
- case CFX_Value::DataType::BOOLEAN:
- pNewData->nType = CFX_Value::DataType::BOOLEAN;
+ case CFX_Value::DataType::kBoolean:
+ pNewData->nType = CFX_Value::DataType::kBoolean;
pNewData->bData = bData;
pNewData->bPersistent = bDefaultPersistent;
break;
- case CFX_Value::DataType::STRING:
- pNewData->nType = CFX_Value::DataType::STRING;
+ case CFX_Value::DataType::kString:
+ pNewData->nType = CFX_Value::DataType::kString;
pNewData->sData = sData;
pNewData->bPersistent = bDefaultPersistent;
break;
- case CFX_Value::DataType::OBJECT:
- pNewData->nType = CFX_Value::DataType::OBJECT;
+ case CFX_Value::DataType::kObject:
+ pNewData->nType = CFX_Value::DataType::kObject;
pNewData->pData.Reset(pData->GetIsolate(), pData);
pNewData->bPersistent = bDefaultPersistent;
break;
- case CFX_Value::DataType::NULLOBJ:
- pNewData->nType = CFX_Value::DataType::NULLOBJ;
+ case CFX_Value::DataType::kNull:
+ pNewData->nType = CFX_Value::DataType::kNull;
pNewData->bPersistent = bDefaultPersistent;
break;
default:
diff --git a/chromium/third_party/pdfium/fxjs/cjs_globalarrays.cpp b/chromium/third_party/pdfium/fxjs/cjs_globalarrays.cpp
index b95861d773c..72f74396094 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_globalarrays.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_globalarrays.cpp
@@ -6,14 +6,14 @@
#include "fxjs/cjs_globalarrays.h"
-#include "core/fxcrt/fx_memory.h"
+#include "third_party/base/stl_util.h"
#define GLOBAL_ARRAY(rt, name, ...) \
{ \
static const wchar_t* const values[] = {__VA_ARGS__}; \
v8::Local<v8::Array> array = (rt)->NewArray(); \
v8::Local<v8::Context> ctx = (rt)->GetIsolate()->GetCurrentContext(); \
- for (size_t i = 0; i < FX_ArraySize(values); ++i) \
+ for (size_t i = 0; i < pdfium::size(values); ++i) \
array->Set(ctx, i, (rt)->NewString(values[i])).FromJust(); \
(rt)->SetConstArray((name), array); \
(rt)->DefineGlobalConst( \
diff --git a/chromium/third_party/pdfium/fxjs/cjs_object.cpp b/chromium/third_party/pdfium/fxjs/cjs_object.cpp
index e13a5095db4..b65c4fc415b 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_object.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_object.cpp
@@ -42,4 +42,4 @@ CJS_Object::CJS_Object(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
m_pV8Object(GetIsolate(), pObject),
m_pRuntime(pRuntime) {}
-CJS_Object::~CJS_Object() {}
+CJS_Object::~CJS_Object() = default;
diff --git a/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp b/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp
index 8eed97d44ff..02dced81750 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp
@@ -35,6 +35,7 @@
#include "fxjs/js_define.h"
#include "fxjs/js_resources.h"
#include "third_party/base/optional.h"
+#include "third_party/base/stl_util.h"
// static
const JSMethodSpec CJS_PublicMethods::GlobalFunctionSpecs[] = {
@@ -799,8 +800,7 @@ CJS_Result CJS_PublicMethods::AFPercent_Format(
// When the |iDec| value is too big, Acrobat will just return "%".
static constexpr int kDecLimit = 512;
- // TODO(thestig): Calculate this once C++14 can be used to declare variables
- // in constexpr functions.
+ // This count must be in sync with |kDecLimit|.
static constexpr size_t kDigitsInDecLimit = 3;
WideString& Value = pEvent->Value();
if (iDec > kDecLimit) {
@@ -924,7 +924,7 @@ double CJS_PublicMethods::ParseDateAsGMT(const WideString& strValue) {
int nMonth = 1;
sTemp = wsArray[1];
- for (size_t i = 0; i < FX_ArraySize(fxjs::kMonths); ++i) {
+ for (size_t i = 0; i < pdfium::size(fxjs::kMonths); ++i) {
if (sTemp.Compare(fxjs::kMonths[i]) == 0) {
nMonth = i + 1;
break;
@@ -984,7 +984,7 @@ CJS_Result CJS_PublicMethods::AFDate_Format(
return CJS_Result::Failure(JSMessage::kParamError);
int iIndex = WithinBoundsOrZero(pRuntime->ToInt32(params[0]),
- FX_ArraySize(kDateFormats));
+ pdfium::size(kDateFormats));
std::vector<v8::Local<v8::Value>> newParams;
newParams.push_back(pRuntime->NewString(kDateFormats[iIndex]));
return AFDate_FormatEx(pRuntime, newParams);
@@ -998,7 +998,7 @@ CJS_Result CJS_PublicMethods::AFDate_Keystroke(
return CJS_Result::Failure(JSMessage::kParamError);
int iIndex = WithinBoundsOrZero(pRuntime->ToInt32(params[0]),
- FX_ArraySize(kDateFormats));
+ pdfium::size(kDateFormats));
std::vector<v8::Local<v8::Value>> newParams;
newParams.push_back(pRuntime->NewString(kDateFormats[iIndex]));
return AFDate_KeystrokeEx(pRuntime, newParams);
@@ -1012,7 +1012,7 @@ CJS_Result CJS_PublicMethods::AFTime_Format(
return CJS_Result::Failure(JSMessage::kParamError);
int iIndex = WithinBoundsOrZero(pRuntime->ToInt32(params[0]),
- FX_ArraySize(kTimeFormats));
+ pdfium::size(kTimeFormats));
std::vector<v8::Local<v8::Value>> newParams;
newParams.push_back(pRuntime->NewString(kTimeFormats[iIndex]));
return AFDate_FormatEx(pRuntime, newParams);
@@ -1025,7 +1025,7 @@ CJS_Result CJS_PublicMethods::AFTime_Keystroke(
return CJS_Result::Failure(JSMessage::kParamError);
int iIndex = WithinBoundsOrZero(pRuntime->ToInt32(params[0]),
- FX_ArraySize(kTimeFormats));
+ pdfium::size(kTimeFormats));
std::vector<v8::Local<v8::Value>> newParams;
newParams.push_back(pRuntime->NewString(kTimeFormats[iIndex]));
return AFDate_KeystrokeEx(pRuntime, newParams);
diff --git a/chromium/third_party/pdfium/fxjs/cjs_publicmethods_unittest.cpp b/chromium/third_party/pdfium/fxjs/cjs_publicmethods_unittest.cpp
index 739c03118bb..69ba63a00e7 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_publicmethods_unittest.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_publicmethods_unittest.cpp
@@ -4,8 +4,8 @@
#include "fxjs/cjs_publicmethods.h"
-#include "core/fxcrt/fx_memory.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/base/stl_util.h"
TEST(CJS_PublicMethods, IsNumber) {
// TODO(weili): Check whether results from case 0, 1, 10, 15 are intended.
@@ -43,7 +43,7 @@ TEST(CJS_PublicMethods, IsNumber) {
{L"0123", true},
{L"9876123", true},
};
- for (size_t i = 0; i < FX_ArraySize(test_data); ++i) {
+ for (size_t i = 0; i < pdfium::size(test_data); ++i) {
EXPECT_EQ(test_data[i].expected,
CJS_PublicMethods::IsNumber(test_data[i].input))
<< "for case " << i;
diff --git a/chromium/third_party/pdfium/fxjs/cjs_runtime.cpp b/chromium/third_party/pdfium/fxjs/cjs_runtime.cpp
index dba7e322843..d2c30d3b674 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_runtime.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_runtime.cpp
@@ -38,13 +38,14 @@
#include "fxjs/cjs_zoomtype.h"
#include "fxjs/fxv8.h"
#include "fxjs/js_define.h"
-#include "third_party/base/ptr_util.h"
CJS_Runtime::CJS_Runtime(CPDFSDK_FormFillEnvironment* pFormFillEnv)
: m_pFormFillEnv(pFormFillEnv) {
v8::Isolate* pIsolate = nullptr;
IPDF_JSPLATFORM* pPlatform = m_pFormFillEnv->GetFormFillInfo()->m_pJsPlatform;
if (pPlatform->version <= 2) {
+ // Backwards compatibility - JS now initialized earlier in more modern
+ // JSPLATFORM versions.
unsigned int embedderDataSlot = 0;
v8::Isolate* pExternalIsolate = nullptr;
if (pPlatform->version == 2) {
@@ -121,7 +122,7 @@ void CJS_Runtime::DefineJSObjects() {
}
IJS_EventContext* CJS_Runtime::NewEventContext() {
- m_EventContextArray.push_back(pdfium::MakeUnique<CJS_EventContext>(this));
+ m_EventContextArray.push_back(std::make_unique<CJS_EventContext>(this));
return m_EventContextArray.back().get();
}
diff --git a/chromium/third_party/pdfium/fxjs/cjs_runtimestub.cpp b/chromium/third_party/pdfium/fxjs/cjs_runtimestub.cpp
index 6e313de584a..fe5b1f62d7e 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_runtimestub.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_runtimestub.cpp
@@ -7,7 +7,6 @@
#include "fxjs/cjs_runtimestub.h"
#include "fxjs/cjs_event_context_stub.h"
-#include "third_party/base/ptr_util.h"
CJS_RuntimeStub::CJS_RuntimeStub(CPDFSDK_FormFillEnvironment* pFormFillEnv)
: m_pFormFillEnv(pFormFillEnv) {}
@@ -16,7 +15,7 @@ CJS_RuntimeStub::~CJS_RuntimeStub() = default;
IJS_EventContext* CJS_RuntimeStub::NewEventContext() {
if (!m_pContext)
- m_pContext = pdfium::MakeUnique<CJS_EventContextStub>();
+ m_pContext = std::make_unique<CJS_EventContextStub>();
return m_pContext.get();
}
diff --git a/chromium/third_party/pdfium/fxjs/cjs_util.cpp b/chromium/third_party/pdfium/fxjs/cjs_util.cpp
index 2f174fac38f..ad504ef7a62 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_util.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_util.cpp
@@ -15,7 +15,6 @@
#include "build/build_config.h"
#include "core/fxcrt/fx_extension.h"
-#include "core/fxcrt/fx_memory.h"
#include "fxjs/cjs_event_context.h"
#include "fxjs/cjs_eventrecorder.h"
#include "fxjs/cjs_object.h"
@@ -24,6 +23,7 @@
#include "fxjs/fx_date_helpers.h"
#include "fxjs/js_define.h"
#include "fxjs/js_resources.h"
+#include "third_party/base/stl_util.h"
#if defined(OS_ANDROID)
#include <ctype.h>
@@ -215,7 +215,7 @@ CJS_Result CJS_Util::printd(CJS_Runtime* pRuntime,
cFormat.erase(std::remove(cFormat.begin(), cFormat.end(), '%'),
cFormat.end());
- for (size_t i = 0; i < FX_ArraySize(TbConvertTable); ++i) {
+ for (size_t i = 0; i < pdfium::size(TbConvertTable); ++i) {
int iStart = 0;
int iEnd;
while ((iEnd = cFormat.find(TbConvertTable[i].lpszJSMark, iStart)) != -1) {
@@ -234,7 +234,7 @@ CJS_Result CJS_Util::printd(CJS_Runtime* pRuntime,
{L"M", min}, {L"s", sec},
};
- for (size_t i = 0; i < FX_ArraySize(cTableAd); ++i) {
+ for (size_t i = 0; i < pdfium::size(cTableAd); ++i) {
int iStart = 0;
int iEnd;
while ((iEnd = cFormat.find(cTableAd[i].lpszJSMark, iStart)) != -1) {
diff --git a/chromium/third_party/pdfium/fxjs/cjs_util_unittest.cpp b/chromium/third_party/pdfium/fxjs/cjs_util_unittest.cpp
index 7c105712b8a..b4c07f794f6 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_util_unittest.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_util_unittest.cpp
@@ -4,8 +4,8 @@
#include "fxjs/cjs_util.h"
-#include "core/fxcrt/fx_memory.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/base/stl_util.h"
TEST(CJS_Util, ParseDataType) {
struct ParseDataTypeCase {
@@ -105,7 +105,7 @@ TEST(CJS_Util, ParseDataType) {
{L"%10s", UTIL_STRING},
};
- for (size_t i = 0; i < FX_ArraySize(cases); i++) {
+ for (size_t i = 0; i < pdfium::size(cases); i++) {
WideString input(cases[i].input_string);
EXPECT_EQ(cases[i].expected, CJS_Util::ParseDataType(&input))
<< cases[i].input_string;
diff --git a/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp b/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp
index 5256fb1a59e..24d68908ba3 100644
--- a/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp
+++ b/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp
@@ -14,6 +14,7 @@
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_system.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
+#include "third_party/base/stl_util.h"
namespace fxjs {
namespace {
@@ -113,7 +114,7 @@ int MonthFromTime(double t) {
// Check for February onwards.
static constexpr int kCumulativeDaysInMonths[] = {
59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
- for (size_t i = 0; i < FX_ArraySize(kCumulativeDaysInMonths); ++i) {
+ for (size_t i = 0; i < pdfium::size(kCumulativeDaysInMonths); ++i) {
if (day < kCumulativeDaysInMonths[i])
return i + 1;
}
@@ -433,7 +434,7 @@ ConversionStatus FX_ParseDateUsingFormat(const WideString& value,
nSkip = FindSubWordLength(value, j);
if (nSkip == KMonthAbbreviationLength) {
WideString sMonth = value.Substr(j, KMonthAbbreviationLength);
- for (size_t m = 0; m < FX_ArraySize(kMonths); ++m) {
+ for (size_t m = 0; m < pdfium::size(kMonths); ++m) {
if (sMonth.CompareNoCase(kMonths[m]) == 0) {
nMonth = m + 1;
i += 3;
@@ -470,7 +471,7 @@ ConversionStatus FX_ParseDateUsingFormat(const WideString& value,
if (nSkip <= kLongestFullMonthLength) {
WideString sMonth = value.Substr(j, nSkip);
sMonth.MakeLower();
- for (size_t m = 0; m < FX_ArraySize(kFullMonths); ++m) {
+ for (size_t m = 0; m < pdfium::size(kFullMonths); ++m) {
WideString sFullMonths = WideString(kFullMonths[m]);
sFullMonths.MakeLower();
if (sFullMonths.Contains(sMonth.c_str())) {
diff --git a/chromium/third_party/pdfium/fxjs/gc/gced_tree_node.h b/chromium/third_party/pdfium/fxjs/gc/gced_tree_node.h
new file mode 100644
index 00000000000..a983fe540cd
--- /dev/null
+++ b/chromium/third_party/pdfium/fxjs/gc/gced_tree_node.h
@@ -0,0 +1,43 @@
+// Copyright 2020 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FXJS_GC_GCED_TREE_NODE_H_
+#define FXJS_GC_GCED_TREE_NODE_H_
+
+#include "core/fxcrt/tree_node.h"
+#include "third_party/base/logging.h"
+#include "v8/include/cppgc/allocation.h"
+#include "v8/include/cppgc/member.h"
+#include "v8/include/cppgc/visitor.h"
+
+namespace fxjs {
+
+// For DOM/XML-ish trees, where references outside the tree are RetainPtr<T>,
+// and the parent node also "retains" its children but doesn't always have
+// a direct pointer to them.
+template <typename T>
+class GCedTreeNode : public TreeNode<T, cppgc::Member<T>>,
+ public cppgc::GarbageCollected<GCedTreeNode<T>> {
+ public:
+ using TreeNode<T, cppgc::Member<T>>::RemoveChild;
+
+ virtual void Trace(cppgc::Visitor* visitor) const {
+ visitor->Trace(TreeNode<T, cppgc::Member<T>>::RawParent());
+ visitor->Trace(TreeNode<T, cppgc::Member<T>>::RawFirstChild());
+ visitor->Trace(TreeNode<T, cppgc::Member<T>>::RawLastChild());
+ visitor->Trace(TreeNode<T, cppgc::Member<T>>::RawNextSibling());
+ visitor->Trace(TreeNode<T, cppgc::Member<T>>::RawPrevSibling());
+ }
+
+ protected:
+ GCedTreeNode() = default;
+ GCedTreeNode(const GCedTreeNode& that) = delete;
+ GCedTreeNode& operator=(const GCedTreeNode& that) = delete;
+};
+
+} // namespace fxjs
+
+using fxjs::GCedTreeNode;
+
+#endif // FXJS_GC_GCED_TREE_NODE_H_
diff --git a/chromium/third_party/pdfium/fxjs/gc/gced_tree_node_embeddertest.cpp b/chromium/third_party/pdfium/fxjs/gc/gced_tree_node_embeddertest.cpp
new file mode 100644
index 00000000000..9dd218b91dc
--- /dev/null
+++ b/chromium/third_party/pdfium/fxjs/gc/gced_tree_node_embeddertest.cpp
@@ -0,0 +1,146 @@
+// Copyright 2020 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "fxjs/gc/gced_tree_node.h"
+
+#include "core/fxcrt/observed_ptr.h"
+#include "fxjs/gc/heap.h"
+#include "testing/gced_embeddertest.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/base/stl_util.h"
+#include "v8/include/cppgc/allocation.h"
+#include "v8/include/cppgc/persistent.h"
+
+namespace {
+
+class ObservableGCedTreeNodeForTest
+ : public GCedTreeNode<ObservableGCedTreeNodeForTest>,
+ public Observable {
+ public:
+ CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
+
+ private:
+ ObservableGCedTreeNodeForTest() = default;
+};
+
+} // namespace
+
+class GCedTreeNodeEmbedderTest : public GCedEmbedderTest {
+ public:
+ static cppgc::Persistent<ObservableGCedTreeNodeForTest> s_root;
+
+ void SetUp() override {
+ GCedEmbedderTest::SetUp();
+ heap_ = FXGC_CreateHeap();
+ }
+
+ void TearDown() override {
+ s_root = nullptr; // Can't (yet) outlive |heap_|.
+ heap_.reset();
+ GCedEmbedderTest::TearDown();
+ }
+
+ cppgc::Heap* heap() const { return heap_.get(); }
+ ObservableGCedTreeNodeForTest* CreateNode() {
+ return cppgc::MakeGarbageCollected<ObservableGCedTreeNodeForTest>(
+ heap_.get());
+ }
+
+ void ForceGCAndPump() {
+ heap()->ForceGarbageCollectionSlow(
+ "GCedTreeNodeEmbedderTest", "test",
+ cppgc::Heap::StackState::kNoHeapPointers);
+ PumpPlatformMessageLoop();
+ }
+
+ void AddClutterToFront(ObservableGCedTreeNodeForTest* parent) {
+ for (int i = 0; i < 4; ++i) {
+ parent->AppendFirstChild(
+ cppgc::MakeGarbageCollected<ObservableGCedTreeNodeForTest>(
+ heap_.get()));
+ }
+ }
+
+ void AddClutterToBack(ObservableGCedTreeNodeForTest* parent) {
+ for (int i = 0; i < 4; ++i) {
+ parent->AppendLastChild(
+ cppgc::MakeGarbageCollected<ObservableGCedTreeNodeForTest>(
+ heap_.get()));
+ }
+ }
+
+ private:
+ FXGCScopedHeap heap_;
+};
+
+cppgc::Persistent<ObservableGCedTreeNodeForTest>
+ GCedTreeNodeEmbedderTest::s_root;
+
+TEST_F(GCedTreeNodeEmbedderTest, OneRefence) {
+ s_root = CreateNode();
+ ObservedPtr<ObservableGCedTreeNodeForTest> watcher(s_root);
+ ForceGCAndPump();
+ EXPECT_TRUE(watcher);
+}
+
+TEST_F(GCedTreeNodeEmbedderTest, NoReferences) {
+ ObservedPtr<ObservableGCedTreeNodeForTest> watcher(CreateNode());
+ ForceGCAndPump();
+ EXPECT_FALSE(watcher);
+}
+
+TEST_F(GCedTreeNodeEmbedderTest, FirstHasParent) {
+ s_root = CreateNode();
+ ObservedPtr<ObservableGCedTreeNodeForTest> watcher(CreateNode());
+ s_root->AppendFirstChild(watcher.Get());
+ ForceGCAndPump();
+ ASSERT_TRUE(s_root);
+ EXPECT_TRUE(watcher);
+ s_root->RemoveChild(watcher.Get());
+ ForceGCAndPump();
+ ASSERT_TRUE(s_root);
+ EXPECT_FALSE(watcher);
+
+ // Now add some clutter.
+ watcher.Reset(CreateNode());
+ s_root->AppendFirstChild(watcher.Get());
+ AddClutterToFront(s_root);
+ AddClutterToBack(s_root);
+ ForceGCAndPump();
+ ASSERT_TRUE(s_root);
+ EXPECT_TRUE(watcher);
+ s_root->RemoveChild(watcher.Get());
+ ForceGCAndPump();
+ EXPECT_TRUE(s_root);
+ EXPECT_FALSE(watcher);
+}
+
+TEST_F(GCedTreeNodeEmbedderTest, RemoveSelf) {
+ s_root = CreateNode();
+ ObservedPtr<ObservableGCedTreeNodeForTest> watcher(CreateNode());
+ s_root->AppendFirstChild(watcher.Get());
+ ForceGCAndPump();
+ EXPECT_TRUE(s_root);
+ ASSERT_TRUE(watcher);
+ watcher->RemoveSelfIfParented();
+ ForceGCAndPump();
+ EXPECT_TRUE(s_root);
+ EXPECT_FALSE(watcher);
+}
+
+TEST_F(GCedTreeNodeEmbedderTest, InsertBeforeAfter) {
+ s_root = CreateNode();
+ AddClutterToFront(s_root);
+ ObservedPtr<ObservableGCedTreeNodeForTest> watcher(CreateNode());
+ s_root->AppendFirstChild(watcher.Get());
+ s_root->InsertBefore(s_root->GetFirstChild(), s_root->GetLastChild());
+ s_root->InsertAfter(s_root->GetLastChild(), s_root->GetFirstChild());
+ ForceGCAndPump();
+ ASSERT_TRUE(s_root);
+ EXPECT_TRUE(watcher);
+ s_root->RemoveChild(watcher.Get());
+ ForceGCAndPump();
+ EXPECT_TRUE(s_root);
+ EXPECT_FALSE(watcher);
+}
diff --git a/chromium/third_party/pdfium/fxjs/gc/heap.cpp b/chromium/third_party/pdfium/fxjs/gc/heap.cpp
new file mode 100644
index 00000000000..9dade5cacf0
--- /dev/null
+++ b/chromium/third_party/pdfium/fxjs/gc/heap.cpp
@@ -0,0 +1,77 @@
+// Copyright 2020 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "fxjs/gc/heap.h"
+
+#include "core/fxcrt/fx_system.h"
+#include "third_party/base/ptr_util.h"
+
+namespace {
+
+size_t g_platform_ref_count = 0;
+v8::Platform* g_platform = nullptr;
+
+} // namespace
+
+class CFXGC_Platform final : public cppgc::Platform {
+ public:
+ CFXGC_Platform() = default;
+ ~CFXGC_Platform() override = default;
+
+ cppgc::PageAllocator* GetPageAllocator() override {
+ return g_platform->GetPageAllocator();
+ }
+
+ double MonotonicallyIncreasingTime() override {
+ return g_platform->MonotonicallyIncreasingTime();
+ }
+
+ std::shared_ptr<cppgc::TaskRunner> GetForegroundTaskRunner() override {
+ // V8's default platform creates a new task runner when passed the
+ // v8::Isolate pointer the first time. For non-default platforms this will
+ // require getting the appropriate task runner.
+ return g_platform->GetForegroundTaskRunner(nullptr);
+ }
+
+ std::unique_ptr<cppgc::JobHandle> PostJob(
+ cppgc::TaskPriority priority,
+ std::unique_ptr<cppgc::JobTask> job_task) override {
+ return g_platform->PostJob(priority, std::move(job_task));
+ }
+};
+
+void FXGC_Initialize(v8::Platform* platform) {
+ if (platform) {
+ ASSERT(!g_platform);
+ g_platform = platform;
+ cppgc::InitializeProcess(platform->GetPageAllocator());
+ }
+}
+
+void FXGC_Release() {
+ if (g_platform && g_platform_ref_count == 0) {
+ cppgc::ShutdownProcess();
+ g_platform = nullptr;
+ }
+}
+
+FXGCScopedHeap FXGC_CreateHeap() {
+ // If XFA is included at compile-time, but JS is disabled at run-time,
+ // we may still attempt to build a CPDFXFA_Context which will want a
+ // heap. But we can't make one because JS is disabled.
+ // TODO(tsepez): Stop the context from even being created.
+ if (!g_platform)
+ return nullptr;
+
+ ++g_platform_ref_count;
+ auto heap = cppgc::Heap::Create(std::make_shared<CFXGC_Platform>());
+ return FXGCScopedHeap(heap.release());
+}
+
+void FXGCHeapDeleter::operator()(cppgc::Heap* heap) {
+ ASSERT(heap);
+ ASSERT(g_platform_ref_count > 0);
+ --g_platform_ref_count;
+ delete heap;
+}
diff --git a/chromium/third_party/pdfium/fxjs/gc/heap.h b/chromium/third_party/pdfium/fxjs/gc/heap.h
new file mode 100644
index 00000000000..96ec209d70b
--- /dev/null
+++ b/chromium/third_party/pdfium/fxjs/gc/heap.h
@@ -0,0 +1,27 @@
+// Copyright 2020 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FXJS_GC_HEAP_H_
+#define FXJS_GC_HEAP_H_
+
+#include <memory>
+
+#include "v8/include/cppgc/heap.h"
+#include "v8/include/libplatform/libplatform.h"
+
+struct FXGCHeapDeleter {
+ void operator()(cppgc::Heap* heap);
+};
+
+using FXGCScopedHeap = std::unique_ptr<cppgc::Heap, FXGCHeapDeleter>;
+
+void FXGC_Initialize(v8::Platform* platform);
+void FXGC_Release();
+FXGCScopedHeap FXGC_CreateHeap();
+
+#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED \
+ template <typename T> \
+ friend class cppgc::MakeGarbageCollectedTrait
+
+#endif // FXJS_GC_HEAP_H_
diff --git a/chromium/third_party/pdfium/fxjs/gc/heap_embeddertest.cpp b/chromium/third_party/pdfium/fxjs/gc/heap_embeddertest.cpp
new file mode 100644
index 00000000000..4930d448f5b
--- /dev/null
+++ b/chromium/third_party/pdfium/fxjs/gc/heap_embeddertest.cpp
@@ -0,0 +1,106 @@
+// Copyright 2020 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "fxjs/gc/heap.h"
+
+#include <memory>
+#include <set>
+
+#include "testing/gced_embeddertest.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/base/stl_util.h"
+#include "v8/include/cppgc/allocation.h"
+#include "v8/include/cppgc/persistent.h"
+
+namespace {
+
+class PseudoCollectible : public cppgc::GarbageCollected<PseudoCollectible> {
+ public:
+ static cppgc::Persistent<PseudoCollectible> s_persistent_;
+
+ static void Clear() {
+ s_live_.clear();
+ s_dead_.clear();
+ s_persistent_ = nullptr;
+ }
+ static size_t LiveCount() { return s_live_.size(); }
+ static size_t DeadCount() { return s_dead_.size(); }
+
+ PseudoCollectible() { s_live_.insert(this); }
+ virtual ~PseudoCollectible() {
+ s_live_.erase(this);
+ s_dead_.insert(this);
+ }
+
+ bool IsLive() const { return pdfium::Contains(s_live_, this); }
+
+ virtual void Trace(cppgc::Visitor* visitor) const {}
+
+ private:
+ static std::set<const PseudoCollectible*> s_live_;
+ static std::set<const PseudoCollectible*> s_dead_;
+};
+
+std::set<const PseudoCollectible*> PseudoCollectible::s_live_;
+std::set<const PseudoCollectible*> PseudoCollectible::s_dead_;
+cppgc::Persistent<PseudoCollectible> PseudoCollectible::s_persistent_;
+
+} // namespace
+
+class HeapEmbedderTest : public GCedEmbedderTest {};
+
+TEST_F(HeapEmbedderTest, SeveralHeaps) {
+ FXGCScopedHeap heap1 = FXGC_CreateHeap();
+ EXPECT_TRUE(heap1);
+
+ FXGCScopedHeap heap2 = FXGC_CreateHeap();
+ EXPECT_TRUE(heap2);
+
+ FXGCScopedHeap heap3 = FXGC_CreateHeap();
+ EXPECT_TRUE(heap3);
+
+ // Test manually destroying the heap.
+ heap3.reset();
+ EXPECT_FALSE(heap3);
+ heap3.reset();
+ EXPECT_FALSE(heap3);
+}
+
+TEST_F(HeapEmbedderTest, NoReferences) {
+ FXGCScopedHeap heap1 = FXGC_CreateHeap();
+ ASSERT_TRUE(heap1);
+
+ PseudoCollectible::s_persistent_ =
+ cppgc::MakeGarbageCollected<PseudoCollectible>(heap1.get());
+ EXPECT_TRUE(PseudoCollectible::s_persistent_->IsLive());
+ EXPECT_EQ(1u, PseudoCollectible::LiveCount());
+ EXPECT_EQ(0u, PseudoCollectible::DeadCount());
+
+ PseudoCollectible::s_persistent_ = nullptr;
+ heap1->ForceGarbageCollectionSlow("NoReferences", "test",
+ cppgc::Heap::StackState::kNoHeapPointers);
+ PumpPlatformMessageLoop();
+ EXPECT_EQ(0u, PseudoCollectible::LiveCount());
+ EXPECT_EQ(1u, PseudoCollectible::DeadCount());
+ PseudoCollectible::Clear();
+}
+
+TEST_F(HeapEmbedderTest, HasReferences) {
+ FXGCScopedHeap heap1 = FXGC_CreateHeap();
+ ASSERT_TRUE(heap1);
+
+ PseudoCollectible::s_persistent_ =
+ cppgc::MakeGarbageCollected<PseudoCollectible>(heap1.get());
+ EXPECT_TRUE(PseudoCollectible::s_persistent_->IsLive());
+ EXPECT_EQ(1u, PseudoCollectible::LiveCount());
+ EXPECT_EQ(0u, PseudoCollectible::DeadCount());
+
+ heap1->ForceGarbageCollectionSlow("HasReferences", "test",
+ cppgc::Heap::StackState::kNoHeapPointers);
+ PumpPlatformMessageLoop();
+ EXPECT_TRUE(PseudoCollectible::s_persistent_->IsLive());
+ EXPECT_EQ(1u, PseudoCollectible::LiveCount());
+ EXPECT_EQ(0u, PseudoCollectible::DeadCount());
+ PseudoCollectible::Clear();
+}
diff --git a/chromium/third_party/pdfium/fxjs/global_timer.cpp b/chromium/third_party/pdfium/fxjs/global_timer.cpp
index 2d5ca177252..ded2596287f 100644
--- a/chromium/third_party/pdfium/fxjs/global_timer.cpp
+++ b/chromium/third_party/pdfium/fxjs/global_timer.cpp
@@ -36,7 +36,7 @@ GlobalTimer::GlobalTimer(CJS_App* pObj,
m_pRuntime(pRuntime),
m_pEmbedApp(pObj) {
if (HasValidID()) {
- ASSERT(!pdfium::ContainsKey(GetGlobalTimerMap(), m_nTimerID));
+ ASSERT(!pdfium::Contains(GetGlobalTimerMap(), m_nTimerID));
GetGlobalTimerMap()[m_nTimerID] = this;
}
}
@@ -48,7 +48,7 @@ GlobalTimer::~GlobalTimer() {
if (m_pRuntime && m_pRuntime->GetTimerHandler())
m_pRuntime->GetTimerHandler()->KillTimer(m_nTimerID);
- ASSERT(pdfium::ContainsKey(GetGlobalTimerMap(), m_nTimerID));
+ ASSERT(pdfium::Contains(GetGlobalTimerMap(), m_nTimerID));
GetGlobalTimerMap().erase(m_nTimerID);
}
diff --git a/chromium/third_party/pdfium/fxjs/ijs_runtime.cpp b/chromium/third_party/pdfium/fxjs/ijs_runtime.cpp
index 34a846e9e3a..b5d3f4a070b 100644
--- a/chromium/third_party/pdfium/fxjs/ijs_runtime.cpp
+++ b/chromium/third_party/pdfium/fxjs/ijs_runtime.cpp
@@ -5,12 +5,14 @@
#include "fxjs/ijs_runtime.h"
#include "fxjs/cjs_runtimestub.h"
-#include "third_party/base/ptr_util.h"
#ifdef PDF_ENABLE_V8
#include "fxjs/cfxjs_engine.h"
#include "fxjs/cjs_runtime.h"
-#endif
+#ifdef PDF_ENABLE_XFA
+#include "fxjs/gc/heap.h"
+#endif // PDF_ENABLE_XFA
+#endif // PDF_ENABLE_V8
IJS_Runtime::ScopedEventContext::ScopedEventContext(IJS_Runtime* pRuntime)
: m_pRuntime(pRuntime), m_pContext(pRuntime->NewEventContext()) {}
@@ -20,17 +22,23 @@ IJS_Runtime::ScopedEventContext::~ScopedEventContext() {
}
// static
-void IJS_Runtime::Initialize(unsigned int slot, void* isolate) {
+void IJS_Runtime::Initialize(unsigned int slot, void* isolate, void* platform) {
#ifdef PDF_ENABLE_V8
FXJS_Initialize(slot, static_cast<v8::Isolate*>(isolate));
-#endif
+#ifdef PDF_ENABLE_XFA
+ FXGC_Initialize(static_cast<v8::Platform*>(platform));
+#endif // PDF_ENABLE_XFA
+#endif // PDF_ENABLE_V8
}
// static
void IJS_Runtime::Destroy() {
#ifdef PDF_ENABLE_V8
+#ifdef PDF_ENABLE_XFA
+ FXGC_Release();
+#endif // PDF_ENABLE_XFA
FXJS_Release();
-#endif
+#endif // PDF_ENABLE_V8
}
// static
@@ -38,9 +46,9 @@ std::unique_ptr<IJS_Runtime> IJS_Runtime::Create(
CPDFSDK_FormFillEnvironment* pFormFillEnv) {
#ifdef PDF_ENABLE_V8
if (pFormFillEnv->IsJSPlatformPresent())
- return pdfium::MakeUnique<CJS_Runtime>(pFormFillEnv);
+ return std::make_unique<CJS_Runtime>(pFormFillEnv);
#endif
- return pdfium::MakeUnique<CJS_RuntimeStub>(pFormFillEnv);
+ return std::make_unique<CJS_RuntimeStub>(pFormFillEnv);
}
IJS_Runtime::~IJS_Runtime() = default;
diff --git a/chromium/third_party/pdfium/fxjs/ijs_runtime.h b/chromium/third_party/pdfium/fxjs/ijs_runtime.h
index b61eca80715..e18b8d46e1e 100644
--- a/chromium/third_party/pdfium/fxjs/ijs_runtime.h
+++ b/chromium/third_party/pdfium/fxjs/ijs_runtime.h
@@ -44,7 +44,7 @@ class IJS_Runtime {
UnownedPtr<IJS_EventContext> m_pContext;
};
- static void Initialize(unsigned int slot, void* isolate);
+ static void Initialize(unsigned int slot, void* isolate, void* platform);
static void Destroy();
static std::unique_ptr<IJS_Runtime> Create(
CPDFSDK_FormFillEnvironment* pFormFillEnv);
diff --git a/chromium/third_party/pdfium/fxjs/js_define.h b/chromium/third_party/pdfium/fxjs/js_define.h
index 2c15c9f4e28..9067980cfc7 100644
--- a/chromium/third_party/pdfium/fxjs/js_define.h
+++ b/chromium/third_party/pdfium/fxjs/js_define.h
@@ -7,6 +7,7 @@
#ifndef FXJS_JS_DEFINE_H_
#define FXJS_JS_DEFINE_H_
+#include <memory>
#include <vector>
#include "core/fxcrt/unowned_ptr.h"
@@ -14,7 +15,6 @@
#include "fxjs/cjs_result.h"
#include "fxjs/cjs_runtime.h"
#include "fxjs/js_resources.h"
-#include "third_party/base/ptr_util.h"
class CJS_Object;
@@ -44,7 +44,7 @@ bool IsExpandedParamKnown(v8::Local<v8::Value> value);
template <class T>
static void JSConstructor(CFXJS_Engine* pEngine, v8::Local<v8::Object> obj) {
pEngine->SetObjectPrivate(
- obj, pdfium::MakeUnique<T>(obj, static_cast<CJS_Runtime*>(pEngine)));
+ obj, std::make_unique<T>(obj, static_cast<CJS_Runtime*>(pEngine)));
}
// CJS_Object has virtual dtor, template not required.
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_class.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_class.cpp
index b411bcd254d..411542a2d38 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_class.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_class.cpp
@@ -16,7 +16,6 @@
#include "fxjs/xfa/cfxjse_context.h"
#include "fxjs/xfa/cfxjse_isolatetracker.h"
#include "fxjs/xfa/cfxjse_value.h"
-#include "third_party/base/ptr_util.h"
using pdfium::fxjse::kClassTag;
using pdfium::fxjse::kFuncTag;
@@ -187,7 +186,7 @@ void NamedPropertyQueryCallback(
v8::HandleScope scope(info.GetIsolate());
v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
- auto lpThisValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto lpThisValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
if (DynPropQueryAdapter(lpClass, lpThisValue.get(), szFxPropName)) {
info.GetReturnValue().Set(v8::DontDelete);
@@ -208,9 +207,9 @@ void NamedPropertyGetterCallback(
v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
- auto lpThisValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto lpThisValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
- auto lpNewValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto lpNewValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
DynPropGetterAdapter(info.GetIsolate(), lpClass, lpThisValue.get(),
szFxPropName, lpNewValue.get());
info.GetReturnValue().Set(lpNewValue->DirectGetValue());
@@ -228,9 +227,9 @@ void NamedPropertySetterCallback(
v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
- auto lpThisValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto lpThisValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
- auto lpNewValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto lpNewValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
lpNewValue->ForceSetValue(value);
DynPropSetterAdapter(lpClass, lpThisValue.get(), szFxPropName,
lpNewValue.get());
@@ -273,7 +272,7 @@ CFXJSE_Class* CFXJSE_Class::Create(
return pExistingClass;
v8::Isolate* pIsolate = lpContext->GetIsolate();
- auto pClass = pdfium::MakeUnique<CFXJSE_Class>(lpContext);
+ auto pClass = std::make_unique<CFXJSE_Class>(lpContext);
pClass->m_szClassName = lpClassDefinition->name;
pClass->m_lpClassDefinition = lpClassDefinition;
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
@@ -322,4 +321,4 @@ CFXJSE_Class* CFXJSE_Class::Create(
CFXJSE_Class::CFXJSE_Class(CFXJSE_Context* lpContext) : m_pContext(lpContext) {}
-CFXJSE_Class::~CFXJSE_Class() {}
+CFXJSE_Class::~CFXJSE_Class() = default;
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_context.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_context.cpp
index a2507553ecb..134154e08bd 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_context.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_context.cpp
@@ -14,7 +14,6 @@
#include "fxjs/xfa/cfxjse_isolatetracker.h"
#include "fxjs/xfa/cfxjse_runtimedata.h"
#include "fxjs/xfa/cfxjse_value.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -176,7 +175,7 @@ std::unique_ptr<CFXJSE_Context> CFXJSE_Context::Create(
const FXJSE_CLASS_DESCRIPTOR* pGlobalClass,
CFXJSE_HostObject* pGlobalObject) {
CFXJSE_ScopeUtil_IsolateHandle scope(pIsolate);
- auto pContext = pdfium::MakeUnique<CFXJSE_Context>(pIsolate);
+ auto pContext = std::make_unique<CFXJSE_Context>(pIsolate);
v8::Local<v8::ObjectTemplate> hObjectTemplate;
if (pGlobalClass) {
CFXJSE_Class* pGlobalClassObj =
@@ -210,10 +209,10 @@ std::unique_ptr<CFXJSE_Context> CFXJSE_Context::Create(
CFXJSE_Context::CFXJSE_Context(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}
-CFXJSE_Context::~CFXJSE_Context() {}
+CFXJSE_Context::~CFXJSE_Context() = default;
std::unique_ptr<CFXJSE_Value> CFXJSE_Context::GetGlobalObject() {
- auto pValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>(GetIsolate());
CFXJSE_ScopeUtil_IsolateHandleContext scope(this);
v8::Local<v8::Context> hContext =
v8::Local<v8::Context>::New(GetIsolate(), m_hContext);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_engine.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_engine.cpp
index ffcd55de8f1..e3f62787f8a 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_engine.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_engine.cpp
@@ -18,7 +18,6 @@
#include "fxjs/xfa/cfxjse_resolveprocessor.h"
#include "fxjs/xfa/cfxjse_value.h"
#include "fxjs/xfa/cjx_object.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxfa/cxfa_eventparam.h"
#include "xfa/fxfa/cxfa_ffdoc.h"
@@ -112,7 +111,7 @@ CFXJSE_Engine::CFXJSE_Engine(CXFA_Document* pDocument,
m_JsContext(CFXJSE_Context::Create(fxjs_runtime->GetIsolate(),
&GlobalClassDescriptor,
pDocument->GetRoot())),
- m_ResolveProcessor(pdfium::MakeUnique<CFXJSE_ResolveProcessor>()) {
+ m_ResolveProcessor(std::make_unique<CFXJSE_ResolveProcessor>()) {
RemoveBuiltInObjs(m_JsContext.get());
m_JsContext->EnableCompatibleMode();
@@ -139,7 +138,7 @@ bool CFXJSE_Engine::RunScript(CXFA_Script::Type eScriptType,
m_eScriptType = eScriptType;
if (eScriptType == CXFA_Script::Type::Formcalc) {
if (!m_FM2JSContext) {
- m_FM2JSContext = pdfium::MakeUnique<CFXJSE_FormCalcContext>(
+ m_FM2JSContext = std::make_unique<CFXJSE_FormCalcContext>(
GetIsolate(), m_JsContext.get(), m_pDocument.Get());
}
CFX_WideTextBuf wsJavaScript;
@@ -547,7 +546,7 @@ bool CFXJSE_Engine::RunVariablesScript(CXFA_Node* pScriptNode) {
return false;
ByteString btScript = wsScript->ToUTF8();
- auto hRetValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto hRetValue = std::make_unique<CFXJSE_Value>(GetIsolate());
CXFA_Node* pThisObject = pParent->GetParent();
CFXJSE_Context* pVariablesContext =
CreateVariablesContext(pScriptNode, pThisObject);
@@ -575,7 +574,7 @@ bool CFXJSE_Engine::QueryVariableValue(CXFA_Node* pScriptNode,
CFXJSE_Context* pVariableContext = it->second.get();
std::unique_ptr<CFXJSE_Value> pObject = pVariableContext->GetGlobalObject();
- auto hVariableValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto hVariableValue = std::make_unique<CFXJSE_Value>(GetIsolate());
if (!bGetter) {
pObject->SetObjectOwnProperty(szPropName, pValue);
return true;
@@ -597,7 +596,7 @@ bool CFXJSE_Engine::QueryVariableValue(CXFA_Node* pScriptNode,
void CFXJSE_Engine::RemoveBuiltInObjs(CFXJSE_Context* pContext) const {
const ByteStringView kObjNames[2] = {"Number", "Date"};
std::unique_ptr<CFXJSE_Value> pObject = pContext->GetGlobalObject();
- auto hProp = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto hProp = std::make_unique<CFXJSE_Value>(GetIsolate());
for (const auto& obj : kObjNames) {
if (pObject->GetObjectProperty(obj, hProp.get()))
pObject->DeleteObjectProperty(obj);
@@ -696,7 +695,7 @@ bool CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
rndFind.m_ScriptAttribute.callback &&
nStart <
pdfium::base::checked_cast<int32_t>(wsExpression.GetLength())) {
- auto pValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>(GetIsolate());
CJX_Object* jsObject = rndFind.m_Objects.front()->JSObject();
(*rndFind.m_ScriptAttribute.callback)(
jsObject, pValue.get(), false, rndFind.m_ScriptAttribute.attribute);
@@ -783,7 +782,7 @@ CFXJSE_Value* CFXJSE_Engine::GetOrCreateJSBindingFromMap(CXFA_Object* pObject) {
if (iter != m_mapObjectToValue.end())
return iter->second.get();
- auto jsValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto jsValue = std::make_unique<CFXJSE_Value>(GetIsolate());
jsValue->SetHostObject(pObject, m_pJsClass.Get());
CFXJSE_Value* pValue = jsValue.get();
@@ -805,7 +804,7 @@ void CFXJSE_Engine::SetNodesOfRunScript(std::vector<CXFA_Node*>* pArray) {
}
void CFXJSE_Engine::AddNodesOfRunScript(CXFA_Node* pNode) {
- if (m_pScriptNodeArray && !pdfium::ContainsValue(*m_pScriptNodeArray, pNode))
+ if (m_pScriptNodeArray && !pdfium::Contains(*m_pScriptNodeArray, pNode))
m_pScriptNodeArray->push_back(pNode);
}
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp
index 815c5a48410..d93f3b76167 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp
@@ -8,7 +8,6 @@
#include <algorithm>
#include <cstdlib>
-#include <string>
#include <utility>
#include "core/fxcrt/cfx_widetextbuf.h"
@@ -20,7 +19,6 @@
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cfxjse_value.h"
#include "fxjs/xfa/cjx_object.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fgas/crt/cfgas_decimal.h"
#include "xfa/fgas/crt/locale_iface.h"
@@ -280,7 +278,7 @@ const uint8_t kAltTableDate[] = {
255, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 1, 255, 255, 255, 255, 255, 255, 255, 255,
};
-static_assert(FX_ArraySize(kAltTableDate) == L'a' - L'A' + 1,
+static_assert(pdfium::size(kAltTableDate) == L'a' - L'A' + 1,
"Invalid kAltTableDate size.");
const uint8_t kAltTableTime[] = {
@@ -288,7 +286,7 @@ const uint8_t kAltTableTime[] = {
255, 6, 255, 255, 255, 255, 255, 7, 255, 255, 255,
255, 255, 1, 17, 255, 255, 255, 255, 255, 255, 255,
};
-static_assert(FX_ArraySize(kAltTableTime) == L'a' - L'A' + 1,
+static_assert(pdfium::size(kAltTableTime) == L'a' - L'A' + 1,
"Invalid kAltTableTime size.");
void AlternateDateTimeSymbols(WideString* pPattern,
@@ -982,7 +980,7 @@ WideString EncodeURL(const ByteString& bsURL) {
szEncode[3] = 0;
for (wchar_t ch : wsURL) {
size_t i = 0;
- size_t iCount = FX_ArraySize(kStrUnsafe);
+ size_t iCount = pdfium::size(kStrUnsafe);
while (i < iCount) {
if (ch == kStrUnsafe[i]) {
int32_t iIndex = ch / 16;
@@ -997,7 +995,7 @@ WideString EncodeURL(const ByteString& bsURL) {
continue;
i = 0;
- iCount = FX_ArraySize(kStrReserved);
+ iCount = pdfium::size(kStrReserved);
while (i < iCount) {
if (ch == kStrReserved[i]) {
int32_t iIndex = ch / 16;
@@ -1012,7 +1010,7 @@ WideString EncodeURL(const ByteString& bsURL) {
continue;
i = 0;
- iCount = FX_ArraySize(kStrSpecial);
+ iCount = pdfium::size(kStrSpecial);
while (i < iCount) {
if (ch == kStrSpecial[i]) {
wsResultBuf.AppendChar(ch);
@@ -1345,7 +1343,7 @@ const FXJSE_CLASS_DESCRIPTOR kFormCalcFM2JSDescriptor = {
kClassTag, // tag
"XFA_FM2JS_FormCalcClass", // name
kFormCalcFM2JSFunctions, // methods
- FX_ArraySize(kFormCalcFM2JSFunctions), // number of methods
+ pdfium::size(kFormCalcFM2JSFunctions), // number of methods
nullptr, // dynamic prop type
nullptr, // dynamic prop getter
nullptr, // dynamic prop setter
@@ -1361,7 +1359,7 @@ void CFXJSE_FormCalcContext::Abs(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (ValueIsNull(pThis, argOne.get())) {
info.GetReturnValue().SetNull();
return;
@@ -1387,8 +1385,7 @@ void CFXJSE_FormCalcContext::Avg(
uint32_t uCount = 0;
double dSum = 0.0;
for (int32_t i = 0; i < argc; i++) {
- auto argValue =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[i]);
+ auto argValue = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[i]);
if (argValue->IsNull())
continue;
@@ -1398,19 +1395,19 @@ void CFXJSE_FormCalcContext::Avg(
continue;
}
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength > 2) {
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectPropertyByIdx(1, propertyValue.get());
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
if (propertyValue->IsNull()) {
for (int32_t j = 2; j < iLength; j++) {
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get());
- auto defaultPropValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto defaultPropValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(jsObjectValue.get(), defaultPropValue.get());
if (defaultPropValue->IsNull())
continue;
@@ -1421,7 +1418,7 @@ void CFXJSE_FormCalcContext::Avg(
} else {
for (int32_t j = 2; j < iLength; j++) {
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get());
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
jsObjectValue->GetObjectProperty(
propertyValue->ToString().AsStringView(), newPropertyValue.get());
if (newPropertyValue->IsNull())
@@ -1467,13 +1464,12 @@ void CFXJSE_FormCalcContext::Count(
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
int32_t iCount = 0;
for (int32_t i = 0; i < info.Length(); i++) {
- auto argValue =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[i]);
+ auto argValue = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[i]);
if (argValue->IsNull())
continue;
if (argValue->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
@@ -1482,9 +1478,9 @@ void CFXJSE_FormCalcContext::Count(
return;
}
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectPropertyByIdx(1, propertyValue.get());
argValue->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
@@ -1503,7 +1499,7 @@ void CFXJSE_FormCalcContext::Count(
}
}
} else if (argValue->IsObject()) {
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(argValue.get(), newPropertyValue.get());
if (!newPropertyValue->IsNull())
iCount++;
@@ -1541,13 +1537,12 @@ void CFXJSE_FormCalcContext::Max(
uint32_t uCount = 0;
double dMaxValue = 0.0;
for (int32_t i = 0; i < info.Length(); i++) {
- auto argValue =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[i]);
+ auto argValue = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[i]);
if (argValue->IsNull())
continue;
if (argValue->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength <= 2) {
@@ -1555,9 +1550,9 @@ void CFXJSE_FormCalcContext::Max(
return;
}
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectPropertyByIdx(1, propertyValue.get());
argValue->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
@@ -1585,7 +1580,7 @@ void CFXJSE_FormCalcContext::Max(
}
}
} else if (argValue->IsObject()) {
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(argValue.get(), newPropertyValue.get());
if (newPropertyValue->IsNull())
continue;
@@ -1615,13 +1610,12 @@ void CFXJSE_FormCalcContext::Min(
uint32_t uCount = 0;
double dMinValue = 0.0;
for (int32_t i = 0; i < info.Length(); i++) {
- auto argValue =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[i]);
+ auto argValue = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[i]);
if (argValue->IsNull())
continue;
if (argValue->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength <= 2) {
@@ -1629,9 +1623,9 @@ void CFXJSE_FormCalcContext::Min(
return;
}
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectPropertyByIdx(1, propertyValue.get());
argValue->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
@@ -1659,7 +1653,7 @@ void CFXJSE_FormCalcContext::Min(
}
}
} else if (argValue->IsObject()) {
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(argValue.get(), newPropertyValue.get());
if (newPropertyValue->IsNull())
continue;
@@ -1691,8 +1685,8 @@ void CFXJSE_FormCalcContext::Mod(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
- auto argTwo = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[1]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argTwo = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[1]);
if (argOne->IsNull() || argTwo->IsNull()) {
info.GetReturnValue().SetNull();
return;
@@ -1727,7 +1721,7 @@ void CFXJSE_FormCalcContext::Round(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (argOne->IsNull()) {
info.GetReturnValue().SetNull();
return;
@@ -1742,7 +1736,7 @@ void CFXJSE_FormCalcContext::Round(
uint8_t uPrecision = 0;
if (argc > 1) {
- auto argTwo = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[1]);
+ auto argTwo = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[1]);
if (argTwo->IsNull()) {
info.GetReturnValue().SetNull();
return;
@@ -1777,13 +1771,12 @@ void CFXJSE_FormCalcContext::Sum(
uint32_t uCount = 0;
double dSum = 0.0;
for (int32_t i = 0; i < argc; i++) {
- auto argValue =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[i]);
+ auto argValue = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[i]);
if (argValue->IsNull())
continue;
if (argValue->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength <= 2) {
@@ -1791,10 +1784,10 @@ void CFXJSE_FormCalcContext::Sum(
return;
}
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectPropertyByIdx(1, propertyValue.get());
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
if (propertyValue->IsNull()) {
for (int32_t j = 2; j < iLength; j++) {
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get());
@@ -1818,7 +1811,7 @@ void CFXJSE_FormCalcContext::Sum(
}
}
} else if (argValue->IsObject()) {
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(argValue.get(), newPropertyValue.get());
if (newPropertyValue->IsNull())
continue;
@@ -3024,7 +3017,7 @@ void CFXJSE_FormCalcContext::Choose(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (ValueIsNull(pThis, argOne.get())) {
info.GetReturnValue().SetNull();
return;
@@ -3043,9 +3036,9 @@ void CFXJSE_FormCalcContext::Choose(
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
while (!bFound && !bStopCounterFlags && (iArgIndex < argc)) {
auto argIndexValue =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[iArgIndex]);
+ std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[iArgIndex]);
if (argIndexValue->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argIndexValue->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength > 3)
@@ -3053,9 +3046,9 @@ void CFXJSE_FormCalcContext::Choose(
iValueIndex += (iLength - 2);
if (iValueIndex >= iIndex) {
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
argIndexValue->GetObjectPropertyByIdx(1, propertyValue.get());
argIndexValue->GetObjectPropertyByIdx(
(iLength - 1) - (iValueIndex - iIndex), jsObjectValue.get());
@@ -3093,7 +3086,7 @@ void CFXJSE_FormCalcContext::Exists(
ToFormCalcContext(pThis)->ThrowParamCountMismatchException(L"Exists");
return;
}
- auto temp = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto temp = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
info.GetReturnValue().Set(static_cast<int>(temp->IsObject()));
}
@@ -3217,7 +3210,7 @@ void CFXJSE_FormCalcContext::Eval(
std::unique_ptr<CFXJSE_Context> pNewContext(
CFXJSE_Context::Create(pIsolate, nullptr, nullptr));
- auto returnValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto returnValue = std::make_unique<CFXJSE_Value>(pIsolate);
pNewContext->ExecuteScript(
FX_UTF8Encode(wsJavaScriptBuf.AsStringView()).c_str(), returnValue.get(),
nullptr);
@@ -3236,7 +3229,7 @@ void CFXJSE_FormCalcContext::Ref(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (!argOne->IsArray() && !argOne->IsObject() && !argOne->IsBoolean() &&
!argOne->IsString() && !argOne->IsNull() && !argOne->IsNumber()) {
pContext->ThrowArgumentMismatchException();
@@ -3250,7 +3243,7 @@ void CFXJSE_FormCalcContext::Ref(
std::vector<std::unique_ptr<CFXJSE_Value>> values;
for (int32_t i = 0; i < 3; i++)
- values.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
int intVal = 3;
if (argOne->IsNull()) {
@@ -3259,13 +3252,13 @@ void CFXJSE_FormCalcContext::Ref(
values[2]->SetNull();
} else if (argOne->IsArray()) {
#ifndef NDEBUG
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argOne->GetObjectProperty("length", lengthValue.get());
ASSERT(lengthValue->ToInteger() >= 3);
#endif
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
argOne->GetObjectPropertyByIdx(1, propertyValue.get());
argOne->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (!propertyValue->IsNull() || jsObjectValue->IsNull()) {
@@ -3281,7 +3274,7 @@ void CFXJSE_FormCalcContext::Ref(
values[0]->SetInteger(intVal);
values[1]->SetNull();
- auto temp = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto temp = std::make_unique<CFXJSE_Value>(info.GetIsolate());
temp->SetArray(values);
info.GetReturnValue().Set(temp->DirectGetValue());
}
@@ -4558,15 +4551,15 @@ void CFXJSE_FormCalcContext::assign_value_operator(
return;
}
ByteStringView bsFuncName("asgn_val_op");
- auto lValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto lValue = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
std::unique_ptr<CFXJSE_Value> rValue = GetSimpleValue(pThis, info, 1);
if (lValue->IsArray()) {
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
- auto leftLengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto leftLengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
lValue->GetObjectProperty("length", leftLengthValue.get());
int32_t iLeftLength = leftLengthValue->ToInteger();
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
lValue->GetObjectPropertyByIdx(1, propertyValue.get());
if (propertyValue->IsNull()) {
for (int32_t i = 2; i < iLeftLength; i++) {
@@ -4704,21 +4697,21 @@ void CFXJSE_FormCalcContext::notequality_operator(
bool CFXJSE_FormCalcContext::fm_ref_equal(
CFXJSE_HostObject* pThis,
const v8::FunctionCallbackInfo<v8::Value>& info) {
- auto argFirst = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
- auto argSecond = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[1]);
+ auto argFirst = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argSecond = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[1]);
if (!argFirst->IsArray() || !argSecond->IsArray())
return false;
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
- auto firstFlagValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto secondFlagValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto firstFlagValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto secondFlagValue = std::make_unique<CFXJSE_Value>(pIsolate);
argFirst->GetObjectPropertyByIdx(0, firstFlagValue.get());
argSecond->GetObjectPropertyByIdx(0, secondFlagValue.get());
if (firstFlagValue->ToInteger() != 3 || secondFlagValue->ToInteger() != 3)
return false;
- auto firstJSObject = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto secondJSObject = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto firstJSObject = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto secondJSObject = std::make_unique<CFXJSE_Value>(pIsolate);
argFirst->GetObjectPropertyByIdx(2, firstJSObject.get());
argSecond->GetObjectPropertyByIdx(2, secondJSObject.get());
if (firstJSObject->IsNull() || secondJSObject->IsNull())
@@ -4850,8 +4843,8 @@ void CFXJSE_FormCalcContext::plus_operator(
return;
}
- auto argFirst = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
- auto argSecond = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[1]);
+ auto argFirst = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argSecond = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[1]);
if (ValueIsNull(pThis, argFirst.get()) &&
ValueIsNull(pThis, argSecond.get())) {
info.GetReturnValue().SetNull();
@@ -5037,7 +5030,7 @@ void CFXJSE_FormCalcContext::is_fm_object(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
info.GetReturnValue().Set(argOne->IsObject());
}
@@ -5050,7 +5043,7 @@ void CFXJSE_FormCalcContext::is_fm_array(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
info.GetReturnValue().Set(argOne->IsArray());
}
@@ -5064,21 +5057,21 @@ void CFXJSE_FormCalcContext::get_fm_value(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (argOne->IsArray()) {
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
argOne->GetObjectPropertyByIdx(1, propertyValue.get());
argOne->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
- auto pReturn = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
GetObjectDefaultValue(jsObjectValue.get(), pReturn.get());
info.GetReturnValue().Set(pReturn->DirectGetValue());
return;
}
- auto pReturn = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
jsObjectValue->GetObjectProperty(propertyValue->ToString().AsStringView(),
pReturn.get());
info.GetReturnValue().Set(pReturn->DirectGetValue());
@@ -5086,7 +5079,7 @@ void CFXJSE_FormCalcContext::get_fm_value(
}
if (argOne->IsObject()) {
- auto pReturn = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
GetObjectDefaultValue(argOne.get(), pReturn.get());
info.GetReturnValue().Set(pReturn->DirectGetValue());
return;
@@ -5104,7 +5097,7 @@ void CFXJSE_FormCalcContext::get_fm_jsobj(
return;
}
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (!argOne->IsArray()) {
info.GetReturnValue().Set(argOne->DirectGetValue());
return;
@@ -5113,12 +5106,12 @@ void CFXJSE_FormCalcContext::get_fm_jsobj(
#ifndef NDEBUG
CFXJSE_FormCalcContext* pContext = ToFormCalcContext(pThis);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argOne->GetObjectProperty("length", lengthValue.get());
ASSERT(lengthValue->ToInteger() >= 3);
#endif
- auto pReturn = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
argOne->GetObjectPropertyByIdx(2, pReturn.get());
info.GetReturnValue().Set(pReturn->DirectGetValue());
}
@@ -5134,7 +5127,7 @@ void CFXJSE_FormCalcContext::fm_var_filter(
}
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
- auto argOne = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (!argOne->IsArray()) {
std::unique_ptr<CFXJSE_Value> simpleValue = GetSimpleValue(pThis, info, 0);
info.GetReturnValue().Set(simpleValue->DirectGetValue());
@@ -5142,12 +5135,12 @@ void CFXJSE_FormCalcContext::fm_var_filter(
}
#ifndef NDEBUG
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argOne->GetObjectProperty("length", lengthValue.get());
ASSERT(lengthValue->ToInteger() >= 3);
#endif
- auto flagsValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto flagsValue = std::make_unique<CFXJSE_Value>(pIsolate);
argOne->GetObjectPropertyByIdx(0, flagsValue.get());
int32_t iFlags = flagsValue->ToInteger();
if (iFlags != 3 && iFlags != 4) {
@@ -5159,18 +5152,18 @@ void CFXJSE_FormCalcContext::fm_var_filter(
if (iFlags == 4) {
std::vector<std::unique_ptr<CFXJSE_Value>> values;
for (int32_t i = 0; i < 3; i++)
- values.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
values[0]->SetInteger(3);
values[1]->SetNull();
values[2]->SetNull();
- auto pResult = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pResult = std::make_unique<CFXJSE_Value>(info.GetIsolate());
pResult->SetArray(values);
info.GetReturnValue().Set(pResult->DirectGetValue());
return;
}
- auto objectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto objectValue = std::make_unique<CFXJSE_Value>(pIsolate);
argOne->GetObjectPropertyByIdx(2, objectValue.get());
if (objectValue->IsNull()) {
pContext->ThrowCompilerErrorException();
@@ -5186,20 +5179,20 @@ void CFXJSE_FormCalcContext::concat_fm_object(
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
std::vector<std::unique_ptr<CFXJSE_Value>> returnValues;
for (int32_t i = 0; i < info.Length(); ++i) {
- auto argValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate, info[i]);
+ auto argValue = std::make_unique<CFXJSE_Value>(pIsolate, info[i]);
if (argValue->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argValue->GetObjectProperty("length", lengthValue.get());
int32_t length = lengthValue->ToInteger();
for (int32_t j = 2; j < length; j++) {
- returnValues.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ returnValues.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
argValue->GetObjectPropertyByIdx(j, returnValues.back().get());
}
}
- returnValues.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ returnValues.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
returnValues.back()->Assign(argValue.get());
}
- auto pReturn = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
pReturn->SetArray(returnValues);
info.GetReturnValue().Set(pReturn->DirectGetValue());
}
@@ -5213,22 +5206,22 @@ std::unique_ptr<CFXJSE_Value> CFXJSE_FormCalcContext::GetSimpleValue(
ASSERT(index < (uint32_t)info.Length());
auto argIndex =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[index]);
+ std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[index]);
if (!argIndex->IsArray() && !argIndex->IsObject())
return argIndex;
if (argIndex->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argIndex->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
- auto simpleValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto simpleValue = std::make_unique<CFXJSE_Value>(pIsolate);
if (iLength < 3) {
simpleValue.get()->SetUndefined();
return simpleValue;
}
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
argIndex->GetObjectPropertyByIdx(1, propertyValue.get());
argIndex->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
@@ -5241,7 +5234,7 @@ std::unique_ptr<CFXJSE_Value> CFXJSE_FormCalcContext::GetSimpleValue(
return simpleValue;
}
- auto defaultValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto defaultValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(argIndex.get(), defaultValue.get());
return defaultValue;
}
@@ -5261,23 +5254,23 @@ bool CFXJSE_FormCalcContext::ValueIsNull(CFXJSE_HostObject* pThis,
if (iLength < 3)
return true;
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
arg->GetObjectPropertyByIdx(1, propertyValue.get());
arg->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
- auto defaultValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto defaultValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(jsObjectValue.get(), defaultValue.get());
return defaultValue->IsNull();
}
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
jsObjectValue->GetObjectProperty(propertyValue->ToString().AsStringView(),
newPropertyValue.get());
return newPropertyValue->IsNull();
}
- auto defaultValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto defaultValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(arg, defaultValue.get());
return defaultValue->IsNull();
}
@@ -5290,7 +5283,7 @@ int32_t CFXJSE_FormCalcContext::hvalue_get_array_length(
return 0;
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
arg->GetObjectProperty("length", lengthValue.get());
return lengthValue->ToInteger();
}
@@ -5325,21 +5318,21 @@ std::vector<std::unique_ptr<CFXJSE_Value>> CFXJSE_FormCalcContext::unfoldArgs(
std::vector<std::unique_ptr<CFXJSE_Value>> results;
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
for (int32_t i = 1; i < info.Length(); ++i) {
- auto arg = pdfium::MakeUnique<CFXJSE_Value>(pIsolate, info[i]);
+ auto arg = std::make_unique<CFXJSE_Value>(pIsolate, info[i]);
if (arg->IsArray()) {
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
arg->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength < 3)
continue;
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
arg->GetObjectPropertyByIdx(1, propertyValue.get());
for (int32_t j = 2; j < iLength; j++) {
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
arg->GetObjectPropertyByIdx(j, jsObjectValue.get());
- results.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ results.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
if (propertyValue->IsNull()) {
GetObjectDefaultValue(jsObjectValue.get(), results.back().get());
} else {
@@ -5348,10 +5341,10 @@ std::vector<std::unique_ptr<CFXJSE_Value>> CFXJSE_FormCalcContext::unfoldArgs(
}
}
} else if (arg->IsObject()) {
- results.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ results.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
GetObjectDefaultValue(arg.get(), results.back().get());
} else {
- results.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ results.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
results.back()->Assign(arg.get());
}
}
@@ -5482,7 +5475,7 @@ void CFXJSE_FormCalcContext::ParseResolveResult(
*bAttribute = false;
CFXJSE_Engine* pScriptContext = pContext->GetDocument()->GetScriptContext();
for (auto& pObject : resolveNodeRS.objects) {
- resultValues->push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ resultValues->push_back(std::make_unique<CFXJSE_Value>(pIsolate));
resultValues->back()->Assign(
pScriptContext->GetOrCreateJSBindingFromMap(pObject.Get()));
}
@@ -5493,7 +5486,7 @@ void CFXJSE_FormCalcContext::ParseResolveResult(
if (resolveNodeRS.script_attribute.callback &&
resolveNodeRS.script_attribute.eValueType == XFA_ScriptType::Object) {
for (auto& pObject : resolveNodeRS.objects) {
- auto pValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto pValue = std::make_unique<CFXJSE_Value>(pIsolate);
CJX_Object* jsObject = pObject->JSObject();
(*resolveNodeRS.script_attribute.callback)(
jsObject, pValue.get(), false,
@@ -5507,7 +5500,7 @@ void CFXJSE_FormCalcContext::ParseResolveResult(
if (!pParentValue || !pParentValue->IsObject())
return;
- resultValues->push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ resultValues->push_back(std::make_unique<CFXJSE_Value>(pIsolate));
resultValues->back()->Assign(pParentValue);
}
@@ -5519,9 +5512,9 @@ int32_t CFXJSE_FormCalcContext::ValueToInteger(CFXJSE_HostObject* pThis,
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
if (pValue->IsArray()) {
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
pValue->GetObjectPropertyByIdx(1, propertyValue.get());
pValue->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
@@ -5534,7 +5527,7 @@ int32_t CFXJSE_FormCalcContext::ValueToInteger(CFXJSE_HostObject* pThis,
return ValueToInteger(pThis, newPropertyValue.get());
}
if (pValue->IsObject()) {
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(pValue, newPropertyValue.get());
return ValueToInteger(pThis, newPropertyValue.get());
}
@@ -5551,9 +5544,9 @@ float CFXJSE_FormCalcContext::ValueToFloat(CFXJSE_HostObject* pThis,
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
if (arg->IsArray()) {
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
arg->GetObjectPropertyByIdx(1, propertyValue.get());
arg->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
@@ -5565,7 +5558,7 @@ float CFXJSE_FormCalcContext::ValueToFloat(CFXJSE_HostObject* pThis,
return ValueToFloat(pThis, newPropertyValue.get());
}
if (arg->IsObject()) {
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(arg, newPropertyValue.get());
return ValueToFloat(pThis, newPropertyValue.get());
}
@@ -5584,9 +5577,9 @@ double CFXJSE_FormCalcContext::ValueToDouble(CFXJSE_HostObject* pThis,
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
if (arg->IsArray()) {
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
arg->GetObjectPropertyByIdx(1, propertyValue.get());
arg->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull()) {
@@ -5598,7 +5591,7 @@ double CFXJSE_FormCalcContext::ValueToDouble(CFXJSE_HostObject* pThis,
return ValueToDouble(pThis, newPropertyValue.get());
}
if (arg->IsObject()) {
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
GetObjectDefaultValue(arg, newPropertyValue.get());
return ValueToDouble(pThis, newPropertyValue.get());
}
@@ -5623,7 +5616,7 @@ double CFXJSE_FormCalcContext::ExtractDouble(CFXJSE_HostObject* pThis,
return ValueToDouble(pThis, src);
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetScriptRuntime();
- auto lengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
src->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength <= 2) {
@@ -5631,14 +5624,14 @@ double CFXJSE_FormCalcContext::ExtractDouble(CFXJSE_HostObject* pThis,
return 0.0;
}
- auto propertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
src->GetObjectPropertyByIdx(1, propertyValue.get());
src->GetObjectPropertyByIdx(2, jsObjectValue.get());
if (propertyValue->IsNull())
return ValueToDouble(pThis, jsObjectValue.get());
- auto newPropertyValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
jsObjectValue->GetObjectProperty(propertyValue->ToString().AsStringView(),
newPropertyValue.get());
return ValueToDouble(pThis, newPropertyValue.get());
@@ -5677,7 +5670,7 @@ CFXJSE_FormCalcContext::CFXJSE_FormCalcContext(v8::Isolate* pScriptIsolate,
CFXJSE_Context* pScriptContext,
CXFA_Document* pDoc)
: m_pIsolate(pScriptIsolate),
- m_pValue(pdfium::MakeUnique<CFXJSE_Value>(pScriptIsolate)),
+ m_pValue(std::make_unique<CFXJSE_Value>(pScriptIsolate)),
m_pDocument(pDoc) {
m_pValue->SetHostObject(
this,
@@ -5711,7 +5704,7 @@ void CFXJSE_FormCalcContext::DotAccessorCommon(
int32_t iIndexValue = 0;
if (argc > 4) {
bIsStar = false;
- auto temp = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[4]);
+ auto temp = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[4]);
iIndexValue = ValueToInteger(pThis, temp.get());
}
@@ -5723,10 +5716,9 @@ void CFXJSE_FormCalcContext::DotAccessorCommon(
fxv8::ReentrantToInt32Helper(info.GetIsolate(), info[3]), iIndexValue,
bIsStar);
- auto argAccessor =
- pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate(), info[0]);
+ auto argAccessor = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (argAccessor->IsArray()) {
- auto pLengthValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto pLengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
argAccessor->GetObjectProperty("length", pLengthValue.get());
int32_t iLength = pLengthValue->ToInteger();
if (iLength < 3) {
@@ -5734,7 +5726,7 @@ void CFXJSE_FormCalcContext::DotAccessorCommon(
return;
}
- auto hJSObjValue = pdfium::MakeUnique<CFXJSE_Value>(pIsolate);
+ auto hJSObjValue = std::make_unique<CFXJSE_Value>(pIsolate);
std::vector<std::vector<std::unique_ptr<CFXJSE_Value>>> resolveValues(
iLength - 2);
bool bAttribute = false;
@@ -5757,9 +5749,9 @@ void CFXJSE_FormCalcContext::DotAccessorCommon(
}
std::vector<std::unique_ptr<CFXJSE_Value>> values;
- values.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
values.back()->SetInteger(1);
- values.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
if (bAttribute)
values.back()->SetString(bsName.AsStringView());
else
@@ -5767,11 +5759,11 @@ void CFXJSE_FormCalcContext::DotAccessorCommon(
for (int32_t i = 0; i < iLength - 2; i++) {
for (size_t j = 0; j < resolveValues[i].size(); j++) {
- values.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
values.back()->Assign(resolveValues[i][j].get());
}
}
- auto pReturn = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
pReturn->SetArray(values);
info.GetReturnValue().Set(pReturn->DirectGetValue());
return;
@@ -5805,7 +5797,7 @@ void CFXJSE_FormCalcContext::DotAccessorCommon(
std::vector<std::unique_ptr<CFXJSE_Value>> values;
for (size_t i = 0; i < resolveValues.size() + 2; i++)
- values.push_back(pdfium::MakeUnique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
values[0]->SetInteger(1);
if (bAttribute)
@@ -5816,7 +5808,7 @@ void CFXJSE_FormCalcContext::DotAccessorCommon(
for (size_t i = 0; i < resolveValues.size(); i++)
values[i + 2]->Assign(resolveValues[i].get());
- auto pReturn = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
pReturn->SetArray(values);
info.GetReturnValue().Set(pReturn->DirectGetValue());
}
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp
index 4803df6e0d4..9e2532c145f 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "core/fxcrt/fx_memory.h"
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cfxjse_value.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/xfa_js_embedder_test.h"
+#include "third_party/base/stl_util.h"
#include "xfa/fxfa/cxfa_eventparam.h"
class CFXJSE_FormCalcContextEmbedderTest : public XFAJSEmbedderTest {
@@ -73,7 +73,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Numeric) {
"endif",
0}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -94,7 +94,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Strings) {
{"concat(\"The total is \", 2, \" dollars and \", 57, \" cents.\")",
"The total is 2 dollars and 57 cents."}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -135,7 +135,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Booleans) {
{"12 >= 12", true},
{"\"true\" < \"false\"", false}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -153,7 +153,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Abs) {
float result;
} tests[] = {{"Abs(1.03)", 1.03f}, {"Abs(-1.03)", 1.03f}, {"Abs(0)", 0.0f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -171,7 +171,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Avg) {
float result;
} tests[] = {{"Avg(0, 32, 16)", 16.0f}, {"Avg(2.5, 17, null)", 9.75f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -189,7 +189,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Ceil) {
int result;
} tests[] = {{"Ceil(2.5875)", 3}, {"Ceil(-5.9)", -5}, {"Ceil(\"abc\")", 0}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -207,7 +207,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Count) {
int result;
} tests[] = {{"Count(\"Tony\", \"Blue\", 41)", 3}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -227,7 +227,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Floor) {
{"Floor(5.999965342)", 5},
{"Floor(3.2 * 15)", 48}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -247,7 +247,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Max) {
{"Max(\"abc\", 15, \"Tony Blue\")", 15},
{"Max(\"abc\")", 0}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -269,7 +269,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Min) {
// {"Min(\"abc\", 15, \"Tony Blue\")", 15},
{"Min(\"abc\")", 0}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -287,7 +287,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Mod) {
int result;
} tests[] = {{"Mod(64, -3)", 1}, {"Mod(-13, 3)", -1}, {"Mod(\"abc\", 2)", 0}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -308,7 +308,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Round) {
{"Round(8.9897, \"abc\")", 9.0f},
{"Round(FV(400, 0.10/12, 30*12), 2)", 904195.17f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -328,7 +328,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Sum) {
{"Sum(-2, 4, -6, 8)", 4},
{"Sum(4, 16, \"abc\", 19)", 39}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -367,7 +367,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Date2Num) {
{"Date2Num(\"1/3/00\", \"D/M/YY\") - Date2Num(\"1/2/00\", \"D/M/YY\")",
29}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -390,7 +390,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DateFmt) {
// {"DateFmt(4, \"fr_FR\")", "EEE D' MMMM YYYY"}
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -413,7 +413,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, IsoDate2Num) {
{"IsoDate2Num(\"19960315T20:20:20\")", 35138},
{"IsoDate2Num(\"2000-03-01\") - IsoDate2Num(\"20000201\")", 29}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -431,7 +431,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_IsoTime2Num) {
int result;
} tests[] = {{"IsoTime2Num(\"00:00:00Z\")", 1}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -452,7 +452,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, LocalDateFmt) {
{"LocalDateFmt(3, \"de_CH\")", "t. MMMM jjjj"},
{"LocalDateFmt(4, \"fr_FR\")", "EEEE j MMMM aaaa"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -474,7 +474,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_LocalTimeFmt) {
{"LocalTimeFmt(3, \"de_CH\")", "HH:mm:ss z"},
{"LocalTimeFmt(4, \"fr_FR\")", "HH' h 'mm z"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -499,7 +499,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Num2Date) {
// "Jan 1, 1902"}
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -523,7 +523,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_Num2GMTime) {
{"Num2GMTime(43993001, TimeFmt(4, \"de_DE\"), \"de_DE\")",
"12.13 Uhr GMT"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -543,7 +543,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_Num2Time) {
const char* result;
} tests[] = {{"Num2Time(1, \"HH:MM:SS\")", "00:00:00"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -578,7 +578,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Time2Num) {
// {"Time2Num(\"00:00:00 GMT\", \"HH:MM:SS Z\")", 1},
{"Time2Num(\"13:13:13 GMT\", \"HH:MM:SS Z\", \"fr_FR\")", 47593001}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -601,7 +601,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, TimeFmt) {
// {"TimeFmt(4, \"de_DE\")", "H.MM' Uhr 'Z"}
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -621,7 +621,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Apr) {
} tests[] = {{"Apr(35000, 269.50, 360)", 0.08515404566f},
{"Apr(210000 * 0.75, 850 + 110, 25 * 26)", 0.07161332404f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -643,7 +643,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, CTerm) {
// {"CTerm(0.0275 + 0.0025, 1000000, 55000 * 0.10)", 176.02226044975f}
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -662,7 +662,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, FV) {
} tests[] = {{"FV(400, 0.10 / 12, 30 * 12)", 904195.16991842445f},
{"FV(1000, 0.075 / 4, 10 * 4)", 58791.96145535981f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -682,7 +682,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, IPmt) {
{"IPmt(160000, 0.0475, 980, 24, 12)", 7103.80833569485f},
{"IPmt(15000, 0.065, 65.50, 15, 1)", 0.0f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -702,7 +702,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, NPV) {
{"NPV(0.10, 500, 1500, 4000, 10000)", 11529.60863329007f},
{"NPV(0.0275 / 12, 50, 60, 40, 100, 25)", 273.14193838457f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -721,7 +721,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Pmt) {
} tests[] = {// {"Pmt(150000, 0.0475 / 12, 25 * 12)", 855.17604207164f},
{"Pmt(25000, 0.085, 12)", 3403.82145169876f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -743,7 +743,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, PPmt) {
// {"PPmt(15000, 0.065, 65.50, 15, 1)", 0.0f}
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -764,7 +764,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, PV) {
// {"PV(1000, 0.075 / 4, 10 * 4)", 58791.96145535981f}
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -783,7 +783,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Rate) {
} tests[] = {{"Rate(12000, 8000, 5)", 0.0844717712f},
{"Rate(10000, 0.25 * 5000, 4 * 12)", 0.04427378243f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -802,7 +802,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Term) {
} tests[] = {// {"Term(475, .05, 1500)", 3.00477517728f},
{"Term(2500, 0.0275 + 0.0025, 5000)", 1.97128786369f}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -824,7 +824,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Choose) {
{"Choose(20/3, \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\")",
"F"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -852,7 +852,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, HasValue) {
bool result;
} tests[] = {{"HasValue(2)", true}, {"HasValue(\" \")", false}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -877,7 +877,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Oneof) {
{"Oneof(3, null, null)", false},
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -897,7 +897,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Within) {
{"Within(1.5, 0, 2)", true},
{"Within(-1, 0, 2)", false}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -915,7 +915,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Eval) {
int result;
} tests[] = {{"eval(\"10*3+5*4\")", 50}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -934,7 +934,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_Null) {
} tests[] = {{"Null()", "null"},
{"Concat(\"ABC\", Null(), \"DEF\")", "ABCDEF"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -959,7 +959,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Ref) {
const char* result;
} tests[] = {{"Ref(\"10*3+5*4\")", "10*3+5*4"}, {"Ref(\"hello\")", "hello"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -983,7 +983,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, UnitType) {
{"UnitType(\"2.zero cm\")", "in"},
{"UnitType(\"kilometers\")", "in"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1007,7 +1007,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, UnitValue) {
// {"UnitType(\"5.08cm\", \"kilograms\")", 2.0f}
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1027,7 +1027,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, At) {
{"At(\"ABCDEFGH\", \"F\")", 6},
{"At(23412931298471, 29)", 5}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1049,7 +1049,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Concat) {
"You owe One Thousand One Hundred Fifty-four Dollars And "
"Sixty-seven Cents."}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1093,7 +1093,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Decode) {
{R"(Decode("?%"))", "?"},
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
EXPECT_TRUE(value->IsString());
@@ -1129,7 +1129,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Encode) {
#endif // !defined(OS_WIN)
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1149,7 +1149,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_Format) {
} tests[] = {{"Format(\"MMM D, YYYY\", \"20020901\")", "Sep 1, 2002"},
{"Format(\"$9,999,999.99\", 1234567.89)", "$1,234,567.89"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1169,7 +1169,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Left) {
} tests[] = {{"Left(\"ABCDEFGH\", 3)", "ABC"},
{"Left(\"Tony Blue\", 5)", "Tony "}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1189,7 +1189,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Len) {
} tests[] = {
{"Len(\"ABCDEFGH\")", 8}, {"Len(4)", 1}, {"Len(Str(4.532, 6, 4))", 6}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1209,7 +1209,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Lower) {
{"Lower(\"21 Main St.\")", "21 main st."},
{"Lower(15)", "15"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1239,7 +1239,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Ltrim) {
} tests[] = {{"Ltrim(\" ABCD\")", "ABCD"},
{"Ltrim(Rtrim(\" Tony Blue \"))", "Tony Blue"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1258,7 +1258,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_Parse) {
const char* result;
} tests[] = {{"Parse(\"MMM D, YYYY\", \"Sep 1, 2002\")", "2002-09-01"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1284,7 +1284,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Replace) {
{"Replace(\"ABCDEFGH\", \"D\")", "ABCEFGH"},
{"Replace(\"ABCDEFGH\", \"d\")", "ABCDEFGH"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1304,7 +1304,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Right) {
} tests[] = {{"Right(\"ABCDEFGH\", 3)", "FGH"},
{"Right(\"Tony Blue\", 5)", " Blue"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1324,7 +1324,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Rtrim) {
} tests[] = {{"Rtrim(\"ABCD \")", "ABCD"},
{"Rtrim(\"Tony Blue \t\")", "Tony Blue"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1344,7 +1344,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Space) {
} tests[] = {{"Space(5)", " "},
{"Concat(\"Tony\", Space(1), \"Blue\")", "Tony Blue"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1366,7 +1366,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Str) {
{"Str(234.458, 4)", " 234"},
{"Str(31.2345, 4, 2)", "****"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1388,7 +1388,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Stuff) {
{"Stuff(\"members-list@myweb.com\", 0, 0, \"cc:\")",
"cc:members-list@myweb.com"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1465,7 +1465,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, Upper) {
{"Upper(\"21 Main St.\")", "21 MAIN ST."},
{"Upper(15)", "15"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1491,7 +1491,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, WordNum) {
"One Thousand One Hundred Fifty-four Dollars And Sixty-seven Cents"},
{"WordNum(43, 2)", "Forty-three Dollars And Zero Cents"}};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_TRUE(Execute(tests[i].program));
CFXJSE_Value* value = GetValue();
@@ -1524,7 +1524,7 @@ TEST_F(CFXJSE_FormCalcContextEmbedderTest, InvalidFunctions) {
"Round(2.0)()",
};
- for (size_t i = 0; i < FX_ArraySize(tests); ++i) {
+ for (size_t i = 0; i < pdfium::size(tests); ++i) {
EXPECT_FALSE(ExecuteSilenceFailure(tests[i]));
}
}
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_resolveprocessor.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_resolveprocessor.cpp
index 89883d65fee..a906df97701 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_resolveprocessor.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_resolveprocessor.cpp
@@ -14,7 +14,6 @@
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cfxjse_value.h"
#include "fxjs/xfa/cjx_object.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_localemgr.h"
@@ -42,8 +41,7 @@ void DoPredicateFilter(WideString wsCondition,
wsExpression = wsCondition.Substr(2, wsCondition.GetLength() - 3);
for (size_t i = iFoundCount; i > 0; --i) {
- auto pRetValue =
- pdfium::MakeUnique<CFXJSE_Value>(pRnd->m_pSC->GetIsolate());
+ auto pRetValue = std::make_unique<CFXJSE_Value>(pRnd->m_pSC->GetIsolate());
bool bRet =
pRnd->m_pSC->RunScript(eLangType, wsExpression.AsStringView(),
pRetValue.get(), pRnd->m_Objects[i - 1].Get());
@@ -55,7 +53,7 @@ void DoPredicateFilter(WideString wsCondition,
} // namespace
CFXJSE_ResolveProcessor::CFXJSE_ResolveProcessor()
- : m_pNodeHelper(pdfium::MakeUnique<CXFA_NodeHelper>()) {}
+ : m_pNodeHelper(std::make_unique<CXFA_NodeHelper>()) {}
CFXJSE_ResolveProcessor::~CFXJSE_ResolveProcessor() = default;
@@ -220,8 +218,7 @@ bool CFXJSE_ResolveProcessor::ResolveNumberSign(CFXJSE_ResolveNodeData& rnd) {
if (rndFind.m_Objects.empty())
return false;
- if (wsCondition.IsEmpty() &&
- pdfium::ContainsValue(rndFind.m_Objects, curNode)) {
+ if (wsCondition.IsEmpty() && pdfium::Contains(rndFind.m_Objects, curNode)) {
rnd.m_Objects.emplace_back(curNode);
} else {
rnd.m_Objects.insert(rnd.m_Objects.end(), rndFind.m_Objects.begin(),
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value.cpp
index e8705e80d43..66ea236e87a 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value.cpp
@@ -72,7 +72,7 @@ CFXJSE_Value::CFXJSE_Value(v8::Isolate* pIsolate, v8::Local<v8::Value> value)
ForceSetValue(value);
}
-CFXJSE_Value::~CFXJSE_Value() {}
+CFXJSE_Value::~CFXJSE_Value() = default;
CFXJSE_HostObject* CFXJSE_Value::ToHostObject() const {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(GetIsolate());
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value_embeddertest.cpp b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value_embeddertest.cpp
index e9c39c12d35..e6ace2a401d 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value_embeddertest.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cfxjse_value_embeddertest.cpp
@@ -11,14 +11,13 @@
#include "fxjs/xfa/cfxjse_engine.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/xfa_js_embedder_test.h"
-#include "third_party/base/ptr_util.h"
class CFXJSE_ValueEmbedderTest : public XFAJSEmbedderTest {};
TEST_F(CFXJSE_ValueEmbedderTest, Empty) {
ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
- auto pValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>(GetIsolate());
EXPECT_TRUE(pValue->IsEmpty());
EXPECT_FALSE(pValue->IsUndefined());
EXPECT_FALSE(pValue->IsNull());
@@ -34,7 +33,7 @@ TEST_F(CFXJSE_ValueEmbedderTest, EmptyArrayInsert) {
ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
// Test inserting empty values into arrays.
- auto pValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>(GetIsolate());
std::vector<std::unique_ptr<CFXJSE_Value>> vec;
vec.push_back(std::move(pValue));
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_container.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_container.cpp
index 44b1ff8a965..20220befd3e 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_container.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_container.cpp
@@ -23,7 +23,7 @@ CJX_Container::CJX_Container(CXFA_Node* node) : CJX_Node(node) {
DefineMethods(MethodSpecs);
}
-CJX_Container::~CJX_Container() {}
+CJX_Container::~CJX_Container() = default;
bool CJX_Container::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_datawindow.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_datawindow.cpp
index d165140816d..9a189ec7ed0 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_datawindow.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_datawindow.cpp
@@ -22,7 +22,7 @@ CJX_DataWindow::CJX_DataWindow(CScript_DataWindow* window)
DefineMethods(MethodSpecs);
}
-CJX_DataWindow::~CJX_DataWindow() {}
+CJX_DataWindow::~CJX_DataWindow() = default;
bool CJX_DataWindow::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_delta.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_delta.cpp
index 3ad20a6faa4..9d17eaa31b6 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_delta.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_delta.cpp
@@ -18,7 +18,7 @@ CJX_Delta::CJX_Delta(CXFA_Delta* delta) : CJX_Object(delta) {
DefineMethods(MethodSpecs);
}
-CJX_Delta::~CJX_Delta() {}
+CJX_Delta::~CJX_Delta() = default;
bool CJX_Delta::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_desc.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_desc.cpp
index 2bbff2b7b5c..01ab555fce4 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_desc.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_desc.cpp
@@ -19,7 +19,7 @@ CJX_Desc::CJX_Desc(CXFA_Desc* desc) : CJX_Node(desc) {
DefineMethods(MethodSpecs);
}
-CJX_Desc::~CJX_Desc() {}
+CJX_Desc::~CJX_Desc() = default;
bool CJX_Desc::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_eventpseudomodel.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_eventpseudomodel.cpp
index d037eb739f0..a4112ac1ae3 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_eventpseudomodel.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_eventpseudomodel.cpp
@@ -53,7 +53,7 @@ CJX_EventPseudoModel::CJX_EventPseudoModel(CScript_EventPseudoModel* model)
DefineMethods(MethodSpecs);
}
-CJX_EventPseudoModel::~CJX_EventPseudoModel() {}
+CJX_EventPseudoModel::~CJX_EventPseudoModel() = default;
bool CJX_EventPseudoModel::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_exclgroup.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_exclgroup.cpp
index 00bf53929a4..7f17bc81e3e 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_exclgroup.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_exclgroup.cpp
@@ -28,7 +28,7 @@ CJX_ExclGroup::CJX_ExclGroup(CXFA_ExclGroup* group) : CJX_Node(group) {
DefineMethods(MethodSpecs);
}
-CJX_ExclGroup::~CJX_ExclGroup() {}
+CJX_ExclGroup::~CJX_ExclGroup() = default;
bool CJX_ExclGroup::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_field.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_field.cpp
index ef334a3f765..4e7bc44501d 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_field.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_field.cpp
@@ -37,7 +37,7 @@ CJX_Field::CJX_Field(CXFA_Field* field) : CJX_Container(field) {
DefineMethods(MethodSpecs);
}
-CJX_Field::~CJX_Field() {}
+CJX_Field::~CJX_Field() = default;
bool CJX_Field::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_form.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_form.cpp
index 07e86028d39..f2b3a7dfc77 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_form.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_form.cpp
@@ -29,7 +29,7 @@ CJX_Form::CJX_Form(CXFA_Form* form) : CJX_Model(form) {
DefineMethods(MethodSpecs);
}
-CJX_Form::~CJX_Form() {}
+CJX_Form::~CJX_Form() = default;
bool CJX_Form::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_hostpseudomodel.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_hostpseudomodel.cpp
index c45495c2fdb..1263a14a7fe 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_hostpseudomodel.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_hostpseudomodel.cpp
@@ -70,7 +70,7 @@ CJX_HostPseudoModel::CJX_HostPseudoModel(CScript_HostPseudoModel* model)
DefineMethods(MethodSpecs);
}
-CJX_HostPseudoModel::~CJX_HostPseudoModel() {}
+CJX_HostPseudoModel::~CJX_HostPseudoModel() = default;
bool CJX_HostPseudoModel::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_instancemanager.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_instancemanager.cpp
index 160c4a57313..095654d70b4 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_instancemanager.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_instancemanager.cpp
@@ -30,7 +30,7 @@ CJX_InstanceManager::CJX_InstanceManager(CXFA_InstanceManager* mgr)
DefineMethods(MethodSpecs);
}
-CJX_InstanceManager::~CJX_InstanceManager() {}
+CJX_InstanceManager::~CJX_InstanceManager() = default;
bool CJX_InstanceManager::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_layoutpseudomodel.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_layoutpseudomodel.cpp
index 35852a856cc..8c9216ef1b6 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_layoutpseudomodel.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_layoutpseudomodel.cpp
@@ -6,6 +6,7 @@
#include "fxjs/xfa/cjx_layoutpseudomodel.h"
+#include <memory>
#include <set>
#include <utility>
@@ -14,7 +15,6 @@
#include "fxjs/xfa/cfxjse_class.h"
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cfxjse_value.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxfa/cxfa_ffnotify.h"
#include "xfa/fxfa/layout/cxfa_contentlayoutitem.h"
@@ -56,7 +56,7 @@ CJX_LayoutPseudoModel::CJX_LayoutPseudoModel(CScript_LayoutPseudoModel* model)
DefineMethods(MethodSpecs);
}
-CJX_LayoutPseudoModel::~CJX_LayoutPseudoModel() {}
+CJX_LayoutPseudoModel::~CJX_LayoutPseudoModel() = default;
bool CJX_LayoutPseudoModel::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
@@ -261,7 +261,7 @@ std::vector<CXFA_Node*> CJX_LayoutPseudoModel::GetObjArray(
eType != XFA_Element::Subform && eType != XFA_Element::Area) {
continue;
}
- if (pdfium::ContainsValue(formItems, pItemChild->GetFormNode()))
+ if (pdfium::Contains(formItems, pItemChild->GetFormNode()))
continue;
formItems.insert(pItemChild->GetFormNode());
@@ -282,7 +282,7 @@ std::vector<CXFA_Node*> CJX_LayoutPseudoModel::GetObjArray(
eType != XFA_Element::Subform && eType != XFA_Element::Area) {
continue;
}
- if (pdfium::ContainsValue(formItems, pItemChild->GetFormNode()))
+ if (pdfium::Contains(formItems, pItemChild->GetFormNode()))
continue;
formItems.insert(pItemChild->GetFormNode());
@@ -317,7 +317,7 @@ std::vector<CXFA_Node*> CJX_LayoutPseudoModel::GetObjArray(
continue;
if (pItemChild->GetFormNode()->GetElementType() != eType)
continue;
- if (pdfium::ContainsValue(formItems, pItemChild->GetFormNode()))
+ if (pdfium::Contains(formItems, pItemChild->GetFormNode()))
continue;
formItems.insert(pItemChild->GetFormNode());
@@ -334,7 +334,7 @@ std::vector<CXFA_Node*> CJX_LayoutPseudoModel::GetObjArray(
continue;
if (pItemChild->GetFormNode()->GetElementType() != eType)
continue;
- if (pdfium::ContainsValue(formItems, pItemChild->GetFormNode()))
+ if (pdfium::Contains(formItems, pItemChild->GetFormNode()))
continue;
formItems.insert(pItemChild->GetFormNode());
@@ -370,7 +370,7 @@ CJS_Result CJX_LayoutPseudoModel::pageContent(
return CJS_Result::Success();
auto* pDocLayout = CXFA_LayoutProcessor::FromDocument(GetDocument());
- auto pArrayNodeList = pdfium::MakeUnique<CXFA_ArrayNodeList>(GetDocument());
+ auto pArrayNodeList = std::make_unique<CXFA_ArrayNodeList>(GetDocument());
pArrayNodeList->SetArrayNodeList(
GetObjArray(pDocLayout, iIndex, wsType, bOnPageArea));
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_list.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_list.cpp
index 7c0cf23f50b..23d7e0dec95 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_list.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_list.cpp
@@ -26,7 +26,7 @@ CJX_List::CJX_List(CXFA_List* list) : CJX_Object(list) {
DefineMethods(MethodSpecs);
}
-CJX_List::~CJX_List() {}
+CJX_List::~CJX_List() = default;
bool CJX_List::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_logpseudomodel.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_logpseudomodel.cpp
index 8cb9ee7aaaf..9ad56122d45 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_logpseudomodel.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_logpseudomodel.cpp
@@ -23,7 +23,7 @@ CJX_LogPseudoModel::CJX_LogPseudoModel(CScript_LogPseudoModel* model)
DefineMethods(MethodSpecs);
}
-CJX_LogPseudoModel::~CJX_LogPseudoModel() {}
+CJX_LogPseudoModel::~CJX_LogPseudoModel() = default;
bool CJX_LogPseudoModel::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_manifest.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_manifest.cpp
index f94232edf4a..22b07627d1b 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_manifest.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_manifest.cpp
@@ -20,7 +20,7 @@ CJX_Manifest::CJX_Manifest(CXFA_Manifest* manifest) : CJX_Node(manifest) {
DefineMethods(MethodSpecs);
}
-CJX_Manifest::~CJX_Manifest() {}
+CJX_Manifest::~CJX_Manifest() = default;
bool CJX_Manifest::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_model.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_model.cpp
index 4fa0a2e286d..ae4053186e1 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_model.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_model.cpp
@@ -24,7 +24,7 @@ CJX_Model::CJX_Model(CXFA_Node* node) : CJX_Node(node) {
DefineMethods(MethodSpecs);
}
-CJX_Model::~CJX_Model() {}
+CJX_Model::~CJX_Model() = default;
bool CJX_Model::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_node.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_node.cpp
index 3877f72a909..56a90354b00 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_node.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_node.cpp
@@ -17,7 +17,6 @@
#include "fxjs/js_resources.h"
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cfxjse_value.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fxfa/cxfa_eventparam.h"
#include "xfa/fxfa/cxfa_ffdoc.h"
#include "xfa/fxfa/cxfa_ffnotify.h"
@@ -269,7 +268,7 @@ CJS_Result CJX_Node::loadXML(CFX_V8* runtime,
if (params.size() >= 3)
bOverwrite = runtime->ToBoolean(params[2]);
- auto pParser = pdfium::MakeUnique<CXFA_DocumentParser>(GetDocument());
+ auto pParser = std::make_unique<CXFA_DocumentParser>(GetDocument());
CFX_XMLNode* pXMLNode = pParser->ParseXMLData(expression);
if (!pXMLNode)
return CJS_Result::Success();
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_object.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_object.cpp
index e62ad869575..9e152d3834e 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_object.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_object.cpp
@@ -21,7 +21,6 @@
#include "fxjs/xfa/cjx_field.h"
#include "fxjs/xfa/cjx_instancemanager.h"
#include "third_party/base/compiler_specific.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fgas/crt/cfgas_decimal.h"
#include "xfa/fxfa/cxfa_ffnotify.h"
@@ -165,7 +164,7 @@ int32_t CJX_Object::Subform_and_SubformSet_InstanceIndex() {
}
bool CJX_Object::HasMethod(const WideString& func) const {
- return pdfium::ContainsKey(method_specs_, func.ToUTF8());
+ return pdfium::Contains(method_specs_, func.ToUTF8());
}
CJS_Result CJX_Object::RunMethod(
@@ -820,7 +819,7 @@ void CJX_Object::SetUserData(
XFA_MAPMODULEDATA* CJX_Object::CreateMapModuleData() {
if (!map_module_data_)
- map_module_data_ = pdfium::MakeUnique<XFA_MAPMODULEDATA>();
+ map_module_data_ = std::make_unique<XFA_MAPMODULEDATA>();
return map_module_data_.get();
}
@@ -921,8 +920,8 @@ bool CJX_Object::GetMapModuleBuffer(void* pKey,
bool CJX_Object::HasMapModuleKey(void* pKey) {
XFA_MAPMODULEDATA* pModule = GetMapModuleData();
- return pModule && (pdfium::ContainsKey(pModule->m_ValueMap, pKey) ||
- pdfium::ContainsKey(pModule->m_BufferMap, pKey));
+ return pModule && (pdfium::Contains(pModule->m_ValueMap, pKey) ||
+ pdfium::Contains(pModule->m_BufferMap, pKey));
}
void CJX_Object::ClearMapModuleBuffer() {
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_packet.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_packet.cpp
index 2c8b67df914..1200d027eb9 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_packet.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_packet.cpp
@@ -27,7 +27,7 @@ CJX_Packet::CJX_Packet(CXFA_Packet* packet) : CJX_Node(packet) {
DefineMethods(MethodSpecs);
}
-CJX_Packet::~CJX_Packet() {}
+CJX_Packet::~CJX_Packet() = default;
bool CJX_Packet::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_signaturepseudomodel.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_signaturepseudomodel.cpp
index 97ecd6e38fd..bd06b377623 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_signaturepseudomodel.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_signaturepseudomodel.cpp
@@ -25,7 +25,7 @@ CJX_SignaturePseudoModel::CJX_SignaturePseudoModel(
DefineMethods(MethodSpecs);
}
-CJX_SignaturePseudoModel::~CJX_SignaturePseudoModel() {}
+CJX_SignaturePseudoModel::~CJX_SignaturePseudoModel() = default;
bool CJX_SignaturePseudoModel::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_source.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_source.cpp
index f6d3187e41e..0e1aab9d531 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_source.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_source.cpp
@@ -35,7 +35,7 @@ CJX_Source::CJX_Source(CXFA_Source* src) : CJX_Node(src) {
DefineMethods(MethodSpecs);
}
-CJX_Source::~CJX_Source() {}
+CJX_Source::~CJX_Source() = default;
bool CJX_Source::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_subform.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_subform.cpp
index 8a72b5b5758..1ea6b562514 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_subform.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_subform.cpp
@@ -28,7 +28,7 @@ CJX_Subform::CJX_Subform(CXFA_Node* node) : CJX_Container(node) {
DefineMethods(MethodSpecs);
}
-CJX_Subform::~CJX_Subform() {}
+CJX_Subform::~CJX_Subform() = default;
bool CJX_Subform::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_template.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_template.cpp
index b3d9d9046f5..95ba486d691 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_template.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_template.cpp
@@ -26,7 +26,7 @@ CJX_Template::CJX_Template(CXFA_Template* tmpl) : CJX_Model(tmpl) {
DefineMethods(MethodSpecs);
}
-CJX_Template::~CJX_Template() {}
+CJX_Template::~CJX_Template() = default;
bool CJX_Template::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_textnode.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_textnode.cpp
index 756a71dcd7a..df6b305695a 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_textnode.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_textnode.cpp
@@ -11,7 +11,7 @@
CJX_TextNode::CJX_TextNode(CXFA_Node* node) : CJX_Node(node) {}
-CJX_TextNode::~CJX_TextNode() {}
+CJX_TextNode::~CJX_TextNode() = default;
bool CJX_TextNode::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_tree.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_tree.cpp
index cc13b7aad95..e03fe8388fb 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_tree.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_tree.cpp
@@ -6,12 +6,12 @@
#include "fxjs/xfa/cjx_tree.h"
+#include <memory>
#include <vector>
#include "fxjs/js_resources.h"
#include "fxjs/xfa/cfxjse_engine.h"
#include "fxjs/xfa/cfxjse_value.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fxfa/parser/cxfa_arraynodelist.h"
#include "xfa/fxfa/parser/cxfa_attachnodelist.h"
#include "xfa/fxfa/parser/cxfa_document.h"
@@ -27,7 +27,7 @@ CJX_Tree::CJX_Tree(CXFA_Object* obj) : CJX_Object(obj) {
DefineMethods(MethodSpecs);
}
-CJX_Tree::~CJX_Tree() {}
+CJX_Tree::~CJX_Tree() = default;
bool CJX_Tree::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
@@ -69,7 +69,7 @@ CJS_Result CJX_Tree::resolveNode(
return CJS_Result::Success(runtime->NewNull());
}
- auto pValue = pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>(pScriptContext->GetIsolate());
CJX_Object* jsObject = resolveNodeRS.objects.front()->JSObject();
(*resolveNodeRS.script_attribute.callback)(
jsObject, pValue.get(), false, resolveNodeRS.script_attribute.attribute);
@@ -88,7 +88,7 @@ CJS_Result CJX_Tree::resolveNodes(
refNode = GetDocument()->GetScriptContext()->GetThisObject();
CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
- auto pValue = pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>(pScriptContext->GetIsolate());
ResolveNodeList(pValue.get(), runtime->ToWideString(params[0]),
XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes |
XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent |
@@ -218,7 +218,7 @@ void CJX_Tree::ResolveNodeList(CFXJSE_Value* pValue,
resolveNodeRS.script_attribute.eValueType == XFA_ScriptType::Object) {
for (auto& pObject : resolveNodeRS.objects) {
auto innerValue =
- pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetIsolate());
+ std::make_unique<CFXJSE_Value>(pScriptContext->GetIsolate());
CJX_Object* jsObject = pObject->JSObject();
(*resolveNodeRS.script_attribute.callback)(
jsObject, innerValue.get(), false,
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_treelist.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_treelist.cpp
index 51bbb0ac5e2..151db828893 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_treelist.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_treelist.cpp
@@ -22,7 +22,7 @@ CJX_TreeList::CJX_TreeList(CXFA_TreeList* list) : CJX_List(list) {
DefineMethods(MethodSpecs);
}
-CJX_TreeList::~CJX_TreeList() {}
+CJX_TreeList::~CJX_TreeList() = default;
bool CJX_TreeList::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
diff --git a/chromium/third_party/pdfium/fxjs/xfa/cjx_wsdlconnection.cpp b/chromium/third_party/pdfium/fxjs/xfa/cjx_wsdlconnection.cpp
index 78212323205..da056622059 100644
--- a/chromium/third_party/pdfium/fxjs/xfa/cjx_wsdlconnection.cpp
+++ b/chromium/third_party/pdfium/fxjs/xfa/cjx_wsdlconnection.cpp
@@ -21,7 +21,7 @@ CJX_WsdlConnection::CJX_WsdlConnection(CXFA_WsdlConnection* connection)
DefineMethods(MethodSpecs);
}
-CJX_WsdlConnection::~CJX_WsdlConnection() {}
+CJX_WsdlConnection::~CJX_WsdlConnection() = default;
bool CJX_WsdlConnection::DynamicTypeIs(TypeTag eType) const {
return eType == static_type__ || ParentType__::DynamicTypeIs(eType);