Diff
Modified: trunk/Source/WebKit/ChangeLog (292586 => 292587)
--- trunk/Source/WebKit/ChangeLog 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/ChangeLog 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1,3 +1,53 @@
+2022-04-07 Chris Dumez <[email protected]>
+
+ Replace deprecated String(const char*) with String::fromLatin1() in more places
+ https://bugs.webkit.org/show_bug.cgi?id=238925
+
+ Reviewed by Darin Adler.
+
+ * NetworkProcess/DatabaseUtilities.cpp:
+ (WebKit::DatabaseUtilities::stripIndexQueryToMatchStoredValue):
+ * NetworkProcess/cache/NetworkCache.cpp:
+ (WebKit::NetworkCache::Cache::dumpContentsToFile):
+ * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
+ * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
+ * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
+ * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
+ (encodeObject):
+ * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
+ (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
+ * Shared/Cocoa/SandboxExtensionCocoa.mm:
+ (WebKit::SandboxExtension::createHandleForTemporaryFile):
+ * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
+ (WebKit::XPCServiceInitializerDelegate::getClientBundleIdentifier):
+ (WebKit::XPCServiceInitializerDelegate::getClientProcessName):
+ (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
+ * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
+ (WebKit::XPCServiceMain):
+ * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
+ (+[_WKWebAuthenticationPanel getAllLocalAuthenticatorCredentials]):
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::showSafeBrowsingWarning):
+ * UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
+ (WebKit::ProcessLauncher::launchProcess):
+ * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
+ (WebKit::LocalAuthenticator::clearAllCredentials):
+ * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
+ (WebKit::LocalConnection::createCredentialPrivateKey const):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::pasteAccessCategoryForCommand):
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::didReceiveInvalidMessage):
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit::PDFPlugin::pluginInfo):
+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+ (WebKit::replaceSelectionPasteboardName):
+ * WebProcess/WebPage/IPCTestingAPI.cpp:
+ (WebKit::IPCTestingAPI::createJSArrayForArgumentDescriptions):
+ (WebKit::IPCTestingAPI::JSMessageListener::jsDescriptionFromDecoder):
+ * webpushd/WebPushDaemonMain.mm:
+ (WebKit::WebPushDaemonMain):
+
2022-04-07 Stephan Szabo <[email protected]>
Build-fix for not ENABLE(SERVICE_WORKER) after r292539
Modified: trunk/Source/WebKit/NetworkProcess/DatabaseUtilities.cpp (292586 => 292587)
--- trunk/Source/WebKit/NetworkProcess/DatabaseUtilities.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/NetworkProcess/DatabaseUtilities.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -205,7 +205,7 @@
String DatabaseUtilities::stripIndexQueryToMatchStoredValue(const char* originalQuery)
{
- return String(originalQuery).replace("CREATE UNIQUE INDEX IF NOT EXISTS", "CREATE UNIQUE INDEX");
+ return String::fromLatin1(originalQuery).replace("CREATE UNIQUE INDEX IF NOT EXISTS", "CREATE UNIQUE INDEX");
}
TableAndIndexPair DatabaseUtilities::currentTableAndIndexQueries(const String& tableName)
Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp (292586 => 292587)
--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -607,9 +607,10 @@
auto fd = openFile(dumpFilePath(), FileOpenMode::Write);
if (!isHandleValid(fd))
return;
- auto prologue = String("{\n\"entries\": [\n").utf8();
- writeToFile(fd, prologue.data(), prologue.length());
+ static const char prologue[] = "{\n\"entries\": [\n";
+ writeToFile(fd, prologue, strlen(prologue));
+
struct Totals {
unsigned count { 0 };
double worth { 0 };
Modified: trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb (292586 => 292587)
--- trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb 2022-04-08 02:21:13 UTC (rev 292587)
@@ -41,7 +41,7 @@
<%- if @pref.condition -%>
#if <%= @pref.condition %>
<%- end -%>
- API::ExperimentalFeature::create(String { <%= @pref.humanReadableName %> }, "<%= @pref.name %>"_s, String { <%= @pref.humanReadableDescription %> }, DEFAULT_VALUE_FOR_<%= @pref.name %>, <%= @pref.hidden %>),
+ API::ExperimentalFeature::create(<%= @pref.humanReadableName %>""_s, "<%= @pref.name %>"_s, <%= @pref.humanReadableDescription %>""_s, DEFAULT_VALUE_FOR_<%= @pref.name %>, <%= @pref.hidden %>),
<%- if @pref.condition -%>
#endif
<%- end -%>
Modified: trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb (292586 => 292587)
--- trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb 2022-04-08 02:21:13 UTC (rev 292587)
@@ -40,7 +40,7 @@
<%- if @pref.condition -%>
#if <%= @pref.condition %>
<%- end -%>
- API::InternalDebugFeature::create(String { <%= @pref.humanReadableName %> }, "<%= @pref.name %>"_s, String { <%= @pref.humanReadableDescription %> }, DEFAULT_VALUE_FOR_<%= @pref.name %>, <%= @pref.hidden %>),
+ API::InternalDebugFeature::create(<%= @pref.humanReadableName %>""_s, "<%= @pref.name %>"_s, <%= @pref.humanReadableDescription %>""_s, DEFAULT_VALUE_FOR_<%= @pref.name %>, <%= @pref.hidden %>),
<%- if @pref.condition -%>
#endif
<%- end -%>
Modified: trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb (292586 => 292587)
--- trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb 2022-04-08 02:21:13 UTC (rev 292587)
@@ -52,7 +52,11 @@
<%- if @pref.condition -%>
#if <%= @pref.condition %>
<%- end -%>
+<%- if @pref.type == "String" -%>
+ defaults.get().set(WebPreferencesKey::<%= @pref.nameLower %>Key(), Value(makeString(DEFAULT_VALUE_FOR_<%= @pref.name %>)));
+<%- else -%>
defaults.get().set(WebPreferencesKey::<%= @pref.nameLower %>Key(), Value(<%= @pref.type %>(DEFAULT_VALUE_FOR_<%= @pref.name %>)));
+<%- end -%>
<%- if @pref.condition -%>
#endif
<%- end -%>
Modified: trunk/Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm (292586 => 292587)
--- trunk/Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -464,7 +464,7 @@
encoder->_objectsBeingEncoded.remove(object);
});
- encoder->_currentDictionary->set(classNameKey, API::String::create(String { class_getName(objectClass) }));
+ encoder->_currentDictionary->set(classNameKey, API::String::create(String::fromLatin1(class_getName(objectClass))));
if ([object isKindOfClass:[NSInvocation class]]) {
// We have to special case NSInvocation since we don't want to encode the target.
Modified: trunk/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm (292586 => 292587)
--- trunk/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -162,7 +162,7 @@
if (strcmp([NSMethodSignature signatureWithObjCTypes:replyBlockSignature].methodReturnType, "v"))
[NSException raise:NSInvalidArgumentException format:@"Return value of block argument must be 'void'. (%s)", sel_getName(invocation.selector)];
- replyInfo = makeUnique<WebKit::RemoteObjectInvocation::ReplyInfo>(generateReplyIdentifier(), String { replyBlockSignature });
+ replyInfo = makeUnique<WebKit::RemoteObjectInvocation::ReplyInfo>(generateReplyIdentifier(), String::fromLatin1(replyBlockSignature));
// Replace the block object so we won't try to encode it.
id null = nullptr;
Modified: trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm (292586 => 292587)
--- trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -299,7 +299,7 @@
WTFLogAlways("Could not create a sandbox extension for temporary file '%s'", path.data());
return std::nullopt;
}
- return {{ WTFMove(handle), String(path.data()) }};
+ return { { WTFMove(handle), String::fromUTF8(path.data()) } };
}
auto SandboxExtension::createHandleForGenericExtension(ASCIILiteral extensionClass) -> std::optional<Handle>
Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm (292586 => 292587)
--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -78,7 +78,7 @@
bool XPCServiceInitializerDelegate::getClientBundleIdentifier(String& clientBundleIdentifier)
{
- clientBundleIdentifier = String { xpc_dictionary_get_string(m_initializerMessage, "client-bundle-identifier") };
+ clientBundleIdentifier = String::fromLatin1(xpc_dictionary_get_string(m_initializerMessage, "client-bundle-identifier"));
return !clientBundleIdentifier.isEmpty();
}
@@ -111,7 +111,7 @@
bool XPCServiceInitializerDelegate::getClientProcessName(String& clientProcessName)
{
- clientProcessName = String { xpc_dictionary_get_string(m_initializerMessage, "ui-process-name") };
+ clientProcessName = String::fromLatin1(xpc_dictionary_get_string(m_initializerMessage, "ui-process-name"));
return !clientProcessName.isEmpty();
}
@@ -119,30 +119,30 @@
{
xpc_object_t extraDataInitializationDataObject = xpc_dictionary_get_value(m_initializerMessage, "extra-initialization-data");
- String inspectorProcess { xpc_dictionary_get_string(extraDataInitializationDataObject, "inspector-process") };
+ auto inspectorProcess = String::fromLatin1(xpc_dictionary_get_string(extraDataInitializationDataObject, "inspector-process"));
if (!inspectorProcess.isEmpty())
extraInitializationData.add("inspector-process"_s, inspectorProcess);
#if ENABLE(SERVICE_WORKER)
- String serviceWorkerProcess { xpc_dictionary_get_string(extraDataInitializationDataObject, "service-worker-process") };
+ auto serviceWorkerProcess = String::fromLatin1(xpc_dictionary_get_string(extraDataInitializationDataObject, "service-worker-process"));
if (!serviceWorkerProcess.isEmpty())
extraInitializationData.add("service-worker-process"_s, WTFMove(serviceWorkerProcess));
- String registrableDomain { xpc_dictionary_get_string(extraDataInitializationDataObject, "registrable-domain") };
+ auto registrableDomain = String::fromLatin1(xpc_dictionary_get_string(extraDataInitializationDataObject, "registrable-domain"));
if (!registrableDomain.isEmpty())
extraInitializationData.add("registrable-domain"_s, WTFMove(registrableDomain));
#endif
- String isPrewarmedProcess { xpc_dictionary_get_string(extraDataInitializationDataObject, "is-prewarmed") };
+ auto isPrewarmedProcess = String::fromLatin1(xpc_dictionary_get_string(extraDataInitializationDataObject, "is-prewarmed"));
if (!isPrewarmedProcess.isEmpty())
extraInitializationData.add("is-prewarmed"_s, isPrewarmedProcess);
if (!isClientSandboxed()) {
- String userDirectorySuffix { xpc_dictionary_get_string(extraDataInitializationDataObject, "user-directory-suffix") };
+ auto userDirectorySuffix = String::fromLatin1(xpc_dictionary_get_string(extraDataInitializationDataObject, "user-directory-suffix"));
if (!userDirectorySuffix.isEmpty())
extraInitializationData.add("user-directory-suffix"_s, userDirectorySuffix);
}
- String alwaysRunsAtBackgroundPriority { xpc_dictionary_get_string(extraDataInitializationDataObject, "always-runs-at-background-priority") };
+ auto alwaysRunsAtBackgroundPriority = String::fromLatin1(xpc_dictionary_get_string(extraDataInitializationDataObject, "always-runs-at-background-priority"));
if (!alwaysRunsAtBackgroundPriority.isEmpty())
extraInitializationData.add("always-runs-at-background-priority"_s, alwaysRunsAtBackgroundPriority);
Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm (292586 => 292587)
--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -203,7 +203,7 @@
}
}
#endif
- String webKitBundleVersion { xpc_dictionary_get_string(bootstrap.get(), "WebKitBundleVersion") };
+ auto webKitBundleVersion = String::fromLatin1(xpc_dictionary_get_string(bootstrap.get(), "WebKitBundleVersion"));
String expectedBundleVersion = [NSBundle bundleWithIdentifier:@"com.apple.WebKit"].infoDictionary[(__bridge NSString *)kCFBundleVersionKey];
if (!webKitBundleVersion.isNull() && !expectedBundleVersion.isNull() && webKitBundleVersion != expectedBundleVersion) {
auto errorMessage = makeString("WebKit framework version mismatch: ", webKitBundleVersion, " != ", expectedBundleVersion);
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm (292586 => 292587)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -315,7 +315,7 @@
+ (NSArray<NSDictionary *> *)getAllLocalAuthenticatorCredentials
{
#if ENABLE(WEB_AUTHN)
- return getAllLocalAuthenticatorCredentialsImpl(String(WebCore::LocalAuthenticatorAccessGroup)).autorelease();
+ return getAllLocalAuthenticatorCredentialsImpl(@(WebCore::LocalAuthenticatorAccessGroup)).autorelease();
#else
return nullptr;
#endif
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (292586 => 292587)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1900,7 +1900,7 @@
return completionHandler(ContinueUnsafeLoad::Yes);
WebCore::DiagnosticLoggingClient::ValueDictionary showedWarningDictionary;
- showedWarningDictionary.set("source"_s, String("service"));
+ showedWarningDictionary.set("source"_s, "service"_s);
m_page->logDiagnosticMessageWithValueDictionary("SafeBrowsing.ShowedWarning"_s, "Safari"_s, showedWarningDictionary, WebCore::ShouldSample::No);
@@ -1915,7 +1915,7 @@
bool forMainFrameNavigation = [weakThis->m_safeBrowsingWarning forMainFrameNavigation];
WebCore::DiagnosticLoggingClient::ValueDictionary dictionary;
- dictionary.set("source"_s, String("service"));
+ dictionary.set("source"_s, "service"_s);
if (navigatesFrame && forMainFrameNavigation) {
// The safe browsing warning will be hidden once the next page is shown.
bool continuingUnsafeLoad = WTF::switchOn(result,
@@ -1924,15 +1924,15 @@
);
if (continuingUnsafeLoad)
- dictionary.set("action"_s, String("visit website"));
+ dictionary.set("action"_s, "visit website"_s);
else
- dictionary.set("action"_s, String("redirect to url"));
+ dictionary.set("action"_s, "redirect to url"_s);
weakThis->m_page->logDiagnosticMessageWithValueDictionary("SafeBrowsing.PerformedAction"_s, "Safari"_s, dictionary, WebCore::ShouldSample::No);
return;
}
- dictionary.set("action"_s, String("go back"));
+ dictionary.set("action"_s, "go back"_s);
weakThis->m_page->logDiagnosticMessageWithValueDictionary("SafeBrowsing.PerformedAction"_s, "Safari"_s, dictionary, WebCore::ShouldSample::No);
if (!navigatesFrame && weakThis->m_safeBrowsingWarning && !forMainFrameNavigation) {
Modified: trunk/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm (292586 => 292587)
--- trunk/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -237,7 +237,7 @@
xpc_dictionary_set_value(bootstrapMessage.get(), "extra-initialization-data", extraInitializationData.get());
- auto errorHandlerImpl = [weakProcessLauncher = WeakPtr { *this }, listeningPort, logName = String(name)] (xpc_object_t event) {
+ auto errorHandlerImpl = [weakProcessLauncher = WeakPtr { *this }, listeningPort, logName = CString(name)] (xpc_object_t event) {
ASSERT(!event || xpc_get_type(event) == XPC_TYPE_ERROR);
auto processLauncher = weakProcessLauncher.get();
@@ -252,9 +252,9 @@
#endif
if (event)
- LOG_ERROR("Error while launching %s: %s", logName.utf8().data(), xpc_dictionary_get_string(event, XPC_ERROR_KEY_DESCRIPTION));
+ LOG_ERROR("Error while launching %s: %s", logName.data(), xpc_dictionary_get_string(event, XPC_ERROR_KEY_DESCRIPTION));
else
- LOG_ERROR("Error while launching %s: No xpc_object_t event available.", logName.utf8().data());
+ LOG_ERROR("Error while launching %s: No xpc_object_t event available.", logName.data());
#if ASSERT_ENABLED
mach_port_urefs_t sendRightCount = 0;
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm (292586 => 292587)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -189,7 +189,7 @@
auto query = adoptNS([[NSMutableDictionary alloc] init]);
[query setDictionary:@{
(id)kSecClass: (id)kSecClassKey,
- (id)kSecAttrAccessGroup: (id)String(LocalAuthenticatorAccessGroup),
+ (id)kSecAttrAccessGroup: @(LocalAuthenticatorAccessGroup),
(id)kSecUseDataProtectionKeychain: @YES
}];
updateQueryIfNecessary(query.get());
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm (292586 => 292587)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -170,7 +170,7 @@
RetainPtr privateKeyAttributes = @{
(id)kSecAttrAccessControl: (id)accessControlRef,
(id)kSecAttrIsPermanent: @YES,
- (id)kSecAttrAccessGroup: (id)String(LocalAuthenticatorAccessGroup),
+ (id)kSecAttrAccessGroup: @(LocalAuthenticatorAccessGroup),
(id)kSecAttrLabel: secAttrLabel,
(id)kSecAttrApplicationTag: secAttrApplicationTag,
};
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (292586 => 292587)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -2538,11 +2538,11 @@
static std::optional<DOMPasteAccessCategory> pasteAccessCategoryForCommand(const String& commandName)
{
static NeverDestroyed<HashMap<String, DOMPasteAccessCategory, ASCIICaseInsensitiveHash>> pasteCommandNames = HashMap<String, DOMPasteAccessCategory, ASCIICaseInsensitiveHash> {
- { "Paste", DOMPasteAccessCategory::General },
- { "PasteAndMatchStyle", DOMPasteAccessCategory::General },
- { "PasteAsQuotation", DOMPasteAccessCategory::General },
- { "PasteAsPlainText", DOMPasteAccessCategory::General },
- { "PasteFont", DOMPasteAccessCategory::Fonts },
+ { "Paste"_s, DOMPasteAccessCategory::General },
+ { "PasteAndMatchStyle"_s, DOMPasteAccessCategory::General },
+ { "PasteAsQuotation"_s, DOMPasteAccessCategory::General },
+ { "PasteAsPlainText"_s, DOMPasteAccessCategory::General },
+ { "PasteFont"_s, DOMPasteAccessCategory::Fonts },
};
auto it = pasteCommandNames->find(commandName);
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (292586 => 292587)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -635,7 +635,7 @@
if (!s_invalidMessageCallback)
return;
- s_invalidMessageCallback(toAPI(API::String::create(String { description(messageName) }).ptr()));
+ s_invalidMessageCallback(toAPI(API::String::create(String::fromLatin1(description(messageName))).ptr()));
}
void WebProcessPool::resolvePathsForSandboxExtensions()
Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (292586 => 292587)
--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1284,13 +1284,13 @@
MimeClassInfo pdfMimeClassInfo;
pdfMimeClassInfo.type = "application/pdf"_s;
pdfMimeClassInfo.desc = pdfDocumentTypeDescription();
- pdfMimeClassInfo.extensions.append("pdf");
+ pdfMimeClassInfo.extensions.append("pdf"_s);
info.mimes.append(pdfMimeClassInfo);
MimeClassInfo textPDFMimeClassInfo;
textPDFMimeClassInfo.type = "text/pdf"_s;
textPDFMimeClassInfo.desc = pdfDocumentTypeDescription();
- textPDFMimeClassInfo.extensions.append("pdf");
+ textPDFMimeClassInfo.extensions.append("pdf"_s);
info.mimes.append(textPDFMimeClassInfo);
return info;
Modified: trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (292586 => 292587)
--- trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -541,7 +541,7 @@
static String& replaceSelectionPasteboardName()
{
- static NeverDestroyed<String> string("ReplaceSelectionPasteboard");
+ static NeverDestroyed<String> string("ReplaceSelectionPasteboard"_s);
return string;
}
Modified: trunk/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp (292586 => 292587)
--- trunk/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1983,10 +1983,10 @@
argumentsArray->putDirectIndex(globalObject, argumentIndex, jsDescriptions);
RETURN_IF_EXCEPTION(scope, JSC::jsTDZValue());
- jsDescriptions->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), JSC::jsString(vm, String(description.name)));
+ jsDescriptions->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), JSC::jsString(vm, String::fromLatin1(description.name)));
RETURN_IF_EXCEPTION(scope, JSC::jsTDZValue());
- jsDescriptions->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsString(vm, String(description.type)));
+ jsDescriptions->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsString(vm, String::fromLatin1(description.type)));
RETURN_IF_EXCEPTION(scope, JSC::jsTDZValue());
jsDescriptions->putDirect(vm, JSC::Identifier::fromString(vm, "optional"_s), JSC::jsBoolean(description.isOptional));
@@ -1993,7 +1993,7 @@
RETURN_IF_EXCEPTION(scope, JSC::jsTDZValue());
if (description.enumName) {
- jsDescriptions->putDirect(vm, JSC::Identifier::fromString(vm, "enum"_s), JSC::jsString(vm, String(description.enumName)));
+ jsDescriptions->putDirect(vm, JSC::Identifier::fromString(vm, "enum"_s), JSC::jsString(vm, String::fromLatin1(description.enumName)));
RETURN_IF_EXCEPTION(scope, JSC::jsTDZValue());
}
}
@@ -2141,7 +2141,7 @@
jsResult->putDirect(vm, JSC::Identifier::fromString(vm, "name"_s), JSC::JSValue(static_cast<unsigned>(decoder.messageName())));
RETURN_IF_EXCEPTION(scope, nullptr);
- jsResult->putDirect(vm, JSC::Identifier::fromString(vm, "description"_s), JSC::jsString(vm, String { IPC::description(decoder.messageName()) }));
+ jsResult->putDirect(vm, JSC::Identifier::fromString(vm, "description"_s), JSC::jsString(vm, String::fromLatin1(IPC::description(decoder.messageName()))));
RETURN_IF_EXCEPTION(scope, nullptr);
jsResult->putDirect(vm, JSC::Identifier::fromString(vm, "destinationID"_s), JSC::JSValue(decoder.destinationID()));
Modified: trunk/Source/WebKit/webpushd/WebPushDaemonMain.mm (292586 => 292587)
--- trunk/Source/WebKit/webpushd/WebPushDaemonMain.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKit/webpushd/WebPushDaemonMain.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -130,7 +130,7 @@
else {
String libraryPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)[0];
String pushDatabasePath = FileSystem::pathByAppendingComponents(libraryPath, { "WebKit"_s, "WebPush"_s, "PushDatabase.db"_s });
- ::WebPushD::Daemon::singleton().startPushService(String { incomingPushServiceName }, pushDatabasePath);
+ ::WebPushD::Daemon::singleton().startPushService(String::fromLatin1(incomingPushServiceName), pushDatabasePath);
}
}
CFRunLoopRun();
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (292586 => 292587)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1,5 +1,17 @@
2022-04-07 Chris Dumez <[email protected]>
+ Replace deprecated String(const char*) with String::fromLatin1() in more places
+ https://bugs.webkit.org/show_bug.cgi?id=238925
+
+ Reviewed by Darin Adler.
+
+ * History/HistoryPropertyList.mm:
+ (HistoryPropertyListWriter::HistoryPropertyListWriter):
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView coreCommandByName:]):
+
+2022-04-07 Chris Dumez <[email protected]>
+
Drop unused EditorClient::getAutoCorrectSuggestionForMisspelledWord()
https://bugs.webkit.org/show_bug.cgi?id=238897
Modified: trunk/Source/WebKitLegacy/mac/History/HistoryPropertyList.mm (292586 => 292587)
--- trunk/Source/WebKitLegacy/mac/History/HistoryPropertyList.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKitLegacy/mac/History/HistoryPropertyList.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -33,12 +33,12 @@
static const int currentFileVersion = 1;
HistoryPropertyListWriter::HistoryPropertyListWriter()
- : m_displayTitleKey("displayTitle")
- , m_lastVisitWasFailureKey("lastVisitWasFailure")
- , m_lastVisitedDateKey("lastVisitedDate")
- , m_redirectURLsKey("redirectURLs")
- , m_titleKey("title")
- , m_urlKey("")
+ : m_displayTitleKey("displayTitle"_s)
+ , m_lastVisitWasFailureKey("lastVisitWasFailure"_s)
+ , m_lastVisitedDateKey("lastVisitedDate"_s)
+ , m_redirectURLsKey("redirectURLs"_s)
+ , m_titleKey("title"_s)
+ , m_urlKey(emptyString())
, m_buffer(0)
{
}
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (292586 => 292587)
--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -2650,7 +2650,7 @@
auto* coreFrame = core([self _frame]);
if (!coreFrame)
return WebCore::Editor::Command();
- return coreFrame->editor().command(String { name });
+ return coreFrame->editor().command(String::fromLatin1(name));
}
- (void)executeCoreCommandBySelector:(SEL)selector
Modified: trunk/Tools/ChangeLog (292586 => 292587)
--- trunk/Tools/ChangeLog 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Tools/ChangeLog 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1,3 +1,26 @@
+2022-04-07 Chris Dumez <[email protected]>
+
+ Replace deprecated String(const char*) with String::fromLatin1() in more places
+ https://bugs.webkit.org/show_bug.cgi?id=238925
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/TestRunner.cpp:
+ (TestRunner::setAccummulateLogsForChannel):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (handleControlCommand):
+ (changeWindowScaleIfNeeded):
+ (resetWebViewToConsistentState):
+ * TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp:
+ (TestWebKitAPI::TEST):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::waitForPostDumpWatchdogTimerFired):
+ * WebKitTestRunner/cocoa/CrashReporterInfo.mm:
+ (WTR::testPathFromURL):
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::cocoaPlatformInitialize):
+ (WTR::TestController::cocoaResetStateToConsistentValues):
+
2022-04-07 Carlos Alberto Lopez Perez <[email protected]>
REGRESSION(r292109): [GTK][WPE] generate-bundle: Don't try to use the interpreter prefix when not bundling all.
Modified: trunk/Tools/DumpRenderTree/TestRunner.cpp (292586 => 292587)
--- trunk/Tools/DumpRenderTree/TestRunner.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Tools/DumpRenderTree/TestRunner.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -2218,7 +2218,7 @@
auto buffer = makeUniqueArray<char>(maxLength + 1);
JSStringGetUTF8CString(channel, buffer.get(), maxLength + 1);
- WebCoreTestSupport::setLogChannelToAccumulate(String { buffer.get() });
+ WebCoreTestSupport::setLogChannelToAccumulate(String::fromLatin1(buffer.get()));
}
using CallbackMap = WTF::HashMap<unsigned, JSObjectRef>;
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (292586 => 292587)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1046,7 +1046,7 @@
{
if (!strncmp("#CHECK FOR WORLD LEAKS", command, 22) || !strncmp("#LIST CHILD PROCESSES", command, 21)) {
// DumpRenderTree does not support checking for world leaks or listing child processes.
- WTF::String result("\n");
+ WTF::String result("\n"_s);
unsigned resultLength = result.length();
printf("Content-Type: text/plain\n");
printf("Content-Length: %u\n", resultLength);
@@ -1499,7 +1499,7 @@
#if !PLATFORM(IOS_FAMILY)
static void changeWindowScaleIfNeeded(const char* testPathOrURL)
{
- auto localPathOrURL = String(testPathOrURL);
+ auto localPathOrURL = String::fromUTF8(testPathOrURL);
float currentScaleFactor = [[[mainFrame webView] window] backingScaleFactor];
float requiredScaleFactor = 1;
if (localPathOrURL.containsIgnoringASCIICase("/hidpi-3x-"))
@@ -1803,7 +1803,7 @@
[[NSPasteboard generalPasteboard] declareTypes:@[NSStringPboardType] owner:nil];
#endif
- WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(String { options.additionalSupportedImageTypes().c_str() });
+ WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(String::fromLatin1(options.additionalSupportedImageTypes().c_str()));
[mainFrame _clearOpener];
Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp (292586 => 292587)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -192,7 +192,7 @@
const String value;
const Vector<uint8_t> cborData;
} kStringTestCases[] = {
- { String("string_without_nul"),
+ { "string_without_nul"_str,
{ 0x72, 0x73, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x5F, 0x77, 0x69, 0x74, 0x68,
0x6F, 0x75, 0x74, 0x5F, 0x6E, 0x75, 0x6C } },
{ String("nul_terminated_string\0", 22),
Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (292586 => 292587)
--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2022-04-08 02:21:13 UTC (rev 292587)
@@ -1708,7 +1708,7 @@
#if PLATFORM(COCOA)
char buffer[1024];
snprintf(buffer, sizeof(buffer), "#PID UNRESPONSIVE - %s (pid %d)\n", getprogname(), getpid());
- outputText(String { buffer });
+ outputText(String::fromLatin1(buffer));
#endif
done();
}
Modified: trunk/Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm (292586 => 292587)
--- trunk/Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -46,7 +46,7 @@
String pathString(pathCFString.get());
if (equalLettersIgnoringASCIICase(schemeString, "file")) {
- String layoutTests("/LayoutTests/");
+ String layoutTests("/LayoutTests/"_s);
size_t layoutTestsOffset = pathString.find(layoutTests);
if (layoutTestsOffset == notFound)
return String();
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (292586 => 292587)
--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2022-04-08 01:35:03 UTC (rev 292586)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2022-04-08 02:21:13 UTC (rev 292587)
@@ -110,9 +110,9 @@
if (!dumpRenderTreeTemp)
return;
- String resourceLoadStatisticsFolder = String(dumpRenderTreeTemp) + '/' + "ResourceLoadStatistics";
+ String resourceLoadStatisticsFolder = makeString(dumpRenderTreeTemp, "/ResourceLoadStatistics");
[[NSFileManager defaultManager] createDirectoryAtPath:resourceLoadStatisticsFolder withIntermediateDirectories:YES attributes:nil error: nil];
- String fullBrowsingSessionResourceLog = resourceLoadStatisticsFolder + '/' + "full_browsing_session_resourceLog.plist";
+ String fullBrowsingSessionResourceLog = makeString(resourceLoadStatisticsFolder, "/full_browsing_session_resourceLog.plist");
NSDictionary *resourceLogPlist = @{ @"version": @(1) };
if (![resourceLogPlist writeToFile:fullBrowsingSessionResourceLog atomically:YES])
WTFCrash();
@@ -328,7 +328,7 @@
[globalWebsiteDataStoreDelegateClient() setAllowRaisingQuota:YES];
- WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(String { options.additionalSupportedImageTypes().c_str() });
+ WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(String::fromLatin1(options.additionalSupportedImageTypes().c_str()));
}
void TestController::platformWillRunTest(const TestInvocation& testInvocation)