summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_runtimedata.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-09-21 10:19:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-21 10:19:50 -0700
commit54be7be992f1cde40b9d5c0e55a119c6cc4e4e02 (patch)
treef5b2926ecf00cba53a9becb0db08b00e64c55ff5 /fxjs/cfxjse_runtimedata.h
parent5819e4f334521cb1599f3d5f1f28df40528727ba (diff)
downloadpdfium-54be7be992f1cde40b9d5c0e55a119c6cc4e4e02.tar.xz
Fix leaks related to the usage of JSE runtime data
Per isolate runtime data should be deleted when the associated isolate's destructed. Also, the internal of per isolate runtime data is obscure to the JS engine. So XFA or this class itself has to be in charge of the memory management. Use smart pointer for it so that the resource could be released properly. BUG=pdfium:242 Review-Url: https://codereview.chromium.org/2354923003
Diffstat (limited to 'fxjs/cfxjse_runtimedata.h')
-rw-r--r--fxjs/cfxjse_runtimedata.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fxjs/cfxjse_runtimedata.h b/fxjs/cfxjse_runtimedata.h
index 34f8f32d92..292fe26ae3 100644
--- a/fxjs/cfxjse_runtimedata.h
+++ b/fxjs/cfxjse_runtimedata.h
@@ -7,6 +7,8 @@
#ifndef FXJS_CFXJSE_RUNTIMEDATA_H_
#define FXJS_CFXJSE_RUNTIMEDATA_H_
+#include <memory>
+
#include "v8/include/v8.h"
class CFXJSE_RuntimeList;
@@ -24,7 +26,7 @@ class CFXJSE_RuntimeData {
protected:
explicit CFXJSE_RuntimeData(v8::Isolate* pIsolate);
- static CFXJSE_RuntimeData* Create(v8::Isolate* pIsolate);
+ static std::unique_ptr<CFXJSE_RuntimeData> Create(v8::Isolate* pIsolate);
private:
CFXJSE_RuntimeData(const CFXJSE_RuntimeData&) = delete;