Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: fxjs/include/fxjs_v8.h

Issue 2358343002: Simplify memory management for per isolate data (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fxjs/fxjs_v8.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fxjs/include/fxjs_v8.h
diff --git a/fxjs/include/fxjs_v8.h b/fxjs/include/fxjs_v8.h
index 8b5fc8399aee9e34e126343cc3de465b91c520f5..c87d8a5873e64883ccb9075f5106108d47a41460 100644
--- a/fxjs/include/fxjs_v8.h
+++ b/fxjs/include/fxjs_v8.h
@@ -100,23 +100,14 @@ class 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);
- }
- void ReleaseDynamicObjsMap() {
- delete m_pDynamicObjsMap;
- m_pDynamicObjsMap = nullptr;
- }
-
- std::vector<CFXJS_ObjDefinition*> m_ObjectDefnArray;
+ std::vector<std::unique_ptr<CFXJS_ObjDefinition>> m_ObjectDefnArray;
#ifdef PDF_ENABLE_XFA
std::unique_ptr<CFXJSE_RuntimeData> m_pFXJSERuntimeData;
#endif // PDF_ENABLE_XFA
- V8TemplateMap* m_pDynamicObjsMap;
+ std::unique_ptr<V8TemplateMap> m_pDynamicObjsMap;
protected:
- FXJS_PerIsolateData();
+ explicit FXJS_PerIsolateData(v8::Isolate* pIsolate);
};
class FXJS_ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
« no previous file with comments | « fxjs/fxjs_v8.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698