Changeset 295445 in webkit


Ignore:
Timestamp:
Jun 9, 2022 9:58:46 PM (2 years ago)
Author:
pvollan@apple.com
Message:

Revert r295422
https://bugs.webkit.org/show_bug.cgi?id=241502

Unreviewed, revert r295422.

  • Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm:

(WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver):
(WebKit::LaunchServicesDatabaseObserver::startObserving):
(WebKit::LaunchServicesDatabaseObserver::~LaunchServicesDatabaseObserver):
(WebKit::hasSystemContentDatabase): Deleted.

Canonical link: https://commits.webkit.org/251451@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm

    r295442 r295445  
    3535namespace WebKit {
    3636
    37 #if HAVE(LSDATABASECONTEXT)
    38 static bool hasSystemContentDatabase()
    39 {
    40     return [LSDatabaseContext.sharedDatabaseContext respondsToSelector:@selector(getSystemContentDatabaseObject4WebKit:)];
    41 }
    42 #endif
    43 
    4437LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver(NetworkProcess&)
    4538{
    4639#if HAVE(LSDATABASECONTEXT)
    47     if (hasSystemContentDatabase())
    48         return;
    49 
    5040    m_observer = [LSDatabaseContext.sharedDatabaseContext addDatabaseChangeObserver4WebKit:^(xpc_object_t change) {
    5141        auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
     
    7565
    7666#if HAVE(LSDATABASECONTEXT)
    77     if (hasSystemContentDatabase()) {
    78         [LSDatabaseContext.sharedDatabaseContext getSystemContentDatabaseObject4WebKit:makeBlockPtr([connection = connection] (xpc_object_t _Nullable object, NSError * _Nullable error) {
    79             if (!object)
    80                 return;
    81             auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
    82             xpc_dictionary_set_string(message.get(), XPCEndpoint::xpcMessageNameKey, LaunchServicesDatabaseXPCConstants::xpcUpdateLaunchServicesDatabaseMessageName);
    83             xpc_dictionary_set_value(message.get(), LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseKey, object);
    84 
    85             xpc_connection_send_message(connection.get(), message.get());
    86 
    87         }).get()];
    88         return;
    89     }
    90 
    9167    RetainPtr<id> observer = [LSDatabaseContext.sharedDatabaseContext addDatabaseChangeObserver4WebKit:^(xpc_object_t change) {
    9268        auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
     
    10884{
    10985#if HAVE(LSDATABASECONTEXT)
    110     if (hasSystemContentDatabase())
    111         return;
    11286    [LSDatabaseContext.sharedDatabaseContext removeDatabaseChangeObserver4WebKit:m_observer.get()];
    11387#endif
Note: See TracChangeset for help on using the changeset viewer.