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

Unified Diff: xfa/fxjse/value.h

Issue 2044293004: Convert CFXJSE_Value::ToString to return. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@fm2jscontext_cleanup_9
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 side-by-side diff with in-line comments
Download patch
Index: xfa/fxjse/value.h
diff --git a/xfa/fxjse/value.h b/xfa/fxjse/value.h
index da4976b53cb146f7d2fd6f7ac8a2c3c241acbc85..264fde66a578ad50f43a6921bc839ba35efb7364 100644
--- a/xfa/fxjse/value.h
+++ b/xfa/fxjse/value.h
@@ -172,14 +172,18 @@ class CFXJSE_Value {
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
return static_cast<int32_t>(hValue->NumberValue());
}
- V8_INLINE void ToString(CFX_ByteString& szStrOutput) const {
+ V8_INLINE CFX_ByteString ToString() const {
ASSERT(!m_hValue.IsEmpty());
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hValue =
v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
v8::Local<v8::String> hString = hValue->ToString();
v8::String::Utf8Value hStringVal(hString);
- szStrOutput = *hStringVal;
+ return CFX_ByteString(*hStringVal);
+ }
+ V8_INLINE CFX_ByteStringC ToStringC() const { return ToString().AsStringC(); }
Tom Sepez 2016/06/09 16:43:56 Nope. The call to ToString() creates a temporary b
dsinclair 2016/06/09 17:26:54 Done.
+ V8_INLINE CFX_WideString ToWideString() const {
+ return CFX_WideString::FromUTF8(ToStringC());
Tom Sepez 2016/06/09 16:47:55 Note that ToWideString() will be fine (once we fix
}
CFXJSE_HostObject* ToHostObject(CFXJSE_Class* lpClass) const;
« xfa/fxfa/parser/xfa_object_imp.cpp ('K') | « xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698