OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 FXJSE_INCLUDE_CFXJSE_VALUE_H_ | 7 #ifndef FXJSE_INCLUDE_CFXJSE_VALUE_H_ |
8 #define FXJSE_INCLUDE_CFXJSE_VALUE_H_ | 8 #define FXJSE_INCLUDE_CFXJSE_VALUE_H_ |
9 | 9 |
10 #include "fxjse/scope_inline.h" | 10 #include "fxjse/scope_inline.h" |
11 | 11 |
12 class CFXJSE_Value { | 12 class CFXJSE_Value { |
13 public: | 13 public: |
14 CFXJSE_Value(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {} | 14 explicit CFXJSE_Value(v8::Isolate* pIsolate); |
| 15 ~CFXJSE_Value(); |
15 | 16 |
16 FX_BOOL IsUndefined() const { | 17 FX_BOOL IsUndefined() const { |
17 if (m_hValue.IsEmpty()) { | 18 if (m_hValue.IsEmpty()) { |
18 return FALSE; | 19 return FALSE; |
19 } | 20 } |
20 CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); | 21 CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); |
21 v8::Local<v8::Value> hValue = | 22 v8::Local<v8::Value> hValue = |
22 v8::Local<v8::Value>::New(m_pIsolate, m_hValue); | 23 v8::Local<v8::Value>::New(m_pIsolate, m_hValue); |
23 return hValue->IsUndefined(); | 24 return hValue->IsUndefined(); |
24 } | 25 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 229 |
229 CFXJSE_Value(); | 230 CFXJSE_Value(); |
230 CFXJSE_Value(const CFXJSE_Value&); | 231 CFXJSE_Value(const CFXJSE_Value&); |
231 CFXJSE_Value& operator=(const CFXJSE_Value&); | 232 CFXJSE_Value& operator=(const CFXJSE_Value&); |
232 | 233 |
233 v8::Isolate* m_pIsolate; | 234 v8::Isolate* m_pIsolate; |
234 v8::Global<v8::Value> m_hValue; | 235 v8::Global<v8::Value> m_hValue; |
235 }; | 236 }; |
236 | 237 |
237 #endif // FXJSE_INCLUDE_CFXJSE_VALUE_H_ | 238 #endif // FXJSE_INCLUDE_CFXJSE_VALUE_H_ |
OLD | NEW |