Skip to content
Permalink
Browse files
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):


Canonical link: https://commits.webkit.org/196423@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pvollan committed Dec 6, 2017
1 parent 044eb09 commit 10eef4ea428362e1721a30f43a6c4ac53782b02c
Showing 9 changed files with 53 additions and 2 deletions.
@@ -1,3 +1,16 @@
2017-12-06 Per Arne Vollan <pvollan@apple.com>

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

Reviewed by Brent Fulgham.

No new tests.

* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):

2017-12-06 Antti Koivisto <antti@apple.com>

Prefer ids and classes over tag names in selector filter
@@ -30,6 +30,10 @@

void EventLoop::cycle()
{
if (![NSApp isRunning]) {
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
return;
}
[NSApp setWindowsNeedUpdate:YES];
if (NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate dateWithTimeIntervalSinceNow:0.05] inMode:NSDefaultRunLoopMode dequeue:YES])
[NSApp sendEvent:event];
@@ -1,3 +1,22 @@
2017-12-06 Per Arne Vollan <pvollan@apple.com>

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

Reviewed by Brent Fulgham.

* 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):

2017-12-06 Nan Wang <n_wang@apple.com>

AX: [iOS] Post accessibility notification when a web process changes its suspended state
@@ -586,6 +586,9 @@ void watchdogTimerFired()
static void AccessibilityProcessSuspendedNotification(bool suspended)
{
#if PLATFORM(MAC)
// Calling _AXUIElementNotifyProcessSuspendStatus will crash if the NSApplication event loop is not running.
if (![NSApp isRunning])
return;
_AXUIElementNotifyProcessSuspendStatus(suspended ? AXSuspendStatusSuspended : AXSuspendStatusRunning);
#elif PLATFORM(IOS)
UIAccessibilityPostNotification(kAXPidStatusChangedNotification, @{ @"pid" : @(getpid()), @"suspended" : @(suspended) });
@@ -70,6 +70,7 @@ class ChildProcess : protected IPC::Connection::Client, public IPC::MessageSende

#if PLATFORM(COCOA)
void setApplicationIsDaemon();
void launchServicesCheckIn();
void setQOS(int latencyQOS, int throughputQOS);
#endif

@@ -70,6 +70,11 @@ static void initializeTimerCoalescingPolicy()
OSStatus error = SetApplicationIsDaemon(true);
ASSERT_UNUSED(error, error == noErr);

launchServicesCheckIn();
}

void ChildProcess::launchServicesCheckIn()
{
_LSSetApplicationLaunchServicesServerConnectionStatus(0, 0);
RetainPtr<CFDictionaryRef> unused = _LSApplicationCheckIn(-2, CFBundleGetInfoDictionary(CFBundleGetMainBundle()));
}
@@ -77,7 +77,8 @@ static bool shouldLeakBoost(const ProcessLauncher::LaunchOptions& launchOptions)
return true;
#else
// On Mac, leak a boost onto the NetworkProcess.
return launchOptions.processType == ProcessLauncher::ProcessType::Network;
return launchOptions.processType == ProcessLauncher::ProcessType::Network
|| launchOptions.processType == ProcessLauncher::ProcessType::Web;
#endif
}

@@ -45,7 +45,7 @@
<key>ServiceType</key>
<string>Application</string>
<key>RunLoopType</key>
<string>_NSApplicationMain</string>
<string>NSRunLoop</string>
<key>_MultipleInstances</key>
<true/>
<key>_HighBitsASLR</key>
@@ -216,6 +216,11 @@ WebProcess::~WebProcess()

void WebProcess::initializeProcess(const ChildProcessInitializationParameters& parameters)
{
#if PLATFORM(COCOA) && !PLATFORM(IOS)
// This call is needed when the WebProcess is not running the NSApplication event loop.
// Otherwise, calling enableSandboxStyleFileQuarantine() will fail.
launchServicesCheckIn();
#endif
platformInitializeProcess(parameters);
}

0 comments on commit 10eef4e

Please sign in to comment.