From 625ad667d0c0c17d5bc11d505f04861d90b45078 Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 15 Jun 2016 11:21:33 -0700 Subject: 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 --- fpdfsdk/jsapi/include/fxjs_v8.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'fpdfsdk/jsapi/include') diff --git a/fpdfsdk/jsapi/include/fxjs_v8.h b/fpdfsdk/jsapi/include/fxjs_v8.h index 60389d2e1a..3ae1d5e0ca 100644 --- a/fpdfsdk/jsapi/include/fxjs_v8.h +++ b/fpdfsdk/jsapi/include/fxjs_v8.h @@ -81,11 +81,11 @@ class V8TemplateMap { public: typedef v8::GlobalValueMap MapType; - void set(void* key, v8::Local handle) { - ASSERT(!m_map.Contains(key)); - m_map.Set(key, handle); - } - explicit V8TemplateMap(v8::Isolate* isolate) : m_map(isolate) {} + explicit V8TemplateMap(v8::Isolate* isolate); + ~V8TemplateMap(); + + void set(void* key, v8::Local handle); + friend class V8TemplateMapTraits; private: @@ -94,8 +94,11 @@ class V8TemplateMap { class FXJS_PerIsolateData { public: + ~FXJS_PerIsolateData(); + static void SetUp(v8::Isolate* pIsolate); static FXJS_PerIsolateData* Get(v8::Isolate* pIsolate); + void CreateDynamicObjsMap(v8::Isolate* pIsolate) { if (!m_pDynamicObjsMap) m_pDynamicObjsMap = new V8TemplateMap(pIsolate); @@ -112,12 +115,7 @@ class FXJS_PerIsolateData { V8TemplateMap* m_pDynamicObjsMap; protected: -#ifndef PDF_ENABLE_XFA - FXJS_PerIsolateData() : m_pDynamicObjsMap(nullptr) {} -#else // PDF_ENABLE_XFA - FXJS_PerIsolateData() - : m_pFXJSERuntimeData(nullptr), m_pDynamicObjsMap(nullptr) {} -#endif // PDF_ENABLE_XFA + FXJS_PerIsolateData(); }; extern const wchar_t kFXJSValueNameString[]; -- cgit v1.2.3