Changeset 174045 in webkit
- Timestamp:
- Sep 28, 2014 1:59:28 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 17 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r173993 r174045 1 2014-09-26 Sam Weinig <sam@webkit.org> 2 3 Replace OSObjectPtr with RetainPtr/adoptOS 4 https://bugs.webkit.org/show_bug.cgi?id=137158 5 6 Reviewed by Dan Bernstein. 7 8 * WTF.xcodeproj/project.pbxproj: 9 * wtf/OSObjectPtr.h: Removed. 10 * wtf/RetainPtr.h: 11 (WTF::adoptOS): 12 Added. This adopt function is slightly different than both adoptCF and adoptNS, 13 in that unlike adoptCF(), it can be passed an Objective-C type (since OS objects 14 are sometimes Objective-C objects, but not always), and unlike adoptNS() it doesn't 15 require us to jump through hoops to appease GC (since OS objects are not Objective-C 16 objects if GC is enabled). 17 1 18 2014-09-24 Filip Pizlo <fpizlo@apple.com> 2 19 -
trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
r173367 r174045 74 74 2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0F118115C85004DBA70 /* RunLoop.cpp */; }; 75 75 2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CDED0F218115C85004DBA70 /* RunLoop.h */; }; 76 7CBBA07419BB7FDC00BBF025 /* OSObjectPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CBBA07319BB7FDC00BBF025 /* OSObjectPtr.h */; };77 76 7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; }; 78 77 7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; }; … … 361 360 5D247B7314689C4700E78B76 /* WTF.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WTF.xcconfig; sourceTree = "<group>"; }; 362 361 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CopyWTFHeaders.xcconfig; sourceTree = "<group>"; }; 363 7CBBA07319BB7FDC00BBF025 /* OSObjectPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSObjectPtr.h; sourceTree = "<group>"; };364 362 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorAdaptors.h; sourceTree = "<group>"; }; 365 363 7CDD7FF9186D2A54007433CD /* IteratorRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorRange.h; sourceTree = "<group>"; }; … … 791 789 A8A472D7151A825B004123FF /* OSAllocator.h */, 792 790 A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */, 793 7CBBA07319BB7FDC00BBF025 /* OSObjectPtr.h */,794 791 A8A472DA151A825B004123FF /* OSRandomSource.cpp */, 795 792 A8A472DB151A825B004123FF /* OSRandomSource.h */, … … 1086 1083 93B1AA80180E5AF3004A2F05 /* PassRef.h in Headers */, 1087 1084 A8A473EA151A825B004123FF /* MD5.h in Headers */, 1088 7CBBA07419BB7FDC00BBF025 /* OSObjectPtr.h in Headers */,1089 1085 CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */, 1090 1086 A8A473EB151A825B004123FF /* MessageQueue.h in Headers */, -
trunk/Source/WTF/wtf/RetainPtr.h
r173807 r174045 51 51 template<typename T> class RetainPtr; 52 52 53 template<typename T> RetainPtr<T> adoptOS(T CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; 53 54 template<typename T> RetainPtr<T> adoptCF(T CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; 54 55 template<typename T> RetainPtr<T> adoptNS(T NS_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; … … 101 102 void swap(RetainPtr&); 102 103 104 template<typename U> friend RetainPtr<U> adoptOS(U CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; 103 105 template<typename U> friend RetainPtr<U> adoptCF(U CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; 104 106 template<typename U> friend RetainPtr<U> adoptNS(U NS_RELEASES_ARGUMENT) WARN_UNUSED_RETURN; … … 248 250 { 249 251 return a != b.get(); 252 } 253 254 template<typename T> inline RetainPtr<T> adoptOS(T CF_RELEASES_ARGUMENT ptr) 255 { 256 return RetainPtr<T>(ptr, RetainPtr<T>::Adopt); 250 257 } 251 258 … … 315 322 316 323 using WTF::RetainPtr; 324 using WTF::adoptOS; 317 325 using WTF::adoptCF; 318 326 using WTF::adoptNS; -
trunk/Source/WebKit2/ChangeLog
r174031 r174045 1 2014-09-26 Sam Weinig <sam@webkit.org> 2 3 Replace OSObjectPtr with RetainPtr/adoptOS 4 https://bugs.webkit.org/show_bug.cgi?id=137158 5 6 Reviewed by Dan Bernstein. 7 8 * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm: 9 (DatabaseServiceInitializer): 10 * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: 11 (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate): 12 (NetworkServiceInitializer): 13 * Platform/IPC/Connection.h: 14 (IPC::Connection::Identifier::Identifier): 15 * Platform/IPC/mac/ConnectionMac.mm: 16 (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog): 17 (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): 18 * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm: 19 (WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate): 20 (PluginServiceInitializer): 21 * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: 22 (WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate): 23 (WebKit::XPCServiceInitializer): 24 * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: 25 (WebKit::XPCServiceInitializerDelegate::checkEntitlements): 26 (WebKit::XPCServiceInitializerDelegate::hasEntitlement): 27 * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: 28 (WebKit::XPCServiceEventHandler): 29 * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: 30 (WebKit::XPCServiceEventHandler): 31 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: 32 (WebKit::connectToService): 33 (WebKit::connectToReExecService): 34 * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: 35 (WebContentServiceInitializer): 36 1 37 2014-09-26 Christophe Dumez <cdumez@apple.com> 2 38 -
trunk/Source/WebKit2/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm
r173367 r174045 37 37 void DatabaseServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage) 38 38 { 39 XPCServiceInitializer<DatabaseProcess, XPCServiceInitializerDelegate>(adoptOS Object(connection), initializerMessage);39 XPCServiceInitializer<DatabaseProcess, XPCServiceInitializerDelegate>(adoptOS(connection), initializerMessage); 40 40 } -
trunk/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm
r173367 r174045 35 35 class NetworkServiceInitializerDelegate : public XPCServiceInitializerDelegate { 36 36 public: 37 NetworkServiceInitializerDelegate( OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)37 NetworkServiceInitializerDelegate(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage) 38 38 : XPCServiceInitializerDelegate(WTF::move(connection), initializerMessage) 39 39 { … … 54 54 EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/SecItemShim.dylib"); 55 55 56 XPCServiceInitializer<NetworkProcess, NetworkServiceInitializerDelegate>(adoptOS Object(connection), initializerMessage);56 XPCServiceInitializer<NetworkProcess, NetworkServiceInitializerDelegate>(adoptOS(connection), initializerMessage); 57 57 #endif 58 58 } -
trunk/Source/WebKit2/Platform/IPC/Connection.h
r173378 r174045 43 43 #if OS(DARWIN) 44 44 #include <mach/mach_port.h> 45 #include <wtf/RetainPtr.h> 45 46 #include <xpc/xpc.h> 46 #include <wtf/OSObjectPtr.h>47 47 #endif 48 48 … … 112 112 } 113 113 114 Identifier(mach_port_t port, OSObjectPtr<xpc_connection_t> xpcConnection)114 Identifier(mach_port_t port, RetainPtr<xpc_connection_t> xpcConnection) 115 115 : port(port) 116 116 , xpcConnection(WTF::move(xpcConnection)) … … 119 119 120 120 mach_port_t port; 121 OSObjectPtr<xpc_connection_t> xpcConnection;121 RetainPtr<xpc_connection_t> xpcConnection; 122 122 }; 123 123 static bool identifierIsNull(Identifier identifier) { return identifier.port == MACH_PORT_NULL; } … … 321 321 #endif 322 322 323 OSObjectPtr<xpc_connection_t> m_xpcConnection;323 RetainPtr<xpc_connection_t> m_xpcConnection; 324 324 325 325 #elif USE(UNIX_DOMAIN_SOCKETS) -
trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm
r173367 r174045 76 76 class ConnectionTerminationWatchdog { 77 77 public: 78 static void createConnectionTerminationWatchdog( OSObjectPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)78 static void createConnectionTerminationWatchdog(RetainPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds) 79 79 { 80 80 new ConnectionTerminationWatchdog(xpcConnection, intervalInSeconds); … … 82 82 83 83 private: 84 ConnectionTerminationWatchdog( OSObjectPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)84 ConnectionTerminationWatchdog(RetainPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds) 85 85 : m_xpcConnection(xpcConnection) 86 86 , m_watchdogTimer(RunLoop::main(), this, &ConnectionTerminationWatchdog::watchdogTimerFired) … … 100 100 } 101 101 102 OSObjectPtr<xpc_connection_t> m_xpcConnection;102 RetainPtr<xpc_connection_t> m_xpcConnection; 103 103 RunLoop::Timer<ConnectionTerminationWatchdog> m_watchdogTimer; 104 104 #if PLATFORM(IOS) -
trunk/Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm
r173367 r174045 30 30 #import "WKBase.h" 31 31 #import "XPCServiceEntryPoint.h" 32 #import <wtf/RetainPtr.h> 32 33 #import <wtf/RunLoop.h> 33 34 … … 38 39 class PluginServiceInitializerDelegate : public XPCServiceInitializerDelegate { 39 40 public: 40 PluginServiceInitializerDelegate( OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)41 PluginServiceInitializerDelegate(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage) 41 42 : XPCServiceInitializerDelegate(WTF::move(connection), initializerMessage) 42 43 { … … 77 78 EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/PluginProcessShim.dylib"); 78 79 79 XPCServiceInitializer<PluginProcess, PluginServiceInitializerDelegate>(adoptOS Object(connection), initializerMessage);80 XPCServiceInitializer<PluginProcess, PluginServiceInitializerDelegate>(adoptOS(connection), initializerMessage); 80 81 #endif // ENABLE(NETSCAPE_PLUGIN_API) 81 82 } -
trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h
r173367 r174045 29 29 #import "ChildProcess.h" 30 30 #import "WebKit2Initialize.h" 31 #import <wtf/ OSObjectPtr.h>31 #import <wtf/RetainPtr.h> 32 32 33 33 #if HAVE(VOUCHERS) … … 43 43 class XPCServiceInitializerDelegate { 44 44 public: 45 XPCServiceInitializerDelegate( OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)45 XPCServiceInitializerDelegate(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage) 46 46 : m_connection(WTF::move(connection)) 47 47 , m_initializerMessage(initializerMessage) … … 62 62 bool isClientSandboxed(); 63 63 64 OSObjectPtr<xpc_connection_t> m_connection;64 RetainPtr<xpc_connection_t> m_connection; 65 65 xpc_object_t m_initializerMessage; 66 66 }; 67 67 68 68 template<typename XPCServiceType, typename XPCServiceInitializerDelegateType> 69 void XPCServiceInitializer( OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)69 void XPCServiceInitializer(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage) 70 70 { 71 71 XPCServiceInitializerDelegateType delegate(WTF::move(connection), initializerMessage); -
trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm
r173929 r174045 29 29 #import "SandboxUtilities.h" 30 30 #import "XPCServiceEntryPoint.h" 31 #import <wtf/RetainPtr.h> 31 32 32 33 #if __has_include(<xpc/private.h>) … … 56 57 #endif 57 58 #if PLATFORM(IOS) 58 auto value = adoptOS Object(xpc_connection_copy_entitlement_value(m_connection.get(), "keychain-access-groups"));59 auto value = adoptOS(xpc_connection_copy_entitlement_value(m_connection.get(), "keychain-access-groups")); 59 60 if (value && xpc_get_type(value.get()) == XPC_TYPE_ARRAY) { 60 61 xpc_array_apply(value.get(), ^bool(size_t index, xpc_object_t object) { … … 106 107 bool XPCServiceInitializerDelegate::hasEntitlement(const char* entitlement) 107 108 { 108 auto value = adoptOS Object(xpc_connection_copy_entitlement_value(m_connection.get(), entitlement));109 auto value = adoptOS(xpc_connection_copy_entitlement_value(m_connection.get(), entitlement)); 109 110 if (!value) 110 111 return false; -
trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm
r173399 r174045 32 32 #import <stdio.h> 33 33 #import <stdlib.h> 34 #import <wtf/ OSObjectPtr.h>34 #import <wtf/RetainPtr.h> 35 35 #import <xpc/xpc.h> 36 36 … … 140 140 } 141 141 142 auto reply = adoptOS Object(xpc_dictionary_create_reply(event));142 auto reply = adoptOS(xpc_dictionary_create_reply(event)); 143 143 xpc_dictionary_set_string(reply.get(), "message-name", "process-finished-launching"); 144 144 xpc_connection_send_message(xpc_dictionary_get_remote_connection(event), reply.get()); -
trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm
r173399 r174045 27 27 28 28 #import <CoreFoundation/CoreFoundation.h> 29 #import <wtf/ OSObjectPtr.h>29 #import <wtf/RetainPtr.h> 30 30 #import <xpc/xpc.h> 31 31 … … 56 56 } 57 57 58 auto reply = adoptOS Object(xpc_dictionary_create_reply(event));58 auto reply = adoptOS(xpc_dictionary_create_reply(event)); 59 59 xpc_dictionary_set_string(reply.get(), "message-name", "process-finished-launching"); 60 60 xpc_connection_send_message(xpc_dictionary_get_remote_connection(event), reply.get()); -
trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
r173367 r174045 203 203 { 204 204 // Create a connection to the WebKit XPC service. 205 auto connection = adoptOS Object(xpc_connection_create(serviceName(launchOptions, forDevelopment), 0));205 auto connection = adoptOS(xpc_connection_create(serviceName(launchOptions, forDevelopment), 0)); 206 206 xpc_connection_set_instance(connection.get(), instanceUUID->uuid); 207 207 … … 212 212 // 2. When AppleLanguages is passed as command line argument for UI process, or set in its preferences, we should respect it in child processes. 213 213 if (_CFBundleSetupXPCBootstrapPtr()) { 214 auto initializationMessage = adoptOS Object(xpc_dictionary_create(nullptr, nullptr, 0));214 auto initializationMessage = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0)); 215 215 _CFBundleSetupXPCBootstrapPtr()(initializationMessage.get()); 216 216 xpc_connection_set_bootstrap(connection.get(), initializationMessage.get()); … … 223 223 224 224 if (shouldLeakBoost(launchOptions)) { 225 auto preBootstrapMessage = adoptOS Object(xpc_dictionary_create(nullptr, nullptr, 0));225 auto preBootstrapMessage = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0)); 226 226 xpc_dictionary_set_string(preBootstrapMessage.get(), "message-name", "pre-bootstrap"); 227 227 xpc_connection_send_message(connection.get(), preBootstrapMessage.get()); … … 239 239 240 240 // FIXME: Switch to xpc_connection_set_bootstrap once it's available everywhere we need. 241 auto bootstrapMessage = adoptOS Object(xpc_dictionary_create(nullptr, nullptr, 0));241 auto bootstrapMessage = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0)); 242 242 xpc_dictionary_set_string(bootstrapMessage.get(), "message-name", "bootstrap"); 243 243 xpc_dictionary_set_string(bootstrapMessage.get(), "framework-executable-path", [[[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] executablePath] fileSystemRepresentation]); … … 251 251 } 252 252 253 auto extraInitializationData = adoptOS Object(xpc_dictionary_create(nullptr, nullptr, 0));253 auto extraInitializationData = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0)); 254 254 255 255 for (const auto& keyValuePair : launchOptions.extraInitializationData) … … 301 301 RefPtr<UUIDHolder> instanceUUID = UUIDHolder::create(); 302 302 303 // FIXME: It would be nice if we could use OSObjectPtr for this connection as well, but we'd have to be careful303 // FIXME: It would be nice if we could use RetainPtr for this connection as well, but we'd have to be careful 304 304 // not to introduce any retain cycles in the call to xpc_connection_set_event_handler below. 305 305 xpc_connection_t reExecConnection = xpc_connection_create(serviceName(launchOptions, true), 0); -
trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm
r173367 r174045 53 53 #endif // PLATFORM(IOS) 54 54 55 XPCServiceInitializer<WebProcess, XPCServiceInitializerDelegate>(adoptOS Object(connection), initializerMessage);55 XPCServiceInitializer<WebProcess, XPCServiceInitializerDelegate>(adoptOS(connection), initializerMessage); 56 56 } -
trunk/Tools/ChangeLog
r174036 r174045 1 2014-09-26 Sam Weinig <sam@webkit.org> 2 3 Replace OSObjectPtr with RetainPtr/adoptOS 4 https://bugs.webkit.org/show_bug.cgi?id=137158 5 6 Reviewed by Dan Bernstein. 7 8 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 9 * TestWebKitAPI/Tests/WTF/darwin/OSObjectPtr.cpp: Removed. 10 * TestWebKitAPI/Tests/WTF/darwin/RetainPtrOSObject.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/darwin/OSObjectPtr.cpp. 11 Rename and change test to use RetainPtr. Remove now unneeded part testing WTF::retainOSObject/WTF::releaseOSObject. 12 1 13 2014-09-26 Filip Pizlo <fpizlo@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r173851 r174045 124 124 7C8DDAAB1735DEEE00EA5AC0 /* CloseThenTerminate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */; }; 125 125 7C9ED98B17A19F4B00E4DC33 /* attributedStringStrikethrough.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7C9ED98A17A19D0600E4DC33 /* attributedStringStrikethrough.html */; }; 126 7CBBA07819BB8A9100BBF025 /* OSObjectPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CBBA07619BB8A9100BBF025 /* OSObjectPtr.cpp */; };126 7CBBA07819BB8A9100BBF025 /* RetainPtrOSObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CBBA07619BB8A9100BBF025 /* RetainPtrOSObject.cpp */; }; 127 127 7CC3E1FC197E234100BE6252 /* UserContentController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CC3E1FA197E234100BE6252 /* UserContentController.mm */; }; 128 128 7CFBCADF1743234F00B2BFCF /* WillLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */; }; … … 473 473 7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CloseThenTerminate.cpp; sourceTree = "<group>"; }; 474 474 7C9ED98A17A19D0600E4DC33 /* attributedStringStrikethrough.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = attributedStringStrikethrough.html; sourceTree = "<group>"; }; 475 7CBBA07619BB8A9100BBF025 /* OSObjectPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSObjectPtr.cpp; sourceTree = "<group>"; };475 7CBBA07619BB8A9100BBF025 /* RetainPtrOSObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RetainPtrOSObject.cpp; sourceTree = "<group>"; }; 476 476 7CC3E1FA197E234100BE6252 /* UserContentController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserContentController.mm; sourceTree = "<group>"; }; 477 477 7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillLoad.cpp; sourceTree = "<group>"; }; … … 767 767 isa = PBXGroup; 768 768 children = ( 769 7CBBA07619BB8A9100BBF025 /* OSObjectPtr.cpp */,769 7CBBA07619BB8A9100BBF025 /* RetainPtrOSObject.cpp */, 770 770 ); 771 771 path = darwin; … … 1346 1346 BC029B181486AD6400817DA9 /* RetainPtr.cpp in Sources */, 1347 1347 BC029B1C1486B25900817DA9 /* RetainPtr.mm in Sources */, 1348 7CBBA07819BB8A9100BBF025 /* OSObjectPtr.cpp in Sources */,1348 7CBBA07819BB8A9100BBF025 /* RetainPtrOSObject.cpp in Sources */, 1349 1349 C0991C51143C7D68007998F2 /* RetainPtrHashing.cpp in Sources */, 1350 1350 CD5393CA1757BAC400C07123 /* SHA1.cpp in Sources */, -
trunk/Tools/TestWebKitAPI/Tests/WTF/darwin/RetainPtrOSObject.cpp
r174017 r174045 26 26 #include "config.h" 27 27 28 #include <wtf/ OSObjectPtr.h>28 #include <wtf/RetainPtr.h> 29 29 30 30 #include <dispatch/dispatch.h> … … 33 33 namespace TestWebKitAPI { 34 34 35 TEST( OSObjectPtr, AdoptOSObject)35 TEST(RetainPtrOSObject, AdoptOSObject) 36 36 { 37 OSObjectPtr<dispatch_queue_t> foo = adoptOSObject(dispatch_queue_create(0, DISPATCH_QUEUE_SERIAL));37 RetainPtr<dispatch_queue_t> foo = adoptOS(dispatch_queue_create(0, DISPATCH_QUEUE_SERIAL)); 38 38 39 39 EXPECT_EQ(1, CFGetRetainCount(foo.get())); 40 40 } 41 41 42 TEST(OSObjectPtr, RetainRelease)43 {44 dispatch_queue_t foo = dispatch_queue_create(0, DISPATCH_QUEUE_SERIAL);45 EXPECT_EQ(1, CFGetRetainCount(foo));46 47 WTF::retainOSObject(foo);48 EXPECT_EQ(2, CFGetRetainCount(foo));49 50 WTF::releaseOSObject(foo);51 EXPECT_EQ(1, CFGetRetainCount(foo));52 }53 54 42 } // namespace TestWebKitAPI
Note: See TracChangeset
for help on using the changeset viewer.