summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_isolatetracker.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-19 14:09:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-19 14:09:33 -0700
commitad589d7b83768f3b78ae6b9c90aa418611cc12c2 (patch)
treefe7d05842dfb43e738506b2f436eb0a27da73276 /fxjs/cfxjse_isolatetracker.h
parent5b13e1dc5770b73295f0c4a61c699a10eb7922e6 (diff)
downloadpdfium-ad589d7b83768f3b78ae6b9c90aa418611cc12c2.tar.xz
Fix leaked array buffer allocators of isolates
The array buffer allocators are allocated and owned by pdfium code, they should be deleted properly after the corresponding isolates are disposed. BUG=pdfium:242 Review-Url: https://codereview.chromium.org/2254123004
Diffstat (limited to 'fxjs/cfxjse_isolatetracker.h')
-rw-r--r--fxjs/cfxjse_isolatetracker.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fxjs/cfxjse_isolatetracker.h b/fxjs/cfxjse_isolatetracker.h
index 7558416a14..5340d9b5c0 100644
--- a/fxjs/cfxjse_isolatetracker.h
+++ b/fxjs/cfxjse_isolatetracker.h
@@ -7,6 +7,8 @@
#ifndef FXJS_CFXJSE_ISOLATETRACKER_H_
#define FXJS_CFXJSE_ISOLATETRACKER_H_
+#include <map>
+#include <memory>
#include <vector>
#include "v8/include/v8.h"
@@ -57,7 +59,8 @@ class CFXJSE_IsolateTracker {
CFXJSE_IsolateTracker();
~CFXJSE_IsolateTracker();
- void Append(v8::Isolate* pIsolate);
+ void Append(v8::Isolate* pIsolate,
+ std::unique_ptr<v8::ArrayBuffer::Allocator> alloc);
void Remove(v8::Isolate* pIsolate, DisposeCallback lpfnDisposeCallback);
void RemoveAll(DisposeCallback lpfnDisposeCallback);
@@ -65,6 +68,8 @@ class CFXJSE_IsolateTracker {
protected:
std::vector<v8::Isolate*> m_OwnedIsolates;
+ std::map<v8::Isolate*, std::unique_ptr<v8::ArrayBuffer::Allocator>>
+ m_AllocatorMap;
};
#endif // FXJS_CFXJSE_ISOLATETRACKER_H_