Title: [233128] trunk/Source/WTF
Revision
233128
Author
[email protected]
Date
2018-06-23 08:30:33 -0700 (Sat, 23 Jun 2018)

Log Message

[Cocoa] Convert the small bit of Objective-C++ code in WTF to ARC
https://bugs.webkit.org/show_bug.cgi?id=186961

Reviewed by Anders Carlsson.

* Configurations/Base.xcconfig: Turn on ARC.

* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::uninstall): Remove calls to dispatch_release.
(WTF::MemoryPressureHandler::holdOff): Ditto.

* wtf/mac/MainThreadMac.mm:
(WTF::initializeMainThreadPlatform): Remove call to retain.
(WTF::initializeWebThreadPlatform): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (233127 => 233128)


--- trunk/Source/WTF/ChangeLog	2018-06-23 15:30:08 UTC (rev 233127)
+++ trunk/Source/WTF/ChangeLog	2018-06-23 15:30:33 UTC (rev 233128)
@@ -1,3 +1,20 @@
+2018-06-22  Darin Adler  <[email protected]>
+
+        [Cocoa] Convert the small bit of Objective-C++ code in WTF to ARC
+        https://bugs.webkit.org/show_bug.cgi?id=186961
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/Base.xcconfig: Turn on ARC.
+
+        * wtf/cocoa/MemoryPressureHandlerCocoa.mm:
+        (WTF::MemoryPressureHandler::uninstall): Remove calls to dispatch_release.
+        (WTF::MemoryPressureHandler::holdOff): Ditto.
+
+        * wtf/mac/MainThreadMac.mm:
+        (WTF::initializeMainThreadPlatform): Remove call to retain.
+        (WTF::initializeWebThreadPlatform): Ditto.
+
 2018-06-22  Yusuke Suzuki  <[email protected]>
 
         [WTF] Use Ref<> for the result type of non-failing factory functions

Modified: trunk/Source/WTF/Configurations/Base.xcconfig (233127 => 233128)


--- trunk/Source/WTF/Configurations/Base.xcconfig	2018-06-23 15:30:08 UTC (rev 233127)
+++ trunk/Source/WTF/Configurations/Base.xcconfig	2018-06-23 15:30:33 UTC (rev 233128)
@@ -32,6 +32,7 @@
 
 CLANG_CXX_LANGUAGE_STANDARD = gnu++14;
 CLANG_CXX_LIBRARY = libc++;
+CLANG_ENABLE_OBJC_ARC = YES;
 CLANG_ENABLE_OBJC_WEAK = YES;
 CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
 CLANG_WARN_BOOL_CONVERSION = YES;

Modified: trunk/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm (233127 => 233128)


--- trunk/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm	2018-06-23 15:30:08 UTC (rev 233127)
+++ trunk/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm	2018-06-23 15:30:33 UTC (rev 233128)
@@ -134,13 +134,11 @@
     dispatch_async(dispatch_get_main_queue(), ^{
         if (_cache_event_source) {
             dispatch_source_cancel(_cache_event_source);
-            dispatch_release(_cache_event_source);
             _cache_event_source = 0;
         }
 
         if (_timer_event_source) {
             dispatch_source_cancel(_timer_event_source);
-            dispatch_release(_timer_event_source);
             _timer_event_source = 0;
         }
     });
@@ -163,7 +161,6 @@
             dispatch_source_set_event_handler(_timer_event_source, ^{
                 if (_timer_event_source) {
                     dispatch_source_cancel(_timer_event_source);
-                    dispatch_release(_timer_event_source);
                     _timer_event_source = 0;
                 }
                 MemoryPressureHandler::singleton().install();

Modified: trunk/Source/WTF/wtf/mac/MainThreadMac.mm (233127 => 233128)


--- trunk/Source/WTF/wtf/mac/MainThreadMac.mm	2018-06-23 15:30:08 UTC (rev 233127)
+++ trunk/Source/WTF/wtf/mac/MainThreadMac.mm	2018-06-23 15:30:33 UTC (rev 233128)
@@ -43,8 +43,7 @@
 #include <wtf/ios/WebCoreThread.h>
 #endif
 
-@interface JSWTFMainThreadCaller : NSObject {
-}
+@interface JSWTFMainThreadCaller : NSObject
 - (void)call;
 @end
 
@@ -55,12 +54,12 @@
     WTF::dispatchFunctionsFromMainThread();
 }
 
-@end // implementation JSWTFMainThreadCaller
+@end
 
 namespace WTF {
 
 static JSWTFMainThreadCaller* staticMainThreadCaller;
-static bool isTimerPosted; // This is only accessed on the 'main' thread.
+static bool isTimerPosted; // This is only accessed on the main thread.
 static bool mainThreadEstablishedAsPthreadMain;
 static pthread_t mainThreadPthread;
 static NSThread* mainThreadNSThread;
@@ -78,7 +77,7 @@
 #if !USE(WEB_THREAD)
     mainThreadEstablishedAsPthreadMain = false;
     mainThreadPthread = pthread_self();
-    mainThreadNSThread = [[NSThread currentThread] retain];
+    mainThreadNSThread = [NSThread currentThread];
 #else
     mainThreadEstablishedAsPthreadMain = true;
     ASSERT(!mainThreadPthread);
@@ -186,7 +185,7 @@
 
     mainThreadEstablishedAsPthreadMain = false;
     mainThreadPthread = pthread_self();
-    mainThreadNSThread = [[NSThread currentThread] retain];
+    mainThreadNSThread = [NSThread currentThread];
 
     sWebThread = &Thread::current();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to