Changeset 174045 in webkit


Ignore:
Timestamp:
Sep 28, 2014 1:59:28 PM (10 years ago)
Author:
weinig@apple.com
Message:

Replace OSObjectPtr with RetainPtr/adoptOS
https://bugs.webkit.org/show_bug.cgi?id=137158

Reviewed by Dan Bernstein.

Source/WebKit2:

  • DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:

(DatabaseServiceInitializer):

  • NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:

(WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
(NetworkServiceInitializer):

  • Platform/IPC/Connection.h:

(IPC::Connection::Identifier::Identifier):

  • Platform/IPC/mac/ConnectionMac.mm:

(IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):

  • PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:

(WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate):
(PluginServiceInitializer):

  • Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:

(WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate):
(WebKit::XPCServiceInitializer):

  • Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:

(WebKit::XPCServiceInitializerDelegate::checkEntitlements):
(WebKit::XPCServiceInitializerDelegate::hasEntitlement):

  • Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:

(WebKit::XPCServiceEventHandler):

  • Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:

(WebKit::XPCServiceEventHandler):

  • UIProcess/Launcher/mac/ProcessLauncherMac.mm:

(WebKit::connectToService):
(WebKit::connectToReExecService):

  • WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:

(WebContentServiceInitializer):

Source/WTF:

  • WTF.xcodeproj/project.pbxproj:
  • wtf/OSObjectPtr.h: Removed.
  • wtf/RetainPtr.h:

(WTF::adoptOS):
Added. This adopt function is slightly different than both adoptCF and adoptNS,
in that unlike adoptCF(), it can be passed an Objective-C type (since OS objects
are sometimes Objective-C objects, but not always), and unlike adoptNS() it doesn't
require us to jump through hoops to appease GC (since OS objects are not Objective-C
objects if GC is enabled).

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WTF/darwin/OSObjectPtr.cpp: Removed.
  • TestWebKitAPI/Tests/WTF/darwin/RetainPtrOSObject.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/darwin/OSObjectPtr.cpp.

Rename and change test to use RetainPtr. Remove now unneeded part testing WTF::retainOSObject/WTF::releaseOSObject.

Location:
trunk
Files:
1 deleted
17 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r173993 r174045  
     12014-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
    1182014-09-24  Filip Pizlo  <fpizlo@apple.com>
    219
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r173367 r174045  
    7474                2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0F118115C85004DBA70 /* RunLoop.cpp */; };
    7575                2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CDED0F218115C85004DBA70 /* RunLoop.h */; };
    76                 7CBBA07419BB7FDC00BBF025 /* OSObjectPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CBBA07319BB7FDC00BBF025 /* OSObjectPtr.h */; };
    7776                7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; };
    7877                7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; };
     
    361360                5D247B7314689C4700E78B76 /* WTF.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WTF.xcconfig; sourceTree = "<group>"; };
    362361                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>"; };
    364362                7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorAdaptors.h; sourceTree = "<group>"; };
    365363                7CDD7FF9186D2A54007433CD /* IteratorRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorRange.h; sourceTree = "<group>"; };
     
    791789                                A8A472D7151A825B004123FF /* OSAllocator.h */,
    792790                                A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */,
    793                                 7CBBA07319BB7FDC00BBF025 /* OSObjectPtr.h */,
    794791                                A8A472DA151A825B004123FF /* OSRandomSource.cpp */,
    795792                                A8A472DB151A825B004123FF /* OSRandomSource.h */,
     
    10861083                                93B1AA80180E5AF3004A2F05 /* PassRef.h in Headers */,
    10871084                                A8A473EA151A825B004123FF /* MD5.h in Headers */,
    1088                                 7CBBA07419BB7FDC00BBF025 /* OSObjectPtr.h in Headers */,
    10891085                                CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */,
    10901086                                A8A473EB151A825B004123FF /* MessageQueue.h in Headers */,
  • trunk/Source/WTF/wtf/RetainPtr.h

    r173807 r174045  
    5151    template<typename T> class RetainPtr;
    5252
     53    template<typename T> RetainPtr<T> adoptOS(T CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN;
    5354    template<typename T> RetainPtr<T> adoptCF(T CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN;
    5455    template<typename T> RetainPtr<T> adoptNS(T NS_RELEASES_ARGUMENT) WARN_UNUSED_RETURN;
     
    101102        void swap(RetainPtr&);
    102103
     104        template<typename U> friend RetainPtr<U> adoptOS(U CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN;
    103105        template<typename U> friend RetainPtr<U> adoptCF(U CF_RELEASES_ARGUMENT) WARN_UNUSED_RETURN;
    104106        template<typename U> friend RetainPtr<U> adoptNS(U NS_RELEASES_ARGUMENT) WARN_UNUSED_RETURN;
     
    248250    {
    249251        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);
    250257    }
    251258
     
    315322
    316323using WTF::RetainPtr;
     324using WTF::adoptOS;
    317325using WTF::adoptCF;
    318326using WTF::adoptNS;
  • trunk/Source/WebKit2/ChangeLog

    r174031 r174045  
     12014-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
    1372014-09-26  Christophe Dumez  <cdumez@apple.com>
    238
  • trunk/Source/WebKit2/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm

    r173367 r174045  
    3737void DatabaseServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage)
    3838{
    39     XPCServiceInitializer<DatabaseProcess, XPCServiceInitializerDelegate>(adoptOSObject(connection), initializerMessage);
     39    XPCServiceInitializer<DatabaseProcess, XPCServiceInitializerDelegate>(adoptOS(connection), initializerMessage);
    4040}
  • trunk/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm

    r173367 r174045  
    3535class NetworkServiceInitializerDelegate : public XPCServiceInitializerDelegate {
    3636public:
    37     NetworkServiceInitializerDelegate(OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
     37    NetworkServiceInitializerDelegate(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
    3838        : XPCServiceInitializerDelegate(WTF::move(connection), initializerMessage)
    3939    {
     
    5454    EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/SecItemShim.dylib");
    5555
    56     XPCServiceInitializer<NetworkProcess, NetworkServiceInitializerDelegate>(adoptOSObject(connection), initializerMessage);
     56    XPCServiceInitializer<NetworkProcess, NetworkServiceInitializerDelegate>(adoptOS(connection), initializerMessage);
    5757#endif
    5858}
  • trunk/Source/WebKit2/Platform/IPC/Connection.h

    r173378 r174045  
    4343#if OS(DARWIN)
    4444#include <mach/mach_port.h>
     45#include <wtf/RetainPtr.h>
    4546#include <xpc/xpc.h>
    46 #include <wtf/OSObjectPtr.h>
    4747#endif
    4848
     
    112112        }
    113113
    114         Identifier(mach_port_t port, OSObjectPtr<xpc_connection_t> xpcConnection)
     114        Identifier(mach_port_t port, RetainPtr<xpc_connection_t> xpcConnection)
    115115            : port(port)
    116116            , xpcConnection(WTF::move(xpcConnection))
     
    119119
    120120        mach_port_t port;
    121         OSObjectPtr<xpc_connection_t> xpcConnection;
     121        RetainPtr<xpc_connection_t> xpcConnection;
    122122    };
    123123    static bool identifierIsNull(Identifier identifier) { return identifier.port == MACH_PORT_NULL; }
     
    321321#endif
    322322
    323     OSObjectPtr<xpc_connection_t> m_xpcConnection;
     323    RetainPtr<xpc_connection_t> m_xpcConnection;
    324324
    325325#elif USE(UNIX_DOMAIN_SOCKETS)
  • trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm

    r173367 r174045  
    7676class ConnectionTerminationWatchdog {
    7777public:
    78     static void createConnectionTerminationWatchdog(OSObjectPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)
     78    static void createConnectionTerminationWatchdog(RetainPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)
    7979    {
    8080        new ConnectionTerminationWatchdog(xpcConnection, intervalInSeconds);
     
    8282   
    8383private:
    84     ConnectionTerminationWatchdog(OSObjectPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)
     84    ConnectionTerminationWatchdog(RetainPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)
    8585        : m_xpcConnection(xpcConnection)
    8686        , m_watchdogTimer(RunLoop::main(), this, &ConnectionTerminationWatchdog::watchdogTimerFired)
     
    100100    }
    101101
    102     OSObjectPtr<xpc_connection_t> m_xpcConnection;
     102    RetainPtr<xpc_connection_t> m_xpcConnection;
    103103    RunLoop::Timer<ConnectionTerminationWatchdog> m_watchdogTimer;
    104104#if PLATFORM(IOS)
  • trunk/Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm

    r173367 r174045  
    3030#import "WKBase.h"
    3131#import "XPCServiceEntryPoint.h"
     32#import <wtf/RetainPtr.h>
    3233#import <wtf/RunLoop.h>
    3334
     
    3839class PluginServiceInitializerDelegate : public XPCServiceInitializerDelegate {
    3940public:
    40     PluginServiceInitializerDelegate(OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
     41    PluginServiceInitializerDelegate(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
    4142        : XPCServiceInitializerDelegate(WTF::move(connection), initializerMessage)
    4243    {
     
    7778    EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/PluginProcessShim.dylib");
    7879
    79     XPCServiceInitializer<PluginProcess, PluginServiceInitializerDelegate>(adoptOSObject(connection), initializerMessage);
     80    XPCServiceInitializer<PluginProcess, PluginServiceInitializerDelegate>(adoptOS(connection), initializerMessage);
    8081#endif // ENABLE(NETSCAPE_PLUGIN_API)
    8182}
  • trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h

    r173367 r174045  
    2929#import "ChildProcess.h"
    3030#import "WebKit2Initialize.h"
    31 #import <wtf/OSObjectPtr.h>
     31#import <wtf/RetainPtr.h>
    3232
    3333#if HAVE(VOUCHERS)
     
    4343class XPCServiceInitializerDelegate {
    4444public:
    45     XPCServiceInitializerDelegate(OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
     45    XPCServiceInitializerDelegate(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
    4646        : m_connection(WTF::move(connection))
    4747        , m_initializerMessage(initializerMessage)
     
    6262    bool isClientSandboxed();
    6363
    64     OSObjectPtr<xpc_connection_t> m_connection;
     64    RetainPtr<xpc_connection_t> m_connection;
    6565    xpc_object_t m_initializerMessage;
    6666};
    6767
    6868template<typename XPCServiceType, typename XPCServiceInitializerDelegateType>
    69 void XPCServiceInitializer(OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
     69void XPCServiceInitializer(RetainPtr<xpc_connection_t> connection, xpc_object_t initializerMessage)
    7070{
    7171    XPCServiceInitializerDelegateType delegate(WTF::move(connection), initializerMessage);
  • trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm

    r173929 r174045  
    2929#import "SandboxUtilities.h"
    3030#import "XPCServiceEntryPoint.h"
     31#import <wtf/RetainPtr.h>
    3132
    3233#if __has_include(<xpc/private.h>)
     
    5657#endif
    5758#if PLATFORM(IOS)
    58     auto value = adoptOSObject(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"));
    5960    if (value && xpc_get_type(value.get()) == XPC_TYPE_ARRAY) {
    6061        xpc_array_apply(value.get(), ^bool(size_t index, xpc_object_t object) {
     
    106107bool XPCServiceInitializerDelegate::hasEntitlement(const char* entitlement)
    107108{
    108     auto value = adoptOSObject(xpc_connection_copy_entitlement_value(m_connection.get(), entitlement));
     109    auto value = adoptOS(xpc_connection_copy_entitlement_value(m_connection.get(), entitlement));
    109110    if (!value)
    110111        return false;
  • trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm

    r173399 r174045  
    3232#import <stdio.h>
    3333#import <stdlib.h>
    34 #import <wtf/OSObjectPtr.h>
     34#import <wtf/RetainPtr.h>
    3535#import <xpc/xpc.h>
    3636
     
    140140                }
    141141
    142                 auto reply = adoptOSObject(xpc_dictionary_create_reply(event));
     142                auto reply = adoptOS(xpc_dictionary_create_reply(event));
    143143                xpc_dictionary_set_string(reply.get(), "message-name", "process-finished-launching");
    144144                xpc_connection_send_message(xpc_dictionary_get_remote_connection(event), reply.get());
  • trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm

    r173399 r174045  
    2727
    2828#import <CoreFoundation/CoreFoundation.h>
    29 #import <wtf/OSObjectPtr.h>
     29#import <wtf/RetainPtr.h>
    3030#import <xpc/xpc.h>
    3131
     
    5656                }
    5757
    58                 auto reply = adoptOSObject(xpc_dictionary_create_reply(event));
     58                auto reply = adoptOS(xpc_dictionary_create_reply(event));
    5959                xpc_dictionary_set_string(reply.get(), "message-name", "process-finished-launching");
    6060                xpc_connection_send_message(xpc_dictionary_get_remote_connection(event), reply.get());
  • trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm

    r173367 r174045  
    203203{
    204204    // Create a connection to the WebKit XPC service.
    205     auto connection = adoptOSObject(xpc_connection_create(serviceName(launchOptions, forDevelopment), 0));
     205    auto connection = adoptOS(xpc_connection_create(serviceName(launchOptions, forDevelopment), 0));
    206206    xpc_connection_set_instance(connection.get(), instanceUUID->uuid);
    207207
     
    212212    // 2. When AppleLanguages is passed as command line argument for UI process, or set in its preferences, we should respect it in child processes.
    213213    if (_CFBundleSetupXPCBootstrapPtr()) {
    214         auto initializationMessage = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
     214        auto initializationMessage = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0));
    215215        _CFBundleSetupXPCBootstrapPtr()(initializationMessage.get());
    216216        xpc_connection_set_bootstrap(connection.get(), initializationMessage.get());
     
    223223   
    224224    if (shouldLeakBoost(launchOptions)) {
    225         auto preBootstrapMessage = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
     225        auto preBootstrapMessage = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0));
    226226        xpc_dictionary_set_string(preBootstrapMessage.get(), "message-name", "pre-bootstrap");
    227227        xpc_connection_send_message(connection.get(), preBootstrapMessage.get());
     
    239239
    240240    // FIXME: Switch to xpc_connection_set_bootstrap once it's available everywhere we need.
    241     auto bootstrapMessage = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
     241    auto bootstrapMessage = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0));
    242242    xpc_dictionary_set_string(bootstrapMessage.get(), "message-name", "bootstrap");
    243243    xpc_dictionary_set_string(bootstrapMessage.get(), "framework-executable-path", [[[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] executablePath] fileSystemRepresentation]);
     
    251251    }
    252252
    253     auto extraInitializationData = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
     253    auto extraInitializationData = adoptOS(xpc_dictionary_create(nullptr, nullptr, 0));
    254254
    255255    for (const auto& keyValuePair : launchOptions.extraInitializationData)
     
    301301    RefPtr<UUIDHolder> instanceUUID = UUIDHolder::create();
    302302
    303     // FIXME: It would be nice if we could use OSObjectPtr for this connection as well, but we'd have to be careful
     303    // FIXME: It would be nice if we could use RetainPtr for this connection as well, but we'd have to be careful
    304304    // not to introduce any retain cycles in the call to xpc_connection_set_event_handler below.
    305305    xpc_connection_t reExecConnection = xpc_connection_create(serviceName(launchOptions, true), 0);
  • trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm

    r173367 r174045  
    5353#endif // PLATFORM(IOS)
    5454
    55     XPCServiceInitializer<WebProcess, XPCServiceInitializerDelegate>(adoptOSObject(connection), initializerMessage);
     55    XPCServiceInitializer<WebProcess, XPCServiceInitializerDelegate>(adoptOS(connection), initializerMessage);
    5656}
  • trunk/Tools/ChangeLog

    r174036 r174045  
     12014-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
    1132014-09-26  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r173851 r174045  
    124124                7C8DDAAB1735DEEE00EA5AC0 /* CloseThenTerminate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */; };
    125125                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 */; };
    127127                7CC3E1FC197E234100BE6252 /* UserContentController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CC3E1FA197E234100BE6252 /* UserContentController.mm */; };
    128128                7CFBCADF1743234F00B2BFCF /* WillLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */; };
     
    473473                7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CloseThenTerminate.cpp; sourceTree = "<group>"; };
    474474                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>"; };
    476476                7CC3E1FA197E234100BE6252 /* UserContentController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserContentController.mm; sourceTree = "<group>"; };
    477477                7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillLoad.cpp; sourceTree = "<group>"; };
     
    767767                        isa = PBXGroup;
    768768                        children = (
    769                                 7CBBA07619BB8A9100BBF025 /* OSObjectPtr.cpp */,
     769                                7CBBA07619BB8A9100BBF025 /* RetainPtrOSObject.cpp */,
    770770                        );
    771771                        path = darwin;
     
    13461346                                BC029B181486AD6400817DA9 /* RetainPtr.cpp in Sources */,
    13471347                                BC029B1C1486B25900817DA9 /* RetainPtr.mm in Sources */,
    1348                                 7CBBA07819BB8A9100BBF025 /* OSObjectPtr.cpp in Sources */,
     1348                                7CBBA07819BB8A9100BBF025 /* RetainPtrOSObject.cpp in Sources */,
    13491349                                C0991C51143C7D68007998F2 /* RetainPtrHashing.cpp in Sources */,
    13501350                                CD5393CA1757BAC400C07123 /* SHA1.cpp in Sources */,
  • trunk/Tools/TestWebKitAPI/Tests/WTF/darwin/RetainPtrOSObject.cpp

    r174017 r174045  
    2626#include "config.h"
    2727
    28 #include <wtf/OSObjectPtr.h>
     28#include <wtf/RetainPtr.h>
    2929
    3030#include <dispatch/dispatch.h>
     
    3333namespace TestWebKitAPI {
    3434
    35 TEST(OSObjectPtr, AdoptOSObject)
     35TEST(RetainPtrOSObject, AdoptOSObject)
    3636{
    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));
    3838
    3939    EXPECT_EQ(1, CFGetRetainCount(foo.get()));
    4040}
    4141
    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 
    5442} // namespace TestWebKitAPI
Note: See TracChangeset for help on using the changeset viewer.