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 XFA_FXJSE_VALUE_H_ | 7 #ifndef XFA_FXJSE_VALUE_H_ |
8 #define XFA_FXJSE_VALUE_H_ | 8 #define XFA_FXJSE_VALUE_H_ |
9 | 9 |
10 #include "xfa/fxjse/scope_inline.h" | 10 #include "xfa/fxjse/scope_inline.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 V8_INLINE void ToString(CFX_ByteString& szStrOutput) const { | 135 V8_INLINE void ToString(CFX_ByteString& szStrOutput) const { |
136 ASSERT(!m_hValue.IsEmpty()); | 136 ASSERT(!m_hValue.IsEmpty()); |
137 CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); | 137 CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); |
138 v8::Local<v8::Value> hValue = | 138 v8::Local<v8::Value> hValue = |
139 v8::Local<v8::Value>::New(m_pIsolate, m_hValue); | 139 v8::Local<v8::Value>::New(m_pIsolate, m_hValue); |
140 v8::Local<v8::String> hString = hValue->ToString(); | 140 v8::Local<v8::String> hString = hValue->ToString(); |
141 v8::String::Utf8Value hStringVal(hString); | 141 v8::String::Utf8Value hStringVal(hString); |
142 szStrOutput = *hStringVal; | 142 szStrOutput = *hStringVal; |
143 } | 143 } |
144 CFXJSE_HostObject* ToObject(CFXJSE_Class* lpClass) const; | 144 CFXJSE_HostObject* ToHostObject(CFXJSE_Class* lpClass) const; |
145 | 145 |
146 V8_INLINE void SetUndefined() { | 146 V8_INLINE void SetUndefined() { |
147 CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); | 147 CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); |
148 v8::Local<v8::Value> hValue = v8::Undefined(m_pIsolate); | 148 v8::Local<v8::Value> hValue = v8::Undefined(m_pIsolate); |
149 m_hValue.Reset(m_pIsolate, hValue); | 149 m_hValue.Reset(m_pIsolate, hValue); |
150 } | 150 } |
151 V8_INLINE void SetNull() { | 151 V8_INLINE void SetNull() { |
152 CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); | 152 CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); |
153 v8::Local<v8::Value> hValue = v8::Null(m_pIsolate); | 153 v8::Local<v8::Value> hValue = v8::Null(m_pIsolate); |
154 m_hValue.Reset(m_pIsolate, hValue); | 154 m_hValue.Reset(m_pIsolate, hValue); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 CFXJSE_Value(); | 225 CFXJSE_Value(); |
226 CFXJSE_Value(const CFXJSE_Value&); | 226 CFXJSE_Value(const CFXJSE_Value&); |
227 CFXJSE_Value& operator=(const CFXJSE_Value&); | 227 CFXJSE_Value& operator=(const CFXJSE_Value&); |
228 | 228 |
229 v8::Isolate* m_pIsolate; | 229 v8::Isolate* m_pIsolate; |
230 v8::Global<v8::Value> m_hValue; | 230 v8::Global<v8::Value> m_hValue; |
231 }; | 231 }; |
232 | 232 |
233 #endif // XFA_FXJSE_VALUE_H_ | 233 #endif // XFA_FXJSE_VALUE_H_ |
OLD | NEW |