Skip to content

Commit 3c707c7

Browse files
committed
Rename WTF::adoptSystem() to WTF::adoptSystemMalloc() for clarity
https://bugs.webkit.org/show_bug.cgi?id=300592 Reviewed by Ryosuke Niwa. * Source/JavaScriptCore/API/JSValue.mm: (createStructHandlerMap): * Source/JavaScriptCore/jsc.cpp: (runInteractive): * Source/WTF/wtf/SystemFree.h: (WTF::adoptSystemMalloc): (WTF::adoptSystem): Deleted. * Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: (WebKit::socketAddressFromIncomingConnection): * Source/WebKit/Platform/cocoa/NetworkIssueReporter.mm: (WebKit::NetworkIssueReporter::NetworkIssueReporter): * Source/WebKit/Shared/Cocoa/LaunchLogHook.mm: (WebKit::LaunchLogHook::initialize): * Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::registerLogClient): * Source/WebKitLegacy/mac/WebView/WebPDFView.mm: (-[WebPDFView _temporaryPDFDirectoryPath]): Canonical link: https://commits.webkit.org/301387@main
1 parent 8106797 commit 3c707c7

8 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎Source/JavaScriptCore/API/JSValue.mm‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ - (JSValue *)initWithValue:(JSValueRef)value inContext:(JSContext *)context
12751275
char idType[3];
12761276
// Check 2nd argument type is "@"
12771277
{
1278-
auto secondType = adoptSystem(method_copyArgumentType(method, 3));
1278+
auto secondType = adoptSystemMalloc(method_copyArgumentType(method, 3));
12791279
if (strcmp(secondType.get(), "@") != 0)
12801280
return;
12811281
}
@@ -1284,7 +1284,7 @@ - (JSValue *)initWithValue:(JSValueRef)value inContext:(JSContext *)context
12841284
if (strcmp(idType, "@") != 0)
12851285
return;
12861286
{
1287-
auto type = adoptSystem(method_copyArgumentType(method, 2));
1287+
auto type = adoptSystemMalloc(method_copyArgumentType(method, 2));
12881288
structHandlers->add(StringImpl::createFromCString(type.get()), (StructTagHandler) { selector, 0 });
12891289
}
12901290
});
@@ -1300,7 +1300,7 @@ - (JSValue *)initWithValue:(JSValueRef)value inContext:(JSContext *)context
13001300
if (method_getNumberOfArguments(method) != 2)
13011301
return;
13021302
// Try to find a matching valueWith<Foo>:context: method.
1303-
auto type = adoptSystem(method_copyReturnType(method));
1303+
auto type = adoptSystemMalloc(method_copyReturnType(method));
13041304
StructHandlers::iterator iter = structHandlers->find(String::fromLatin1(type.get()));
13051305
if (iter == structHandlers->end())
13061306
return;

‎Source/JavaScriptCore/jsc.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3915,7 +3915,7 @@ static void runInteractive(GlobalObject* globalObject)
39153915
String source;
39163916
do {
39173917
error = ParserError();
3918-
auto line = adoptSystem(readline(source.isEmpty() ? interactivePrompt : "... "));
3918+
auto line = adoptSystemMalloc(readline(source.isEmpty() ? interactivePrompt : "... "));
39193919
shouldQuit = !line;
39203920
if (!line)
39213921
break;

‎Source/WTF/wtf/SystemFree.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ struct SystemFree {
4040
};
4141

4242
template<typename T>
43-
inline std::unique_ptr<T, WTF::SystemFree<T>> adoptSystem(T* value)
43+
inline std::unique_ptr<T, WTF::SystemFree<T>> adoptSystemMalloc(T* value)
4444
{
4545
return std::unique_ptr<T, WTF::SystemFree<T>>(value);
4646
}
4747

4848
} // namespace WTF
4949

50-
using WTF::adoptSystem;
50+
using WTF::adoptSystemMalloc;

‎Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static dispatch_queue_t udpSocketQueueSingleton()
174174
auto endpoint = adoptNS(nw_connection_copy_endpoint(connection));
175175
auto type = nw_endpoint_get_type(endpoint.get());
176176
if (type == nw_endpoint_type_address) {
177-
auto ipAddress = adoptSystem(nw_endpoint_copy_address_string(endpoint.get()));
177+
auto ipAddress = adoptSystemMalloc(nw_endpoint_copy_address_string(endpoint.get()));
178178
webrtc::SocketAddress remoteAddress { ipAddress.get(), nw_endpoint_get_port(endpoint.get()) };
179179
return remoteAddress;
180180
}

‎Source/WebKit/Platform/cocoa/NetworkIssueReporter.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
NetworkIssueReporter::NetworkIssueReporter()
6464
{
6565
if (auto* copyStacktrace = ne_tracker_copy_current_stacktracePtr())
66-
m_stackTrace = adoptSystem(copyStacktrace(&m_stackTraceSize));
66+
m_stackTrace = adoptSystemMalloc(copyStacktrace(&m_stackTraceSize));
6767
}
6868

6969
NetworkIssueReporter::~NetworkIssueReporter() = default;

‎Source/WebKit/Shared/Cocoa/LaunchLogHook.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
if (type == OS_LOG_TYPE_FAULT)
7272
type = OS_LOG_TYPE_ERROR;
7373

74-
if (auto messageString = adoptSystem(os_log_copy_message_string(msg))) {
74+
if (auto messageString = adoptSystemMalloc(os_log_copy_message_string(msg))) {
7575
auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
7676
xpc_dictionary_set_string(message.get(), XPCEndpoint::xpcMessageNameKey, logMessageName);
7777
if (auto* subsystem = msg->subsystem)

‎Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ static void registerLogClient(bool isDebugLoggingEnabled, std::unique_ptr<LogCli
886886
if (type == OS_LOG_TYPE_FAULT)
887887
type = OS_LOG_TYPE_ERROR;
888888

889-
if (auto messageString = adoptSystem(os_log_copy_message_string(msg))) {
889+
if (auto messageString = adoptSystemMalloc(os_log_copy_message_string(msg))) {
890890
auto logString = spanConstCast<Latin1Character>(unsafeSpan8IncludingNullTerminator(messageString.get()));
891891
if (logString.size() > logStringMaxSize) {
892892
logString = logString.first(logStringMaxSize);

‎Source/WebKitLegacy/mac/WebView/WebPDFView.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ - (NSString *)_temporaryPDFDirectoryPath
13721372

13731373
if (!_temporaryPDFDirectoryPath) {
13741374
NSString *temporaryDirectoryTemplate = [NSTemporaryDirectory() stringByAppendingPathComponent:@"WebKitPDFs-XXXXXX"];
1375-
auto cTemplate = adoptSystem(strdup([temporaryDirectoryTemplate fileSystemRepresentation]));
1375+
auto cTemplate = adoptSystemMalloc(strdup([temporaryDirectoryTemplate fileSystemRepresentation]));
13761376

13771377
if (!mkdtemp(cTemplate.get())) {
13781378
// This should never happen; if it does we'll fail silently on non-debug builds.

0 commit comments

Comments
 (0)