From 179bebb9a14dfd3ba91e9e068d4d436657a7c780 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 5 Apr 2016 11:02:18 -0700 Subject: Rename GetCStr and GetPtr to match CFX_ByteString. This CL updates CFX_ByteStringC to use the more common c_str and raw_str instead of GetCStr and GetPtr. Review URL: https://codereview.chromium.org/1857713003 --- xfa/fxjse/dynprop.cpp | 2 +- xfa/fxjse/value.cpp | 14 +++++++------- xfa/fxjse/value.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'xfa/fxjse') diff --git a/xfa/fxjse/dynprop.cpp b/xfa/fxjse/dynprop.cpp index fc408ac000..498c6608cf 100644 --- a/xfa/fxjse/dynprop.cpp +++ b/xfa/fxjse/dynprop.cpp @@ -61,7 +61,7 @@ static void FXJSE_DynPropGetterAdapter(const FXJSE_CLASS* lpClass, 0, const_cast(lpClass)); hCallBackInfo->SetInternalField( 1, v8::String::NewFromUtf8( - pIsolate, reinterpret_cast(szPropName.GetPtr()), + pIsolate, reinterpret_cast(szPropName.raw_str()), v8::String::kNormalString, szPropName.GetLength())); lpValue->ForceSetValue(v8::Function::New( lpValue->GetIsolate(), FXJSE_DynPropGetterAdapter_MethodCallback, diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp index f9214813c2..cd3220a17a 100644 --- a/xfa/fxjse/value.cpp +++ b/xfa/fxjse/value.cpp @@ -249,7 +249,7 @@ void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name, CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate); v8::Local hMessage = v8::String::NewFromUtf8( - pIsolate, utf8Message.GetCStr(), v8::String::kNormalString, + pIsolate, utf8Message.c_str(), v8::String::kNormalString, utf8Message.GetLength()); v8::Local hError; @@ -266,7 +266,7 @@ void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name, if (utf8Name != "Error" && !utf8Name.IsEmpty()) { hError.As()->Set( v8::String::NewFromUtf8(pIsolate, "name"), - v8::String::NewFromUtf8(pIsolate, utf8Name.GetCStr(), + v8::String::NewFromUtf8(pIsolate, utf8Name.c_str(), v8::String::kNormalString, utf8Name.GetLength())); } @@ -378,7 +378,7 @@ FX_BOOL CFXJSE_Value::SetObjectProperty(const CFX_ByteStringC& szPropName, v8::Local hPropValue = v8::Local::New(m_pIsolate, lpPropValue->DirectGetValue()); return (FX_BOOL)hObject.As()->Set( - v8::String::NewFromUtf8(m_pIsolate, szPropName.GetCStr(), + v8::String::NewFromUtf8(m_pIsolate, szPropName.c_str(), v8::String::kNormalString, szPropName.GetLength()), hPropValue); @@ -394,7 +394,7 @@ FX_BOOL CFXJSE_Value::GetObjectProperty(const CFX_ByteStringC& szPropName, v8::Local hPropValue = hObject.As()->Get(v8::String::NewFromUtf8( - m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString, + m_pIsolate, szPropName.c_str(), v8::String::kNormalString, szPropName.GetLength())); lpPropValue->ForceSetValue(hPropValue); return TRUE; @@ -434,7 +434,7 @@ FX_BOOL CFXJSE_Value::DeleteObjectProperty(const CFX_ByteStringC& szPropName) { return FALSE; hObject.As()->Delete(v8::String::NewFromUtf8( - m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString, + m_pIsolate, szPropName.c_str(), v8::String::kNormalString, szPropName.GetLength())); return TRUE; } @@ -448,7 +448,7 @@ FX_BOOL CFXJSE_Value::HasObjectOwnProperty(const CFX_ByteStringC& szPropName, return FALSE; v8::Local hKey = v8::String::NewFromUtf8( - m_pIsolate, szPropName.GetCStr(), v8::String::kNormalString, + m_pIsolate, szPropName.c_str(), v8::String::kNormalString, szPropName.GetLength()); return hObject.As()->HasRealNamedProperty(hKey) || (bUseTypeGetter && @@ -470,7 +470,7 @@ FX_BOOL CFXJSE_Value::SetObjectOwnProperty(const CFX_ByteStringC& szPropName, return hObject.As() ->DefineOwnProperty( m_pIsolate->GetCurrentContext(), - v8::String::NewFromUtf8(m_pIsolate, szPropName.GetCStr(), + v8::String::NewFromUtf8(m_pIsolate, szPropName.c_str(), v8::String::kNormalString, szPropName.GetLength()), hValue) diff --git a/xfa/fxjse/value.h b/xfa/fxjse/value.h index e728b8d857..2939ac34f7 100644 --- a/xfa/fxjse/value.h +++ b/xfa/fxjse/value.h @@ -180,7 +180,7 @@ class CFXJSE_Value { V8_INLINE void SetString(const CFX_ByteStringC& szString) { CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); v8::Local hValue = v8::String::NewFromUtf8( - m_pIsolate, reinterpret_cast(szString.GetPtr()), + m_pIsolate, reinterpret_cast(szString.raw_str()), v8::String::kNormalString, szString.GetLength()); m_hValue.Reset(m_pIsolate, hValue); } -- cgit v1.2.3