WebKit Bugzilla
Attachment 343419 Details for
Bug 186961
: [Cocoa] Convert the small bit of Objective-C++ code in WTF to ARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186961-20180622214538.patch (text/plain), 4.36 KB, created by
Darin Adler
on 2018-06-22 21:45:38 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2018-06-22 21:45:38 PDT
Size:
4.36 KB
patch
obsolete
>Subversion Revision: 233120 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index fb36e290ea3ba3c5f47278d2e245ffe1cb8f7d68..93515eda77574a578c23897173ba691700e32da5 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-22 Darin Adler <darin@apple.com> >+ >+ [Cocoa] Convert the small bit of Objective-C++ code in WTF to ARC >+ https://bugs.webkit.org/show_bug.cgi?id=186961 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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 Darin Adler <darin@apple.com> > > [Cocoa] reduce unnecessary use of .mm source files in WTF, spruce up some implementation details >diff --git a/Source/WTF/Configurations/Base.xcconfig b/Source/WTF/Configurations/Base.xcconfig >index 8dfd59efecaeae0435bd4f44c7f5cc17feb3ddcd..058706042e02e03c3db1c88c62ecb563c2e5700c 100644 >--- a/Source/WTF/Configurations/Base.xcconfig >+++ b/Source/WTF/Configurations/Base.xcconfig >@@ -32,6 +32,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; > > 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; >diff --git a/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm b/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm >index f7ee6477a3059b479146cac0cb113b028f0b5a4a..754cae6e605957d7e6b4c70264fde99a121fe512 100644 >--- a/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm >+++ b/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm >@@ -134,13 +134,11 @@ void MemoryPressureHandler::uninstall() > 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 @@ void MemoryPressureHandler::holdOff(Seconds seconds) > 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(); >diff --git a/Source/WTF/wtf/mac/MainThreadMac.mm b/Source/WTF/wtf/mac/MainThreadMac.mm >index b5cf0ebefa080d01b5e04dfa7630ea844c4e8bdd..270be794e8541b7fe2776dedf83e2416186e55f3 100644 >--- a/Source/WTF/wtf/mac/MainThreadMac.mm >+++ b/Source/WTF/wtf/mac/MainThreadMac.mm >@@ -43,8 +43,7 @@ > #include <wtf/ios/WebCoreThread.h> > #endif > >-@interface JSWTFMainThreadCaller : NSObject { >-} >+@interface JSWTFMainThreadCaller : NSObject > - (void)call; > @end > >@@ -55,12 +54,12 @@ - (void)call > 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 @@ void initializeMainThreadPlatform() > #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 @@ void initializeWebThreadPlatform() > > mainThreadEstablishedAsPthreadMain = false; > mainThreadPthread = pthread_self(); >- mainThreadNSThread = [[NSThread currentThread] retain]; >+ mainThreadNSThread = [NSThread currentThread]; > > sWebThread = &Thread::current(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
andersca
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186961
: 343419