Changeset 225597 in webkit


Ignore:
Timestamp:
Dec 6, 2017 2:24:30 PM (6 years ago)
Author:
pvollan@apple.com
Message:

The WebProcess should use the NSRunLoop runloop type.
https://bugs.webkit.org/show_bug.cgi?id=179804
<rdar://problem/14012823>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests.

  • platform/mac/EventLoopMac.mm:

(WebCore::EventLoop::cycle):

Source/WebKit:

  • Platform/IPC/mac/ConnectionMac.mm:

(IPC::AccessibilityProcessSuspendedNotification):

  • Shared/ChildProcess.h:
  • Shared/mac/ChildProcessMac.mm:

(WebKit::ChildProcess::launchServicesCheckIn):

  • UIProcess/Launcher/mac/ProcessLauncherMac.mm:

(WebKit::shouldLeakBoost):

  • WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeProcess):

Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r225596 r225597  
     12017-12-06  Per Arne Vollan  <pvollan@apple.com>
     2
     3        The WebProcess should use the NSRunLoop runloop type.
     4        https://bugs.webkit.org/show_bug.cgi?id=179804
     5        <rdar://problem/14012823>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        No new tests.
     10
     11        * platform/mac/EventLoopMac.mm:
     12        (WebCore::EventLoop::cycle):
     13
    1142017-12-06  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebCore/platform/mac/EventLoopMac.mm

    r222940 r225597  
    3131void EventLoop::cycle()
    3232{
     33    if (![NSApp isRunning]) {
     34        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
     35        return;
     36    }
    3337    [NSApp setWindowsNeedUpdate:YES];
    3438    if (NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate dateWithTimeIntervalSinceNow:0.05] inMode:NSDefaultRunLoopMode dequeue:YES])
  • trunk/Source/WebKit/ChangeLog

    r225592 r225597  
     12017-12-06  Per Arne Vollan  <pvollan@apple.com>
     2
     3        The WebProcess should use the NSRunLoop runloop type.
     4        https://bugs.webkit.org/show_bug.cgi?id=179804
     5        <rdar://problem/14012823>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * Platform/IPC/mac/ConnectionMac.mm:
     10        (IPC::AccessibilityProcessSuspendedNotification):
     11        * Shared/ChildProcess.h:
     12        * Shared/mac/ChildProcessMac.mm:
     13        (WebKit::ChildProcess::launchServicesCheckIn):
     14        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
     15        (WebKit::shouldLeakBoost):
     16        * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
     17        * WebProcess/WebProcess.cpp:
     18        (WebKit::WebProcess::initializeProcess):
     19
    1202017-12-06  Nan Wang  <n_wang@apple.com>
    221
  • trunk/Source/WebKit/Platform/IPC/mac/ConnectionMac.mm

    r224728 r225597  
    587587{
    588588#if PLATFORM(MAC)
     589    // Calling _AXUIElementNotifyProcessSuspendStatus will crash if the NSApplication event loop is not running.
     590    if (![NSApp isRunning])
     591        return;
    589592    _AXUIElementNotifyProcessSuspendStatus(suspended ? AXSuspendStatusSuspended : AXSuspendStatusRunning);
    590593#elif PLATFORM(IOS)
  • trunk/Source/WebKit/Shared/ChildProcess.h

    r219050 r225597  
    7171#if PLATFORM(COCOA)
    7272    void setApplicationIsDaemon();
     73    void launchServicesCheckIn();
    7374    void setQOS(int latencyQOS, int throughputQOS);
    7475#endif
  • trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm

    r224371 r225597  
    7171    ASSERT_UNUSED(error, error == noErr);
    7272
     73    launchServicesCheckIn();
     74}
     75
     76void ChildProcess::launchServicesCheckIn()
     77{
    7378    _LSSetApplicationLaunchServicesServerConnectionStatus(0, 0);
    7479    RetainPtr<CFDictionaryRef> unused = _LSApplicationCheckIn(-2, CFBundleGetInfoDictionary(CFBundleGetMainBundle()));
  • trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm

    r225087 r225597  
    7878#else
    7979    // On Mac, leak a boost onto the NetworkProcess.
    80     return launchOptions.processType == ProcessLauncher::ProcessType::Network;
     80    return launchOptions.processType == ProcessLauncher::ProcessType::Network
     81        || launchOptions.processType == ProcessLauncher::ProcessType::Web;
    8182#endif
    8283}
  • trunk/Source/WebKit/WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist

    r219002 r225597  
    4646                <string>Application</string>
    4747                <key>RunLoopType</key>
    48                 <string>_NSApplicationMain</string>
     48                <string>NSRunLoop</string>
    4949                <key>_MultipleInstances</key>
    5050                <true/>
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r225592 r225597  
    217217void WebProcess::initializeProcess(const ChildProcessInitializationParameters& parameters)
    218218{
     219#if PLATFORM(COCOA) && !PLATFORM(IOS)
     220    // This call is needed when the WebProcess is not running the NSApplication event loop.
     221    // Otherwise, calling enableSandboxStyleFileQuarantine() will fail.
     222    launchServicesCheckIn();
     223#endif
    219224    platformInitializeProcess(parameters);
    220225}
Note: See TracChangeset for help on using the changeset viewer.