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

Side by Side Diff: fxjs/cfxjse_runtimedata.h

Issue 2354923003: Fix leaks related to the usage of JSE runtime 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 unified diff | Download patch
« no previous file with comments | « no previous file | fxjs/cfxjse_runtimedata.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef FXJS_CFXJSE_RUNTIMEDATA_H_ 7 #ifndef FXJS_CFXJSE_RUNTIMEDATA_H_
8 #define FXJS_CFXJSE_RUNTIMEDATA_H_ 8 #define FXJS_CFXJSE_RUNTIMEDATA_H_
9 9
10 #include <memory>
11
10 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
11 13
12 class CFXJSE_RuntimeList; 14 class CFXJSE_RuntimeList;
13 15
14 class CFXJSE_RuntimeData { 16 class CFXJSE_RuntimeData {
15 public: 17 public:
16 ~CFXJSE_RuntimeData(); 18 ~CFXJSE_RuntimeData();
17 19
18 static CFXJSE_RuntimeData* Get(v8::Isolate* pIsolate); 20 static CFXJSE_RuntimeData* Get(v8::Isolate* pIsolate);
19 21
20 v8::Isolate* m_pIsolate; 22 v8::Isolate* m_pIsolate;
21 v8::Global<v8::FunctionTemplate> m_hRootContextGlobalTemplate; 23 v8::Global<v8::FunctionTemplate> m_hRootContextGlobalTemplate;
22 v8::Global<v8::Context> m_hRootContext; 24 v8::Global<v8::Context> m_hRootContext;
23 25
24 protected: 26 protected:
25 explicit CFXJSE_RuntimeData(v8::Isolate* pIsolate); 27 explicit CFXJSE_RuntimeData(v8::Isolate* pIsolate);
26 28
27 static CFXJSE_RuntimeData* Create(v8::Isolate* pIsolate); 29 static std::unique_ptr<CFXJSE_RuntimeData> Create(v8::Isolate* pIsolate);
28 30
29 private: 31 private:
30 CFXJSE_RuntimeData(const CFXJSE_RuntimeData&) = delete; 32 CFXJSE_RuntimeData(const CFXJSE_RuntimeData&) = delete;
31 CFXJSE_RuntimeData& operator=(const CFXJSE_RuntimeData&) = delete; 33 CFXJSE_RuntimeData& operator=(const CFXJSE_RuntimeData&) = delete;
32 }; 34 };
33 35
34 #endif // FXJS_CFXJSE_RUNTIMEDATA_H_ 36 #endif // FXJS_CFXJSE_RUNTIMEDATA_H_
OLDNEW
« no previous file with comments | « no previous file | fxjs/cfxjse_runtimedata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698