Changeset 245021 in webkit


Ignore:
Timestamp:
May 7, 2019 11:52:22 AM (5 years ago)
Author:
Chris Dumez
Message:

Rename ConnectionMac.mm to ConnectionCocoa.mm since it is used on both macOS and iOS
https://bugs.webkit.org/show_bug.cgi?id=197661

Reviewed by Alexey Proskuryakov.

  • Platform/IPC/cocoa/ConnectionCocoa.mm: Renamed from Source/WebKit/Platform/IPC/mac/ConnectionMac.mm.

(IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
(IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
(IPC::Connection::platformInvalidate):
(IPC::Connection::cancelReceiveSource):
(IPC::Connection::terminateSoon):
(IPC::Connection::platformInitialize):
(IPC::Connection::open):
(IPC::Connection::sendMessage):
(IPC::Connection::platformCanSendOutgoingMessages const):
(IPC::Connection::sendOutgoingMessage):
(IPC::Connection::initializeSendSource):
(IPC::Connection::resumeSendSource):
(IPC::createMessageDecoder):
(IPC::readFromMachPort):
(IPC::Connection::receiveSourceEventHandler):
(IPC::Connection::identifier const):
(IPC::Connection::getAuditToken):
(IPC::Connection::kill):
(IPC::AccessibilityProcessSuspendedNotification):
(IPC::Connection::willSendSyncMessage):
(IPC::Connection::didReceiveSyncReply):
(IPC::Connection::remoteProcessID const):

  • Platform/IPC/cocoa/ImportanceAssertion.h: Renamed from Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h.

(IPC::ImportanceAssertion::ImportanceAssertion):
(IPC::ImportanceAssertion::~ImportanceAssertion):

  • Platform/IPC/cocoa/MachMessage.cpp: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.cpp.

(IPC::MachMessage::create):
(IPC::MachMessage::MachMessage):
(IPC::MachMessage::~MachMessage):
(IPC::MachMessage::messageSize):
(IPC::MachMessage::leakDescriptors):

  • Platform/IPC/cocoa/MachMessage.h: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.h.

(IPC::MachMessage::size const):
(IPC::MachMessage::header):
(IPC::MachMessage::messageReceiverName const):
(IPC::MachMessage::messageName const):

  • Platform/IPC/cocoa/MachPort.h: Renamed from Source/WebKit/Platform/IPC/mac/MachPort.h.

(IPC::MachPort::MachPort):
(IPC::MachPort::encode const):
(IPC::MachPort::decode):
(IPC::MachPort::port const):
(IPC::MachPort::disposition const):

  • PlatformMac.cmake:
  • SourcesCocoa.txt:
  • WebKit.xcodeproj/project.pbxproj:
Location:
trunk/Source/WebKit
Files:
1 added
1 deleted
4 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r245016 r245021  
     12019-05-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Rename ConnectionMac.mm to ConnectionCocoa.mm since it is used on both macOS and iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=197661
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * Platform/IPC/cocoa/ConnectionCocoa.mm: Renamed from Source/WebKit/Platform/IPC/mac/ConnectionMac.mm.
     9        (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
     10        (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
     11        (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
     12        (IPC::Connection::platformInvalidate):
     13        (IPC::Connection::cancelReceiveSource):
     14        (IPC::Connection::terminateSoon):
     15        (IPC::Connection::platformInitialize):
     16        (IPC::Connection::open):
     17        (IPC::Connection::sendMessage):
     18        (IPC::Connection::platformCanSendOutgoingMessages const):
     19        (IPC::Connection::sendOutgoingMessage):
     20        (IPC::Connection::initializeSendSource):
     21        (IPC::Connection::resumeSendSource):
     22        (IPC::createMessageDecoder):
     23        (IPC::readFromMachPort):
     24        (IPC::Connection::receiveSourceEventHandler):
     25        (IPC::Connection::identifier const):
     26        (IPC::Connection::getAuditToken):
     27        (IPC::Connection::kill):
     28        (IPC::AccessibilityProcessSuspendedNotification):
     29        (IPC::Connection::willSendSyncMessage):
     30        (IPC::Connection::didReceiveSyncReply):
     31        (IPC::Connection::remoteProcessID const):
     32        * Platform/IPC/cocoa/ImportanceAssertion.h: Renamed from Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h.
     33        (IPC::ImportanceAssertion::ImportanceAssertion):
     34        (IPC::ImportanceAssertion::~ImportanceAssertion):
     35        * Platform/IPC/cocoa/MachMessage.cpp: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.cpp.
     36        (IPC::MachMessage::create):
     37        (IPC::MachMessage::MachMessage):
     38        (IPC::MachMessage::~MachMessage):
     39        (IPC::MachMessage::messageSize):
     40        (IPC::MachMessage::leakDescriptors):
     41        * Platform/IPC/cocoa/MachMessage.h: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.h.
     42        (IPC::MachMessage::size const):
     43        (IPC::MachMessage::header):
     44        (IPC::MachMessage::messageReceiverName const):
     45        (IPC::MachMessage::messageName const):
     46        * Platform/IPC/cocoa/MachPort.h: Renamed from Source/WebKit/Platform/IPC/mac/MachPort.h.
     47        (IPC::MachPort::MachPort):
     48        (IPC::MachPort::encode const):
     49        (IPC::MachPort::decode):
     50        (IPC::MachPort::port const):
     51        (IPC::MachPort::disposition const):
     52        * PlatformMac.cmake:
     53        * SourcesCocoa.txt:
     54        * WebKit.xcodeproj/project.pbxproj:
     55
    1562019-05-07  Antti Koivisto  <antti@apple.com>
    257
  • trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm

    r245020 r245021  
    232232    setMachPortQueueLength(m_receivePort, MACH_PORT_QLIMIT_LARGE);
    233233
    234     RefPtr<Connection> connection(this);
    235234    m_receiveSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, m_receivePort, 0, m_connectionQueue->dispatchQueue());
    236     dispatch_source_set_event_handler(m_receiveSource, [connection] {
    237         connection->receiveSourceEventHandler();
     235    dispatch_source_set_event_handler(m_receiveSource, [this, protectedThis = makeRefPtr(this)] {
     236        receiveSourceEventHandler();
    238237    });
    239     dispatch_source_set_cancel_handler(m_receiveSource, [connection, receivePort = m_receivePort] {
    240 #if PLATFORM(WATCHOS)
    241         UNUSED_PARAM(connection);
    242 #else
    243         mach_port_unguard(mach_task_self(), receivePort, reinterpret_cast<mach_port_context_t>(connection.get()));
     238    dispatch_source_set_cancel_handler(m_receiveSource, [protectedThis = makeRefPtr(this), receivePort = m_receivePort] {
     239#if !PLATFORM(WATCHOS)
     240        mach_port_unguard(mach_task_self(), receivePort, reinterpret_cast<mach_port_context_t>(protectedThis.get()));
    244241#endif
    245242        mach_port_mod_refs(mach_task_self(), receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
     
    299296    auto attachments = encoder->releaseAttachments();
    300297   
    301     auto numberOfPortDescriptors = std::count_if(attachments.begin(), attachments.end(), [](auto& attachment) { return attachment.type() == Attachment::MachPortType; });
     298    auto numberOfPortDescriptors = std::count_if(attachments.begin(), attachments.end(), [](auto& attachment)
     299    {
     300        return attachment.type() == Attachment::MachPortType;
     301    });
     302
    302303    bool messageBodyIsOOL = false;
    303304    auto messageSize = MachMessage::messageSize(encoder->bufferSize(), numberOfPortDescriptors, messageBodyIsOOL);
     
    365366    m_isInitializingSendSource = true;
    366367
    367     RefPtr<Connection> connection(this);
    368     dispatch_source_set_registration_handler(m_sendSource, [connection] {
    369         if (!connection->m_sendSource)
     368    dispatch_source_set_registration_handler(m_sendSource, [this, protectedThis = makeRefPtr(this)] {
     369        if (!m_sendSource)
    370370            return;
    371         connection->m_isInitializingSendSource = false;
    372         connection->resumeSendSource();
     371        m_isInitializingSendSource = false;
     372        resumeSendSource();
    373373    });
    374     dispatch_source_set_event_handler(m_sendSource, [connection] {
    375         if (!connection->m_sendSource)
     374    dispatch_source_set_event_handler(m_sendSource, [this, protectedThis = makeRefPtr(this)] {
     375        if (!m_sendSource)
    376376            return;
    377377
    378         unsigned long data = dispatch_source_get_data(connection->m_sendSource);
     378        unsigned long data = dispatch_source_get_data(m_sendSource);
    379379
    380380        if (data & DISPATCH_MACH_SEND_DEAD) {
    381             connection->connectionDidClose();
     381            connectionDidClose();
    382382            return;
    383383        }
     
    385385        if (data & DISPATCH_MACH_SEND_POSSIBLE) {
    386386            // FIXME: Figure out why we get spurious DISPATCH_MACH_SEND_POSSIBLE events.
    387             connection->resumeSendSource();
     387            resumeSendSource();
    388388            return;
    389389        }
  • trunk/Source/WebKit/Platform/IPC/cocoa/ImportanceAssertion.h

    r245020 r245021  
    2424 */
    2525
    26 #ifndef ImportanceAssertion_h
    27 #define ImportanceAssertion_h
     26#pragma once
    2827
    2928#if PLATFORM(MAC)
     
    6362
    6463#endif // PLATFORM(MAC)
    65 
    66 #endif // ImportanceAssertion_h
  • trunk/Source/WebKit/Platform/IPC/cocoa/MachPort.h

    r245020 r245021  
    2424 */
    2525
    26 #ifndef MachPort_h
    27 #define MachPort_h
     26#pragma once
    2827
    2928#include "Attachment.h"
     
    7271
    7372} // namespace IPC
    74 
    75 #endif // MachPort_h
  • trunk/Source/WebKit/PlatformMac.cmake

    r244292 r245021  
    4343    NetworkProcess/mac/RemoteNetworkingContext.mm
    4444
    45     Platform/IPC/mac/ConnectionMac.mm
    46     Platform/IPC/mac/MachMessage.cpp
     45    Platform/IPC/cocoa/ConnectionCocoa.mm
     46    Platform/IPC/cocoa/MachMessage.cpp
    4747
    4848    Platform/cf/ModuleCF.cpp
  • trunk/Source/WebKit/SourcesCocoa.txt

    r244921 r245021  
    7575Platform/ios/PaymentAuthorizationController.mm
    7676
    77 Platform/IPC/mac/ConnectionMac.mm
    78 Platform/IPC/mac/MachMessage.cpp
     77Platform/IPC/cocoa/ConnectionCocoa.mm
     78Platform/IPC/cocoa/MachMessage.cpp
    7979
    8080Platform/mac/LayerHostingContext.mm
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r244955 r245021  
    20642064                1A2D956E12848564001EB962 /* AuxiliaryProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuxiliaryProcess.cpp; sourceTree = "<group>"; };
    20652065                1A30066C1110F4F70031937C /* ResponsivenessTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResponsivenessTimer.h; sourceTree = "<group>"; };
    2066                 1A30EAC5115D7DA30053E937 /* ConnectionMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConnectionMac.mm; sourceTree = "<group>"; };
     2066                1A30EAC5115D7DA30053E937 /* ConnectionCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConnectionCocoa.mm; sourceTree = "<group>"; };
    20672067                1A334DEA16DE8B68006A8E38 /* StorageAreaMap.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = StorageAreaMap.messages.in; sourceTree = "<group>"; };
    20682068                1A334DEB16DE8F88006A8E38 /* StorageAreaMapMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StorageAreaMapMessageReceiver.cpp; path = DerivedSources/WebKit2/StorageAreaMapMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
     
    54915491                        isa = PBXGroup;
    54925492                        children = (
    5493                                 BCC56F751159955E001CCAF9 /* mac */,
     5493                                BCC56F751159955E001CCAF9 /* cocoa */,
    54945494                                1AEFD27811D16C81008219D3 /* ArgumentCoder.h */,
    54955495                                1A3D610413A7F03A00F95D4E /* ArgumentCoders.cpp */,
     
    83338333                        sourceTree = "<group>";
    83348334                };
    8335                 BCC56F751159955E001CCAF9 /* mac */ = {
    8336                         isa = PBXGroup;
    8337                         children = (
    8338                                 1A30EAC5115D7DA30053E937 /* ConnectionMac.mm */,
     8335                BCC56F751159955E001CCAF9 /* cocoa */ = {
     8336                        isa = PBXGroup;
     8337                        children = (
     8338                                1A30EAC5115D7DA30053E937 /* ConnectionCocoa.mm */,
    83398339                                1A1EC69D1872092100B951F0 /* ImportanceAssertion.h */,
    83408340                                1A6D86BF1DF75265007745E8 /* MachMessage.cpp */,
     
    83428342                                BCC56F771159957D001CCAF9 /* MachPort.h */,
    83438343                        );
    8344                         path = mac;
     8344                        path = cocoa;
    83458345                        sourceTree = "<group>";
    83468346                };
Note: See TracChangeset for help on using the changeset viewer.