summaryrefslogtreecommitdiff
path: root/fpdfsdk/jsapi/fxjs_v8.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-15 11:21:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-15 11:21:33 -0700
commit625ad667d0c0c17d5bc11d505f04861d90b45078 (patch)
treeefd014e752072adf726a0e34383555399342dcb2 /fpdfsdk/jsapi/fxjs_v8.cpp
parent29b8ad0b130ec6ed4f72ebd0c0a4f9e6a5b03467 (diff)
downloadpdfium-625ad667d0c0c17d5bc11d505f04861d90b45078.tar.xz
Make code compile with clang_use_chrome_plugin (part IV)
This change mainly contains files in fpdfsdk/ directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups plus removing an unused file and splitting cxfa_eventparam out from fxfa.h BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2062313002
Diffstat (limited to 'fpdfsdk/jsapi/fxjs_v8.cpp')
-rw-r--r--fpdfsdk/jsapi/fxjs_v8.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/fpdfsdk/jsapi/fxjs_v8.cpp b/fpdfsdk/jsapi/fxjs_v8.cpp
index 790d10b602..c63ef7ae89 100644
--- a/fpdfsdk/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/jsapi/fxjs_v8.cpp
@@ -190,6 +190,17 @@ size_t FXJS_GlobalIsolateRefCount() {
return g_isolate_ref_count;
}
+V8TemplateMap::V8TemplateMap(v8::Isolate* isolate) : m_map(isolate) {}
+
+V8TemplateMap::~V8TemplateMap() {}
+
+void V8TemplateMap::set(void* key, v8::Local<v8::Object> handle) {
+ ASSERT(!m_map.Contains(key));
+ m_map.Set(key, handle);
+}
+
+FXJS_PerIsolateData::~FXJS_PerIsolateData() {}
+
// static
void FXJS_PerIsolateData::SetUp(v8::Isolate* pIsolate) {
if (!pIsolate->GetData(g_embedderDataSlot))
@@ -202,6 +213,13 @@ FXJS_PerIsolateData* FXJS_PerIsolateData::Get(v8::Isolate* pIsolate) {
pIsolate->GetData(g_embedderDataSlot));
}
+#ifndef PDF_ENABLE_XFA
+FXJS_PerIsolateData::FXJS_PerIsolateData() : m_pDynamicObjsMap(nullptr) {}
+#else // PDF_ENABLE_XFA
+FXJS_PerIsolateData::FXJS_PerIsolateData()
+ : m_pFXJSERuntimeData(nullptr), m_pDynamicObjsMap(nullptr) {}
+#endif // PDF_ENABLE_XFA
+
int FXJS_DefineObj(v8::Isolate* pIsolate,
const wchar_t* sObjName,
FXJSOBJTYPE eObjType,