From 275e260a6cd4a8e506ba974feb85ebcd926c1739 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 18 Sep 2017 14:23:18 -0400 Subject: Convert string class names Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez Commit-Queue: Ryan Harrison --- fxjs/cfxjse_class.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'fxjs/cfxjse_class.cpp') diff --git a/fxjs/cfxjse_class.cpp b/fxjs/cfxjse_class.cpp index 3dba0abbd6..8f4334f89e 100644 --- a/fxjs/cfxjse_class.cpp +++ b/fxjs/cfxjse_class.cpp @@ -24,7 +24,7 @@ void V8FunctionCallback_Wrapper( if (!lpFunctionInfo) return; - CFX_ByteStringC szFunctionName(lpFunctionInfo->name); + ByteStringView szFunctionName(lpFunctionInfo->name); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(info.Holder()); auto lpRetValue = pdfium::MakeUnique(info.GetIsolate()); @@ -42,7 +42,7 @@ void V8ClassGlobalConstructorCallback_Wrapper( if (!lpClassDefinition) return; - CFX_ByteStringC szFunctionName(lpClassDefinition->name); + ByteStringView szFunctionName(lpClassDefinition->name); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(info.Holder()); auto lpRetValue = pdfium::MakeUnique(info.GetIsolate()); @@ -60,7 +60,7 @@ void V8GetterCallback_Wrapper(v8::Local property, if (!lpPropertyInfo) return; - CFX_ByteStringC szPropertyName(lpPropertyInfo->name); + ByteStringView szPropertyName(lpPropertyInfo->name); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); auto lpPropValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(info.Holder()); @@ -77,7 +77,7 @@ void V8SetterCallback_Wrapper(v8::Local property, if (!lpPropertyInfo) return; - CFX_ByteStringC szPropertyName(lpPropertyInfo->name); + ByteStringView szPropertyName(lpPropertyInfo->name); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); auto lpPropValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(info.Holder()); @@ -108,7 +108,7 @@ void Context_GlobalObjToString( return; if (info.This() == info.Holder() && lpClass->name) { - CFX_ByteString szStringVal; + ByteString szStringVal; szStringVal.Format("[object %s]", lpClass->name); info.GetReturnValue().Set(v8::String::NewFromUtf8( info.GetIsolate(), szStringVal.c_str(), v8::String::kNormalString, @@ -131,7 +131,7 @@ void DynPropGetterAdapter_MethodCallback( hCallBackInfo->GetInternalField(1).As(); ASSERT(lpClass && !hPropName.IsEmpty()); v8::String::Utf8Value szPropName(hPropName); - CFX_ByteStringC szFxPropName = *szPropName; + ByteStringView szFxPropName = *szPropName; auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(info.Holder()); auto lpRetValue = pdfium::MakeUnique(info.GetIsolate()); @@ -143,7 +143,7 @@ void DynPropGetterAdapter_MethodCallback( void DynPropGetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, CFXJSE_Value* pObject, - const CFX_ByteStringC& szPropName, + const ByteStringView& szPropName, CFXJSE_Value* pValue) { ASSERT(lpClass); int32_t nPropType = @@ -179,7 +179,7 @@ void DynPropGetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, void DynPropSetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, CFXJSE_Value* pObject, - const CFX_ByteStringC& szPropName, + const ByteStringView& szPropName, CFXJSE_Value* pValue) { ASSERT(lpClass); int32_t nPropType = @@ -194,7 +194,7 @@ void DynPropSetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, bool DynPropQueryAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, CFXJSE_Value* pObject, - const CFX_ByteStringC& szPropName) { + const ByteStringView& szPropName) { ASSERT(lpClass); int32_t nPropType = lpClass->dynPropTypeGetter == nullptr @@ -205,7 +205,7 @@ bool DynPropQueryAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, bool DynPropDeleterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, CFXJSE_Value* pObject, - const CFX_ByteStringC& szPropName) { + const ByteStringView& szPropName) { ASSERT(lpClass); int32_t nPropType = lpClass->dynPropTypeGetter == nullptr @@ -228,7 +228,7 @@ void NamedPropertyQueryCallback( v8::Isolate* pIsolate = info.GetIsolate(); v8::HandleScope scope(pIsolate); v8::String::Utf8Value szPropName(property); - CFX_ByteStringC szFxPropName(*szPropName, szPropName.length()); + ByteStringView szFxPropName(*szPropName, szPropName.length()); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(thisObject); if (DynPropQueryAdapter(lpClass, lpThisValue.get(), szFxPropName)) { @@ -248,7 +248,7 @@ void NamedPropertyDeleterCallback( v8::Isolate* pIsolate = info.GetIsolate(); v8::HandleScope scope(pIsolate); v8::String::Utf8Value szPropName(property); - CFX_ByteStringC szFxPropName(*szPropName, szPropName.length()); + ByteStringView szFxPropName(*szPropName, szPropName.length()); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(thisObject); info.GetReturnValue().Set( @@ -262,7 +262,7 @@ void NamedPropertyGetterCallback( const FXJSE_CLASS_DESCRIPTOR* lpClass = static_cast( info.Data().As()->Value()); v8::String::Utf8Value szPropName(property); - CFX_ByteStringC szFxPropName(*szPropName, szPropName.length()); + ByteStringView szFxPropName(*szPropName, szPropName.length()); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(thisObject); auto lpNewValue = pdfium::MakeUnique(info.GetIsolate()); @@ -279,7 +279,7 @@ void NamedPropertySetterCallback( const FXJSE_CLASS_DESCRIPTOR* lpClass = static_cast( info.Data().As()->Value()); v8::String::Utf8Value szPropName(property); - CFX_ByteStringC szFxPropName(*szPropName, szPropName.length()); + ByteStringView szFxPropName(*szPropName, szPropName.length()); auto lpThisValue = pdfium::MakeUnique(info.GetIsolate()); lpThisValue->ForceSetValue(thisObject); -- cgit v1.2.3