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

Side by Side Diff: xfa/fxjse/value.h

Issue 2026993003: Remove FXJSE_Value_ToObject and call methods directly (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@context_cleanup_3
Patch Set: Created 4 years, 6 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 | « xfa/fxjse/include/fxjse.h ('k') | xfa/fxjse/value.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 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
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
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_
OLDNEW
« no previous file with comments | « xfa/fxjse/include/fxjse.h ('k') | xfa/fxjse/value.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698